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GACjF,C","sources":["webpack://lcci/./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/events/event-info.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/events/use-dom-event.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/events/use-pointer-event.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/events/utils.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/gestures/utils/event-type.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/projection/utils/measure.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/utils/shallow-compare.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/motion/features/animations.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/gestures/use-hover-gesture.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/utils/warn-once.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/motion/features/viewport/use-viewport.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/motion/features/gestures.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/gestures/use-tap-gesture.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/gestures/use-focus-gesture.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/utils/lifecycles.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/index.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/utils/motion-values.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/html/visual-element.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/svg/visual-element.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/features-animation.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/utils/animation.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/utils/setters.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/render/utils/types.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/utils/use-id.mjs","webpack://lcci/./node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useId } from '../../utils/use-id.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence() {\n var context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n // Replace with useId when released in React\n var id = useId();\n useEffect(function () { return register(id); }, []);\n var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); };\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","import { __read, __rest } from 'tslib';\nimport * as React from 'react';\nimport { useState, useRef, useEffect } from 'react';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { loadFeatures } from '../../motion/features/definitions.mjs';\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimations } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimations')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nfunction LazyMotion(_a) {\n var children = _a.children, features = _a.features, _b = _a.strict, strict = _b === void 0 ? false : _b;\n var _c = __read(useState(!isLazyBundle(features)), 2), setIsLoaded = _c[1];\n var loadedRenderer = useRef(undefined);\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n var renderer = features.renderer, loadedFeatures = __rest(features, [\"renderer\"]);\n loadedRenderer.current = renderer;\n loadFeatures(loadedFeatures);\n }\n useEffect(function () {\n if (isLazyBundle(features)) {\n features().then(function (_a) {\n var renderer = _a.renderer, loadedFeatures = __rest(_a, [\"renderer\"]);\n loadFeatures(loadedFeatures);\n loadedRenderer.current = renderer;\n setIsLoaded(true);\n });\n }\n }, []);\n return (React.createElement(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict: strict } }, children));\n}\nfunction isLazyBundle(features) {\n return typeof features === \"function\";\n}\n\nexport { LazyMotion };\n","import { isTouchEvent } from '../gestures/utils/event-type.mjs';\n\n/**\n * Filters out events not attached to the primary pointer (currently left mouse button)\n * @param eventHandler\n */\nfunction filterPrimaryPointer(eventHandler) {\n return function (event) {\n var isMouseEvent = event instanceof MouseEvent;\n var isPrimaryPointer = !isMouseEvent ||\n (isMouseEvent && event.button === 0);\n if (isPrimaryPointer) {\n eventHandler(event);\n }\n };\n}\nvar defaultPagePoint = { pageX: 0, pageY: 0 };\nfunction pointFromTouch(e, pointType) {\n if (pointType === void 0) { pointType = \"page\"; }\n var primaryTouch = e.touches[0] || e.changedTouches[0];\n var point = primaryTouch || defaultPagePoint;\n return {\n x: point[pointType + \"X\"],\n y: point[pointType + \"Y\"],\n };\n}\nfunction pointFromMouse(point, pointType) {\n if (pointType === void 0) { pointType = \"page\"; }\n return {\n x: point[pointType + \"X\"],\n y: point[pointType + \"Y\"],\n };\n}\nfunction extractEventInfo(event, pointType) {\n if (pointType === void 0) { pointType = \"page\"; }\n return {\n point: isTouchEvent(event)\n ? pointFromTouch(event, pointType)\n : pointFromMouse(event, pointType),\n };\n}\nvar wrapHandler = function (handler, shouldFilterPrimaryPointer) {\n if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; }\n var listener = function (event) {\n return handler(event, extractEventInfo(event));\n };\n return shouldFilterPrimaryPointer\n ? filterPrimaryPointer(listener)\n : listener;\n};\n\nexport { extractEventInfo, wrapHandler };\n","import { useEffect } from 'react';\n\nfunction addDomEvent(target, eventName, handler, options) {\n if (options === void 0) { options = { passive: true }; }\n target.addEventListener(eventName, handler, options);\n return function () { return target.removeEventListener(eventName, handler); };\n}\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nfunction useDomEvent(ref, eventName, handler, options) {\n useEffect(function () {\n var element = ref.current;\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options);\n }\n }, [ref, eventName, handler, options]);\n}\n\nexport { addDomEvent, useDomEvent };\n","import { addDomEvent, useDomEvent } from './use-dom-event.mjs';\nimport { wrapHandler } from './event-info.mjs';\nimport { supportsPointerEvents, supportsTouchEvents, supportsMouseEvents } from './utils.mjs';\n\nvar mouseEventNames = {\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointercancel: \"mousecancel\",\n pointerover: \"mouseover\",\n pointerout: \"mouseout\",\n pointerenter: \"mouseenter\",\n pointerleave: \"mouseleave\",\n};\nvar touchEventNames = {\n pointerdown: \"touchstart\",\n pointermove: \"touchmove\",\n pointerup: \"touchend\",\n pointercancel: \"touchcancel\",\n};\nfunction getPointerEventName(name) {\n if (supportsPointerEvents()) {\n return name;\n }\n else if (supportsTouchEvents()) {\n return touchEventNames[name];\n }\n else if (supportsMouseEvents()) {\n return mouseEventNames[name];\n }\n return name;\n}\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === \"pointerdown\"), options);\n}\nfunction usePointerEvent(ref, eventName, handler, options) {\n return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === \"pointerdown\"), options);\n}\n\nexport { addPointerEvent, usePointerEvent };\n","import { isBrowser } from '../utils/is-browser.mjs';\n\n// We check for event support via functions in case they've been mocked by a testing suite.\nvar supportsPointerEvents = function () {\n return isBrowser && window.onpointerdown === null;\n};\nvar supportsTouchEvents = function () {\n return isBrowser && window.ontouchstart === null;\n};\nvar supportsMouseEvents = function () {\n return isBrowser && window.onmousedown === null;\n};\n\nexport { supportsMouseEvents, supportsPointerEvents, supportsTouchEvents };\n","function createLock(name) {\n var lock = null;\n return function () {\n var openLock = function () {\n lock = null;\n };\n if (lock === null) {\n lock = name;\n return openLock;\n }\n return false;\n };\n}\nvar globalHorizontalLock = createLock(\"dragHorizontal\");\nvar globalVerticalLock = createLock(\"dragVertical\");\nfunction getGlobalLock(drag) {\n var lock = false;\n if (drag === \"y\") {\n lock = globalVerticalLock();\n }\n else if (drag === \"x\") {\n lock = globalHorizontalLock();\n }\n else {\n var openHorizontal_1 = globalHorizontalLock();\n var openVertical_1 = globalVerticalLock();\n if (openHorizontal_1 && openVertical_1) {\n lock = function () {\n openHorizontal_1();\n openVertical_1();\n };\n }\n else {\n // Release the locks because we don't use them\n if (openHorizontal_1)\n openHorizontal_1();\n if (openVertical_1)\n openVertical_1();\n }\n }\n return lock;\n}\nfunction isDragActive() {\n // Check the gesture lock - if we get it, it means no drag gesture is active\n // and we can safely fire the tap gesture.\n var openGestureLock = getGlobalLock(true);\n if (!openGestureLock)\n return true;\n openGestureLock();\n return false;\n}\n\nexport { createLock, getGlobalLock, isDragActive };\n","function isMouseEvent(event) {\n // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check.\n if (typeof PointerEvent !== \"undefined\" && event instanceof PointerEvent) {\n return !!(event.pointerType === \"mouse\");\n }\n return event instanceof MouseEvent;\n}\nfunction isTouchEvent(event) {\n var hasTouches = !!event.touches;\n return hasTouches;\n}\n\nexport { isMouseEvent, isTouchEvent };\n","var makeRenderlessComponent = function (hook) { return function (props) {\n hook(props);\n return null;\n}; };\n\nexport { makeRenderlessComponent };\n","/**\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 */\nfunction convertBoundingBoxToBox(_a) {\n var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom;\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox(_a) {\n var x = _a.x, y = _a.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 */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n var topLeft = transformPoint({ x: point.left, y: point.top });\n var 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\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n","import { __read } from 'tslib';\nimport { mix } from 'popmotion';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n var distanceFromOrigin = point - originPoint;\n var scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate, scale, originPoint, boxScale) {\n if (translate === void 0) { translate = 0; }\n if (scale === void 0) { scale = 1; }\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, _a) {\n var x = _a.x, y = _a.y;\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition) {\n var _a, _b;\n if (isSharedTransition === void 0) { isSharedTransition = false; }\n var treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n var node;\n var delta;\n for (var i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n if (((_b = (_a = node.instance) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === \"contents\")\n continue;\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(box, { x: -node.scroll.x, y: -node.scroll.y });\n }\n if (delta) {\n // Incoporate each ancestor's scale into a culmulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues);\n }\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min = axis.min + distance;\n axis.max = axis.max + distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, transforms, _a) {\n var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2];\n var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5;\n var originPoint = mix(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nvar xKeys = [\"x\", \"scaleX\", \"originX\"];\nvar yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform) {\n transformAxis(box.x, transform, xKeys);\n transformAxis(box.y, transform, yKeys);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale(_a) {\n var scale = _a.scale, scaleX = _a.scaleX, scaleY = _a.scaleY;\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n hasTranslate(values.x) ||\n hasTranslate(values.y) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY);\n}\nfunction hasTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { hasScale, hasTransform };\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n var viewportBox = measureViewportBox(element, transformPagePoint);\n var scroll = rootProjectionNode.scroll;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.x);\n translateAxis(viewportBox.y, scroll.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n var prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (var i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n","import { __spreadArray, __read, __assign, __rest } from 'tslib';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\nimport { animateVisualElement } from './animation.mjs';\nimport { AnimationType } from './types.mjs';\nimport { isVariantLabels, resolveVariant, isVariantLabel } from './variants.mjs';\n\nvar variantPriorityOrder = [\n AnimationType.Animate,\n AnimationType.InView,\n AnimationType.Focus,\n AnimationType.Hover,\n AnimationType.Tap,\n AnimationType.Drag,\n AnimationType.Exit,\n];\nvar reversePriorityOrder = __spreadArray([], __read(variantPriorityOrder), false).reverse();\nvar numAnimationTypes = variantPriorityOrder.length;\nfunction animateList(visualElement) {\n return function (animations) {\n return Promise.all(animations.map(function (_a) {\n var animation = _a.animation, options = _a.options;\n return animateVisualElement(visualElement, animation, options);\n }));\n };\n}\nfunction createAnimationState(visualElement) {\n var animate = animateList(visualElement);\n var state = createState();\n var allAnimatedKeys = {};\n var isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n var buildResolvedTypeValues = function (acc, definition) {\n var resolved = resolveVariant(visualElement, definition);\n if (resolved) {\n resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, [\"transition\", \"transitionEnd\"]);\n acc = __assign(__assign(__assign({}, acc), target), transitionEnd);\n }\n return acc;\n };\n function isAnimated(key) {\n return allAnimatedKeys[key] !== undefined;\n }\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(options, changedActiveType) {\n var _a;\n var props = visualElement.getProps();\n var context = visualElement.getVariantContext(true) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n var animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n var removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n var encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n var removedVariantIndex = Infinity;\n var _loop_1 = function (i) {\n var type = reversePriorityOrder[i];\n var typeState = state[type];\n var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type];\n var propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n var activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n var isInherited = prop === context[type] && prop !== props[type] && propIsVariant;\n /**\n *\n */\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = __assign({}, encounteredKeys);\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n return \"continue\";\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n var shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n var definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;\n var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues);\n var markToAnimate = function (key) {\n shouldAnimateType = true;\n removedKeys.delete(key);\n typeState.needsAnimating[key] = true;\n };\n for (var key in allKeys) {\n var next = resolvedValues[key];\n var prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n if (next !== prev) {\n /**\n * If both values are keyframes, we need to shallow compare them to\n * detect whether any value has changed. If it has, we animate it.\n */\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n if (!shallowCompare(next, prev) || variantDidChange) {\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we want to ensure it doesn't animate by\n * adding it to the list of protected keys.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n else if (next !== undefined) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n /**\n *\n */\n if (typeState.isActive) {\n encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues);\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to hard-block animations\n * TODO: Test as this should probably still handle animations triggered\n * by removed values?\n */\n if (shouldAnimateType && !isInherited) {\n animations.push.apply(animations, __spreadArray([], __read(definitionList.map(function (animation) { return ({\n animation: animation,\n options: __assign({ type: type }, options),\n }); })), false));\n }\n };\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (var i = 0; i < numAnimationTypes; i++) {\n _loop_1(i);\n }\n allAnimatedKeys = __assign({}, encounteredKeys);\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n var fallbackAnimation_1 = {};\n removedKeys.forEach(function (key) {\n var fallbackTarget = visualElement.getBaseTarget(key);\n if (fallbackTarget !== undefined) {\n fallbackAnimation_1[key] = fallbackTarget;\n }\n });\n animations.push({ animation: fallbackAnimation_1 });\n }\n var shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n props.initial === false &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive, options) {\n var _a;\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });\n state[type].isActive = isActive;\n var animations = animateChanges(options, type);\n for (var key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n isAnimated: isAnimated,\n animateChanges: animateChanges,\n setActive: setActive,\n setAnimateFunction: setAnimateFunction,\n getState: function () { return state; },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (isVariantLabels(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive) {\n if (isActive === void 0) { isActive = false; }\n return {\n isActive: isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n var _a;\n return _a = {},\n _a[AnimationType.Animate] = createTypeState(true),\n _a[AnimationType.InView] = createTypeState(),\n _a[AnimationType.Hover] = createTypeState(),\n _a[AnimationType.Tap] = createTypeState(),\n _a[AnimationType.Drag] = createTypeState(),\n _a[AnimationType.Focus] = createTypeState(),\n _a[AnimationType.Exit] = createTypeState(),\n _a;\n}\n\nexport { checkVariantsDidChange, createAnimationState, variantPriorityOrder };\n","import { __read } from 'tslib';\nimport { useEffect, useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { usePresence } from '../../components/AnimatePresence/use-presence.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { createAnimationState } from '../../render/utils/animation-state.mjs';\nimport { AnimationType } from '../../render/utils/types.mjs';\nimport { makeRenderlessComponent } from '../utils/make-renderless-component.mjs';\n\nvar animations = {\n animation: makeRenderlessComponent(function (_a) {\n var visualElement = _a.visualElement, animate = _a.animate;\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement));\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n if (isAnimationControls(animate)) {\n useEffect(function () { return animate.subscribe(visualElement); }, [animate]);\n }\n }),\n exit: makeRenderlessComponent(function (props) {\n var custom = props.custom, visualElement = props.visualElement;\n var _a = __read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1];\n var presenceContext = useContext(PresenceContext);\n useEffect(function () {\n var _a, _b;\n visualElement.isPresent = isPresent;\n var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom });\n !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove));\n }, [isPresent]);\n }),\n};\n\nexport { animations };\n","import { isMouseEvent } from './utils/event-type.mjs';\nimport { AnimationType } from '../render/utils/types.mjs';\nimport { usePointerEvent } from '../events/use-pointer-event.mjs';\nimport { isDragActive } from './drag/utils/lock.mjs';\n\nfunction createHoverEvent(visualElement, isActive, callback) {\n return function (event, info) {\n var _a;\n if (!isMouseEvent(event) || isDragActive())\n return;\n /**\n * Ensure we trigger animations before firing event callback\n */\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive);\n callback === null || callback === void 0 ? void 0 : callback(event, info);\n };\n}\nfunction useHoverGesture(_a) {\n var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;\n usePointerEvent(visualElement, \"pointerenter\", onHoverStart || whileHover\n ? createHoverEvent(visualElement, true, onHoverStart)\n : undefined, { passive: !onHoverStart });\n usePointerEvent(visualElement, \"pointerleave\", onHoverEnd || whileHover\n ? createHoverEvent(visualElement, false, onHoverEnd)\n : undefined, { passive: !onHoverEnd });\n}\n\nexport { useHoverGesture };\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nvar isNodeOrChild = function (parent, child) {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n","var warned = new Set();\nfunction warnOnce(condition, message, element) {\n if (condition || warned.has(message))\n return;\n console.warn(message);\n if (element)\n console.warn(element);\n warned.add(message);\n}\n\nexport { warnOnce };\n","import { __rest, __assign } from 'tslib';\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nvar observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nvar observers = new WeakMap();\nvar fireObserverCallback = function (entry) {\n var _a;\n (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n};\nvar fireAllObserverCallbacks = function (entries) {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver(_a) {\n var root = _a.root, options = __rest(_a, [\"root\"]);\n var lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n var rootObservers = observers.get(lookupRoot);\n var key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __assign({ root: root }, options));\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n var rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return function () {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n","import { env } from '../../../utils/process.mjs';\nimport { useRef, useEffect } from 'react';\nimport { AnimationType } from '../../../render/utils/types.mjs';\nimport { warnOnce } from '../../../utils/warn-once.mjs';\nimport { observeIntersection } from './observers.mjs';\n\nfunction useViewport(_a) {\n var visualElement = _a.visualElement, whileInView = _a.whileInView, onViewportEnter = _a.onViewportEnter, onViewportLeave = _a.onViewportLeave, _b = _a.viewport, viewport = _b === void 0 ? {} : _b;\n var state = useRef({\n hasEnteredView: false,\n isInView: false,\n });\n var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave);\n if (viewport.once && state.current.hasEnteredView)\n shouldObserve = false;\n var useObserver = typeof IntersectionObserver === \"undefined\"\n ? useMissingIntersectionObserver\n : useIntersectionObserver;\n useObserver(shouldObserve, state.current, visualElement, viewport);\n}\nvar thresholdNames = {\n some: 0,\n all: 1,\n};\nfunction useIntersectionObserver(shouldObserve, state, visualElement, _a) {\n var root = _a.root, rootMargin = _a.margin, _b = _a.amount, amount = _b === void 0 ? \"some\" : _b, once = _a.once;\n useEffect(function () {\n if (!shouldObserve)\n return;\n var options = {\n root: root === null || root === void 0 ? void 0 : root.current,\n rootMargin: rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n var intersectionCallback = function (entry) {\n var _a;\n var isIntersecting = entry.isIntersecting;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (state.isInView === isIntersecting)\n return;\n state.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && state.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n state.hasEnteredView = true;\n }\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, isIntersecting);\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n var props = visualElement.getProps();\n var callback = isIntersecting\n ? props.onViewportEnter\n : props.onViewportLeave;\n callback === null || callback === void 0 ? void 0 : callback(entry);\n };\n return observeIntersection(visualElement.getInstance(), options, intersectionCallback);\n }, [shouldObserve, root, rootMargin, amount]);\n}\n/**\n * If IntersectionObserver is missing, we activate inView and fire onViewportEnter\n * on mount. This way, the page will be in the state the author expects users\n * to see it in for everyone.\n */\nfunction useMissingIntersectionObserver(shouldObserve, state, visualElement, _a) {\n var _b = _a.fallback, fallback = _b === void 0 ? true : _b;\n useEffect(function () {\n if (!shouldObserve || !fallback)\n return;\n if (env !== \"production\") {\n warnOnce(false, \"IntersectionObserver not available on this device. whileInView animations will trigger on mount.\");\n }\n /**\n * Fire this in an rAF because, at this point, the animation state\n * won't have flushed for the first time and there's certain logic in\n * there that behaves differently on the initial animation.\n *\n * This hook should be quite rarely called so setting this in an rAF\n * is preferred to changing the behaviour of the animation state.\n */\n requestAnimationFrame(function () {\n var _a;\n state.hasEnteredView = true;\n var onViewportEnter = visualElement.getProps().onViewportEnter;\n onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null);\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, true);\n });\n }, [shouldObserve]);\n}\n\nexport { useViewport };\n","import { useFocusGesture } from '../../gestures/use-focus-gesture.mjs';\nimport { useHoverGesture } from '../../gestures/use-hover-gesture.mjs';\nimport { useTapGesture } from '../../gestures/use-tap-gesture.mjs';\nimport { useViewport } from './viewport/use-viewport.mjs';\nimport { makeRenderlessComponent } from '../utils/make-renderless-component.mjs';\n\nvar gestureAnimations = {\n inView: makeRenderlessComponent(useViewport),\n tap: makeRenderlessComponent(useTapGesture),\n focus: makeRenderlessComponent(useFocusGesture),\n hover: makeRenderlessComponent(useHoverGesture),\n};\n\nexport { gestureAnimations };\n","import { __assign, __read } from 'tslib';\nimport { number, px } from 'style-value-types';\nimport { isKeyframesTarget } from '../../../animation/utils/is-keyframes-target.mjs';\nimport { invariant } from 'hey-listen';\nimport { transformProps } from '../../html/utils/transform.mjs';\nimport { findDimensionValueType } from '../value-types/dimensions.mjs';\n\nvar positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n \"x\",\n \"y\",\n]);\nvar isPositionalKey = function (key) { return positionalKeys.has(key); };\nvar hasPositionalKey = function (target) {\n return Object.keys(target).some(isPositionalKey);\n};\nvar setAndResetVelocity = function (value, to) {\n // Looks odd but setting it twice doesn't render, it'll just\n // set both prev and current to the latest value\n value.set(to, false);\n value.set(to);\n};\nvar isNumOrPxType = function (v) {\n return v === number || v === px;\n};\nvar BoundingBoxDimension;\n(function (BoundingBoxDimension) {\n BoundingBoxDimension[\"width\"] = \"width\";\n BoundingBoxDimension[\"height\"] = \"height\";\n BoundingBoxDimension[\"left\"] = \"left\";\n BoundingBoxDimension[\"right\"] = \"right\";\n BoundingBoxDimension[\"top\"] = \"top\";\n BoundingBoxDimension[\"bottom\"] = \"bottom\";\n})(BoundingBoxDimension || (BoundingBoxDimension = {}));\nvar getPosFromMatrix = function (matrix, pos) {\n return parseFloat(matrix.split(\", \")[pos]);\n};\nvar getTranslateFromMatrix = function (pos2, pos3) {\n return function (_bbox, _a) {\n var transform = _a.transform;\n if (transform === \"none\" || !transform)\n return 0;\n var matrix3d = transform.match(/^matrix3d\\((.+)\\)$/);\n if (matrix3d) {\n return getPosFromMatrix(matrix3d[1], pos3);\n }\n else {\n var matrix = transform.match(/^matrix\\((.+)\\)$/);\n if (matrix) {\n return getPosFromMatrix(matrix[1], pos2);\n }\n else {\n return 0;\n }\n }\n };\n};\nvar transformKeys = new Set([\"x\", \"y\", \"z\"]);\nvar nonTranslationalTransformKeys = transformProps.filter(function (key) { return !transformKeys.has(key); });\nfunction removeNonTranslationalTransform(visualElement) {\n var removedTransforms = [];\n nonTranslationalTransformKeys.forEach(function (key) {\n var 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 // Apply changes to element before measurement\n if (removedTransforms.length)\n visualElement.syncRender();\n return removedTransforms;\n}\nvar positionalValues = {\n // Dimensions\n width: function (_a, _b) {\n var x = _a.x;\n var _c = _b.paddingLeft, paddingLeft = _c === void 0 ? \"0\" : _c, _d = _b.paddingRight, paddingRight = _d === void 0 ? \"0\" : _d;\n return x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight);\n },\n height: function (_a, _b) {\n var y = _a.y;\n var _c = _b.paddingTop, paddingTop = _c === void 0 ? \"0\" : _c, _d = _b.paddingBottom, paddingBottom = _d === void 0 ? \"0\" : _d;\n return y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom);\n },\n top: function (_bbox, _a) {\n var top = _a.top;\n return parseFloat(top);\n },\n left: function (_bbox, _a) {\n var left = _a.left;\n return parseFloat(left);\n },\n bottom: function (_a, _b) {\n var y = _a.y;\n var top = _b.top;\n return parseFloat(top) + (y.max - y.min);\n },\n right: function (_a, _b) {\n var x = _a.x;\n var left = _b.left;\n return parseFloat(left) + (x.max - x.min);\n },\n // Transform\n x: getTranslateFromMatrix(4, 13),\n y: getTranslateFromMatrix(5, 14),\n};\nvar convertChangedValueTypes = function (target, visualElement, changedKeys) {\n var originBbox = visualElement.measureViewportBox();\n var element = visualElement.getInstance();\n var elementComputedStyle = getComputedStyle(element);\n var display = elementComputedStyle.display;\n var origin = {};\n // If the element is currently set to display: \"none\", make it visible before\n // measuring the target bounding box\n if (display === \"none\") {\n visualElement.setStaticValue(\"display\", target.display || \"block\");\n }\n /**\n * Record origins before we render and update styles\n */\n changedKeys.forEach(function (key) {\n origin[key] = positionalValues[key](originBbox, elementComputedStyle);\n });\n // Apply the latest values (as set in checkAndConvertChangedValueTypes)\n visualElement.syncRender();\n var targetBbox = visualElement.measureViewportBox();\n changedKeys.forEach(function (key) {\n // Restore styles to their **calculated computed style**, not their actual\n // originally set style. This allows us to animate between equivalent pixel units.\n var value = visualElement.getValue(key);\n setAndResetVelocity(value, origin[key]);\n target[key] = positionalValues[key](targetBbox, elementComputedStyle);\n });\n return target;\n};\nvar checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) {\n if (origin === void 0) { origin = {}; }\n if (transitionEnd === void 0) { transitionEnd = {}; }\n target = __assign({}, target);\n transitionEnd = __assign({}, transitionEnd);\n var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);\n // We want to remove any transform values that could affect the element's bounding box before\n // it's measured. We'll reapply these later.\n var removedTransformValues = [];\n var hasAttemptedToRemoveTransformValues = false;\n var changedValueTypeKeys = [];\n targetPositionalKeys.forEach(function (key) {\n var value = visualElement.getValue(key);\n if (!visualElement.hasValue(key))\n return;\n var from = origin[key];\n var fromType = findDimensionValueType(from);\n var to = target[key];\n var toType;\n // TODO: The current implementation of this basically throws an error\n // if you try and do value conversion via keyframes. There's probably\n // a way of doing this but the performance implications would need greater scrutiny,\n // as it'd be doing multiple resize-remeasure operations.\n if (isKeyframesTarget(to)) {\n var numKeyframes = to.length;\n var fromIndex = to[0] === null ? 1 : 0;\n from = to[fromIndex];\n fromType = findDimensionValueType(from);\n for (var i = fromIndex; i < numKeyframes; i++) {\n if (!toType) {\n toType = findDimensionValueType(to[i]);\n invariant(toType === fromType ||\n (isNumOrPxType(fromType) && isNumOrPxType(toType)), \"Keyframes must be of the same dimension as the current value\");\n }\n else {\n invariant(findDimensionValueType(to[i]) === toType, \"All keyframes must be of the same type\");\n }\n }\n }\n else {\n toType = findDimensionValueType(to);\n }\n if (fromType !== toType) {\n // If they're both just number or px, convert them both to numbers rather than\n // relying on resize/remeasure to convert (which is wasteful in this situation)\n if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {\n var current = value.get();\n if (typeof current === \"string\") {\n value.set(parseFloat(current));\n }\n if (typeof to === \"string\") {\n target[key] = parseFloat(to);\n }\n else if (Array.isArray(to) && toType === px) {\n target[key] = to.map(parseFloat);\n }\n }\n else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) &&\n (toType === null || toType === void 0 ? void 0 : toType.transform) &&\n (from === 0 || to === 0)) {\n // If one or the other value is 0, it's safe to coerce it to the\n // type of the other without measurement\n if (from === 0) {\n value.set(toType.transform(from));\n }\n else {\n target[key] = fromType.transform(to);\n }\n }\n else {\n // If we're going to do value conversion via DOM measurements, we first\n // need to remove non-positional transform values that could affect the bbox measurements.\n if (!hasAttemptedToRemoveTransformValues) {\n removedTransformValues =\n removeNonTranslationalTransform(visualElement);\n hasAttemptedToRemoveTransformValues = true;\n }\n changedValueTypeKeys.push(key);\n transitionEnd[key] =\n transitionEnd[key] !== undefined\n ? transitionEnd[key]\n : target[key];\n setAndResetVelocity(value, to);\n }\n }\n });\n if (changedValueTypeKeys.length) {\n var scrollY_1 = changedValueTypeKeys.indexOf(\"height\") >= 0\n ? window.pageYOffset\n : null;\n var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);\n // If we removed transform values, reapply them before the next render\n if (removedTransformValues.length) {\n removedTransformValues.forEach(function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n visualElement.getValue(key).set(value);\n });\n }\n // Reapply original values\n visualElement.syncRender();\n // Restore scroll position\n if (scrollY_1 !== null)\n window.scrollTo({ top: scrollY_1 });\n return { target: convertedTarget, transitionEnd: transitionEnd };\n }\n else {\n return { target: target, transitionEnd: transitionEnd };\n }\n};\n/**\n * Convert value types for x/y/width/height/top/left/bottom/right\n *\n * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'`\n *\n * @internal\n */\nfunction unitConversion(visualElement, target, origin, transitionEnd) {\n return hasPositionalKey(target)\n ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd)\n : { target: target, transitionEnd: transitionEnd };\n}\n\nexport { BoundingBoxDimension, positionalValues, unitConversion };\n","import { useRef } from 'react';\nimport { isNodeOrChild } from './utils/is-node-or-child.mjs';\nimport { usePointerEvent, addPointerEvent } from '../events/use-pointer-event.mjs';\nimport { useUnmountEffect } from '../utils/use-unmount-effect.mjs';\nimport { pipe } from 'popmotion';\nimport { AnimationType } from '../render/utils/types.mjs';\nimport { isDragActive } from './drag/utils/lock.mjs';\n\n/**\n * @param handlers -\n * @internal\n */\nfunction useTapGesture(_a) {\n var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement;\n var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;\n var isPressing = useRef(false);\n var cancelPointerEndListeners = useRef(null);\n /**\n * Only set listener to passive if there are no external listeners.\n */\n var eventOptions = {\n passive: !(onTapStart || onTap || onTapCancel || onPointerDown),\n };\n function removePointerEndListener() {\n var _a;\n (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);\n cancelPointerEndListeners.current = null;\n }\n function checkPointerEnd() {\n var _a;\n removePointerEndListener();\n isPressing.current = false;\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false);\n return !isDragActive();\n }\n function onPointerUp(event, info) {\n if (!checkPointerEnd())\n return;\n /**\n * We only count this as a tap gesture if the event.target is the same\n * as, or a child of, this component's element\n */\n !isNodeOrChild(visualElement.getInstance(), event.target)\n ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info)\n : onTap === null || onTap === void 0 ? void 0 : onTap(event, info);\n }\n function onPointerCancel(event, info) {\n if (!checkPointerEnd())\n return;\n onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info);\n }\n function onPointerDown(event, info) {\n var _a;\n removePointerEndListener();\n if (isPressing.current)\n return;\n isPressing.current = true;\n cancelPointerEndListeners.current = pipe(addPointerEvent(window, \"pointerup\", onPointerUp, eventOptions), addPointerEvent(window, \"pointercancel\", onPointerCancel, eventOptions));\n /**\n * Ensure we trigger animations before firing event callback\n */\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true);\n onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);\n }\n usePointerEvent(visualElement, \"pointerdown\", hasPressListeners ? onPointerDown : undefined, eventOptions);\n useUnmountEffect(removePointerEndListener);\n}\n\nexport { useTapGesture };\n","import { AnimationType } from '../render/utils/types.mjs';\nimport { useDomEvent } from '../events/use-dom-event.mjs';\n\n/**\n *\n * @param props\n * @param ref\n * @internal\n */\nfunction useFocusGesture(_a) {\n var whileFocus = _a.whileFocus, visualElement = _a.visualElement;\n var onFocus = function () {\n var _a;\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true);\n };\n var onBlur = function () {\n var _a;\n (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false);\n };\n useDomEvent(visualElement, \"focus\", whileFocus ? onFocus : undefined);\n useDomEvent(visualElement, \"blur\", whileFocus ? onBlur : undefined);\n}\n\nexport { useFocusGesture };\n","import { __spreadArray, __read } from 'tslib';\nimport { SubscriptionManager } from '../../utils/subscription-manager.mjs';\n\nvar names = [\n \"LayoutMeasure\",\n \"BeforeLayoutMeasure\",\n \"LayoutUpdate\",\n \"ViewportBoxUpdate\",\n \"Update\",\n \"Render\",\n \"AnimationComplete\",\n \"LayoutAnimationComplete\",\n \"AnimationStart\",\n \"LayoutAnimationStart\",\n \"SetAxisTarget\",\n \"Unmount\",\n];\nfunction createLifecycles() {\n var managers = names.map(function () { return new SubscriptionManager(); });\n var propSubscriptions = {};\n var lifecycles = {\n clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); },\n updatePropListeners: function (props) {\n names.forEach(function (name) {\n var _a;\n var on = \"on\" + name;\n var propListener = props[on];\n // Unsubscribe existing subscription\n (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions);\n // Add new subscription\n if (propListener) {\n propSubscriptions[name] = lifecycles[on](propListener);\n }\n });\n },\n };\n managers.forEach(function (manager, i) {\n lifecycles[\"on\" + names[i]] = function (handler) { return manager.add(handler); };\n lifecycles[\"notify\" + names[i]] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return manager.notify.apply(manager, __spreadArray([], __read(args), false));\n };\n });\n return lifecycles;\n}\n\nexport { createLifecycles };\n","import { __assign, __spreadArray, __read } from 'tslib';\nimport sync, { cancelSync } from 'framesync';\nimport { motionValue } from '../value/index.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { variantPriorityOrder } from './utils/animation-state.mjs';\nimport { createLifecycles } from './utils/lifecycles.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { checkIfControllingVariants, checkIfVariantNode, isVariantLabel } from './utils/variants.mjs';\n\nvar visualElement = function (_a) {\n var _b = _a.treeType, treeType = _b === void 0 ? \"\" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps;\n return function (_a, options) {\n var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState, shouldReduceMotion = _a.shouldReduceMotion;\n if (options === void 0) { options = {}; }\n var isMounted = false;\n var latestValues = visualState.latestValues, renderState = visualState.renderState;\n /**\n * The instance of the render-specific node that will be hydrated by the\n * exposed React ref. So for example, this visual element can host a\n * HTMLElement, plain object, or Three.js object. The functions provided\n * in VisualElementConfig allow us to interface with this instance.\n */\n var instance;\n /**\n * Manages the subscriptions for a visual element's lifecycle, for instance\n * onRender\n */\n var lifecycles = createLifecycles();\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 var values = new Map();\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n var 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 var prevMotionValues = {};\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n var baseTarget = __assign({}, latestValues);\n // Internal methods ========================\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n var removeFromVariantTree;\n /**\n * Render the element with the latest styles outside of the React\n * render lifecycle\n */\n function render() {\n if (!instance || !isMounted)\n return;\n triggerBuild();\n renderInstance(instance, renderState, props.style, element.projection);\n }\n function triggerBuild() {\n build(element, renderState, latestValues, options, props);\n }\n function update() {\n lifecycles.notifyUpdate(latestValues);\n }\n /**\n *\n */\n function bindToMotionValue(key, value) {\n var removeOnChange = value.onChange(function (latestValue) {\n latestValues[key] = latestValue;\n props.onUpdate && sync.update(update, false, true);\n });\n var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender);\n valueSubscriptions.set(key, function () {\n removeOnChange();\n removeOnRenderRequest();\n });\n }\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 neccessarily a breaking change,\n * more a reflection of the test.\n */\n var initialMotionValues = scrapeMotionValuesFromProps(props);\n for (var key in initialMotionValues) {\n var value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key], false);\n }\n }\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n var isControllingVariants = checkIfControllingVariants(props);\n var isVariantNode = checkIfVariantNode(props);\n var element = __assign(__assign({ treeType: treeType, \n /**\n * This is a mirror of the internal instance prop, which keeps\n * VisualElement type-compatible with React's RefObject.\n */\n current: null, \n /**\n * The depth of this visual element within the visual element tree.\n */\n depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(), \n /**\n *\n */\n presenceId: presenceId, shouldReduceMotion: shouldReduceMotion, \n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren: isVariantNode ? new Set() : undefined, \n /**\n * Whether this instance is visible. This can be changed imperatively\n * by the projection tree, is analogous to CSS's visibility in that\n * hidden elements should take up layout, and needs enacting by the configured\n * render function.\n */\n isVisible: undefined, \n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()), \n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: blockInitialAnimation, \n /**\n * Determine whether this component has mounted yet. This is mostly used\n * by variant children to determine whether they need to trigger their\n * own animations on mount.\n */\n isMounted: function () { return Boolean(instance); }, mount: function (newInstance) {\n isMounted = true;\n instance = element.current = newInstance;\n if (element.projection) {\n element.projection.mount(newInstance);\n }\n if (isVariantNode && parent && !isControllingVariants) {\n removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element);\n }\n values.forEach(function (value, key) { return bindToMotionValue(key, value); });\n parent === null || parent === void 0 ? void 0 : parent.children.add(element);\n element.setProps(props);\n }, \n /**\n *\n */\n unmount: function () {\n var _a;\n (_a = element.projection) === null || _a === void 0 ? void 0 : _a.unmount();\n cancelSync.update(update);\n cancelSync.render(render);\n valueSubscriptions.forEach(function (remove) { return remove(); });\n removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree();\n parent === null || parent === void 0 ? void 0 : parent.children.delete(element);\n lifecycles.clearAllListeners();\n instance = undefined;\n isMounted = false;\n }, \n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild: function (child) {\n var _a;\n var closestVariantNode = element.getClosestVariantNode();\n if (closestVariantNode) {\n (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child);\n return function () {\n return closestVariantNode.variantChildren.delete(child);\n };\n }\n }, sortNodePosition: function (other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!sortNodePosition || treeType !== other.treeType)\n return 0;\n return sortNodePosition(element.getInstance(), other.getInstance());\n }, \n /**\n * Returns the closest variant node in the tree starting from\n * this visual element.\n */\n getClosestVariantNode: function () {\n return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode();\n }, \n /**\n * Expose the latest layoutId prop.\n */\n getLayoutId: function () { return props.layoutId; }, \n /**\n * Returns the current instance.\n */\n getInstance: function () { return instance; }, \n /**\n * Get/set the latest static values.\n */\n getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); }, \n /**\n * Returns the latest motion value state. Currently only used to take\n * a snapshot of the visual element - perhaps this can return the whole\n * visual state\n */\n getLatestValues: function () { return latestValues; }, \n /**\n * Set the visiblity of the visual element. If it's changed, schedule\n * a render to reflect these changes.\n */\n setVisibility: function (visibility) {\n if (element.isVisible === visibility)\n return;\n element.isVisible = visibility;\n element.scheduleRender();\n }, \n /**\n * Make a target animatable by Popmotion. For instance, if we're\n * trying to animate width from 100px to 100vw we need to measure 100vw\n * in pixels to determine what we really need to animate to. This is also\n * pluggable to support Framer's custom value types like Color,\n * and CSS variables.\n */\n makeTargetAnimatable: function (target, canMutate) {\n if (canMutate === void 0) { canMutate = true; }\n return makeTargetAnimatable(element, target, props, canMutate);\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: function () {\n return measureViewportBox(instance, props);\n }, \n // Motion values ========================\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue: function (key, value) {\n // Remove existing value if it exists\n if (element.hasValue(key))\n element.removeValue(key);\n values.set(key, value);\n latestValues[key] = value.get();\n bindToMotionValue(key, value);\n }, \n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue: function (key) {\n var _a;\n values.delete(key);\n (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a();\n valueSubscriptions.delete(key);\n delete latestValues[key];\n removeValueFromRenderState(key, renderState);\n }, \n /**\n * Check whether we have a motion value for this key\n */\n hasValue: function (key) { return values.has(key); }, \n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue: function (key, defaultValue) {\n var value = values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue);\n element.addValue(key, value);\n }\n return value;\n }, \n /**\n * Iterate over our motion values.\n */\n forEachValue: function (callback) { return values.forEach(callback); }, \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: function (key) {\n var _a;\n return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options);\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: function (key, value) {\n baseTarget[key] = value;\n }, \n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget: function (key) {\n if (getBaseTarget) {\n var target = getBaseTarget(props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n }\n return baseTarget[key];\n } }, lifecycles), { \n /**\n * Build the renderer state based on the latest visual state.\n */\n build: function () {\n triggerBuild();\n return renderState;\n }, \n /**\n * Schedule a render on the next animation frame.\n */\n scheduleRender: function () {\n sync.render(render, false, true);\n }, \n /**\n * Synchronously fire render. It's prefered that we batch renders but\n * in many circumstances, like layout measurement, we need to run this\n * synchronously. However in those instances other measures should be taken\n * to batch reads/writes.\n */\n syncRender: render, \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 setProps: function (newProps) {\n if (newProps.transformTemplate || props.transformTemplate) {\n element.scheduleRender();\n }\n props = newProps;\n lifecycles.updatePropListeners(newProps);\n prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues);\n }, getProps: function () { return props; }, \n // Variants ==============================\n /**\n * Returns the variant definition with a given name.\n */\n getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; }, \n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition: function () { return props.transition; }, getTransformPagePoint: function () {\n return props.transformPagePoint;\n }, \n /**\n * Used by child variant nodes to get the closest ancestor variant props.\n */\n getVariantContext: function (startAtParent) {\n if (startAtParent === void 0) { startAtParent = false; }\n if (startAtParent)\n return parent === null || parent === void 0 ? void 0 : parent.getVariantContext();\n if (!isControllingVariants) {\n var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {};\n if (props.initial !== undefined) {\n context_1.initial = props.initial;\n }\n return context_1;\n }\n var context = {};\n for (var i = 0; i < numVariantProps; i++) {\n var name_1 = variantProps[i];\n var prop = props[name_1];\n if (isVariantLabel(prop) || prop === false) {\n context[name_1] = prop;\n }\n }\n return context;\n } });\n return element;\n };\n};\nvar variantProps = __spreadArray([\"initial\"], __read(variantPriorityOrder), false);\nvar numVariantProps = variantProps.length;\n\nexport { visualElement };\n","import { warnOnce } from '../../utils/warn-once.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction updateMotionValuesFromProps(element, next, prev) {\n var _a;\n for (var key in next) {\n var nextValue = next[key];\n var 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 * Check the version of the incoming motion value with this version\n * and warn against mismatches.\n */\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(nextValue.version === \"6.5.1\", \"Attempting to mix Framer Motion versions \".concat(nextValue.version, \" with 6.5.1 may not work as expected.\"));\n }\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping to a new motion value, create a new motion value\n * from that\n */\n element.addValue(key, motionValue(nextValue));\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 var existingValue = element.getValue(key);\n // TODO: Only update values that aren't being animated or even looked at\n !existingValue.hasAnimated && existingValue.set(nextValue);\n }\n else {\n element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue));\n }\n }\n }\n // Handle removed values\n for (var key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n","import { resolveCSSVariables } from './css-variables-conversion.mjs';\nimport { unitConversion } from './unit-conversion.mjs';\n\n/**\n * Parse a DOM variant to make it animatable. This involves resolving CSS variables\n * and ensuring animations like \"20%\" => \"calc(50vw)\" are performed in pixels.\n */\nvar parseDomVariant = function (visualElement, target, origin, transitionEnd) {\n var resolved = resolveCSSVariables(visualElement, target, transitionEnd);\n target = resolved.target;\n transitionEnd = resolved.transitionEnd;\n return unitConversion(visualElement, target, origin, transitionEnd);\n};\n\nexport { parseDomVariant };\n","import { __rest, __assign } from 'tslib';\nimport { visualElement } from '../index.mjs';\nimport { getOrigin, checkTargetForNewValues } from '../utils/setters.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { isCSSVariable } from '../dom/utils/is-css-variable.mjs';\nimport { parseDomVariant } from '../dom/utils/parse-dom-variant.mjs';\nimport { isTransformProp } from './utils/transform.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nvar htmlConfig = {\n treeType: \"dom\",\n readValueFromInstance: function (domElement, key) {\n if (isTransformProp(key)) {\n var defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n else {\n var computedStyle = getComputedStyle(domElement);\n return ((isCSSVariable(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0);\n }\n },\n sortNodePosition: function (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 getBaseTarget: function (props, key) {\n var _a;\n return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key];\n },\n measureViewportBox: function (element, _a) {\n var transformPagePoint = _a.transformPagePoint;\n return measureViewportBox(element, transformPagePoint);\n },\n /**\n * Reset the transform on the current Element. This is called as part\n * of a batched process across the entire layout tree. To remove this write\n * cycle it'd be interesting to see if it's possible to \"undo\" all the current\n * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms\n * works\n */\n resetTransform: function (element, domElement, props) {\n var transformTemplate = props.transformTemplate;\n domElement.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n // Ensure that whatever happens next, we restore our transform on the next frame\n element.scheduleRender();\n },\n restoreTransform: function (instance, mutableState) {\n instance.style.transform = mutableState.style.transform;\n },\n removeValueFromRenderState: function (key, _a) {\n var vars = _a.vars, style = _a.style;\n delete vars[key];\n delete style[key];\n },\n /**\n * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color`\n * can be animated by Motion.\n */\n makeTargetAnimatable: function (element, _a, _b, isMounted) {\n var transformValues = _b.transformValues;\n if (isMounted === void 0) { isMounted = true; }\n var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, [\"transition\", \"transitionEnd\"]);\n var origin = getOrigin(target, transition || {}, element);\n /**\n * If Framer has provided a function to convert `Color` etc value types, convert them\n */\n if (transformValues) {\n if (transitionEnd)\n transitionEnd = transformValues(transitionEnd);\n if (target)\n target = transformValues(target);\n if (origin)\n origin = transformValues(origin);\n }\n if (isMounted) {\n checkTargetForNewValues(element, target, origin);\n var parsed = parseDomVariant(element, target, origin, transitionEnd);\n transitionEnd = parsed.transitionEnd;\n target = parsed.target;\n }\n return __assign({ transition: transition, transitionEnd: transitionEnd }, target);\n },\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n build: function (element, renderState, latestValues, options, props) {\n if (element.isVisible !== undefined) {\n renderState.style.visibility = element.isVisible\n ? \"visible\"\n : \"hidden\";\n }\n buildHTMLStyles(renderState, latestValues, options, props.transformTemplate);\n },\n render: renderHTML,\n};\nvar htmlVisualElement = visualElement(htmlConfig);\n\nexport { getComputedStyle, htmlConfig, htmlVisualElement };\n","import { __assign } from 'tslib';\nimport { visualElement } from '../index.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\nimport { htmlConfig } from '../html/visual-element.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isTransformProp } from '../html/utils/transform.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { getDefaultValueType } from '../dom/value-types/defaults.mjs';\n\nvar svgVisualElement = visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) {\n return props[key];\n }, readValueFromInstance: function (domElement, key) {\n var _a;\n if (isTransformProp(key)) {\n return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return domElement.getAttribute(key);\n }, scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, build: function (_element, renderState, latestValues, options, props) {\n buildSVGAttrs(renderState, latestValues, options, props.transformTemplate);\n }, render: renderSVG }));\n\nexport { svgVisualElement };\n","import { __assign } from 'tslib';\nimport { animations } from '../../motion/features/animations.mjs';\nimport { gestureAnimations } from '../../motion/features/gestures.mjs';\nimport { createDomVisualElement } from './create-visual-element.mjs';\n\n/**\n * @public\n */\nvar domAnimation = __assign(__assign({ renderer: createDomVisualElement }, animations), gestureAnimations);\n\nexport { domAnimation };\n","import { htmlVisualElement } from '../html/visual-element.mjs';\nimport { svgVisualElement } from '../svg/visual-element.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nvar createDomVisualElement = function (Component, options) {\n return isSVGComponent(Component)\n ? svgVisualElement(options, { enableHardwareAcceleration: false })\n : htmlVisualElement(options, { enableHardwareAcceleration: true });\n};\n\nexport { createDomVisualElement };\n","import { __rest, __assign, __read } from 'tslib';\nimport { invariant } from 'hey-listen';\n\nfunction isCSSVariable(value) {\n return typeof value === \"string\" && value.startsWith(\"var(--\");\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 */\nvar cssVariableRegex = /var\\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\\)/;\nfunction parseCSSVariable(current) {\n var match = cssVariableRegex.exec(current);\n if (!match)\n return [,];\n var _a = __read(match, 3), token = _a[1], fallback = _a[2];\n return [token, fallback];\n}\nvar maxDepth = 4;\nfunction getVariableValue(current, element, depth) {\n if (depth === void 0) { depth = 1; }\n invariant(depth <= maxDepth, \"Max CSS variable fallback depth detected in property \\\"\".concat(current, \"\\\". This may indicate a circular fallback dependency.\"));\n var _a = __read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1];\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n var resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n return resolved.trim();\n }\n else if (isCSSVariable(fallback)) {\n // The fallback might itself be a CSS variable, in which case we attempt to resolve it too.\n return getVariableValue(fallback, element, depth + 1);\n }\n else {\n return fallback;\n }\n}\n/**\n * Resolve CSS variables from\n *\n * @internal\n */\nfunction resolveCSSVariables(visualElement, _a, transitionEnd) {\n var _b;\n var target = __rest(_a, []);\n var element = visualElement.getInstance();\n if (!(element instanceof Element))\n return { target: target, transitionEnd: transitionEnd };\n // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`\n // only if they change but I think this reads clearer and this isn't a performance-critical path.\n if (transitionEnd) {\n transitionEnd = __assign({}, transitionEnd);\n }\n // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved\n visualElement.forEachValue(function (value) {\n var current = value.get();\n if (!isCSSVariable(current))\n return;\n var resolved = getVariableValue(current, element);\n if (resolved)\n value.set(resolved);\n });\n // Cycle through every target property and resolve CSS variables. Currently\n // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)`\n for (var key in target) {\n var current = target[key];\n if (!isCSSVariable(current))\n continue;\n var resolved = getVariableValue(current, element);\n if (!resolved)\n continue;\n // Clone target if it hasn't already been\n target[key] = resolved;\n // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved\n // CSS variable. This will ensure that after the animation the component will reflect\n // changes in the value of the CSS variable.\n if (transitionEnd)\n (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current);\n }\n return { target: target, transitionEnd: transitionEnd };\n}\n\nexport { cssVariableRegex, parseCSSVariable, resolveCSSVariables };\n","import { number, px, percent, degrees, vw, vh } from 'style-value-types';\nimport { testValueType } from './test.mjs';\nimport { auto } from './type-auto.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nvar dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nvar findDimensionValueType = function (v) {\n return dimensionValueTypes.find(testValueType(v));\n};\n\nexport { dimensionValueTypes, findDimensionValueType };\n","/**\n * ValueType for \"auto\"\n */\nvar auto = {\n test: function (v) { return v === \"auto\"; },\n parse: function (v) { return v; },\n};\n\nexport { auto };\n","/**\n * Tests a provided value against a ValueType\n */\nvar testValueType = function (v) { return function (type) { return type.test(v); }; };\n\nexport { testValueType };\n","import { __read, __rest, __assign } from 'tslib';\nimport { startAnimation } from '../../animation/utils/transitions.mjs';\nimport { setTarget } from './setters.mjs';\nimport { resolveVariant } from './variants.mjs';\nimport { isTransformProp } from '../html/utils/transform.mjs';\n\nfunction animateVisualElement(visualElement, definition, options) {\n if (options === void 0) { options = {}; }\n visualElement.notifyAnimationStart(definition);\n var animation;\n if (Array.isArray(definition)) {\n var animations = definition.map(function (variant) {\n return animateVariant(visualElement, variant, options);\n });\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n var resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = animateTarget(visualElement, resolvedDefinition, options);\n }\n return animation.then(function () {\n return visualElement.notifyAnimationComplete(definition);\n });\n}\nfunction animateVariant(visualElement, variant, options) {\n var _a;\n if (options === void 0) { options = {}; }\n var resolved = resolveVariant(visualElement, variant, options.custom);\n var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b;\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n var getAnimation = resolved\n ? function () { return animateTarget(visualElement, resolved, options); }\n : function () { return Promise.resolve(); };\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size)\n ? function (forwardDelay) {\n if (forwardDelay === void 0) { forwardDelay = 0; }\n var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : function () { return Promise.resolve(); };\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n var when = transition.when;\n if (when) {\n var _c = __read(when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1];\n return first().then(last);\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\n/**\n * @internal\n */\nfunction animateTarget(visualElement, definition, _a) {\n var _b;\n var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type;\n var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, [\"transition\", \"transitionEnd\"]);\n if (transitionOverride)\n transition = transitionOverride;\n var animations = [];\n var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]);\n for (var key in target) {\n var value = visualElement.getValue(key);\n var valueTarget = target[key];\n if (!value ||\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n var valueTransition = __assign({ delay: delay }, transition);\n /**\n * Make animation instant if this is a transform prop and we should reduce motion.\n */\n if (visualElement.shouldReduceMotion && isTransformProp(key)) {\n valueTransition = __assign(__assign({}, valueTransition), { type: false, delay: 0 });\n }\n var animation = startAnimation(key, value, valueTarget, valueTransition);\n animations.push(animation);\n }\n return Promise.all(animations).then(function () {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n}\nfunction animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) {\n if (delayChildren === void 0) { delayChildren = 0; }\n if (staggerChildren === void 0) { staggerChildren = 0; }\n if (staggerDirection === void 0) { staggerDirection = 1; }\n var animations = [];\n var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n var generateStaggerDuration = staggerDirection === 1\n ? function (i) {\n if (i === void 0) { i = 0; }\n return i * staggerChildren;\n }\n : function (i) {\n if (i === void 0) { i = 0; }\n return maxStaggerDuration - i * staggerChildren;\n };\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach(function (child, i) {\n animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));\n });\n return Promise.all(animations);\n}\nfunction stopAnimation(visualElement) {\n visualElement.forEachValue(function (value) { return value.stop(); });\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\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(_a, key) {\n var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating;\n var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\n\nexport { animateVisualElement, sortByTreeOrder, stopAnimation };\n","import { __spreadArray, __read } from 'tslib';\nimport { color, complex } from 'style-value-types';\nimport { dimensionValueTypes } from './dimensions.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nvar valueTypes = __spreadArray(__spreadArray([], __read(dimensionValueTypes), false), [color, complex], false);\n/**\n * Tests a value against the list of ValueTypes\n */\nvar findValueType = function (v) { return valueTypes.find(testValueType(v)); };\n\nexport { findValueType };\n","import { __rest, __assign, __spreadArray, __read } from 'tslib';\nimport { complex } from 'style-value-types';\nimport { isNumericalString } from '../../utils/is-numerical-string.mjs';\nimport { isZeroValueString } from '../../utils/is-zero-value-string.mjs';\nimport { resolveFinalValueInKeyframes } from '../../utils/resolve-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { getAnimatableNone } from '../dom/value-types/animatable-none.mjs';\nimport { findValueType } from '../dom/value-types/find.mjs';\nimport { resolveVariant } from './variants.mjs';\n\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 setTarget(visualElement, definition) {\n var resolved = resolveVariant(visualElement, definition);\n var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, [\"transitionEnd\", \"transition\"]);\n target = __assign(__assign({}, target), transitionEnd);\n for (var key in target) {\n var value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\nfunction setVariants(visualElement, variantLabels) {\n var reversedLabels = __spreadArray([], __read(variantLabels), false).reverse();\n reversedLabels.forEach(function (key) {\n var _a;\n var variant = visualElement.getVariant(key);\n variant && setTarget(visualElement, variant);\n (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n setVariants(child, variantLabels);\n });\n });\n}\nfunction setValues(visualElement, definition) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition);\n }\n else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition]);\n }\n else {\n setTarget(visualElement, definition);\n }\n}\nfunction checkTargetForNewValues(visualElement, target, origin) {\n var _a, _b, _c;\n var _d;\n var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); });\n var numNewValues = newValueKeys.length;\n if (!numNewValues)\n return;\n for (var i = 0; i < numNewValues; i++) {\n var key = newValueKeys[i];\n var targetValue = target[key];\n var value = null;\n /**\n * If the target is a series of keyframes, we can use the first value\n * in the array. If this first value is null, we'll still need to read from the DOM.\n */\n if (Array.isArray(targetValue)) {\n value = targetValue[0];\n }\n /**\n * If the target isn't keyframes, or the first keyframe was null, we need to\n * first check if an origin value was explicitly defined in the transition as \"from\",\n * if not read the value from the DOM. As an absolute fallback, take the defined target value.\n */\n if (value === null) {\n value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];\n }\n /**\n * If value is still undefined or null, ignore it. Preferably this would throw,\n * but this was causing issues in Framer.\n */\n if (value === undefined || value === null)\n continue;\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(targetValue)) {\n value = getAnimatableNone(key, targetValue);\n }\n visualElement.addValue(key, motionValue(value));\n (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value);\n visualElement.setBaseTarget(key, value);\n }\n}\nfunction getOriginFromTransition(key, transition) {\n if (!transition)\n return;\n var valueTransition = transition[key] || transition[\"default\"] || transition;\n return valueTransition.from;\n}\nfunction getOrigin(target, transition, visualElement) {\n var _a, _b;\n var origin = {};\n for (var key in target) {\n origin[key] =\n (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get();\n }\n return origin;\n}\n\nexport { checkTargetForNewValues, getOrigin, getOriginFromTransition, setTarget, setValues };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nvar isNumericalString = function (v) { return /^\\-?\\d*\\.?\\d+$/.test(v); };\n\nexport { isNumericalString };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nvar isZeroValueString = function (v) { return /^0[^.\\s]+$/.test(v); };\n\nexport { isZeroValueString };\n","var AnimationType;\n(function (AnimationType) {\n AnimationType[\"Animate\"] = \"animate\";\n AnimationType[\"Hover\"] = \"whileHover\";\n AnimationType[\"Tap\"] = \"whileTap\";\n AnimationType[\"Drag\"] = \"whileDrag\";\n AnimationType[\"Focus\"] = \"whileFocus\";\n AnimationType[\"InView\"] = \"whileInView\";\n AnimationType[\"Exit\"] = \"exit\";\n})(AnimationType || (AnimationType = {}));\n\nexport { AnimationType };\n","import { useConstant } from './use-constant.mjs';\n\nvar counter = 0;\nvar incrementId = function () { return counter++; };\nvar useId = function () { return useConstant(incrementId); };\n/**\n * Ideally we'd use the following code to support React 18 optionally.\n * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all).\n * Need to come up with a different way of figuring this out.\n */\n// export const useId = (React as any).useId\n// ? (React as any).useId\n// : () => useConstant(incrementId)\n\nexport { useId };\n","import { useEffect } from 'react';\n\nfunction useUnmountEffect(callback) {\n return useEffect(function () { return function () { return callback(); }; }, []);\n}\n\nexport { useUnmountEffect };\n"],"names":["usePresence","context","useContext","isPresent","onExitComplete","register","id","useEffect","LazyMotion","_a","children","features","_b","strict","setIsLoaded","useState","isLazyBundle","loadedRenderer","useRef","undefined","renderer","loadedFeatures","current","then","value","defaultPagePoint","pageX","pageY","pointFromTouch","e","pointType","point","touches","changedTouches","x","y","pointFromMouse","extractEventInfo","event","wrapHandler","handler","shouldFilterPrimaryPointer","eventHandler","listener","isMouseEvent","MouseEvent","button","addDomEvent","target","eventName","options","passive","addEventListener","removeEventListener","useDomEvent","ref","element","mouseEventNames","pointerdown","pointermove","pointerup","pointercancel","pointerover","pointerout","pointerenter","pointerleave","touchEventNames","getPointerEventName","name","window","onpointerdown","ontouchstart","onmousedown","addPointerEvent","usePointerEvent","createLock","lock","globalHorizontalLock","globalVerticalLock","getGlobalLock","drag","openHorizontal_1","openVertical_1","isDragActive","openGestureLock","PointerEvent","pointerType","isTouchEvent","makeRenderlessComponent","hook","props","convertBoundingBoxToBox","top","min","left","max","right","bottom","convertBoxToBoundingBox","transformBoxPoints","transformPoint","topLeft","bottomRight","scalePoint","scale","originPoint","applyPointDelta","translate","boxScale","applyAxisDelta","axis","applyBoxDelta","box","applyTreeDeltas","treeScale","treePath","isSharedTransition","treeLength","length","node","delta","i","projectionDelta","instance","style","display","layoutScroll","scroll","root","transformBox","latestValues","translateAxis","distance","transformAxis","transforms","key","scaleKey","originKey","axisOrigin","xKeys","yKeys","transform","isIdentityScale","hasScale","scaleX","scaleY","hasTransform","values","hasTranslate","z","rotate","rotateX","rotateY","measureViewportBox","getBoundingClientRect","measurePageBox","rootProjectionNode","transformPagePoint","viewportBox","shallowCompare","next","prev","Array","isArray","prevLength","variantPriorityOrder","reversePriorityOrder","reverse","numAnimationTypes","createTypeState","isActive","protectedKeys","needsAnimating","prevResolvedValues","animations","animation","visualElement","animate","animationState","Promise","all","map","animateList","state","allAnimatedKeys","isInitialRender","buildResolvedTypeValues","acc","definition","resolved","transition","transitionEnd","animateChanges","changedActiveType","getProps","getVariantContext","removedKeys","Set","encounteredKeys","removedVariantIndex","Infinity","_loop_1","type","typeState","prop","propIsVariant","activeDelta","isInherited","manuallyAnimateOnMount","prevProp","variantDidChange","checkVariantsDidChange","shouldAnimateType","definitionList","resolvedValues","reduce","allKeys","markToAnimate","delete","hasOwnProperty","add","has","blockInitialAnimation","push","apply","size","fallbackAnimation_1","forEach","fallbackTarget","getBaseTarget","shouldAnimate","Boolean","initial","resolve","isAnimated","setActive","variantChildren","child","setAnimateFunction","makeAnimator","getState","createAnimationState","subscribe","exit","custom","safeToRemove","presenceContext","PresenceContext","createHoverEvent","callback","info","isNodeOrChild","parent","parentElement","warned","observerCallbacks","WeakMap","observers","fireObserverCallback","entry","get","fireAllObserverCallbacks","entries","thresholdNames","some","useIntersectionObserver","shouldObserve","rootMargin","margin","amount","once","threshold","rootInteresectionObserver","lookupRoot","document","set","rootObservers","JSON","stringify","IntersectionObserver","initIntersectionObserver","observe","unobserve","observeIntersection","getInstance","isIntersecting","isInView","hasEnteredView","onViewportEnter","onViewportLeave","useMissingIntersectionObserver","fallback","message","console","warn","requestAnimationFrame","BoundingBoxDimension","gestureAnimations","inView","whileInView","viewport","tap","onTap","onTapStart","onTapCancel","whileTap","hasPressListeners","isPressing","cancelPointerEndListeners","eventOptions","onPointerDown","removePointerEndListener","call","checkPointerEnd","onPointerUp","onPointerCancel","pipe","a","focus","whileFocus","hover","onHoverStart","onHoverEnd","whileHover","names","treeType","build","makeTargetAnimatable","renderInstance","render","readValueFromInstance","removeValueFromRenderState","sortNodePosition","scrapeMotionValuesFromProps","presenceId","visualState","shouldReduceMotion","removeFromVariantTree","isMounted","renderState","lifecycles","managers","propSubscriptions","clearAllListeners","manager","clear","updatePropListeners","on","propListener","args","_i","arguments","notify","createLifecycles","Map","valueSubscriptions","prevMotionValues","baseTarget","triggerBuild","projection","update","notifyUpdate","bindToMotionValue","removeOnChange","onChange","latestValue","onUpdate","removeOnRenderRequest","onRenderRequest","scheduleRender","initialMotionValues","isControllingVariants","isVariantNode","depth","isVisible","mount","newInstance","addVariantChild","setProps","unmount","remove","closestVariantNode","getClosestVariantNode","other","getLayoutId","layoutId","getStaticValue","setStaticValue","getLatestValues","setVisibility","visibility","canMutate","addValue","hasValue","removeValue","getValue","defaultValue","forEachValue","readValue","setBaseTarget","syncRender","newProps","transformTemplate","nextValue","prevValue","existingValue","hasAnimated","updateMotionValuesFromProps","getVariant","variants","getDefaultTransition","getTransformPagePoint","startAtParent","context_1","numVariantProps","name_1","variantProps","positionalKeys","isPositionalKey","setAndResetVelocity","to","isNumOrPxType","v","px","getPosFromMatrix","matrix","pos","parseFloat","split","getTranslateFromMatrix","pos2","pos3","_bbox","matrix3d","match","transformKeys","nonTranslationalTransformKeys","positionalValues","width","_c","paddingLeft","_d","paddingRight","height","paddingTop","paddingBottom","unitConversion","origin","Object","keys","hasPositionalKey","targetPositionalKeys","filter","removedTransformValues","hasAttemptedToRemoveTransformValues","changedValueTypeKeys","toType","from","fromType","numKeyframes","fromIndex","removedTransforms","startsWith","removeNonTranslationalTransform","scrollY_1","indexOf","pageYOffset","convertedTarget","changedKeys","originBbox","elementComputedStyle","getComputedStyle","targetBbox","convertChangedValueTypes","scrollTo","checkAndConvertChangedValueTypes","htmlConfig","domElement","defaultType","default","computedStyle","getPropertyValue","b","compareDocumentPosition","measure","resetTransform","restoreTransform","mutableState","vars","transformValues","parsed","parseDomVariant","htmlVisualElement","svgVisualElement","getAttribute","_element","domAnimation","Component","enableHardwareAcceleration","isCSSVariable","cssVariableRegex","getVariableValue","concat","exec","parseCSSVariable","token","trim","resolveCSSVariables","Element","dimensionValueTypes","vw","vh","test","parse","findDimensionValueType","find","testValueType","animateVisualElement","notifyAnimationStart","variant","animateVariant","resolvedDefinition","animateTarget","notifyAnimationComplete","transitionOverride","getAnimation","getChildAnimations","forwardDelay","delayChildren","staggerChildren","staggerDirection","maxStaggerDuration","generateStaggerDuration","sort","sortByTreeOrder","delay","animateChildren","when","first","last","_e","_f","animationTypeState","valueTarget","shouldBlockAnimation","valueTransition","stopAnimation","stop","shouldBlock","valueTypes","color","complex","findValueType","setMotionValue","setTarget","setVariants","variantLabels","setValues","checkTargetForNewValues","newValueKeys","numNewValues","targetValue","getOriginFromTransition","getOrigin","AnimationType","counter","incrementId","useId","useUnmountEffect"],"sourceRoot":""}