{"version":3,"sources":["jsdelivr-header.js","/npm/framer-motion@14.3.0/src/animation/utils/is-dom-keyframes.ts","/npm/framer-motion@14.3.0/src/animation/animate/resolve-subjects.ts","/npm/framer-motion@14.3.0/src/animation/sequence/utils/calc-repeat-duration.ts","/npm/framer-motion@14.3.0/src/animation/sequence/utils/calc-time.ts","/npm/framer-motion@14.3.0/src/animation/sequence/utils/edit.ts","/npm/framer-motion@14.3.0/src/animation/sequence/utils/normalize-times.ts","/npm/framer-motion@14.3.0/src/animation/sequence/utils/sort.ts","/npm/framer-motion@14.3.0/src/animation/sequence/create.ts","/npm/framer-motion@14.3.0/src/animation/animate/subject.ts","/npm/framer-motion@14.3.0/src/animation/animate/sequence.ts","/npm/framer-motion@14.3.0/src/animation/animate/index.ts","/npm/framer-motion@14.3.0/src/animation/animators/waapi/animate-elements.ts","/npm/framer-motion@14.3.0/src/animation/animators/waapi/animate-style.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/info.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/offsets/edge.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/offsets/offset.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/offsets/presets.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/offsets/index.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/offsets/inset.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/on-scroll-handler.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/track.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/utils/can-use-native-timeline.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/utils/get-timeline.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/utils/offset-to-range.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/attach-animation.ts","/npm/framer-motion@14.3.0/src/render/dom/scroll/index.ts","/npm/framer-motion@14.3.0/src/render/dom/viewport/index.ts","/npm/framer-motion@14.3.0/src/utils/distance.ts"],"names":[],"mappings":"AAAA;AAC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Q,EAAY,OAAA,EAAS,MAAM,EAAoB,CAAA,EAAE,CAEjE,MAAM,EAAW,EAAgB,CAAiB,EAE5C,EAAsB,IAAI,QAE1B,EAAsD,GAAW,CACnE,EAAQ,QAAS,GAAS,CACtB,MAAM,EAAQ,EAAoB,IAAI,EAAM,MAAM,EAMlD,GAAI,EAAM,iBAAmB,EAAQ,EAErC,GAAI,EAAM,eAAgB,CACtB,MAAM,EAAW,EAAQ,EAAM,OAAQ,CAAK,EACxC,OAAO,GAAa,WACpB,EAAoB,IAAI,EAAM,OAAQ,CAAQ,EAE9C,EAAS,UAAU,EAAM,MAAM,CAEvC,MAAW,OAAO,GAAU,aACxB,EAAM,CAAK,EACX,EAAoB,OAAO,EAAM,MAAM,EAE/C,CAAC,CACL,EAEM,EAAW,IAAI,qBAAqB,EAAsB,CAC5D,KAAA,EACA,WAAA,EACA,UAAW,OAAO,GAAW,SAAW,EAAS,GAAW,CAAM,CACrE,CAAA,EAED,OAAA,EAAS,QAAS,GAAY,EAAS,QAAQ,CAAO,CAAC,EAEhD,IAAM,EAAS,WAAU,CACpC,CCjEO,MAAM,EAAW,CAAC,EAAW,IAAc,KAAK,IAAI,EAAI,CAAC,EAE1D,SAAU,GAAW,EAAU,EAAQ,CAEzC,MAAM,EAAS,EAAS,EAAE,EAAG,EAAE,CAAC,EAC1B,EAAS,EAAS,EAAE,EAAG,EAAE,CAAC,EAChC,OAAO,KAAK,KAAK,GAAU,EAAI,GAAU,CAAC,CAC9C","file":"/npm/framer-motion@14.3.0/dist/es/dom.mjs/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/framer-motion@14.3.0/dist/es/dom.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n    keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n    return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n    AnimationScope,\n    DOMKeyframesDefinition,\n    SelectorCache,\n    resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects<O extends {}>(\n    subject:\n        | string\n        | Element\n        | Element[]\n        | NodeListOf<Element>\n        | O\n        | O[]\n        | null\n        | undefined,\n    keyframes: DOMKeyframesDefinition | ObjectTarget<O>,\n    scope?: AnimationScope,\n    selectorCache?: SelectorCache\n) {\n    if (subject == null) {\n        return []\n    }\n\n    if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n        return resolveElements(subject, scope, selectorCache)\n    } else if (subject instanceof NodeList) {\n        return Array.from(subject)\n    } else if (Array.isArray(subject)) {\n        return subject.filter((s) => s != null)\n    } else {\n        return [subject]\n    }\n}\n","export function calculateRepeatDuration(\n    duration: number,\n    repeat: number,\n    repeatDelay: number\n): number {\n    return duration * (repeat + 1) + repeatDelay * repeat\n}\n","import { SequenceTime } from \"../types\"\n\n/**\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(\n    current: number,\n    next: SequenceTime,\n    prev: number,\n    labels: Map<string, number>\n): number {\n    if (typeof next === \"number\") {\n        return next\n    } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n        return Math.max(0, current + parseFloat(next))\n    } else if (next === \"<\") {\n        return prev\n    } else if (next.startsWith(\"<\")) {\n        return Math.max(0, prev + parseFloat(next.slice(1)))\n    } else {\n        return labels.get(next) ?? current\n    }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n    sequence: ValueSequence,\n    startTime: number,\n    endTime: number\n): void {\n    for (let i = 0; i < sequence.length; i++) {\n        const keyframe = sequence[i]\n\n        if (keyframe.at > startTime && keyframe.at < endTime) {\n            removeItem(sequence, keyframe)\n\n            // If we remove this item we have to push the pointer back one\n            i--\n        }\n    }\n}\n\nexport function addKeyframes(\n    sequence: ValueSequence,\n    keyframes: UnresolvedValueKeyframe[],\n    easing: Easing | Easing[],\n    offset: number[],\n    startTime: number,\n    endTime: number\n): void {\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\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","/**\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 *\n * `repeatDelayUnits` is the repeatDelay expressed in units of a single\n * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`.\n */\nexport function normalizeTimes(\n    times: number[],\n    repeat: number,\n    repeatDelayUnits = 0\n): void {\n    const totalUnits = repeat + 1 + repeat * repeatDelayUnits\n    for (let i = 0; i < times.length; i++) {\n        times[i] = times[i] / totalUnits\n    }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n    a: AbsoluteKeyframe,\n    b: AbsoluteKeyframe\n): number {\n    if (a.at === b.at) {\n        if (a.value === null) return 1\n        if (b.value === null) return -1\n        return 0\n    } else {\n        return a.at - b.at\n    }\n}\n","import {\n    AnimationScope,\n    createGeneratorEasing,\n    defaultOffset,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    fillOffset,\n    GeneratorFactory,\n    isGenerator,\n    isMotionValue,\n    Transition,\n    UnresolvedValueKeyframe,\n    type AnyResolvedKeyframe,\n    type MotionValue,\n} from \"motion-dom\"\nimport {\n    Easing,\n    getEasingForSegment,\n    progress,\n    reverseEasing,\n    secondsToMilliseconds,\n    warning,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n    AnimationSequence,\n    At,\n    ResolvedAnimationDefinitions,\n    SequenceMap,\n    SequenceOptions,\n    ValueSequence,\n} from \"./types\"\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\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n    sequence: AnimationSequence,\n    { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n    scope?: AnimationScope,\n    generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n    const defaultDuration = defaultTransition.duration || 0.3\n    const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n    const sequences = new Map<Element | MotionValue, SequenceMap>()\n    const elementCache = {}\n    const timeLabels = new Map<string, number>()\n\n    let prevTime = 0\n    let currentTime = 0\n    let totalDuration = 0\n\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        /**\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        } else if (!Array.isArray(segment)) {\n            timeLabels.set(\n                segment.name,\n                calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n            )\n            continue\n        }\n\n        let [subject, keyframes, transition = {}] = segment\n\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(\n                currentTime,\n                transition.at,\n                prevTime,\n                timeLabels\n            )\n        }\n\n        /**\n         * Keep track of the maximum duration in this definition. This will be\n         * applied to currentTime once the definition has been parsed.\n         */\n        let maxDuration = 0\n\n        const resolveValueSequence = (\n            valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n            valueTransition: Transition | DynamicAnimationOptions,\n            valueSequence: ValueSequence,\n            elementIndex = 0,\n            numSubjects = 0\n        ) => {\n            const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n            const {\n                delay = 0,\n                times = defaultOffset(valueKeyframesAsList),\n                type = defaultTransition.type || \"keyframes\",\n                repeat,\n                repeatType,\n                repeatDelay = 0,\n                ...remainingTransition\n            } = valueTransition\n            let { ease = defaultTransition.ease || \"easeOut\", duration } =\n                valueTransition\n\n            /**\n             * Resolve stagger() if defined.\n             */\n            const calculatedDelay =\n                typeof delay === \"function\"\n                    ? delay(elementIndex, numSubjects)\n                    : delay\n\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\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 (\n                    numKeyframes === 2 &&\n                    isNumberKeyframesArray(valueKeyframesAsList)\n                ) {\n                    const delta =\n                        valueKeyframesAsList[1] - valueKeyframesAsList[0]\n                    absoluteDelta = Math.abs(delta)\n                }\n\n                const springTransition = {\n                    ...defaultTransition,\n                    ...remainingTransition,\n                }\n                if (duration !== undefined) {\n                    springTransition.duration = secondsToMilliseconds(duration)\n                }\n\n                const springEasing = createGeneratorEasing(\n                    springTransition,\n                    absoluteDelta,\n                    createGenerator\n                )\n\n                ease = springEasing.ease\n                duration = springEasing.duration\n            }\n\n            duration ??= defaultDuration\n\n            const startTime = currentTime + calculatedDelay\n\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            /**\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            /**\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            /**\n             * Segments can't express `repeat: Infinity` or very large\n             * counts — they'd leave dead time after the segment or\n             * explode the keyframe array. Ignore with a warning.\n             */\n            if (repeat) {\n                warning(\n                    repeat < MAX_REPEAT,\n                    `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`\n                )\n            }\n\n            if (repeat && repeat < MAX_REPEAT) {\n                /**\n                 * Express repeatDelay in units of a single iteration's duration\n                 * so it can be added to the per-iteration time offsets below\n                 * before they're normalized to 0-1.\n                 */\n                const repeatDelayUnits =\n                    duration > 0 ? repeatDelay / duration : 0\n\n                duration = calculateRepeatDuration(\n                    duration,\n                    repeat,\n                    repeatDelay\n                )\n\n                const originalKeyframes = [...valueKeyframesAsList]\n                const originalTimes = [...times]\n                ease = Array.isArray(ease) ? [...ease] : [ease]\n                const originalEase = [...ease]\n\n                /**\n                 * For reverse/mirror, alternate iterations play the segment\n                 * backwards. mirror matches JSAnimation's mirroredGenerator:\n                 * reversed keyframes, easings unchanged. reverse matches\n                 * JSAnimation's iterationProgress = 1 - p: reversed\n                 * keyframes, easing array reversed AND each function easing\n                 * mapped through reverseEasing (string easings unchanged —\n                 * they're resolved later by the keyframes engine).\n                 */\n                const isFlipping =\n                    repeatType === \"reverse\" || repeatType === \"mirror\"\n                let flippedKeyframes = originalKeyframes\n                let flippedEases = originalEase\n                if (isFlipping) {\n                    flippedKeyframes = [...originalKeyframes].reverse()\n                    if (repeatType === \"reverse\") {\n                        flippedEases = [...originalEase]\n                            .reverse()\n                            .map((e) =>\n                                typeof e === \"function\"\n                                    ? reverseEasing(e)\n                                    : e\n                            )\n                    }\n                }\n\n                for (\n                    let repeatIndex = 0;\n                    repeatIndex < repeat;\n                    repeatIndex++\n                ) {\n                    const isFlipped = isFlipping && repeatIndex % 2 === 0\n                    const iterKeyframes = isFlipped\n                        ? flippedKeyframes\n                        : originalKeyframes\n                    const iterEase = isFlipped ? flippedEases : originalEase\n                    const iterStartOffset =\n                        (repeatIndex + 1) * (1 + repeatDelayUnits)\n\n                    /**\n                     * If repeatDelay is set, hold the previous iteration's\n                     * final value through the delay by inserting a keyframe\n                     * at the moment the next iteration begins.\n                     */\n                    if (repeatDelayUnits > 0) {\n                        valueKeyframesAsList.push(\n                            valueKeyframesAsList[\n                                valueKeyframesAsList.length - 1\n                            ]\n                        )\n                        times.push(iterStartOffset)\n                        ease.push(\"linear\")\n                    }\n\n                    valueKeyframesAsList.push(...iterKeyframes)\n\n                    for (\n                        let keyframeIndex = 0;\n                        keyframeIndex < iterKeyframes.length;\n                        keyframeIndex++\n                    ) {\n                        times.push(\n                            originalTimes[keyframeIndex] + iterStartOffset\n                        )\n                        ease.push(\n                            keyframeIndex === 0\n                                ? \"linear\"\n                                : getEasingForSegment(\n                                      iterEase,\n                                      keyframeIndex - 1\n                                  )\n                        )\n                    }\n                }\n\n                normalizeTimes(times, repeat, repeatDelayUnits)\n            }\n\n            const targetTime = startTime + duration\n\n            /**\n             * Add keyframes, mapping offsets to absolute time.\n             */\n            addKeyframes(\n                valueSequence,\n                valueKeyframesAsList,\n                ease as Easing | Easing[],\n                times,\n                startTime,\n                targetTime\n            )\n\n            maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n            totalDuration = Math.max(targetTime, totalDuration)\n        }\n\n        if (isMotionValue(subject)) {\n            const subjectSequence = getSubjectSequence(subject, sequences)\n            resolveValueSequence(\n                keyframes as AnyResolvedKeyframe,\n                transition,\n                getValueSequence(\"default\", subjectSequence)\n            )\n        } else {\n            const subjects = resolveSubjects(\n                subject,\n                keyframes as DOMKeyframesDefinition,\n                scope,\n                elementCache\n            )\n\n            const numSubjects = subjects.length\n\n            /**\n             * For every element in this segment, process the defined values.\n             */\n            for (\n                let subjectIndex = 0;\n                subjectIndex < numSubjects;\n                subjectIndex++\n            ) {\n                /**\n                 * Cast necessary, but we know these are of this type\n                 */\n                keyframes = keyframes as DOMKeyframesDefinition\n                transition = transition as DynamicAnimationOptions\n\n                const thisSubject = subjects[subjectIndex]\n                const subjectSequence = getSubjectSequence(\n                    thisSubject,\n                    sequences\n                )\n\n                for (const key in keyframes) {\n                    resolveValueSequence(\n                        keyframes[\n                            key as keyof typeof keyframes\n                        ] as UnresolvedValueKeyframe,\n                        getValueTransition(transition, key),\n                        getValueSequence(key, subjectSequence),\n                        subjectIndex,\n                        numSubjects\n                    )\n                }\n            }\n        }\n\n        prevTime = currentTime\n        currentTime += maxDuration\n    }\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            /**\n             * Arrange all the keyframes in ascending time order.\n             */\n            valueSequence.sort(compareByTime)\n\n            const keyframes: UnresolvedValueKeyframe[] = []\n            const valueOffset: number[] = []\n            const valueEasing: Easing[] = []\n\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            /**\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            /**\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\n            if (!animationDefinitions.has(element)) {\n                animationDefinitions.set(element, {\n                    keyframes: {},\n                    transition: {},\n                })\n            }\n\n            const definition = animationDefinitions.get(element)!\n\n            definition.keyframes[key] = keyframes\n\n            /**\n             * Exclude `type` from defaultTransition since springs have been\n             * converted to duration-based easing functions in resolveValueSequence.\n             * Including `type: \"spring\"` would cause JSAnimation to error when\n             * the merged keyframes array has more than 2 keyframes.\n             */\n            const { type: _type, ...remainingDefaultTransition } =\n                defaultTransition\n            definition.transition[key] = {\n                ...remainingDefaultTransition,\n                duration: totalDuration,\n                ease: valueEasing,\n                times: valueOffset,\n                ...sequenceTransition,\n            }\n        }\n    })\n\n    return animationDefinitions\n}\n\nfunction getSubjectSequence<O extends {}>(\n    subject: Element | MotionValue | O,\n    sequences: Map<Element | MotionValue | O, SequenceMap>\n): SequenceMap {\n    !sequences.has(subject) && sequences.set(subject, {})\n    return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n    if (!sequences[name]) sequences[name] = []\n    return sequences[name]\n}\n\nfunction keyframesAsList(\n    keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n    return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n    transition: DynamicAnimationOptions & At,\n    key: string\n): DynamicAnimationOptions {\n    return transition && transition[key as keyof typeof transition]\n        ? {\n              ...transition,\n              ...(transition[key as keyof typeof transition] as Transition),\n          }\n        : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n    keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n    animateEffectSubject,\n    animateElement,\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    AnyResolvedKeyframe,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    EffectKeyframes,\n    EffectTransition,\n    ElementOrSelector,\n    findEffect,\n    isMotionValue,\n    MotionValue,\n    propEffect,\n    UnresolvedValueKeyframe,\n    ValueAnimationTransition,\n    visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue<any> | any\n\nfunction isSingleValue(\n    subject: unknown,\n    keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n    return (\n        isMotionValue(subject) ||\n        typeof subject === \"number\" ||\n        (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n    )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n    value: string | MotionValue<string>,\n    keyframes: string | UnresolvedValueKeyframe<string>[],\n    options?: ValueAnimationTransition<string>\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n    value: number | MotionValue<number>,\n    keyframes: number | UnresolvedValueKeyframe<number>[],\n    options?: ValueAnimationTransition<number>\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n    element: ElementOrSelector,\n    keyframes: DOMKeyframesDefinition,\n    options?: DynamicAnimationOptions,\n    scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject<O extends Object>(\n    object: O | O[],\n    keyframes: ObjectTarget<O>,\n    options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject<O extends Object>(\n    subject:\n        | MotionValue<number>\n        | MotionValue<string>\n        | number\n        | string\n        | ElementOrSelector\n        | O\n        | O[],\n    keyframes:\n        | number\n        | string\n        | UnresolvedValueKeyframe<number>[]\n        | UnresolvedValueKeyframe<string>[]\n        | DOMKeyframesDefinition\n        | ObjectTarget<O>,\n    options?:\n        | ValueAnimationTransition<number>\n        | ValueAnimationTransition<string>\n        | DynamicAnimationOptions,\n    scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n    const animations: AnimationPlaybackControlsWithThen[] = []\n\n    if (isSingleValue(subject, keyframes)) {\n        animations.push(\n            animateSingleValue(\n                subject,\n                isDOMKeyframes(keyframes)\n                    ? (keyframes as any).default || keyframes\n                    : keyframes,\n                options ? (options as any).default || options : options\n            )\n        )\n    } else {\n        // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n        if (subject == null) {\n            return animations\n        }\n\n        const subjects = resolveSubjects(\n            subject,\n            keyframes as DOMKeyframesDefinition,\n            scope\n        )\n\n        const numSubjects = subjects.length\n\n        invariant(\n            Boolean(numSubjects),\n            \"No valid elements provided.\",\n            \"no-valid-elements\"\n        )\n\n        for (let i = 0; i < numSubjects; i++) {\n            const thisSubject = subjects[i]\n            const transition = { ...options }\n\n            /**\n             * Resolve stagger function if provided.\n             */\n            if (\n                \"delay\" in transition &&\n                typeof transition.delay === \"function\"\n            ) {\n                transition.delay = transition.delay(i, numSubjects)\n            }\n\n            if (thisSubject instanceof Element) {\n                /**\n                 * An element already owned by a VisualElement (a <motion.*>\n                 * component or animateLayout()) animates its values so they\n                 * share one renderer. Anything else is driven through\n                 * styleEffect (or svgEffect) and the DOM keyframe resolver,\n                 * without creating a VisualElement.\n                 */\n                animations.push(\n                    ...animateElement(\n                        thisSubject as HTMLElement | SVGElement,\n                        keyframes as EffectKeyframes,\n                        transition as EffectTransition,\n                        visualElementStore.get(thisSubject)\n                    )\n                )\n            } else {\n                /**\n                 * Registered effects (animate.addEffect) claim non-DOM\n                 * subjects before we fall back to writing plain properties.\n                 */\n                animations.push(\n                    ...animateEffectSubject(\n                        findEffect(thisSubject) ?? propEffect,\n                        thisSubject as object,\n                        keyframes as EffectKeyframes,\n                        transition as EffectTransition\n                    )\n                )\n            }\n        }\n    }\n\n    return animations\n}\n","import {\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    motionValue,\n    spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n    sequence: AnimationSequence,\n    options?: SequenceOptions,\n    scope?: AnimationScope\n) {\n    const animations: AnimationPlaybackControlsWithThen[] = []\n\n    /**\n     * Pre-process: replace function segments with MotionValue segments,\n     * subscribe callbacks immediately\n     */\n    const processedSequence = sequence.map((segment) => {\n        if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n            const callback = segment[0] as (value: any) => void\n            const mv = motionValue(0)\n            mv.on(\"change\", callback)\n\n            if (segment.length === 1) {\n                return [mv, [0, 1]] as any\n            } else if (segment.length === 2) {\n                return [mv, [0, 1], segment[1]] as any\n            } else {\n                return [mv, segment[1], segment[2]] as any\n            }\n        }\n        return segment\n    }) as AnimationSequence\n\n    const animationDefinitions = createAnimationsFromSequence(\n        processedSequence,\n        options,\n        scope,\n        { spring }\n    )\n\n    animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n        animations.push(...animateSubject(subject, keyframes, transition))\n    })\n\n    return animations\n}\n","import type {\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    MotionValue,\n    UnresolvedValueKeyframe,\n    ValueAnimationTransition,\n} from \"motion-dom\"\nimport { addEffect, GroupAnimationWithThen, removeEffect } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n    AnimationSequence,\n    ObjectTarget,\n    SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n    return Array.isArray(value) && value.some(Array.isArray)\n}\n\ninterface ScopedAnimateOptions {\n    scope?: AnimationScope\n    reduceMotion?: boolean\n    skipAnimations?: boolean\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options: ScopedAnimateOptions = {}) {\n    const { scope, reduceMotion, skipAnimations } = options\n    /**\n     * Animate a sequence\n     */\n    function scopedAnimate(\n        sequence: AnimationSequence,\n        options?: SequenceOptions\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate a string\n     */\n    function scopedAnimate(\n        value: string | MotionValue<string>,\n        keyframes: string | UnresolvedValueKeyframe<string>[],\n        options?: ValueAnimationTransition<string>\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate a number\n     */\n    function scopedAnimate(\n        value: number | MotionValue<number>,\n        keyframes: number | UnresolvedValueKeyframe<number>[],\n        options?: ValueAnimationTransition<number>\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate a generic motion value\n     */\n    function scopedAnimate<V extends string | number>(\n        value: V | MotionValue<V>,\n        keyframes: V | UnresolvedValueKeyframe<V>[],\n        options?: ValueAnimationTransition<V>\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate an Element\n     */\n    function scopedAnimate(\n        element: ElementOrSelector,\n        keyframes: DOMKeyframesDefinition,\n        options?: DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate an object\n     */\n    function scopedAnimate<O extends {}>(\n        object: O | O[],\n        keyframes: ObjectTarget<O>,\n        options?: DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Implementation\n     */\n    function scopedAnimate<O extends {}>(\n        subjectOrSequence:\n            | AnimationSequence\n            | MotionValue<number>\n            | MotionValue<string>\n            | number\n            | string\n            | ElementOrSelector\n            | O\n            | O[],\n        optionsOrKeyframes?:\n            | SequenceOptions\n            | number\n            | string\n            | UnresolvedValueKeyframe<number>[]\n            | UnresolvedValueKeyframe<string>[]\n            | DOMKeyframesDefinition\n            | ObjectTarget<O>,\n        options?:\n            | ValueAnimationTransition<number>\n            | ValueAnimationTransition<string>\n            | DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen {\n        let animations: AnimationPlaybackControlsWithThen[] = []\n        let animationOnComplete: VoidFunction | undefined\n\n        const inherited: { reduceMotion?: boolean; skipAnimations?: boolean } =\n            {}\n        if (reduceMotion !== undefined) inherited.reduceMotion = reduceMotion\n        if (skipAnimations !== undefined)\n            inherited.skipAnimations = skipAnimations\n\n        if (isSequence(subjectOrSequence)) {\n            const { onComplete, ...sequenceOptions } =\n                (optionsOrKeyframes as SequenceOptions) || {}\n            if (typeof onComplete === \"function\") {\n                animationOnComplete = onComplete as VoidFunction\n            }\n            animations = animateSequence(\n                subjectOrSequence,\n                { ...inherited, ...sequenceOptions } as SequenceOptions,\n                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 as VoidFunction\n            }\n            animations = animateSubject(\n                subjectOrSequence as ElementOrSelector,\n                optionsOrKeyframes as DOMKeyframesDefinition,\n                { ...inherited, ...rest } as DynamicAnimationOptions,\n                scope\n            )\n        }\n\n        const animation = new GroupAnimationWithThen(animations)\n\n        if (animationOnComplete) {\n            animation.finished.then(animationOnComplete)\n        }\n\n        if (scope) {\n            scope.animations.push(animation)\n            animation.finished.then(() => {\n                removeItem(scope.animations, animation)\n            })\n        }\n\n        return animation\n    }\n\n    return scopedAnimate\n}\n\nexport const animate = Object.assign(createScopedAnimate(), {\n    /**\n     * Register an effect so `animate()` can animate the subjects it\n     * claims, for instance `animate.addEffect(threeEffect)`. The most\n     * recently added effect is tested first. DOM elements are always\n     * animated directly.\n     */\n    addEffect,\n    removeEffect,\n})\n","import {\n    animationMapKey,\n    AnimationPlaybackControls,\n    AnimationScope,\n    applyPxDefaults,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    fillWildcards,\n    getAnimationMap,\n    getComputedStyle,\n    getValueTransition,\n    NativeAnimation,\n    NativeAnimationOptions,\n    resolveElements,\n    UnresolvedValueKeyframe,\n    ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n    map: Map<string, NativeAnimation<any>>\n    key: string\n    unresolvedKeyframes: UnresolvedValueKeyframe[]\n    options: Omit<NativeAnimationOptions, \"keyframes\"> & {\n        keyframes?: ValueKeyframe[]\n    }\n}\n\nexport function animateElements(\n    elementOrSelector: ElementOrSelector,\n    keyframes: DOMKeyframesDefinition,\n    options?: DynamicAnimationOptions,\n    scope?: AnimationScope\n) {\n    // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n    if (elementOrSelector == null) {\n        return []\n    }\n\n    const elements = resolveElements(elementOrSelector, scope) as Array<\n        HTMLElement | SVGElement\n    >\n    const numElements = elements.length\n\n    invariant(\n        Boolean(numElements),\n        \"No valid elements provided.\",\n        \"no-valid-elements\"\n    )\n\n    /**\n     * WAAPI doesn't support interrupting animations.\n     *\n     * Therefore, starting animations requires a three-step process:\n     * 1. Stop existing animations (write styles to DOM)\n     * 2. Resolve keyframes (read styles from DOM)\n     * 3. Create new animations (write styles to DOM)\n     *\n     * The hybrid `animate()` function uses AsyncAnimation to resolve\n     * keyframes before creating new animations, which removes style\n     * thrashing. Here, we have much stricter filesize constraints.\n     * Therefore we do this in a synchronous way that ensures that\n     * at least within `animate()` calls there is no style thrashing.\n     *\n     * In the motion-native-animate-mini-interrupt benchmark this\n     * was 80% faster than a single loop.\n     */\n    const animationDefinitions: AnimationDefinition[] = []\n\n    /**\n     * Step 1: Build options and stop existing animations (write)\n     */\n    for (let i = 0; i < numElements; i++) {\n        const element = elements[i]\n        const elementTransition: DynamicAnimationOptions = { ...options }\n\n        /**\n         * Resolve stagger function if provided.\n         */\n        if (typeof elementTransition.delay === \"function\") {\n            elementTransition.delay = elementTransition.delay(i, numElements)\n        }\n\n        for (const valueName in keyframes) {\n            let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n            if (!Array.isArray(valueKeyframes)) {\n                valueKeyframes = [valueKeyframes]\n            }\n\n            const valueOptions = {\n                ...getValueTransition(elementTransition as any, valueName),\n            }\n\n            valueOptions.duration &&= secondsToMilliseconds(\n                valueOptions.duration\n            )\n\n            valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n            /**\n             * If there's an existing animation playing on this element then stop it\n             * before creating a new one.\n             */\n            const map = getAnimationMap(element)\n            const key = animationMapKey(\n                valueName,\n                valueOptions.pseudoElement || \"\"\n            )\n            const currentAnimation = map.get(key)\n            currentAnimation && currentAnimation.stop()\n\n            animationDefinitions.push({\n                map,\n                key,\n                unresolvedKeyframes: valueKeyframes,\n                options: {\n                    ...valueOptions,\n                    element,\n                    name: valueName,\n                    allowFlatten:\n                        !elementTransition.type && !elementTransition.ease,\n                },\n            })\n        }\n    }\n\n    /**\n     * Step 2: Resolve keyframes (read)\n     */\n    for (let i = 0; i < animationDefinitions.length; i++) {\n        const { unresolvedKeyframes, options: animationOptions } =\n            animationDefinitions[i]\n\n        const { element, name, pseudoElement } = animationOptions\n        if (!pseudoElement && unresolvedKeyframes[0] === null) {\n            unresolvedKeyframes[0] = getComputedStyle(element, name)\n        }\n\n        fillWildcards(unresolvedKeyframes)\n        applyPxDefaults(unresolvedKeyframes, name)\n\n        /**\n         * If we only have one keyframe, explicitly read the initial keyframe\n         * from the computed style. This is to ensure consistency with WAAPI behaviour\n         * for restarting animations, for instance .play() after finish, when it\n         * has one vs two keyframes.\n         */\n        if (!pseudoElement && unresolvedKeyframes.length < 2) {\n            unresolvedKeyframes.unshift(getComputedStyle(element, name))\n        }\n\n        animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n    }\n\n    /**\n     * Step 3: Create new animations (write)\n     */\n    const animations: AnimationPlaybackControls[] = []\n    for (let i = 0; i < animationDefinitions.length; i++) {\n        const { map, key, options: animationOptions } = animationDefinitions[i]\n        const animation = new NativeAnimation(\n            animationOptions as NativeAnimationOptions\n        )\n\n        map.set(key, animation)\n        animation.finished.finally(() => map.delete(key))\n\n        animations.push(animation)\n    }\n\n    return animations\n}\n","import {\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n    function scopedAnimate(\n        elementOrSelector: ElementOrSelector,\n        keyframes: DOMKeyframesDefinition,\n        options?: DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen {\n        return new GroupAnimationWithThen(\n            animateElements(\n                elementOrSelector,\n                keyframes as DOMKeyframesDefinition,\n                options,\n                scope\n            )\n        )\n    }\n\n    return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n","import { clamp, progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n    current: 0,\n    offset: [],\n    progress: 0,\n    scrollLength: 0,\n    targetOffset: 0,\n    targetLength: 0,\n    containerLength: 0,\n    velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n    time: 0,\n    x: createAxisInfo(),\n    y: createAxisInfo(),\n})\n\n/**\n * Also iterated with for...in as the list of axes.\n */\nexport const axisKeys = {\n    x: {\n        length: \"Width\",\n        position: \"Left\",\n    },\n    y: {\n        length: \"Height\",\n        position: \"Top\",\n    },\n} as const\n\nexport type Axis = keyof typeof axisKeys\n\nconst styles = new WeakMap<Element, CSSStyleDeclaration>()\n\n/**\n * Whether an axis scrolls from its end, which browsers report as a scroll\n * position running from 0 to -scrollLength (#3340). This is read from style\n * rather than the sign of the scroll position, as elastic overscroll pushes\n * the position past 0 in either kind of axis (#3791).\n */\nfunction isReversed(element: Element, axisName: Axis) {\n    /**\n     * The viewport takes its writing mode and direction from <body>, which\n     * not every browser reflects in the root element's computed style. It\n     * doesn't adopt the root element's flex layout.\n     */\n    const isRoot = element === document.scrollingElement\n    const source = (isRoot && document.body) || element\n\n    let style = styles.get(source)\n    if (!style) styles.set(source, (style = getComputedStyle(source)))\n\n    const { writingMode, flexDirection } = style\n    const isInline = (axisName === \"x\") !== /^[vs]/.test(writingMode)\n\n    return (\n        (isInline\n            ? (style.direction === \"rtl\") !== (writingMode === \"sideways-lr\")\n            : writingMode.endsWith(\"rl\")) !==\n        /**\n         * A reversed flex axis flips this. The main axis is the inline axis\n         * unless flex-direction is a column.\n         */\n        (!isRoot &&\n            style.display.includes(\"flex\") &&\n            (isInline !== (flexDirection[0] === \"c\")\n                ? flexDirection\n                : style.flexWrap\n            ).endsWith(\"reverse\"))\n    )\n}\n\nfunction updateAxisInfo(\n    element: Element,\n    axisName: Axis,\n    info: ScrollInfo,\n    time: number\n) {\n    const axis = info[axisName]\n    const { length, position } = axisKeys[axisName]\n\n    const prev = axis.current\n    const prevTime = info.time\n\n    const scrollPosition = element[`scroll${position}`]\n    axis.current = isReversed(element, axisName)\n        ? -scrollPosition || 0 // Avoid -0\n        : scrollPosition\n    axis.containerLength = element[`client${length}`]\n    axis.targetLength = element[`scroll${length}`]\n    axis.scrollLength = axis.targetLength - axis.containerLength\n\n    axis.offset.length = 0\n    axis.offset[0] = 0\n    axis.offset[1] = axis.scrollLength\n    axis.progress = clamp(0, 1, progress(0, axis.scrollLength, axis.current))\n\n    const elapsed = time - prevTime\n    axis.velocity =\n        elapsed > maxElapsed\n            ? 0\n            : velocityPerSecond(axis.current - prev, elapsed)\n}\n\n/**\n * Measures a scroll container. Runs once per container per frame; every\n * handler on that container derives its info from the result.\n */\nexport function updateScrollInfo(\n    element: Element,\n    info: ScrollInfo,\n    time: number\n) {\n    for (const axis in axisKeys) {\n        updateAxisInfo(element, axis as Axis, info, time)\n    }\n    info.time = time\n}\n","import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record<NamedEdges, number> = {\n    start: 0,\n    center: 0.5,\n    end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n    let delta = 0\n\n    /**\n     * If we have this edge defined as a preset, replace the definition\n     * with the numerical value.\n     */\n    if (edge in namedEdges) {\n        edge = namedEdges[edge as NamedEdges]\n    }\n\n    /**\n     * Handle unit values\n     */\n    if (typeof edge === \"string\") {\n        const asNumber = parseFloat(edge)\n\n        if (edge.endsWith(\"px\")) {\n            delta = asNumber\n        } else if (edge.endsWith(\"%\")) {\n            edge = asNumber / 100\n        } else if (edge.endsWith(\"vw\")) {\n            delta = (asNumber / 100) * document.documentElement.clientWidth\n        } else if (edge.endsWith(\"vh\")) {\n            delta = (asNumber / 100) * document.documentElement.clientHeight\n        } else {\n            edge = asNumber\n        }\n    }\n\n    /**\n     * If the edge is defined as a number, handle as a progress value.\n     */\n    if (typeof edge === \"number\") {\n        delta = length * edge\n    }\n\n    return inset + delta\n}\n","import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n    offset: Edge | Intersection | ProgressIntersection,\n    containerLength: number,\n    targetLength: number,\n    targetInset: number\n) {\n    let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n        Array.isArray(offset) ? offset : defaultOffset\n\n    let targetPoint = 0\n    let containerPoint = 0\n\n    if (typeof offset === \"number\") {\n        /**\n         * If we're provided offset: [0, 0.5, 1] then each number x should become\n         * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n         * and container etc.\n         */\n        offsetDefinition = [offset, offset]\n    } else if (typeof offset === \"string\") {\n        offset = offset.trim() as EdgeString\n\n        if (offset.includes(\" \")) {\n            offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n        } else {\n            /**\n             * If we're provided a definition like \"100px\" then we want to apply\n             * that only to the top of the target point, leaving the container at 0.\n             * Whereas a named offset like \"end\" should be applied to both.\n             */\n            offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n        }\n    }\n\n    targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n    containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n    return targetPoint - containerPoint\n}\n","import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record<string, ProgressIntersection[]> = {\n  Enter: [\n    [0, 1],\n    [1, 1],\n  ],\n  Exit: [\n    [0, 0],\n    [1, 0],\n  ],\n  Any: [\n    [1, 0],\n    [0, 1],\n  ],\n  All: [\n    [0, 0],\n    [1, 1],\n  ],\n}\n","import { clamp, progress } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\n/**\n * Resolved offsets map to evenly spaced progress values, so progress is\n * derived from the segment index rather than building an interpolator.\n */\nfunction offsetsToProgress(offsets: number[], v: number) {\n    const n = offsets.length - 1\n    if (n < 1) return 0\n\n    const reverse = offsets[0] > offsets[n]\n    const at = (i: number) => offsets[reverse ? n - i : i]\n\n    /**\n     * Matches interpolate(), which checks for a zero-length first range\n     * before reversing descending offsets.\n     */\n    if (offsets[0] === offsets[1] && v < at(0)) return reverse ? 1 : 0\n\n    let i = 0\n    while (i < n - 1 && v >= at(i + 1)) i++\n\n    const p = (i + progress(at(i), at(i + 1), v)) / n\n    return reverse ? 1 - p : p\n}\n\nexport function resolveOffsets(info: ScrollInfo, options: ScrollInfoOptions) {\n    const { offset: offsetDefinition = ScrollOffset.All, axis = \"y\" } = options\n    const axisInfo = info[axis]\n\n    /**\n     * Reset the length of the resolved offset array rather than creating a new one.\n     */\n    axisInfo.offset.length = 0\n\n    /**\n     * Populate the offset array by resolving the user's offset definition into\n     * a list of pixel scroll offsets.\n     */\n    const numOffsets = offsetDefinition.length\n    for (let i = 0; i < numOffsets; i++) {\n        axisInfo.offset[i] = resolveOffset(\n            offsetDefinition[i],\n            axisInfo.containerLength,\n            axisInfo.targetLength,\n            axisInfo.targetOffset\n        )\n    }\n\n    axisInfo.progress = clamp(\n        0,\n        1,\n        offsetsToProgress(axisInfo.offset, axisInfo.current)\n    )\n}\n","import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n    const inset = { x: 0, y: 0 }\n\n    let current: Element | null = element\n    while (current && current !== container) {\n        if (isHTMLElement(current)) {\n            inset.x += current.offsetLeft\n            inset.y += current.offsetTop\n            current = current.offsetParent\n        } else if (current.tagName === \"svg\") {\n            /**\n             * This isn't an ideal approach to measuring the offset of <svg /> tags.\n             * It would be preferable, given they behave like HTMLElements in most ways\n             * to use offsetLeft/Top. But these don't exist on <svg />. Likewise we\n             * can't use .getBBox() like most SVG elements as these provide the offset\n             * relative to the SVG itself, which for <svg /> is usually 0x0.\n             */\n            const svgBoundingBox = current.getBoundingClientRect()\n            current = current.parentElement!\n            const parentBoundingBox = current.getBoundingClientRect()\n            inset.x += svgBoundingBox.left - parentBoundingBox.left\n            inset.y += svgBoundingBox.top - parentBoundingBox.top\n        } else if (current instanceof SVGGraphicsElement) {\n            const { x, y } = current.getBBox()\n            inset.x += x\n            inset.y += y\n\n            let svg: SVGElement | null = null\n            let parent: SVGElement = current.parentNode as SVGElement\n            while (!svg) {\n                if (parent.tagName === \"svg\") {\n                    svg = parent\n                }\n                parent = current.parentNode as SVGElement\n            }\n            current = svg\n        } else {\n            break\n        }\n    }\n\n    return inset\n}\n","import { warnOnce } from \"motion-utils\"\nimport { Axis, axisKeys } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport { calcInset } from \"./offsets/inset\"\nimport {\n    OnScrollHandler,\n    OnScrollInfo,\n    ScrollInfo,\n    ScrollInfoOptions,\n} from \"./types\"\n\nfunction getTargetSize(target: Element) {\n    return \"getBBox\" in target && target.tagName !== \"svg\"\n        ? (target as SVGGraphicsElement).getBBox()\n        : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function createOnScrollHandler(\n    container: Element,\n    onScroll: OnScrollInfo,\n    info: ScrollInfo,\n    options: ScrollInfoOptions = {}\n): OnScrollHandler {\n    const { target } = options\n\n    /**\n     * In development mode ensure scroll containers aren't position: static as this makes\n     * it difficult to measure their relative positions. The document scrolling element\n     * is exempt: offsetParent measurements naturally resolve relative to the document.\n     */\n    if (process.env.NODE_ENV !== \"production\") {\n        if (\n            target &&\n            target !== container &&\n            container !== document.documentElement &&\n            container !== document.scrollingElement &&\n            container !== document.body\n        ) {\n            warnOnce(\n                getComputedStyle(container).position !== \"static\",\n                \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n            )\n        }\n    }\n\n    /**\n     * Handlers without a target or offset are notified with the container's\n     * shared info object, so they measure nothing themselves.\n     */\n    const needsOwnInfo = target || options.offset\n\n    return {\n        measure: (containerInfo) => {\n            if (!needsOwnInfo) return\n\n            info.time = containerInfo.time\n            for (const key in axisKeys) {\n                const axis = key as Axis\n                const { offset } = info[axis]\n                Object.assign(info[axis], containerInfo[axis])\n                info[axis].offset = offset\n            }\n\n            if (target && target !== container) {\n                const inset = calcInset(target, container)\n                const size = getTargetSize(target)\n                info.x.targetOffset = inset.x\n                info.y.targetOffset = inset.y\n                info.x.targetLength = size.width\n                info.y.targetLength = size.height\n            }\n\n            resolveOffsets(info, options)\n        },\n        notify: (containerInfo) =>\n            onScroll(needsOwnInfo ? info : containerInfo),\n    }\n}\n","import { cancelFrame, frame, frameData, resize, Process } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo, updateScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap<Element, VoidFunction>()\nconst resizeListeners = new WeakMap<Element, VoidFunction>()\nconst onScrollHandlers = new WeakMap<Element, Set<OnScrollHandler>>()\nconst dimensionCheckProcesses = new WeakMap<Element, Process>()\n\nexport type ScrollTargets = Array<HTMLElement>\n\nconst getEventTarget = (element: Element) =>\n    element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n    onScroll: OnScrollInfo,\n    {\n        container = document.scrollingElement as Element,\n        trackContentSize = false,\n        ...options\n    }: ScrollInfoOptions = {}\n) {\n    if (!container) return noop as VoidFunction\n\n    let containerHandlers = onScrollHandlers.get(container)\n\n    /**\n     * Get the onScroll handlers for this container.\n     * If one isn't found, create a new one.\n     */\n    if (!containerHandlers) {\n        containerHandlers = new Set()\n        onScrollHandlers.set(container, containerHandlers)\n    }\n\n    /**\n     * Create a new onScroll handler for the provided callback.\n     */\n    const info = createScrollInfo()\n    const containerHandler = createOnScrollHandler(\n        container,\n        onScroll,\n        info,\n        options\n    )\n    containerHandlers.add(containerHandler)\n\n    /**\n     * Check if there's a scroll event listener for this container.\n     * If not, create one.\n     */\n    if (!scrollListeners.has(container)) {\n        const containerInfo = createScrollInfo()\n\n        const measureAll = () => {\n            updateScrollInfo(container, containerInfo, frameData.timestamp)\n\n            for (const handler of containerHandlers) {\n                handler.measure(containerInfo)\n            }\n\n            frame.preUpdate(notifyAll)\n        }\n\n        const notifyAll = () => {\n            for (const handler of containerHandlers) {\n                handler.notify(containerInfo)\n            }\n        }\n\n        const listener = () => frame.read(measureAll)\n\n        scrollListeners.set(container, listener)\n\n        const target = getEventTarget(container)\n        window.addEventListener(\"resize\", listener)\n        if (container !== document.documentElement) {\n            resizeListeners.set(container, resize(container, listener))\n        }\n\n        target.addEventListener(\"scroll\", listener)\n\n        listener()\n    }\n\n    /**\n     * Enable content size tracking if requested and not already enabled.\n     */\n    if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n        const listener = scrollListeners.get(container)!\n\n        // Store initial scroll dimensions (object is reused to avoid allocation)\n        const size = {\n            width: container.scrollWidth,\n            height: container.scrollHeight,\n        }\n\n        // Add frame-based scroll dimension checking to detect content changes\n        const checkScrollDimensions: Process = () => {\n            const newWidth = container.scrollWidth\n            const newHeight = container.scrollHeight\n\n            if (size.width !== newWidth || size.height !== newHeight) {\n                listener()\n                size.width = newWidth\n                size.height = newHeight\n            }\n        }\n\n        // Schedule with keepAlive=true to run every frame\n        const dimensionCheckProcess = frame.read(checkScrollDimensions, true)\n        dimensionCheckProcesses.set(container, dimensionCheckProcess)\n    }\n\n    const listener = scrollListeners.get(container)!\n    frame.read(listener, false, true)\n\n    return () => {\n        cancelFrame(listener)\n\n        /**\n         * Check if we even have any handlers for this container.\n         */\n        const currentHandlers = onScrollHandlers.get(container)\n        if (!currentHandlers) return\n\n        currentHandlers.delete(containerHandler)\n\n        if (currentHandlers.size) return\n\n        /**\n         * If no more handlers, remove the scroll listener too. The handler\n         * set goes with it, as a measure still queued from this listener\n         * would otherwise notify handlers added by a later scrollInfo call.\n         */\n        onScrollHandlers.delete(container)\n        const scrollListener = scrollListeners.get(container)\n        scrollListeners.delete(container)\n\n        if (scrollListener) {\n            getEventTarget(container).removeEventListener(\n                \"scroll\",\n                scrollListener\n            )\n            resizeListeners.get(container)?.()\n            window.removeEventListener(\"resize\", scrollListener)\n        }\n\n        // Clean up scroll dimension checking\n        const dimensionCheckProcess = dimensionCheckProcesses.get(container)\n        if (dimensionCheckProcess) {\n            cancelFrame(dimensionCheckProcess)\n            dimensionCheckProcesses.delete(container)\n        }\n    }\n}\n","import { supportsScrollTimeline, supportsViewTimeline } from \"motion-dom\"\n\nexport function canUseNativeTimeline(target?: Element) {\n    if (typeof window === \"undefined\") return false\n    return target ? supportsViewTimeline() : supportsScrollTimeline()\n}\n","import { ProgressTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n    constructor(options: ScrollOptions)\n\n    currentTime: null | { value: number }\n\n    cancel?: VoidFunction\n}\n\ndeclare class ViewTimeline implements ProgressTimeline {\n    constructor(options: { subject: Element; axis?: string })\n\n    currentTime: null | { value: number }\n\n    cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n    Element,\n    Map<Element | \"self\", Record<string, ProgressTimeline>>\n>()\n\n/**\n * Native timelines are only attached to WAAPI animations. Offsets are\n * applied to each animation as a range, so a timeline is shared by every\n * offset.\n */\nexport function getTimeline({\n    container,\n    target,\n    axis,\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n    let containerCache = timelineCache.get(container)\n    if (!containerCache) {\n        containerCache = new Map()\n        timelineCache.set(container, containerCache)\n    }\n\n    const targetKey = target ?? \"self\"\n    let targetCache = containerCache.get(targetKey)\n    if (!targetCache) {\n        targetCache = {}\n        containerCache.set(targetKey, targetCache)\n    }\n\n    return (targetCache[axis] ||= target\n        ? new ViewTimeline({ subject: target, axis })\n        : new ScrollTimeline({ source: container, axis } as any))\n}\n","import { resolveOffset } from \"../offsets/offset\"\nimport { ScrollOffset as presets } from \"../offsets/presets\"\nimport { ScrollOffset } from \"../types\"\n\nexport interface ViewTimelineRange {\n    /**\n     * Named range offsets of the offset's two points.\n     */\n    points: string[]\n\n    /**\n     * The offset runs forwards when a × target length + b × container length\n     * is >= 0. Otherwise its range runs from the second point to the first,\n     * with progress reversed.\n     */\n    a: number\n    b: number\n\n    /**\n     * Whether this is the ViewTimeline's default range, run forwards.\n     */\n    cover: boolean\n}\n\n/**\n * Resolved offsets are linear in the target and container lengths, so\n * probing them gives [target progress, container progress, pixels].\n * vw/vh can resolve to 0px, so they're rejected up front.\n */\nconst toIntersection = (o: ScrollOffset[number]) => {\n    if (/v/u.test(o as string)) return []\n    const px = resolveOffset(o, 0, 0, 0)\n    return [resolveOffset(o, 0, 1, 0) - px, px - resolveOffset(o, 1, 0, 0), px]\n}\n\nconst toRange = ([t, c, px]: number[]) =>\n    !px &&\n    (c === 0 || c === 1) &&\n    `${c ? \"entry\" : \"exit\"}-crossing ${t * 100}%`\n\n/**\n * Maps an offset to an equivalent ViewTimeline range. Returns undefined when\n * there isn't one, which signals the caller to fall back to JS-based scroll\n * tracking.\n */\nexport function offsetToViewTimelineRange(\n    offset: ScrollOffset = presets.All\n): ViewTimelineRange | undefined {\n    if (offset.length !== 2) return\n\n    const [start, end] = offset.map(toIntersection)\n    const points = [toRange(start), toRange(end)]\n    const a = end[0] - start[0]\n    const b = start[1] - end[1]\n\n    if (points[0] && points[1] && (a || b)) {\n        return {\n            points: points as string[],\n            a,\n            b,\n            cover: !start[0] && a === 1 && b === 1,\n        }\n    }\n}\n","import { AnimationPlaybackControls, resize } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { canUseNativeTimeline } from \"./utils/can-use-native-timeline\"\nimport { getTimeline } from \"./utils/get-timeline\"\nimport { offsetToViewTimelineRange } from \"./utils/offset-to-range\"\n\nexport function attachToAnimation(\n    animation: AnimationPlaybackControls,\n    options: ScrollOptionsWithDefaults\n) {\n    const { target, container, axis } = options\n    const range = target && offsetToViewTimelineRange(options.offset)\n\n    /**\n     * Use native timeline when:\n     * - No target and no offset: ScrollTimeline\n     * - Target with mappable offset: ViewTimeline with named range\n     * - Otherwise: fall back to JS observe. A ScrollTimeline has no offset,\n     *   so page offsets are applied by the JS timeline.\n     */\n    const native =\n        canUseNativeTimeline(target) && (target ? !!range : !options.offset)\n    const animations = new Map<Animation, PlaybackDirection>()\n    const observed = new Set<AnimationPlaybackControls>()\n    let stopObserving: VoidFunction | undefined\n    let reverse = false\n\n    /**\n     * When an offset's second point comes first, its range is swapped and\n     * the animation played backwards. The range is set after the direction,\n     * as that's what realigns a running animation with its timeline. Chrome\n     * skips that realignment when the range changes in the frame the\n     * animation starts, leaving it offset for good, so it's replayed too.\n     */\n    const apply = (direction: PlaybackDirection, waapi: Animation) => {\n        const [start, end] = range!.points\n        waapi.effect!.updateTiming({\n            direction: reverse\n                ? direction === \"normal\"\n                    ? \"reverse\"\n                    : \"alternate-reverse\"\n                : direction,\n        })\n        Object.assign(waapi, {\n            rangeStart: reverse ? end : start,\n            rangeEnd: reverse ? start : end,\n        })\n        waapi.play()\n    }\n\n    const stops = [\n        animation.attachTimeline({\n            /**\n             * Read only by WAAPI animations, so values driven from JS don't\n             * create a native timeline they won't use.\n             */\n            get timeline() {\n                return native ? getTimeline(options) : undefined\n            },\n            onAttach:\n                range &&\n                ((waapi) => {\n                    const direction = waapi.effect!.getTiming().direction!\n                    animations.set(waapi, direction)\n                    apply(direction, waapi)\n                }),\n            /**\n             * Values driven from JS all track the offset with scrollInfo,\n             * which measures once per frame for all of them.\n             */\n            observe: (valueAnimation) => {\n                valueAnimation.pause()\n                observed.add(valueAnimation)\n\n                stopObserving ||= scrollInfo((info) => {\n                    observed.forEach((observedAnimation) => {\n                        observedAnimation.time =\n                            observedAnimation.iterationDuration *\n                            info[axis].progress\n                    })\n                }, options)\n\n                return () => observed.delete(valueAnimation)\n            },\n        }),\n    ]\n\n    if (native && range) {\n        const { a, b } = range\n        const length = axis === \"y\" ? \"clientHeight\" : \"clientWidth\"\n\n        /**\n         * Offsets like All only run forwards when the target is longer than\n         * the container, so their direction is remeasured on resize.\n         */\n        const update = () => {\n            if (\n                reverse !==\n                (reverse = a * target![length] + b * container[length] < 0)\n            ) {\n                animations.forEach(apply)\n            }\n        }\n        update()\n\n        if (a * b < 0) {\n            stops.push(resize(update), resize([target!, container], update))\n        }\n    }\n\n    return () => {\n        stops.forEach((stop) => stop())\n        stopObserving?.()\n    }\n}\n","import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n    onScroll: OnScroll | AnimationPlaybackControls,\n    {\n        axis = \"y\",\n        source,\n        container = document.scrollingElement as Element,\n        ...options\n    }: ScrollOptions = {}\n): VoidFunction {\n    if (!container) return noop as VoidFunction\n\n    const optionsWithDefaults = {\n        axis,\n        container: source || container,\n        ...options,\n    }\n\n    return typeof onScroll === \"function\"\n        ? scrollInfo(\n              (info) => onScroll(info[axis].progress, info),\n              optionsWithDefaults\n          )\n        : attachToAnimation(onScroll, optionsWithDefaults)\n}\n","import { ElementOrSelector, resolveElements } from \"motion-dom\"\n\nexport type ViewChangeHandler = (entry: IntersectionObserverEntry) => void\n\ntype MarginValue = `${number}${\"px\" | \"%\"}`\ntype MarginType =\n    | MarginValue\n    | `${MarginValue} ${MarginValue}`\n    | `${MarginValue} ${MarginValue} ${MarginValue}`\n    | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`\n\nexport interface InViewOptions {\n    root?: Element | Document\n    margin?: MarginType\n    amount?: \"some\" | \"all\" | number\n}\n\nconst thresholds = {\n    some: 0,\n    all: 1,\n}\n\nexport function inView(\n    elementOrSelector: ElementOrSelector,\n    onStart: (\n        element: Element,\n        entry: IntersectionObserverEntry\n    ) => void | ViewChangeHandler,\n    { root, margin: rootMargin, amount = \"some\" }: InViewOptions = {}\n): VoidFunction {\n    const elements = resolveElements(elementOrSelector)\n\n    const activeIntersections = new WeakMap<Element, ViewChangeHandler>()\n\n    const onIntersectionChange: IntersectionObserverCallback = (entries) => {\n        entries.forEach((entry) => {\n            const onEnd = activeIntersections.get(entry.target)\n\n            /**\n             * If there's no change to the intersection, we don't need to\n             * do anything here.\n             */\n            if (entry.isIntersecting === Boolean(onEnd)) return\n\n            if (entry.isIntersecting) {\n                const newOnEnd = onStart(entry.target, entry)\n                if (typeof newOnEnd === \"function\") {\n                    activeIntersections.set(entry.target, newOnEnd)\n                } else {\n                    observer.unobserve(entry.target)\n                }\n            } else if (typeof onEnd === \"function\") {\n                onEnd(entry)\n                activeIntersections.delete(entry.target)\n            }\n        })\n    }\n\n    const observer = new IntersectionObserver(onIntersectionChange, {\n        root,\n        rootMargin,\n        threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n    })\n\n    elements.forEach((element) => observer.observe(element))\n\n    return () => observer.disconnect()\n}\n","import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n    // Multi-dimensional\n    const xDelta = distance(a.x, b.x)\n    const yDelta = distance(a.y, b.y)\n    return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n"]}