{"version":3,"sources":["webpack:///./node_modules/framer-motion/dist/es/utils/use-force-update.mjs","webpack:///./node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","webpack:///./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","webpack:///./node_modules/react-swipeable/es/index.js","webpack:///./node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs"],"names":["useForceUpdate","isMounted","useIsMounted","_a","__read","useState","forcedRenderCount","setForcedRenderCount","forceRender","useCallback","current","sync","postRender","PresenceChild","children","initial","isPresent","onExitComplete","custom","presenceAffectsLayout","presenceChildren","useConstant","newChildrenMap","id","useId","context","useMemo","childId","e_1","set","_b","__values","values","_c","next","done","value","e_1_1","error","return","call","register","delete","undefined","forEach","_","key","React","size","PresenceContext","Provider","Map","getChildKey","child","AnimatePresence","exitBeforeEnter","forceRenderLayoutGroup","useContext","LayoutGroupContext","filteredChildren","filtered","Children","isValidElement","push","onlyElements","childrenToRender","exiting","Set","presentChildren","useRef","allChildren","isInitialRender","useIsomorphicLayoutEffect","updateChildLookup","useUnmountEffect","clear","map","__spreadArray","presentKeys","targetKeys","numPresent","length","i","indexOf","add","get","insertionIndex","splice","removeIndex","findIndex","presentChild","has","env","console","warn","cloneElement","defaultProps","delta","preventScrollOnSwipe","rotationAngle","trackMouse","trackTouch","swipeDuration","Infinity","touchEventOptions","passive","initialState","first","start","swiping","xy","rotateXYByAngle","pos","angle","angleInRadians","Math","PI","cos","sin","getHandlers","handlerProps","onStart","event","isTouch","touches","state","props","document","addEventListener","onMove","onUp","clientX","clientY","onTouchStartOrOnMouseDown","Object","assign","slice","timeStamp","x","y","deltaX","deltaY","absX","abs","absY","time","velocity","sqrt","vxvy","dir","getDirection","toLowerCase","eventData","onSwipeStart","onSwiping","cancelablePageSwipe","onSwiped","cancelable","preventDefault","onEnd","onSwipedDir","onTap","onTouchEndOrOnMouseUp","e","removeEventListener","attachTouch","el","cleanup","baseOptions","tls","h","o","output","ref","addState","cleanUpTouch","onMouseDown","useSwipeable","options","transientState","transientProps","previousProps","defaultKey","handlers","stateSetter","updateTransientState"],"mappings":"uGAAA,6EAKA,SAASA,IACL,IAAIC,EAAYC,cACZC,EAAKC,iBAAOC,mBAAS,GAAI,GAAIC,EAAoBH,EAAG,GAAII,EAAuBJ,EAAG,GAClFK,EAAcC,uBAAY,WAC1BR,EAAUS,SAAWH,EAAqBD,EAAoB,KAC/D,CAACA,IAMJ,MAAO,CADmBG,uBAAY,WAAc,OAAOE,IAAKC,WAAWJ,KAAiB,CAACA,IAChEF,K,yICT7BO,EAAgB,SAAUV,GAC1B,IAAIW,EAAWX,EAAGW,SAAUC,EAAUZ,EAAGY,QAASC,EAAYb,EAAGa,UAAWC,EAAiBd,EAAGc,eAAgBC,EAASf,EAAGe,OAAQC,EAAwBhB,EAAGgB,sBAC3JC,EAAmBC,YAAYC,GAC/BC,EAAKC,cACLC,EAAUC,mBAAQ,WAAc,MAAQ,CACxCH,GAAIA,EACJR,QAASA,EACTC,UAAWA,EACXE,OAAQA,EACRD,eAAgB,SAAUU,GACtB,IAAIC,EAAKzB,EACTiB,EAAiBS,IAAIF,GAAS,GAC9B,IACI,IAAK,IAAIG,EAAKC,mBAASX,EAAiBY,UAAWC,EAAKH,EAAGI,QAASD,EAAGE,KAAMF,EAAKH,EAAGI,OAAQ,CAEzF,IADiBD,EAAGG,MAEhB,QAGZ,MAAOC,GAAST,EAAM,CAAEU,MAAOD,GAP/B,QASI,IACQJ,IAAOA,EAAGE,OAAShC,EAAK2B,EAAGS,SAASpC,EAAGqC,KAAKV,GADpD,QAGU,GAAIF,EAAK,MAAMA,EAAIU,OAEjCrB,SAAgEA,KAEpEwB,SAAU,SAAUd,GAEhB,OADAP,EAAiBS,IAAIF,GAAS,GACvB,WAAc,OAAOP,EAAiBsB,OAAOf,QAQ5DR,OAAwBwB,EAAY,CAAC3B,IAWrC,OAVAU,mBAAQ,WACJN,EAAiBwB,SAAQ,SAAUC,EAAGC,GAAO,OAAO1B,EAAiBS,IA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E3L,OADA+E,EAAezK,QAvCnB,SAA8BmH,EAAOC,EAAOuD,EAAehB,GAEvD,OAAKvC,EAAMzB,YAAewB,EAAMyC,GAO3BzC,EAAMkD,aAMPjD,EAAM5B,uBAAyBmF,EAAcnF,sBAC7C4B,EAAMtB,kBAAkBC,UAAY4E,EAAc7E,kBAAkBC,SACpEoB,EAAMkD,eACCzC,OAAOC,OAAOD,OAAOC,OAAO,GAAIV,GAAQ,CAAEkD,aAAcV,EAAYxC,EAAMyC,GAAIxC,MAElFD,EAVIS,OAAOC,OAAOD,OAAOC,OAAO,GAAIV,GAAQ,CAAEkD,aAAcV,EAAYxC,EAAMyC,GAAIxC,MAPjFD,EAAMkD,cACNlD,EAAMkD,eAEHzC,OAAOC,OAAOD,OAAOC,OAAO,GAAIV,GAAQ,CAAEkD,kBAAcpI,KAiC1C8I,CAAqBN,EAAezK,QAAS0K,EAAe1K,QAAS2K,EAAc3K,QAAS2J,GAC9GkB,I,gCC1QX,qDAGA,SAASrL,IACL,IAAID,EAAYoE,kBAAO,GAOvB,OANAG,aAA0B,WAEtB,OADAvE,EAAUS,SAAU,EACb,WACHT,EAAUS,SAAU,KAEzB,IACIT","file":"vendors~HomepageCarousel-4c838f370e64922cbbb3.js","sourcesContent":["import { __read } from 'tslib';\nimport sync from 'framesync';\nimport { useState, useCallback } from 'react';\nimport { useIsMounted } from './use-is-mounted.mjs';\n\nfunction useForceUpdate() {\n var isMounted = useIsMounted();\n var _a = __read(useState(0), 2), forcedRenderCount = _a[0], setForcedRenderCount = _a[1];\n var forceRender = useCallback(function () {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1);\n }, [forcedRenderCount]);\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n var deferredForceRender = useCallback(function () { return sync.postRender(forceRender); }, [forceRender]);\n return [deferredForceRender, forcedRenderCount];\n}\n\nexport { useForceUpdate };\n","import { __values } from 'tslib';\nimport * as React from 'react';\nimport { useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useId } from '../../utils/use-id.mjs';\n\nvar PresenceChild = function (_a) {\n var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout;\n var presenceChildren = useConstant(newChildrenMap);\n var id = useId();\n var context = useMemo(function () { return ({\n id: id,\n initial: initial,\n isPresent: isPresent,\n custom: custom,\n onExitComplete: function (childId) {\n var e_1, _a;\n presenceChildren.set(childId, true);\n try {\n for (var _b = __values(presenceChildren.values()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var isComplete = _c.value;\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete();\n },\n register: function (childId) {\n presenceChildren.set(childId, false);\n return function () { return presenceChildren.delete(childId); };\n },\n }); }, \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout ? undefined : [isPresent]);\n useMemo(function () {\n presenceChildren.forEach(function (_, key) { return presenceChildren.set(key, false); });\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(function () {\n !isPresent && !presenceChildren.size && (onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete());\n }, [isPresent]);\n return (React.createElement(PresenceContext.Provider, { value: context }, children));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { __read, __spreadArray } from 'tslib';\nimport * as React from 'react';\nimport { useContext, useRef, cloneElement, Children, isValidElement } from 'react';\nimport { env } from '../../utils/process.mjs';\nimport { useForceUpdate } from '../../utils/use-force-update.mjs';\nimport { useIsMounted } from '../../utils/use-is-mounted.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\n\nvar getChildKey = function (child) { return child.key || \"\"; };\nfunction updateChildLookup(children, allChildren) {\n children.forEach(function (child) {\n var key = getChildKey(child);\n allChildren.set(key, child);\n });\n}\nfunction onlyElements(children) {\n var filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, function (child) {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nvar AnimatePresence = function (_a) {\n var children = _a.children, custom = _a.custom, _b = _a.initial, initial = _b === void 0 ? true : _b, onExitComplete = _a.onExitComplete, exitBeforeEnter = _a.exitBeforeEnter, _c = _a.presenceAffectsLayout, presenceAffectsLayout = _c === void 0 ? true : _c;\n // We want to force a re-render once all exiting animations have finished. We\n // either use a local forceRender function, or one from a parent context if it exists.\n var _d = __read(useForceUpdate(), 1), forceRender = _d[0];\n var forceRenderLayoutGroup = useContext(LayoutGroupContext).forceRender;\n if (forceRenderLayoutGroup)\n forceRender = forceRenderLayoutGroup;\n var isMounted = useIsMounted();\n // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key\n var filteredChildren = onlyElements(children);\n var childrenToRender = filteredChildren;\n var exiting = new Set();\n // Keep a living record of the children we're actually rendering so we\n // can diff to figure out which are entering and exiting\n var presentChildren = useRef(childrenToRender);\n // A lookup table to quickly reference components by key\n var allChildren = useRef(new Map()).current;\n // If this is the initial component render, just deal with logic surrounding whether\n // we play onMount animations or not.\n var isInitialRender = useRef(true);\n useIsomorphicLayoutEffect(function () {\n isInitialRender.current = false;\n updateChildLookup(filteredChildren, allChildren);\n presentChildren.current = childrenToRender;\n });\n useUnmountEffect(function () {\n isInitialRender.current = true;\n allChildren.clear();\n exiting.clear();\n });\n if (isInitialRender.current) {\n return (React.createElement(React.Fragment, null, childrenToRender.map(function (child) { return (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout }, child)); })));\n }\n // If this is a subsequent render, deal with entering and exiting children\n childrenToRender = __spreadArray([], __read(childrenToRender), false);\n // Diff the keys of the currently-present and target children to update our\n // exiting list.\n var presentKeys = presentChildren.current.map(getChildKey);\n var targetKeys = filteredChildren.map(getChildKey);\n // Diff the present children with our target children and mark those that are exiting\n var numPresent = presentKeys.length;\n for (var i = 0; i < numPresent; i++) {\n var key = presentKeys[i];\n if (targetKeys.indexOf(key) === -1) {\n exiting.add(key);\n }\n }\n // If we currently have exiting children, and we're deferring rendering incoming children\n // until after all current children have exiting, empty the childrenToRender array\n if (exitBeforeEnter && exiting.size) {\n childrenToRender = [];\n }\n // Loop through all currently exiting components and clone them to overwrite `animate`\n // with any `exit` prop they might have defined.\n exiting.forEach(function (key) {\n // If this component is actually entering again, early return\n if (targetKeys.indexOf(key) !== -1)\n return;\n var child = allChildren.get(key);\n if (!child)\n return;\n var insertionIndex = presentKeys.indexOf(key);\n var onExit = function () {\n allChildren.delete(key);\n exiting.delete(key);\n // Remove this child from the present children\n var removeIndex = presentChildren.current.findIndex(function (presentChild) { return presentChild.key === key; });\n presentChildren.current.splice(removeIndex, 1);\n // Defer re-rendering until all exiting children have indeed left\n if (!exiting.size) {\n presentChildren.current = filteredChildren;\n if (isMounted.current === false)\n return;\n forceRender();\n onExitComplete && onExitComplete();\n }\n };\n childrenToRender.splice(insertionIndex, 0, React.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout }, child));\n });\n // Add `MotionContext` even to children that don't need it to ensure we're rendering\n // the same tree between renders\n childrenToRender = childrenToRender.map(function (child) {\n var key = child.key;\n return exiting.has(key) ? (child) : (React.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout }, child));\n });\n if (env !== \"production\" &&\n exitBeforeEnter &&\n childrenToRender.length > 1) {\n console.warn(\"You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour.\");\n }\n return (React.createElement(React.Fragment, null, exiting.size\n ? childrenToRender\n : childrenToRender.map(function (child) { return cloneElement(child); })));\n};\n\nexport { AnimatePresence };\n","import * as React from 'react';\n\nconst LEFT = \"Left\";\nconst RIGHT = \"Right\";\nconst UP = \"Up\";\nconst DOWN = \"Down\";\n\n/* global document */\nconst defaultProps = {\n delta: 10,\n preventScrollOnSwipe: false,\n rotationAngle: 0,\n trackMouse: false,\n trackTouch: true,\n swipeDuration: Infinity,\n touchEventOptions: { passive: true },\n};\nconst initialState = {\n first: true,\n initial: [0, 0],\n start: 0,\n swiping: false,\n xy: [0, 0],\n};\nconst mouseMove = \"mousemove\";\nconst mouseUp = \"mouseup\";\nconst touchEnd = \"touchend\";\nconst touchMove = \"touchmove\";\nconst touchStart = \"touchstart\";\nfunction getDirection(absX, absY, deltaX, deltaY) {\n if (absX > absY) {\n if (deltaX > 0) {\n return RIGHT;\n }\n return LEFT;\n }\n else if (deltaY > 0) {\n return DOWN;\n }\n return UP;\n}\nfunction rotateXYByAngle(pos, angle) {\n if (angle === 0)\n return pos;\n const angleInRadians = (Math.PI / 180) * angle;\n const x = pos[0] * Math.cos(angleInRadians) + pos[1] * Math.sin(angleInRadians);\n const y = pos[1] * Math.cos(angleInRadians) - pos[0] * Math.sin(angleInRadians);\n return [x, y];\n}\nfunction getHandlers(set, handlerProps) {\n const onStart = (event) => {\n const isTouch = \"touches\" in event;\n // if more than a single touch don't track, for now...\n if (isTouch && event.touches.length > 1)\n return;\n set((state, props) => {\n // setup mouse listeners on document to track swipe since swipe can leave container\n if (props.trackMouse && !isTouch) {\n document.addEventListener(mouseMove, onMove);\n document.addEventListener(mouseUp, onUp);\n }\n const { clientX, clientY } = isTouch ? event.touches[0] : event;\n const xy = rotateXYByAngle([clientX, clientY], props.rotationAngle);\n props.onTouchStartOrOnMouseDown &&\n props.onTouchStartOrOnMouseDown({ event });\n return Object.assign(Object.assign(Object.assign({}, state), initialState), { initial: xy.slice(), xy, start: event.timeStamp || 0 });\n });\n };\n const onMove = (event) => {\n set((state, props) => {\n const isTouch = \"touches\" in event;\n // Discount a swipe if additional touches are present after\n // a swipe has started.\n if (isTouch && event.touches.length > 1) {\n return state;\n }\n // if swipe has exceeded duration stop tracking\n if (event.timeStamp - state.start > props.swipeDuration) {\n return state.swiping ? Object.assign(Object.assign({}, state), { swiping: false }) : state;\n }\n const { clientX, clientY } = isTouch ? event.touches[0] : event;\n const [x, y] = rotateXYByAngle([clientX, clientY], props.rotationAngle);\n const deltaX = x - state.xy[0];\n const deltaY = y - state.xy[1];\n const absX = Math.abs(deltaX);\n const absY = Math.abs(deltaY);\n const time = (event.timeStamp || 0) - state.start;\n const velocity = Math.sqrt(absX * absX + absY * absY) / (time || 1);\n const vxvy = [deltaX / (time || 1), deltaY / (time || 1)];\n const dir = getDirection(absX, absY, deltaX, deltaY);\n // if swipe is under delta and we have not started to track a swipe: skip update\n const delta = typeof props.delta === \"number\"\n ? props.delta\n : props.delta[dir.toLowerCase()] ||\n defaultProps.delta;\n if (absX < delta && absY < delta && !state.swiping)\n return state;\n const eventData = {\n absX,\n absY,\n deltaX,\n deltaY,\n dir,\n event,\n first: state.first,\n initial: state.initial,\n velocity,\n vxvy,\n };\n // call onSwipeStart if present and is first swipe event\n eventData.first && props.onSwipeStart && props.onSwipeStart(eventData);\n // call onSwiping if present\n props.onSwiping && props.onSwiping(eventData);\n // track if a swipe is cancelable (handler for swiping or swiped(dir) exists)\n // so we can call preventDefault if needed\n let cancelablePageSwipe = false;\n if (props.onSwiping ||\n props.onSwiped ||\n props[`onSwiped${dir}`]) {\n cancelablePageSwipe = true;\n }\n if (cancelablePageSwipe &&\n props.preventScrollOnSwipe &&\n props.trackTouch &&\n event.cancelable) {\n event.preventDefault();\n }\n return Object.assign(Object.assign({}, state), { \n // first is now always false\n first: false, eventData, swiping: true });\n });\n };\n const onEnd = (event) => {\n set((state, props) => {\n let eventData;\n if (state.swiping && state.eventData) {\n // if swipe is less than duration fire swiped callbacks\n if (event.timeStamp - state.start < props.swipeDuration) {\n eventData = Object.assign(Object.assign({}, state.eventData), { event });\n props.onSwiped && props.onSwiped(eventData);\n const onSwipedDir = props[`onSwiped${eventData.dir}`];\n onSwipedDir && onSwipedDir(eventData);\n }\n }\n else {\n props.onTap && props.onTap({ event });\n }\n props.onTouchEndOrOnMouseUp && props.onTouchEndOrOnMouseUp({ event });\n return Object.assign(Object.assign(Object.assign({}, state), initialState), { eventData });\n });\n };\n const cleanUpMouse = () => {\n // safe to just call removeEventListener\n document.removeEventListener(mouseMove, onMove);\n document.removeEventListener(mouseUp, onUp);\n };\n const onUp = (e) => {\n cleanUpMouse();\n onEnd(e);\n };\n /**\n * The value of passive on touchMove depends on `preventScrollOnSwipe`:\n * - true => { passive: false }\n * - false => { passive: true } // Default\n *\n * NOTE: When preventScrollOnSwipe is true, we attempt to call preventDefault to prevent scroll.\n *\n * props.touchEventOptions can also be set for all touch event listeners,\n * but for `touchmove` specifically when `preventScrollOnSwipe` it will\n * supersede and force passive to false.\n *\n */\n const attachTouch = (el, props) => {\n let cleanup = () => { };\n if (el && el.addEventListener) {\n const baseOptions = Object.assign(Object.assign({}, defaultProps.touchEventOptions), props.touchEventOptions);\n // attach touch event listeners and handlers\n const tls = [\n [touchStart, onStart, baseOptions],\n // preventScrollOnSwipe option supersedes touchEventOptions.passive\n [\n touchMove,\n onMove,\n Object.assign(Object.assign({}, baseOptions), (props.preventScrollOnSwipe ? { passive: false } : {})),\n ],\n [touchEnd, onEnd, baseOptions],\n ];\n tls.forEach(([e, h, o]) => el.addEventListener(e, h, o));\n // return properly scoped cleanup method for removing listeners, options not required\n cleanup = () => tls.forEach(([e, h]) => el.removeEventListener(e, h));\n }\n return cleanup;\n };\n const onRef = (el) => {\n // \"inline\" ref functions are called twice on render, once with null then again with DOM element\n // ignore null here\n if (el === null)\n return;\n set((state, props) => {\n // if the same DOM el as previous just return state\n if (state.el === el)\n return state;\n const addState = {};\n // if new DOM el clean up old DOM and reset cleanUpTouch\n if (state.el && state.el !== el && state.cleanUpTouch) {\n state.cleanUpTouch();\n addState.cleanUpTouch = void 0;\n }\n // only attach if we want to track touch\n if (props.trackTouch && el) {\n addState.cleanUpTouch = attachTouch(el, props);\n }\n // store event attached DOM el for comparison, clean up, and re-attachment\n return Object.assign(Object.assign(Object.assign({}, state), { el }), addState);\n });\n };\n // set ref callback to attach touch event listeners\n const output = {\n ref: onRef,\n };\n // if track mouse attach mouse down listener\n if (handlerProps.trackMouse) {\n output.onMouseDown = onStart;\n }\n return [output, attachTouch];\n}\nfunction updateTransientState(state, props, previousProps, attachTouch) {\n // if trackTouch is off or there is no el, then remove handlers if necessary and exit\n if (!props.trackTouch || !state.el) {\n if (state.cleanUpTouch) {\n state.cleanUpTouch();\n }\n return Object.assign(Object.assign({}, state), { cleanUpTouch: undefined });\n }\n // trackTouch is on, so if there are no handlers attached, attach them and exit\n if (!state.cleanUpTouch) {\n return Object.assign(Object.assign({}, state), { cleanUpTouch: attachTouch(state.el, props) });\n }\n // trackTouch is on and handlers are already attached, so if preventScrollOnSwipe changes value,\n // remove and reattach handlers (this is required to update the passive option when attaching\n // the handlers)\n if (props.preventScrollOnSwipe !== previousProps.preventScrollOnSwipe ||\n props.touchEventOptions.passive !== previousProps.touchEventOptions.passive) {\n state.cleanUpTouch();\n return Object.assign(Object.assign({}, state), { cleanUpTouch: attachTouch(state.el, props) });\n }\n return state;\n}\nfunction useSwipeable(options) {\n const { trackMouse } = options;\n const transientState = React.useRef(Object.assign({}, initialState));\n const transientProps = React.useRef(Object.assign({}, defaultProps));\n // track previous rendered props\n const previousProps = React.useRef(Object.assign({}, transientProps.current));\n previousProps.current = Object.assign({}, transientProps.current);\n // update current render props & defaults\n transientProps.current = Object.assign(Object.assign({}, defaultProps), options);\n // Force defaults for config properties\n let defaultKey;\n for (defaultKey in defaultProps) {\n if (transientProps.current[defaultKey] === void 0) {\n transientProps.current[defaultKey] = defaultProps[defaultKey];\n }\n }\n const [handlers, attachTouch] = React.useMemo(() => getHandlers((stateSetter) => (transientState.current = stateSetter(transientState.current, transientProps.current)), { trackMouse }), [trackMouse]);\n transientState.current = updateTransientState(transientState.current, transientProps.current, previousProps.current, attachTouch);\n return handlers;\n}\n\nexport { DOWN, LEFT, RIGHT, UP, useSwipeable };\n//# sourceMappingURL=index.js.map\n","import { useRef } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs';\n\nfunction useIsMounted() {\n var isMounted = useRef(false);\n useIsomorphicLayoutEffect(function () {\n isMounted.current = true;\n return function () {\n isMounted.current = false;\n };\n }, []);\n return isMounted;\n}\n\nexport { useIsMounted };\n"],"sourceRoot":""}