{"ast":null,"code":"import { useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nfunction createUseRender() {\n  let forwardMotionProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n  const useRender = (Component, props, ref, _ref, isStatic) => {\n    let {\n      latestValues\n    } = _ref;\n    const useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps;\n    const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n    const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n    const elementProps = {\n      ...filteredProps,\n      ...visualProps,\n      ref\n    };\n    /**\n     * If component has been handed a motion value as its child,\n     * memoise its initial value and render that. Subsequent updates\n     * will be handled by the onChange handler\n     */\n    const {\n      children\n    } = props;\n    const renderedChildren = useMemo(() => isMotionValue(children) ? children.get() : children, [children]);\n    return createElement(Component, {\n      ...elementProps,\n      children: renderedChildren\n    });\n  };\n  return useRender;\n}\nexport { createUseRender };","map":{"version":3,"names":["useMemo","createElement","useHTMLProps","filterProps","isSVGComponent","useSVGProps","isMotionValue","createUseRender","forwardMotionProps","arguments","length","undefined","useRender","Component","props","ref","_ref","isStatic","latestValues","useVisualProps","visualProps","filteredProps","elementProps","children","renderedChildren","get"],"sources":["/opt/bitnami/minigames/frasle/node_modules/framer-motion/dist/es/render/dom/use-render.mjs"],"sourcesContent":["import { useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction createUseRender(forwardMotionProps = false) {\n    const useRender = (Component, props, ref, { latestValues }, isStatic) => {\n        const useVisualProps = isSVGComponent(Component)\n            ? useSVGProps\n            : useHTMLProps;\n        const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n        const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n        const elementProps = {\n            ...filteredProps,\n            ...visualProps,\n            ref,\n        };\n        /**\n         * If component has been handed a motion value as its child,\n         * memoise its initial value and render that. Subsequent updates\n         * will be handled by the onChange handler\n         */\n        const { children } = props;\n        const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n        return createElement(Component, {\n            ...elementProps,\n            children: renderedChildren,\n        });\n    };\n    return useRender;\n}\n\nexport { createUseRender };\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,aAAa,QAAQ,OAAO;AAC9C,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAAQ,sBAAsB;AAClD,SAASC,aAAa,QAAQ,uCAAuC;AAErE,SAASC,eAAeA,CAAA,EAA6B;EAAA,IAA5BC,kBAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAC/C,MAAMG,SAAS,GAAGA,CAACC,SAAS,EAAEC,KAAK,EAAEC,GAAG,EAAAC,IAAA,EAAoBC,QAAQ,KAAK;IAAA,IAA/B;MAAEC;IAAa,CAAC,GAAAF,IAAA;IACtD,MAAMG,cAAc,GAAGf,cAAc,CAACS,SAAS,CAAC,GAC1CR,WAAW,GACXH,YAAY;IAClB,MAAMkB,WAAW,GAAGD,cAAc,CAACL,KAAK,EAAEI,YAAY,EAAED,QAAQ,EAAEJ,SAAS,CAAC;IAC5E,MAAMQ,aAAa,GAAGlB,WAAW,CAACW,KAAK,EAAE,OAAOD,SAAS,KAAK,QAAQ,EAAEL,kBAAkB,CAAC;IAC3F,MAAMc,YAAY,GAAG;MACjB,GAAGD,aAAa;MAChB,GAAGD,WAA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