{"version":3,"file":"create-projection-node.mjs","sources":["../../../../src/projection/node/create-projection-node.ts"],"sourcesContent":["import {\n    Axis,\n    AxisDelta,\n    Box,\n    clamp,\n    Delta,\n    Point,\n    SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { spring } from \"../../animation/generators/spring\"\nimport { calcGeneratorDuration } from \"../../animation/generators/utils/calc-duration\"\nimport { notifyLayoutAnimationStart } from \"../../animation/utils/notify-inspector\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport {\n    AnimationPlaybackControls,\n    MotionPath,\n    PathInterpolator,\n    Transition,\n    ValueAnimationOptions,\n} from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport {\n    pointToProgressVelocity,\n    resolveAutoMass,\n} from \"../animation/layout-velocity\"\nimport { transformGroups } from \"../../animation/waapi/transforms/groups\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n    applyBoxDelta,\n    applyTreeDeltas,\n    transformBox,\n    translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n    calcBoxDelta,\n    calcLength,\n    calcRelativeBox,\n    calcRelativePosition,\n    isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { roundBox } from \"../geometry/round\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n    aspectRatio,\n    axisDeltaEquals,\n    boxEquals,\n    boxEqualsRounded,\n    isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { defaultScaleCorrectors } from \"../styles/default-scale-correctors\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport {\n    angleTransforms,\n    has2DTranslate,\n    hasDistortingTransform,\n    hasScale,\n    hasTransform,\n} from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n    InitialPromotionConfig,\n    IProjectionNode,\n    LayoutEvents,\n    LayoutUpdateData,\n    Measurements,\n    Phase,\n    ProjectionNodeConfig,\n    ProjectionNodeOptions,\n    ScrollMeasurements,\n} from \"./types\"\n\n/**\n * Transforms that distort an element's layout, so must be reset before measuring.\n */\nconst distortingTransforms = [\"z\", \"skew\", \"skewZ\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n    key: string,\n    visualElement: VisualElement,\n    values: ResolvedValues,\n    sharedAnimationValues?: ResolvedValues\n) {\n    const { latestValues } = visualElement\n\n    // Record the distorting transform and then temporarily set it to 0\n    if (latestValues[key]) {\n        values[key] = latestValues[key]\n        visualElement.setStaticValue(key, 0)\n        if (sharedAnimationValues) {\n            sharedAnimationValues[key] = 0\n        }\n    }\n}\n\n/**\n * Move accelerated transforms back to the main thread. The WAAPI animation\n * hid startUpdate()'s reset of rotations, skews and z, and moving off it\n * writes the whole transform back, so reset them again before this node\n * is measured.\n */\nconst demoteTransforms = (node: IProjectionNode) =>\n    node.instance &&\n    transformGroups.get(node.instance)?.demote() &&\n    node.resetSkewAndRotation()\n\nfunction cancelTreeOptimisedTransformAnimations(\n    projectionNode: IProjectionNode\n) {\n    projectionNode.hasCheckedOptimisedAppear = true\n    if (projectionNode.root === projectionNode) return\n\n    const { visualElement } = projectionNode.options\n\n    if (!visualElement) return\n\n    const appearId = getOptimisedAppearId(visualElement)\n\n    if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n        const { layout, layoutId } = projectionNode.options\n        window.MotionCancelOptimisedAnimation!(\n            appearId,\n            \"transform\",\n            frame,\n            !(layout || layoutId)\n        )\n    }\n\n    const { parent } = projectionNode\n    if (parent && !parent.hasCheckedOptimisedAppear) {\n        cancelTreeOptimisedTransformAnimations(parent)\n    }\n}\n\nfunction getClosestProjectingNode(\n    visualElement?: VisualElement<\n        unknown,\n        unknown,\n        { allowProjection?: boolean }\n    >\n): IProjectionNode | undefined {\n    if (!visualElement) return undefined\n\n    return visualElement.options.allowProjection !== false\n        ? visualElement.projection\n        : getClosestProjectingNode(visualElement.parent)\n}\n\nexport function createProjectionNode<I>({\n    attachResizeListener,\n    defaultParent,\n    measureScroll,\n    checkIsScrollRoot,\n    resetTransform,\n}: ProjectionNodeConfig<I>) {\n    /**\n     * Correctors registered via addScaleCorrector before projection loaded\n     * (e.g. with an async LazyMotion bundle) take precedence over the defaults.\n     * Applied here rather than at module scope so bundlers can drop projection\n     * when it's unused.\n     */\n    Object.assign(scaleCorrectors, {\n        ...defaultScaleCorrectors,\n        ...scaleCorrectors,\n    })\n\n    return class ProjectionNode implements IProjectionNode<I> {\n        /**\n         * Create the projection node of a `motion` component's VisualElement,\n         * from its props. This runs while the component renders, before its\n         * children. It's here rather than in the component so React\n         * bundles only include it with the features that supply a\n         * ProjectionNode. Vanilla bundles that use the projection node\n         * (drag(), animateLayout()) include it too, as a class static\n         * can't be tree-shaken.\n         */\n        static create(\n            visualElement: VisualElement<any>,\n            props: MotionNodeOptions,\n            initialPromotionConfig?: InitialPromotionConfig\n        ) {\n            const {\n                layoutId,\n                layout,\n                drag,\n                dragConstraints,\n                layoutScroll,\n                layoutRoot,\n                layoutAnchor,\n                layoutCrossfade,\n            } = props\n\n            const projection = (visualElement.projection = new this(\n                visualElement.latestValues,\n                props[\"data-framer-portal-id\"]\n                    ? undefined\n                    : getClosestProjectingNode(visualElement.parent)\n            ) as IProjectionNode)\n\n            projection.setOptions({\n                layoutId,\n                layout,\n                alwaysMeasureLayout:\n                    Boolean(drag) ||\n                    (dragConstraints && isRefObject(dragConstraints)),\n                visualElement,\n                /**\n                 * TODO: Update options in an effect. This could be tricky as it'll be too late\n                 * to update by the time layout animations run.\n                 * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n                 * ensuring it gets called if there's no potential layout animations.\n                 *\n                 */\n                animationType: typeof layout === \"string\" ? layout : \"both\",\n                initialPromotionConfig,\n                crossfade: layoutCrossfade,\n                layoutScroll,\n                layoutRoot,\n                layoutAnchor,\n            })\n\n            /**\n             * This node will take over from its layoutId's current lead, so snapshot\n             * the lead now, while rendering. By the time the lead unmounts (or this\n             * node mounts) React may already have committed DOM changes that come\n             * before it in the tree, like a sibling changing height, and a snapshot\n             * taken then starts the animation from a position never seen on screen.\n             *\n             * If React discards this render (e.g. it suspends), nothing else\n             * completes the update, so check it after the next frame as an\n             * unmounting node does.\n             */\n            const lead = projection.getStack()?.lead\n            if (lead && !projection.root!.isUpdateBlocked()) {\n                lead.willUpdate()\n                lead.scheduleCheckAfterUnmount()\n            }\n        }\n\n        /**\n         * A unique ID generated for every projection node.\n         */\n        id: number = id++\n\n        /**\n         * An id that represents a unique session instigated by startUpdate.\n         */\n        animationId: number = 0\n\n        animationCommitId = 0\n\n        /**\n         * A reference to the platform-native node (currently this will be a HTMLElement).\n         */\n        instance: I | undefined\n\n        /**\n         * A reference to the root projection node. There'll only ever be one tree and one root.\n         */\n        root: IProjectionNode\n\n        /**\n         * A reference to this node's parent.\n         */\n        parent?: IProjectionNode\n\n        /**\n         * A path from this node to the root node. This provides a fast way to iterate\n         * back up the tree.\n         */\n        path: IProjectionNode[]\n\n        /**\n         * A Set containing all this component's children. This is used to iterate\n         * through the children.\n         *\n         * TODO: This could be faster to iterate as a flat array stored on the root node.\n         */\n        children = new Set<IProjectionNode>()\n\n        /**\n         * Options for the node. We use this to configure what kind of layout animations\n         * we should perform (if any).\n         */\n        options: ProjectionNodeOptions = {}\n\n        /**\n         * A snapshot of the element's state just before the current update. This is\n         * hydrated when this node's `willUpdate` method is called and scrubbed at the\n         * end of the tree's `didUpdate` method.\n         */\n        snapshot: Measurements | undefined\n\n        /**\n         * A box defining the element's layout relative to the page. This will have been\n         * captured with all parent scrolls and projection transforms unset.\n         */\n        layout: Measurements | undefined\n\n        /**\n         * A measurement taken just before the current update of a dragged node\n         * without a snapshot (one without `layout`).\n         */\n        dragSnapshot: Measurements | undefined\n\n        /**\n         * The nearest dragged ancestor, recorded in willUpdate.\n         */\n        dragAncestor: IProjectionNode | undefined\n\n        /**\n         * The layout used to calculate the previous layout animation. We use this to compare\n         * layouts between renders and decide whether we need to trigger a new layout animation\n         * or just let the current one play out.\n         */\n        targetLayout?: Box\n\n        /**\n         * A mutable data structure we use to apply all parent transforms currently\n         * acting on the element's layout. It's from here we can calculate the projectionDelta\n         * required to get the element from its layout into its calculated target box.\n         */\n        layoutCorrected: Box\n\n        /**\n         * An ideal projection transform we want to apply to the element. This is calculated,\n         * usually when an element's layout has changed, and we want the element to look as though\n         * its in its previous layout on the next frame. From there, we animated it down to 0\n         * to animate the element to its new layout.\n         */\n        targetDelta?: Delta\n\n        /**\n         * A mutable structure representing the visual bounding box on the page where we want\n         * and element to appear. This can be set directly but is currently derived once a frame\n         * from apply targetDelta to layout.\n         */\n        target?: Box\n\n        /**\n         * A mutable structure describing a visual bounding box relative to the element's\n         * projected parent. If defined, target will be derived from this rather than targetDelta.\n         * If not defined, we'll attempt to calculate on the first layout animation frame\n         * based on the targets calculated from targetDelta. This will transfer a layout animation\n         * from viewport-relative to parent-relative.\n         */\n        relativeTarget?: Box\n\n        relativeTargetOrigin?: Box\n        relativeParent?: IProjectionNode\n\n        /**\n         * We use this to detect when its safe to shut down part of a projection tree.\n         * We have to keep projecting children for scale correction and relative projection\n         * until all their parents stop performing layout animations.\n         */\n        isTreeAnimating = false\n\n        isAnimationBlocked = false\n\n        /**\n         * If true, attempt to resolve relativeTarget.\n         */\n        attemptToResolveRelativeTarget?: boolean\n\n        /**\n         * A mutable structure that represents the target as transformed by the element's\n         * latest user-set transforms (ie scale, x)\n         */\n        targetWithTransforms?: Box\n\n        /**\n         * The previous projection delta, which we can compare with the newly calculated\n         * projection delta to see if we need to render.\n         */\n        prevProjectionDelta?: Delta\n\n        /**\n         * A calculated transform that will project an element from its layoutCorrected\n         * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n         */\n        projectionDelta?: Delta\n\n        /**\n         * A calculated transform that will project an element from its layoutCorrected\n         * into the targetWithTransforms.\n         */\n        projectionDeltaWithTransform?: Delta\n\n        /**\n         * If we're tracking the scroll of this element, we store it here.\n         */\n        scroll?: ScrollMeasurements\n\n        /**\n         * Flag to true if we think this layout has been changed. We can't always know this,\n         * currently we set it to true every time a component renders, or if it has a layoutDependency\n         * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n         * and if one node is dirtied, they all are.\n         */\n        isLayoutDirty = false\n\n        /**\n         * Flag to true if we think the projection calculations for this node needs\n         * recalculating as a result of an updated transform or layout animation.\n         */\n        isProjectionDirty = false\n\n        /**\n         * Flag to true if the layout *or* transform has changed. This then gets propagated\n         * throughout the projection tree, forcing any element below to recalculate on the next frame.\n         */\n        isSharedProjectionDirty = false\n\n        /**\n         * Flag transform dirty. This gets propagated throughout the whole tree but is only\n         * respected by shared nodes.\n         */\n        isTransformDirty = false\n\n        /**\n         * Block layout updates for instant layout transitions throughout the tree.\n         */\n        updateManuallyBlocked = false\n\n        updateBlockedByResize = false\n\n        /**\n         * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n         * call.\n         */\n        isUpdating = false\n\n        /**\n         * If this is an SVG element we currently disable projection transforms\n         */\n        isSVG = false\n\n        /**\n         * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n         * its projection styles.\n         */\n        needsReset = false\n\n        /**\n         * Set when this node gives up its layoutId, so styles it was given\n         * while following another node are cleared on its next render.\n         */\n        needsShow?: boolean\n\n        /**\n         * Flags whether this node should have its transform reset prior to measuring.\n         */\n        shouldResetTransform = false\n\n        /**\n         * Store whether this node has been checked for optimised appear animations. As\n         * effects fire bottom-up, and we want to look up the tree for appear animations,\n         * this makes sure we only check each path once, stopping at nodes that\n         * have already been checked.\n         */\n        hasCheckedOptimisedAppear = false\n\n        /**\n         * An object representing the calculated contextual/accumulated/tree scale.\n         * This will be used to scale calculated projection transforms, as these are\n         * calculated in screen-space but need to be scaled for elements to visually\n         * make it to their calculated destinations.\n         *\n         * TODO: Lazy-init\n         */\n        treeScale: Point = { x: 1, y: 1 }\n\n        /**\n         * Is hydrated with a projection node if an element is animating from another.\n         */\n        resumeFrom?: IProjectionNode\n\n        /**\n         * Is hydrated with a projection node if an element is animating from another.\n         */\n        resumingFrom?: IProjectionNode\n\n        /**\n         * A reference to the element's latest animated values. This is a reference shared\n         * between the element's VisualElement and the ProjectionNode.\n         */\n        latestValues: ResolvedValues\n\n        /**\n         *\n         */\n        eventHandlers = new Map<LayoutEvents, SubscriptionManager<any>>()\n\n        nodes?: FlatTree\n\n        depth: number\n\n        /**\n         * If transformTemplate generates a different value before/after the\n         * update, we need to reset the transform.\n         */\n        prevTransformTemplateValue: string | undefined\n\n        preserveOpacity?: boolean\n\n        hasTreeAnimated = false\n\n        /**\n         * Whether the layout animation \"didUpdate\" handler has been registered.\n         */\n        hasLayoutListener?: boolean\n\n        constructor(\n            latestValues: ResolvedValues = {},\n            parent: IProjectionNode | undefined = defaultParent?.()\n        ) {\n            this.latestValues = latestValues\n            this.root = parent ? parent.root || parent : this\n            this.path = parent ? [...parent.path, parent] : []\n            this.parent = parent\n\n            this.depth = parent ? parent.depth + 1 : 0\n\n            for (let i = 0; i < this.path.length; i++) {\n                this.path[i].shouldResetTransform = true\n            }\n\n            if (this.root === this) this.nodes = new FlatTree()\n        }\n\n        addEventListener(name: LayoutEvents, handler: any) {\n            if (!this.eventHandlers.has(name)) {\n                this.eventHandlers.set(name, new SubscriptionManager())\n            }\n\n            return this.eventHandlers.get(name)!.add(handler)\n        }\n\n        notifyListeners(name: LayoutEvents, ...args: any) {\n            this.eventHandlers.get(name)?.notify(...args)\n        }\n\n        hasListeners(name: LayoutEvents) {\n            return this.eventHandlers.has(name)\n        }\n\n        /**\n         * Lifecycles\n         */\n        mount(instance: I) {\n            if (this.instance) return\n\n            this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n            this.instance = instance\n\n            const { layoutId, layout, visualElement } = this.options\n            if (visualElement && !visualElement.current) {\n                visualElement.mount(instance)\n            }\n\n            this.root.nodes!.add(this)\n            this.parent?.children.add(this)\n\n            if (this.root.hasTreeAnimated && (layout || layoutId)) {\n                this.isLayoutDirty = true\n            }\n\n            if (attachResizeListener) {\n                let cancelDelay: VoidFunction\n                let innerWidth = 0\n\n                const resizeUnblockUpdate = () =>\n                    (this.root.updateBlockedByResize = false)\n\n                // Set initial innerWidth in a frame.read callback to batch the read\n                frame.read(() => {\n                    innerWidth = window.innerWidth\n                })\n\n                attachResizeListener(instance, () => {\n                    const newInnerWidth = window.innerWidth\n                    if (newInnerWidth === innerWidth) return\n\n                    innerWidth = newInnerWidth\n\n                    this.root.updateBlockedByResize = true\n\n                    cancelDelay?.()\n                    cancelDelay = delay(resizeUnblockUpdate, 250)\n\n                    if (globalProjectionState.hasAnimatedSinceResize) {\n                        globalProjectionState.hasAnimatedSinceResize = false\n                        this.nodes!.forEach(finishAnimation)\n                    }\n                })\n            }\n\n            if (layoutId) {\n                this.root.registerSharedNode(layoutId, this)\n            }\n\n            this.addLayoutListener()\n        }\n\n        /**\n         * Only register the layout animation handler if this node requires\n         * layout animation. This is called on mount, and again whenever options\n         * change, as `layout` or `layoutId` may be enabled after mount.\n         */\n        addLayoutListener() {\n            const { layoutId, layout, visualElement, animate } = this.options\n\n            if (\n                !this.instance ||\n                this.hasLayoutListener ||\n                animate === false ||\n                !visualElement ||\n                !(layoutId || layout)\n            )\n                return\n\n            this.hasLayoutListener = true\n            this.addEventListener(\n                \"didUpdate\",\n                ({\n                    delta,\n                    hasLayoutChanged,\n                    hasRelativeLayoutChanged,\n                    layout: newLayout,\n                }: LayoutUpdateData) => {\n                    if (this.isAnimationBlocked) {\n                        this.target = undefined\n                        this.relativeTarget = undefined\n                        return\n                    }\n\n                    // TODO: Check here if an animation exists\n                    const layoutTransition =\n                        this.options.transition ||\n                        visualElement.getDefaultTransition() ||\n                        defaultLayoutTransition\n\n                    const {\n                        onLayoutAnimationStart,\n                        onLayoutAnimationComplete,\n                    } = visualElement.getProps()\n\n                    /**\n                     * The target layout of the element might stay the same,\n                     * but its position relative to its parent has changed.\n                     */\n                    const hasTargetChanged =\n                        !this.targetLayout ||\n                        !boxEqualsRounded(this.targetLayout, newLayout)\n                    /*\n                     * Note: Disabled to fix relative animations always triggering new\n                     * layout animations. If this causes further issues, we can try\n                     * a different approach to detecting relative target changes.\n                     */\n                    // || hasRelativeLayoutChanged\n\n                    /**\n                     * If the layout hasn't seemed to have changed, it might be that the\n                     * element is visually in the same place in the document but its position\n                     * relative to its parent has indeed changed. So here we check for that.\n                     */\n                    const hasOnlyRelativeTargetChanged =\n                        !hasLayoutChanged && hasRelativeLayoutChanged\n\n                    if (\n                        this.options.layoutRoot ||\n                        this.resumeFrom ||\n                        hasOnlyRelativeTargetChanged ||\n                        (hasLayoutChanged &&\n                            (hasTargetChanged || !this.currentAnimation))\n                    ) {\n                        if (this.resumeFrom) {\n                            this.resumingFrom = this.resumeFrom\n                            this.resumingFrom.resumingFrom = undefined\n                        }\n\n                        const animationOptions = {\n                            ...getValueTransition(layoutTransition, \"layout\"),\n                            onPlay: onLayoutAnimationStart,\n                            onComplete: onLayoutAnimationComplete,\n                        }\n\n                        if (\n                            visualElement.shouldReduceMotion ||\n                            this.options.layoutRoot\n                        ) {\n                            animationOptions.delay = 0\n                            animationOptions.type = false\n                        }\n\n                        this.startAnimation(animationOptions)\n                        /**\n                         * Set animation origin after starting animation to avoid layout jump\n                         * caused by stopping previous layout animation\n                         */\n                        this.setAnimationOrigin(\n                            delta,\n                            hasOnlyRelativeTargetChanged,\n                            (animationOptions as { path?: MotionPath }).path\n                        )\n                    } else {\n                        /**\n                         * If the layout hasn't changed and we have an animation that hasn't started yet,\n                         * finish it immediately. Otherwise it will be animating from a location\n                         * that was probably never committed to screen and look like a jumpy box.\n                         */\n\n                        if (!hasLayoutChanged) {\n                            finishAnimation(this)\n                        }\n\n                        this.isLead() && this.options.onExitComplete?.()\n                    }\n\n                    this.targetLayout = newLayout\n                }\n            )\n        }\n\n        unmount() {\n            this.options.layoutId && this.willUpdate()\n            this.root.nodes!.remove(this)\n            this.getStack()?.remove(this)\n            this.parent?.children.delete(this)\n            this.instance = undefined\n            this.eventHandlers.clear()\n            this.hasLayoutListener = false\n\n            cancelFrame(this.updateProjection)\n        }\n\n        // only on the root\n        blockUpdate() {\n            this.updateManuallyBlocked = true\n        }\n\n        unblockUpdate() {\n            this.updateManuallyBlocked = false\n        }\n\n        isUpdateBlocked() {\n            return this.updateManuallyBlocked || this.updateBlockedByResize\n        }\n\n        // Note: currently only running on root node\n        startUpdate() {\n            if (this.isUpdateBlocked()) return\n\n            this.isUpdating = true\n\n            this.nodes?.forEach(resetSkewAndRotation)\n            this.animationId++\n        }\n\n        getTransformTemplate() {\n            const { visualElement } = this.options\n            return visualElement && visualElement.getProps().transformTemplate\n        }\n\n        willUpdate(shouldNotifyListeners = true) {\n            this.root.hasTreeAnimated = true\n\n            if (this.root.isUpdateBlocked()) {\n                this.options.onExitComplete?.()\n                return\n            }\n\n            /**\n             * If we're running optimised appear animations then these must be\n             * cancelled before measuring the DOM. This is so we can measure\n             * the true layout of the element rather than the WAAPI animation\n             * which will be unaffected by the resetSkewAndRotate step.\n             *\n             * Note: This is a DOM write. Worst case scenario is this is sandwiched\n             * between other snapshot reads which will cause unnecessary style recalculations.\n             * This has to happen here though, as we don't yet know which nodes will need\n             * snapshots in startUpdate(), but we only want to cancel optimised animations\n             * if a layout animation measurement is actually going to be affected by them.\n             */\n            if (\n                window.MotionCancelOptimisedAnimation &&\n                !this.hasCheckedOptimisedAppear\n            ) {\n                cancelTreeOptimisedTransformAnimations(this)\n            }\n\n            !this.root.isUpdating && this.root.startUpdate()\n\n            if (this.isLayoutDirty) return\n\n            /**\n             * Accelerated transforms aren't reflected in latestValues or\n             * removed by resetTransform, so move them back to the main\n             * thread before this node, or its ancestors, are measured.\n             */\n            demoteTransforms(this)\n\n            this.isLayoutDirty = true\n            for (let i = 0; i < this.path.length; i++) {\n                const node = this.path[i]\n                node.shouldResetTransform = true\n                demoteTransforms(node)\n\n                /**\n                 * Percentage translates resolve against layoutBox dimensions,\n                 * so ancestors with them must be re-measured after transform reset.\n                 */\n                if (\n                    typeof node.latestValues.x === \"string\" ||\n                    typeof node.latestValues.y === \"string\"\n                ) {\n                    node.isLayoutDirty = true\n                }\n\n                node.updateScroll(\"snapshot\")\n\n                if (node.options.layoutRoot) {\n                    node.willUpdate(false)\n                }\n\n                /**\n                 * Measure the nearest dragged ancestor before the DOM\n                 * changes, so this node can follow its layout change.\n                 */\n                if (node.isAnimationBlocked) {\n                    node.dragSnapshot ||= node.measure()\n                    this.dragAncestor = node\n                }\n            }\n\n            const { layoutId, layout } = this.options\n            if (layoutId === undefined && !layout) return\n\n            const transformTemplate = this.getTransformTemplate()\n            this.prevTransformTemplateValue = transformTemplate\n                ? transformTemplate(this.latestValues, \"\")\n                : undefined\n\n            this.updateSnapshot()\n            shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n        }\n\n        // Note: Currently only running on root node\n        updateScheduled = false\n\n        update() {\n            this.updateScheduled = false\n\n            const updateWasBlocked = this.isUpdateBlocked()\n\n            // When doing an instant transition, we skip the layout update,\n            // but should still clean up the measurements so that the next\n            // snapshot could be taken correctly.\n            if (updateWasBlocked) {\n                const wasBlockedByResize = this.updateBlockedByResize\n\n                this.unblockUpdate()\n                this.updateBlockedByResize = false\n                this.clearAllSnapshots()\n\n                /**\n                 * When blocked by resize, still measure layouts so\n                 * callbacks like onLayoutMeasure fire (e.g. Reorder).\n                 * Skip notifyLayoutUpdate to prevent animations.\n                 */\n                if (wasBlockedByResize) {\n                    this.nodes!.forEach(forceLayoutMeasure)\n                }\n\n                this.nodes!.forEach(clearMeasurements)\n                return\n            }\n\n            /**\n             * If this is a repeat of didUpdate then ignore the animation.\n             */\n            if (this.animationId <= this.animationCommitId) {\n                this.nodes!.forEach(clearIsLayoutDirty)\n                return\n            }\n\n            this.animationCommitId = this.animationId\n\n            if (!this.isUpdating) {\n                this.nodes!.forEach(clearIsLayoutDirty)\n            } else {\n                this.isUpdating = false\n\n                /**\n                 * Ensure animation-blocked nodes (e.g. during drag)\n                 * get measured even when memoized (willUpdate skipped).\n                 */\n                this.nodes!.forEach(ensureDraggedNodesSnapshotted)\n                this.nodes!.forEach(syncRelativeLayout)\n\n                /**\n                 * Write\n                 */\n                this.nodes!.forEach(resetTransformStyle)\n\n                /**\n                 * Read ==================\n                 */\n                // Update layout measurements of updated children\n                this.nodes!.forEach(updateLayout)\n\n                /**\n                 * Write\n                 */\n                // Notify listeners that the layout is updated\n                this.nodes!.forEach(notifyLayoutUpdate)\n            }\n\n            this.clearAllSnapshots()\n\n            /**\n             * Manually flush any pending updates. Ideally\n             * we could leave this to the following requestAnimationFrame but this seems\n             * to leave a flash of incorrectly styled content.\n             */\n            const now = time.now()\n            frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n            frameData.timestamp = now\n            frameData.isProcessing = true\n            frameSteps.update.process(frameData)\n            frameSteps.preRender.process(frameData)\n            frameSteps.render.process(frameData)\n            frameData.isProcessing = false\n        }\n\n        scheduleUpdate = () => this.update()\n\n        didUpdate() {\n            if (!this.updateScheduled) {\n                this.updateScheduled = true\n                microtask.read(this.scheduleUpdate)\n            }\n        }\n\n        clearAllSnapshots() {\n            this.nodes!.forEach(clearSnapshot)\n\n            /**\n             * A stack's last member can unmount while a replacement with the\n             * same layoutId mounts in the same commit, so the stack (and its\n             * lead) must outlive the unmount for the replacement to resume\n             * from it. By now that handoff has happened, so stacks that are\n             * still empty only retain unmounted nodes and can be released.\n             */\n            this.sharedNodes.forEach((stack, layoutId) =>\n                stack.members.length\n                    ? stack.removeLeadSnapshot()\n                    : this.sharedNodes.delete(layoutId)\n            )\n        }\n\n        projectionUpdateScheduled = false\n        scheduleUpdateProjection() {\n            if (!this.projectionUpdateScheduled) {\n                this.projectionUpdateScheduled = true\n                frame.preRender(this.updateProjection, false, true)\n            }\n        }\n\n        scheduleCheckAfterUnmount() {\n            /**\n             * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n             * we manually call didUpdate to give a chance to the siblings to animate.\n             * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n             */\n            frame.postRender(() => {\n                if (this.isLayoutDirty) {\n                    this.root.didUpdate()\n                } else {\n                    this.root.checkUpdateFailed()\n                }\n            })\n        }\n\n        checkUpdateFailed = () => {\n            if (this.isUpdating) {\n                this.isUpdating = false\n                this.clearAllSnapshots()\n            }\n        }\n\n        /**\n         * This is a multi-step process as shared nodes might be of different depths. Nodes\n         * are sorted by depth order, so we need to resolve the entire tree before moving to\n         * the next step.\n         */\n        updateProjection = () => {\n            this.projectionUpdateScheduled = false\n\n            this.nodes!.forEach(propagateDirtyNodes)\n            this.nodes!.forEach(resolveTargetDelta)\n            this.nodes!.forEach(calcProjection)\n            this.nodes!.forEach(cleanDirtyNodes)\n\n            /**\n             * Record this frame's debug counts, if recordStats() is running.\n             */\n            statsBuffer.countProjection?.()\n        }\n\n        /**\n         * Update measurements\n         */\n        updateSnapshot() {\n            if (this.snapshot || !this.instance) return\n\n            this.snapshot = this.measure()\n\n            if (\n                this.snapshot &&\n                !calcLength(this.snapshot.measuredBox.x) &&\n                !calcLength(this.snapshot.measuredBox.y)\n            ) {\n                this.snapshot = undefined\n            }\n\n            /**\n             * Record how fast the element is moving when it's measured, so\n             * the next layout animation can start at the same speed.\n             */\n            if (this.snapshot) {\n                const { visualElement } = this.options\n                /**\n                 * A paused or stopped animation hands on no velocity.\n                 */\n                const isRunning = this.currentAnimation?.state === \"running\"\n                const edges = isRunning && this.animationEdges\n                /**\n                 * A child moving inside its parent hands on only its\n                 * velocity relative to the parent.\n                 */\n                if (isRunning && this.relativeTarget) {\n                    this.snapshot.relativeVelocity =\n                        this.relativeVelocity?.slice() || []\n                }\n                const progress = (edges && this.motionValue?.getVelocity()) || 0\n                const velocity = [0, 1, 2, 3, 4, 5].map(\n                    (i) =>\n                        (i < 4\n                            ? edges &&\n                              (this.edgeValues\n                                  ? this.edgeVelocity!(i)\n                                  : (-edges[i] * progress) / 1000)\n                            : visualElement\n                                  ?.getValue(i < 5 ? \"x\" : \"y\")\n                                  ?.getVelocity()) || 0\n                )\n                if (velocity.some(Boolean)) this.snapshot.velocity = velocity\n            }\n        }\n\n        updateLayout() {\n            if (!this.instance) return\n\n            this.updateScroll()\n\n            if (\n                !(this.options.alwaysMeasureLayout && this.isLead()) &&\n                !this.isLayoutDirty\n            ) {\n                return\n            }\n\n            /**\n             * When a node is mounted, it simply resumes from the prevLead's\n             * snapshot instead of taking a new one, but the ancestors scroll\n             * might have updated while the prevLead is unmounted. We need to\n             * update the scroll again to make sure the layout we measure is\n             * up to date.\n             */\n            if (this.resumeFrom && !this.resumeFrom.instance) {\n                for (let i = 0; i < this.path.length; i++) {\n                    const node = this.path[i]\n                    node.updateScroll()\n                }\n            }\n\n            const prevLayout = this.layout\n            this.layout = this.measure(false)\n            if (!this.layoutCorrected) this.layoutCorrected = createBox()\n            this.isLayoutDirty = false\n            this.projectionDelta = undefined\n            this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n            const { visualElement } = this.options\n            visualElement?.notify(\n                \"LayoutMeasure\",\n                this.layout.layoutBox,\n                prevLayout?.layoutBox\n            )\n        }\n\n        updateScroll(phase: Phase = \"measure\") {\n            const { scroll, instance } = this\n            const { animationId } = this.root\n\n            if (\n                this.options.layoutScroll &&\n                instance &&\n                !(\n                    scroll &&\n                    scroll.animationId === animationId &&\n                    scroll.phase === phase\n                )\n            ) {\n                const isRoot = checkIsScrollRoot(instance)\n                this.scroll = {\n                    animationId,\n                    phase,\n                    isRoot,\n                    offset: measureScroll(instance),\n                    wasRoot: scroll ? scroll.isRoot : isRoot,\n                }\n            }\n        }\n\n        resetTransform() {\n            if (!resetTransform) return\n\n            const isResetRequested =\n                this.isLayoutDirty ||\n                this.shouldResetTransform ||\n                this.options.alwaysMeasureLayout\n\n            isResetRequested && demoteTransforms(this)\n\n            const hasProjection =\n                this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n            const transformTemplate = this.getTransformTemplate()\n            const transformTemplateValue = transformTemplate\n                ? transformTemplate(this.latestValues, \"\")\n                : undefined\n\n            const transformTemplateHasChanged =\n                transformTemplateValue !== this.prevTransformTemplateValue\n\n            if (\n                isResetRequested &&\n                this.instance &&\n                (hasProjection ||\n                    hasTransform(this.latestValues) ||\n                    transformTemplateHasChanged)\n            ) {\n                resetTransform(this.instance, transformTemplateValue)\n                this.shouldResetTransform = false\n                this.scheduleRender()\n            }\n        }\n\n        measure(removeTransform = true) {\n            const pageBox = this.measurePageBox()\n\n            let layoutBox = this.removeElementScroll(pageBox)\n\n            /**\n             * Measurements taken during the pre-render stage\n             * still have transforms applied so we remove them\n             * via calculation.\n             */\n            if (removeTransform) {\n                layoutBox = this.removeTransform(layoutBox)\n            }\n\n            roundBox(layoutBox)\n\n            return {\n                animationId: this.root.animationId,\n                measuredBox: pageBox,\n                layoutBox,\n                latestValues: {},\n                source: this.id,\n            }\n        }\n\n        measurePageBox() {\n            const { visualElement } = this.options\n            if (!visualElement) return createBox()\n\n            const box = visualElement.measureViewportBox()\n\n            const wasInScrollRoot =\n                this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n            if (!wasInScrollRoot) {\n                // Remove viewport scroll to give page-relative coordinates\n                const { scroll } = this.root\n                if (scroll) {\n                    translateAxis(box.x, scroll.offset.x)\n                    translateAxis(box.y, scroll.offset.y)\n                }\n            }\n\n            return box\n        }\n\n        removeElementScroll(box: Box): Box {\n            const boxWithoutScroll = createBox()\n            copyBoxInto(boxWithoutScroll, box)\n\n            if (this.scroll?.wasRoot) {\n                return boxWithoutScroll\n            }\n\n            /**\n             * Performance TODO: Keep a cumulative scroll offset down the tree\n             * rather than loop back up the path.\n             */\n            for (let i = 0; i < this.path.length; i++) {\n                const node = this.path[i]\n                const { scroll, options } = node\n\n                if (node !== this.root && scroll && options.layoutScroll) {\n                    /**\n                     * If this is a new scroll root, we want to remove all previous scrolls\n                     * from the viewport box.\n                     */\n                    if (scroll.wasRoot) {\n                        copyBoxInto(boxWithoutScroll, box)\n                    }\n\n                    translateAxis(boxWithoutScroll.x, scroll.offset.x)\n                    translateAxis(boxWithoutScroll.y, scroll.offset.y)\n                }\n            }\n\n            return boxWithoutScroll\n        }\n\n        applyTransform(\n            box: Box,\n            transformOnly = false,\n            output?: Box,\n            skipOwnTransform?: boolean,\n            start = 0\n        ): Box {\n            const withTransforms = output || createBox()\n            copyBoxInto(withTransforms, box)\n            for (let i = start; i < this.path.length; i++) {\n                const node = this.path[i]\n\n                if (\n                    !transformOnly &&\n                    node.options.layoutScroll &&\n                    node.scroll &&\n                    node !== node.root\n                ) {\n                    translateAxis(withTransforms.x, -node.scroll.offset.x)\n                    translateAxis(withTransforms.y, -node.scroll.offset.y)\n                }\n\n                if (!hasTransform(node.latestValues)) continue\n                transformBox(\n                    withTransforms,\n                    node.latestValues,\n                    node.layout?.layoutBox\n                )\n            }\n\n            if (!skipOwnTransform && hasTransform(this.latestValues)) {\n                transformBox(\n                    withTransforms,\n                    this.latestValues,\n                    this.layout?.layoutBox\n                )\n            }\n\n            return withTransforms\n        }\n\n        removeTransform(box: Box): Box {\n            const boxWithoutTransform = createBox()\n            copyBoxInto(boxWithoutTransform, box)\n\n            for (let i = 0; i < this.path.length; i++) {\n                const node = this.path[i]\n                if (!hasTransform(node.latestValues)) continue\n\n                let sourceBox: Box | undefined\n\n                if (node.instance) {\n                    hasScale(node.latestValues) && node.updateSnapshot()\n                    sourceBox = createBox()\n                    copyBoxInto(sourceBox, node.measurePageBox())\n                }\n\n                removeBoxTransforms(\n                    boxWithoutTransform,\n                    node.latestValues,\n                    node.snapshot?.layoutBox,\n                    sourceBox\n                )\n            }\n\n            if (hasTransform(this.latestValues)) {\n                removeBoxTransforms(boxWithoutTransform, this.latestValues)\n            }\n\n            return boxWithoutTransform\n        }\n\n        setTargetDelta(delta: Delta) {\n            this.targetDelta = delta\n            this.root.scheduleUpdateProjection()\n            this.isProjectionDirty = true\n        }\n\n        setOptions(options: ProjectionNodeOptions) {\n            this.options = {\n                ...this.options,\n                ...options,\n                crossfade:\n                    options.crossfade !== undefined ? options.crossfade : true,\n            }\n            this.addLayoutListener()\n        }\n\n        clearMeasurements() {\n            this.scroll = undefined\n            this.layout = undefined\n            this.snapshot = undefined\n            this.prevTransformTemplateValue = undefined\n            this.targetDelta = undefined\n            this.target = undefined\n            this.isLayoutDirty = false\n        }\n\n        forceRelativeParentToResolveTarget() {\n            if (!this.relativeParent) return\n\n            /**\n             * If the parent target isn't up-to-date, force it to update.\n             * This is an unfortunate de-optimisation as it means any updating relative\n             * projection will cause all the relative parents to recalculate back\n             * up the tree.\n             */\n            if (\n                this.relativeParent.resolvedRelativeTargetAt !==\n                frameData.timestamp\n            ) {\n                this.relativeParent.resolveTargetDelta(true)\n            }\n        }\n\n        /**\n         * Frame calculations\n         */\n        resolvedRelativeTargetAt: number = 0.0\n        resolveTargetDelta(forceRecalculation = false) {\n            /**\n             * Once the dirty status of nodes has been spread through the tree, we also\n             * need to check if we have a shared node of a different depth that has itself\n             * been dirtied.\n             */\n            const lead = this.getLead()\n            this.isProjectionDirty ||= lead.isProjectionDirty\n            this.isTransformDirty ||= lead.isTransformDirty\n            this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n            const isShared = Boolean(this.resumingFrom) || this !== lead\n\n            /**\n             * We don't use transform for this step of processing so we don't\n             * need to check whether any nodes have changed transform.\n             */\n            const canSkip = !(\n                forceRecalculation ||\n                (isShared && this.isSharedProjectionDirty) ||\n                this.isProjectionDirty ||\n                this.parent?.isProjectionDirty ||\n                this.attemptToResolveRelativeTarget ||\n                this.root.updateBlockedByResize\n            )\n\n            if (canSkip) return\n\n            const { layout, layoutId } = this.options\n\n            /**\n             * If we have no layout, we can't perform projection, so early return\n             */\n            if (!this.layout || !(layout || layoutId)) return\n\n            this.resolvedRelativeTargetAt = frameData.timestamp\n\n            const relativeParent = this.getClosestProjectingParent()\n\n            /**\n             * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n             * a relativeParent. This will allow a component to perform scale correction\n             * even if no animation has started.\n             */\n            if (!this.targetDelta && !this.relativeTarget) {\n                if (\n                    this.options.layoutAnchor !== false &&\n                    relativeParent &&\n                    relativeParent.layout\n                ) {\n                    this.createRelativeTarget(\n                        relativeParent,\n                        this.layout.layoutBox,\n                        relativeParent.layout.layoutBox\n                    )\n                } else {\n                    this.removeRelativeTarget()\n                }\n            }\n\n            /**\n             * If we have no relative target or no target delta our target isn't valid\n             * for this frame.\n             */\n            if (!this.relativeTarget && !this.targetDelta) return\n\n            /**\n             * Lazy-init target data structure\n             */\n            if (!this.target) {\n                this.target = createBox()\n                this.targetWithTransforms = createBox()\n            }\n\n            /**\n             * If we've got a relative box for this component, resolve it into a target relative to the parent.\n             */\n            if (\n                this.relativeTarget &&\n                this.relativeTargetOrigin &&\n                this.relativeParent &&\n                this.relativeParent.target\n            ) {\n                this.forceRelativeParentToResolveTarget()\n\n                calcRelativeBox(\n                    this.target,\n                    this.relativeTarget,\n                    this.relativeParent.target,\n                    this.options.layoutAnchor || undefined\n                )\n\n                /**\n                 * If we've only got a targetDelta, resolve it into a target\n                 */\n            } else if (this.targetDelta) {\n                if (Boolean(this.resumingFrom)) {\n                    /**\n                     * Own transforms are applied later, in applyTransformsToTarget,\n                     * so only apply ancestor transforms here or they'd be doubled.\n                     */\n                    this.applyTransform(\n                        this.layout.layoutBox,\n                        false,\n                        this.target,\n                        true\n                    )\n                } else {\n                    copyBoxInto(this.target, this.layout.layoutBox)\n                }\n\n                applyBoxDelta(this.target, this.targetDelta)\n            } else {\n                /**\n                 * If no target, use own layout as target\n                 */\n                copyBoxInto(this.target, this.layout.layoutBox)\n            }\n\n            /**\n             * If we've been told to attempt to resolve a relative target, do so.\n             */\n            if (this.attemptToResolveRelativeTarget) {\n                this.attemptToResolveRelativeTarget = false\n\n                if (\n                    this.options.layoutAnchor !== false &&\n                    relativeParent &&\n                    (!relativeParent.resumingFrom === !this.resumingFrom ||\n                        /**\n                         * Shared layout animations within a layoutRoot\n                         * animate relative to it.\n                         */\n                        (relativeParent.options.layoutRoot &&\n                            !relativeParent.resumingFrom)) &&\n                    !relativeParent.options.layoutScroll &&\n                    relativeParent.target &&\n                    this.animationProgress !== 1\n                ) {\n                    this.createRelativeTarget(\n                        relativeParent,\n                        this.target,\n                        relativeParent.target\n                    )\n                } else {\n                    this.relativeParent = this.relativeTarget = undefined\n                }\n            }\n\n            /**\n             * Increase debug counter for resolved target deltas\n             */\n            statsBuffer.countProjection?.(1) // calculatedTargetDeltas\n        }\n\n        getClosestProjectingParent() {\n            if (\n                !this.parent ||\n                hasScale(this.parent.latestValues) ||\n                has2DTranslate(this.parent.latestValues)\n            ) {\n                return undefined\n            }\n\n            if (this.parent.isProjecting()) {\n                return this.parent\n            } else {\n                return this.parent.getClosestProjectingParent()\n            }\n        }\n\n        isProjecting() {\n            return Boolean(\n                (this.relativeTarget ||\n                    this.targetDelta ||\n                    this.options.layoutRoot) &&\n                    this.layout\n            )\n        }\n\n        createRelativeTarget(\n            relativeParent: IProjectionNode,\n            layout: Box,\n            parentLayout: Box\n        ) {\n            this.relativeParent = relativeParent\n            this.forceRelativeParentToResolveTarget()\n            this.relativeTarget = createBox()\n            this.relativeTargetOrigin = createBox()\n            calcRelativePosition(\n                this.relativeTargetOrigin,\n                layout,\n                parentLayout,\n                this.options.layoutAnchor || undefined\n            )\n\n            copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n        }\n\n        removeRelativeTarget() {\n            this.relativeParent = this.relativeTarget = undefined\n        }\n\n        hasProjected: boolean = false\n\n        calcProjection() {\n            const lead = this.getLead()\n            const isShared = Boolean(this.resumingFrom) || this !== lead\n\n            let canSkip = true\n\n            /**\n             * If this is a normal layout animation and neither this node nor its nearest projecting\n             * is dirty then we can't skip.\n             */\n            if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n                canSkip = false\n            }\n\n            /**\n             * If this is a shared layout animation and this node's shared projection is dirty then\n             * we can't skip.\n             */\n            if (\n                isShared &&\n                (this.isSharedProjectionDirty || this.isTransformDirty)\n            ) {\n                canSkip = false\n            }\n\n            /**\n             * If we have resolved the target this frame we must recalculate the\n             * projection to ensure it visually represents the internal calculations.\n             */\n            if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n                canSkip = false\n            }\n\n            if (canSkip) return\n\n            const { layout, layoutId } = this.options\n\n            /**\n             * If this section of the tree isn't animating we can\n             * delete our target sources for the following frame.\n             */\n            this.isTreeAnimating = Boolean(\n                this.parent?.isTreeAnimating ||\n                    this.currentAnimation ||\n                    this.pendingAnimation\n            )\n            if (!this.isTreeAnimating) {\n                this.targetDelta = this.relativeTarget = undefined\n            }\n\n            if (!this.layout || !(layout || layoutId)) return\n\n            /**\n             * Reset the corrected box with the latest values from box, as we're then going\n             * to perform mutative operations on it.\n             */\n            copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n            /**\n             * Record previous tree scales before updating.\n             */\n            const prevTreeScaleX = this.treeScale.x\n            const prevTreeScaleY = this.treeScale.y\n            /**\n             * Apply all the parent deltas to this box to produce the corrected box. This\n             * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n             *\n             * A shared target is usually in page space, so ancestor transforms are applied\n             * too. But a target relative to a parent that isn't itself shared (like a\n             * layoutRoot) is in that parent's layout space. So the transforms of the\n             * parent and its ancestors, which move both elements alike, are skipped,\n             * but those of other ancestors (between it and either element) apply.\n             */\n            applyTreeDeltas(\n                this.layoutCorrected,\n                this.treeScale,\n                this.path,\n                isShared &&\n                    (lead.relativeTarget && !lead.relativeParent!.resumingFrom\n                        ? lead.relativeParent\n                        : true)\n            )\n\n            /**\n             * If this layer needs to perform scale correction but doesn't have a target,\n             * use the layout as the target.\n             */\n            if (\n                lead.layout &&\n                !lead.target &&\n                (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n            ) {\n                lead.target = lead.layout.layoutBox\n                lead.targetWithTransforms = createBox()\n            }\n\n            const { target } = lead\n\n            if (!target) {\n                /**\n                 * If we don't have a target to project into, but we were previously\n                 * projecting, we want to remove the stored transform and schedule\n                 * a render to ensure the elements reflect the removed transform.\n                 */\n                if (this.prevProjectionDelta) {\n                    this.createProjectionDeltas()\n                    this.scheduleRender()\n                }\n\n                return\n            }\n\n            if (!this.projectionDelta || !this.prevProjectionDelta) {\n                this.createProjectionDeltas()\n            } else {\n                copyAxisDeltaInto(\n                    this.prevProjectionDelta.x,\n                    this.projectionDelta.x\n                )\n                copyAxisDeltaInto(\n                    this.prevProjectionDelta.y,\n                    this.projectionDelta.y\n                )\n            }\n\n            /**\n             * Update the delta between the corrected box and the target box before user-set transforms were applied.\n             * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n             * for our layout reprojection, but still allow them to be scaled correctly by the user.\n             * It might be that to simplify this we may want to accept that user-set scale is also corrected\n             * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n             * to allow people to choose whether these styles are corrected based on just the\n             * layout reprojection or the final bounding box.\n             */\n            calcBoxDelta(\n                this.projectionDelta!,\n                this.layoutCorrected,\n                target,\n                this.latestValues\n            )\n\n            if (\n                this.treeScale.x !== prevTreeScaleX ||\n                this.treeScale.y !== prevTreeScaleY ||\n                !axisDeltaEquals(\n                    this.projectionDelta!.x,\n                    this.prevProjectionDelta!.x\n                ) ||\n                !axisDeltaEquals(\n                    this.projectionDelta!.y,\n                    this.prevProjectionDelta!.y\n                )\n            ) {\n                this.hasProjected = true\n                this.scheduleRender()\n                this.notifyListeners(\"projectionUpdate\", target)\n            }\n\n            /**\n             * Increase debug counter for recalculated projections\n             */\n            statsBuffer.countProjection?.(2) // calculatedProjections\n        }\n\n        isVisible = true\n        hide() {\n            this.isVisible = false\n            // TODO: Schedule render\n        }\n        show() {\n            this.isVisible = true\n            // TODO: Schedule render\n        }\n\n        scheduleRender(notifyAll = true) {\n            this.options.visualElement?.scheduleRender()\n            if (notifyAll) {\n                this.getStack()?.scheduleRender()\n            }\n            if (this.resumingFrom && !this.resumingFrom.instance) {\n                this.resumingFrom = undefined\n            }\n        }\n\n        createProjectionDeltas() {\n            this.prevProjectionDelta = createDelta()\n            this.projectionDelta = createDelta()\n            this.projectionDeltaWithTransform = createDelta()\n        }\n\n        /**\n         * Animation\n         */\n        animationValues?: ResolvedValues\n        pendingAnimation?: Process\n        currentAnimation?: AnimationPlaybackControls\n        mixTargetDelta: (progress: number) => void\n        animationProgress = 0\n\n        /**\n         * Layout velocity.\n         * animationEdges are the offsets (px) of the x min, x max, y min and\n         * y max edges from the layout at the start of the animation.\n         * startVelocity is for the next animation: one progress velocity for\n         * a curved path, or a velocity (px/s) for each edge.\n         * edgeValues hold the latest edge offsets while each edge runs on\n         * its own spring, and edgeVelocity reads an edge's velocity.\n         */\n        animationEdges?: number[]\n        startVelocity?: number | number[]\n        edgeValues?: number[]\n        edgeVelocity?: (i: number) => number\n        /**\n         * relativeVelocity is measured each frame while a child moves inside\n         * its parent. relativeStart is the relative velocity of the next\n         * animation, and impulse is how far one px/s of it has moved the\n         * child so far.\n         */\n        relativeVelocity?: number[]\n        relativeTime?: number\n        relativeStart?: number[]\n        impulse?: number\n        isSpringLayout?: boolean\n\n        setAnimationOrigin(\n            delta: Delta,\n            hasOnlyRelativeTargetChanged: boolean = false,\n            pathFn?: MotionPath\n        ) {\n            const snapshot = this.snapshot\n            const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n            const mixedValues = { ...this.latestValues }\n\n            const targetDelta = createDelta()\n            if (\n                !this.relativeParent ||\n                !this.relativeParent.options.layoutRoot\n            ) {\n                this.relativeTarget = this.relativeTargetOrigin = undefined\n            }\n            this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n            const relativeLayout = createBox()\n\n            const isSharedLayoutAnimation =\n                snapshot?.source !== this.layout?.source\n            const stack = this.getStack()\n            const isOnlyMember = !stack || stack.members.length <= 1\n            const shouldCrossfadeOpacity = Boolean(\n                isSharedLayoutAnimation &&\n                    !isOnlyMember &&\n                    this.options.crossfade === true &&\n                    !this.path.some(hasOpacityCrossfade)\n            )\n\n            this.animationProgress = 0\n\n            let prevRelativeTarget: Box\n\n            // The path decides whether the layout shift is worth curving\n            // (distance floor) and resolves the interpolator from the delta.\n            const interpolate: PathInterpolator | undefined =\n                pathFn?.interpolateProjection(delta)\n\n            const box = this.layout?.layoutBox\n            let edges =\n                box &&\n                [box.x.min, box.x.max, box.y.min, box.y.max].map((edge, i) => {\n                    const { translate, scale, originPoint } =\n                        delta[i < 2 ? \"x\" : \"y\"]\n                    return (edge - originPoint) * (scale - 1) + translate\n                })\n            /**\n             * A zero-length layout axis has no finite edge offsets.\n             */\n            if (!edges?.every(isFinite)) edges = undefined\n            this.animationEdges = edges\n            this.edgeValues =\n                this.startVelocity =\n                this.impulse =\n                this.relativeVelocity =\n                this.relativeStart =\n                    undefined\n\n            /**\n             * A shared snapshot is measured with the old element's own\n             * transforms (like x/y from drag), so it hands their velocity on\n             * too. Otherwise those values keep animating themselves.\n             */\n            const velocity = snapshot?.velocity\n            /**\n             * A child that wasn't moving inside an animating parent before\n             * moved in page space, so that is its relative velocity.\n             */\n            const relative = snapshot?.relativeVelocity || velocity\n            if (\n                relative?.slice(0, 4).some(Boolean) &&\n                this.getClosestProjectingParent()\n            ) {\n                this.relativeStart = relative\n            }\n            if (velocity && edges) {\n                const v = velocity\n                    .slice(0, 4)\n                    .map(\n                        (edge, i) =>\n                            edge +\n                            (isSharedLayoutAnimation\n                                ? velocity[4 + (i >> 1)]\n                                : 0)\n                    )\n                if (v.some(Boolean)) {\n                    this.startVelocity = interpolate\n                        ? pointToProgressVelocity(\n                              delta.x.translate,\n                              delta.y.translate,\n                              { x: (v[0] + v[1]) / 2, y: (v[2] + v[3]) / 2 }\n                          )\n                        : v\n                }\n            }\n\n            this.mixTargetDelta = (latest: number) => {\n                const progress = latest / 1000\n                const point = interpolate?.(progress)\n                const values = this.edgeValues\n\n                for (let i = 0; i < 2; i++) {\n                    const axis = i ? \"y\" : \"x\"\n                    values\n                        ? edgesToDelta(\n                              targetDelta[axis],\n                              delta[axis],\n                              this.layout!.layoutBox[axis],\n                              values[i * 2],\n                              values[i * 2 + 1]\n                          )\n                        : mixAxisDeltaLinear(\n                              targetDelta[axis],\n                              delta[axis],\n                              progress\n                          )\n                }\n\n                if (point) {\n                    targetDelta.x.translate = point.x\n                    targetDelta.y.translate = point.y\n                }\n\n                this.setTargetDelta(targetDelta)\n\n                if (\n                    this.relativeTarget &&\n                    this.relativeTargetOrigin &&\n                    this.layout &&\n                    this.relativeParent &&\n                    this.relativeParent.layout\n                ) {\n                    calcRelativePosition(\n                        relativeLayout,\n                        this.layout.layoutBox,\n                        this.relativeParent.layout.layoutBox,\n                        this.options.layoutAnchor || undefined\n                    )\n                    const from = this.relativeTargetOrigin\n                    const to = relativeLayout\n                    /**\n                     * A child mixes its place in its parent by progress,\n                     * so a nested tree moves as one.\n                     */\n                    mixBox(this.relativeTarget, from, to, progress)\n\n                    /**\n                     * Springs are linear, so the child's own velocity adds\n                     * the impulse response on top of the mix.\n                     */\n                    /**\n                     * Only springs take velocity, so a tween skips this.\n                     */\n                    if (this.isSpringLayout) {\n                        const box = this.relativeTarget\n                        const impulse = this.impulse || 0\n                        const start = this.relativeStart\n                        const now = time.now()\n                        const dt = (now - this.relativeTime!) / 1000\n                        this.relativeTime = now\n                        const speeds = (this.relativeVelocity ||= [0, 0, 0, 0])\n                        for (let i = 0; i < 4; i++) {\n                            const axis = i < 2 ? \"x\" : \"y\"\n                            const edge = i & 1 ? \"max\" : \"min\"\n                            if (start) box[axis][edge] += start[i] * impulse\n                            if (prevRelativeTarget && dt > 0) {\n                                speeds[i] =\n                                    (box[axis][edge] -\n                                        prevRelativeTarget[axis][edge]) /\n                                    dt\n                            }\n                        }\n                    }\n\n                    /**\n                     * If this is an unchanged relative target we can consider the\n                     * projection not dirty.\n                     */\n                    if (\n                        prevRelativeTarget &&\n                        boxEquals(this.relativeTarget, prevRelativeTarget)\n                    ) {\n                        this.isProjectionDirty = false\n                    }\n\n                    if (!prevRelativeTarget) prevRelativeTarget = createBox()\n                    copyBoxInto(prevRelativeTarget, this.relativeTarget)\n                }\n\n                if (isSharedLayoutAnimation) {\n                    this.animationValues = mixedValues\n\n                    mixValues(\n                        mixedValues,\n                        snapshotLatestValues,\n                        this.latestValues,\n                        progress,\n                        shouldCrossfadeOpacity,\n                        isOnlyMember\n                    )\n                }\n\n                if (point?.rotate !== undefined) {\n                    // Dedicated `pathRotation` channel, not `rotate`, so an\n                    // animating `rotate` is composed with, never clobbered.\n                    if (!this.animationValues)\n                        this.animationValues = mixedValues\n                    this.animationValues.pathRotation = point.rotate\n                }\n\n                this.root.scheduleUpdateProjection()\n                this.scheduleRender()\n\n                this.animationProgress = progress\n            }\n\n            this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n        }\n\n        motionValue?: MotionValue<number>\n        startAnimation(options: ValueAnimationOptions<number>) {\n            this.notifyListeners(\"animationStart\")\n\n            const isSpring = (this.isSpringLayout = options.type === \"spring\")\n            this.currentAnimation?.stop()\n            this.resumingFrom?.currentAnimation?.stop()\n            if (this.resumingFrom) this.resumingFrom.edgeValues = undefined\n\n            if (this.pendingAnimation) {\n                cancelFrame(this.pendingAnimation)\n                this.pendingAnimation = undefined\n            }\n\n            /**\n             * Start the animation in the next frame to have a frame with progress 0,\n             * where the target is the same as when the animation started, so we can\n             * calculate the relative positions correctly for instant transitions.\n             */\n            this.pendingAnimation = frame.update(() => {\n                globalProjectionState.hasAnimatedSinceResize = true\n\n                this.motionValue ||= motionValue(0)\n                this.motionValue.jump(0, false)\n\n                /**\n                 * A duration spring ignores velocity, like in animate(), so\n                 * it ends on time.\n                 */\n                const velocity = this.startVelocity\n                this.startVelocity = undefined\n\n                let transition: any = options\n                let mainVelocity = 0\n\n                if (isSpring) {\n                    /**\n                     * With mass: \"auto\", mass comes from the element's own\n                     * size.\n                     */\n                    if (options.mass === \"auto\") {\n                        const box = this.layout?.layoutBox\n                        transition = resolveAutoMass(\n                            options,\n                            box &&\n                                Math.sqrt(calcLength(box.x) * calcLength(box.y))\n                        )\n                    }\n                    /**\n                     * Only springs take a velocity. A tween keeps one\n                     * driver, so its controls (pause, time) reach it all.\n                     */\n                    const relative = this.relativeStart\n                    if ((velocity || relative) && !options.repeat) {\n                        if (typeof velocity === \"number\") {\n                            mainVelocity = velocity\n                        } else {\n                            /**\n                             * Each edge (x min, x max, y min, y max) gets its\n                             * own spring in pixels, with its own start\n                             * velocity. An edge that doesn't move keeps\n                             * still, and a thrown element keeps its size.\n                             * One generator steps them all with the main\n                             * spring, so one animation drives them and its\n                             * controls reach them all.\n                             */\n                            const edges = velocity && this.animationEdges!\n                            transition = {\n                                ...transition,\n                                type: (o: any) => {\n                                    const springs = [\n                                        o.velocity,\n                                        ...(velocity || []),\n                                    ].map((v, i) =>\n                                        spring({\n                                            ...o,\n                                            keyframes: i\n                                                ? [edges![i - 1], 0]\n                                                : o.keyframes,\n                                            velocity: v,\n                                        })\n                                    )\n                                    const count = springs.length\n                                    /**\n                                     * The response to 1000 px/s, for a\n                                     * child's velocity inside its parent.\n                                     * Coarse rest thresholds, because a\n                                     * small offset of it is far below 1px.\n                                     */\n                                    relative &&\n                                        springs.push(\n                                            spring({\n                                                ...o,\n                                                keyframes: [0, 0],\n                                                velocity: 1000,\n                                                restDelta: 0.5,\n                                                restSpeed: 5,\n                                            })\n                                        )\n                                    let time = 0\n                                    const values: number[] = []\n                                    const generator = {\n                                        calculatedDuration: null as\n                                            | number\n                                            | null,\n                                        next: (t: number) => {\n                                            time = t\n                                            const state = springs[0].next(t)\n                                            let done = state.done\n                                            for (\n                                                let i = 1;\n                                                i < springs.length;\n                                                i++\n                                            ) {\n                                                const { value, done: rest } =\n                                                    springs[i].next(t)\n                                                if (i < count) {\n                                                    values[i - 1] = value\n                                                } else {\n                                                    this.impulse = value / 1000\n                                                }\n                                                done = done && rest\n                                            }\n                                            if (edges) this.edgeValues = values\n                                            state.done = done\n                                            return state\n                                        },\n                                    }\n                                    /**\n                                     * Measure the duration now, then go back\n                                     * to the start, so a delay shows the\n                                     * start and not the end.\n                                     */\n                                    generator.calculatedDuration =\n                                        calcGeneratorDuration(generator)\n                                    generator.next(0)\n                                    this.edgeVelocity = (i) =>\n                                        springs[i + 1].velocity!(time)\n                                    return generator\n                                },\n                            }\n                        }\n                    }\n                }\n\n                const main = animateSingleValue(this.motionValue, [0, 1000], {\n                    ...transition,\n                    velocity: mainVelocity,\n                    isSync: true,\n                    onUpdate: (latest: number) => {\n                        this.mixTargetDelta(latest)\n                        options.onUpdate && options.onUpdate(latest)\n                    },\n                    onComplete: () => {\n                        options.onComplete && options.onComplete()\n                        this.completeAnimation()\n                    },\n                })\n\n                this.currentAnimation = main\n\n                notifyLayoutAnimationStart(this.currentAnimation, this)\n\n                if (this.resumingFrom) {\n                    this.resumingFrom.currentAnimation = this.currentAnimation\n                }\n\n                this.pendingAnimation = undefined\n            })\n        }\n\n        completeAnimation() {\n            if (this.resumingFrom) {\n                this.resumingFrom.currentAnimation = undefined\n                this.resumingFrom.preserveOpacity = undefined\n            }\n\n            const stack = this.getStack()\n            stack && stack.exitAnimationComplete()\n            this.resumingFrom =\n                this.currentAnimation =\n                this.animationValues =\n                this.edgeValues =\n                this.edgeVelocity =\n                this.impulse =\n                    undefined\n\n            this.notifyListeners(\"animationComplete\")\n        }\n\n        finishAnimation() {\n            if (this.currentAnimation) {\n                this.edgeValues = this.impulse = undefined\n                this.mixTargetDelta?.(animationTarget)\n                this.currentAnimation.stop()\n            }\n\n            this.completeAnimation()\n        }\n\n        applyTransformsToTarget() {\n            const lead = this.getLead()\n            const { targetWithTransforms, layout, latestValues } = lead\n            let { target } = lead\n\n            if (!targetWithTransforms || !target || !layout) return\n\n            /**\n             * If we're only animating position, and this element isn't the lead element,\n             * then instead of projecting into the lead box we instead want to calculate\n             * a new target that aligns the two boxes but maintains the layout shape.\n             */\n            if (\n                this !== lead &&\n                this.layout &&\n                layout &&\n                shouldAnimatePositionOnly(\n                    this.options.animationType,\n                    this.layout.layoutBox,\n                    layout.layoutBox\n                )\n            ) {\n                const { layoutBox } = this.layout\n                const leadTarget = target\n                target = this.target || createBox()\n                alignAxis(target.x, leadTarget.x, layoutBox.x)\n                alignAxis(target.y, leadTarget.y, layoutBox.y)\n            }\n\n            copyBoxInto(targetWithTransforms, target)\n\n            /**\n             * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n             * This is the final box that we will then project into by calculating a transform delta and\n             * applying it to the corrected box.\n             */\n            transformBox(targetWithTransforms, latestValues)\n\n            /**\n             * Update the delta between the corrected box and the final target box, after\n             * user-set transforms are applied to it. This will be used by the renderer to\n             * create a transform style that will reproject the element from its layout layout\n             * into the desired bounding box.\n             */\n            calcBoxDelta(\n                this.projectionDeltaWithTransform!,\n                this.layoutCorrected,\n                targetWithTransforms!,\n                latestValues\n            )\n        }\n\n        /**\n         * Shared layout\n         */\n        // TODO Only running on root node\n        sharedNodes: Map<string, NodeStack> = new Map()\n        registerSharedNode(layoutId: string, node: IProjectionNode) {\n            if (!this.sharedNodes.has(layoutId)) {\n                this.sharedNodes.set(layoutId, new NodeStack())\n            }\n\n            const stack = this.sharedNodes.get(layoutId)!\n            stack.add(node)\n\n            const config = node.options.initialPromotionConfig\n            node.promote({\n                transition: config?.transition,\n                preserveFollowOpacity: config?.shouldPreserveFollowOpacity\n                    ? config.shouldPreserveFollowOpacity(node)\n                    : undefined,\n            })\n        }\n\n        isLead(): boolean {\n            const stack = this.getStack()\n            return stack ? stack.lead === this : true\n        }\n\n        getLead() {\n            const { layoutId } = this.options\n            return layoutId ? this.getStack()?.lead || this : this\n        }\n\n        getPrevLead() {\n            const { layoutId } = this.options\n            return layoutId ? this.getStack()?.prevLead : undefined\n        }\n\n        getStack() {\n            const { layoutId } = this.options\n            if (layoutId) return this.root.sharedNodes.get(layoutId)\n        }\n\n        promote({\n            needsReset,\n            transition,\n            preserveFollowOpacity,\n        }: {\n            needsReset?: boolean\n            transition?: Transition\n            preserveFollowOpacity?: boolean\n        } = {}) {\n            this.getStack()?.promote(this, preserveFollowOpacity)\n\n            if (needsReset) {\n                this.projectionDelta = undefined\n                this.needsReset = true\n            }\n            if (transition) this.setOptions({ transition })\n        }\n\n        relegate(): boolean {\n            return this.getStack()?.relegate(this) || false\n        }\n\n        resetSkewAndRotation() {\n            const { visualElement } = this.options\n\n            if (!visualElement) return\n\n            /**\n             * An unrolled check for rotation values. Most elements don't have any rotation and\n             * skipping the loop and new object creation is 50% faster.\n             * If there's no distorting values, we don't need to do any more.\n             */\n            const { latestValues } = visualElement\n            if (!hasDistortingTransform(latestValues)) return\n\n            const resetValues: ResolvedValues = {}\n\n            // Check the skew and rotate value of all axes and reset to 0\n            for (let i = 0; i < distortingTransforms.length; i++) {\n                resetDistortingTransform(\n                    distortingTransforms[i],\n                    visualElement,\n                    resetValues,\n                    this.animationValues\n                )\n            }\n            for (let i = 0; i < angleTransforms.length; i++) {\n                resetDistortingTransform(\n                    angleTransforms[i],\n                    visualElement,\n                    resetValues,\n                    this.animationValues\n                )\n            }\n\n            // Force a render of this element to apply the transform with all skews and rotations\n            // set to 0.\n            visualElement.render()\n\n            // Put back all the values we reset\n            for (const key in resetValues) {\n                visualElement.setStaticValue(key, resetValues[key])\n                if (this.animationValues) {\n                    this.animationValues[key] = resetValues[key]\n                }\n            }\n\n            // Schedule a render for the next frame. This ensures we won't visually\n            // see the element with the reset rotate value applied.\n            visualElement.scheduleRender()\n        }\n\n        applyProjectionStyles(\n            targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n            styleProp?: MotionStyle\n        ) {\n            if (!this.instance || this.isSVG) return\n\n            const lead = this.getLead()\n\n            /**\n             * Without crossfade, a new lead hides the previous one, as it's\n             * usually unmounting. One that gave its layoutId away keeps\n             * rendering, so only hide nodes that follow another.\n             */\n            if (!this.isVisible && lead !== this) {\n                targetStyle.visibility = \"hidden\"\n                return\n            }\n\n            const transformTemplate = this.getTransformTemplate()\n\n            if (this.needsReset) {\n                this.needsReset = false\n\n                targetStyle.visibility = \"\"\n                targetStyle.opacity = \"\"\n                targetStyle.pointerEvents =\n                    resolveMotionValue(styleProp?.pointerEvents) || \"\"\n                targetStyle.transform = transformTemplate\n                    ? transformTemplate(this.latestValues, \"\")\n                    : \"none\"\n                return\n            }\n\n            if (!this.projectionDelta || !this.layout || !lead.target) {\n                if (this.options.layoutId || this.needsShow) {\n                    this.needsShow = false\n                    targetStyle.visibility = \"\"\n                    targetStyle.opacity =\n                        this.latestValues.opacity !== undefined\n                            ? this.latestValues.opacity\n                            : 1\n                    targetStyle.pointerEvents =\n                        resolveMotionValue(styleProp?.pointerEvents) || \"\"\n                }\n                if (this.hasProjected && !hasTransform(this.latestValues)) {\n                    targetStyle.transform = transformTemplate\n                        ? transformTemplate({}, \"\")\n                        : \"none\"\n                    this.hasProjected = false\n                }\n\n                return\n            }\n\n            targetStyle.visibility = \"\"\n\n            const valuesToRender = lead.animationValues || lead.latestValues\n            this.applyTransformsToTarget()\n\n            let transform = buildProjectionTransform(\n                this.projectionDeltaWithTransform!,\n                this.treeScale,\n                valuesToRender\n            )\n\n            if (transformTemplate) {\n                transform = transformTemplate(valuesToRender, transform)\n            }\n\n            targetStyle.transform = transform\n\n            const { x, y } = this.projectionDelta\n            targetStyle.transformOrigin = `${x.origin * 100}% ${\n                y.origin * 100\n            }% 0`\n\n            if (lead.animationValues) {\n                /**\n                 * If the lead component is animating, assign this either the entering/leaving\n                 * opacity\n                 */\n                targetStyle.opacity =\n                    lead === this\n                        ? valuesToRender.opacity ??\n                          this.latestValues.opacity ??\n                          1\n                        : this.preserveOpacity\n                        ? this.latestValues.opacity\n                        : valuesToRender.opacityExit\n            } else {\n                /**\n                 * Or we're not animating at all, set the lead component to its layout\n                 * opacity and other components to hidden.\n                 */\n                targetStyle.opacity =\n                    lead === this\n                        ? valuesToRender.opacity !== undefined\n                            ? valuesToRender.opacity\n                            : \"\"\n                        : valuesToRender.opacityExit !== undefined\n                        ? valuesToRender.opacityExit\n                        : 0\n            }\n\n            /**\n             * Apply scale correction\n             */\n            for (const key in scaleCorrectors) {\n                if (valuesToRender[key] === undefined) continue\n\n                const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n                /**\n                 * Only apply scale correction to the value if we have an\n                 * active projection transform. Otherwise these values become\n                 * vulnerable to distortion if the element changes size without\n                 * a corresponding layout animation.\n                 */\n                const corrected =\n                    transform === \"none\"\n                        ? valuesToRender[key]\n                        : correct(valuesToRender[key], lead)\n\n                if (applyTo) {\n                    const num = applyTo.length\n                    for (let i = 0; i < num; i++) {\n                        targetStyle[applyTo[i] as any] = corrected\n                    }\n                } else {\n                    // If this is a CSS variable, set it directly on the instance.\n                    // Replacing this function from creating styles to setting them\n                    // would be a good place to remove per frame object creation\n                    if (isCSSVariable) {\n                        ;(\n                            this.options.visualElement as HTMLVisualElement\n                        ).renderState.vars[key] = corrected\n                    } else {\n                        targetStyle[key as any] = corrected\n                    }\n                }\n            }\n\n            /**\n             * Disable pointer events on follow components. This is to ensure\n             * that if a follow component covers a lead component it doesn't block\n             * pointer events on the lead.\n             */\n            if (this.options.layoutId) {\n                targetStyle.pointerEvents =\n                    lead === this\n                        ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n                        : \"none\"\n            }\n        }\n\n        clearSnapshot() {\n            this.resumeFrom =\n                this.snapshot =\n                this.dragSnapshot =\n                this.dragAncestor =\n                    undefined\n        }\n\n        // Only run on root\n        resetTree() {\n            this.root.nodes!.forEach((node: IProjectionNode) =>\n                node.currentAnimation?.stop()\n            )\n            this.root.nodes!.forEach(clearMeasurements)\n            this.root.sharedNodes.clear()\n        }\n    }\n}\n\n/**\n * Nodes are depth-ordered, so a dragged ancestor's layout is updated before\n * its descendants'.\n */\nfunction updateLayout(node: IProjectionNode) {\n    node.updateLayout()\n    followDraggedAncestor(node)\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n    const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n    if (\n        node.isLead() &&\n        node.layout &&\n        snapshot &&\n        node.hasListeners(\"didUpdate\")\n    ) {\n        const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n        const { animationType } = node.options\n\n        const isShared = snapshot.source !== node.layout.source\n\n        // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n        // animations for instance if layout=\"size\" and an element has only changed position\n        const resizeSnapshot = (box: Box, to: Box) => {\n            if (animationType === \"size\") {\n                eachAxis((axis) => {\n                    const length = calcLength(box[axis])\n                    box[axis].min = to[axis].min\n                    box[axis].max = box[axis].min + length\n                })\n            } else if (animationType === \"x\" || animationType === \"y\") {\n                const snapAxis = animationType === \"x\" ? \"y\" : \"x\"\n                copyAxisInto(box[snapAxis], to[snapAxis])\n            } else if (\n                shouldAnimatePositionOnly(\n                    animationType,\n                    snapshot.layoutBox,\n                    layout\n                )\n            ) {\n                eachAxis((axis) => {\n                    const length = calcLength(to[axis])\n                    box[axis].max = box[axis].min + length\n\n                    /**\n                     * Ensure relative target gets resized and rerendererd\n                     */\n                    if (node.relativeTarget && !node.currentAnimation) {\n                        node.isProjectionDirty = true\n                        node.relativeTarget[axis].max =\n                            node.relativeTarget[axis].min + length\n                    }\n                })\n            }\n        }\n\n        const snapshotBox = isShared ? snapshot.measuredBox : snapshot.layoutBox\n        resizeSnapshot(snapshotBox, layout)\n\n        const layoutDelta = createDelta()\n\n        calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n        const visualDelta = createDelta()\n        calcBoxDelta(\n            visualDelta,\n            isShared ? node.applyTransform(measuredLayout, true) : layout,\n            snapshotBox\n        )\n\n        const hasLayoutChanged = !isDeltaZero(layoutDelta)\n        let hasRelativeLayoutChanged = false\n\n        const relativeParent = node.getClosestProjectingParent()\n\n        /**\n         * A snapshot from another element is only relative to this node's\n         * relativeParent if it's a layoutRoot that contains both. A node can\n         * hold one without resumeFrom, when the element it came from changed\n         * layoutId but stayed mounted (see switchLayoutId), or a remix\n         * layout exit cleared it (see markLayoutExit).\n         */\n        if (\n            !isShared ||\n            (relativeParent?.options.layoutRoot &&\n                node.resumeFrom?.path.includes(relativeParent))\n        ) {\n            /**\n             * If the relativeParent is itself resuming from a different element then\n             * the relative snapshot is not relavent\n             */\n            if (relativeParent && !relativeParent.resumeFrom) {\n                const { snapshot: parentSnapshot, layout: parentLayout } =\n                    relativeParent\n\n                if (parentSnapshot && parentLayout) {\n                    const anchor = node.options.layoutAnchor || undefined\n\n                    /**\n                     * A shared snapshot includes the transforms of the old\n                     * element's ancestors below the layoutRoot, as they\n                     * aren't shared with the new element.\n                     */\n                    const relativeSnapshot = createBox()\n                    calcRelativePosition(\n                        relativeSnapshot,\n                        isShared\n                            ? node.resumeFrom!.applyTransform(\n                                  snapshot.layoutBox,\n                                  true,\n                                  undefined,\n                                  true,\n                                  relativeParent.depth + 1\n                              )\n                            : snapshot.layoutBox,\n                        parentSnapshot.layoutBox,\n                        anchor\n                    )\n\n                    const relativeLayout = createBox()\n                    calcRelativePosition(\n                        relativeLayout,\n                        layout,\n                        parentLayout.layoutBox,\n                        anchor\n                    )\n\n                    /**\n                     * A shared snapshot is resized in page space, above, so\n                     * resize it relative to the layoutRoot too.\n                     */\n                    isShared && resizeSnapshot(relativeSnapshot, relativeLayout)\n\n                    if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n                        hasRelativeLayoutChanged = true\n                    }\n\n                    if (relativeParent.options.layoutRoot) {\n                        node.relativeTarget = relativeLayout\n                        node.relativeTargetOrigin = relativeSnapshot\n                        node.relativeParent = relativeParent\n                    }\n                }\n            }\n        }\n\n        node.notifyListeners(\"didUpdate\", {\n            layout,\n            snapshot,\n            delta: visualDelta,\n            layoutDelta,\n            hasLayoutChanged,\n            hasRelativeLayoutChanged,\n        })\n    } else if (node.isLead()) {\n        node.options.onExitComplete?.()\n    }\n\n    /**\n     * Clearing transition\n     * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n     * and why we need it at all\n     */\n    node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n    /**\n     * Increase debug counter for nodes encountered this frame\n     */\n    statsBuffer.countProjection?.(0) // nodes\n\n    if (!node.parent) return\n\n    /**\n     * If this node isn't projecting, propagate isProjectionDirty. It will have\n     * no performance impact but it will allow the next child that *is* projecting\n     * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n     * correcting.\n     */\n    if (!node.isProjecting()) {\n        node.isProjectionDirty = node.parent.isProjectionDirty\n    }\n\n    /**\n     * Propagate isSharedProjectionDirty and isTransformDirty\n     * throughout the whole tree. A future revision can take another look at\n     * this but for safety we still recalcualte shared nodes.\n     */\n    node.isSharedProjectionDirty ||= Boolean(\n        node.isProjectionDirty ||\n            node.parent.isProjectionDirty ||\n            node.parent.isSharedProjectionDirty\n    )\n\n    node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n    node.isProjectionDirty =\n        node.isSharedProjectionDirty =\n        node.isTransformDirty =\n            false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n    node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n    node.clearMeasurements()\n}\n\nfunction forceLayoutMeasure(node: IProjectionNode) {\n    node.isLayoutDirty = true\n    node.updateLayout()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n    node.isLayoutDirty = false\n}\n\n/**\n * A dragged node doesn't layout animate, so it jumps to its new layout. Shift\n * its descendants' snapshots by the same amount, so they only animate layout\n * changes relative to it, rather than lagging behind.\n *\n * If its drag ended since the snapshot (e.g. drag disabled from onDrag), it\n * layout animates again, so its descendants mustn't follow its jump.\n */\nfunction followDraggedAncestor(node: IProjectionNode) {\n    const { snapshot, dragAncestor } = node\n    const to = dragAncestor?.isAnimationBlocked && dragAncestor.layout\n    if (!snapshot || !to || node.resumeFrom || node.isAnimationBlocked) return\n\n    const from = dragAncestor!.dragSnapshot!\n    eachAxis((axis) =>\n        translateAxis(\n            snapshot.layoutBox[axis],\n            to.layoutBox[axis].min - from.layoutBox[axis].min\n        )\n    )\n}\n\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node: IProjectionNode) {\n    if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n        node.snapshot = node.dragSnapshot || node.layout\n        node.isLayoutDirty = true\n    }\n}\n\n/**\n * If a node's relative parent is about to be re-measured but the node isn't\n * (e.g. it's in another LayoutGroup), its relative target is out of date.\n * If it's layout animating, re-measure it too, so its relative target keeps\n * resolving against current layouts. Otherwise its layout is still valid\n * relative to its parent, so drop the relative target, and any targetDelta\n * left over from a finished animation while an ancestor still animates, to be\n * rebuilt from its layout.\n */\nfunction syncRelativeLayout(node: IProjectionNode) {\n    if (node.relativeTarget && node.relativeParent?.isLayoutDirty) {\n        if (node.currentAnimation) {\n            node.isLayoutDirty = true\n        } else {\n            node.targetDelta = undefined\n            node.removeRelativeTarget()\n        }\n    }\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n    const { visualElement } = node.options\n    if (visualElement?.getProps().onBeforeLayoutMeasure) {\n        visualElement.notify(\"BeforeLayoutMeasure\")\n    }\n\n    node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n    node.finishAnimation()\n    node.targetDelta = node.relativeTarget = node.target = undefined\n    node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n    node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n    node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n    node.resetSkewAndRotation()\n}\n\n/**\n * Build an axis delta that moves the layout's edges by these offsets (px).\n */\nfunction edgesToDelta(\n    output: AxisDelta,\n    delta: AxisDelta,\n    layout: Axis,\n    min: number,\n    max: number\n) {\n    const length = layout.max - layout.min\n    const scale = length ? Math.max(0, (length + max - min) / length) : 1\n    const origin = (output.originPoint = delta.originPoint)\n    output.origin = delta.origin\n    output.scale = scale\n    output.translate =\n        layout.min + min - (origin + (layout.min - origin) * scale)\n}\n\nfunction mixAxisDeltaLinear(output: AxisDelta, delta: AxisDelta, p: number) {\n    output.translate = mixNumber(delta.translate, 0, p)\n    output.scale = mixNumber(delta.scale, 1, p)\n    output.origin = delta.origin\n    output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n    output.min = mixNumber(from.min, to.min, p)\n    output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n    mixAxis(output.x, from.x, to.x, p)\n    mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n    return node.animationValues?.opacityExit !== undefined\n}\n\nconst defaultLayoutTransition = {\n    duration: 0.45,\n    ease: [0.4, 0, 0.1, 1],\n}\n\n/**\n * Align an axis to the start of another, keeping the length of a layout axis.\n * The length is read first, as output can be the layout axis itself.\n */\nfunction alignAxis(output: Axis, from: Axis, layout: Axis) {\n    output.max = calcLength(layout) + (output.min = from.min)\n}\n\nfunction shouldAnimatePositionOnly(\n    animationType: string | undefined,\n    snapshot: Box,\n    layout: Box\n) {\n    return (\n        animationType === \"position\" ||\n        (animationType === \"preserve-aspect\" &&\n            !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n    )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n    return node !== node.root && node.scroll?.wasRoot\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA;;AAEG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC;AAEnD;;;AAGG;AACH,MAAM,eAAe,GAAG,IAAI;AAE5B,IAAI,EAAE,GAAG,CAAC;AAEV,SAAS,wBAAwB,CAC7B,GAAW,EACX,aAA4B,EAC5B,MAAsB,EACtB,qBAAsC,EAAA;AAEtC,IAAA,MAAM,EAAE,YAAY,EAAE,GAAG,aAAa;;AAGtC,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC;AAC/B,QAAA,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC;QACpC,IAAI,qBAAqB,EAAE;AACvB,YAAA,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC;QAClC;IACJ;AACJ;AAEA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAqB,KAC3C,IAAI,CAAC,QAAQ;IACb,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE;IAC5C,IAAI,CAAC,oBAAoB,EAAE;AAE/B,SAAS,sCAAsC,CAC3C,cAA+B,EAAA;AAE/B,IAAA,cAAc,CAA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