{"version":3,"sources":["jsdelivr-header.js","/npm/react-native-easing-gradient@1.1.1/lib/commonjs/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,sGCNA,IAAA,aAAA,QAAA,gBACA,qBAAA,QAAA,0BAeA,MAAM,UAAY,oBAAO,OAAO,IAAM,EAAG,IAAM,GAE/C,SAAS,cAAa,WAAE,EAAF,OAAc,EAAS,UAAvB,6BAAkC,EAA+B,KACrF,MAAM,EAAmB,GACnB,EAAsB,GAEtB,EAAmB,OAAO,KAAK,GAClC,KAAK,GAAQ,OAAO,KACpB,OAEG,EAAkB,EAAiB,OAEzC,IACE,IAAI,EAAmB,EACvB,EAAmB,EAAkB,EACrC,IACA,KAAA,EACA,MAAM,EAAgB,EAAiB,GACjC,EAAc,EAAiB,EAAmB,GAElD,EAAa,EAAW,GAAe,MACvC,EAAW,EAAW,GAAa,MACnC,EAAa,QAAA,EAAG,EAAW,GAAe,cAA7B,IAAA,IAAuC,EAEpD,GAAa,EAAA,qBAAA,qBAAoB,CACrC,WAAY,CAAC,EAAG,GAChB,YAAa,CAAC,EAAY,GAC1B,OAAQ,IAGJ,EAA0B,EAAc,EACxC,EAAW,GAAK,EAA+B,GAErD,IACE,IAAI,EAAY,EAChB,GAAa,EAA+B,EAC5C,IACA,CACA,MAAM,EAAW,EAAY,EACvB,EAAQ,EAAW,GACzB,EAAO,KAAK,GACZ,EAAU,KAAK,EAAgB,EAA0B,EAC1D,CACF,CAED,MAAO,CAAE,SAAQ,YAClB","file":"/npm/react-native-easing-gradient@1.1.1/lib/commonjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-native-easing-gradient@1.1.1/lib/commonjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { Easing, EasingFunction } from 'react-native'\nimport { createInterpolation } from './create-interpolation'\n\ninterface ColorStops {\n  [location: number]: {\n    color: string\n    easing?: EasingFunction\n  }\n}\n\ninterface GradientParams {\n  colorStops: ColorStops\n  extraColorStopsPerTransition?: number\n  easing?: EasingFunction\n}\n\nconst easeInOut = Easing.bezier(0.42, 0, 0.58, 1)\n\nfunction easeGradient({ colorStops, easing = easeInOut, extraColorStopsPerTransition = 12 }: GradientParams) {\n  const colors: string[] = []\n  const locations: number[] = []\n\n  const initialLocations = Object.keys(colorStops)\n    .map((key) => Number(key))\n    .sort()\n\n  const totalColorStops = initialLocations.length\n\n  for (\n    let currentStopIndex = 0;\n    currentStopIndex < totalColorStops - 1;\n    currentStopIndex++\n  ) {\n    const startLocation = initialLocations[currentStopIndex]\n    const endLocation = initialLocations[currentStopIndex + 1]\n\n    const startColor = colorStops[startLocation].color\n    const endColor = colorStops[endLocation].color\n    const currentEasing = colorStops[startLocation].easing ?? easing\n\n    const colorScale = createInterpolation({\n      inputRange: [0, 1],\n      outputRange: [startColor, endColor],\n      easing: currentEasing,\n    })\n\n    const currentTransitionLength = endLocation - startLocation\n    const stepSize = 1 / (extraColorStopsPerTransition + 1)\n\n    for (\n      let stepIndex = 0;\n      stepIndex <= extraColorStopsPerTransition + 1;\n      stepIndex++\n    ) {\n      const progress = stepIndex * stepSize\n      const color = colorScale(progress)\n      colors.push(color)\n      locations.push(startLocation + currentTransitionLength * progress)\n    }\n  }\n\n  return { colors, locations }\n}\n\nexport { easeGradient }\n"]}