{"version":3,"file":"vaul-BhVNGlUX.js","sources":["../../node_modules/vaul/dist/index.mjs"],"sourcesContent":["'use client';\nfunction __insertCSS(code) {\n if (!code || typeof document == 'undefined') return\n let head = document.head || document.getElementsByTagName('head')[0]\n let style = document.createElement('style')\n style.type = 'text/css'\n head.appendChild(style)\n ;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))\n}\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport * as React from 'react';\nimport React__default, { useLayoutEffect, useEffect } from 'react';\n\nconst DrawerContext = React__default.createContext({\n drawerRef: {\n current: null\n },\n overlayRef: {\n current: null\n },\n scaleBackground: ()=>{},\n onPress: ()=>{},\n onRelease: ()=>{},\n onDrag: ()=>{},\n onNestedDrag: ()=>{},\n onNestedOpenChange: ()=>{},\n onNestedRelease: ()=>{},\n openProp: undefined,\n dismissible: false,\n handleOnly: false,\n isOpen: false,\n isDragging: false,\n keyboardIsOpen: {\n current: false\n },\n snapPointsOffset: null,\n snapPoints: null,\n modal: false,\n shouldFade: false,\n activeSnapPoint: null,\n onOpenChange: ()=>{},\n setActiveSnapPoint: ()=>{},\n visible: false,\n closeDrawer: ()=>{},\n setVisible: ()=>{},\n direction: 'bottom'\n});\nconst useDrawerContext = ()=>{\n const context = React__default.useContext(DrawerContext);\n if (!context) {\n throw new Error('useDrawerContext must be used within a Drawer.Root');\n }\n return context;\n};\n\n__insertCSS(\"[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left]{overflow-x:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]::after{content:'';position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-handle]{display:block;position:relative;opacity:.8;margin-left:auto;margin-right:auto;height:5px;width:56px;border-radius:1rem;touch-action:pan-y;cursor:grab}[vaul-handle]:active,[vaul-handle]:hover{opacity:1}[vaul-handle]:active{cursor:grabbing}[vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@media (hover:hover) and (pointer:fine){[vaul-drawer]{user-select:none}}@media (pointer:fine){[vaul-handle-hitarea]:{width:100%;height:100%}}\");\n\n// This code comes from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/overlays/src/usePreventScroll.ts\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\nfunction chain(...callbacks) {\n return (...args)=>{\n for (let callback of callbacks){\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\nfunction isMac() {\n return testPlatform(/^Mac/);\n}\nfunction isIPhone() {\n return testPlatform(/^iPhone/);\n}\nfunction isIPad() {\n return testPlatform(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n isMac() && navigator.maxTouchPoints > 1;\n}\nfunction isIOS() {\n return isIPhone() || isIPad();\n}\nfunction testPlatform(re) {\n return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : undefined;\n}\n// @ts-ignore\nconst visualViewport = typeof document !== 'undefined' && window.visualViewport;\nfunction isScrollable(node) {\n let style = window.getComputedStyle(node);\n return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n}\nfunction getScrollParent(node) {\n if (isScrollable(node)) {\n node = node.parentElement;\n }\n while(node && !isScrollable(node)){\n node = node.parentElement;\n }\n return node || document.scrollingElement || document.documentElement;\n}\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n// The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position\nlet preventScrollCount = 0;\nlet restore;\n/**\n * Prevents scrolling on the document body on mount, and\n * restores it on unmount. Also ensures that content does not\n * shift due to the scrollbars disappearing.\n */ function usePreventScroll(options = {}) {\n let { isDisabled } = options;\n useIsomorphicLayoutEffect(()=>{\n if (isDisabled) {\n return;\n }\n preventScrollCount++;\n if (preventScrollCount === 1) {\n if (isIOS()) {\n restore = preventScrollMobileSafari();\n } else {\n restore = preventScrollStandard();\n }\n }\n return ()=>{\n preventScrollCount--;\n if (preventScrollCount === 0) {\n restore();\n }\n };\n }, [\n isDisabled\n ]);\n}\n// For most browsers, all we need to do is set `overflow: hidden` on the root element, and\n// add some padding to prevent the page from shifting when the scrollbar is hidden.\nfunction preventScrollStandard() {\n return chain(setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`));\n}\n// Mobile Safari is a whole different beast. Even with overflow: hidden,\n// it still scrolls the page in many situations:\n//\n// 1. When the bottom toolbar and address bar are collapsed, page scrolling is always allowed.\n// 2. When the keyboard is visible, the viewport does not resize. Instead, the keyboard covers part of\n// it, so it becomes scrollable.\n// 3. When tapping on an input, the page always scrolls so that the input is centered in the visual viewport.\n// This may cause even fixed position elements to scroll off the screen.\n// 4. When using the next/previous buttons in the keyboard to navigate between inputs, the whole page always\n// scrolls, even if the input is inside a nested scrollable element that could be scrolled instead.\n//\n// In order to work around these cases, and prevent scrolling without jankiness, we do a few things:\n//\n// 1. Prevent default on `touchmove` events that are not in a scrollable element. This prevents touch scrolling\n// on the window.\n// 2. Prevent default on `touchmove` events inside a scrollable element when the scroll position is at the\n// top or bottom. This avoids the whole page scrolling instead, but does prevent overscrolling.\n// 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.\n// 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top\n// of the page, which prevents it from scrolling the page. After the input is focused, scroll the element\n// into view ourselves, without scrolling the whole page.\n// 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the\n// same visually, but makes the actual scroll position always zero. This is required to make all of the\n// above work or Safari will still try to scroll the page when focusing an input.\n// 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting\n// to navigate to an input with the next/previous buttons that's outside a modal.\nfunction preventScrollMobileSafari() {\n let scrollable;\n let lastY = 0;\n let onTouchStart = (e)=>{\n // Store the nearest scrollable parent element from the element that the user touched.\n scrollable = getScrollParent(e.target);\n if (scrollable === document.documentElement && scrollable === document.body) {\n return;\n }\n lastY = e.changedTouches[0].pageY;\n };\n let onTouchMove = (e)=>{\n // Prevent scrolling the window.\n if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {\n e.preventDefault();\n return;\n }\n // Prevent scrolling up when at the top and scrolling down when at the bottom\n // of a nested scrollable area, otherwise mobile Safari will start scrolling\n // the window instead. Unfortunately, this disables bounce scrolling when at\n // the top but it's the best we can do.\n let y = e.changedTouches[0].pageY;\n let scrollTop = scrollable.scrollTop;\n let bottom = scrollable.scrollHeight - scrollable.clientHeight;\n if (bottom === 0) {\n return;\n }\n if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) {\n e.preventDefault();\n }\n lastY = y;\n };\n let onTouchEnd = (e)=>{\n let target = e.target;\n // Apply this change if we're not already focused on the target element\n if (isInput(target) && target !== document.activeElement) {\n e.preventDefault();\n // Apply a transform to trick Safari into thinking the input is at the top of the page\n // so it doesn't try to scroll it into view. When tapping on an input, this needs to\n // be done before the \"focus\" event, so we have to focus the element ourselves.\n target.style.transform = 'translateY(-2000px)';\n target.focus();\n requestAnimationFrame(()=>{\n target.style.transform = '';\n });\n }\n };\n let onFocus = (e)=>{\n let target = e.target;\n if (isInput(target)) {\n // Transform also needs to be applied in the focus event in cases where focus moves\n // other than tapping on an input directly, e.g. the next/previous buttons in the\n // software keyboard. In these cases, it seems applying the transform in the focus event\n // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️\n target.style.transform = 'translateY(-2000px)';\n requestAnimationFrame(()=>{\n target.style.transform = '';\n // This will have prevented the browser from scrolling the focused element into view,\n // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.\n if (visualViewport) {\n if (visualViewport.height < window.innerHeight) {\n // If the keyboard is already visible, do this after one additional frame\n // to wait for the transform to be removed.\n requestAnimationFrame(()=>{\n scrollIntoView(target);\n });\n } else {\n // Otherwise, wait for the visual viewport to resize before scrolling so we can\n // measure the correct position to scroll to.\n visualViewport.addEventListener('resize', ()=>scrollIntoView(target), {\n once: true\n });\n }\n }\n });\n }\n };\n let onWindowScroll = ()=>{\n // Last resort. If the window scrolled, scroll it back to the top.\n // It should always be at the top because the body will have a negative margin (see below).\n window.scrollTo(0, 0);\n };\n // Record the original scroll position so we can restore it.\n // Then apply a negative margin to the body to offset it by the scroll position. This will\n // enable us to scroll the window to the top, which is required for the rest of this to work.\n let scrollX = window.pageXOffset;\n let scrollY = window.pageYOffset;\n let restoreStyles = chain(setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`));\n // Scroll to the top. The negative margin on the body will make this appear the same.\n window.scrollTo(0, 0);\n let removeEvents = chain(addEvent(document, 'touchstart', onTouchStart, {\n passive: false,\n capture: true\n }), addEvent(document, 'touchmove', onTouchMove, {\n passive: false,\n capture: true\n }), addEvent(document, 'touchend', onTouchEnd, {\n passive: false,\n capture: true\n }), addEvent(document, 'focus', onFocus, true), addEvent(window, 'scroll', onWindowScroll));\n return ()=>{\n // Restore styles and scroll the page back to where it was.\n restoreStyles();\n removeEvents();\n window.scrollTo(scrollX, scrollY);\n };\n}\n// Sets a CSS property on an element, and returns a function to revert it to the previous value.\nfunction setStyle(element, style, value) {\n let cur = element.style[style];\n element.style[style] = value;\n return ()=>{\n element.style[style] = cur;\n };\n}\n// Adds an event listener to an element, and returns a function to remove it.\nfunction addEvent(target, event, handler, options) {\n // @ts-ignore\n target.addEventListener(event, handler, options);\n return ()=>{\n // @ts-ignore\n target.removeEventListener(event, handler, options);\n };\n}\nfunction scrollIntoView(target) {\n let root = document.scrollingElement || document.documentElement;\n while(target && target !== root){\n // Find the parent scrollable element and adjust the scroll position if the target is not already in view.\n let scrollable = getScrollParent(target);\n if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {\n let scrollableTop = scrollable.getBoundingClientRect().top;\n let targetTop = target.getBoundingClientRect().top;\n let targetBottom = target.getBoundingClientRect().bottom;\n const keyboardHeight = scrollable.getBoundingClientRect().bottom;\n if (targetBottom > keyboardHeight) {\n scrollable.scrollTop += targetTop - scrollableTop;\n }\n }\n // @ts-ignore\n target = scrollable.parentElement;\n }\n}\nfunction isInput(target) {\n return target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;\n}\n\n// This code comes from https://github.com/radix-ui/primitives/tree/main/packages/react/compose-refs\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function composeRefs(...refs) {\n return (node)=>refs.forEach((ref)=>setRef(ref, node));\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function useComposedRefs(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nlet previousBodyPosition = null;\nfunction usePositionFixed({ isOpen, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles }) {\n const [activeUrl, setActiveUrl] = React__default.useState(()=>typeof window !== 'undefined' ? window.location.href : '');\n const scrollPos = React__default.useRef(0);\n const setPositionFixed = React__default.useCallback(()=>{\n // If previousBodyPosition is already set, don't set it again.\n if (previousBodyPosition === null && isOpen && !noBodyStyles) {\n previousBodyPosition = {\n position: document.body.style.position,\n top: document.body.style.top,\n left: document.body.style.left,\n height: document.body.style.height,\n right: 'unset'\n };\n // Update the dom inside an animation frame\n const { scrollX, innerHeight } = window;\n document.body.style.setProperty('position', 'fixed', 'important');\n Object.assign(document.body.style, {\n top: `${-scrollPos.current}px`,\n left: `${-scrollX}px`,\n right: '0px',\n height: 'auto'\n });\n window.setTimeout(()=>window.requestAnimationFrame(()=>{\n // Attempt to check if the bottom bar appeared due to the position change\n const bottomBarHeight = innerHeight - window.innerHeight;\n if (bottomBarHeight && scrollPos.current >= innerHeight) {\n // Move the content further up so that the bottom bar doesn't hide it\n document.body.style.top = `${-(scrollPos.current + bottomBarHeight)}px`;\n }\n }), 300);\n }\n }, [\n isOpen\n ]);\n const restorePositionSetting = React__default.useCallback(()=>{\n if (previousBodyPosition !== null && !noBodyStyles) {\n // Convert the position from \"px\" to Int\n const y = -parseInt(document.body.style.top, 10);\n const x = -parseInt(document.body.style.left, 10);\n // Restore styles\n Object.assign(document.body.style, previousBodyPosition);\n window.requestAnimationFrame(()=>{\n if (preventScrollRestoration && activeUrl !== window.location.href) {\n setActiveUrl(window.location.href);\n return;\n }\n window.scrollTo(x, y);\n });\n previousBodyPosition = null;\n }\n }, [\n activeUrl\n ]);\n React__default.useEffect(()=>{\n function onScroll() {\n scrollPos.current = window.scrollY;\n }\n onScroll();\n window.addEventListener('scroll', onScroll);\n return ()=>{\n window.removeEventListener('scroll', onScroll);\n };\n }, []);\n React__default.useEffect(()=>{\n if (nested || !hasBeenOpened) return;\n // This is needed to force Safari toolbar to show **before** the drawer starts animating to prevent a gnarly shift from happening\n if (isOpen) {\n // avoid for standalone mode (PWA)\n const isStandalone = window.matchMedia('(display-mode: standalone)').matches;\n !isStandalone && setPositionFixed();\n if (!modal) {\n window.setTimeout(()=>{\n restorePositionSetting();\n }, 500);\n }\n } else {\n restorePositionSetting();\n }\n }, [\n isOpen,\n hasBeenOpened,\n activeUrl,\n modal,\n nested,\n setPositionFixed,\n restorePositionSetting\n ]);\n return {\n restorePositionSetting\n };\n}\n\nconst cache = new WeakMap();\nfunction set(el, styles, ignoreCache = false) {\n if (!el || !(el instanceof HTMLElement)) return;\n let originalStyles = {};\n Object.entries(styles).forEach(([key, value])=>{\n if (key.startsWith('--')) {\n el.style.setProperty(key, value);\n return;\n }\n originalStyles[key] = el.style[key];\n el.style[key] = value;\n });\n if (ignoreCache) return;\n cache.set(el, originalStyles);\n}\nfunction reset(el, prop) {\n if (!el || !(el instanceof HTMLElement)) return;\n let originalStyles = cache.get(el);\n if (!originalStyles) {\n return;\n }\n if (prop) {\n el.style[prop] = originalStyles[prop];\n } else {\n Object.entries(originalStyles).forEach(([key, value])=>{\n el.style[key] = value;\n });\n }\n}\nconst isVertical = (direction)=>{\n switch(direction){\n case 'top':\n case 'bottom':\n return true;\n case 'left':\n case 'right':\n return false;\n default:\n return direction;\n }\n};\nfunction getTranslate(element, direction) {\n if (!element) {\n return null;\n }\n const style = window.getComputedStyle(element);\n const transform = // @ts-ignore\n style.transform || style.webkitTransform || style.mozTransform;\n let mat = transform.match(/^matrix3d\\((.+)\\)$/);\n if (mat) {\n // https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d\n return parseFloat(mat[1].split(', ')[isVertical(direction) ? 13 : 12]);\n }\n // https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix\n mat = transform.match(/^matrix\\((.+)\\)$/);\n return mat ? parseFloat(mat[1].split(', ')[isVertical(direction) ? 5 : 4]) : null;\n}\nfunction dampenValue(v) {\n return 8 * (Math.log(v + 1) - 2);\n}\n\nconst TRANSITIONS = {\n DURATION: 0.5,\n EASE: [\n 0.32,\n 0.72,\n 0,\n 1\n ]\n};\nconst VELOCITY_THRESHOLD = 0.4;\n\n// This code comes from https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx\nfunction useCallbackRef(callback) {\n const callbackRef = React__default.useRef(callback);\n React__default.useEffect(()=>{\n callbackRef.current = callback;\n });\n // https://github.com/facebook/react/issues/19240\n return React__default.useMemo(()=>(...args)=>callbackRef.current == null ? void 0 : callbackRef.current.call(callbackRef, ...args), []);\n}\nfunction useUncontrolledState({ defaultProp, onChange }) {\n const uncontrolledState = React__default.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React__default.useRef(value);\n const handleChange = useCallbackRef(onChange);\n React__default.useEffect(()=>{\n if (prevValueRef.current !== value) {\n handleChange(value);\n prevValueRef.current = value;\n }\n }, [\n value,\n prevValueRef,\n handleChange\n ]);\n return uncontrolledState;\n}\nfunction useControllableState({ prop, defaultProp, onChange = ()=>{} }) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n const setValue = React__default.useCallback((nextValue)=>{\n if (isControlled) {\n const setter = nextValue;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) handleChange(value);\n } else {\n setUncontrolledProp(nextValue);\n }\n }, [\n isControlled,\n prop,\n setUncontrolledProp,\n handleChange\n ]);\n return [\n value,\n setValue\n ];\n}\n\nfunction useSnapPoints({ activeSnapPointProp, setActiveSnapPointProp, snapPoints, drawerRef, overlayRef, fadeFromIndex, onSnapPointChange, direction = 'bottom' }) {\n const [activeSnapPoint, setActiveSnapPoint] = useControllableState({\n prop: activeSnapPointProp,\n defaultProp: snapPoints == null ? void 0 : snapPoints[0],\n onChange: setActiveSnapPointProp\n });\n const isLastSnapPoint = React__default.useMemo(()=>activeSnapPoint === (snapPoints == null ? void 0 : snapPoints[snapPoints.length - 1]) || null, [\n snapPoints,\n activeSnapPoint\n ]);\n const shouldFade = snapPoints && snapPoints.length > 0 && (fadeFromIndex || fadeFromIndex === 0) && !Number.isNaN(fadeFromIndex) && snapPoints[fadeFromIndex] === activeSnapPoint || !snapPoints;\n const activeSnapPointIndex = React__default.useMemo(()=>snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint)=>snapPoint === activeSnapPoint), [\n snapPoints,\n activeSnapPoint\n ]);\n const snapPointsOffset = React__default.useMemo(()=>{\n var _snapPoints_map;\n return (_snapPoints_map = snapPoints == null ? void 0 : snapPoints.map((snapPoint)=>{\n const hasWindow = typeof window !== 'undefined';\n const isPx = typeof snapPoint === 'string';\n let snapPointAsNumber = 0;\n if (isPx) {\n snapPointAsNumber = parseInt(snapPoint, 10);\n }\n if (isVertical(direction)) {\n const height = isPx ? snapPointAsNumber : hasWindow ? snapPoint * window.innerHeight : 0;\n if (hasWindow) {\n return direction === 'bottom' ? window.innerHeight - height : -window.innerHeight + height;\n }\n return height;\n }\n const width = isPx ? snapPointAsNumber : hasWindow ? snapPoint * window.innerWidth : 0;\n if (hasWindow) {\n return direction === 'right' ? window.innerWidth - width : -window.innerWidth + width;\n }\n return width;\n })) != null ? _snapPoints_map : [];\n }, [\n snapPoints\n ]);\n const activeSnapPointOffset = React__default.useMemo(()=>activeSnapPointIndex !== null ? snapPointsOffset == null ? void 0 : snapPointsOffset[activeSnapPointIndex] : null, [\n snapPointsOffset,\n activeSnapPointIndex\n ]);\n const snapToPoint = React__default.useCallback((dimension)=>{\n var _snapPointsOffset_findIndex;\n const newSnapPointIndex = (_snapPointsOffset_findIndex = snapPointsOffset == null ? void 0 : snapPointsOffset.findIndex((snapPointDim)=>snapPointDim === dimension)) != null ? _snapPointsOffset_findIndex : null;\n onSnapPointChange(newSnapPointIndex);\n set(drawerRef.current, {\n transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,\n transform: isVertical(direction) ? `translate3d(0, ${dimension}px, 0)` : `translate3d(${dimension}px, 0, 0)`\n });\n if (snapPointsOffset && newSnapPointIndex !== snapPointsOffset.length - 1 && newSnapPointIndex !== fadeFromIndex) {\n set(overlayRef.current, {\n transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,\n opacity: '0'\n });\n } else {\n set(overlayRef.current, {\n transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,\n opacity: '1'\n });\n }\n setActiveSnapPoint(newSnapPointIndex !== null ? snapPoints == null ? void 0 : snapPoints[newSnapPointIndex] : null);\n }, [\n drawerRef.current,\n snapPoints,\n snapPointsOffset,\n fadeFromIndex,\n overlayRef,\n setActiveSnapPoint\n ]);\n React__default.useEffect(()=>{\n if (activeSnapPoint || activeSnapPointProp) {\n var _snapPoints_findIndex;\n const newIndex = (_snapPoints_findIndex = snapPoints == null ? void 0 : snapPoints.findIndex((snapPoint)=>snapPoint === activeSnapPointProp || snapPoint === activeSnapPoint)) != null ? _snapPoints_findIndex : -1;\n if (snapPointsOffset && newIndex !== -1 && typeof snapPointsOffset[newIndex] === 'number') {\n snapToPoint(snapPointsOffset[newIndex]);\n }\n }\n }, [\n activeSnapPoint,\n activeSnapPointProp,\n snapPoints,\n snapPointsOffset,\n snapToPoint\n ]);\n function onRelease({ draggedDistance, closeDrawer, velocity, dismissible }) {\n if (fadeFromIndex === undefined) return;\n const currentPosition = direction === 'bottom' || direction === 'right' ? (activeSnapPointOffset != null ? activeSnapPointOffset : 0) - draggedDistance : (activeSnapPointOffset != null ? activeSnapPointOffset : 0) + draggedDistance;\n const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;\n const isFirst = activeSnapPointIndex === 0;\n const hasDraggedUp = draggedDistance > 0;\n if (isOverlaySnapPoint) {\n set(overlayRef.current, {\n transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n });\n }\n if (velocity > 2 && !hasDraggedUp) {\n if (dismissible) closeDrawer();\n else snapToPoint(snapPointsOffset[0]); // snap to initial point\n return;\n }\n if (velocity > 2 && hasDraggedUp && snapPointsOffset && snapPoints) {\n snapToPoint(snapPointsOffset[snapPoints.length - 1]);\n return;\n }\n // Find the closest snap point to the current position\n const closestSnapPoint = snapPointsOffset == null ? void 0 : snapPointsOffset.reduce((prev, curr)=>{\n if (typeof prev !== 'number' || typeof curr !== 'number') return prev;\n return Math.abs(curr - currentPosition) < Math.abs(prev - currentPosition) ? curr : prev;\n });\n const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;\n if (velocity > VELOCITY_THRESHOLD && Math.abs(draggedDistance) < dim * 0.4) {\n const dragDirection = hasDraggedUp ? 1 : -1; // 1 = up, -1 = down\n // Don't do anything if we swipe upwards while being on the last snap point\n if (dragDirection > 0 && isLastSnapPoint) {\n snapToPoint(snapPointsOffset[snapPoints.length - 1]);\n return;\n }\n if (isFirst && dragDirection < 0 && dismissible) {\n closeDrawer();\n }\n if (activeSnapPointIndex === null) return;\n snapToPoint(snapPointsOffset[activeSnapPointIndex + dragDirection]);\n return;\n }\n snapToPoint(closestSnapPoint);\n }\n function onDrag({ draggedDistance }) {\n if (activeSnapPointOffset === null) return;\n const newValue = direction === 'bottom' || direction === 'right' ? activeSnapPointOffset - draggedDistance : activeSnapPointOffset + draggedDistance;\n // Don't do anything if we exceed the last(biggest) snap point\n if ((direction === 'bottom' || direction === 'right') && newValue < snapPointsOffset[snapPointsOffset.length - 1]) {\n return;\n }\n if ((direction === 'top' || direction === 'left') && newValue > snapPointsOffset[snapPointsOffset.length - 1]) {\n return;\n }\n set(drawerRef.current, {\n transform: isVertical(direction) ? `translate3d(0, ${newValue}px, 0)` : `translate3d(${newValue}px, 0, 0)`\n });\n }\n function getPercentageDragged(absDraggedDistance, isDraggingDown) {\n if (!snapPoints || typeof activeSnapPointIndex !== 'number' || !snapPointsOffset || fadeFromIndex === undefined) return null;\n // If this is true we are dragging to a snap point that is supposed to have an overlay\n const isOverlaySnapPoint = activeSnapPointIndex === fadeFromIndex - 1;\n const isOverlaySnapPointOrHigher = activeSnapPointIndex >= fadeFromIndex;\n if (isOverlaySnapPointOrHigher && isDraggingDown) {\n return 0;\n }\n // Don't animate, but still use this one if we are dragging away from the overlaySnapPoint\n if (isOverlaySnapPoint && !isDraggingDown) return 1;\n if (!shouldFade && !isOverlaySnapPoint) return null;\n // Either fadeFrom index or the one before\n const targetSnapPointIndex = isOverlaySnapPoint ? activeSnapPointIndex + 1 : activeSnapPointIndex - 1;\n // Get the distance from overlaySnapPoint to the one before or vice-versa to calculate the opacity percentage accordingly\n const snapPointDistance = isOverlaySnapPoint ? snapPointsOffset[targetSnapPointIndex] - snapPointsOffset[targetSnapPointIndex - 1] : snapPointsOffset[targetSnapPointIndex + 1] - snapPointsOffset[targetSnapPointIndex];\n const percentageDragged = absDraggedDistance / Math.abs(snapPointDistance);\n if (isOverlaySnapPoint) {\n return 1 - percentageDragged;\n } else {\n return percentageDragged;\n }\n }\n return {\n isLastSnapPoint,\n activeSnapPoint,\n shouldFade,\n getPercentageDragged,\n setActiveSnapPoint,\n activeSnapPointIndex,\n onRelease,\n onDrag,\n snapPointsOffset\n };\n}\n\nconst CLOSE_THRESHOLD = 0.25;\nconst SCROLL_LOCK_TIMEOUT = 100;\nconst BORDER_RADIUS = 8;\nconst NESTED_DISPLACEMENT = 16;\nconst WINDOW_TOP_OFFSET = 26;\nconst DRAG_CLASS = 'vaul-dragging';\nfunction Root({ open: openProp, onOpenChange, children, shouldScaleBackground, onDrag: onDragProp, onRelease: onReleaseProp, snapPoints, nested = false, setBackgroundColorOnScale = true, closeThreshold = CLOSE_THRESHOLD, scrollLockTimeout = SCROLL_LOCK_TIMEOUT, dismissible = true, handleOnly = false, fadeFromIndex = snapPoints && snapPoints.length - 1, activeSnapPoint: activeSnapPointProp, setActiveSnapPoint: setActiveSnapPointProp, fixed, modal = true, onClose, noBodyStyles, direction = 'bottom', preventScrollRestoration = true, disablePreventScroll = false }) {\n var _drawerRef_current;\n const [isOpen = false, setIsOpen] = React__default.useState(false);\n const [hasBeenOpened, setHasBeenOpened] = React__default.useState(false);\n // Not visible = translateY(100%)\n const [visible, setVisible] = React__default.useState(false);\n const [mounted, setMounted] = React__default.useState(false);\n const [isDragging, setIsDragging] = React__default.useState(false);\n const [justReleased, setJustReleased] = React__default.useState(false);\n const overlayRef = React__default.useRef(null);\n const openTime = React__default.useRef(null);\n const dragStartTime = React__default.useRef(null);\n const dragEndTime = React__default.useRef(null);\n const lastTimeDragPrevented = React__default.useRef(null);\n const isAllowedToDrag = React__default.useRef(false);\n const nestedOpenChangeTimer = React__default.useRef(null);\n const pointerStart = React__default.useRef(0);\n const keyboardIsOpen = React__default.useRef(false);\n const previousDiffFromInitial = React__default.useRef(0);\n const drawerRef = React__default.useRef(null);\n const drawerHeightRef = React__default.useRef(((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0);\n const initialDrawerHeight = React__default.useRef(0);\n const onSnapPointChange = React__default.useCallback((activeSnapPointIndex)=>{\n // Change openTime ref when we reach the last snap point to prevent dragging for 500ms incase it's scrollable.\n if (snapPoints && activeSnapPointIndex === snapPointsOffset.length - 1) openTime.current = new Date();\n }, []);\n const { activeSnapPoint, activeSnapPointIndex, setActiveSnapPoint, onRelease: onReleaseSnapPoints, snapPointsOffset, onDrag: onDragSnapPoints, shouldFade, getPercentageDragged: getSnapPointsPercentageDragged } = useSnapPoints({\n snapPoints,\n activeSnapPointProp,\n setActiveSnapPointProp,\n drawerRef,\n fadeFromIndex,\n overlayRef,\n onSnapPointChange,\n direction\n });\n usePreventScroll({\n isDisabled: !isOpen || isDragging || !modal || justReleased || !hasBeenOpened || disablePreventScroll\n });\n const { restorePositionSetting } = usePositionFixed({\n isOpen,\n modal,\n nested,\n hasBeenOpened,\n preventScrollRestoration,\n noBodyStyles\n });\n function getScale() {\n return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;\n }\n function onPress(event) {\n var _drawerRef_current;\n if (!dismissible && !snapPoints) return;\n if (drawerRef.current && !drawerRef.current.contains(event.target)) return;\n drawerHeightRef.current = ((_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.getBoundingClientRect().height) || 0;\n setIsDragging(true);\n dragStartTime.current = new Date();\n // iOS doesn't trigger mouseUp after scrolling so we need to listen to touched in order to disallow dragging\n if (isIOS()) {\n window.addEventListener('touchend', ()=>isAllowedToDrag.current = false, {\n once: true\n });\n }\n // Ensure we maintain correct pointer capture even when going outside of the drawer\n event.target.setPointerCapture(event.pointerId);\n pointerStart.current = isVertical(direction) ? event.clientY : event.clientX;\n }\n function shouldDrag(el, isDraggingInDirection) {\n var _window_getSelection;\n let element = el;\n const highlightedText = (_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString();\n const swipeAmount = drawerRef.current ? getTranslate(drawerRef.current, direction) : null;\n const date = new Date();\n if (element.hasAttribute('data-vaul-no-drag') || element.closest('[data-vaul-no-drag]')) {\n return false;\n }\n if (direction === 'right' || direction === 'left') {\n return true;\n }\n // Allow scrolling when animating\n if (openTime.current && date.getTime() - openTime.current.getTime() < 500) {\n return false;\n }\n if (swipeAmount !== null) {\n if (direction === 'bottom' ? swipeAmount > 0 : swipeAmount < 0) {\n return true;\n }\n }\n // Don't drag if there's highlighted text\n if (highlightedText && highlightedText.length > 0) {\n return false;\n }\n // Disallow dragging if drawer was scrolled within `scrollLockTimeout`\n if (lastTimeDragPrevented.current && date.getTime() - lastTimeDragPrevented.current.getTime() < scrollLockTimeout && swipeAmount === 0) {\n lastTimeDragPrevented.current = date;\n return false;\n }\n if (isDraggingInDirection) {\n lastTimeDragPrevented.current = date;\n // We are dragging down so we should allow scrolling\n return false;\n }\n // Keep climbing up the DOM tree as long as there's a parent\n while(element){\n // Check if the element is scrollable\n if (element.scrollHeight > element.clientHeight) {\n if (element.scrollTop !== 0) {\n lastTimeDragPrevented.current = new Date();\n // The element is scrollable and not scrolled to the top, so don't drag\n return false;\n }\n if (element.getAttribute('role') === 'dialog') {\n return true;\n }\n }\n // Move up to the parent element\n element = element.parentNode;\n }\n // No scrollable parents not scrolled to the top found, so drag\n return true;\n }\n function onDrag(event) {\n if (!drawerRef.current) {\n return;\n }\n // We need to know how much of the drawer has been dragged in percentages so that we can transform background accordingly\n if (isDragging) {\n const directionMultiplier = direction === 'bottom' || direction === 'right' ? 1 : -1;\n const draggedDistance = (pointerStart.current - (isVertical(direction) ? event.clientY : event.clientX)) * directionMultiplier;\n const isDraggingInDirection = draggedDistance > 0;\n // Pre condition for disallowing dragging in the close direction.\n const noCloseSnapPointsPreCondition = snapPoints && !dismissible && !isDraggingInDirection;\n // Disallow dragging down to close when first snap point is the active one and dismissible prop is set to false.\n if (noCloseSnapPointsPreCondition && activeSnapPointIndex === 0) return;\n // We need to capture last time when drag with scroll was triggered and have a timeout between\n const absDraggedDistance = Math.abs(draggedDistance);\n const wrapper = document.querySelector('[vaul-drawer-wrapper]');\n // Calculate the percentage dragged, where 1 is the closed position\n let percentageDragged = absDraggedDistance / drawerHeightRef.current;\n const snapPointPercentageDragged = getSnapPointsPercentageDragged(absDraggedDistance, isDraggingInDirection);\n if (snapPointPercentageDragged !== null) {\n percentageDragged = snapPointPercentageDragged;\n }\n // Disallow close dragging beyond the smallest snap point.\n if (noCloseSnapPointsPreCondition && percentageDragged >= 1) {\n return;\n }\n if (!isAllowedToDrag.current && !shouldDrag(event.target, isDraggingInDirection)) return;\n drawerRef.current.classList.add(DRAG_CLASS);\n // If shouldDrag gave true once after pressing down on the drawer, we set isAllowedToDrag to true and it will remain true until we let go, there's no reason to disable dragging mid way, ever, and that's the solution to it\n isAllowedToDrag.current = true;\n set(drawerRef.current, {\n transition: 'none'\n });\n set(overlayRef.current, {\n transition: 'none'\n });\n if (snapPoints) {\n onDragSnapPoints({\n draggedDistance\n });\n }\n // Run this only if snapPoints are not defined or if we are at the last snap point (highest one)\n if (isDraggingInDirection && !snapPoints) {\n const dampenedDraggedDistance = dampenValue(draggedDistance);\n const translateValue = Math.min(dampenedDraggedDistance * -1, 0) * directionMultiplier;\n set(drawerRef.current, {\n transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`\n });\n return;\n }\n const opacityValue = 1 - percentageDragged;\n if (shouldFade || fadeFromIndex && activeSnapPointIndex === fadeFromIndex - 1) {\n onDragProp == null ? void 0 : onDragProp(event, percentageDragged);\n set(overlayRef.current, {\n opacity: `${opacityValue}`,\n transition: 'none'\n }, true);\n }\n if (wrapper && overlayRef.current && shouldScaleBackground) {\n // Calculate percentageDragged as a fraction (0 to 1)\n const scaleValue = Math.min(getScale() + percentageDragged * (1 - getScale()), 1);\n const borderRadiusValue = 8 - percentageDragged * 8;\n const translateValue = Math.max(0, 14 - percentageDragged * 14);\n set(wrapper, {\n borderRadius: `${borderRadiusValue}px`,\n transform: isVertical(direction) ? `scale(${scaleValue}) translate3d(0, ${translateValue}px, 0)` : `scale(${scaleValue}) translate3d(${translateValue}px, 0, 0)`,\n transition: 'none'\n }, true);\n }\n if (!snapPoints) {\n const translateValue = absDraggedDistance * directionMultiplier;\n set(drawerRef.current, {\n transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`\n });\n }\n }\n }\n React__default.useEffect(()=>{\n return ()=>{\n scaleBackground(false);\n restorePositionSetting();\n };\n }, []);\n React__default.useEffect(()=>{\n var _window_visualViewport;\n function onVisualViewportChange() {\n if (!drawerRef.current) return;\n const focusedElement = document.activeElement;\n if (isInput(focusedElement) || keyboardIsOpen.current) {\n var _window_visualViewport;\n const visualViewportHeight = ((_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.height) || 0;\n // This is the height of the keyboard\n let diffFromInitial = window.innerHeight - visualViewportHeight;\n const drawerHeight = drawerRef.current.getBoundingClientRect().height || 0;\n if (!initialDrawerHeight.current) {\n initialDrawerHeight.current = drawerHeight;\n }\n const offsetFromTop = drawerRef.current.getBoundingClientRect().top;\n // visualViewport height may change due to some subtle changes to the keyboard. Checking if the height changed by 60 or more will make sure that they keyboard really changed its open state.\n if (Math.abs(previousDiffFromInitial.current - diffFromInitial) > 60) {\n keyboardIsOpen.current = !keyboardIsOpen.current;\n }\n if (snapPoints && snapPoints.length > 0 && snapPointsOffset && activeSnapPointIndex) {\n const activeSnapPointHeight = snapPointsOffset[activeSnapPointIndex] || 0;\n diffFromInitial += activeSnapPointHeight;\n }\n previousDiffFromInitial.current = diffFromInitial;\n // We don't have to change the height if the input is in view, when we are here we are in the opened keyboard state so we can correctly check if the input is in view\n if (drawerHeight > visualViewportHeight || keyboardIsOpen.current) {\n const height = drawerRef.current.getBoundingClientRect().height;\n let newDrawerHeight = height;\n if (height > visualViewportHeight) {\n newDrawerHeight = visualViewportHeight - WINDOW_TOP_OFFSET;\n }\n // When fixed, don't move the drawer upwards if there's space, but rather only change it's height so it's fully scrollable when the keyboard is open\n if (fixed) {\n drawerRef.current.style.height = `${height - Math.max(diffFromInitial, 0)}px`;\n } else {\n drawerRef.current.style.height = `${Math.max(newDrawerHeight, visualViewportHeight - offsetFromTop)}px`;\n }\n } else {\n drawerRef.current.style.height = `${initialDrawerHeight.current}px`;\n }\n if (snapPoints && snapPoints.length > 0 && !keyboardIsOpen.current) {\n drawerRef.current.style.bottom = `0px`;\n } else {\n // Negative bottom value would never make sense\n drawerRef.current.style.bottom = `${Math.max(diffFromInitial, 0)}px`;\n }\n }\n }\n (_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.addEventListener('resize', onVisualViewportChange);\n return ()=>{\n var _window_visualViewport;\n return (_window_visualViewport = window.visualViewport) == null ? void 0 : _window_visualViewport.removeEventListener('resize', onVisualViewportChange);\n };\n }, [\n activeSnapPointIndex,\n snapPoints,\n snapPointsOffset\n ]);\n function closeDrawer() {\n if (!drawerRef.current) return;\n cancelDrag();\n onClose == null ? void 0 : onClose();\n set(drawerRef.current, {\n transform: isVertical(direction) ? `translate3d(0, ${direction === 'bottom' ? '100%' : '-100%'}, 0)` : `translate3d(${direction === 'right' ? '100%' : '-100%'}, 0, 0)`,\n transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n });\n set(overlayRef.current, {\n opacity: '0',\n transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n });\n scaleBackground(false);\n setTimeout(()=>{\n setVisible(false);\n setIsOpen(false);\n }, 300);\n setTimeout(()=>{\n // reset(document.documentElement, 'scrollBehavior');\n if (snapPoints) {\n setActiveSnapPoint(snapPoints[0]);\n }\n }, TRANSITIONS.DURATION * 1000); // seconds to ms\n }\n React__default.useEffect(()=>{\n if (!isOpen && shouldScaleBackground) {\n // Can't use `onAnimationEnd` as the component will be invisible by then\n const id = setTimeout(()=>{\n reset(document.body);\n }, 200);\n return ()=>clearTimeout(id);\n }\n }, [\n isOpen,\n shouldScaleBackground\n ]);\n // LayoutEffect to prevent extra render where openProp and isOpen are not synced yet\n React__default.useLayoutEffect(()=>{\n if (openProp) {\n setIsOpen(true);\n setHasBeenOpened(true);\n } else {\n closeDrawer();\n }\n }, [\n openProp\n ]);\n // This can be done much better\n React__default.useEffect(()=>{\n if (mounted) {\n onOpenChange == null ? void 0 : onOpenChange(isOpen);\n }\n }, [\n isOpen\n ]);\n React__default.useEffect(()=>{\n setMounted(true);\n }, []);\n function resetDrawer() {\n if (!drawerRef.current) return;\n const wrapper = document.querySelector('[vaul-drawer-wrapper]');\n const currentSwipeAmount = getTranslate(drawerRef.current, direction);\n set(drawerRef.current, {\n transform: 'translate3d(0, 0, 0)',\n transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n });\n set(overlayRef.current, {\n transition: `opacity ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,\n opacity: '1'\n });\n // Don't reset background if swiped upwards\n if (shouldScaleBackground && currentSwipeAmount && currentSwipeAmount > 0 && isOpen) {\n set(wrapper, {\n borderRadius: `${BORDER_RADIUS}px`,\n overflow: 'hidden',\n ...isVertical(direction) ? {\n transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,\n transformOrigin: 'top'\n } : {\n transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,\n transformOrigin: 'left'\n },\n transitionProperty: 'transform, border-radius',\n transitionDuration: `${TRANSITIONS.DURATION}s`,\n transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n }, true);\n }\n }\n function cancelDrag() {\n if (!isDragging || !drawerRef.current) return;\n drawerRef.current.classList.remove(DRAG_CLASS);\n isAllowedToDrag.current = false;\n setIsDragging(false);\n dragEndTime.current = new Date();\n }\n function onRelease(event) {\n if (!isDragging || !drawerRef.current) return;\n drawerRef.current.classList.remove(DRAG_CLASS);\n isAllowedToDrag.current = false;\n setIsDragging(false);\n dragEndTime.current = new Date();\n const swipeAmount = getTranslate(drawerRef.current, direction);\n if (!shouldDrag(event.target, false) || !swipeAmount || Number.isNaN(swipeAmount)) return;\n if (dragStartTime.current === null) return;\n const timeTaken = dragEndTime.current.getTime() - dragStartTime.current.getTime();\n const distMoved = pointerStart.current - (isVertical(direction) ? event.clientY : event.clientX);\n const velocity = Math.abs(distMoved) / timeTaken;\n if (velocity > 0.05) {\n // `justReleased` is needed to prevent the drawer from focusing on an input when the drag ends, as it's not the intent most of the time.\n setJustReleased(true);\n setTimeout(()=>{\n setJustReleased(false);\n }, 200);\n }\n if (snapPoints) {\n const directionMultiplier = direction === 'bottom' || direction === 'right' ? 1 : -1;\n onReleaseSnapPoints({\n draggedDistance: distMoved * directionMultiplier,\n closeDrawer,\n velocity,\n dismissible\n });\n onReleaseProp == null ? void 0 : onReleaseProp(event, true);\n return;\n }\n // Moved upwards, don't do anything\n if (direction === 'bottom' || direction === 'right' ? distMoved > 0 : distMoved < 0) {\n resetDrawer();\n onReleaseProp == null ? void 0 : onReleaseProp(event, true);\n return;\n }\n if (velocity > VELOCITY_THRESHOLD) {\n closeDrawer();\n onReleaseProp == null ? void 0 : onReleaseProp(event, false);\n return;\n }\n var _drawerRef_current_getBoundingClientRect_height;\n const visibleDrawerHeight = Math.min((_drawerRef_current_getBoundingClientRect_height = drawerRef.current.getBoundingClientRect().height) != null ? _drawerRef_current_getBoundingClientRect_height : 0, window.innerHeight);\n if (swipeAmount >= visibleDrawerHeight * closeThreshold) {\n closeDrawer();\n onReleaseProp == null ? void 0 : onReleaseProp(event, false);\n return;\n }\n onReleaseProp == null ? void 0 : onReleaseProp(event, true);\n resetDrawer();\n }\n React__default.useEffect(()=>{\n // Trigger enter animation without using CSS animation\n if (isOpen) {\n set(document.documentElement, {\n scrollBehavior: 'auto'\n });\n openTime.current = new Date();\n scaleBackground(true);\n }\n }, [\n isOpen\n ]);\n React__default.useEffect(()=>{\n if (drawerRef.current && visible) {\n var _drawerRef_current;\n // Find all scrollable elements inside our drawer and assign a class to it so that we can disable overflow when dragging to prevent pointermove not being captured\n const children = drawerRef == null ? void 0 : (_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.querySelectorAll('*');\n children == null ? void 0 : children.forEach((child)=>{\n const htmlChild = child;\n if (htmlChild.scrollHeight > htmlChild.clientHeight || htmlChild.scrollWidth > htmlChild.clientWidth) {\n htmlChild.classList.add('vaul-scrollable');\n }\n });\n }\n }, [\n visible\n ]);\n function scaleBackground(open) {\n const wrapper = document.querySelector('[vaul-drawer-wrapper]');\n if (!wrapper || !shouldScaleBackground) return;\n if (open) {\n if (setBackgroundColorOnScale) {\n if (!noBodyStyles) {\n // setting original styles initially\n set(document.body, {\n background: document.body.style.backgroundColor || document.body.style.background\n });\n // setting body styles, with cache ignored, so that we can get correct original styles in reset\n set(document.body, {\n background: 'black'\n }, true);\n }\n }\n set(wrapper, {\n borderRadius: `${BORDER_RADIUS}px`,\n overflow: 'hidden',\n ...isVertical(direction) ? {\n transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,\n transformOrigin: 'top'\n } : {\n transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,\n transformOrigin: 'left'\n },\n transitionProperty: 'transform, border-radius',\n transitionDuration: `${TRANSITIONS.DURATION}s`,\n transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n });\n } else {\n // Exit\n reset(wrapper, 'overflow');\n reset(wrapper, 'transform');\n reset(wrapper, 'borderRadius');\n set(wrapper, {\n transitionProperty: 'transform, border-radius',\n transitionDuration: `${TRANSITIONS.DURATION}s`,\n transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(',')})`\n });\n }\n }\n function onNestedOpenChange(o) {\n const scale = o ? (window.innerWidth - NESTED_DISPLACEMENT) / window.innerWidth : 1;\n const y = o ? -NESTED_DISPLACEMENT : 0;\n if (nestedOpenChangeTimer.current) {\n window.clearTimeout(nestedOpenChangeTimer.current);\n }\n set(drawerRef.current, {\n transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,\n transform: `scale(${scale}) translate3d(0, ${y}px, 0)`\n });\n if (!o && drawerRef.current) {\n nestedOpenChangeTimer.current = setTimeout(()=>{\n const translateValue = getTranslate(drawerRef.current, direction);\n set(drawerRef.current, {\n transition: 'none',\n transform: isVertical(direction) ? `translate3d(0, ${translateValue}px, 0)` : `translate3d(${translateValue}px, 0, 0)`\n });\n }, 500);\n }\n }\n function onNestedDrag(event, percentageDragged) {\n if (percentageDragged < 0) return;\n const initialDim = isVertical(direction) ? window.innerHeight : window.innerWidth;\n const initialScale = (initialDim - NESTED_DISPLACEMENT) / initialDim;\n const newScale = initialScale + percentageDragged * (1 - initialScale);\n const newTranslate = -NESTED_DISPLACEMENT + percentageDragged * NESTED_DISPLACEMENT;\n set(drawerRef.current, {\n transform: isVertical(direction) ? `scale(${newScale}) translate3d(0, ${newTranslate}px, 0)` : `scale(${newScale}) translate3d(${newTranslate}px, 0, 0)`,\n transition: 'none'\n });\n }\n function onNestedRelease(event, o) {\n const dim = isVertical(direction) ? window.innerHeight : window.innerWidth;\n const scale = o ? (dim - NESTED_DISPLACEMENT) / dim : 1;\n const translate = o ? -NESTED_DISPLACEMENT : 0;\n if (o) {\n set(drawerRef.current, {\n transition: `transform ${TRANSITIONS.DURATION}s cubic-bezier(${TRANSITIONS.EASE.join(',')})`,\n transform: isVertical(direction) ? `scale(${scale}) translate3d(0, ${translate}px, 0)` : `scale(${scale}) translate3d(${translate}px, 0, 0)`\n });\n }\n }\n return /*#__PURE__*/ React__default.createElement(DialogPrimitive.Root, {\n modal: modal,\n onOpenChange: (o)=>{\n if (openProp !== undefined) {\n onOpenChange == null ? void 0 : onOpenChange(o);\n return;\n }\n if (!o) {\n closeDrawer();\n } else {\n setHasBeenOpened(true);\n setIsOpen(o);\n }\n },\n open: isOpen\n }, /*#__PURE__*/ React__default.createElement(DrawerContext.Provider, {\n value: {\n visible,\n activeSnapPoint,\n snapPoints,\n setActiveSnapPoint,\n drawerRef,\n overlayRef,\n scaleBackground,\n onOpenChange,\n onPress,\n setVisible,\n onRelease,\n onDrag,\n dismissible,\n handleOnly,\n isOpen,\n isDragging,\n shouldFade,\n closeDrawer,\n onNestedDrag,\n onNestedOpenChange,\n onNestedRelease,\n keyboardIsOpen,\n openProp,\n modal,\n snapPointsOffset,\n direction\n }\n }, children));\n}\nconst LONG_HANDLE_PRESS_TIMEOUT = 250;\nconst DOUBLE_TAP_TIMEOUT = 120;\nconst Handle = /*#__PURE__*/ React__default.forwardRef(function({ preventCycle = false, children, ...rest }, ref) {\n const { visible, closeDrawer, isDragging, snapPoints, activeSnapPoint, setActiveSnapPoint, dismissible, handleOnly, onPress, onDrag } = useDrawerContext();\n const closeTimeoutIdRef = React__default.useRef(null);\n const shouldCancelInteractionRef = React__default.useRef(false);\n function handleStartCycle() {\n // Stop if this is the second click of a double click\n if (shouldCancelInteractionRef.current) {\n handleCancelInteraction();\n return;\n }\n window.setTimeout(()=>{\n handleCycleSnapPoints();\n }, DOUBLE_TAP_TIMEOUT);\n }\n function handleCycleSnapPoints() {\n // Prevent accidental taps while resizing drawer\n if (isDragging || preventCycle || shouldCancelInteractionRef.current) {\n handleCancelInteraction();\n return;\n }\n // Make sure to clear the timeout id if the user releases the handle before the cancel timeout\n handleCancelInteraction();\n if ((!snapPoints || snapPoints.length === 0) && dismissible) {\n closeDrawer();\n return;\n }\n const isLastSnapPoint = activeSnapPoint === snapPoints[snapPoints.length - 1];\n if (isLastSnapPoint && dismissible) {\n closeDrawer();\n return;\n }\n const currentSnapIndex = snapPoints.findIndex((point)=>point === activeSnapPoint);\n if (currentSnapIndex === -1) return; // activeSnapPoint not found in snapPoints\n const nextSnapPoint = snapPoints[currentSnapIndex + 1];\n setActiveSnapPoint(nextSnapPoint);\n }\n function handleStartInteraction() {\n closeTimeoutIdRef.current = window.setTimeout(()=>{\n // Cancel click interaction on a long press\n shouldCancelInteractionRef.current = true;\n }, LONG_HANDLE_PRESS_TIMEOUT);\n }\n function handleCancelInteraction() {\n window.clearTimeout(closeTimeoutIdRef.current);\n shouldCancelInteractionRef.current = false;\n }\n return /*#__PURE__*/ React__default.createElement(\"div\", {\n onClick: handleStartCycle,\n onDoubleClick: ()=>{\n shouldCancelInteractionRef.current = true;\n closeDrawer();\n },\n onPointerCancel: handleCancelInteraction,\n onPointerDown: (e)=>{\n if (handleOnly) onPress(e);\n handleStartInteraction();\n },\n onPointerMove: (e)=>{\n if (handleOnly) onDrag(e);\n },\n // onPointerUp is already handled by the content component\n ref: ref,\n \"vaul-drawer-visible\": visible ? 'true' : 'false',\n \"vaul-handle\": \"\",\n \"aria-hidden\": \"true\",\n ...rest\n }, /*#__PURE__*/ React__default.createElement(\"span\", {\n \"vaul-handle-hitarea\": \"\",\n \"aria-hidden\": \"true\"\n }, children));\n});\nHandle.displayName = 'Drawer.Handle';\nconst Overlay = /*#__PURE__*/ React__default.forwardRef(function({ children, ...rest }, ref) {\n const { overlayRef, snapPoints, onRelease, shouldFade, isOpen, visible } = useDrawerContext();\n const composedRef = useComposedRefs(ref, overlayRef);\n const hasSnapPoints = snapPoints && snapPoints.length > 0;\n return /*#__PURE__*/ React__default.createElement(DialogPrimitive.Overlay, {\n onMouseUp: onRelease,\n ref: composedRef,\n \"vaul-drawer-visible\": visible ? 'true' : 'false',\n \"vaul-overlay\": \"\",\n \"vaul-snap-points\": isOpen && hasSnapPoints ? 'true' : 'false',\n \"vaul-snap-points-overlay\": isOpen && shouldFade ? 'true' : 'false',\n ...rest\n });\n});\nOverlay.displayName = 'Drawer.Overlay';\nconst Content = /*#__PURE__*/ React__default.forwardRef(function({ onOpenAutoFocus, onPointerDownOutside, onAnimationEnd, style, ...rest }, ref) {\n const { drawerRef, onPress, onRelease, onDrag, dismissible, keyboardIsOpen, snapPointsOffset, visible, closeDrawer, modal, openProp, onOpenChange, setVisible, handleOnly, direction } = useDrawerContext();\n const composedRef = useComposedRefs(ref, drawerRef);\n const pointerStartRef = React__default.useRef(null);\n const wasBeyondThePointRef = React__default.useRef(false);\n const isDeltaInDirection = (delta, direction, threshold = 0)=>{\n if (wasBeyondThePointRef.current) return true;\n const deltaY = Math.abs(delta.y);\n const deltaX = Math.abs(delta.x);\n const isDeltaX = deltaX > deltaY;\n const dFactor = [\n 'bottom',\n 'right'\n ].includes(direction) ? 1 : -1;\n if (direction === 'left' || direction === 'right') {\n const isReverseDirection = delta.x * dFactor < 0;\n if (!isReverseDirection && deltaX >= 0 && deltaX <= threshold) {\n return isDeltaX;\n }\n } else {\n const isReverseDirection = delta.y * dFactor < 0;\n if (!isReverseDirection && deltaY >= 0 && deltaY <= threshold) {\n return !isDeltaX;\n }\n }\n wasBeyondThePointRef.current = true;\n return true;\n };\n React__default.useEffect(()=>{\n // Trigger enter animation without using CSS animation\n setVisible(true);\n }, []);\n return /*#__PURE__*/ React__default.createElement(DialogPrimitive.Content, {\n \"vaul-drawer\": \"\",\n \"vaul-drawer-direction\": direction,\n \"vaul-drawer-visible\": visible ? 'true' : 'false',\n ...rest,\n ref: composedRef,\n style: snapPointsOffset && snapPointsOffset.length > 0 ? {\n '--snap-point-height': `${snapPointsOffset[0]}px`,\n ...style\n } : style,\n onOpenAutoFocus: (e)=>{\n if (onOpenAutoFocus) {\n onOpenAutoFocus(e);\n } else {\n var _drawerRef_current;\n e.preventDefault();\n (_drawerRef_current = drawerRef.current) == null ? void 0 : _drawerRef_current.focus();\n }\n },\n onPointerDown: (event)=>{\n if (handleOnly) return;\n rest.onPointerDown == null ? void 0 : rest.onPointerDown.call(rest, event);\n pointerStartRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n onPress(event);\n },\n onPointerDownOutside: (e)=>{\n onPointerDownOutside == null ? void 0 : onPointerDownOutside(e);\n if (!modal || e.defaultPrevented) {\n e.preventDefault();\n return;\n }\n if (keyboardIsOpen.current) {\n keyboardIsOpen.current = false;\n }\n e.preventDefault();\n onOpenChange == null ? void 0 : onOpenChange(false);\n if (!dismissible || openProp !== undefined) {\n return;\n }\n closeDrawer();\n },\n onFocusOutside: (e)=>{\n if (!modal) {\n e.preventDefault();\n return;\n }\n },\n onEscapeKeyDown: (e)=>{\n if (!modal) {\n e.preventDefault();\n return;\n }\n },\n onPointerMove: (event)=>{\n if (handleOnly) return;\n rest.onPointerMove == null ? void 0 : rest.onPointerMove.call(rest, event);\n if (!pointerStartRef.current) return;\n const yPosition = event.clientY - pointerStartRef.current.y;\n const xPosition = event.clientX - pointerStartRef.current.x;\n const swipeStartThreshold = event.pointerType === 'touch' ? 10 : 2;\n const delta = {\n x: xPosition,\n y: yPosition\n };\n const isAllowedToSwipe = isDeltaInDirection(delta, direction, swipeStartThreshold);\n if (isAllowedToSwipe) onDrag(event);\n else if (Math.abs(xPosition) > swipeStartThreshold || Math.abs(yPosition) > swipeStartThreshold) {\n pointerStartRef.current = null;\n }\n },\n onPointerUp: (event)=>{\n rest.onPointerUp == null ? void 0 : rest.onPointerUp.call(rest, event);\n pointerStartRef.current = null;\n wasBeyondThePointRef.current = false;\n onRelease(event);\n }\n });\n});\nContent.displayName = 'Drawer.Content';\nfunction NestedRoot({ onDrag, onOpenChange, ...rest }) {\n const { onNestedDrag, onNestedOpenChange, onNestedRelease } = useDrawerContext();\n if (!onNestedDrag) {\n throw new Error('Drawer.NestedRoot must be placed in another drawer');\n }\n return /*#__PURE__*/ React__default.createElement(Root, {\n nested: true,\n onClose: ()=>{\n onNestedOpenChange(false);\n },\n onDrag: (e, p)=>{\n onNestedDrag(e, p);\n onDrag == null ? void 0 : onDrag(e, p);\n },\n onOpenChange: (o)=>{\n if (o) {\n onNestedOpenChange(o);\n }\n onOpenChange == null ? void 0 : onOpenChange(o);\n },\n onRelease: onNestedRelease,\n ...rest\n });\n}\nconst Drawer = {\n Root,\n NestedRoot,\n Content,\n Handle,\n Overlay,\n Trigger: DialogPrimitive.Trigger,\n Portal: DialogPrimitive.Portal,\n Close: DialogPrimitive.Close,\n Title: DialogPrimitive.Title,\n Description: DialogPrimitive.Description\n};\n\nexport { Drawer };\n"],"names":["DrawerContext","React__default","createContext","drawerRef","current","overlayRef","scaleBackground","onPress","onRelease","onDrag","onNestedDrag","onNestedOpenChange","onNestedRelease","openProp","dismissible","handleOnly","isOpen","isDragging","keyboardIsOpen","snapPointsOffset","snapPoints","modal","shouldFade","activeSnapPoint","onOpenChange","setActiveSnapPoint","visible","closeDrawer","setVisible","direction","useDrawerContext","context","useContext","Error","code","document","head","getElementsByTagName","style","createElement","type","appendChild","styleSheet","cssText","createTextNode","__insertCSS","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","chain","callbacks","args","callback","isIPad","testPlatform","navigator","maxTouchPoints","isIOS","re","test","platform","visualViewport","isScrollable","node","getComputedStyle","overflow","overflowX","overflowY","getScrollParent","parentElement","scrollingElement","documentElement","nonTextInputTypes","Set","restore","preventScrollCount","usePreventScroll","options","isDisabled","scrollable","lastY","onTouchStart","e","target","body","changedTouches","pageY","onTouchMove","preventDefault","y","scrollTop","bottom","scrollHeight","clientHeight","onTouchEnd","isInput","activeElement","transform","focus","requestAnimationFrame","onFocus","height","innerHeight","scrollIntoView","addEventListener","once","onWindowScroll","scrollTo","scrollX","pageXOffset","scrollY","pageYOffset","restoreStyles","setStyle","innerWidth","clientWidth","removeEvents","addEvent","passive","capture","preventScrollMobileSafari","element","value","cur","event","handler","removeEventListener","root","scrollableTop","getBoundingClientRect","top","targetTop","HTMLInputElement","has","HTMLTextAreaElement","HTMLElement","isContentEditable","useComposedRefs","refs","React.useCallback","useCallback","forEach","ref","setRef","composeRefs","previousBodyPosition","cache","WeakMap","set","el","styles","ignoreCache","originalStyles","Object","entries","key","startsWith","setProperty","reset","prop","get","isVertical","getTranslate","webkitTransform","mozTransform","mat","match","parseFloat","split","TRANSITIONS","DURATION","EASE","VELOCITY_THRESHOLD","useCallbackRef","callbackRef","useRef","useMemo","call","useControllableState","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","uncontrolledState","useState","prevValueRef","handleChange","useUncontrolledState","isControlled","nextValue","CLOSE_THRESHOLD","SCROLL_LOCK_TIMEOUT","BORDER_RADIUS","NESTED_DISPLACEMENT","WINDOW_TOP_OFFSET","DRAG_CLASS","Root","open","children","shouldScaleBackground","onDragProp","onReleaseProp","nested","setBackgroundColorOnScale","closeThreshold","scrollLockTimeout","fadeFromIndex","length","activeSnapPointProp","setActiveSnapPointProp","fixed","onClose","noBodyStyles","preventScrollRestoration","disablePreventScroll","_drawerRef_current","setIsOpen","hasBeenOpened","setHasBeenOpened","mounted","setMounted","setIsDragging","justReleased","setJustReleased","openTime","dragStartTime","dragEndTime","lastTimeDragPrevented","isAllowedToDrag","nestedOpenChangeTimer","pointerStart","previousDiffFromInitial","drawerHeightRef","initialDrawerHeight","onSnapPointChange","activeSnapPointIndex","Date","onReleaseSnapPoints","onDragSnapPoints","getPercentageDragged","getSnapPointsPercentageDragged","isLastSnapPoint","Number","isNaN","findIndex","snapPoint","_snapPoints_map","map","hasWindow","isPx","snapPointAsNumber","parseInt","width","activeSnapPointOffset","snapToPoint","dimension","_snapPointsOffset_findIndex","newSnapPointIndex","snapPointDim","transition","join","opacity","_snapPoints_findIndex","newIndex","absDraggedDistance","isDraggingDown","isOverlaySnapPoint","targetSnapPointIndex","snapPointDistance","percentageDragged","Math","abs","draggedDistance","velocity","currentPosition","isFirst","hasDraggedUp","closestSnapPoint","reduce","prev","curr","dim","dragDirection","newValue","useSnapPoints","restorePositionSetting","activeUrl","setActiveUrl","location","href","scrollPos","setPositionFixed","position","left","right","assign","setTimeout","bottomBarHeight","x","onScroll","matchMedia","matches","usePositionFixed","getScale","shouldDrag","isDraggingInDirection","_window_getSelection","highlightedText","getSelection","toString","swipeAmount","date","hasAttribute","closest","getTime","getAttribute","parentNode","classList","remove","resetDrawer","wrapper","querySelector","currentSwipeAmount","borderRadius","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","background","backgroundColor","_window_visualViewport","onVisualViewportChange","visualViewportHeight","diffFromInitial","drawerHeight","offsetFromTop","newDrawerHeight","max","id","clearTimeout","scrollBehavior","querySelectorAll","child","htmlChild","scrollWidth","add","DialogPrimitive.Root","o","Provider","contains","setPointerCapture","pointerId","clientY","clientX","timeTaken","distMoved","_drawerRef_current_getBoundingClientRect_height","min","v","directionMultiplier","noCloseSnapPointsPreCondition","snapPointPercentageDragged","dampenedDraggedDistance","log","translateValue","opacityValue","scaleValue","borderRadiusValue","initialDim","initialScale","newScale","newTranslate","scale","translate","Handle","React","forwardRef","preventCycle","rest","closeTimeoutIdRef","shouldCancelInteractionRef","handleCancelInteraction","onClick","currentSnapIndex","point","nextSnapPoint","onDoubleClick","onPointerCancel","onPointerDown","onPointerMove","displayName","Overlay","composedRef","hasSnapPoints","DialogPrimitive.Overlay","onMouseUp","Content","onOpenAutoFocus","onPointerDownOutside","onAnimationEnd","pointerStartRef","wasBeyondThePointRef","DialogPrimitive.Content","defaultPrevented","onFocusOutside","onEscapeKeyDown","yPosition","xPosition","swipeStartThreshold","pointerType","isAllowedToSwipe","delta","threshold","deltaY","deltaX","isDeltaX","dFactor","includes","isDeltaInDirection","onPointerUp","Drawer","NestedRoot","p","Trigger","Portal","Close","Title","Description"],"mappings":"4IAcA,MAAMA,EAAgBC,EAAeC,cAAc,CAC/CC,UAAW,CACPC,QAAS,MAEbC,WAAY,CACRD,QAAS,MAEbE,gBAAiB,OACjBC,QAAS,OACTC,UAAW,OACXC,OAAQ,OACRC,aAAc,OACdC,mBAAoB,OACpBC,gBAAiB,OACjBC,cAAU,EACVC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACRC,YAAY,EACZC,eAAgB,CACZd,SAAS,GAEbe,iBAAkB,KAClBC,WAAY,KACZC,OAAO,EACPC,YAAY,EACZC,gBAAiB,KACjBC,aAAc,OACdC,mBAAoB,OACpBC,SAAS,EACTC,YAAa,OACbC,WAAY,OACZC,UAAW,WAETC,EAAmB,KACf,MAAA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