framer-motion 12.24.0 → 12.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/dom.js +15 -0
- package/dist/cjs/dom.js.map +1 -1
- package/dist/cjs/{feature-bundle-DhbxBqkJ.js → feature-bundle-DBjkFz2c.js} +24 -2
- package/dist/cjs/feature-bundle-DBjkFz2c.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/m.js +15 -0
- package/dist/cjs/m.js.map +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/components/Reorder/Item.mjs.map +1 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +8 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs.map +1 -1
- package/dist/es/render/svg/utils/build-attrs.mjs +15 -0
- package/dist/es/render/svg/utils/build-attrs.mjs.map +1 -1
- package/dist/framer-motion.dev.js +23 -1
- package/dist/framer-motion.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-animate.js.map +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-m.js.map +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -2
- package/dist/cjs/feature-bundle-DhbxBqkJ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size-rollup-animate.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/wrap.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/stats/buffer.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/spring/defaults.mjs","../../motion-dom/dist/es/animation/generators/spring/find.mjs","../../motion-dom/dist/es/animation/generators/spring/index.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../lib/animation/utils/is-dom-keyframes.js","../lib/animation/animate/resolve-subjects.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/sequence/utils/calc-repeat-duration.js","../lib/animation/sequence/utils/calc-time.js","../lib/animation/sequence/utils/edit.js","../lib/animation/sequence/utils/normalize-times.js","../lib/animation/sequence/utils/sort.js","../lib/animation/sequence/create.js","../lib/render/store.js","../lib/render/utils/resolve-variants.js","../lib/render/utils/setters.js","../lib/animation/utils/is-keyframes-target.js","../lib/render/utils/resolve-dynamic-variants.js","../lib/value/use-will-change/add-will-change.js","../lib/value/use-will-change/is.js","../lib/render/dom/utils/camel-to-dash.js","../lib/animation/optimized-appear/data-id.js","../lib/animation/optimized-appear/get-appear-id.js","../lib/animation/animators/waapi/utils/get-final-keyframe.js","../lib/animation/utils/default-transitions.js","../lib/animation/interfaces/motion-value.js","../lib/animation/utils/is-transition-defined.js","../lib/animation/interfaces/visual-element-target.js","../lib/motion/features/definitions.js","../lib/projection/geometry/models.js","../lib/utils/is-browser.js","../lib/utils/reduced-motion/state.js","../lib/render/utils/variant-props.js","../lib/render/utils/is-controlling-variants.js","../lib/animation/utils/is-animation-controls.js","../lib/render/utils/is-variant-label.js","../lib/render/VisualElement.js","../lib/utils/reduced-motion/index.js","../lib/render/utils/motion-values.js","../lib/render/dom/DOMVisualElement.js","../lib/render/html/utils/build-transform.js","../lib/render/html/utils/build-styles.js","../lib/render/html/utils/render.js","../lib/projection/styles/scale-border-radius.js","../lib/projection/styles/scale-box-shadow.js","../lib/projection/styles/scale-correction.js","../lib/motion/utils/is-forced-motion-value.js","../lib/render/html/utils/scrape-motion-values.js","../lib/render/html/HTMLVisualElement.js","../lib/projection/utils/measure.js","../lib/projection/geometry/conversion.js","../lib/render/object/ObjectVisualElement.js","../lib/render/svg/utils/path.js","../lib/render/svg/utils/build-attrs.js","../lib/render/svg/utils/camel-case-attrs.js","../lib/render/svg/SVGVisualElement.js","../lib/render/svg/utils/scrape-motion-values.js","../lib/render/svg/utils/render.js","../lib/render/svg/utils/is-svg-tag.js","../lib/animation/utils/create-visual-element.js","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../lib/animation/animate/subject.js","../lib/animation/animate/single-value.js","../lib/animation/animate/sequence.js","../lib/animation/animate/index.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\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","const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\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 noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\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 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) *\n 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 noop;\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","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n","import { wrap } from '../../wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n","const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n\nexport { statsBuffer };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n\nexport { isCSSVariableName, isCSSVariableToken };\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n","const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n","import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n","import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs';\nimport { createGeneratorEasing } from '../utils/create-generator-easing.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\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 = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\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 - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\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) <= restDelta;\n state.value = 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.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (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 return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\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(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\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 = Math.min(this.currentTime, totalDuration) / resolvedDuration;\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 /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n","import { memo } from 'motion-utils';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n if (!this.isPseudoElement) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n","import { anticipate, backInOut, circInOut } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n","import { secondsToMilliseconds } from 'motion-utils';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n","import { memo } from 'motion-utils';\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element: resolvedOptions.motionValue.owner.current,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => this.notifyFinished()).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null)\n return false;\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n","function getValueTransition(transition, key) {\n return (transition?.[key] ??\n transition?.[\"default\"] ??\n transition);\n}\n\nexport { getValueTransition };\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n","export function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n//# sourceMappingURL=is-dom-keyframes.js.map","import { resolveElements, } from \"motion-dom\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nexport function resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject;\n }\n else {\n return [subject];\n }\n}\n//# sourceMappingURL=resolve-subjects.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector);\n}\n\nexport { resolveElements };\n","export function calculateRepeatDuration(duration, repeat, _repeatDelay) {\n return duration * (repeat + 1);\n}\n//# sourceMappingURL=calc-repeat-duration.js.map","/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(current, next, prev, labels) {\n if (typeof next === \"number\") {\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 if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)));\n }\n else {\n return labels.get(next) ?? current;\n }\n}\n//# sourceMappingURL=calc-time.js.map","import { mixNumber } from \"motion-dom\";\nimport { getEasingForSegment, removeItem } from \"motion-utils\";\nexport function 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}\nexport function 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: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n });\n }\n}\n//# sourceMappingURL=edit.js.map","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times, repeat) {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1);\n }\n}\n//# sourceMappingURL=normalize-times.js.map","export function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n//# sourceMappingURL=sort.js.map","import { createGeneratorEasing, defaultOffset, fillOffset, isGenerator, isMotionValue, } from \"motion-dom\";\nimport { getEasingForSegment, invariant, progress, secondsToMilliseconds, } from \"motion-utils\";\nimport { resolveSubjects } from \"../animate/resolve-subjects\";\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\";\nimport { calcNextTime } from \"./utils/calc-time\";\nimport { addKeyframes } from \"./utils/edit\";\nimport { normalizeTimes } from \"./utils/normalize-times\";\nimport { compareByTime } from \"./utils/sort\";\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nexport function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = 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 sequence 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 < sequence.length; i++) {\n const segment = sequence[i];\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\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 let [subject, keyframes, transition = {}] = 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 (transition.at !== undefined) {\n currentTime = calcNextTime(currentTime, transition.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 const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length;\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"];\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100;\n if (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = { ...remainingTransition };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration ?? (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1;\n }\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length;\n remainder > 0 && fillOffset(times, 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 valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null);\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(repeat < MAX_REPEAT, \"Repeat count too high, must be less than 20\", \"repeat-count-high\");\n duration = calculateRepeatDuration(duration, repeat, repeatDelay);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(originalEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\n }\n /**\n * For every element and value combination create a new animation.\n */\n sequences.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 || \"easeOut\");\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(defaultSegmentEasing);\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 if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\n definition.transition[key] = {\n ...defaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nexport function getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n//# sourceMappingURL=create.js.map","export const visualElementStore = new WeakMap();\n//# sourceMappingURL=store.js.map","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nexport function resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n//# sourceMappingURL=resolve-variants.js.map","import { motionValue } from \"motion-dom\";\nimport { isKeyframesTarget } from \"../../animation/utils/is-keyframes-target\";\nimport { resolveVariant } from \"./resolve-dynamic-variants\";\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nexport function setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n//# sourceMappingURL=setters.js.map","export const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n//# sourceMappingURL=is-keyframes-target.js.map","import { resolveVariantFromProps } from \"./resolve-variants\";\nexport function resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n//# sourceMappingURL=resolve-dynamic-variants.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { isWillChangeMotionValue } from \"./is\";\nexport function addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n//# sourceMappingURL=add-will-change.js.map","import { isMotionValue } from \"motion-dom\";\nexport function isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n//# sourceMappingURL=is.js.map","/**\n * Convert camelCase to dash-case properties.\n */\nexport const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, \"$1-$2\").toLowerCase();\n//# sourceMappingURL=camel-to-dash.js.map","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\";\nexport const optimizedAppearDataId = \"framerAppearId\";\nexport const optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n//# sourceMappingURL=data-id.js.map","import { optimizedAppearDataAttribute } from \"./data-id\";\nexport function getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n//# sourceMappingURL=get-appear-id.js.map","const isNotNull = (value) => value !== null;\nexport function getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n//# sourceMappingURL=get-final-keyframe.js.map","import { transformProps } from \"motion-dom\";\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nexport const getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n//# sourceMappingURL=default-transitions.js.map","import { AsyncMotionValueAnimation, frame, getValueTransition, JSAnimation, makeAnimationInstant, } from \"motion-dom\";\nimport { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\";\nimport { getFinalKeyframe } from \"../animators/waapi/utils/get-final-keyframe\";\nimport { getDefaultTransition } from \"../utils/default-transitions\";\nimport { isTransitionDefined } from \"../utils/is-transition-defined\";\nexport const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n//# sourceMappingURL=motion-value.js.map","/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n//# sourceMappingURL=is-transition-defined.js.map","import { frame, getValueTransition, positionalKeys, } from \"motion-dom\";\nimport { setTarget } from \"../../render/utils/setters\";\nimport { addValueToWillChange } from \"../../value/use-will-change/add-will-change\";\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\";\nimport { animateMotionValue } from \"./motion-value\";\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nexport function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n//# sourceMappingURL=visual-element-target.js.map","const featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nexport const featureDefinitions = {};\nfor (const key in featureProps) {\n featureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n}\n//# sourceMappingURL=definitions.js.map","export const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nexport const createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nexport const createAxis = () => ({ min: 0, max: 0 });\nexport const createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n//# sourceMappingURL=models.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion = { current: null };\nexport const hasReducedMotionListener = { current: false };\n//# sourceMappingURL=state.js.map","export const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nexport const variantProps = [\"initial\", ...variantPriorityOrder];\n//# sourceMappingURL=variant-props.js.map","import { isAnimationControls } from \"../../animation/utils/is-animation-controls\";\nimport { isVariantLabel } from \"./is-variant-label\";\nimport { variantProps } from \"./variant-props\";\nexport function isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nexport function isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n//# sourceMappingURL=is-controlling-variants.js.map","export function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n//# sourceMappingURL=is-animation-controls.js.map","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n//# sourceMappingURL=is-variant-label.js.map","import { cancelFrame, complex, findValueType, frame, getAnimatableNone, isMotionValue, KeyframeResolver, microtask, motionValue, time, transformProps, } from \"motion-dom\";\nimport { isNumericalString, isZeroValueString, SubscriptionManager, warnOnce, } from \"motion-utils\";\nimport { featureDefinitions } from \"../motion/features/definitions\";\nimport { createBox } from \"../projection/geometry/models\";\nimport { initPrefersReducedMotion } from \"../utils/reduced-motion\";\nimport { hasReducedMotionListener, prefersReducedMotion, } from \"../utils/reduced-motion/state\";\nimport { visualElementStore } from \"./store\";\nimport { isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, } from \"./utils/is-controlling-variants\";\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\";\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\";\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport class VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = checkIsControllingVariants(props);\n this.isVariantNode = checkIsVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion =\n this.reducedMotionConfig === \"never\"\n ? false\n : this.reducedMotionConfig === \"always\"\n ? true\n : prefersReducedMotion.current;\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n//# sourceMappingURL=VisualElement.js.map","import { isBrowser } from \"../is-browser\";\nimport { hasReducedMotionListener, prefersReducedMotion } from \"./state\";\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n//# sourceMappingURL=index.js.map","import { isMotionValue, motionValue } from \"motion-dom\";\nexport function updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n//# sourceMappingURL=motion-values.js.map","import { DOMKeyframesResolver, isMotionValue, } from \"motion-dom\";\nimport { VisualElement } from \"../VisualElement\";\nexport class DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n return props.style\n ? props.style[key]\n : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n//# sourceMappingURL=DOMVisualElement.js.map","import { getValueAsType, numberValueTypes, transformPropOrder, } from \"motion-dom\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n valueIsDefault = parseFloat(value) === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n//# sourceMappingURL=build-transform.js.map","import { getValueAsType, isCSSVariableName, numberValueTypes, transformProps, } from \"motion-dom\";\nimport { buildTransform } from \"./build-transform\";\nexport function buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n//# sourceMappingURL=build-styles.js.map","export function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n//# sourceMappingURL=render.js.map","import { px } from \"motion-dom\";\nexport function pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n//# sourceMappingURL=scale-border-radius.js.map","import { complex, mixNumber } from \"motion-dom\";\nexport const correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n//# sourceMappingURL=scale-box-shadow.js.map","import { isCSSVariableName } from \"motion-dom\";\nimport { correctBorderRadius } from \"./scale-border-radius\";\nimport { correctBoxShadow } from \"./scale-box-shadow\";\nexport const scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nexport function addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n//# sourceMappingURL=scale-correction.js.map","import { transformProps } from \"motion-dom\";\nimport { scaleCorrectors } from \"../../projection/styles/scale-correction\";\nexport function isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n//# sourceMappingURL=is-forced-motion-value.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isForcedMotionValue } from \"../../../motion/utils/is-forced-motion-value\";\nexport function scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const { style } = props;\n const newValues = {};\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevProps.style &&\n isMotionValue(prevProps.style[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n//# sourceMappingURL=scrape-motion-values.js.map","import { defaultTransformValue, isCSSVariableName, readTransformValue, transformProps, } from \"motion-dom\";\nimport { measureViewportBox } from \"../../projection/utils/measure\";\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\";\nimport { buildHTMLStyles } from \"./utils/build-styles\";\nimport { renderHTML } from \"./utils/render\";\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\";\nexport function getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nexport class HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n//# sourceMappingURL=HTMLVisualElement.js.map","import { convertBoundingBoxToBox, transformBoxPoints, } from \"../geometry/conversion\";\nimport { translateAxis } from \"../geometry/delta-apply\";\nexport function measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nexport function measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n//# sourceMappingURL=measure.js.map","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nexport function convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n//# sourceMappingURL=conversion.js.map","import { createBox } from \"../../projection/geometry/models\";\nimport { VisualElement } from \"../VisualElement\";\nfunction isObjectKey(key, object) {\n return key in object;\n}\nexport class ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n//# sourceMappingURL=ObjectVisualElement.js.map","import { px } from \"motion-dom\";\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n */\nexport function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n const pathLength = px.transform(length);\n const pathSpacing = px.transform(spacing);\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\n}\n//# sourceMappingURL=path.js.map","import { buildHTMLStyles } from \"../../html/utils/build-styles\";\nimport { buildSVGPath } from \"./path\";\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n//# sourceMappingURL=build-attrs.js.map","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n//# sourceMappingURL=camel-case-attrs.js.map","import { getDefaultValueType, transformProps, } from \"motion-dom\";\nimport { createBox } from \"../../projection/geometry/models\";\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\";\nimport { camelToDash } from \"../dom/utils/camel-to-dash\";\nimport { buildSVGAttrs } from \"./utils/build-attrs\";\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\";\nimport { isSVGTag } from \"./utils/is-svg-tag\";\nimport { renderSVG } from \"./utils/render\";\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\";\nexport class SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n//# sourceMappingURL=SVGVisualElement.js.map","import { isMotionValue, transformPropOrder } from \"motion-dom\";\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\";\nexport function scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeHTMLMotionValuesFromProps(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n//# sourceMappingURL=scrape-motion-values.js.map","import { camelToDash } from \"../../dom/utils/camel-to-dash\";\nimport { renderHTML } from \"../../html/utils/render\";\nimport { camelCaseAttributes } from \"./camel-case-attrs\";\nexport function renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n//# sourceMappingURL=render.js.map","export const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n//# sourceMappingURL=is-svg-tag.js.map","import { isSVGElement, isSVGSVGElement } from \"motion-dom\";\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\";\nimport { ObjectVisualElement } from \"../../render/object/ObjectVisualElement\";\nimport { visualElementStore } from \"../../render/store\";\nimport { SVGVisualElement } from \"../../render/svg/SVGVisualElement\";\nexport function createDOMVisualElement(element) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n };\n const node = isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nexport function createObjectVisualElement(subject) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n };\n const node = new ObjectVisualElement(options);\n node.mount(subject);\n visualElementStore.set(subject, node);\n}\n//# sourceMappingURL=create-visual-element.js.map","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n","import { isMotionValue, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { visualElementStore } from \"../../render/store\";\nimport { animateTarget } from \"../interfaces/visual-element-target\";\nimport { createDOMVisualElement, createObjectVisualElement, } from \"../utils/create-visual-element\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nimport { resolveSubjects } from \"./resolve-subjects\";\nimport { animateSingleValue } from \"./single-value\";\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nexport function animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\", \"no-valid-elements\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n invariant(thisSubject !== null, \"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.\", \"animate-null\");\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n//# sourceMappingURL=subject.js.map","import { motionValue as createMotionValue, isMotionValue, } from \"motion-dom\";\nimport { animateMotionValue } from \"../interfaces/motion-value\";\nexport function animateSingleValue(value, keyframes, options) {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value);\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options));\n return motionValue.animation;\n}\n//# sourceMappingURL=single-value.js.map","import { spring, } from \"motion-dom\";\nimport { createAnimationsFromSequence } from \"../sequence/create\";\nimport { animateSubject } from \"./subject\";\nexport function animateSequence(sequence, options, scope) {\n const animations = [];\n const animationDefinitions = createAnimationsFromSequence(sequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n//# sourceMappingURL=sequence.js.map","import { GroupAnimationWithThen } from \"motion-dom\";\nimport { removeItem } from \"motion-utils\";\nimport { animateSequence } from \"./sequence\";\nimport { animateSubject } from \"./subject\";\nfunction isSequence(value) {\n return Array.isArray(value) && value.some(Array.isArray);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(scope) {\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n let animationOnComplete;\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(subjectOrSequence, optionsOrKeyframes, scope);\n }\n else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {};\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete;\n }\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, rest, scope);\n }\n const animation = new GroupAnimationWithThen(animations);\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete);\n }\n if (scope) {\n scope.animations.push(animation);\n animation.finished.then(() => {\n removeItem(scope.animations, animation);\n });\n }\n return animation;\n }\n return scopedAnimate;\n}\nexport const animate = createScopedAnimate();\n//# sourceMappingURL=index.js.map"],"names":["removeItem","arr","item","index","indexOf","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isZeroValueString","memo","callback","result","undefined","noop","any","combineFunctions","a","b","pipe","transformers","reduce","progress","from","to","value","toFromDifference","SubscriptionManager","constructor","this","subscriptions","add","handler","push","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isEasingArray","ease","Array","isArray","getEasingForSegment","rangeSize","wrap","isBezierDefinition","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","stepsOrder","statsBuffer","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","stepName","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","forEach","frameloop","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","frameSteps","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","complex","isNaN","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","createGeneratorEasing","options","createGenerator","keyframes","calcGeneratorVelocity","resolveValue","current","prevT","springDefaults","granular","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","exp","d","e","f","initialGuess","rootIterations","approximateRoot","stiffness","damping","durationKeys","physicsKeys","isSpringType","keys","some","spring","optionsOrVisualDuration","visualDuration","restSpeed","restDelta","isResolvedFromDuration","springOptions","root","PI","derived","getSpringOptions","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","cos","dampedAngularFreq","freqForT","sinh","cosh","calculatedDuration","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","toTransition","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","fillOffset","offset","remaining","offsetProgress","defaultOffset","keyframeValues","times","easingFunctions","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","applyToOptions","generatorOptions","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","includes","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","supportsScrollTimeline","ScrollTimeline","supportsFlags","memoSupports","supportsFlag","memoized","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","isCSSVar","style","setProperty","setStyle","commitStyles","effect","getComputedTiming","Number","playbackRate","playState","newStartTime","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","supportsWaapi","Element","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","subject","owner","HTMLElement","transformTemplate","getProps","supportsBrowserAnimation","catch","pendingTimeline","_onReject","finally","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","getMax","methodName","controls","GroupAnimationWithThen","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","getValueTransition","positionalKeys","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","getDefaultValueType","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","jump","finalKeyframeIndex","unsetTransformName","unsetTransformValue","getValueAsType","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","endAnimation","addDependent","removeDependent","getPrevious","getVelocity","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","microtask","cancelMicrotask","isSVGElement","isMotionValue","valueTypes","isDOMKeyframes","resolveSubjects","scope","selectorCache","elementOrSelector","EventTarget","elements","querySelectorAll","resolveElements","NodeList","calculateRepeatDuration","_repeatDelay","calcNextTime","labels","addKeyframes","sequence","endTime","at","eraseKeyframes","normalizeTimes","compareByTime","getSubjectSequence","sequences","getValueSequence","keyframesAsList","isNumber","isNumberKeyframesArray","every","visualElementStore","WeakMap","getValueState","resolveVariantFromProps","props","custom","variants","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","setTarget","resolveVariant","transitionEnd","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","animateMotionValue","valueTransition","when","_delay","delayChildren","staggerChildren","staggerDirection","isTransitionDefined","assign","shouldSkip","skipAnimations","isSync","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","animationTypeState","animationState","getState","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","featureProps","exit","drag","focus","hover","tap","pan","inView","layout","featureDefinitions","isEnabled","createBox","isBrowser","prefersReducedMotion","hasReducedMotionListener","variantProps","isControllingVariants","isVariantLabel","propEventHandlers","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","parent","presenceContext","reducedMotionConfig","blockInitialAnimation","visualState","children","isVariantNode","features","valueSubscriptions","prevMotionValues","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","checkIsControllingVariants","checkIsVariantNode","variantChildren","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","addEventListener","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","child","enteringChildren","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","sortNodePosition","other","sortInstanceNodePosition","updateFeatures","featureDefinition","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","transformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","variant","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransform","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","axis","correctBorderRadius","correct","node","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layoutId","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","transformPoint","convertBoundingBoxToBox","point","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","ObjectVisualElement","object","isObjectKey","dashKeys","array","camelKeys","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","camelCaseAttributes","SVGVisualElement","defaultType","getAttribute","scrapeHTMLMotionValuesFromProps","charAt","toUpperCase","_styleProp","setAttribute","renderSVG","tag","tagName","createDOMVisualElement","isSVGSVGElement","createObjectVisualElement","animateSubject","isSingleValue","createMotionValue","animateSingleValue","subjects","numSubjects","thisSubject","createVisualElement","animateSequence","animationDefinitions","defaultTransition","sequenceTransition","generators","defaultDuration","elementCache","timeLabels","prevTime","segment","maxDuration","resolveValueSequence","valueKeyframes","valueSequence","elementIndex","valueKeyframesAsList","remainingTransition","calculatedDelay","numKeyframes","absoluteDelta","springTransition","springEasing","remainder","unshift","originalKeyframes","originalTimes","originalEase","repeatIndex","keyframeIndex","targetTime","subjectIndex","subjectSequence","valueSequences","sort","valueOffset","valueEasing","createAnimationsFromSequence","createScopedAnimate","subjectOrSequence","optionsOrKeyframes","animationOnComplete","rest"],"mappings":"AAIA,SAASA,EAAWC,EAAKC,GACrB,MAAMC,EAAQF,EAAIG,QAAQF,GACtBC,GAAS,GACTF,EAAII,OAAOF,EAAO,EAC1B,CCRA,MAAMG,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD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0B,EADA1e,EAAa,GAEjB,GAdY/mB,EAcGulC,EAbZ1hC,MAAMC,QAAQ9D,IAAUA,EAAMiT,KAAKpP,MAAMC,SAcxCijB,EAAakc,GAAgBsC,EAAmBC,EAAoBtU,OAEnE,CAED,MAAMpV,WAAEA,KAAe4pB,GAASz0B,GAAW,CAAA,EACjB,mBAAf6K,IACP2pB,EAAsB3pB,GAE1BiL,EAAa0b,GAAe8C,EAAmBC,EAAoBE,EAAMxU,EAC5E,CAxBT,IAAoBlxB,EAyBZ,MAAMsjB,EAAY,IAAImE,GAAuBV,GAU7C,OATI0e,GACAniB,EAAU7K,SAASK,KAAK2sB,GAExBvU,IACAA,EAAMnK,WAAWvmB,KAAK8iB,GACtBA,EAAU7K,SAASK,KAAK,KACpBvb,EAAW2zB,EAAMnK,WAAYzD,MAG9BA,CACV,CAEL,CACY,MAAClB,GAAUkjB"}
|
|
1
|
+
{"version":3,"file":"size-rollup-animate.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/wrap.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/stats/buffer.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/spring/defaults.mjs","../../motion-dom/dist/es/animation/generators/spring/find.mjs","../../motion-dom/dist/es/animation/generators/spring/index.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../lib/animation/utils/is-dom-keyframes.js","../lib/animation/animate/resolve-subjects.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/sequence/utils/calc-repeat-duration.js","../lib/animation/sequence/utils/calc-time.js","../lib/animation/sequence/utils/edit.js","../lib/animation/sequence/utils/normalize-times.js","../lib/animation/sequence/utils/sort.js","../lib/animation/sequence/create.js","../lib/render/store.js","../lib/render/utils/resolve-variants.js","../lib/render/utils/setters.js","../lib/animation/utils/is-keyframes-target.js","../lib/render/utils/resolve-dynamic-variants.js","../lib/value/use-will-change/add-will-change.js","../lib/value/use-will-change/is.js","../lib/render/dom/utils/camel-to-dash.js","../lib/animation/optimized-appear/data-id.js","../lib/animation/optimized-appear/get-appear-id.js","../lib/animation/animators/waapi/utils/get-final-keyframe.js","../lib/animation/utils/default-transitions.js","../lib/animation/interfaces/motion-value.js","../lib/animation/utils/is-transition-defined.js","../lib/animation/interfaces/visual-element-target.js","../lib/motion/features/definitions.js","../lib/projection/geometry/models.js","../lib/utils/is-browser.js","../lib/utils/reduced-motion/state.js","../lib/render/utils/variant-props.js","../lib/render/utils/is-controlling-variants.js","../lib/animation/utils/is-animation-controls.js","../lib/render/utils/is-variant-label.js","../lib/render/VisualElement.js","../lib/utils/reduced-motion/index.js","../lib/render/utils/motion-values.js","../lib/render/dom/DOMVisualElement.js","../lib/render/html/utils/build-transform.js","../lib/render/html/utils/build-styles.js","../lib/render/html/utils/render.js","../lib/projection/styles/scale-border-radius.js","../lib/projection/styles/scale-box-shadow.js","../lib/projection/styles/scale-correction.js","../lib/motion/utils/is-forced-motion-value.js","../lib/render/html/utils/scrape-motion-values.js","../lib/render/html/HTMLVisualElement.js","../lib/projection/utils/measure.js","../lib/projection/geometry/conversion.js","../lib/render/object/ObjectVisualElement.js","../lib/render/svg/utils/path.js","../lib/render/svg/utils/build-attrs.js","../lib/render/svg/utils/camel-case-attrs.js","../lib/render/svg/SVGVisualElement.js","../lib/render/svg/utils/scrape-motion-values.js","../lib/render/svg/utils/render.js","../lib/render/svg/utils/is-svg-tag.js","../lib/animation/utils/create-visual-element.js","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../lib/animation/animate/subject.js","../lib/animation/animate/single-value.js","../lib/animation/animate/sequence.js","../lib/animation/animate/index.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\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","const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\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 noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\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 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) *\n 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 noop;\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","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n","import { wrap } from '../../wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n","const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n\nexport { statsBuffer };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n\nexport { isCSSVariableName, isCSSVariableToken };\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n","const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n","import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n","import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs';\nimport { createGeneratorEasing } from '../utils/create-generator-easing.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\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 = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\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 - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\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) <= restDelta;\n state.value = 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.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (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 return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\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(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\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 = Math.min(this.currentTime, totalDuration) / resolvedDuration;\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 /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n","import { memo } from 'motion-utils';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n if (!this.isPseudoElement) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n","import { anticipate, backInOut, circInOut } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n","import { secondsToMilliseconds } from 'motion-utils';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n","import { memo } from 'motion-utils';\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element: resolvedOptions.motionValue.owner.current,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => this.notifyFinished()).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null)\n return false;\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n","function getValueTransition(transition, key) {\n return (transition?.[key] ??\n transition?.[\"default\"] ??\n transition);\n}\n\nexport { getValueTransition };\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n","export function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n//# sourceMappingURL=is-dom-keyframes.js.map","import { resolveElements, } from \"motion-dom\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nexport function resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject;\n }\n else {\n return [subject];\n }\n}\n//# sourceMappingURL=resolve-subjects.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector);\n}\n\nexport { resolveElements };\n","export function calculateRepeatDuration(duration, repeat, _repeatDelay) {\n return duration * (repeat + 1);\n}\n//# sourceMappingURL=calc-repeat-duration.js.map","/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(current, next, prev, labels) {\n if (typeof next === \"number\") {\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 if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)));\n }\n else {\n return labels.get(next) ?? current;\n }\n}\n//# sourceMappingURL=calc-time.js.map","import { mixNumber } from \"motion-dom\";\nimport { getEasingForSegment, removeItem } from \"motion-utils\";\nexport function 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}\nexport function 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: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n });\n }\n}\n//# sourceMappingURL=edit.js.map","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times, repeat) {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1);\n }\n}\n//# sourceMappingURL=normalize-times.js.map","export function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n//# sourceMappingURL=sort.js.map","import { createGeneratorEasing, defaultOffset, fillOffset, isGenerator, isMotionValue, } from \"motion-dom\";\nimport { getEasingForSegment, invariant, progress, secondsToMilliseconds, } from \"motion-utils\";\nimport { resolveSubjects } from \"../animate/resolve-subjects\";\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\";\nimport { calcNextTime } from \"./utils/calc-time\";\nimport { addKeyframes } from \"./utils/edit\";\nimport { normalizeTimes } from \"./utils/normalize-times\";\nimport { compareByTime } from \"./utils/sort\";\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nexport function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = 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 sequence 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 < sequence.length; i++) {\n const segment = sequence[i];\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\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 let [subject, keyframes, transition = {}] = 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 (transition.at !== undefined) {\n currentTime = calcNextTime(currentTime, transition.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 const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length;\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"];\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100;\n if (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = { ...remainingTransition };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration ?? (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1;\n }\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length;\n remainder > 0 && fillOffset(times, 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 valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null);\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(repeat < MAX_REPEAT, \"Repeat count too high, must be less than 20\", \"repeat-count-high\");\n duration = calculateRepeatDuration(duration, repeat, repeatDelay);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(originalEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\n }\n /**\n * For every element and value combination create a new animation.\n */\n sequences.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 || \"easeOut\");\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(defaultSegmentEasing);\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 if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\n definition.transition[key] = {\n ...defaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nexport function getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n//# sourceMappingURL=create.js.map","export const visualElementStore = new WeakMap();\n//# sourceMappingURL=store.js.map","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nexport function resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n//# sourceMappingURL=resolve-variants.js.map","import { motionValue } from \"motion-dom\";\nimport { isKeyframesTarget } from \"../../animation/utils/is-keyframes-target\";\nimport { resolveVariant } from \"./resolve-dynamic-variants\";\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nexport function setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n//# sourceMappingURL=setters.js.map","export const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n//# sourceMappingURL=is-keyframes-target.js.map","import { resolveVariantFromProps } from \"./resolve-variants\";\nexport function resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n//# sourceMappingURL=resolve-dynamic-variants.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { isWillChangeMotionValue } from \"./is\";\nexport function addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n//# sourceMappingURL=add-will-change.js.map","import { isMotionValue } from \"motion-dom\";\nexport function isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n//# sourceMappingURL=is.js.map","/**\n * Convert camelCase to dash-case properties.\n */\nexport const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, \"$1-$2\").toLowerCase();\n//# sourceMappingURL=camel-to-dash.js.map","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\";\nexport const optimizedAppearDataId = \"framerAppearId\";\nexport const optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n//# sourceMappingURL=data-id.js.map","import { optimizedAppearDataAttribute } from \"./data-id\";\nexport function getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n//# sourceMappingURL=get-appear-id.js.map","const isNotNull = (value) => value !== null;\nexport function getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n//# sourceMappingURL=get-final-keyframe.js.map","import { transformProps } from \"motion-dom\";\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nexport const getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n//# sourceMappingURL=default-transitions.js.map","import { AsyncMotionValueAnimation, frame, getValueTransition, JSAnimation, makeAnimationInstant, } from \"motion-dom\";\nimport { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\";\nimport { getFinalKeyframe } from \"../animators/waapi/utils/get-final-keyframe\";\nimport { getDefaultTransition } from \"../utils/default-transitions\";\nimport { isTransitionDefined } from \"../utils/is-transition-defined\";\nexport const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n//# sourceMappingURL=motion-value.js.map","/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n//# sourceMappingURL=is-transition-defined.js.map","import { frame, getValueTransition, positionalKeys, } from \"motion-dom\";\nimport { setTarget } from \"../../render/utils/setters\";\nimport { addValueToWillChange } from \"../../value/use-will-change/add-will-change\";\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\";\nimport { animateMotionValue } from \"./motion-value\";\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nexport function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n//# sourceMappingURL=visual-element-target.js.map","const featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nexport const featureDefinitions = {};\nfor (const key in featureProps) {\n featureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n}\n//# sourceMappingURL=definitions.js.map","export const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nexport const createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nexport const createAxis = () => ({ min: 0, max: 0 });\nexport const createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n//# sourceMappingURL=models.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion = { current: null };\nexport const hasReducedMotionListener = { current: false };\n//# sourceMappingURL=state.js.map","export const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nexport const variantProps = [\"initial\", ...variantPriorityOrder];\n//# sourceMappingURL=variant-props.js.map","import { isAnimationControls } from \"../../animation/utils/is-animation-controls\";\nimport { isVariantLabel } from \"./is-variant-label\";\nimport { variantProps } from \"./variant-props\";\nexport function isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nexport function isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n//# sourceMappingURL=is-controlling-variants.js.map","export function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n//# sourceMappingURL=is-animation-controls.js.map","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n//# sourceMappingURL=is-variant-label.js.map","import { cancelFrame, complex, findValueType, frame, getAnimatableNone, isMotionValue, KeyframeResolver, microtask, motionValue, time, transformProps, } from \"motion-dom\";\nimport { isNumericalString, isZeroValueString, SubscriptionManager, warnOnce, } from \"motion-utils\";\nimport { featureDefinitions } from \"../motion/features/definitions\";\nimport { createBox } from \"../projection/geometry/models\";\nimport { initPrefersReducedMotion } from \"../utils/reduced-motion\";\nimport { hasReducedMotionListener, prefersReducedMotion, } from \"../utils/reduced-motion/state\";\nimport { visualElementStore } from \"./store\";\nimport { isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, } from \"./utils/is-controlling-variants\";\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\";\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\";\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport class VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = checkIsControllingVariants(props);\n this.isVariantNode = checkIsVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion =\n this.reducedMotionConfig === \"never\"\n ? false\n : this.reducedMotionConfig === \"always\"\n ? true\n : prefersReducedMotion.current;\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n//# sourceMappingURL=VisualElement.js.map","import { isBrowser } from \"../is-browser\";\nimport { hasReducedMotionListener, prefersReducedMotion } from \"./state\";\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n//# sourceMappingURL=index.js.map","import { isMotionValue, motionValue } from \"motion-dom\";\nexport function updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n//# sourceMappingURL=motion-values.js.map","import { DOMKeyframesResolver, isMotionValue, } from \"motion-dom\";\nimport { VisualElement } from \"../VisualElement\";\nexport class DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n return props.style\n ? props.style[key]\n : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n//# sourceMappingURL=DOMVisualElement.js.map","import { getValueAsType, numberValueTypes, transformPropOrder, } from \"motion-dom\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n valueIsDefault = parseFloat(value) === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n//# sourceMappingURL=build-transform.js.map","import { getValueAsType, isCSSVariableName, numberValueTypes, transformProps, } from \"motion-dom\";\nimport { buildTransform } from \"./build-transform\";\nexport function buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n//# sourceMappingURL=build-styles.js.map","export function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n//# sourceMappingURL=render.js.map","import { px } from \"motion-dom\";\nexport function pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n//# sourceMappingURL=scale-border-radius.js.map","import { complex, mixNumber } from \"motion-dom\";\nexport const correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n//# sourceMappingURL=scale-box-shadow.js.map","import { isCSSVariableName } from \"motion-dom\";\nimport { correctBorderRadius } from \"./scale-border-radius\";\nimport { correctBoxShadow } from \"./scale-box-shadow\";\nexport const scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nexport function addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n//# sourceMappingURL=scale-correction.js.map","import { transformProps } from \"motion-dom\";\nimport { scaleCorrectors } from \"../../projection/styles/scale-correction\";\nexport function isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n//# sourceMappingURL=is-forced-motion-value.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isForcedMotionValue } from \"../../../motion/utils/is-forced-motion-value\";\nexport function scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const { style } = props;\n const newValues = {};\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevProps.style &&\n isMotionValue(prevProps.style[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n//# sourceMappingURL=scrape-motion-values.js.map","import { defaultTransformValue, isCSSVariableName, readTransformValue, transformProps, } from \"motion-dom\";\nimport { measureViewportBox } from \"../../projection/utils/measure\";\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\";\nimport { buildHTMLStyles } from \"./utils/build-styles\";\nimport { renderHTML } from \"./utils/render\";\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\";\nexport function getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nexport class HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n//# sourceMappingURL=HTMLVisualElement.js.map","import { convertBoundingBoxToBox, transformBoxPoints, } from \"../geometry/conversion\";\nimport { translateAxis } from \"../geometry/delta-apply\";\nexport function measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nexport function measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n//# sourceMappingURL=measure.js.map","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nexport function convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n//# sourceMappingURL=conversion.js.map","import { createBox } from \"../../projection/geometry/models\";\nimport { VisualElement } from \"../VisualElement\";\nfunction isObjectKey(key, object) {\n return key in object;\n}\nexport class ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n//# sourceMappingURL=ObjectVisualElement.js.map","import { px } from \"motion-dom\";\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n */\nexport function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n const pathLength = px.transform(length);\n const pathSpacing = px.transform(spacing);\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\n}\n//# sourceMappingURL=path.js.map","import { buildHTMLStyles } from \"../../html/utils/build-styles\";\nimport { buildSVGPath } from \"./path\";\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n//# sourceMappingURL=build-attrs.js.map","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n//# sourceMappingURL=camel-case-attrs.js.map","import { getDefaultValueType, transformProps, } from \"motion-dom\";\nimport { createBox } from \"../../projection/geometry/models\";\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\";\nimport { camelToDash } from \"../dom/utils/camel-to-dash\";\nimport { buildSVGAttrs } from \"./utils/build-attrs\";\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\";\nimport { isSVGTag } from \"./utils/is-svg-tag\";\nimport { renderSVG } from \"./utils/render\";\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\";\nexport class SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n//# sourceMappingURL=SVGVisualElement.js.map","import { isMotionValue, transformPropOrder } from \"motion-dom\";\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\";\nexport function scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeHTMLMotionValuesFromProps(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n//# sourceMappingURL=scrape-motion-values.js.map","import { camelToDash } from \"../../dom/utils/camel-to-dash\";\nimport { renderHTML } from \"../../html/utils/render\";\nimport { camelCaseAttributes } from \"./camel-case-attrs\";\nexport function renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n//# sourceMappingURL=render.js.map","export const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n//# sourceMappingURL=is-svg-tag.js.map","import { isSVGElement, isSVGSVGElement } from \"motion-dom\";\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\";\nimport { ObjectVisualElement } from \"../../render/object/ObjectVisualElement\";\nimport { visualElementStore } from \"../../render/store\";\nimport { SVGVisualElement } from \"../../render/svg/SVGVisualElement\";\nexport function createDOMVisualElement(element) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n };\n const node = isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nexport function createObjectVisualElement(subject) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n };\n const node = new ObjectVisualElement(options);\n node.mount(subject);\n visualElementStore.set(subject, node);\n}\n//# sourceMappingURL=create-visual-element.js.map","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n","import { isMotionValue, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { visualElementStore } from \"../../render/store\";\nimport { animateTarget } from \"../interfaces/visual-element-target\";\nimport { createDOMVisualElement, createObjectVisualElement, } from \"../utils/create-visual-element\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nimport { resolveSubjects } from \"./resolve-subjects\";\nimport { animateSingleValue } from \"./single-value\";\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nexport function animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\", \"no-valid-elements\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n invariant(thisSubject !== null, \"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.\", \"animate-null\");\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n//# sourceMappingURL=subject.js.map","import { motionValue as createMotionValue, isMotionValue, } from \"motion-dom\";\nimport { animateMotionValue } from \"../interfaces/motion-value\";\nexport function animateSingleValue(value, keyframes, options) {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value);\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options));\n return motionValue.animation;\n}\n//# sourceMappingURL=single-value.js.map","import { spring, } from \"motion-dom\";\nimport { createAnimationsFromSequence } from \"../sequence/create\";\nimport { animateSubject } from \"./subject\";\nexport function animateSequence(sequence, options, scope) {\n const animations = [];\n const animationDefinitions = createAnimationsFromSequence(sequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n//# sourceMappingURL=sequence.js.map","import { GroupAnimationWithThen } from \"motion-dom\";\nimport { removeItem } from \"motion-utils\";\nimport { animateSequence } from \"./sequence\";\nimport { animateSubject } from \"./subject\";\nfunction isSequence(value) {\n return Array.isArray(value) && value.some(Array.isArray);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(scope) {\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n let animationOnComplete;\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(subjectOrSequence, optionsOrKeyframes, scope);\n }\n else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {};\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete;\n }\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, rest, scope);\n }\n const animation = new GroupAnimationWithThen(animations);\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete);\n }\n if (scope) {\n scope.animations.push(animation);\n animation.finished.then(() => {\n removeItem(scope.animations, animation);\n });\n }\n return animation;\n }\n return scopedAnimate;\n}\nexport const animate = createScopedAnimate();\n//# sourceMappingURL=index.js.map"],"names":["removeItem","arr","item","index","indexOf","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isZeroValueString","memo","callback","result","undefined","noop","any","combineFunctions","a","b","pipe","transformers","reduce","progress","from","to","value","toFromDifference","SubscriptionManager","constructor","this","subscriptions","add","handler","push","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isEasingArray","ease","Array","isArray","getEasingForSegment","rangeSize","wrap","isBezierDefinition","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","stepsOrder","statsBuffer","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","stepName","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","forEach","frameloop","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","frameSteps","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","complex","isNaN","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","createGeneratorEasing","options","createGenerator","keyframes","calcGeneratorVelocity","resolveValue","current","prevT","springDefaults","granular","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","exp","d","e","f","initialGuess","rootIterations","approximateRoot","stiffness","damping","durationKeys","physicsKeys","isSpringType","keys","some","spring","optionsOrVisualDuration","visualDuration","restSpeed","restDelta","isResolvedFromDuration","springOptions","root","PI","derived","getSpringOptions","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","cos","dampedAngularFreq","freqForT","sinh","cosh","calculatedDuration","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","toTransition","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","fillOffset","offset","remaining","offsetProgress","defaultOffset","keyframeValues","times","easingFunctions","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","applyToOptions","generatorOptions","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","includes","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","supportsScrollTimeline","ScrollTimeline","supportsFlags","memoSupports","supportsFlag","memoized","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","isCSSVar","style","setProperty","setStyle","commitStyles","effect","getComputedTiming","Number","playbackRate","playState","newStartTime","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","supportsWaapi","Element","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","subject","owner","HTMLElement","transformTemplate","getProps","supportsBrowserAnimation","catch","pendingTimeline","_onReject","finally","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","getMax","methodName","controls","GroupAnimationWithThen","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","getValueTransition","positionalKeys","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","getDefaultValueType","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","jump","finalKeyframeIndex","unsetTransformName","unsetTransformValue","getValueAsType","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","endAnimation","addDependent","removeDependent","getPrevious","getVelocity","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","microtask","cancelMicrotask","isSVGElement","isMotionValue","valueTypes","isDOMKeyframes","resolveSubjects","scope","selectorCache","elementOrSelector","EventTarget","elements","querySelectorAll","resolveElements","NodeList","calculateRepeatDuration","_repeatDelay","calcNextTime","labels","addKeyframes","sequence","endTime","at","eraseKeyframes","normalizeTimes","compareByTime","getSubjectSequence","sequences","getValueSequence","keyframesAsList","isNumber","isNumberKeyframesArray","every","visualElementStore","WeakMap","getValueState","resolveVariantFromProps","props","custom","variants","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","setTarget","resolveVariant","transitionEnd","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","animateMotionValue","valueTransition","when","_delay","delayChildren","staggerChildren","staggerDirection","isTransitionDefined","assign","shouldSkip","skipAnimations","isSync","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","animationTypeState","animationState","getState","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","featureProps","exit","drag","focus","hover","tap","pan","inView","layout","featureDefinitions","isEnabled","createBox","isBrowser","prefersReducedMotion","hasReducedMotionListener","variantProps","isControllingVariants","isVariantLabel","propEventHandlers","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","parent","presenceContext","reducedMotionConfig","blockInitialAnimation","visualState","children","isVariantNode","features","valueSubscriptions","prevMotionValues","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","checkIsControllingVariants","checkIsVariantNode","variantChildren","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","addEventListener","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","child","enteringChildren","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","sortNodePosition","other","sortInstanceNodePosition","updateFeatures","featureDefinition","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","transformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","variant","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransform","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","axis","correctBorderRadius","correct","node","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layoutId","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","transformPoint","convertBoundingBoxToBox","point","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","ObjectVisualElement","object","isObjectKey","dashKeys","array","camelKeys","cssMotionPathProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","camelCaseAttributes","SVGVisualElement","defaultType","getAttribute","scrapeHTMLMotionValuesFromProps","charAt","toUpperCase","_styleProp","setAttribute","renderSVG","tag","tagName","createDOMVisualElement","isSVGSVGElement","createObjectVisualElement","animateSubject","isSingleValue","createMotionValue","animateSingleValue","subjects","numSubjects","thisSubject","createVisualElement","animateSequence","animationDefinitions","defaultTransition","sequenceTransition","generators","defaultDuration","elementCache","timeLabels","prevTime","segment","maxDuration","resolveValueSequence","valueKeyframes","valueSequence","elementIndex","valueKeyframesAsList","remainingTransition","calculatedDelay","numKeyframes","absoluteDelta","springTransition","springEasing","remainder","unshift","originalKeyframes","originalTimes","originalEase","repeatIndex","keyframeIndex","targetTime","subjectIndex","subjectSequence","valueSequences","sort","valueOffset","valueEasing","createAnimationsFromSequence","createScopedAnimate","subjectOrSequence","optionsOrKeyframes","animationOnComplete","rest"],"mappings":"AAIA,SAASA,EAAWC,EAAKC,GACrB,MAAMC,EAAQF,EAAIG,QAAQF,GACtBC,GAAS,GACTF,EAAII,OAAOF,EAAO,EAC1B,CCRA,MAAMG,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD,MAAMU,EAAqB,CAAE,ECGvBC,EAAqBd,GAAM,+BAA+Be,KAAKf,GCArE,MAAMgB,EAAqBhB,GAAM,cAAce,KAAKf,GCFpD,SAASiB,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAmB,CAACC,EAAGC,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