4a91606b78cec8b0341de5cda3037f53.json
29.6 KB
{"ast":null,"code":"'use strict';var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _AnimatedNode=_interopRequireDefault(require(\"./AnimatedNode\"));var _AnimatedWithChildren2=_interopRequireDefault(require(\"./AnimatedWithChildren\"));var _NativeAnimatedHelper=_interopRequireDefault(require(\"../NativeAnimatedHelper\"));var _invariant=_interopRequireDefault(require(\"fbjs/lib/invariant\"));var _normalizeCssColor=_interopRequireDefault(require(\"normalize-css-color\"));function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var linear=function linear(t){return t;};function createInterpolation(config){if(config.outputRange&&typeof config.outputRange[0]==='string'){return createInterpolationFromStringOutputRange(config);}var outputRange=config.outputRange;checkInfiniteRange('outputRange',outputRange);var inputRange=config.inputRange;checkInfiniteRange('inputRange',inputRange);checkValidInputRange(inputRange);(0,_invariant.default)(inputRange.length===outputRange.length,'inputRange ('+inputRange.length+') and outputRange ('+outputRange.length+') must have the same length');var easing=config.easing||linear;var extrapolateLeft='extend';if(config.extrapolateLeft!==undefined){extrapolateLeft=config.extrapolateLeft;}else if(config.extrapolate!==undefined){extrapolateLeft=config.extrapolate;}var extrapolateRight='extend';if(config.extrapolateRight!==undefined){extrapolateRight=config.extrapolateRight;}else if(config.extrapolate!==undefined){extrapolateRight=config.extrapolate;}return function(input){(0,_invariant.default)(typeof input==='number','Cannot interpolation an input which is not a number');var range=findRange(input,inputRange);return interpolate(input,inputRange[range],inputRange[range+1],outputRange[range],outputRange[range+1],easing,extrapolateLeft,extrapolateRight);};}function interpolate(input,inputMin,inputMax,outputMin,outputMax,easing,extrapolateLeft,extrapolateRight){var result=input;if(result<inputMin){if(extrapolateLeft==='identity'){return result;}else if(extrapolateLeft==='clamp'){result=inputMin;}else if(extrapolateLeft==='extend'){}}if(result>inputMax){if(extrapolateRight==='identity'){return result;}else if(extrapolateRight==='clamp'){result=inputMax;}else if(extrapolateRight==='extend'){}}if(outputMin===outputMax){return outputMin;}if(inputMin===inputMax){if(input<=inputMin){return outputMin;}return outputMax;}if(inputMin===-Infinity){result=-result;}else if(inputMax===Infinity){result=result-inputMin;}else{result=(result-inputMin)/(inputMax-inputMin);}result=easing(result);if(outputMin===-Infinity){result=-result;}else if(outputMax===Infinity){result=result+outputMin;}else{result=result*(outputMax-outputMin)+outputMin;}return result;}function colorToRgba(input){var int32Color=(0,_normalizeCssColor.default)(input);if(int32Color===null){return input;}int32Color=int32Color||0;var r=(int32Color&0xff000000)>>>24;var g=(int32Color&0x00ff0000)>>>16;var b=(int32Color&0x0000ff00)>>>8;var a=(int32Color&0x000000ff)/255;return\"rgba(\"+r+\", \"+g+\", \"+b+\", \"+a+\")\";}var stringShapeRegex=/[0-9\\.-]+/g;function createInterpolationFromStringOutputRange(config){var outputRange=config.outputRange;(0,_invariant.default)(outputRange.length>=2,'Bad output range');outputRange=outputRange.map(colorToRgba);checkPattern(outputRange);var outputRanges=outputRange[0].match(stringShapeRegex).map(function(){return[];});outputRange.forEach(function(value){value.match(stringShapeRegex).forEach(function(number,i){outputRanges[i].push(+number);});});var interpolations=outputRange[0].match(stringShapeRegex).map(function(value,i){return createInterpolation(_objectSpread({},config,{outputRange:outputRanges[i]}));});var shouldRound=isRgbOrRgba(outputRange[0]);return function(input){var i=0;return outputRange[0].replace(stringShapeRegex,function(){var val=+interpolations[i++](input);var rounded=shouldRound&&i<4?Math.round(val):Math.round(val*1000)/1000;return String(rounded);});};}function isRgbOrRgba(range){return typeof range==='string'&&range.startsWith('rgb');}function checkPattern(arr){var pattern=arr[0].replace(stringShapeRegex,'');for(var i=1;i<arr.length;++i){(0,_invariant.default)(pattern===arr[i].replace(stringShapeRegex,''),'invalid pattern '+arr[0]+' and '+arr[i]);}}function findRange(input,inputRange){var i;for(i=1;i<inputRange.length-1;++i){if(inputRange[i]>=input){break;}}return i-1;}function checkValidInputRange(arr){(0,_invariant.default)(arr.length>=2,'inputRange must have at least 2 elements');for(var i=1;i<arr.length;++i){(0,_invariant.default)(arr[i]>=arr[i-1],'inputRange must be monotonically increasing '+arr);}}function checkInfiniteRange(name,arr){(0,_invariant.default)(arr.length>=2,name+' must have at least 2 elements');(0,_invariant.default)(arr.length!==2||arr[0]!==-Infinity||arr[1]!==Infinity,name+'cannot be ]-infinity;+infinity[ '+arr);}var AnimatedInterpolation=function(_AnimatedWithChildren){_inheritsLoose(AnimatedInterpolation,_AnimatedWithChildren);function AnimatedInterpolation(parent,config){var _this;_this=_AnimatedWithChildren.call(this)||this;_this._parent=parent;_this._config=config;_this._interpolation=createInterpolation(config);return _this;}var _proto=AnimatedInterpolation.prototype;_proto.__makeNative=function __makeNative(){this._parent.__makeNative();_AnimatedWithChildren.prototype.__makeNative.call(this);};_proto.__getValue=function __getValue(){var parentValue=this._parent.__getValue();(0,_invariant.default)(typeof parentValue==='number','Cannot interpolate an input which is not a number.');return this._interpolation(parentValue);};_proto.interpolate=function interpolate(config){return new AnimatedInterpolation(this,config);};_proto.__attach=function __attach(){this._parent.__addChild(this);};_proto.__detach=function __detach(){this._parent.__removeChild(this);_AnimatedWithChildren.prototype.__detach.call(this);};_proto.__transformDataType=function __transformDataType(range){return range.map(function(value){if(typeof value!=='string'){return value;}if(/deg$/.test(value)){var degrees=parseFloat(value)||0;var radians=degrees*Math.PI/180.0;return radians;}else{return parseFloat(value)||0;}});};_proto.__getNativeConfig=function __getNativeConfig(){if(process.env.NODE_ENV!=='production'){_NativeAnimatedHelper.default.validateInterpolation(this._config);}return{inputRange:this._config.inputRange,outputRange:this.__transformDataType(this._config.outputRange),extrapolateLeft:this._config.extrapolateLeft||this._config.extrapolate||'extend',extrapolateRight:this._config.extrapolateRight||this._config.extrapolate||'extend',type:'interpolation'};};return AnimatedInterpolation;}(_AnimatedWithChildren2.default);AnimatedInterpolation.__createInterpolation=createInterpolation;var _default=AnimatedInterpolation;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedInterpolation.js"],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","__proto__","_objectSpread","target","i","arguments","length","source","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","key","_defineProperty","obj","value","defineProperty","configurable","writable","linear","t","createInterpolation","config","outputRange","createInterpolationFromStringOutputRange","checkInfiniteRange","inputRange","checkValidInputRange","easing","extrapolateLeft","undefined","extrapolate","extrapolateRight","input","range","findRange","interpolate","inputMin","inputMax","outputMin","outputMax","result","Infinity","colorToRgba","int32Color","r","g","b","a","stringShapeRegex","map","checkPattern","outputRanges","match","number","push","interpolations","shouldRound","isRgbOrRgba","replace","val","rounded","Math","round","String","startsWith","arr","pattern","name","AnimatedInterpolation","_AnimatedWithChildren","parent","_this","call","_parent","_config","_interpolation","_proto","__makeNative","__getValue","parentValue","__attach","__addChild","__detach","__removeChild","__transformDataType","test","degrees","parseFloat","radians","PI","__getNativeConfig","process","env","NODE_ENV","NativeAnimatedHelper","validateInterpolation","type","AnimatedWithChildren","__createInterpolation"],"mappings":"AAWA,a,mKAQA,oEACA,qFACA,qFACA,qEACA,8EAVA,QAASA,CAAAA,cAAT,CAAwBC,QAAxB,CAAkCC,UAAlC,CAA8C,CAAED,QAAQ,CAACE,SAAT,CAAqBC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AMLkE,IAAI,CAAE,eAND,CAAP,CAQD,CAbD,CAeA,MAAO5B,CAAAA,qBAAP,CACD,CA9ED,CA8EE6B,8BA9EF,CAFA,CAkFA7B,qBAAqB,CAAC8B,qBAAtB,CAA8C9E,mBAA9C,C,aACegD,qB","sourcesContent":["/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n/* eslint no-bitwise: 0 */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport invariant from 'fbjs/lib/invariant';\nimport normalizeColor from 'normalize-css-color';\n\nvar linear = function linear(t) {\n return t;\n};\n/**\n * Very handy helper to map input ranges to output ranges with an easing\n * function and custom behavior outside of the ranges.\n */\n\n\nfunction createInterpolation(config) {\n if (config.outputRange && typeof config.outputRange[0] === 'string') {\n return createInterpolationFromStringOutputRange(config);\n }\n\n var outputRange = config.outputRange;\n checkInfiniteRange('outputRange', outputRange);\n var inputRange = config.inputRange;\n checkInfiniteRange('inputRange', inputRange);\n checkValidInputRange(inputRange);\n invariant(inputRange.length === outputRange.length, 'inputRange (' + inputRange.length + ') and outputRange (' + outputRange.length + ') must have the same length');\n var easing = config.easing || linear;\n var extrapolateLeft = 'extend';\n\n if (config.extrapolateLeft !== undefined) {\n extrapolateLeft = config.extrapolateLeft;\n } else if (config.extrapolate !== undefined) {\n extrapolateLeft = config.extrapolate;\n }\n\n var extrapolateRight = 'extend';\n\n if (config.extrapolateRight !== undefined) {\n extrapolateRight = config.extrapolateRight;\n } else if (config.extrapolate !== undefined) {\n extrapolateRight = config.extrapolate;\n }\n\n return function (input) {\n invariant(typeof input === 'number', 'Cannot interpolation an input which is not a number');\n var range = findRange(input, inputRange);\n return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight);\n };\n}\n\nfunction interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) {\n var result = input; // Extrapolate\n\n if (result < inputMin) {\n if (extrapolateLeft === 'identity') {\n return result;\n } else if (extrapolateLeft === 'clamp') {\n result = inputMin;\n } else if (extrapolateLeft === 'extend') {// noop\n }\n }\n\n if (result > inputMax) {\n if (extrapolateRight === 'identity') {\n return result;\n } else if (extrapolateRight === 'clamp') {\n result = inputMax;\n } else if (extrapolateRight === 'extend') {// noop\n }\n }\n\n if (outputMin === outputMax) {\n return outputMin;\n }\n\n if (inputMin === inputMax) {\n if (input <= inputMin) {\n return outputMin;\n }\n\n return outputMax;\n } // Input Range\n\n\n if (inputMin === -Infinity) {\n result = -result;\n } else if (inputMax === Infinity) {\n result = result - inputMin;\n } else {\n result = (result - inputMin) / (inputMax - inputMin);\n } // Easing\n\n\n result = easing(result); // Output Range\n\n if (outputMin === -Infinity) {\n result = -result;\n } else if (outputMax === Infinity) {\n result = result + outputMin;\n } else {\n result = result * (outputMax - outputMin) + outputMin;\n }\n\n return result;\n}\n\nfunction colorToRgba(input) {\n var int32Color = normalizeColor(input);\n\n if (int32Color === null) {\n return input;\n }\n\n int32Color = int32Color || 0;\n var r = (int32Color & 0xff000000) >>> 24;\n var g = (int32Color & 0x00ff0000) >>> 16;\n var b = (int32Color & 0x0000ff00) >>> 8;\n var a = (int32Color & 0x000000ff) / 255;\n return \"rgba(\" + r + \", \" + g + \", \" + b + \", \" + a + \")\";\n}\n\nvar stringShapeRegex = /[0-9\\.-]+/g;\n/**\n * Supports string shapes by extracting numbers so new values can be computed,\n * and recombines those values into new strings of the same shape. Supports\n * things like:\n *\n * rgba(123, 42, 99, 0.36) // colors\n * -45deg // values with units\n */\n\nfunction createInterpolationFromStringOutputRange(config) {\n var outputRange = config.outputRange;\n invariant(outputRange.length >= 2, 'Bad output range');\n outputRange = outputRange.map(colorToRgba);\n checkPattern(outputRange); // ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.5)']\n // ->\n // [\n // [0, 50],\n // [100, 150],\n // [200, 250],\n // [0, 0.5],\n // ]\n\n /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to\n * guard against this possibility.\n */\n\n var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {\n return [];\n });\n outputRange.forEach(function (value) {\n /* $FlowFixMe(>=0.18.0): `value.match()` can return `null`. Need to guard\n * against this possibility.\n */\n value.match(stringShapeRegex).forEach(function (number, i) {\n outputRanges[i].push(+number);\n });\n });\n /* $FlowFixMe(>=0.18.0): `outputRange[0].match()` can return `null`. Need to\n * guard against this possibility.\n */\n\n var interpolations = outputRange[0].match(stringShapeRegex).map(function (value, i) {\n return createInterpolation(_objectSpread({}, config, {\n outputRange: outputRanges[i]\n }));\n }); // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to\n // round the opacity (4th column).\n\n var shouldRound = isRgbOrRgba(outputRange[0]);\n return function (input) {\n var i = 0; // 'rgba(0, 100, 200, 0)'\n // ->\n // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'\n\n return outputRange[0].replace(stringShapeRegex, function () {\n var val = +interpolations[i++](input);\n var rounded = shouldRound && i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000;\n return String(rounded);\n });\n };\n}\n\nfunction isRgbOrRgba(range) {\n return typeof range === 'string' && range.startsWith('rgb');\n}\n\nfunction checkPattern(arr) {\n var pattern = arr[0].replace(stringShapeRegex, '');\n\n for (var i = 1; i < arr.length; ++i) {\n invariant(pattern === arr[i].replace(stringShapeRegex, ''), 'invalid pattern ' + arr[0] + ' and ' + arr[i]);\n }\n}\n\nfunction findRange(input, inputRange) {\n var i;\n\n for (i = 1; i < inputRange.length - 1; ++i) {\n if (inputRange[i] >= input) {\n break;\n }\n }\n\n return i - 1;\n}\n\nfunction checkValidInputRange(arr) {\n invariant(arr.length >= 2, 'inputRange must have at least 2 elements');\n\n for (var i = 1; i < arr.length; ++i) {\n invariant(arr[i] >= arr[i - 1],\n /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment,\n * one or both of the operands may be something that doesn't cleanly\n * convert to a string, like undefined, null, and object, etc. If you really\n * mean this implicit string conversion, you can do something like\n * String(myThing)\n */\n 'inputRange must be monotonically increasing ' + arr);\n }\n}\n\nfunction checkInfiniteRange(name, arr) {\n invariant(arr.length >= 2, name + ' must have at least 2 elements');\n invariant(arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity,\n /* $FlowFixMe(>=0.13.0) - In the addition expression below this comment,\n * one or both of the operands may be something that doesn't cleanly convert\n * to a string, like undefined, null, and object, etc. If you really mean\n * this implicit string conversion, you can do something like\n * String(myThing)\n */\n name + 'cannot be ]-infinity;+infinity[ ' + arr);\n}\n\nvar AnimatedInterpolation =\n/*#__PURE__*/\nfunction (_AnimatedWithChildren) {\n _inheritsLoose(AnimatedInterpolation, _AnimatedWithChildren);\n\n // Export for testing.\n function AnimatedInterpolation(parent, config) {\n var _this;\n\n _this = _AnimatedWithChildren.call(this) || this;\n _this._parent = parent;\n _this._config = config;\n _this._interpolation = createInterpolation(config);\n return _this;\n }\n\n var _proto = AnimatedInterpolation.prototype;\n\n _proto.__makeNative = function __makeNative() {\n this._parent.__makeNative();\n\n _AnimatedWithChildren.prototype.__makeNative.call(this);\n };\n\n _proto.__getValue = function __getValue() {\n var parentValue = this._parent.__getValue();\n\n invariant(typeof parentValue === 'number', 'Cannot interpolate an input which is not a number.');\n return this._interpolation(parentValue);\n };\n\n _proto.interpolate = function interpolate(config) {\n return new AnimatedInterpolation(this, config);\n };\n\n _proto.__attach = function __attach() {\n this._parent.__addChild(this);\n };\n\n _proto.__detach = function __detach() {\n this._parent.__removeChild(this);\n\n _AnimatedWithChildren.prototype.__detach.call(this);\n };\n\n _proto.__transformDataType = function __transformDataType(range) {\n // Change the string array type to number array\n // So we can reuse the same logic in iOS and Android platform\n return range.map(function (value) {\n if (typeof value !== 'string') {\n return value;\n }\n\n if (/deg$/.test(value)) {\n var degrees = parseFloat(value) || 0;\n var radians = degrees * Math.PI / 180.0;\n return radians;\n } else {\n // Assume radians\n return parseFloat(value) || 0;\n }\n });\n };\n\n _proto.__getNativeConfig = function __getNativeConfig() {\n if (process.env.NODE_ENV !== 'production') {\n NativeAnimatedHelper.validateInterpolation(this._config);\n }\n\n return {\n inputRange: this._config.inputRange,\n // Only the `outputRange` can contain strings so we don't need to transform `inputRange` here\n outputRange: this.__transformDataType(this._config.outputRange),\n extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend',\n extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend',\n type: 'interpolation'\n };\n };\n\n return AnimatedInterpolation;\n}(AnimatedWithChildren);\n\nAnimatedInterpolation.__createInterpolation = createInterpolation;\nexport default AnimatedInterpolation;"]},"metadata":{},"sourceType":"script"}