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,QACX,SAAU,QAEd,EAAW,yBAA2B,0BAC/B,CACX,CA7CiB,CA6Cf,MAAM,WAEJ,UAAa,SAAU,GAEvB,SAAS,IACL,OAAkB,OAAX,GAAmB,EAAO,MAAM,KAAM,YAAc,IAC/D,CAOA,OAVA,QAAQ,UAAU,EAAW,GAI7B,EAAU,UAAU,OAAS,WACzB,OAAO,MAAM,cAAc,WAAY,QAAQ,SAAS,CAAC,EAAG,KAAK,OACrE,EACA,EAAU,aAAe,CACrB,UAAU,GAEP,CACX,CAZgB,CAYd,MAAM,WAER,QAAQ,QAAU,MAClB,QAAQ,WAAa,WACrB,QAAQ,UAAY","file":"/npm/@bonobolabs/react-pose@4.1.3/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@bonobolabs/react-pose@4.1.3/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar tslib_1 = require('tslib');\nvar React = require('react');\nvar React__default = _interopDefault(React);\nvar poseFactory = _interopDefault(require('popmotion-pose'));\nvar isValidProp = _interopDefault(require('@emotion/is-prop-valid'));\nvar heyListen = require('hey-listen');\n\nvar hasChanged = function (prev, next) {\r\n    if (prev === next)\r\n        return false;\r\n    var prevIsArray = Array.isArray(prev);\r\n    var nextIsArray = Array.isArray(next);\r\n    if (prevIsArray !== nextIsArray || (!prevIsArray && !nextIsArray)) {\r\n        return true;\r\n    }\r\n    else if (prevIsArray && nextIsArray) {\r\n        var numPrev = prev.length;\r\n        var numNext = next.length;\r\n        if (numPrev !== numNext)\r\n            return true;\r\n        for (var i = 0; i < numPrev; i++) {\r\n            if (prev[i] !== next[i])\r\n                return true;\r\n        }\r\n    }\r\n    return false;\r\n};\n\nvar pickAssign = function (shouldPick, sources) {\r\n    return sources.reduce(function (picked, source) {\r\n        for (var key in source) {\r\n            if (shouldPick(key)) {\r\n                picked[key] = source[key];\r\n            }\r\n        }\r\n        return picked;\r\n    }, {});\r\n};\n\nvar _a = React.createContext({}), PoseParentConsumer = _a.Consumer, PoseParentProvider = _a.Provider;\r\nvar calcPopFromFlowStyle = function (el) {\r\n    var offsetTop = el.offsetTop, offsetLeft = el.offsetLeft, offsetWidth = el.offsetWidth, offsetHeight = el.offsetHeight;\r\n    return {\r\n        position: 'absolute',\r\n        top: offsetTop,\r\n        left: offsetLeft,\r\n        width: offsetWidth,\r\n        height: offsetHeight\r\n    };\r\n};\r\nvar hasPose = function (pose, key) {\r\n    return Array.isArray(pose) ? pose.indexOf(key) !== -1 : pose === key;\r\n};\r\nvar objectToMap = function (obj) {\r\n    return Object.keys(obj).reduce(function (map, key) {\r\n        map.set(key, { raw: obj[key] });\r\n        return map;\r\n    }, new Map());\r\n};\r\nvar testAlwaysTrue = function () { return true; };\r\nvar filterProps = function (_a) {\r\n    var elementType = _a.elementType, poseConfig = _a.poseConfig, onValueChange = _a.onValueChange, innerRef = _a.innerRef, _pose = _a._pose, pose = _a.pose, initialPose = _a.initialPose, poseKey = _a.poseKey, onPoseComplete = _a.onPoseComplete, getParentPoseConfig = _a.getParentPoseConfig, registerChild = _a.registerChild, onUnmount = _a.onUnmount, getInitialPoseFromParent = _a.getInitialPoseFromParent, popFromFlow = _a.popFromFlow, values = _a.values, parentValues = _a.parentValues, onDragStart = _a.onDragStart, onDragEnd = _a.onDragEnd, onPressStart = _a.onPressStart, onPressEnd = _a.onPressEnd, props = tslib_1.__rest(_a, [\"elementType\", \"poseConfig\", \"onValueChange\", \"innerRef\", \"_pose\", \"pose\", \"initialPose\", \"poseKey\", \"onPoseComplete\", \"getParentPoseConfig\", \"registerChild\", \"onUnmount\", \"getInitialPoseFromParent\", \"popFromFlow\", \"values\", \"parentValues\", \"onDragStart\", \"onDragEnd\", \"onPressStart\", \"onPressEnd\"]);\r\n    return props;\r\n};\r\nvar PoseElement = (function (_super) {\r\n    tslib_1.__extends(PoseElement, _super);\r\n    function PoseElement(props) {\r\n        var _this = _super.call(this, props) || this;\r\n        _this.children = new Set();\r\n        _this.childrenHandlers = {\r\n            registerChild: function (props) {\r\n                _this.children.add(props);\r\n                if (_this.poser)\r\n                    _this.flushChildren();\r\n            },\r\n            onUnmount: function (child) { return _this.poser.removeChild(child); },\r\n            getParentPoseConfig: function () { return _this.poseConfig; },\r\n            getInitialPoseFromParent: function () { return _this.getInitialPose(); }\r\n        };\r\n        _this.setRef = function (ref) {\r\n            heyListen.warning(ref === null || (ref instanceof Element && _this.ref === undefined), 'ref must be provided to the same DOM component for the entire lifecycle of a posed component.');\r\n            _this.ref = ref;\r\n            var innerRef = _this.props.innerRef;\r\n            if (!innerRef)\r\n                return;\r\n            if (typeof innerRef === 'function') {\r\n                innerRef(ref);\r\n            }\r\n            else {\r\n                innerRef.current = ref;\r\n            }\r\n        };\r\n        _this.shouldForwardProp =\r\n            typeof _this.props.elementType === 'string' ? isValidProp : testAlwaysTrue;\r\n        var poseConfig = _this.props.poseConfig;\r\n        _this.poseConfig =\r\n            typeof poseConfig === 'function'\r\n                ? poseConfig(filterProps(props))\r\n                : poseConfig;\r\n        return _this;\r\n    }\r\n    PoseElement.prototype.getInitialPose = function () {\r\n        var _a = this.props, getInitialPoseFromParent = _a.getInitialPoseFromParent, pose = _a.pose, _pose = _a._pose, initialPose = _a.initialPose;\r\n        if (initialPose) {\r\n            return initialPose;\r\n        }\r\n        else {\r\n            var parentPose = getInitialPoseFromParent && getInitialPoseFromParent();\r\n            var initialPoses = (Array.isArray(parentPose)\r\n                ? parentPose\r\n                : [parentPose])\r\n                .concat(pose, _pose)\r\n                .filter(Boolean);\r\n            return initialPoses.length > 0 ? initialPoses : undefined;\r\n        }\r\n    };\r\n    PoseElement.prototype.getFirstPose = function () {\r\n        var _a = this.props, initialPose = _a.initialPose, pose = _a.pose, _pose = _a._pose;\r\n        if (!initialPose)\r\n            return;\r\n        var firstPose = (Array.isArray(pose) ? pose : [pose])\r\n            .concat(_pose)\r\n            .filter(Boolean);\r\n        return firstPose.length === 1 ? firstPose[0] : firstPose;\r\n    };\r\n    PoseElement.prototype.getSetProps = function () {\r\n        var props = filterProps(this.props);\r\n        if (this.props.popFromFlow && this.ref && this.ref instanceof HTMLElement) {\r\n            if (!this.popStyle) {\r\n                props.style = tslib_1.__assign({}, props.style, calcPopFromFlowStyle(this.ref));\r\n                this.popStyle = props.style;\r\n            }\r\n            else {\r\n                props.style = this.popStyle;\r\n            }\r\n        }\r\n        else {\r\n            this.popStyle = null;\r\n        }\r\n        return props;\r\n    };\r\n    PoseElement.prototype.componentDidMount = function () {\r\n        var _this = this;\r\n        heyListen.invariant(this.ref instanceof Element, \"No valid DOM ref found. If you're converting an existing component via posed(Component), you must ensure you're passing the ref to the host DOM node via the React.forwardRef function.\");\r\n        var _a = this.props, onValueChange = _a.onValueChange, registerChild = _a.registerChild, values = _a.values, parentValues = _a.parentValues, onDragStart = _a.onDragStart, onDragEnd = _a.onDragEnd, onPressStart = _a.onPressStart, onPressEnd = _a.onPressEnd;\r\n        var config = tslib_1.__assign({}, this.poseConfig, { initialPose: this.getInitialPose(), values: values || this.poseConfig.values, parentValues: parentValues ? objectToMap(parentValues) : undefined, props: this.getSetProps(), onDragStart: onDragStart,\r\n            onDragEnd: onDragEnd,\r\n            onPressStart: onPressStart,\r\n            onPressEnd: onPressEnd, onChange: onValueChange });\r\n        if (!registerChild) {\r\n            this.initPoser(poseFactory(this.ref, config));\r\n        }\r\n        else {\r\n            registerChild({\r\n                element: this.ref,\r\n                poseConfig: config,\r\n                onRegistered: function (poser) { return _this.initPoser(poser); }\r\n            });\r\n        }\r\n    };\r\n    PoseElement.prototype.getSnapshotBeforeUpdate = function () {\r\n        var _a = this.props, pose = _a.pose, _pose = _a._pose;\r\n        if (hasPose(pose, 'flip') || hasPose(_pose, 'flip'))\r\n            this.poser.measure();\r\n        return null;\r\n    };\r\n    PoseElement.prototype.componentDidUpdate = function (prevProps) {\r\n        var _a = this.props, pose = _a.pose, _pose = _a._pose, poseKey = _a.poseKey;\r\n        this.poser.setProps(this.getSetProps());\r\n        if (poseKey !== prevProps.poseKey ||\r\n            hasChanged(prevProps.pose, pose) ||\r\n            pose === 'flip') {\r\n            this.setPose(pose);\r\n        }\r\n        if (_pose !== prevProps._pose || _pose === 'flip')\r\n            this.setPose(_pose);\r\n    };\r\n    PoseElement.prototype.componentWillUnmount = function () {\r\n        if (!this.poser)\r\n            return;\r\n        var onUnmount = this.props.onUnmount;\r\n        if (onUnmount)\r\n            onUnmount(this.poser);\r\n        this.poser.destroy();\r\n    };\r\n    PoseElement.prototype.initPoser = function (poser) {\r\n        this.poser = poser;\r\n        this.flushChildren();\r\n        var firstPose = this.getFirstPose();\r\n        if (firstPose)\r\n            this.setPose(firstPose);\r\n    };\r\n    PoseElement.prototype.setPose = function (pose) {\r\n        var _this = this;\r\n        var onPoseComplete = this.props.onPoseComplete;\r\n        var poseList = Array.isArray(pose) ? pose : [pose];\r\n        Promise.all(poseList.map(function (key) { return key && _this.poser.set(key); })).then(function () { return onPoseComplete && onPoseComplete(pose); });\r\n    };\r\n    PoseElement.prototype.flushChildren = function () {\r\n        var _this = this;\r\n        this.children.forEach(function (_a) {\r\n            var element = _a.element, poseConfig = _a.poseConfig, onRegistered = _a.onRegistered;\r\n            return onRegistered(_this.poser.addChild(element, poseConfig));\r\n        });\r\n        this.children.clear();\r\n    };\r\n    PoseElement.prototype.render = function () {\r\n        var elementType = this.props.elementType;\r\n        return (React__default.createElement(PoseParentProvider, { value: this.childrenHandlers }, React.createElement(elementType, pickAssign(this.shouldForwardProp, [\r\n            this.getSetProps(),\r\n            { ref: this.setRef }\r\n        ]))));\r\n    };\r\n    return PoseElement;\r\n}(React.PureComponent));\n\nvar supportedElements = [\r\n    'a',\r\n    'article',\r\n    'aside',\r\n    'audio',\r\n    'b',\r\n    'blockquote',\r\n    'body',\r\n    'br',\r\n    'button',\r\n    'canvas',\r\n    'caption',\r\n    'cite',\r\n    'code',\r\n    'col',\r\n    'colgroup',\r\n    'data',\r\n    'datalist',\r\n    'dialog',\r\n    'div',\r\n    'em',\r\n    'embed',\r\n    'fieldset',\r\n    'figcaption',\r\n    'figure',\r\n    'footer',\r\n    'form',\r\n    'h1',\r\n    'h2',\r\n    'h3',\r\n    'h4',\r\n    'h5',\r\n    'h6',\r\n    'head',\r\n    'header',\r\n    'hgroup',\r\n    'hr',\r\n    'i',\r\n    'iframe',\r\n    'img',\r\n    'input',\r\n    'label',\r\n    'legend',\r\n    'li',\r\n    'nav',\r\n    'object',\r\n    'ol',\r\n    'option',\r\n    'p',\r\n    'param',\r\n    'picture',\r\n    'pre',\r\n    'progress',\r\n    'q',\r\n    'section',\r\n    'select',\r\n    'span',\r\n    'strong',\r\n    'table',\r\n    'tbody',\r\n    'td',\r\n    'textarea',\r\n    'tfoot',\r\n    'th',\r\n    'thead',\r\n    'time',\r\n    'title',\r\n    'tr',\r\n    'ul',\r\n    'video',\r\n    'circle',\r\n    'clipPath',\r\n    'defs',\r\n    'ellipse',\r\n    'g',\r\n    'image',\r\n    'line',\r\n    'linearGradient',\r\n    'mask',\r\n    'path',\r\n    'pattern',\r\n    'polygon',\r\n    'polyline',\r\n    'radialGradient',\r\n    'rect',\r\n    'stop',\r\n    'svg',\r\n    'text',\r\n    'tspan'\r\n];\n\nvar componentCache = new Map();\r\nvar createComponentFactory = function (key) {\r\n    var componentFactory = function (poseConfig) {\r\n        if (poseConfig === void 0) { poseConfig = {}; }\r\n        return React.forwardRef(function (_a, ref) {\r\n            var _b = _a.withParent, withParent = _b === void 0 ? true : _b, props = tslib_1.__rest(_a, [\"withParent\"]);\r\n            heyListen.warning(props.innerRef === undefined, 'innerRef is deprecated. Please use ref instead.');\r\n            return !withParent || props.parentValues ? (React__default.createElement(PoseElement, tslib_1.__assign({ poseConfig: poseConfig, innerRef: ref, elementType: key }, props))) : (React__default.createElement(PoseParentConsumer, null, function (parentCtx) { return (React__default.createElement(PoseElement, tslib_1.__assign({ poseConfig: poseConfig, elementType: key, innerRef: ref }, props, parentCtx))); }));\r\n        });\r\n    };\r\n    componentCache.set(key, componentFactory);\r\n    return componentFactory;\r\n};\r\nvar getComponentFactory = function (key) {\r\n    return componentCache.has(key)\r\n        ? componentCache.get(key)\r\n        : createComponentFactory(key);\r\n};\r\nvar posed = (function (component) {\r\n    return getComponentFactory(component);\r\n});\r\nsupportedElements.reduce(function (acc, key) {\r\n    acc[key] = createComponentFactory(key);\r\n    return acc;\r\n}, posed);\n\nvar getKey = function (child) {\r\n    heyListen.invariant(child && child.key !== null, 'Every child of Transition must be given a unique key');\r\n    var childKey = typeof child.key === 'number' ? child.key.toString() : child.key;\r\n    return childKey.replace('.$', '');\r\n};\r\nvar prependProps = function (element, props) {\r\n    return React.createElement(element.type, tslib_1.__assign({ key: element.key, ref: element.ref }, props, element.props));\r\n};\r\nvar handleTransition = function (_a, _b) {\r\n    var displayedChildren = _b.displayedChildren, finishedLeaving = _b.finishedLeaving, hasInitialized = _b.hasInitialized, indexedChildren = _b.indexedChildren, scheduleChildRemoval = _b.scheduleChildRemoval;\r\n    var incomingChildren = _a.children, preEnterPose = _a.preEnterPose, enterPose = _a.enterPose, exitPose = _a.exitPose, animateOnMount = _a.animateOnMount, enterAfterExit = _a.enterAfterExit, flipMove = _a.flipMove, onRest = _a.onRest, propsForChildren = tslib_1.__rest(_a, [\"children\", \"preEnterPose\", \"enterPose\", \"exitPose\", \"animateOnMount\", \"enterAfterExit\", \"flipMove\", \"onRest\"]);\r\n    var targetChildren = makeChildList(incomingChildren);\r\n    var nextState = {\r\n        displayedChildren: []\r\n    };\r\n    if (process.env.NODE_ENV !== 'production') {\r\n        heyListen.warning(!propsForChildren.onPoseComplete, \"<Transition/> (or <PoseGroup/>) doesn't accept onPoseComplete prop.\");\r\n    }\r\n    var prevKeys = displayedChildren.map(getKey);\r\n    var nextKeys = targetChildren.map(getKey);\r\n    var hasPropsForChildren = Object.keys(propsForChildren).length !== 0;\r\n    var entering = new Set(nextKeys.filter(function (key) { return finishedLeaving.hasOwnProperty(key) || prevKeys.indexOf(key) === -1; }));\r\n    entering.forEach(function (key) { return delete finishedLeaving[key]; });\r\n    var leaving = [];\r\n    var newlyLeaving = {};\r\n    prevKeys.forEach(function (key) {\r\n        if (entering.has(key)) {\r\n            return;\r\n        }\r\n        var isLeaving = finishedLeaving.hasOwnProperty(key);\r\n        if (!isLeaving && nextKeys.indexOf(key) !== -1) {\r\n            return;\r\n        }\r\n        leaving.push(key);\r\n        if (!isLeaving) {\r\n            finishedLeaving[key] = false;\r\n            newlyLeaving[key] = true;\r\n        }\r\n    });\r\n    var moving = new Set(prevKeys.filter(function (key, i) {\r\n        return !entering.has(key) || leaving.indexOf(key) === -1;\r\n    }));\r\n    targetChildren.forEach(function (child) {\r\n        var newChildProps = {};\r\n        if (entering.has(child.key)) {\r\n            if (hasInitialized || animateOnMount) {\r\n                newChildProps.initialPose = preEnterPose;\r\n            }\r\n            newChildProps._pose = enterPose;\r\n        }\r\n        else if (moving.has(child.key) && flipMove) {\r\n            newChildProps._pose = [enterPose, 'flip'];\r\n        }\r\n        else {\r\n            newChildProps._pose = enterPose;\r\n        }\r\n        var newChild = React.cloneElement(child, newChildProps);\r\n        indexedChildren[child.key] = newChild;\r\n        nextState.displayedChildren.push(hasPropsForChildren ? prependProps(newChild, propsForChildren) : newChild);\r\n    });\r\n    leaving.forEach(function (key) {\r\n        var child = indexedChildren[key];\r\n        var newChild = newlyLeaving[key]\r\n            ? React.cloneElement(child, {\r\n                _pose: exitPose,\r\n                onPoseComplete: function (pose) {\r\n                    if (pose === exitPose)\r\n                        scheduleChildRemoval(key);\r\n                    var onPoseComplete = child.props.onPoseComplete;\r\n                    if (onPoseComplete)\r\n                        onPoseComplete(pose);\r\n                },\r\n                popFromFlow: flipMove\r\n            })\r\n            : child;\r\n        var insertionIndex = prevKeys.indexOf(key);\r\n        indexedChildren[child.key] = newChild;\r\n        nextState.displayedChildren.splice(insertionIndex, 0, hasPropsForChildren ? prependProps(newChild, propsForChildren) : newChild);\r\n    });\r\n    return nextState;\r\n};\r\nvar handleChildrenTransitions = (function (props, state) {\r\n    var newState = handleTransition(props, state);\r\n    newState.hasInitialized = true;\r\n    return newState;\r\n});\r\nvar makeChildList = function (children) {\r\n    var list = [];\r\n    React.Children.forEach(children, function (child) { return child && list.push(child); });\r\n    return list;\r\n};\n\nvar Transition = (function (_super) {\r\n    tslib_1.__extends(Transition, _super);\r\n    function Transition() {\r\n        var _this = _super !== null && _super.apply(this, arguments) || this;\r\n        _this.state = {\r\n            displayedChildren: [],\r\n            finishedLeaving: {},\r\n            hasInitialized: false,\r\n            indexedChildren: {},\r\n            scheduleChildRemoval: function (key) { return _this.removeChild(key); }\r\n        };\r\n        return _this;\r\n    }\r\n    Transition.prototype.removeChild = function (key) {\r\n        var _a = this.state, displayedChildren = _a.displayedChildren, finishedLeaving = _a.finishedLeaving;\r\n        var _b = this.props, enterAfterExit = _b.enterAfterExit, onRest = _b.onRest;\r\n        if (!finishedLeaving.hasOwnProperty(key))\r\n            return;\r\n        finishedLeaving[key] = true;\r\n        if (!Object.keys(finishedLeaving).every(function (leavingKey) { return finishedLeaving[leavingKey]; })) {\r\n            return;\r\n        }\r\n        var targetChildren = displayedChildren.filter(function (child) { return !finishedLeaving.hasOwnProperty(child.key); });\r\n        var newState = enterAfterExit\r\n            ? tslib_1.__assign({ finishedLeaving: {} }, handleChildrenTransitions(tslib_1.__assign({}, this.props, { enterAfterExit: false }), tslib_1.__assign({}, this.state, { displayedChildren: targetChildren }))) : {\r\n            finishedLeaving: {},\r\n            displayedChildren: targetChildren\r\n        };\r\n        this.setState(newState, onRest);\r\n    };\r\n    Transition.prototype.shouldComponentUpdate = function (nextProps, nextState) {\r\n        return this.state !== nextState;\r\n    };\r\n    Transition.prototype.render = function () {\r\n        return this.state.displayedChildren;\r\n    };\r\n    Transition.defaultProps = {\r\n        flipMove: false,\r\n        enterAfterExit: false,\r\n        preEnterPose: 'exit',\r\n        enterPose: 'enter',\r\n        exitPose: 'exit'\r\n    };\r\n    Transition.getDerivedStateFromProps = handleChildrenTransitions;\r\n    return Transition;\r\n}(React.Component));\n\nvar PoseGroup = (function (_super) {\r\n    tslib_1.__extends(PoseGroup, _super);\r\n    function PoseGroup() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    PoseGroup.prototype.render = function () {\r\n        return React.createElement(Transition, tslib_1.__assign({}, this.props));\r\n    };\r\n    PoseGroup.defaultProps = {\r\n        flipMove: true\r\n    };\r\n    return PoseGroup;\r\n}(React.Component));\n\nexports.default = posed;\nexports.Transition = Transition;\nexports.PoseGroup = PoseGroup;\n"]}