{"version":3,"sources":["webpack:///./node_modules/@motionone/types/dist/MotionValue.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/data.es.js","webpack:///./node_modules/@motionone/utils/dist/noop.es.js","webpack:///./node_modules/@motionone/utils/dist/array.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/transforms.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/css-var.es.js","webpack:///./node_modules/@motionone/utils/dist/defaults.es.js","webpack:///./node_modules/@motionone/utils/dist/is-easing-generator.es.js","webpack:///./node_modules/@motionone/utils/dist/is-function.es.js","webpack:///./node_modules/@motionone/utils/dist/is-number.es.js","webpack:///./node_modules/@motionone/utils/dist/is-easing-list.es.js","webpack:///./node_modules/@motionone/utils/dist/time.es.js","webpack:///./node_modules/@motionone/utils/dist/progress.es.js","webpack:///./node_modules/@motionone/utils/dist/is-cubic-bezier.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/easing.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/style.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js","webpack:///./node_modules/@motionone/utils/dist/is-string.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/get-unit.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/animate-style.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/options.es.js","webpack:///./node_modules/@motionone/dom/dist/utils/resolve-elements.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/controls.es.js","webpack:///./node_modules/@motionone/easing/dist/cubic-bezier.es.js","webpack:///./node_modules/@motionone/utils/dist/clamp.es.js","webpack:///./node_modules/@motionone/animation/dist/utils/easing.es.js","webpack:///./node_modules/@motionone/easing/dist/steps.es.js","webpack:///./node_modules/@motionone/dom/dist/utils/stagger.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/create-animate.es.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/@motionone/utils/dist/mix.es.js","webpack:///./node_modules/@motionone/utils/dist/offset.es.js","webpack:///./node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js","webpack:///./node_modules/@motionone/utils/dist/easing.es.js","webpack:///./node_modules/@motionone/utils/dist/wrap.es.js","webpack:///./node_modules/@motionone/dom/dist/timeline/utils/edit.es.js","webpack:///./node_modules/@motionone/dom/dist/timeline/utils/sort.es.js","webpack:///./node_modules/@motionone/utils/dist/interpolate.es.js","webpack:///./node_modules/@motionone/animation/dist/Animation.es.js","webpack:///./node_modules/@motionone/dom/dist/timeline/index.es.js","webpack:///./node_modules/@motionone/generators/dist/spring/defaults.es.js","webpack:///./node_modules/@motionone/utils/dist/velocity.es.js","webpack:///./node_modules/@motionone/generators/dist/utils/velocity.es.js","webpack:///./node_modules/@motionone/generators/dist/spring/index.es.js","webpack:///./node_modules/@motionone/generators/dist/spring/utils.es.js","webpack:///./node_modules/@motionone/generators/dist/utils/has-reached-target.es.js","webpack:///./node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js","webpack:///./node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js","webpack:///./node_modules/@motionone/dom/dist/easing/spring/index.es.js","webpack:///./node_modules/@motionone/dom/dist/easing/glide/index.es.js","webpack:///./node_modules/@motionone/generators/dist/glide/index.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/in-view.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/resize/index.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/info.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js","webpack:///./node_modules/@motionone/dom/dist/gestures/scroll/index.es.js","webpack:///./node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js","webpack:///./node_modules/@motionone/dom/dist/state/utils/is-variant.es.js","webpack:///./node_modules/@motionone/dom/dist/state/utils/schedule.es.js","webpack:///./node_modules/@motionone/dom/dist/state/utils/events.es.js","webpack:///./node_modules/@motionone/dom/dist/state/gestures/in-view.es.js","webpack:///./node_modules/@motionone/dom/dist/state/gestures/hover.es.js","webpack:///./node_modules/@motionone/dom/dist/state/index.es.js","webpack:///./node_modules/@motionone/dom/dist/state/gestures/press.es.js","webpack:///./node_modules/@motionone/dom/dist/state/utils/has-changed.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/style-object.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/utils/style-string.es.js","webpack:///./node_modules/@motionone/dom/dist/animate/index.es.js","webpack:///./node_modules/motion/dist/animate.es.js","webpack:///./node_modules/motion/dist/main.es.js"],"names":["MotionValue","animation","this","finished","then","clearAnimation","catch","generator","undefined","WeakMap","getAnimationData","element","has","set","transforms","values","Map","get","noop","noopReturn","v","addUniqueItem","array","item","indexOf","push","removeItem","arr","index","splice","axes","transformAlias","x","y","z","rotation","syntax","initialValue","toDefaultUnit","baseTransformProperties","translate","rotate","scale","skew","transformDefinitions","asTransformCssVar","name","forEach","axis","compareTransformOrder","a","b","transformLookup","Set","isTransform","buildTransformTemplate","sort","reduce","transformListToString","trim","template","isCssVar","startsWith","registeredProperties","defaults","duration","delay","endDelay","repeat","easing","isEasingGenerator","Boolean","createAnimation","isFunction","value","isNumber","isEasingList","Array","isArray","seconds","milliseconds","min","max","isCubicBezier","testAnimation","keyframes","options","document","createElement","animate","featureTests","cssRegisterProperty","CSS","Object","hasOwnProperty","call","waapi","Element","prototype","partialKeyframes","opacity","e","linearEasing","results","supports","key","convertEasing","points","numPoints","Math","round","i","substring","length","generateLinearEasingPoints","cubicBezierAsString","c","d","keyframesList","getStyleName","style","getPropertyValue","getComputedStyle","definition","setProperty","stopAnimation","needsCommit","playState","stop","commitStyles","cancel","isString","getUnitConverter","_a","toUnit","finalKeyframe","unit","match","animateStyle","keyframesDefinition","AnimationPolyfill","record","window","__MOTION_DEV_TOOLS_RECORD","isRecording","persist","direction","offset","allowWebkitAcceleration","data","valueIsTransform","canAnimateNatively","transform","addTransformToElement","motionValue","motionValues","getMotionValue","readInitialValue","_b","hydrateKeyframes","custom","add","registerProperty","inherits","registerCssVariable","some","map","unshift","animationOptions","iterations","fill","thisEasing","Promise","resolve","reject","onfinish","oncancel","target","playbackRate","parseFloat","latest","assign","setAnimation","getOptions","resolveElements","elements","selectorCache","querySelectorAll","from","factory","withControls","animationFactory","Proxy","animations","filter","activeAnimation","all","selectFinished","callback","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","lowerBound","upperBound","currentX","currentT","abs","binarySubdivide","clamp","namedEasings","ease","functionArgsRegex","getEasingFunction","args","exec","argsArray","split","steps","progress","expanded","rounded","floor","ceil","stagger","start","total","fromIndex","lastIndex","getFromIndex","distance","maxDelay","easingFunction","resolveOption","option","createAnimate","AnimatePolyfill","numElements","animationFactories","valueOptions","__rest","s","p","getOwnPropertySymbols","propertyIsEnumerable","create","SuppressedError","mix","fillOffset","remaining","offsetProgress","defaultOffset","calcNextTime","current","next","prev","labels","getEasingForSegment","rangeSize","wrap","addKeyframes","sequence","startTime","endTime","keyframe","at","eraseKeyframes","compareByTime","interpolate","output","input","remainder","progressInRange","segmentEasing","initialDuration","rate","cancelTimestamp","totalDuration","updateDuration","interpolate$1","tick","timestamp","pauseTime","currentIteration","iterationProgress","iterationIsOdd","frameRequestId","requestAnimationFrame","play","now","performance","cancelAnimationFrame","timeline","animationDefinitions","defaultOptions","timelineOptions","elementSequences","elementCache","timeLabels","prevTime","currentTime","segment","elementDefinition","maxDuration","elementIndex","elementSequence","getElementSequence","valueSequence","getValueSequence","valueKeyframes","targetTime","valueSequences","valueOffset","valueEasing","createAnimationsFromTimeline","sequences","velocityPerSecond","velocity","frameDuration","calcGeneratorVelocity","resolveValue","prevT","spring","stiffness","damping","mass","to","restSpeed","restDistance","state","done","hasReachedTarget","initialDelta","undampedAngularFreq","sqrt","dampingRatio","calcDampingRatio","resolveSpring","angularFreq","exp","sin","cos","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","origin","canGenerate","isNaN","getAsNumber","createGeneratorEasing","createGenerator","keyframesCache","generatorCache","getGenerator","isScale","getKeyframes","overshootDuration","pregenerateKeyframes","shouldGenerate","getOrigin","settings","numKeyframes","prevGenerator","generatorStartTime","prevGeneratorCurrent","includes","power","decay","bounceDamping","bounceStiffness","changeTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","delta","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","thresholds","any","inView","elementOrSelector","onStart","root","margin","rootMargin","amount","IntersectionObserver","activeIntersections","observer","entries","entry","onEnd","isIntersecting","newOnEnd","unobserve","delete","threshold","observe","disconnect","resizeHandlers","notifyTarget","contentRect","borderBoxSize","handler","contentSize","inlineSize","blockSize","width","height","SVGElement","getBBox","offsetWidth","offsetHeight","getElementSize","notifyAll","resizeElement","ResizeObserver","elementHandlers","size","windowCallbacks","windowResizeHandler","resizeWindow","innerWidth","innerHeight","info","addEventListener","resize","keys","position","updateAxisInfo","axisName","time","scrollLength","elapsed","ScrollOffset","Enter","Exit","Any","All","namedEdges","center","end","resolveEdge","edge","inset","asNumber","endsWith","documentElement","clientWidth","clientHeight","resolveOffset","containerLength","targetLength","targetInset","offsetDefinition","targetPoint","containerPoint","point","resolveOffsets","container","lengthLabel","HTMLElement","offsetLeft","offsetTop","offsetParent","SVGGraphicsElement","top","left","tagName","parentNode","calcInset","targetSize","scrollWidth","scrollHeight","containerSize","hasChanged","numOffsets","interpolatorOffsets","createOnScrollHandler","onScroll","measure","targetOffset","node","update","updateScrollInfo","notify","scrubAnimation","controls","axisInfo","pause","forEachNative","timingOptions","effect","updateTiming","scrollListeners","resizeListeners","onScrollHandlers","getEventTarget","containerHandlers","containerHandler","listener","passive","onLoadProcesss","removeEventListener","resolveVariant","variants","isVariant","scheduled","processScheduledAnimations","generators","compareByDepth","fireAnimateUpdates","fireNext","scheduleAnimation","getDepth","animateUpdates","iterator","motionEvent","CustomEvent","detail","dispatchPointerEvent","event","dispatchEvent","originalEvent","dispatchViewEvent","originalEntry","mouseEvent","action","pointerType","gestures","isActive","subscribe","enable","disable","inViewOptions","once","viewOptions","enterEntry","leaveEntry","hover","onEnter","onLeave","press","onPointerUp","onPointerDown","stateTypes","mountedStates","createMotionState","parent","depth","activeStates","initial","gestureSubscriptions","context","getContext","initialVariantSource","baseTarget","setGesture","updateGestureSubscriptions","isGestureActive","remove","newOptions","setActive","prevTarget","variant","transition","allTargetKeys","prevLength","shallowCompare","animationTarget","getTarget","mount","newElement","unscheduleAnimation","isMounted","createStyles","initialKeyframes","transformKeys","initialKeyframe","camelLetterToPipeLetter","letter","toLowerCase","createStyleString","styles","replace","animateProgress","keyframesOrOptions"],"mappings":"iGAMA,MAAMA,EACF,aAAaC,GACTC,KAAKD,UAAYA,EACjBA,SAAsDA,EAAUE,SAASC,KAAK,IAAMF,KAAKG,kBAAkBC,MAAM,QAErH,iBACIJ,KAAKD,UAAYC,KAAKK,eAAYC,GCV1C,MAAM,EAAO,IAAIC,QACjB,SAASC,EAAiBC,GAOtB,OANK,EAAKC,IAAID,IACV,EAAKE,IAAIF,EAAS,CACdG,WAAY,GACZC,OAAQ,IAAIC,MAGb,EAAKC,IAAIN,GCVpB,MAAMO,EAAO,OACPC,EAAcC,GAAMA,ECD1B,SAASC,EAAcC,EAAOC,IACD,I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oB,GACpBnD,EAAYmD,KACR1E,EAAe0E,KACfA,EAAM1E,EAAe0E,IACzBoe,EAAcpjB,KAAKgF,GACnBA,EAAM5D,EAAkB4D,IAE5B,IAAIqe,EAAkBjgB,MAAMC,QAAQJ,GAASA,EAAM,GAAKA,EAKxD,MAAMiD,EAAa/E,EAAqB3B,IAAIwF,GACxCkB,IACAmd,EAAkBngB,EAASD,GACrBiD,EAAWrF,cAAcoC,GACzBA,GAEVkgB,EAAiBne,GAAOqe,EAK5B,OAHID,EAAc5d,SACd2d,EAAiBpb,UAAYjG,EAAuBshB,IAEjDD,EC5BX,MAAMG,GAA2BC,GAAW,IAAIA,EAAOC,cAEvD,SAASC,GAAkBja,EAAS,IAChC,MAAMka,EAASR,GAAa1Z,GAC5B,IAAIzD,EAAQ,GACZ,IAAK,MAAMf,KAAO0e,EACd3d,GAASf,EAAI3C,WAAW,MAAQ2C,EAAsBA,EALzB2e,QAAQ,SAAUL,IAM/Cvd,GAAS,KAAK2d,EAAO1e,OAEzB,OAAOe,ECRX,MAAM,GAAU0H,GAAc,ICC9B,SAASmW,GAAgBpa,EAAQ3F,EAAU,IACvC,OAAOwG,EAAa,CAChB,KACI,MAAM7L,EAAY,IAAI,GAAUgL,EAAQ,CAAC,EAAG,GAAI3F,GAEhD,OADArF,EAAUE,SAASG,MAAM,QAClBL,IAEZqF,EAASA,EAAQrB,UAExB,SAAS,GAAQgH,EAAQqa,EAAoBhgB,GAEzC,OADgBb,EAAWwG,GAAUoa,GAAkB,IACxCpa,EAAQqa,EAAoBhgB,GCf/C","file":"0.a964bcbb51a11574ce0f.js","sourcesContent":["/**\n * The MotionValue tracks the state of a single animatable\n * value. Currently, updatedAt and current are unused. The\n * long term idea is to use this to minimise the number\n * of DOM reads, and to abstract the DOM interactions here.\n */\nclass MotionValue {\n setAnimation(animation) {\n this.animation = animation;\n animation === null || animation === void 0 ? void 0 : animation.finished.then(() => this.clearAnimation()).catch(() => { });\n }\n clearAnimation() {\n this.animation = this.generator = undefined;\n }\n}\n\nexport { MotionValue };\n","import { MotionValue } from '@motionone/types';\n\nconst data = new WeakMap();\nfunction getAnimationData(element) {\n if (!data.has(element)) {\n data.set(element, {\n transforms: [],\n values: new Map(),\n });\n }\n return data.get(element);\n}\nfunction getMotionValue(motionValues, name) {\n if (!motionValues.has(name)) {\n motionValues.set(name, new MotionValue());\n }\n return motionValues.get(name);\n}\n\nexport { getAnimationData, getMotionValue };\n","const noop = () => { };\nconst noopReturn = (v) => v;\n\nexport { noop, noopReturn };\n","function addUniqueItem(array, item) {\n array.indexOf(item) === -1 && array.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n index > -1 && arr.splice(index, 1);\n}\n\nexport { addUniqueItem, removeItem };\n","import { noopReturn, addUniqueItem } from '@motionone/utils';\nimport { getAnimationData } from '../data.es.js';\n\n/**\n * A list of all transformable axes. We'll use this list to generated a version\n * of each axes for each transform.\n */\nconst axes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * An ordered array of each transformable value. By default, transform values\n * will be sorted to this order.\n */\nconst order = [\"translate\", \"scale\", \"rotate\", \"skew\"];\nconst transformAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n};\nconst rotation = {\n syntax: \"\",\n initialValue: \"0deg\",\n toDefaultUnit: (v) => v + \"deg\",\n};\nconst baseTransformProperties = {\n translate: {\n syntax: \"\",\n initialValue: \"0px\",\n toDefaultUnit: (v) => v + \"px\",\n },\n rotate: rotation,\n scale: {\n syntax: \"\",\n initialValue: 1,\n toDefaultUnit: noopReturn,\n },\n skew: rotation,\n};\nconst transformDefinitions = new Map();\nconst asTransformCssVar = (name) => `--motion-${name}`;\n/**\n * Generate a list of every possible transform key\n */\nconst transforms = [\"x\", \"y\", \"z\"];\norder.forEach((name) => {\n axes.forEach((axis) => {\n transforms.push(name + axis);\n transformDefinitions.set(asTransformCssVar(name + axis), baseTransformProperties[name]);\n });\n});\n/**\n * A function to use with Array.sort to sort transform keys by their default order.\n */\nconst compareTransformOrder = (a, b) => transforms.indexOf(a) - transforms.indexOf(b);\n/**\n * Provide a quick way to check if a string is the name of a transform\n */\nconst transformLookup = new Set(transforms);\nconst isTransform = (name) => transformLookup.has(name);\nconst addTransformToElement = (element, name) => {\n // Map x to translateX etc\n if (transformAlias[name])\n name = transformAlias[name];\n const { transforms } = getAnimationData(element);\n addUniqueItem(transforms, name);\n /**\n * TODO: An optimisation here could be to cache the transform in element data\n * and only update if this has changed.\n */\n element.style.transform = buildTransformTemplate(transforms);\n};\nconst buildTransformTemplate = (transforms) => transforms\n .sort(compareTransformOrder)\n .reduce(transformListToString, \"\")\n .trim();\nconst transformListToString = (template, name) => `${template} ${name}(var(${asTransformCssVar(name)}))`;\n\nexport { addTransformToElement, asTransformCssVar, axes, buildTransformTemplate, compareTransformOrder, isTransform, transformAlias, transformDefinitions };\n","import { transformDefinitions } from './transforms.es.js';\n\nconst isCssVar = (name) => name.startsWith(\"--\");\nconst registeredProperties = new Set();\nfunction registerCssVariable(name) {\n if (registeredProperties.has(name))\n return;\n registeredProperties.add(name);\n try {\n const { syntax, initialValue } = transformDefinitions.has(name)\n ? transformDefinitions.get(name)\n : {};\n CSS.registerProperty({\n name,\n inherits: false,\n syntax,\n initialValue,\n });\n }\n catch (e) { }\n}\n\nexport { isCssVar, registerCssVariable, registeredProperties };\n","const defaults = {\n duration: 0.3,\n delay: 0,\n endDelay: 0,\n repeat: 0,\n easing: \"ease\",\n};\n\nexport { defaults };\n","const isEasingGenerator = (easing) => typeof easing === \"object\" &&\n Boolean(easing.createAnimation);\n\nexport { isEasingGenerator };\n","const isFunction = (value) => typeof value === \"function\";\n\nexport { isFunction };\n","const isNumber = (value) => typeof value === \"number\";\n\nexport { isNumber };\n","import { isNumber } from './is-number.es.js';\n\nconst isEasingList = (easing) => Array.isArray(easing) && !isNumber(easing[0]);\n\nexport { isEasingList };\n","const time = {\n ms: (seconds) => seconds * 1000,\n s: (milliseconds) => milliseconds / 1000,\n};\n\nexport { time };\n","const progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min);\n\nexport { progress };\n","import { isNumber } from './is-number.es.js';\n\nconst isCubicBezier = (easing) => Array.isArray(easing) && isNumber(easing[0]);\n\nexport { isCubicBezier };\n","const testAnimation = (keyframes, options) => document.createElement(\"div\").animate(keyframes, options);\nconst featureTests = {\n cssRegisterProperty: () => typeof CSS !== \"undefined\" &&\n Object.hasOwnProperty.call(CSS, \"registerProperty\"),\n waapi: () => Object.hasOwnProperty.call(Element.prototype, \"animate\"),\n partialKeyframes: () => {\n try {\n testAnimation({ opacity: [1] });\n }\n catch (e) {\n return false;\n }\n return true;\n },\n finished: () => Boolean(testAnimation({ opacity: [0, 1] }, { duration: 0.001 }).finished),\n linearEasing: () => {\n try {\n testAnimation({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n },\n};\nconst results = {};\nconst supports = {};\nfor (const key in featureTests) {\n supports[key] = () => {\n if (results[key] === undefined)\n results[key] = featureTests[key]();\n return results[key];\n };\n}\n\nexport { supports };\n","import { isFunction, defaults, isCubicBezier, progress } from '@motionone/utils';\nimport { supports } from './feature-detection.es.js';\n\n// Create a linear easing point for every x second\nconst resolution = 0.015;\nconst generateLinearEasingPoints = (easing, duration) => {\n let points = \"\";\n const numPoints = Math.round(duration / resolution);\n for (let i = 0; i < numPoints; i++) {\n points += easing(progress(0, numPoints - 1, i)) + \", \";\n }\n return points.substring(0, points.length - 2);\n};\nconst convertEasing = (easing, duration) => {\n if (isFunction(easing)) {\n return supports.linearEasing()\n ? `linear(${generateLinearEasingPoints(easing, duration)})`\n : defaults.easing;\n }\n else {\n return isCubicBezier(easing) ? cubicBezierAsString(easing) : easing;\n }\n};\nconst cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { convertEasing, cubicBezierAsString, generateLinearEasingPoints };\n","function hydrateKeyframes(keyframes, readInitialValue) {\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] === null) {\n keyframes[i] = i ? keyframes[i - 1] : readInitialValue();\n }\n }\n return keyframes;\n}\nconst keyframesList = (keyframes) => Array.isArray(keyframes) ? keyframes : [keyframes];\n\nexport { hydrateKeyframes, keyframesList };\n","import { isTransform, asTransformCssVar, transformAlias } from './transforms.es.js';\n\nfunction getStyleName(key) {\n if (transformAlias[key])\n key = transformAlias[key];\n return isTransform(key) ? asTransformCssVar(key) : key;\n}\n\nexport { getStyleName };\n","import { isCssVar } from './utils/css-var.es.js';\nimport { getStyleName } from './utils/get-style-name.es.js';\nimport { transformDefinitions } from './utils/transforms.es.js';\n\nconst style = {\n get: (element, name) => {\n name = getStyleName(name);\n let value = isCssVar(name)\n ? element.style.getPropertyValue(name)\n : getComputedStyle(element)[name];\n if (!value && value !== 0) {\n const definition = transformDefinitions.get(name);\n if (definition)\n value = definition.initialValue;\n }\n return value;\n },\n set: (element, name, value) => {\n name = getStyleName(name);\n if (isCssVar(name)) {\n element.style.setProperty(name, value);\n }\n else {\n element.style[name] = value;\n }\n },\n};\n\nexport { style };\n","function stopAnimation(animation, needsCommit = true) {\n if (!animation || animation.playState === \"finished\")\n return;\n // Suppress error thrown by WAAPI\n try {\n if (animation.stop) {\n animation.stop();\n }\n else {\n needsCommit && animation.commitStyles();\n animation.cancel();\n }\n }\n catch (e) { }\n}\n\nexport { stopAnimation };\n","const isString = (value) => typeof value === \"string\";\n\nexport { isString };\n","import { noopReturn, isString } from '@motionone/utils';\n\nfunction getUnitConverter(keyframes, definition) {\n var _a;\n let toUnit = (definition === null || definition === void 0 ? void 0 : definition.toDefaultUnit) || noopReturn;\n const finalKeyframe = keyframes[keyframes.length - 1];\n if (isString(finalKeyframe)) {\n const unit = ((_a = finalKeyframe.match(/(-?[\\d.]+)([a-z%]*)/)) === null || _a === void 0 ? void 0 : _a[2]) || \"\";\n if (unit)\n toUnit = (value) => value + unit;\n }\n return toUnit;\n}\n\nexport { getUnitConverter };\n","import { getAnimationData, getMotionValue } from './data.es.js';\nimport { isCssVar, registerCssVariable } from './utils/css-var.es.js';\nimport { defaults, isEasingGenerator, isFunction, isEasingList, isNumber, time, noop } from '@motionone/utils';\nimport { isTransform, addTransformToElement, transformDefinitions } from './utils/transforms.es.js';\nimport { convertEasing } from './utils/easing.es.js';\nimport { supports } from './utils/feature-detection.es.js';\nimport { hydrateKeyframes, keyframesList } from './utils/keyframes.es.js';\nimport { style } from './style.es.js';\nimport { getStyleName } from './utils/get-style-name.es.js';\nimport { stopAnimation } from './utils/stop-animation.es.js';\nimport { getUnitConverter } from './utils/get-unit.es.js';\n\nfunction getDevToolsRecord() {\n return window.__MOTION_DEV_TOOLS_RECORD;\n}\nfunction animateStyle(element, key, keyframesDefinition, options = {}, AnimationPolyfill) {\n const record = getDevToolsRecord();\n const isRecording = options.record !== false && record;\n let animation;\n let { duration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, persist = false, direction, offset, allowWebkitAcceleration = false, } = options;\n const data = getAnimationData(element);\n const valueIsTransform = isTransform(key);\n let canAnimateNatively = supports.waapi();\n /**\n * If this is an individual transform, we need to map its\n * key to a CSS variable and update the element's transform style\n */\n valueIsTransform && addTransformToElement(element, key);\n const name = getStyleName(key);\n const motionValue = getMotionValue(data.values, name);\n /**\n * Get definition of value, this will be used to convert numerical\n * keyframes into the default value type.\n */\n const definition = transformDefinitions.get(name);\n /**\n * Stop the current animation, if any. Because this will trigger\n * commitStyles (DOM writes) and we might later trigger DOM reads,\n * this is fired now and we return a factory function to create\n * the actual animation that can get called in batch,\n */\n stopAnimation(motionValue.animation, !(isEasingGenerator(easing) && motionValue.generator) &&\n options.record !== false);\n /**\n * Batchable factory function containing all DOM reads.\n */\n return () => {\n const readInitialValue = () => { var _a, _b; return (_b = (_a = style.get(element, name)) !== null && _a !== void 0 ? _a : definition === null || definition === void 0 ? void 0 : definition.initialValue) !== null && _b !== void 0 ? _b : 0; };\n /**\n * Replace null values with the previous keyframe value, or read\n * it from the DOM if it's the first keyframe.\n */\n let keyframes = hydrateKeyframes(keyframesList(keyframesDefinition), readInitialValue);\n /**\n * Detect unit type of keyframes.\n */\n const toUnit = getUnitConverter(keyframes, definition);\n if (isEasingGenerator(easing)) {\n const custom = easing.createAnimation(keyframes, key !== \"opacity\", readInitialValue, name, motionValue);\n easing = custom.easing;\n keyframes = custom.keyframes || keyframes;\n duration = custom.duration || duration;\n }\n /**\n * If this is a CSS variable we need to register it with the browser\n * before it can be animated natively. We also set it with setProperty\n * rather than directly onto the element.style object.\n */\n if (isCssVar(name)) {\n if (supports.cssRegisterProperty()) {\n registerCssVariable(name);\n }\n else {\n canAnimateNatively = false;\n }\n }\n /**\n * If we've been passed a custom easing function, and this browser\n * does **not** support linear() easing, and the value is a transform\n * (and thus a pure number) we can still support the custom easing\n * by falling back to the animation polyfill.\n */\n if (valueIsTransform &&\n !supports.linearEasing() &&\n (isFunction(easing) || (isEasingList(easing) && easing.some(isFunction)))) {\n canAnimateNatively = false;\n }\n /**\n * If we can animate this value with WAAPI, do so.\n */\n if (canAnimateNatively) {\n /**\n * Convert numbers to default value types. Currently this only supports\n * transforms but it could also support other value types.\n */\n if (definition) {\n keyframes = keyframes.map((value) => isNumber(value) ? definition.toDefaultUnit(value) : value);\n }\n /**\n * If this browser doesn't support partial/implicit keyframes we need to\n * explicitly provide one.\n */\n if (keyframes.length === 1 &&\n (!supports.partialKeyframes() || isRecording)) {\n keyframes.unshift(readInitialValue());\n }\n const animationOptions = {\n delay: time.ms(delay),\n duration: time.ms(duration),\n endDelay: time.ms(endDelay),\n easing: !isEasingList(easing)\n ? convertEasing(easing, duration)\n : undefined,\n direction,\n iterations: repeat + 1,\n fill: \"both\",\n };\n animation = element.animate({\n [name]: keyframes,\n offset,\n easing: isEasingList(easing)\n ? easing.map((thisEasing) => convertEasing(thisEasing, duration))\n : undefined,\n }, animationOptions);\n /**\n * Polyfill finished Promise in browsers that don't support it\n */\n if (!animation.finished) {\n animation.finished = new Promise((resolve, reject) => {\n animation.onfinish = resolve;\n animation.oncancel = reject;\n });\n }\n const target = keyframes[keyframes.length - 1];\n animation.finished\n .then(() => {\n if (persist)\n return;\n // Apply styles to target\n style.set(element, name, target);\n // Ensure fill modes don't persist\n animation.cancel();\n })\n .catch(noop);\n /**\n * This forces Webkit to run animations on the main thread by exploiting\n * this condition:\n * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=281238#L1099\n *\n * This fixes Webkit's timing bugs, like accelerated animations falling\n * out of sync with main thread animations and massive delays in starting\n * accelerated animations in WKWebView.\n */\n if (!allowWebkitAcceleration)\n animation.playbackRate = 1.000001;\n /**\n * If we can't animate the value natively then we can fallback to the numbers-only\n * polyfill for transforms.\n */\n }\n else if (AnimationPolyfill && valueIsTransform) {\n /**\n * If any keyframe is a string (because we measured it from the DOM), we need to convert\n * it into a number before passing to the Animation polyfill.\n */\n keyframes = keyframes.map((value) => typeof value === \"string\" ? parseFloat(value) : value);\n /**\n * If we only have a single keyframe, we need to create an initial keyframe by reading\n * the current value from the DOM.\n */\n if (keyframes.length === 1) {\n keyframes.unshift(parseFloat(readInitialValue()));\n }\n animation = new AnimationPolyfill((latest) => {\n style.set(element, name, toUnit ? toUnit(latest) : latest);\n }, keyframes, Object.assign(Object.assign({}, options), { duration,\n easing }));\n }\n else {\n const target = keyframes[keyframes.length - 1];\n style.set(element, name, definition && isNumber(target)\n ? definition.toDefaultUnit(target)\n : target);\n }\n if (isRecording) {\n record(element, key, keyframes, {\n duration,\n delay: delay,\n easing,\n repeat,\n offset,\n }, \"motion-one\");\n }\n motionValue.setAnimation(animation);\n return animation;\n };\n}\n\nexport { animateStyle };\n","const getOptions = (options, key) => \n/**\n * TODO: Make test for this\n * Always return a new object otherwise delay is overwritten by results of stagger\n * and this results in no stagger\n */\noptions[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options);\n\nexport { getOptions };\n","function resolveElements(elements, selectorCache) {\n var _a;\n if (typeof elements === \"string\") {\n if (selectorCache) {\n (_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : (selectorCache[elements] = document.querySelectorAll(elements));\n elements = selectorCache[elements];\n }\n else {\n elements = document.querySelectorAll(elements);\n }\n }\n else if (elements instanceof Element) {\n elements = [elements];\n }\n /**\n * Return an empty array\n */\n return Array.from(elements || []);\n}\n\nexport { resolveElements };\n","import { defaults, noop, time } from '@motionone/utils';\nimport { stopAnimation } from './stop-animation.es.js';\n\nconst createAnimation = (factory) => factory();\nconst withControls = (animationFactory, options, duration = defaults.duration) => {\n return new Proxy({\n animations: animationFactory.map(createAnimation).filter(Boolean),\n duration,\n options,\n }, controls);\n};\n/**\n * TODO:\n * Currently this returns the first animation, ideally it would return\n * the first active animation.\n */\nconst getActiveAnimation = (state) => state.animations[0];\nconst controls = {\n get: (target, key) => {\n const activeAnimation = getActiveAnimation(target);\n switch (key) {\n case \"duration\":\n return target.duration;\n case \"currentTime\":\n return time.s((activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) || 0);\n case \"playbackRate\":\n case \"playState\":\n return activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key];\n case \"finished\":\n if (!target.finished) {\n target.finished = Promise.all(target.animations.map(selectFinished)).catch(noop);\n }\n return target.finished;\n case \"stop\":\n return () => {\n target.animations.forEach((animation) => stopAnimation(animation));\n };\n case \"forEachNative\":\n /**\n * This is for internal use only, fire a callback for each\n * underlying animation.\n */\n return (callback) => {\n target.animations.forEach((animation) => callback(animation, target));\n };\n default:\n return typeof (activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) === \"undefined\"\n ? undefined\n : () => target.animations.forEach((animation) => animation[key]());\n }\n },\n set: (target, key, value) => {\n switch (key) {\n case \"currentTime\":\n value = time.ms(value);\n case \"currentTime\":\n case \"playbackRate\":\n for (let i = 0; i < target.animations.length; i++) {\n target.animations[i][key] = value;\n }\n return true;\n }\n return false;\n },\n};\nconst selectFinished = (animation) => animation.finished;\n\nexport { controls, withControls };\n","import { noopReturn } from '@motionone/utils';\n\n/*\n Bezier function generator\n\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticiably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noopReturn;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n","const clamp = (min, max, v) => Math.min(Math.max(v, min), max);\n\nexport { clamp };\n","import { cubicBezier, steps } from '@motionone/easing';\nimport { isFunction, isCubicBezier, noopReturn } from '@motionone/utils';\n\nconst namedEasings = {\n ease: cubicBezier(0.25, 0.1, 0.25, 1.0),\n \"ease-in\": cubicBezier(0.42, 0.0, 1.0, 1.0),\n \"ease-in-out\": cubicBezier(0.42, 0.0, 0.58, 1.0),\n \"ease-out\": cubicBezier(0.0, 0.0, 0.58, 1.0),\n};\nconst functionArgsRegex = /\\((.*?)\\)/;\nfunction getEasingFunction(definition) {\n // If already an easing function, return\n if (isFunction(definition))\n return definition;\n // If an easing curve definition, return bezier function\n if (isCubicBezier(definition))\n return cubicBezier(...definition);\n // If we have a predefined easing function, return\n if (namedEasings[definition])\n return namedEasings[definition];\n // If this is a steps function, attempt to create easing curve\n if (definition.startsWith(\"steps\")) {\n const args = functionArgsRegex.exec(definition);\n if (args) {\n const argsArray = args[1].split(\",\");\n return steps(parseFloat(argsArray[0]), argsArray[1].trim());\n }\n }\n return noopReturn;\n}\n\nexport { getEasingFunction };\n","import { clamp } from '@motionone/utils';\n\nconst steps = (steps, direction = \"end\") => (progress) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001);\n const expanded = progress * steps;\n const rounded = direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded);\n return clamp(0, 1, rounded / steps);\n};\n\nexport { steps };\n","import { isNumber, isFunction } from '@motionone/utils';\nimport { getEasingFunction } from '@motionone/animation';\n\nfunction stagger(duration = 0.1, { start = 0, from = 0, easing } = {}) {\n return (i, total) => {\n const fromIndex = isNumber(from) ? from : getFromIndex(from, total);\n const distance = Math.abs(fromIndex - i);\n let delay = duration * distance;\n if (easing) {\n const maxDelay = total * duration;\n const easingFunction = getEasingFunction(easing);\n delay = easingFunction(delay / maxDelay) * maxDelay;\n }\n return start + delay;\n };\n}\nfunction getFromIndex(from, total) {\n if (from === \"first\") {\n return 0;\n }\n else {\n const lastIndex = total - 1;\n return from === \"last\" ? lastIndex : lastIndex / 2;\n }\n}\nfunction resolveOption(option, i, total) {\n return isFunction(option) ? option(i, total) : option;\n}\n\nexport { getFromIndex, resolveOption, stagger };\n","import { invariant } from 'hey-listen';\nimport { animateStyle } from './animate-style.es.js';\nimport { getOptions } from './utils/options.es.js';\nimport { resolveElements } from '../utils/resolve-elements.es.js';\nimport { withControls } from './utils/controls.es.js';\nimport { resolveOption } from '../utils/stagger.es.js';\n\nfunction createAnimate(AnimatePolyfill) {\n return function animate(elements, keyframes, options = {}) {\n elements = resolveElements(elements);\n const numElements = elements.length;\n invariant(Boolean(numElements), \"No valid element provided.\");\n invariant(Boolean(keyframes), \"No keyframes defined.\");\n /**\n * Create and start new animations\n */\n const animationFactories = [];\n for (let i = 0; i < numElements; i++) {\n const element = elements[i];\n for (const key in keyframes) {\n const valueOptions = getOptions(options, key);\n valueOptions.delay = resolveOption(valueOptions.delay, i, numElements);\n const animation = animateStyle(element, key, keyframes[key], valueOptions, AnimatePolyfill);\n animationFactories.push(animation);\n }\n }\n return withControls(animationFactories, options, \n /**\n * TODO:\n * If easing is set to spring or glide, duration will be dynamically\n * generated. Ideally we would dynamically generate this from\n * animation.effect.getComputedTiming().duration but this isn't\n * supported in iOS13 or our number polyfill. Perhaps it's possible\n * to Proxy animations returned from animateStyle that has duration\n * as a getter.\n */\n options.duration);\n };\n}\n\nexport { createAnimate };\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __createBinding,\r\n __exportStar,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n __addDisposableResource,\r\n __disposeResources,\r\n};\r\n","const mix = (min, max, progress) => -progress * min + progress * max + min;\n\nexport { mix };\n","import { mix } from './mix.es.js';\nimport { progress } from './progress.es.js';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mix(min, 1, offsetProgress));\n }\n}\nfunction defaultOffset(length) {\n const offset = [0];\n fillOffset(offset, length - 1);\n return offset;\n}\n\nexport { defaultOffset, fillOffset };\n","import { isNumber } from '@motionone/utils';\n\nfunction calcNextTime(current, next, prev, labels) {\n var _a;\n if (isNumber(next)) {\n return next;\n }\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next));\n }\n else if (next === \"<\") {\n return prev;\n }\n else {\n return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;\n }\n}\n\nexport { calcNextTime };\n","import { isEasingList } from './is-easing-list.es.js';\nimport { wrap } from './wrap.es.js';\n\nfunction getEasingForSegment(easing, i) {\n return isEasingList(easing)\n ? easing[wrap(0, easing.length, i)]\n : easing;\n}\n\nexport { getEasingForSegment };\n","const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n","import { mix, getEasingForSegment, removeItem } from '@motionone/utils';\n\nfunction eraseKeyframes(sequence, startTime, endTime) {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i];\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe);\n // If we remove this item we have to push the pointer back one\n i--;\n }\n }\n}\nfunction addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime);\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mix(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n });\n }\n}\n\nexport { addKeyframes, eraseKeyframes };\n","function compareByTime(a, b) {\n if (a.at === b.at) {\n return a.value === null ? 1 : -1;\n }\n else {\n return a.at - b.at;\n }\n}\n\nexport { compareByTime };\n","import { mix } from './mix.es.js';\nimport { noopReturn } from './noop.es.js';\nimport { fillOffset, defaultOffset } from './offset.es.js';\nimport { progress } from './progress.es.js';\nimport { getEasingForSegment } from './easing.es.js';\nimport { clamp } from './clamp.es.js';\n\nfunction interpolate(output, input = defaultOffset(output.length), easing = noopReturn) {\n const length = output.length;\n /**\n * If the input length is lower than the output we\n * fill the input to match. This currently assumes the input\n * is an animation progress value so is a good candidate for\n * moving outside the function.\n */\n const remainder = length - input.length;\n remainder > 0 && fillOffset(input, remainder);\n return (t) => {\n let i = 0;\n for (; i < length - 2; i++) {\n if (t < input[i + 1])\n break;\n }\n let progressInRange = clamp(0, 1, progress(input[i], input[i + 1], t));\n const segmentEasing = getEasingForSegment(easing, i);\n progressInRange = segmentEasing(progressInRange);\n return mix(output[i], output[i + 1], progressInRange);\n };\n}\n\nexport { interpolate };\n","import { noopReturn, defaults, isEasingGenerator, isEasingList, interpolate } from '@motionone/utils';\nimport { getEasingFunction } from './utils/easing.es.js';\n\nclass Animation {\n constructor(output, keyframes = [0, 1], { easing, duration: initialDuration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, offset, direction = \"normal\", } = {}) {\n this.startTime = null;\n this.rate = 1;\n this.t = 0;\n this.cancelTimestamp = null;\n this.easing = noopReturn;\n this.duration = 0;\n this.totalDuration = 0;\n this.repeat = 0;\n this.playState = \"idle\";\n this.finished = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n easing = easing || defaults.easing;\n if (isEasingGenerator(easing)) {\n const custom = easing.createAnimation(keyframes);\n easing = custom.easing;\n keyframes = custom.keyframes || keyframes;\n initialDuration = custom.duration || initialDuration;\n }\n this.repeat = repeat;\n this.easing = isEasingList(easing) ? noopReturn : getEasingFunction(easing);\n this.updateDuration(initialDuration);\n const interpolate$1 = interpolate(keyframes, offset, isEasingList(easing) ? easing.map(getEasingFunction) : noopReturn);\n this.tick = (timestamp) => {\n var _a;\n // TODO: Temporary fix for OptionsResolver typing\n delay = delay;\n let t = 0;\n if (this.pauseTime !== undefined) {\n t = this.pauseTime;\n }\n else {\n t = (timestamp - this.startTime) * this.rate;\n }\n this.t = t;\n // Convert to seconds\n t /= 1000;\n // Rebase on delay\n t = Math.max(t - delay, 0);\n /**\n * If this animation has finished, set the current time\n * to the total duration.\n */\n if (this.playState === \"finished\" && this.pauseTime === undefined) {\n t = this.totalDuration;\n }\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = t / this.duration;\n // TODO progress += iterationStart\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n iterationProgress === 1 && currentIteration--;\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const iterationIsOdd = currentIteration % 2;\n if (direction === \"reverse\" ||\n (direction === \"alternate\" && iterationIsOdd) ||\n (direction === \"alternate-reverse\" && !iterationIsOdd)) {\n iterationProgress = 1 - iterationProgress;\n }\n const p = t >= this.totalDuration ? 1 : Math.min(iterationProgress, 1);\n const latest = interpolate$1(this.easing(p));\n output(latest);\n const isAnimationFinished = this.pauseTime === undefined &&\n (this.playState === \"finished\" || t >= this.totalDuration + endDelay);\n if (isAnimationFinished) {\n this.playState = \"finished\";\n (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, latest);\n }\n else if (this.playState !== \"idle\") {\n this.frameRequestId = requestAnimationFrame(this.tick);\n }\n };\n this.play();\n }\n play() {\n const now = performance.now();\n this.playState = \"running\";\n if (this.pauseTime !== undefined) {\n this.startTime = now - this.pauseTime;\n }\n else if (!this.startTime) {\n this.startTime = now;\n }\n this.cancelTimestamp = this.startTime;\n this.pauseTime = undefined;\n this.frameRequestId = requestAnimationFrame(this.tick);\n }\n pause() {\n this.playState = \"paused\";\n this.pauseTime = this.t;\n }\n finish() {\n this.playState = \"finished\";\n this.tick(0);\n }\n stop() {\n var _a;\n this.playState = \"idle\";\n if (this.frameRequestId !== undefined) {\n cancelAnimationFrame(this.frameRequestId);\n }\n (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, false);\n }\n cancel() {\n this.stop();\n this.tick(this.cancelTimestamp);\n }\n reverse() {\n this.rate *= -1;\n }\n commitStyles() { }\n updateDuration(duration) {\n this.duration = duration;\n this.totalDuration = duration * (this.repeat + 1);\n }\n get currentTime() {\n return this.t;\n }\n set currentTime(t) {\n if (this.pauseTime !== undefined || this.rate === 0) {\n this.pauseTime = t;\n }\n else {\n this.startTime = performance.now() - t / this.rate;\n }\n }\n get playbackRate() {\n return this.rate;\n }\n set playbackRate(rate) {\n this.rate = rate;\n }\n}\n\nexport { Animation };\n","import { __rest } from 'tslib';\nimport { invariant } from 'hey-listen';\nimport { isString, defaults, isEasingGenerator, defaultOffset, fillOffset, progress } from '@motionone/utils';\nimport { resolveOption } from '../utils/stagger.es.js';\nimport { animateStyle } from '../animate/animate-style.es.js';\nimport { withControls } from '../animate/utils/controls.es.js';\nimport { keyframesList } from '../animate/utils/keyframes.es.js';\nimport { getOptions } from '../animate/utils/options.es.js';\nimport { resolveElements } from '../utils/resolve-elements.es.js';\nimport { calcNextTime } from './utils/calc-time.es.js';\nimport { addKeyframes } from './utils/edit.es.js';\nimport { compareByTime } from './utils/sort.es.js';\nimport { Animation } from '@motionone/animation';\n\nfunction timeline(definition, options = {}) {\n var _a;\n const animationDefinitions = createAnimationsFromTimeline(definition, options);\n /**\n * Create and start animations\n */\n const animationFactories = animationDefinitions\n .map((definition) => animateStyle(...definition, Animation))\n .filter(Boolean);\n return withControls(animationFactories, options, \n // Get the duration from the first animation definition\n (_a = animationDefinitions[0]) === null || _a === void 0 ? void 0 : _a[3].duration);\n}\nfunction createAnimationsFromTimeline(definition, _a = {}) {\n var { defaultOptions = {} } = _a, timelineOptions = __rest(_a, [\"defaultOptions\"]);\n const animationDefinitions = [];\n const elementSequences = new Map();\n const elementCache = {};\n const timeLabels = new Map();\n let prevTime = 0;\n let currentTime = 0;\n let totalDuration = 0;\n /**\n * Build the timeline by mapping over the definition array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < definition.length; i++) {\n const segment = definition[i];\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (isString(segment)) {\n timeLabels.set(segment, currentTime);\n continue;\n }\n else if (!Array.isArray(segment)) {\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\n continue;\n }\n const [elementDefinition, keyframes, options = {}] = segment;\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (options.at !== undefined) {\n currentTime = calcNextTime(currentTime, options.at, prevTime, timeLabels);\n }\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0;\n /**\n * Find all the elements specified in the definition and parse value\n * keyframes from their timeline definitions.\n */\n const elements = resolveElements(elementDefinition, elementCache);\n const numElements = elements.length;\n for (let elementIndex = 0; elementIndex < numElements; elementIndex++) {\n const element = elements[elementIndex];\n const elementSequence = getElementSequence(element, elementSequences);\n for (const key in keyframes) {\n const valueSequence = getValueSequence(key, elementSequence);\n let valueKeyframes = keyframesList(keyframes[key]);\n const valueOptions = getOptions(options, key);\n let { duration = defaultOptions.duration || defaults.duration, easing = defaultOptions.easing || defaults.easing, } = valueOptions;\n if (isEasingGenerator(easing)) {\n invariant(key === \"opacity\" || valueKeyframes.length > 1, \"spring must be provided 2 keyframes within timeline()\");\n const custom = easing.createAnimation(valueKeyframes, key !== \"opacity\", () => 0, key);\n easing = custom.easing;\n valueKeyframes = custom.keyframes || valueKeyframes;\n duration = custom.duration || duration;\n }\n const delay = resolveOption(options.delay, elementIndex, numElements) || 0;\n const startTime = currentTime + delay;\n const targetTime = startTime + duration;\n /**\n *\n */\n let { offset = defaultOffset(valueKeyframes.length) } = valueOptions;\n /**\n * If there's only one offset of 0, fill in a second with length 1\n *\n * TODO: Ensure there's a test that covers this removal\n */\n if (offset.length === 1 && offset[0] === 0) {\n offset[1] = 1;\n }\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = offset.length - valueKeyframes.length;\n remainder > 0 && fillOffset(offset, remainder);\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframes.length === 1 && valueKeyframes.unshift(null);\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframes, easing, offset, startTime, targetTime);\n maxDuration = Math.max(delay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\n }\n /**\n * For every element and value combination create a new animation.\n */\n elementSequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key];\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime);\n const keyframes = [];\n const valueOffset = [];\n const valueEasing = [];\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i];\n keyframes.push(value);\n valueOffset.push(progress(0, totalDuration, at));\n valueEasing.push(easing || defaults.easing);\n }\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0);\n keyframes.unshift(keyframes[0]);\n valueEasing.unshift(\"linear\");\n }\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1);\n keyframes.push(null);\n }\n animationDefinitions.push([\n element,\n key,\n keyframes,\n Object.assign(Object.assign(Object.assign({}, defaultOptions), { duration: totalDuration, easing: valueEasing, offset: valueOffset }), timelineOptions),\n ]);\n }\n });\n return animationDefinitions;\n}\nfunction getElementSequence(element, sequences) {\n !sequences.has(element) && sequences.set(element, {});\n return sequences.get(element);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\n\nexport { createAnimationsFromTimeline, timeline };\n","const defaults = {\n stiffness: 100.0,\n damping: 10.0,\n mass: 1.0,\n};\n\nexport { defaults };\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n","import { velocityPerSecond } from '@motionone/utils';\n\nconst sampleT = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - sampleT, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n","import { time } from '@motionone/utils';\nimport { defaults } from './defaults.es.js';\nimport { calcDampingRatio } from './utils.es.js';\nimport { hasReachedTarget } from '../utils/has-reached-target.es.js';\nimport { calcGeneratorVelocity } from '../utils/velocity.es.js';\n\nconst spring = ({ stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass, from = 0, to = 1, velocity = 0.0, restSpeed = 2, restDistance = 0.5, } = {}) => {\n velocity = velocity ? time.s(velocity) : 0.0;\n const state = {\n done: false,\n hasReachedTarget: false,\n current: from,\n target: to,\n };\n const initialDelta = to - from;\n const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000;\n const dampingRatio = calcDampingRatio(stiffness, damping, mass);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = undampedAngularFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n // Underdamped spring (bouncy)\n resolveSpring = (t) => to -\n Math.exp(-dampingRatio * undampedAngularFreq * t) *\n (((-velocity + dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t));\n }\n else {\n // Critically damped spring\n resolveSpring = (t) => {\n return (to -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta + (-velocity + undampedAngularFreq * initialDelta) * t));\n };\n }\n return (t) => {\n state.current = resolveSpring(t);\n const currentVelocity = t === 0\n ? velocity\n : calcGeneratorVelocity(resolveSpring, t, state.current);\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(to - state.current) <= restDistance;\n state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold;\n state.hasReachedTarget = hasReachedTarget(from, to, state.current);\n return state;\n };\n};\n\nexport { spring };\n","import { defaults } from './defaults.es.js';\n\nconst calcDampingRatio = (stiffness = defaults.stiffness, damping = defaults.damping, mass = defaults.mass) => damping / (2 * Math.sqrt(stiffness * mass));\n\nexport { calcDampingRatio };\n","function hasReachedTarget(origin, target, current) {\n return ((origin < target && current >= target) ||\n (origin > target && current <= target));\n}\n\nexport { hasReachedTarget };\n","import { calcGeneratorVelocity, pregenerateKeyframes } from '@motionone/generators';\nimport { isNumber, isString, noopReturn } from '@motionone/utils';\nimport { getUnitConverter } from '../animate/utils/get-unit.es.js';\nimport { transformDefinitions } from '../animate/utils/transforms.es.js';\nimport { getStyleName } from '../animate/utils/get-style-name.es.js';\n\nfunction canGenerate(value) {\n return isNumber(value) && !isNaN(value);\n}\nfunction getAsNumber(value) {\n return isString(value) ? parseFloat(value) : value;\n}\nfunction createGeneratorEasing(createGenerator) {\n const keyframesCache = new WeakMap();\n return (options = {}) => {\n const generatorCache = new Map();\n const getGenerator = (from = 0, to = 100, velocity = 0, isScale = false) => {\n const key = `${from}-${to}-${velocity}-${isScale}`;\n if (!generatorCache.has(key)) {\n generatorCache.set(key, createGenerator(Object.assign({ from,\n to,\n velocity, restSpeed: isScale ? 0.05 : 2, restDistance: isScale ? 0.01 : 0.5 }, options)));\n }\n return generatorCache.get(key);\n };\n const getKeyframes = (generator, toUnit) => {\n if (!keyframesCache.has(generator)) {\n keyframesCache.set(generator, pregenerateKeyframes(generator, toUnit));\n }\n return keyframesCache.get(generator);\n };\n return {\n createAnimation: (keyframes, shouldGenerate = true, getOrigin, name, motionValue) => {\n let settings;\n let origin;\n let target;\n let velocity = 0;\n let toUnit = noopReturn;\n const numKeyframes = keyframes.length;\n /**\n * If we should generate an animation for this value, run some preperation\n * like resolving target/origin, finding a unit (if any) and determine if\n * it is actually possible to generate.\n */\n if (shouldGenerate) {\n toUnit = getUnitConverter(keyframes, name ? transformDefinitions.get(getStyleName(name)) : undefined);\n const targetDefinition = keyframes[numKeyframes - 1];\n target = getAsNumber(targetDefinition);\n if (numKeyframes > 1 && keyframes[0] !== null) {\n /**\n * If we have multiple keyframes, take the initial keyframe as the origin.\n */\n origin = getAsNumber(keyframes[0]);\n }\n else {\n const prevGenerator = motionValue === null || motionValue === void 0 ? void 0 : motionValue.generator;\n /**\n * If we have an existing generator for this value we can use it to resolve\n * the animation's current value and velocity.\n */\n if (prevGenerator) {\n /**\n * If we have a generator for this value we can use it to resolve\n * the animations's current value and velocity.\n */\n const { animation, generatorStartTime } = motionValue;\n const startTime = (animation === null || animation === void 0 ? void 0 : animation.startTime) || generatorStartTime || 0;\n const currentTime = (animation === null || animation === void 0 ? void 0 : animation.currentTime) || performance.now() - startTime;\n const prevGeneratorCurrent = prevGenerator(currentTime).current;\n origin = prevGeneratorCurrent;\n velocity = calcGeneratorVelocity((t) => prevGenerator(t).current, currentTime, prevGeneratorCurrent);\n }\n else if (getOrigin) {\n /**\n * As a last resort, read the origin from the DOM.\n */\n origin = getAsNumber(getOrigin());\n }\n }\n }\n /**\n * If we've determined it is possible to generate an animation, do so.\n */\n if (canGenerate(origin) && canGenerate(target)) {\n const generator = getGenerator(origin, target, velocity, name === null || name === void 0 ? void 0 : name.includes(\"scale\"));\n settings = Object.assign(Object.assign({}, getKeyframes(generator, toUnit)), { easing: \"linear\" });\n // TODO Add test for this\n if (motionValue) {\n motionValue.generator = generator;\n motionValue.generatorStartTime = performance.now();\n }\n }\n /**\n * If by now we haven't generated a set of keyframes, create a generic generator\n * based on the provided props that animates from 0-100 to fetch a rough\n * \"overshootDuration\" - the moment when the generator first hits the animation target.\n * Then return animation settings that will run a normal animation for that duration.\n */\n if (!settings) {\n const keyframesMetadata = getKeyframes(getGenerator(0, 100));\n settings = {\n easing: \"ease\",\n duration: keyframesMetadata.overshootDuration,\n };\n }\n return settings;\n },\n };\n };\n}\n\nexport { createGeneratorEasing };\n","import { noopReturn } from '@motionone/utils';\n\nconst timeStep = 10;\nconst maxDuration = 10000;\nfunction pregenerateKeyframes(generator, toUnit = noopReturn) {\n let overshootDuration = undefined;\n let timestamp = timeStep;\n let state = generator(0);\n const keyframes = [toUnit(state.current)];\n while (!state.done && timestamp < maxDuration) {\n state = generator(timestamp);\n keyframes.push(toUnit(state.done ? state.target : state.current));\n if (overshootDuration === undefined && state.hasReachedTarget) {\n overshootDuration = timestamp;\n }\n timestamp += timeStep;\n }\n const duration = timestamp - timeStep;\n /**\n * If generating an animation that didn't actually move,\n * generate a second keyframe so we have an origin and target.\n */\n if (keyframes.length === 1)\n keyframes.push(state.current);\n return {\n keyframes,\n duration: duration / 1000,\n overshootDuration: (overshootDuration !== null && overshootDuration !== void 0 ? overshootDuration : duration) / 1000,\n };\n}\n\nexport { pregenerateKeyframes };\n","import { spring as spring$1 } from '@motionone/generators';\nimport { createGeneratorEasing } from '../create-generator-easing.es.js';\n\nconst spring = createGeneratorEasing(spring$1);\n\nexport { spring };\n","import { glide as glide$1 } from '@motionone/generators';\nimport { createGeneratorEasing } from '../create-generator-easing.es.js';\n\nconst glide = createGeneratorEasing(glide$1);\n\nexport { glide };\n","import { time } from '@motionone/utils';\nimport { calcGeneratorVelocity } from '../utils/velocity.es.js';\nimport { spring } from '../spring/index.es.js';\n\nconst glide = ({ from = 0, velocity = 0.0, power = 0.8, decay = 0.325, bounceDamping, bounceStiffness, changeTarget, min, max, restDistance = 0.5, restSpeed, }) => {\n decay = time.ms(decay);\n const state = {\n hasReachedTarget: false,\n done: false,\n current: from,\n target: from,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = from + amplitude;\n const target = changeTarget === undefined ? ideal : changeTarget(ideal);\n state.target = target;\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - from;\n const calcDelta = (t) => -amplitude * Math.exp(-t / decay);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDistance;\n state.current = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.current))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n from: state.current,\n to: nearestBoundary(state.current),\n velocity: calcGeneratorVelocity(calcLatest, t, state.current),\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDistance,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t > timeReachedBoundary) {\n state.hasReachedTarget = true;\n return spring$1(t - timeReachedBoundary);\n }\n else {\n state.hasReachedTarget = false;\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n };\n};\n\nexport { glide };\n","import { resolveElements } from '../utils/resolve-elements.es.js';\nimport { isFunction } from '@motionone/utils';\n\nconst thresholds = {\n any: 0,\n all: 1,\n};\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"any\" } = {}) {\n /**\n * If this browser doesn't support IntersectionObserver, return a dummy stop function.\n * Default triggering of onStart is tricky - it could be used for starting/stopping\n * videos, lazy loading content etc. We could provide an option to enable a fallback, or\n * provide a fallback callback option.\n */\n if (typeof IntersectionObserver === \"undefined\") {\n return () => { };\n }\n const elements = resolveElements(elementOrSelector);\n const activeIntersections = new WeakMap();\n const onIntersectionChange = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target);\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd))\n return;\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry);\n if (isFunction(newOnEnd)) {\n activeIntersections.set(entry.target, newOnEnd);\n }\n else {\n observer.unobserve(entry.target);\n }\n }\n else if (onEnd) {\n onEnd(entry);\n activeIntersections.delete(entry.target);\n }\n });\n };\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n });\n elements.forEach((element) => observer.observe(element));\n return () => observer.disconnect();\n}\n\nexport { inView };\n","import { resolveElements } from '../../utils/resolve-elements.es.js';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nfunction getElementSize(target, borderBoxSize) {\n if (borderBoxSize) {\n const { inlineSize, blockSize } = borderBoxSize[0];\n return { width: inlineSize, height: blockSize };\n }\n else if (target instanceof SVGElement && \"getBBox\" in target) {\n return target.getBBox();\n }\n else {\n return {\n width: target.offsetWidth,\n height: target.offsetHeight,\n };\n }\n}\nfunction notifyTarget({ target, contentRect, borderBoxSize, }) {\n var _a;\n (_a = resizeHandlers.get(target)) === null || _a === void 0 ? void 0 : _a.forEach((handler) => {\n handler({\n target,\n contentSize: contentRect,\n get size() {\n return getElementSize(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer === null || observer === void 0 ? void 0 : observer.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.delete(handler);\n if (!(elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.size)) {\n observer === null || observer === void 0 ? void 0 : observer.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const size = {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n const info = {\n target: window,\n size,\n contentSize: size,\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size && windowResizeHandler) {\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n","import { resizeElement } from './handle-element.es.js';\nimport { resizeWindow } from './handle-window.es.js';\nimport { isFunction } from '@motionone/utils';\n\nfunction resize(a, b) {\n return isFunction(a) ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n","import { progress, velocityPerSecond } from '@motionone/utils';\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50;\nconst createAxisInfo = () => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n});\nconst createScrollInfo = () => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n});\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n};\nfunction updateAxisInfo(element, axisName, info, time) {\n const axis = info[axisName];\n const { length, position } = keys[axisName];\n const prev = axis.current;\n const prevTime = info.time;\n axis.current = element[\"scroll\" + position];\n axis.scrollLength = element[\"scroll\" + length] - element[\"client\" + length];\n axis.offset.length = 0;\n axis.offset[0] = 0;\n axis.offset[1] = axis.scrollLength;\n axis.progress = progress(0, axis.scrollLength, axis.current);\n const elapsed = time - prevTime;\n axis.velocity =\n elapsed > maxElapsed ? 0 : velocityPerSecond(axis.current - prev, elapsed);\n}\nfunction updateScrollInfo(element, info, time) {\n updateAxisInfo(element, \"x\", info, time);\n updateAxisInfo(element, \"y\", info, time);\n info.time = time;\n}\n\nexport { createScrollInfo, updateScrollInfo };\n","const ScrollOffset = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n};\n\nexport { ScrollOffset };\n","import { isString, isNumber } from '@motionone/utils';\n\nconst namedEdges = {\n start: 0,\n center: 0.5,\n end: 1,\n};\nfunction resolveEdge(edge, length, inset = 0) {\n let delta = 0;\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (namedEdges[edge] !== undefined) {\n edge = namedEdges[edge];\n }\n /**\n * Handle unit values\n */\n if (isString(edge)) {\n const asNumber = parseFloat(edge);\n if (edge.endsWith(\"px\")) {\n delta = asNumber;\n }\n else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100;\n }\n else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth;\n }\n else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight;\n }\n else {\n edge = asNumber;\n }\n }\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (isNumber(edge)) {\n delta = length * edge;\n }\n return inset + delta;\n}\n\nexport { namedEdges, resolveEdge };\n","import { isNumber, isString } from '@motionone/utils';\nimport { resolveEdge, namedEdges } from './edge.es.js';\n\nconst defaultOffset = [0, 0];\nfunction resolveOffset(offset, containerLength, targetLength, targetInset) {\n let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;\n let targetPoint = 0;\n let containerPoint = 0;\n if (isNumber(offset)) {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset];\n }\n else if (isString(offset)) {\n offset = offset.trim();\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \");\n }\n else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset] ? offset : `0`];\n }\n }\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);\n containerPoint = resolveEdge(offsetDefinition[1], containerLength);\n return targetPoint - containerPoint;\n}\n\nexport { resolveOffset };\n","import { interpolate, defaultOffset } from '@motionone/utils';\nimport { calcInset } from './inset.es.js';\nimport { ScrollOffset } from './presets.es.js';\nimport { resolveOffset } from './offset.es.js';\n\nconst point = { x: 0, y: 0 };\nfunction resolveOffsets(container, info, options) {\n let { offset: offsetDefinition = ScrollOffset.All } = options;\n const { target = container, axis = \"y\" } = options;\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\";\n const inset = target !== container ? calcInset(target, container) : point;\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize = target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : { width: target.clientWidth, height: target.clientHeight };\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n };\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0;\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate;\n const numOffsets = offsetDefinition.length;\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);\n if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {\n hasChanged = true;\n }\n info[axis].offset[i] = offset;\n }\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(defaultOffset(numOffsets), info[axis].offset);\n info[axis].interpolatorOffsets = [...info[axis].offset];\n }\n info[axis].progress = info[axis].interpolate(info[axis].current);\n}\n\nexport { resolveOffsets };\n","function calcInset(element, container) {\n let inset = { x: 0, y: 0 };\n let current = element;\n while (current && current !== container) {\n if (current instanceof HTMLElement) {\n inset.x += current.offsetLeft;\n inset.y += current.offsetTop;\n current = current.offsetParent;\n }\n else if (current instanceof SVGGraphicsElement && \"getBBox\" in current) {\n const { top, left } = current.getBBox();\n inset.x += left;\n inset.y += top;\n /**\n * Assign the next parent element as the tag.\n */\n while (current && current.tagName !== \"svg\") {\n current = current.parentNode;\n }\n }\n }\n return inset;\n}\n\nexport { calcInset };\n","import { isFunction, noopReturn } from '@motionone/utils';\nimport { updateScrollInfo } from './info.es.js';\nimport { resolveOffsets } from './offsets/index.es.js';\n\nfunction measure(container, target = container, info) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0;\n info.y.targetOffset = 0;\n if (target !== container) {\n let node = target;\n while (node && node != container) {\n info.x.targetOffset += node.offsetLeft;\n info.y.targetOffset += node.offsetTop;\n node = node.offsetParent;\n }\n }\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth;\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight;\n info.x.containerLength = container.clientWidth;\n info.y.containerLength = container.clientHeight;\n}\nfunction createOnScrollHandler(element, onScroll, info, options = {}) {\n const axis = options.axis || \"y\";\n return {\n measure: () => measure(element, options.target, info),\n update: (time) => {\n updateScrollInfo(element, info, time);\n if (options.offset || options.target) {\n resolveOffsets(element, info, options);\n }\n },\n notify: isFunction(onScroll)\n ? () => onScroll(info)\n : scrubAnimation(onScroll, info[axis]),\n };\n}\nfunction scrubAnimation(controls, axisInfo) {\n controls.pause();\n controls.forEachNative((animation, { easing }) => {\n var _a, _b;\n if (animation.updateDuration) {\n if (!easing)\n animation.easing = noopReturn;\n animation.updateDuration(1);\n }\n else {\n const timingOptions = { duration: 1000 };\n if (!easing)\n timingOptions.easing = \"linear\";\n (_b = (_a = animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming) === null || _b === void 0 ? void 0 : _b.call(_a, timingOptions);\n }\n });\n return () => {\n controls.currentTime = axisInfo.progress;\n };\n}\n\nexport { createOnScrollHandler };\n","import { __rest } from 'tslib';\nimport { resize } from '../resize/index.es.js';\nimport { createScrollInfo } from './info.es.js';\nimport { createOnScrollHandler } from './on-scroll-handler.es.js';\n\nconst scrollListeners = new WeakMap();\nconst resizeListeners = new WeakMap();\nconst onScrollHandlers = new WeakMap();\nconst getEventTarget = (element) => element === document.documentElement ? window : element;\nfunction scroll(onScroll, _a = {}) {\n var { container = document.documentElement } = _a, options = __rest(_a, [\"container\"]);\n let containerHandlers = onScrollHandlers.get(container);\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set();\n onScrollHandlers.set(container, containerHandlers);\n }\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo();\n const containerHandler = createOnScrollHandler(container, onScroll, info, options);\n containerHandlers.add(containerHandler);\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const listener = () => {\n const time = performance.now();\n for (const handler of containerHandlers)\n handler.measure();\n for (const handler of containerHandlers)\n handler.update(time);\n for (const handler of containerHandlers)\n handler.notify();\n };\n scrollListeners.set(container, listener);\n const target = getEventTarget(container);\n window.addEventListener(\"resize\", listener, { passive: true });\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener));\n }\n target.addEventListener(\"scroll\", listener, { passive: true });\n }\n const listener = scrollListeners.get(container);\n const onLoadProcesss = requestAnimationFrame(listener);\n return () => {\n var _a;\n if (typeof onScroll !== \"function\")\n onScroll.stop();\n cancelAnimationFrame(onLoadProcesss);\n /**\n * Check if we even have any handlers for this container.\n */\n const containerHandlers = onScrollHandlers.get(container);\n if (!containerHandlers)\n return;\n containerHandlers.delete(containerHandler);\n if (containerHandlers.size)\n return;\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const listener = scrollListeners.get(container);\n scrollListeners.delete(container);\n if (listener) {\n getEventTarget(container).removeEventListener(\"scroll\", listener);\n (_a = resizeListeners.get(container)) === null || _a === void 0 ? void 0 : _a();\n window.removeEventListener(\"resize\", listener);\n }\n };\n}\n\nexport { scroll };\n","import { isVariant } from './is-variant.es.js';\n\nfunction resolveVariant(definition, variants) {\n if (isVariant(definition)) {\n return definition;\n }\n else if (definition && variants) {\n return variants[definition];\n }\n}\n\nexport { resolveVariant };\n","function isVariant(definition) {\n return typeof definition === \"object\";\n}\n\nexport { isVariant };\n","import { addUniqueItem, removeItem } from '@motionone/utils';\n\nlet scheduled = undefined;\nfunction processScheduledAnimations() {\n if (!scheduled)\n return;\n const generators = scheduled.sort(compareByDepth).map(fireAnimateUpdates);\n generators.forEach(fireNext);\n generators.forEach(fireNext);\n scheduled = undefined;\n}\nfunction scheduleAnimation(state) {\n if (!scheduled) {\n scheduled = [state];\n requestAnimationFrame(processScheduledAnimations);\n }\n else {\n addUniqueItem(scheduled, state);\n }\n}\nfunction unscheduleAnimation(state) {\n scheduled && removeItem(scheduled, state);\n}\nconst compareByDepth = (a, b) => a.getDepth() - b.getDepth();\nconst fireAnimateUpdates = (state) => state.animateUpdates();\nconst fireNext = (iterator) => iterator.next();\n\nexport { scheduleAnimation, unscheduleAnimation };\n","const motionEvent = (name, target) => new CustomEvent(name, { detail: { target } });\nfunction dispatchPointerEvent(element, name, event) {\n element.dispatchEvent(new CustomEvent(name, { detail: { originalEvent: event } }));\n}\nfunction dispatchViewEvent(element, name, entry) {\n element.dispatchEvent(new CustomEvent(name, { detail: { originalEntry: entry } }));\n}\n\nexport { dispatchPointerEvent, dispatchViewEvent, motionEvent };\n","import { __rest } from 'tslib';\nimport { dispatchViewEvent } from '../utils/events.es.js';\nimport { inView as inView$1 } from '../../gestures/in-view.es.js';\n\nconst inView = {\n isActive: (options) => Boolean(options.inView),\n subscribe: (element, { enable, disable }, { inViewOptions = {} }) => {\n const { once } = inViewOptions, viewOptions = __rest(inViewOptions, [\"once\"]);\n return inView$1(element, (enterEntry) => {\n enable();\n dispatchViewEvent(element, \"viewenter\", enterEntry);\n if (!once) {\n return (leaveEntry) => {\n disable();\n dispatchViewEvent(element, \"viewleave\", leaveEntry);\n };\n }\n }, viewOptions);\n },\n};\n\nexport { inView };\n","import { dispatchPointerEvent } from '../utils/events.es.js';\n\nconst mouseEvent = (element, name, action) => (event) => {\n if (event.pointerType && event.pointerType !== \"mouse\")\n return;\n action();\n dispatchPointerEvent(element, name, event);\n};\nconst hover = {\n isActive: (options) => Boolean(options.hover),\n subscribe: (element, { enable, disable }) => {\n const onEnter = mouseEvent(element, \"hoverstart\", enable);\n const onLeave = mouseEvent(element, \"hoverend\", disable);\n element.addEventListener(\"pointerenter\", onEnter);\n element.addEventListener(\"pointerleave\", onLeave);\n return () => {\n element.removeEventListener(\"pointerenter\", onEnter);\n element.removeEventListener(\"pointerleave\", onLeave);\n };\n },\n};\n\nexport { hover };\n","import { __rest } from 'tslib';\nimport { invariant } from 'hey-listen';\nimport { noop } from '@motionone/utils';\nimport { animateStyle } from '../animate/animate-style.es.js';\nimport { style } from '../animate/style.es.js';\nimport { getOptions } from '../animate/utils/options.es.js';\nimport { hasChanged } from './utils/has-changed.es.js';\nimport { resolveVariant } from './utils/resolve-variant.es.js';\nimport { scheduleAnimation, unscheduleAnimation } from './utils/schedule.es.js';\nimport { inView } from './gestures/in-view.es.js';\nimport { hover } from './gestures/hover.es.js';\nimport { press } from './gestures/press.es.js';\nimport { motionEvent } from './utils/events.es.js';\nimport { Animation } from '@motionone/animation';\n\nconst gestures = { inView, hover, press };\n/**\n * A list of state types, in priority order. If a value is defined in\n * a righter-most type, it will override any definition in a lefter-most.\n */\nconst stateTypes = [\"initial\", \"animate\", ...Object.keys(gestures), \"exit\"];\n/**\n * A global store of all generated motion states. This can be used to lookup\n * a motion state for a given Element.\n */\nconst mountedStates = new WeakMap();\nfunction createMotionState(options = {}, parent) {\n /**\n * The element represented by the motion state. This is an empty reference\n * when we create the state to support SSR and allow for later mounting\n * in view libraries.\n *\n * @ts-ignore\n */\n let element;\n /**\n * Calculate a depth that we can use to order motion states by tree depth.\n */\n let depth = parent ? parent.getDepth() + 1 : 0;\n /**\n * Track which states are currently active.\n */\n const activeStates = { initial: true, animate: true };\n /**\n * A map of functions that, when called, will remove event listeners for\n * a given gesture.\n */\n const gestureSubscriptions = {};\n /**\n * Initialise a context to share through motion states. This\n * will be populated by variant names (if any).\n */\n const context = {};\n for (const name of stateTypes) {\n context[name] =\n typeof options[name] === \"string\"\n ? options[name]\n : parent === null || parent === void 0 ? void 0 : parent.getContext()[name];\n }\n /**\n * If initial is set to false we use the animate prop as the initial\n * animation state.\n */\n const initialVariantSource = options.initial === false ? \"animate\" : \"initial\";\n /**\n * Destructure an initial target out from the resolved initial variant.\n */\n let _a = resolveVariant(options[initialVariantSource] || context[initialVariantSource], options.variants) || {}, target = __rest(_a, [\"transition\"]);\n /**\n * The base target is a cached map of values that we'll use to animate\n * back to if a value is removed from all active state types. This\n * is usually the initial value as read from the DOM, for instance if\n * it hasn't been defined in initial.\n */\n const baseTarget = Object.assign({}, target);\n /**\n * A generator that will be processed by the global animation scheduler.\n * This yeilds when it switches from reading the DOM to writing to it\n * to prevent layout thrashing.\n */\n function* animateUpdates() {\n var _a, _b;\n const prevTarget = target;\n target = {};\n const animationOptions = {};\n for (const name of stateTypes) {\n if (!activeStates[name])\n continue;\n const variant = resolveVariant(options[name]);\n if (!variant)\n continue;\n for (const key in variant) {\n if (key === \"transition\")\n continue;\n target[key] = variant[key];\n animationOptions[key] = getOptions((_b = (_a = variant.transition) !== null && _a !== void 0 ? _a : options.transition) !== null && _b !== void 0 ? _b : {}, key);\n }\n }\n const allTargetKeys = new Set([\n ...Object.keys(target),\n ...Object.keys(prevTarget),\n ]);\n const animationFactories = [];\n allTargetKeys.forEach((key) => {\n var _a;\n if (target[key] === undefined) {\n target[key] = baseTarget[key];\n }\n if (hasChanged(prevTarget[key], target[key])) {\n (_a = baseTarget[key]) !== null && _a !== void 0 ? _a : (baseTarget[key] = style.get(element, key));\n animationFactories.push(animateStyle(element, key, target[key], animationOptions[key], Animation));\n }\n });\n // Wait for all animation states to read from the DOM\n yield;\n const animations = animationFactories\n .map((factory) => factory())\n .filter(Boolean);\n if (!animations.length)\n return;\n const animationTarget = target;\n element.dispatchEvent(motionEvent(\"motionstart\", animationTarget));\n Promise.all(animations.map((animation) => animation.finished))\n .then(() => {\n element.dispatchEvent(motionEvent(\"motioncomplete\", animationTarget));\n })\n .catch(noop);\n }\n const setGesture = (name, isActive) => () => {\n activeStates[name] = isActive;\n scheduleAnimation(state);\n };\n const updateGestureSubscriptions = () => {\n for (const name in gestures) {\n const isGestureActive = gestures[name].isActive(options);\n const remove = gestureSubscriptions[name];\n if (isGestureActive && !remove) {\n gestureSubscriptions[name] = gestures[name].subscribe(element, {\n enable: setGesture(name, true),\n disable: setGesture(name, false),\n }, options);\n }\n else if (!isGestureActive && remove) {\n remove();\n delete gestureSubscriptions[name];\n }\n }\n };\n const state = {\n update: (newOptions) => {\n if (!element)\n return;\n options = newOptions;\n updateGestureSubscriptions();\n scheduleAnimation(state);\n },\n setActive: (name, isActive) => {\n if (!element)\n return;\n activeStates[name] = isActive;\n scheduleAnimation(state);\n },\n animateUpdates,\n getDepth: () => depth,\n getTarget: () => target,\n getOptions: () => options,\n getContext: () => context,\n mount: (newElement) => {\n invariant(Boolean(newElement), \"Animation state must be mounted with valid Element\");\n element = newElement;\n mountedStates.set(element, state);\n updateGestureSubscriptions();\n return () => {\n mountedStates.delete(element);\n unscheduleAnimation(state);\n for (const key in gestureSubscriptions) {\n gestureSubscriptions[key]();\n }\n };\n },\n isMounted: () => Boolean(element),\n };\n return state;\n}\n\nexport { createMotionState, mountedStates };\n","import { dispatchPointerEvent } from '../utils/events.es.js';\n\nconst press = {\n isActive: (options) => Boolean(options.press),\n subscribe: (element, { enable, disable }) => {\n const onPointerUp = (event) => {\n disable();\n dispatchPointerEvent(element, \"pressend\", event);\n window.removeEventListener(\"pointerup\", onPointerUp);\n };\n const onPointerDown = (event) => {\n enable();\n dispatchPointerEvent(element, \"pressstart\", event);\n window.addEventListener(\"pointerup\", onPointerUp);\n };\n element.addEventListener(\"pointerdown\", onPointerDown);\n return () => {\n element.removeEventListener(\"pointerdown\", onPointerDown);\n window.removeEventListener(\"pointerup\", onPointerUp);\n };\n },\n};\n\nexport { press };\n","function hasChanged(a, b) {\n if (typeof a !== typeof b)\n return true;\n if (Array.isArray(a) && Array.isArray(b))\n return !shallowCompare(a, b);\n return a !== b;\n}\nfunction shallowCompare(next, prev) {\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { hasChanged, shallowCompare };\n","import { isNumber } from '@motionone/utils';\nimport { isTransform, transformAlias, asTransformCssVar, transformDefinitions, buildTransformTemplate } from './transforms.es.js';\n\nfunction createStyles(keyframes) {\n const initialKeyframes = {};\n const transformKeys = [];\n for (let key in keyframes) {\n const value = keyframes[key];\n if (isTransform(key)) {\n if (transformAlias[key])\n key = transformAlias[key];\n transformKeys.push(key);\n key = asTransformCssVar(key);\n }\n let initialKeyframe = Array.isArray(value) ? value[0] : value;\n /**\n * If this is a number and we have a default value type, convert the number\n * to this type.\n */\n const definition = transformDefinitions.get(key);\n if (definition) {\n initialKeyframe = isNumber(value)\n ? definition.toDefaultUnit(value)\n : value;\n }\n initialKeyframes[key] = initialKeyframe;\n }\n if (transformKeys.length) {\n initialKeyframes.transform = buildTransformTemplate(transformKeys);\n }\n return initialKeyframes;\n}\n\nexport { createStyles };\n","import { createStyles } from './style-object.es.js';\n\nconst camelLetterToPipeLetter = (letter) => `-${letter.toLowerCase()}`;\nconst camelToPipeCase = (str) => str.replace(/[A-Z]/g, camelLetterToPipeLetter);\nfunction createStyleString(target = {}) {\n const styles = createStyles(target);\n let style = \"\";\n for (const key in styles) {\n style += key.startsWith(\"--\") ? key : camelToPipeCase(key);\n style += `: ${styles[key]}; `;\n }\n return style;\n}\n\nexport { createStyleString };\n","import { Animation } from '@motionone/animation';\nimport { createAnimate } from './create-animate.es.js';\n\nconst animate = createAnimate(Animation);\n\nexport { animate };\n","import { animate as animate$1, withControls } from '@motionone/dom';\nimport { isFunction } from '@motionone/utils';\nimport { Animation } from '@motionone/animation';\n\nfunction animateProgress(target, options = {}) {\n return withControls([\n () => {\n const animation = new Animation(target, [0, 1], options);\n animation.finished.catch(() => { });\n return animation;\n },\n ], options, options.duration);\n}\nfunction animate(target, keyframesOrOptions, options) {\n const factory = isFunction(target) ? animateProgress : animate$1;\n return factory(target, keyframesOrOptions, options);\n}\n\nexport { animate, animateProgress };\n","export * from '@motionone/dom';\nexport * from '@motionone/types';\nexport { animate } from './animate.es.js';\n"],"sourceRoot":""}