{"version":3,"file":"index.mjs","sources":["../src/helpers/domStyleProperties.ts","../src/helpers/getConfig.ts","../src/helpers/getUnits.ts","../src/helpers/handleForwardedRef.ts","../src/helpers/reconciler.ts","../src/springyGroups/childRegisterContext.tsx","../src/SpringyDOMElement.tsx","../src/getSpringyDOMElement.tsx","../src/springyGroups/SpringyRepositionGroup.tsx","../src/springyGroups/SpringyFollowGroup.tsx","../node_modules/babel-plugin-transform-async-to-promises/helpers.js","../src/springyGroups/SpringyRepeater.tsx"],"sourcesContent":["export const TRANSFORM_PROPERTIES = [\n    'scaleX',\n    'scaleY',\n    'scaleZ',\n    'scale',\n    'translate',\n    'translateX',\n    'translateY',\n    'translateZ',\n    'rotate',\n    'rotateX',\n    'rotateY',\n    'rotateZ',\n    'skew',\n    'skewX',\n    'skewY',\n    'perspective'\n];\n\nexport const AUTO_PROPERTIES = [\n    'width',\n    'height',\n    'margin',\n    'top',\n    'right',\n    'bottom',\n    'left'\n];\n\nexport const RESIZE_PROPERTIES = [\n    'width', 'height'\n];\n\nexport const DEFAULT_UNIT_SUFFIXES = {\n    'width': 'px',\n    'height': 'px',\n    'margin': 'px',\n    'top': 'px',\n    'right': 'px',\n    'left': 'px',\n    'bottom': 'px',\n    'padding': 'px',\n    'scaleX': '',\n    'scaleY': '',\n    'scaleZ': '',\n    'scale': '',\n    'translate': 'px',\n    'translateX': 'px',\n    'translateY': 'px',\n    'translateZ': 'px',\n    'rotate': 'deg',\n    'rotateX': 'deg',\n    'rotateY': 'deg',\n    'rotateZ': 'deg',\n    'skew': 'deg',\n    'skewX': '',\n    'skewY': '',\n    'backgroundPosition': 'px',\n    'borderWidth': 'px',\n    'borderBottom-width': 'px',\n    'borderTopWidth': 'px',\n    'borderLeftWidth': 'px',\n    'borderRightWidth': 'px',\n    'lineHeight': 'px',\n    'maxHeight': 'px',\n    'maxHidth': 'px',\n    'minHeight': 'px',\n    'minHidth': 'px',\n    'fontSize': 'px',\n    'fontWeight': '',\n    'markerOffset': 'px',\n    'marginTop': 'px',\n    'marginRight': 'px',\n    'marginBottom': 'px',\n    'marginLeft': 'px',\n    'paddingTop': 'px',\n    'paddingRight': 'px',\n    'paddingBottom': 'px',\n    'paddingLeft': 'px',\n    'outlineWidth': 'px',\n    'letterSpacing': 'px',\n    'textIndent': 'px',\n    'wordSpacing': 'px',\n    'opacity': '',\n    'perspective': 'px'\n};","import {SpringConfig} from 'simple-performant-harmonic-oscillator';\nimport {SpringPropertyConfig} from '../types';\n\nexport default function getConfig(config: SpringPropertyConfig | null | undefined, oldToValue: number, newToValue: number): SpringConfig | null {\n    let springConfig: SpringConfig = {};\n    if(config == null) return springConfig;\n\n    springConfig.speed = config.speed;\n    springConfig.bounciness = config.bounciness;\n\n    if(oldToValue <= newToValue) {\n        const configWhenGettingBigger = config.configWhenGettingBigger;\n        if(configWhenGettingBigger){\n            springConfig.speed = configWhenGettingBigger.speed != null ? configWhenGettingBigger.speed : springConfig.speed;\n            springConfig.bounciness = configWhenGettingBigger.bounciness != null ? configWhenGettingBigger.bounciness : springConfig.bounciness;\n        }\n    }\n    else if(oldToValue > newToValue){\n        const configWhenGettingSmaller = config.configWhenGettingSmaller;\n        if(configWhenGettingSmaller){\n            springConfig.speed = configWhenGettingSmaller.speed != null ? configWhenGettingSmaller.speed : springConfig.speed;\n            springConfig.bounciness = configWhenGettingSmaller.bounciness != null ? configWhenGettingSmaller.bounciness : springConfig.bounciness;\n        }\n    }\n\n    return springConfig;\n}","import {DOMSpringConfigMap} from '../types';\nimport {DEFAULT_UNIT_SUFFIXES} from './domStyleProperties';\n\nexport default function getUnits(configMap: DOMSpringConfigMap, property: string): string {\n\n    return configMap && configMap[property] && configMap[property].units ?\n                configMap[property].units : \n            DEFAULT_UNIT_SUFFIXES[property] != null ?\n                DEFAULT_UNIT_SUFFIXES[property] :\n                '';\n\n\n                \n\n}","import {MutableRefObject} from 'react';\ntype Ref<T> = { bivarianceHack(instance: T | null): void }[\"bivarianceHack\"] | MutableRefObject<T> | null;\n\nexport default function handleForwardedRef<T>(ref: T, forwardedRef: Ref<T>) {\n    if(forwardedRef){\n        if(typeof forwardedRef === 'function') forwardedRef(ref);\n        else if(typeof forwardedRef === 'object' && forwardedRef.hasOwnProperty('current')) forwardedRef.current = ref;\n    }\n}","import transformValuesToTransformCommands from 'transform-values-to-transform-commands';\nimport {TRANSFORM_PROPERTIES} from './domStyleProperties';\nimport {StyleObject} from '../types';\n\nexport default function reconciler(refElement: null | HTMLElement, currentStyle: StyleObject, values: any) {\n    if(refElement == null) return;\n    \n    for(let property in values){\n        if(!TRANSFORM_PROPERTIES.includes(property)){\n            refElement.style[property] = values[property];\n        }\n    }\n\n    refElement.style['transform'] = `${currentStyle.transform || ''} ${transformValuesToTransformCommands(values)}`;\n}","import React from 'react';\nimport SpringyDOMElement from '../SpringyDOMElement';\n\nexport const ChildRegisterContext = React.createContext({\n    registerChild: (child: SpringyDOMElement) => void 0,\n    unregisterChild: (child: SpringyDOMElement) => void 0,\n    registerChildIndex: (child: SpringyDOMElement, index: number) => void 0,\n    unregisterChildIndex: (child: SpringyDOMElement, index: number) => void 0\n});\n\nexport class AbstractChildRegisterProviderClass<T> extends React.PureComponent<T> {\n\n    static contextType = ChildRegisterContext;\n    _registeredChildren: Array<SpringyDOMElement> = [];\n    _orderedChildrenGroups: Array<Array<SpringyDOMElement>> = [];\n\n    registerChild(child: SpringyDOMElement) {\n        if(this._registeredChildren.indexOf(child) === -1) this._registeredChildren.push(child);\n        if(this.context) this.context.registerChild(child);\n    }\n\n    unregisterChild(child: SpringyDOMElement) {\n        const index = this._registeredChildren.indexOf(child);\n        if(index > -1){\n            this._registeredChildren[index] = this._registeredChildren[this._registeredChildren.length - 1];\n            this._registeredChildren.pop();\n        }\n        \n        if(this.context) this.context.unregisterChild(child);\n    }\n\n    registerChildIndex(child: SpringyDOMElement, index: number) {\n        const childrenAtIndex = this._orderedChildrenGroups[index] || [];\n        childrenAtIndex.push(child);\n        this._orderedChildrenGroups[index] = childrenAtIndex;\n        if(this.context) this.context.registerChildIndex(child, index);\n    }\n\n    unregisterChildIndex(child: SpringyDOMElement,  index: number) {\n        const childrenAtIndex = this._orderedChildrenGroups[index];\n        if(childrenAtIndex) {\n            const childIndex = childrenAtIndex.indexOf(child);\n            if(childIndex > -1){\n                childrenAtIndex[childIndex] = childrenAtIndex[childrenAtIndex.length - 1];\n                childrenAtIndex.pop();\n            }\n        }\n\n        if(this.context) this.context.unregisterChildIndex(child, index);\n    }\n\n    render(): React.ReactNode {\n        return (\n            <ChildRegisterContext.Provider value={this}>\n                {this.props.children}\n            </ChildRegisterContext.Provider>\n        );\n    }\n\n}","import React from 'react';\nimport Spring from 'simple-performant-harmonic-oscillator';\nimport decomposeDOMMatrix from 'decompose-dommatrix';\n\nimport {InternalSpringyProps} from './types';\n\nimport {TRANSFORM_PROPERTIES, AUTO_PROPERTIES, RESIZE_PROPERTIES} from './helpers/domStyleProperties';\nimport getConfig from './helpers/getConfig';\nimport getUnits from './helpers/getUnits';\nimport handleForwardedRef from './helpers/handleForwardedRef';\nimport reconciler from './helpers/reconciler';\n\nimport {ChildRegisterContext} from './springyGroups/childRegisterContext';\n\ntype ReconcileScheduler = {\n    values: {[key: string]: string};\n    scheduled?: Promise<void> | null;\n};\n\ntype CustomValueMapper = (value: number) => number;\n\nconst springyDOMMap: Map<string, SpringyDOMElement> = new Map();\n\nexport default class SpringyDOMElement extends React.PureComponent<InternalSpringyProps> {\n\n    static contextType = ChildRegisterContext;\n\n    _reconcileUpdate: ReconcileScheduler = {values: {}};\n    _ref: HTMLElement | null = null;\n    _resizeObserver: ResizeObserver | null = null;\n    _isSecondRender: boolean = false;\n    _needsSecondRender: boolean = false;\n    _springMap: Map<string, Spring> = new Map();\n    _removalBlocked: boolean = false;\n    _transitionOutCloneElement: HTMLElement | null = null;\n\n    render() {\n        const cleanProps = {...this.props} as any;\n        delete (cleanProps as any).forwardedRef;\n        delete (cleanProps as any).ComponentToWrap;\n        delete (cleanProps as any).configMap;\n        delete (cleanProps as any).styleOnExit;\n        delete (cleanProps as any).globalUniqueIDForSpringReuse;\n        delete (cleanProps as any).onSpringyPropertyValueAtRest;\n        delete (cleanProps as any).onSpringyPropertyValueUpdate;\n        delete (cleanProps as any).springyOrderedIndex;\n        delete (cleanProps as any).springyStyle;\n        delete (cleanProps as any).instanceRef;\n\n        if(this.props.globalUniqueIDForSpringReuse){\n            this._checkAndTakeOverExistingSpringyDOM(this.props.globalUniqueIDForSpringReuse);\n        }\n\n        this._processSpringyStyle();\n\n        const ComponentToWrap = this.props.ComponentToWrap;\n\n        return (\n            <ComponentToWrap\n                {...cleanProps}\n                ref={ref => {\n                    this._ref = ref;\n                    handleForwardedRef(ref, this.props.forwardedRef)\n                    if(this.props.instanceRef){\n                        handleForwardedRef(this, this.props.instanceRef);\n                    }\n                }}\n            > {\n                this.props.children && (\n                    <SecondRenderGuard isSecondRender={this._isSecondRender}>\n                        {this.props.children}\n                    </SecondRenderGuard>\n                )\n              }\n            </ComponentToWrap>\n            \n        );\n    }\n\n    componentDidMount(){\n        if(this.context) {\n            this.context.registerChild(this);\n            if(this.props.springyOrderedIndex != null){\n                this.context.registerChildIndex(this, this.props.springyOrderedIndex);\n            }\n        }\n        if(!this._isSecondRender && this._needsSecondRender){\n            this._rerenderToUseTrueSize();\n        }\n    }\n\n    componentDidUpdate(prevProps: InternalSpringyProps){\n        if(this.context){\n            if(prevProps.springyOrderedIndex !== null && prevProps.springyOrderedIndex != this.props.springyOrderedIndex){\n                this.context.unregisterChildIndex(this, prevProps.springyOrderedIndex);\n\n                if(this.props.springyOrderedIndex != null) {\n                    this.context.registerChildIndex(this, this.props.springyOrderedIndex);\n                }\n            }\n        }\n\n        if(!this._isSecondRender && this._needsSecondRender){\n            this._rerenderToUseTrueSize();\n        }\n    }\n\n    componentWillUnmount() {\n        this._killResizeObserver();\n\n        this._handleOnExitIfExists();\n    }\n\n    blockRemoval() {\n        this._removalBlocked = true;\n        return () => {\n            this._removalBlocked = false;\n            if(this._springMap.size === 0 && this._transitionOutCloneElement){\n                this._transitionOutCloneElement.remove();\n                if(this.props.globalUniqueIDForSpringReuse && springyDOMMap.get(this.props.globalUniqueIDForSpringReuse) === this) {\n                    springyDOMMap.delete(this.props.globalUniqueIDForSpringReuse);\n                }\n            }\n        }\n    }\n\n    getSpringForProperty(property: string): Spring | null {\n        return this._springMap.get(property);\n    }\n\n    isUnmounting(): boolean {\n        return Boolean(this._transitionOutCloneElement);\n    }\n\n    setSpringToValueForProperty(property: string, toValue: number | 'auto', overridingFromValue?: number, customValueMapper?: CustomValueMapper) {\n        this._setupOrUpdateSpringForProperty(property, toValue, overridingFromValue);\n\n        if(customValueMapper) {\n            const spring = this.getSpringForProperty(property);\n            if(!spring) throw new Error('spring should have been created');\n            spring.setValueMapper(customValueMapper);\n        }\n    }\n\n    getDOMNode(): HTMLElement | null {\n        return this._ref;\n    }\n\n    _checkAndTakeOverExistingSpringyDOM(globalUniqueIDForSpringReuse) {\n        const existingSpringyDOM = springyDOMMap.get(globalUniqueIDForSpringReuse);\n        if(existingSpringyDOM) {\n            const springMap = existingSpringyDOM._springMap;\n            if(springMap) {\n                for(let [property, spring] of springMap) {\n                    const springClone = spring.clone();\n                    spring.end();\n\n                    this._listenToSpring(springClone, property);\n                }\n            }\n\n            if(existingSpringyDOM._transitionOutCloneElement) existingSpringyDOM._transitionOutCloneElement.remove();\n        }\n        \n        springyDOMMap.set(globalUniqueIDForSpringReuse, this);\n    }\n\n    _processSpringyStyle() {\n        let springyStyle = this.props.springyStyle;\n        const configMap = this.props.configMap;\n        if(!springyStyle && !configMap) {\n            this._killResizeObserver();\n            return;\n        }\n        \n        if(!springyStyle) {\n            springyStyle = {}; // we have a configMap, so we'll have an artificial springyStyle object\n            \n            //put the springyStyle value for this property to the onEnterToValue\n            // we do this BEFORE th flipAutoPropsIfNecessary so that allows the config map\n            // to have \"auto\" as a onEnterToValue value\n            for(let property in configMap){\n                if(configMap[property].onEnterToValue != null){\n                    springyStyle[property] = configMap[property].onEnterToValue;\n                }\n                else if(\n                    (configMap[property].onEnterFromValue != null || configMap[property].onEnterFromValueOffset != null) &&\n                    AUTO_PROPERTIES.includes(property)\n                ){\n                    springyStyle[property] = 'auto'; //default to auto\n                }\n            }                \n        }\n\n        this._dealWithPotentialResizeObserver(springyStyle);\n        this._flipAutoPropsIfNecessary(springyStyle);\n\n        for(let property in springyStyle){\n            this._setupOrUpdateSpringForProperty(property, springyStyle[property]);\n        }\n    }\n\n    _flipAutoPropsIfNecessary(springyStyle: {[key: string]: number | 'auto'}) {\n        const propsThatAreSpringy = Object.keys(springyStyle);\n        const springyPropsThatCanBeAuto = propsThatAreSpringy.filter(property => AUTO_PROPERTIES.includes(property));\n        if (springyPropsThatCanBeAuto.length === 0) return;\n\n        const propsThatAreAuto = \n            Object.keys(springyStyle)\n                    .filter(\n                        property => \n                            springyStyle[property] === 'auto' &&\n                            springyPropsThatCanBeAuto.includes(property)\n                    );\n\n        if(propsThatAreAuto.length === 0) return;\n        if(!this._isSecondRender) {\n            this._needsSecondRender = true;\n            return;\n        }\n\n        if(!this._ref) return;\n\n        // apply latest styles\n        reconciler(this._ref, {...(this.props as any).style}, springyStyle);\n\n        // get the computed styles and clean up\n        const computedStyle = getComputedStyle(this._ref);\n        propsThatAreAuto.forEach(property => {\n            springyStyle[property] = parseFloat(computedStyle.getPropertyValue(property)); //use target value for mutable prop\n        });\n    }\n\n    _setupOrUpdateSpringForProperty(property: string, propValue: number | 'auto', overridingFromValue?: number) {\n        if(propValue == 'auto') return;\n\n        const configMap = this.props.configMap;\n        let spring = this._springMap.get(property);\n\n        const toValue = \n            propValue != null ?\n                propValue :\n                configMap && configMap[property] && configMap[property].onEnterToValue;\n\n        // we don't have a target toValue, then don't do anything\n        if(toValue == null || typeof toValue === 'string') return null;\n\n        // spring has already been initialized and we're just updating values\n        if(spring != null){\n            if(configMap){\n                const config = getConfig(configMap[property], spring.getToValue(), toValue);\n                spring.setBounciness(config.bounciness);\n                spring.setSpeed(config.speed);\n            }\n            \n            spring.setToValue(propValue);\n            if(overridingFromValue != null) spring.setCurrentValue(overridingFromValue);\n        }\n        else {\n            const fromValue = \n                overridingFromValue != null ? overridingFromValue : //if we have an overridingFromValue use that\n                configMap == null || configMap[property] == null ? propValue : // if we don't have a then use propValue\n                configMap[property].onEnterFromValue != null ? configMap[property].onEnterFromValue : // if we have an onEnterFromValue use that\n                configMap[property].onEnterFromValueOffset != null ? // if have an onEnterFromValueOffset use that\n                    propValue + configMap[property].onEnterFromValueOffset : propValue;  // use propValue\n\n            spring = new Spring(\n                configMap ? getConfig(configMap[property], fromValue, toValue) : {},\n                {fromValue, toValue}\n            );\n\n            this._listenToSpring(spring, property);\n\n            if(fromValue === toValue) {\n                this._updateValueForProperty(property, toValue);\n            }\n        }\n    }\n\n    _listenToSpring(spring: Spring, property: string) {\n        spring.onUpdate((value: number) => {\n            this._updateValueForProperty(property, value);\n            if(this.props.onSpringyPropertyValueUpdate) this.props.onSpringyPropertyValueUpdate(property, value);\n        });\n\n        spring.onAtRest((value: number) => {\n            if(this.props.onSpringyPropertyValueAtRest) this.props.onSpringyPropertyValueAtRest(property, value);\n        });\n\n        this._springMap.set(property, spring);\n    }\n\n    _updateValueForProperty(property: string, value: number) {\n        this._reconcileUpdate.values[property] = `${value}${getUnits(this.props.configMap, property)}`;\n\n        if(!this._reconcileUpdate.scheduled){\n            this._reconcileUpdate.scheduled = Promise.resolve().then(() => {\n                reconciler(this._ref, {...(this.props as any).style}, this._reconcileUpdate.values);\n                this._reconcileUpdate.scheduled = null;\n            })\n        }\n    }\n\n    _dealWithPotentialResizeObserver(springyStyle: {[key: string]: number | 'auto'}){\n        if(!this._ref) return;\n        const propsThatAreSpringy = Object.keys(springyStyle);\n        const springyPropsThatCanBeAuto = propsThatAreSpringy.filter(property => AUTO_PROPERTIES.includes(property));\n        const resizableSpringyAutoProperties = springyPropsThatCanBeAuto.filter(property => RESIZE_PROPERTIES.includes(property));\n        if(resizableSpringyAutoProperties.length === 0) {\n            this._killResizeObserver();\n            return;\n        }\n\n        if(this._resizeObserver){\n            //we already have one\n            return;\n        }\n\n        if((window as any).ResizeObserver){\n            this._resizeObserver = new (window as any).ResizeObserver(entries => {\n                const springyStyle = this.props.springyStyle;\n                const propsThatAreAutoAndResizable = \n                    Object.keys(springyStyle)\n                            .filter(\n                                property => \n                                    springyStyle[property] === 'auto' &&\n                                    RESIZE_PROPERTIES.includes(property)\n                            );\n\n                if(propsThatAreAutoAndResizable.length > 0 && !this._isSecondRender && !this._needsSecondRender){\n                    this._rerenderToUseTrueSize();\n                }\n            });\n\n            this._resizeObserver.observe(this._ref);\n        }\n    }\n\n    _rerenderToUseTrueSize() {\n        this._isSecondRender = true;\n        this.forceUpdate(() => {\n            this._needsSecondRender = false;\n            this._isSecondRender = false;\n        });\n    }\n\n    _killResizeObserver(){\n        if(this._resizeObserver){\n            this._resizeObserver.disconnect();\n            this._resizeObserver = null;\n        }\n    }\n\n    _handleOnExitIfExists() {\n        const configMap = this.props.configMap;\n        if(!configMap || !this._ref) return;\n        const propertiesWithOnExitToValue = Object.keys(configMap).filter(property => configMap[property].onExitToValue != null);\n\n        if(propertiesWithOnExitToValue.length === 0) {\n            this._cleanUpSprings();\n            return;\n        }\n\n        const lastStyle = {...(this.props as any).style};\n\n        const clone = this._transitionOutCloneElement = this._ref.cloneNode(true) as HTMLElement; //true = deep clone\n        clone.style.pointerEvents = 'none';\n        this._ref.insertAdjacentElement('beforebegin', clone);\n        this._ref.remove();\n\n        const fromValues = {};\n        const propertiesWithOnExitFromValue = propertiesWithOnExitToValue.filter(property => configMap[property].onExitFromValue != null);\n        const propertiesWithoutOnExitFromValue = propertiesWithOnExitToValue.filter(property => configMap[property].onExitFromValue == null);\n\n        propertiesWithOnExitFromValue.forEach(property => {\n            fromValues[property] = configMap[property].onExitFromValue;\n        });\n\n        const computedStyle = getComputedStyle(clone);\n        //we set width and height to computed value because we're make make the element\n        // position absolute which may change height and width\n        clone.style.width = computedStyle.getPropertyValue('width');\n        clone.style.height = computedStyle.getPropertyValue('height');\n\n        if(this.props.styleOnExit) {\n            let styleOnExit = this.props.styleOnExit;\n            if(typeof styleOnExit === 'function') {\n                styleOnExit = (styleOnExit as any)(clone);\n            }\n            \n            reconciler(clone, lastStyle, styleOnExit);\n        }\n\n        propertiesWithoutOnExitFromValue.filter(property => !TRANSFORM_PROPERTIES.includes(property)).forEach(property => {\n            fromValues[property] = parseFloat(computedStyle.getPropertyValue(property)); //use target value for mutable prop\n        });\n\n        const transformPropertiesWithOnExitValue = propertiesWithoutOnExitFromValue.filter(property => TRANSFORM_PROPERTIES.includes(property));\n        if(transformPropertiesWithOnExitValue.length > 0){\n            const domMatrix = new DOMMatrix(computedStyle.getPropertyValue('transform'));\n            const transformValues = decomposeDOMMatrix(domMatrix);\n            for(let property of transformPropertiesWithOnExitValue){\n                if(property === 'scale'){\n                    fromValues[property] = transformValues.scaleX;\n                }\n                else {\n                    fromValues[property] = transformValues[property];\n                }\n            }\n        }\n\n        clone.insertAdjacentElement('beforebegin', this._ref);\n\n        let existingUpdate: ReconcileScheduler = {values: {}};\n        for(let property of propertiesWithOnExitToValue) {\n            const config =  configMap[property];\n            const springConfig = getConfig(config, fromValues[property], config.onExitToValue);\n            const spring = new Spring(springConfig, {fromValue: fromValues[property], toValue: config.onExitToValue});\n            this._springMap.set(property, spring);\n            \n            spring.onUpdate((value) => {\n                existingUpdate.values[property] = `${value}${getUnits(configMap, property)}`;\n\n                if(!existingUpdate.scheduled){\n                    existingUpdate.scheduled = Promise.resolve().then(() => {\n                        reconciler(clone, lastStyle, existingUpdate.values);\n                        existingUpdate.scheduled = null;\n                    });\n                }\n            });\n\n            const cleanUp = () => {\n                this._springMap.delete(property);\n                spring.end();\n                if(this._springMap.size === 0) {\n                    if(!this._removalBlocked){\n                        clone.remove();\n                        if(this.props.globalUniqueIDForSpringReuse && springyDOMMap.get(this.props.globalUniqueIDForSpringReuse) === this) {\n                            springyDOMMap.delete(this.props.globalUniqueIDForSpringReuse);\n                        }\n                    }\n                    \n                    this._cleanUpSprings();\n                }\n            };\n\n            spring.onAtRest(cleanUp);\n            spring.onEnd(cleanUp);\n        }\n    }\n\n    _cleanUpSprings() {\n        for(let spring of this._springMap.values()) {\n            spring.end();\n        }\n        this._springMap.clear();\n\n        if(this.context) {\n            this.context.unregisterChild(this);\n            if(this.props.springyOrderedIndex != null){\n                this.context.unregisterChildIndex(this, this.props.springyOrderedIndex);\n            }\n        }\n    }\n }\n\n /*\n    only render children on the first render\n*/\nclass SecondRenderGuard extends React.Component<{isSecondRender: boolean}> {\n    shouldComponentUpdate(nextProps){\n        return !nextProps.isSecondRender;\n    }\n\n    render() {\n        return this.props.children;\n    }\n\n}","import React from 'react';\n\nimport {SpringyDOMWrapper, DOMSpringConfigMap} from './types';\nimport SpringyDOMElement from './SpringyDOMElement';\n\nfunction getSpringyDOMElement(ComponentToWrap: string, configMap?: DOMSpringConfigMap | null, styleOnExit?: any) {\n     return React.forwardRef((props, ref) => (\n        <SpringyDOMElement \n            {...props} \n            ComponentToWrap={ComponentToWrap} \n            configMap={configMap}\n            forwardedRef={ref} \n            styleOnExit={styleOnExit}\n        />\n    ));\n}\n\nexport default (getSpringyDOMElement as any) as SpringyDOMWrapper;","import {AbstractChildRegisterProviderClass} from './childRegisterContext';\nimport SpringyDOMElement from '../SpringyDOMElement';\n \nexport default class SpringyRepositionGroup extends AbstractChildRegisterProviderClass<{}> {\n    getSnapshotBeforeUpdate() {\n        const offsetValues = new Map();\n        this._registeredChildren.forEach((node: any) => {\n            const domNode = node.getDOMNode();\n            if(!domNode) return;\n            offsetValues.set(node, {\n                top: domNode.offsetTop,\n                left: domNode.offsetLeft\n            });\n        });\n\n        return offsetValues;\n    }\n\n    componentDidUpdate(prevProps, prevState, offsetValues: Map<SpringyDOMElement, {top: number, left: number}>) {\n        if(!offsetValues) return;\n        this._registeredChildren.forEach((node: SpringyDOMElement) => {\n            const domNode = node.getDOMNode();\n            if(!domNode || !offsetValues.get(node)) return;\n\n            const newOffsetTop = domNode.offsetTop;\n            const newOffsetLeft = domNode.offsetLeft;\n\n            const translateXSpring = node._springMap.get('translateX');\n            const existingTranslateXTarget = \n                translateXSpring ? translateXSpring.getToValue() : 0;\n            const currentTranslateXValue =\n                translateXSpring ? translateXSpring.getCurrentValue() : 0;\n\n            const translateYSpring = node._springMap.get('translateY');\n            const existingTranslateYTarget = \n                    translateYSpring ? translateYSpring.getToValue() : 0;\n            const currentTranslateYValue =\n                    translateYSpring ? translateYSpring.getCurrentValue() : 0;\n\n            node.setSpringToValueForProperty('translateX', existingTranslateXTarget, currentTranslateXValue + offsetValues.get(node).left - newOffsetLeft);\n            node.setSpringToValueForProperty('translateY', existingTranslateYTarget, currentTranslateYValue + offsetValues.get(node).top - newOffsetTop);\n        });\n    }\n\n}","import {AbstractChildRegisterProviderClass} from './childRegisterContext';\nimport SpringyDOMElement from '../SpringyDOMElement';\n\nfunction once(fn: Function) {\n    let hasBeenCalled = false;\n    return () => {\n        if(hasBeenCalled) return;\n        hasBeenCalled = true;\n        fn();\n    };\n}\n\ntype PropertyConfig = {\n    property: string;\n    offset: number;\n};\n\ntype Props = {\n    properties: Array<string | PropertyConfig>\n};\n\nexport default class SpringyFollowGroup extends AbstractChildRegisterProviderClass<Props> {\n\n    _unregisterFunctions = [];\n\n    componentDidMount() {\n        this._setupFollows();\n    }\n\n    componentDidUpdate() {\n        this._setupFollows();\n    }\n\n    componentWillUnmount() {\n        this._unregisterListeners();\n    }\n\n    _setupFollows() {\n        this._unregisterListeners();\n\n        let numActive = 0;\n        let removalQueue = [];\n        for(let propertyConfig of this.props.properties) {\n            const offset = \n                typeof propertyConfig === 'string' ?\n                    0 : propertyConfig.offset;\n\n            const property = \n                typeof propertyConfig === 'string' ?\n                    propertyConfig : propertyConfig.property;\n\n            let lastGroupChild: SpringyDOMElement | null = null;\n            \n            this._orderedChildrenGroups.filter(Boolean).forEach(childGroup => {\n                childGroup.forEach((child, index) => {\n                    const isUnmounting = child.isUnmounting();\n                    if(lastGroupChild != null){\n                        const parentSpring = lastGroupChild.getSpringForProperty(property);\n                        if(parentSpring) {\n                            // if the child already has a spring for the property then we don't\n                            // override the from value\n                            let childSpring = child.getSpringForProperty(property);\n                            const overridingFrom = childSpring != null ? null : parentSpring.getCurrentValue() + offset;\n                            child.setSpringToValueForProperty(property, parentSpring.getCurrentValue() + offset, overridingFrom);\n\n                            this._unregisterFunctions.push(\n                                parentSpring.onUpdate(value => {\n                                    child.setSpringToValueForProperty(property, value + offset);\n                                })\n                            );\n                            \n                            if(isUnmounting) {\n                                const childSpring = child.getSpringForProperty(property);\n                                if(childSpring) {\n                                    const unblock = childSpring.blockSpringFromResting();\n                                    this._unregisterFunctions.push(unblock);\n\n                                    this._unregisterFunctions.push(\n                                        parentSpring.onAtRest(() => unblock())\n                                    );\n                                }\n                            }\n                        }\n                    }\n                    \n                    if(index === childGroup.length - 1) lastGroupChild = child;\n\n                    if(isUnmounting) {\n                        const childSpring = child.getSpringForProperty(property);\n                        if(childSpring) {\n                            const unblockRemoval = child.blockRemoval();\n                            this._unregisterFunctions.push(unblockRemoval);\n                            numActive++;\n                            const remove = once(() => {\n                                removalQueue.push(unblockRemoval);\n                                numActive--;\n                                if(numActive === 0) {\n                                    removalQueue.forEach(fn => fn());\n                                }\n                            });\n\n                            this._unregisterFunctions.push(childSpring.onAtRest(remove));\n                            this._unregisterFunctions.push(childSpring.onEnd(remove));\n                        }\n                    }\n                });\n            });\n        }\n    }\n\n    _unregisterListeners(){\n        this._unregisterFunctions.forEach(fn => fn());\n        this._unregisterFunctions = [];\n    }\n\n}","// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tvar iteratorSymbol = Symbol.iterator;\n\t\tif (iteratorSymbol && (iteratorSymbol in target)) {\n\t\t\tvar iterator = target[iteratorSymbol](), step, pact, reject;\n\t\t\tfunction _cycle(result) {\n\t\t\t\ttry {\n\t\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (pact) {\n\t\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpact = result;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(pact || (pact = new Pact()), 2, e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_cycle();\n\t\t\tif (iterator.return) {\n\t\t\t\tvar _fixup = function(value) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\t\titerator.return();\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t\tif (pact && pact.then) {\n\t\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t_fixup();\n\t\t\t}\n\t\t\treturn pact;\n\t\t}\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"value is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tvar asyncIteratorSymbol = Symbol.asyncIterator;\n\t\tif (asyncIteratorSymbol && (asyncIteratorSymbol in target)) {\n\t\t\tvar pact = new _Pact();\n\t\t\tvar iterator = target[asyncIteratorSymbol]();\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t\treturn pact;\n\t\t\tfunction _resumeAfterBody(result) {\n\t\t\t\tif (check && !check()) {\n\t\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t\t}\n\t\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t\t}\n\t\t\tfunction _resumeAfterNext(step) {\n\t\t\t\tif (step.done) {\n\t\t\t\t\t_settle(pact, 1);\n\t\t\t\t} else {\n\t\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction _reject(error) {\n\t\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t\t}\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, value);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t\tthis[Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))] = function() {\n\t\t\treturn this;\n\t\t};\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\t_entry(_this).then(returnValue, function(error) {\n\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","import React from 'react';\n\nimport {AbstractChildRegisterProviderClass} from './childRegisterContext';\nimport SpringyDOMElement from '../SpringyDOMElement';\nimport { arrayOf } from 'prop-types';\n \ntype RepeaterConfig = {\n    from: number;\n    to: number;\n};\n\ntype Props = {\n    springyRepeaterStyles: {[key: string]: RepeaterConfig}\n    direction: 'from-beginning-each-time' | 'back-and-forth';\n    delayStartBetweenChildren?: number;\n    normalizeToZeroAndOne?: boolean;\n    numberOfTimesToRepeat?: number | 'infinite';\n};\n\nfunction wait(time: number) {\n    return new Promise(resolve => setTimeout(resolve, time));\n}\n\nexport default class SpringyRepeater extends AbstractChildRegisterProviderClass<Props> {\n    static defaultProps = {\n        direction: 'back-and-forth',\n        numberOfTimesToRepeat: 'infinite'\n    };\n\n    _lastRenderTime: number = 0;\n    _unregisterFunctions: Map<SpringyDOMElement, Array<Function>> = new Map();\n\n    componentDidMount() {\n        this._setupRepeaters();\n    }\n\n    componentDidUpdate() {\n        this._setupRepeaters();\n    }\n\n    componentWillUnmount() {\n        this._unregisterFunctions.forEach((functions) => functions.forEach(fn => fn()));\n    }\n\n    unregisterChild(child: SpringyDOMElement) {\n        super.unregisterChild(child);\n        this._unregisterListeners(child);\n    }\n\n    async _setupRepeaters() {\n        const renderTime = this._lastRenderTime = Date.now();\n        if(this._orderedChildrenGroups.length > 0) {\n            for(let group of this._orderedChildrenGroups) {\n                if(this.props.delayStartBetweenChildren != null) {\n                    await wait(this.props.delayStartBetweenChildren);\n                    if(renderTime !== this._lastRenderTime) return; // we had a render while waiting\n                }\n                \n                for(let child of group) {\n                    this._setupRepeaterForChild(child);\n                }\n            }\n        }\n        else {\n            for(let child of this._registeredChildren) {\n                if(this.props.delayStartBetweenChildren != null) {\n                    await wait(this.props.delayStartBetweenChildren);\n                    if(renderTime !== this._lastRenderTime) return;\n                }\n                this._setupRepeaterForChild(child);\n            }\n        }\n    }\n\n    _setupRepeaterForChild(child: SpringyDOMElement) {\n        this._unregisterListeners(child);\n        for(let property in this.props.springyRepeaterStyles) {\n            const config = this.props.springyRepeaterStyles[property];\n            this._setupRepeaterSpring(property, config, child);\n        }\n    }\n\n    _setupRepeaterSpring(property: string, config: RepeaterConfig, child: SpringyDOMElement) {\n        const unregisterFunctions = this._unregisterFunctions.get(child) || [];\n        this._unregisterFunctions.set(child, unregisterFunctions);\n\n        if(\n            (Object.keys(this.props.springyRepeaterStyles).length > 1 && this.props.normalizeToZeroAndOne !== false) \n            || this.props.normalizeToZeroAndOne === true\n        ) {\n            unregisterFunctions.push(this._setupNormalizedRepeaterSpring(property, config, child));\n        }\n        else {\n            unregisterFunctions.push(this._setupRegularRepeaterSpring(property, config, child));\n        }\n    }\n\n    _setupNormalizedRepeaterSpring(property: string, config: RepeaterConfig, child: SpringyDOMElement) {\n        let configOrigin = config.from;\n        let configTarget = config.to;\n        let origin = 0;\n        let target = 1;\n        let isTargetBiggerThanOrigin = configTarget - configOrigin > 0;\n\n        const mapper = (value: number) => {\n            return (configTarget-configOrigin) * value + configOrigin;\n        };\n\n        let spring = child.getSpringForProperty(property);\n        // if there's already a spring for this property then we don't reset the from\n        // value so the spring will go from its current position and go towards the\n        // new target\n        let initialOrigin = spring != null ? null : origin;\n        child.setSpringToValueForProperty(property, target, initialOrigin, mapper);\n        spring = child.getSpringForProperty(property);\n        if(!spring) throw new Error('spring should have been created');\n\n        let numberOfRepeats = 0;\n        return spring.onUpdate((value) => {\n            if(isTargetBiggerThanOrigin ? value >= configTarget : value <= configTarget) {\n                numberOfRepeats++;\n                if(this.props.numberOfTimesToRepeat !== 'infinite' && numberOfRepeats > this.props.numberOfTimesToRepeat) {\n                    return; //we are done\n                }\n                if(this.props.direction === 'from-beginning-each-time') {\n                    child.setSpringToValueForProperty(property, target, origin);\n                }\n                else {\n                    //swap target and origin                        \n                    const temp = configTarget;\n                    configTarget = configOrigin;\n                    configOrigin = temp;\n\n                    isTargetBiggerThanOrigin = configTarget - configOrigin > 0;\n                    child.setSpringToValueForProperty(property, target, origin);\n                }\n            }\n        });\n    }\n\n    _setupRegularRepeaterSpring(property: string, config: RepeaterConfig, child: SpringyDOMElement) {\n        let origin = config.from;\n        let target = config.to;\n        let isTargetBiggerThanOrigin = target - origin > 0;\n\n        let spring = child.getSpringForProperty(property);\n        // if there's already a spring for this property then we don't reset the from\n        // value so the spring will go from its current position and go towards the\n        // new target\n        let initialOrigin = spring != null ? null : origin;\n        child.setSpringToValueForProperty(property, target, initialOrigin);\n        \n        spring = child.getSpringForProperty(property);\n        if(!spring) throw new Error('spring should have been created');\n        spring.unsetValueMapper();\n\n        let numberOfRepeats = 0;\n        return spring.onUpdate((value) => {\n            if(isTargetBiggerThanOrigin ? value >= target : value <= target) {\n                numberOfRepeats++;\n                if(this.props.numberOfTimesToRepeat !== 'infinite' && numberOfRepeats > this.props.numberOfTimesToRepeat) {\n                    return; //we are done\n                }\n                if(this.props.direction === 'from-beginning-each-time') {\n                    child.setSpringToValueForProperty(property, target, origin);\n                }\n                else {\n                    //swap target and origin\n                    const temp = target;\n                    target = origin;\n                    origin = temp;\n                    isTargetBiggerThanOrigin = target - origin > 0;\n                    child.setSpringToValueForProperty(property, target);\n                }\n            }\n        });\n    }\n\n    _unregisterListeners(child: SpringyDOMElement) {\n        const unregisterFunctions = this._unregisterFunctions.get(child);\n        if(unregisterFunctions){\n            unregisterFunctions.forEach(fn => fn());\n            this._unregisterFunctions.delete(child);\n        }\n    }\n}"],"names":["const","TRANSFORM_PROPERTIES","AUTO_PROPERTIES","RESIZE_PROPERTIES","DEFAULT_UNIT_SUFFIXES","getConfig","config","oldToValue","newToValue","springConfig","speed","bounciness","configWhenGettingBigger","configWhenGettingSmaller","getUnits","configMap","property","units","handleForwardedRef","ref","forwardedRef","hasOwnProperty","current","reconciler","refElement","currentStyle","values","let","includes","style","transform","transformValuesToTransformCommands","ChildRegisterContext","React","createContext","registerChild","child","unregisterChild","registerChildIndex","index","unregisterChildIndex","AbstractChildRegisterProviderClass","constructor","this","_registeredChildren","indexOf","push","context","length","pop","childrenAtIndex","_orderedChildrenGroups","childIndex","render","Provider","value","props","children","PureComponent","springyDOMMap","Map","SpringyDOMElement","cleanProps","Object","ComponentToWrap","styleOnExit","globalUniqueIDForSpringReuse","onSpringyPropertyValueAtRest","onSpringyPropertyValueUpdate","springyOrderedIndex","springyStyle","instanceRef","_checkAndTakeOverExistingSpringyDOM","_processSpringyStyle","_ref","SecondRenderGuard","isSecondRender","_isSecondRender","componentDidMount","_needsSecondRender","_rerenderToUseTrueSize","componentDidUpdate","prevProps","componentWillUnmount","_killResizeObserver","_handleOnExitIfExists","blockRemoval","_removalBlocked","_springMap","size","_transitionOutCloneElement","remove","get","delete","getSpringForProperty","isUnmounting","Boolean","setSpringToValueForProperty","toValue","overridingFromValue","customValueMapper","_setupOrUpdateSpringForProperty","spring","Error","setValueMapper","getDOMNode","existingSpringyDOM","springMap","springClone","clone","end","_listenToSpring","set","onEnterToValue","onEnterFromValue","onEnterFromValueOffset","_dealWithPotentialResizeObserver","_flipAutoPropsIfNecessary","springyPropsThatCanBeAuto","keys","filter","propsThatAreAuto","computedStyle","getComputedStyle","forEach","parseFloat","getPropertyValue","propValue","getToValue","setBounciness","setSpeed","setToValue","setCurrentValue","fromValue","Spring","_updateValueForProperty","onUpdate","onAtRest","_reconcileUpdate","scheduled","Promise","resolve","then","_resizeObserver","window","ResizeObserver","entries","observe","forceUpdate","disconnect","propertiesWithOnExitToValue","onExitToValue","lastStyle","cloneNode","pointerEvents","insertAdjacentElement","fromValues","propertiesWithOnExitFromValue","onExitFromValue","propertiesWithoutOnExitFromValue","width","height","transformPropertiesWithOnExitValue","domMatrix","DOMMatrix","transformValues","decomposeDOMMatrix","scaleX","existingUpdate","cleanUp","_cleanUpSprings","onEnd","clear","shouldComponentUpdate","nextProps","Component","getSpringyDOMElement","forwardRef","SpringyRepositionGroup","getSnapshotBeforeUpdate","offsetValues","node","domNode","top","offsetTop","left","offsetLeft","prevState","newOffsetTop","newOffsetLeft","translateXSpring","existingTranslateXTarget","currentTranslateXValue","getCurrentValue","translateYSpring","existingTranslateYTarget","currentTranslateYValue","SpringyFollowGroup","_setupFollows","_unregisterListeners","numActive","removalQueue","propertyConfig","offset","lastGroupChild","childGroup","fn","hasBeenCalled","parentSpring","overridingFrom","_unregisterFunctions","childSpring","unblock","blockSpringFromResting","unblockRemoval","properties","_Pact","prototype","onFulfilled","onRejected","result","state","s","callback","_settle","v","e","o","_this","pact","bind","observer","_isSettledPact","thenable","_forOf","target","body","check","Symbol","iteratorSymbol","iterator","step","reject","_cycle","next","done","Pact","return","_fixup","TypeError","i","array","_forTo","wait","time","setTimeout","SpringyRepeater","_setupRepeaters","functions","renderTime","_lastRenderTime","Date","now","group","_setupRepeaterForChild","delayStartBetweenChildren","springyRepeaterStyles","_setupRepeaterSpring","unregisterFunctions","normalizeToZeroAndOne","_setupNormalizedRepeaterSpring","_setupRegularRepeaterSpring","configOrigin","from","configTarget","to","isTargetBiggerThanOrigin","numberOfRepeats","numberOfTimesToRepeat","direction","temp","origin","unsetValueMapper"],"mappings":"wOAAOA,IAAMC,EAAuB,CAChC,SACA,SACA,SACA,QACA,YACA,aACA,aACA,aACA,SACA,UACA,UACA,UACA,OACA,QACA,QACA,eAGSC,EAAkB,CAC3B,QACA,SACA,SACA,MACA,QACA,SACA,QAGSC,EAAoB,CAC7B,QAAS,UAGAC,EAAwB,OACxB,YACC,YACA,SACH,WACE,UACD,YACE,aACC,YACD,UACA,UACA,SACD,aACI,gBACC,gBACA,gBACA,YACJ,cACC,cACA,cACA,WACH,YACC,SACA,sBACa,iBACP,0BACO,oBACJ,qBACC,sBACC,gBACN,eACD,cACD,eACC,cACD,cACA,gBACE,gBACE,eACH,iBACE,kBACC,gBACF,gBACA,kBACE,mBACC,iBACF,kBACC,mBACC,gBACH,iBACC,aACJ,eACI,eCjFKC,EAAUC,EAAiDC,EAAoBC,OAC/FC,EAA6B,MACpB,MAAVH,EAAgB,OAAOG,KAE1BA,EAAaC,MAAQJ,EAAOI,MAC5BD,EAAaE,WAAaL,EAAOK,WAE9BJ,GAAcC,EAAY,KACnBI,EAA0BN,EAAOM,wBACpCA,IACCH,EAAaC,MAAyC,MAAjCE,EAAwBF,MAAgBE,EAAwBF,MAAQD,EAAaC,MAC1GD,EAAaE,WAAmD,MAAtCC,EAAwBD,WAAqBC,EAAwBD,WAAaF,EAAaE,iBAG5H,GAAGJ,EAAaC,EAAW,KACtBK,EAA2BP,EAAOO,yBACrCA,IACCJ,EAAaC,MAA0C,MAAlCG,EAAyBH,MAAgBG,EAAyBH,MAAQD,EAAaC,MAC5GD,EAAaE,WAAoD,MAAvCE,EAAyBF,WAAqBE,EAAyBF,WAA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