{"ast":null,"code":"import { __read } from 'tslib';\nimport { useEffect, useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.js';\nimport { usePresence } from '../../components/AnimatePresence/use-presence.js';\nimport { PresenceContext } from '../../context/PresenceContext.js';\nimport { createAnimationState } from '../../render/utils/animation-state.js';\nimport { AnimationType } from '../../render/utils/types.js';\nimport { makeRenderlessComponent } from '../utils/make-renderless-component.js';\nvar animations = {\n  animation: makeRenderlessComponent(function (_a) {\n    var visualElement = _a.visualElement,\n      animate = _a.animate;\n    /**\n     * We dynamically generate the AnimationState manager as it contains a reference\n     * to the underlying animation library. We only want to load that if we load this,\n     * so people can optionally code split it out using the `m` component.\n     */\n    visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement));\n    /**\n     * Subscribe any provided AnimationControls to the component's VisualElement\n     */\n    if (isAnimationControls(animate)) {\n      useEffect(function () {\n        return animate.subscribe(visualElement);\n      }, [animate]);\n    }\n  }),\n  exit: makeRenderlessComponent(function (props) {\n    var custom = props.custom,\n      visualElement = props.visualElement;\n    var _a = __read(usePresence(), 2),\n      isPresent = _a[0],\n      onExitComplete = _a[1];\n    var presenceContext = useContext(PresenceContext);\n    useEffect(function () {\n      var _a, _b;\n      var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, {\n        custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom\n      });\n      !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(onExitComplete));\n    }, [isPresent]);\n  })\n};\nexport { animations };","map":{"version":3,"names":["__read","useEffect","useContext","isAnimationControls","usePresence","PresenceContext","createAnimationState","AnimationType","makeRenderlessComponent","animations","animation","_a","visualElement","animate","animationState","subscribe","exit","props","custom","isPresent","onExitComplete","presenceContext","_b","setActive","Exit","then"],"sources":["C:/ldt/LDT/management/node_modules/framer-motion/dist/es/motion/features/animations.js"],"sourcesContent":["import { __read } from 'tslib';\nimport { useEffect, useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.js';\nimport { usePresence } from '../../components/AnimatePresence/use-presence.js';\nimport { PresenceContext } from '../../context/PresenceContext.js';\nimport { createAnimationState } from '../../render/utils/animation-state.js';\nimport { AnimationType } from '../../render/utils/types.js';\nimport { makeRenderlessComponent } from '../utils/make-renderless-component.js';\n\nvar animations = {\n    animation: makeRenderlessComponent(function (_a) {\n        var visualElement = _a.visualElement, animate = _a.animate;\n        /**\n         * We dynamically generate the AnimationState manager as it contains a reference\n         * to the underlying animation library. We only want to load that if we load this,\n         * so people can optionally code split it out using the `m` component.\n         */\n        visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement));\n        /**\n         * Subscribe any provided AnimationControls to the component's VisualElement\n         */\n        if (isAnimationControls(animate)) {\n            useEffect(function () { return animate.subscribe(visualElement); }, [animate]);\n        }\n    }),\n    exit: makeRenderlessComponent(function (props) {\n        var custom = props.custom, visualElement = props.visualElement;\n        var _a = __read(usePresence(), 2), isPresent = _a[0], onExitComplete = _a[1];\n        var presenceContext = useContext(PresenceContext);\n        useEffect(function () {\n            var _a, _b;\n            var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom });\n            !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(onExitComplete));\n        }, [isPresent]);\n    }),\n};\n\nexport { animations };\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,QAAQ,OAAO;AAC7C,SAASC,mBAAmB,QAAQ,gDAAgD;AACpF,SAASC,WAAW,QAAQ,kDAAkD;AAC9E,SAASC,eAAe,QAAQ,kCAAkC;AAClE,SAASC,oBAAoB,QAAQ,uCAAuC;AAC5E,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SAASC,uBAAu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