bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
1 lines • 95 kB
Source Map (JSON)
{"version":3,"file":"PopperContent-BTUvv6Tu.mjs","names":["count","useId"],"sources":["../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/handleAndDispatchCustomEvent.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useBodyScrollLock.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useEmitAsProps.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFocusGuards.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useForwardProps.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useForwardPropsEmits.js","../../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useHideOthers.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useId.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useSize.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useStateMachine.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Presence/usePresence.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Presence/Presence.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/DismissableLayer/utils.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/DismissableLayer/DismissableLayer.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/FocusScope/stack.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/FocusScope/utils.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/FocusScope/FocusScope.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Teleport/Teleport.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Popper/PopperRoot.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Popper/PopperAnchor.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Popper/utils.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Popper/PopperContent.js"],"sourcesContent":["//#region src/shared/handleAndDispatchCustomEvent.ts\nfunction handleAndDispatchCustomEvent(name, handler, detail) {\n\tconst target = detail.originalEvent.target;\n\tconst event = new CustomEvent(name, {\n\t\tbubbles: false,\n\t\tcancelable: true,\n\t\tdetail\n\t});\n\tif (handler) target.addEventListener(name, handler, { once: true });\n\ttarget.dispatchEvent(event);\n}\n\n//#endregion\nexport { handleAndDispatchCustomEvent };\n//# sourceMappingURL=handleAndDispatchCustomEvent.js.map","import { injectConfigProviderContext } from \"../ConfigProvider/ConfigProvider.js\";\nimport { computed, nextTick, ref, watch } from \"vue\";\nimport { createSharedComposable, useEventListener } from \"@vueuse/core\";\nimport { isClient, isIOS, tryOnBeforeUnmount } from \"@vueuse/shared\";\nimport { defu } from \"defu\";\n\n//#region src/shared/useBodyScrollLock.ts\nconst useBodyLockStackCount = createSharedComposable(() => {\n\tconst map = ref(/* @__PURE__ */ new Map());\n\tconst initialOverflow = ref();\n\tconst locked = computed(() => {\n\t\tfor (const value of map.value.values()) if (value) return true;\n\t\treturn false;\n\t});\n\tconst context = injectConfigProviderContext({ scrollBody: ref(true) });\n\tlet stopTouchMoveListener = null;\n\tconst resetBodyStyle = () => {\n\t\tdocument.body.style.paddingRight = \"\";\n\t\tdocument.body.style.marginRight = \"\";\n\t\tdocument.body.style.pointerEvents = \"\";\n\t\tdocument.documentElement.style.removeProperty(\"--scrollbar-width\");\n\t\tdocument.body.style.overflow = initialOverflow.value ?? \"\";\n\t\tisIOS && stopTouchMoveListener?.();\n\t\tinitialOverflow.value = void 0;\n\t};\n\twatch(locked, (val, oldVal) => {\n\t\tif (!isClient) return;\n\t\tif (!val) {\n\t\t\tif (oldVal) resetBodyStyle();\n\t\t\treturn;\n\t\t}\n\t\tif (initialOverflow.value === void 0) initialOverflow.value = document.body.style.overflow;\n\t\tconst verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n\t\tconst defaultConfig = {\n\t\t\tpadding: verticalScrollbarWidth,\n\t\t\tmargin: 0\n\t\t};\n\t\tconst config = context.scrollBody?.value ? typeof context.scrollBody.value === \"object\" ? defu({\n\t\t\tpadding: context.scrollBody.value.padding === true ? verticalScrollbarWidth : context.scrollBody.value.padding,\n\t\t\tmargin: context.scrollBody.value.margin === true ? verticalScrollbarWidth : context.scrollBody.value.margin\n\t\t}, defaultConfig) : defaultConfig : {\n\t\t\tpadding: 0,\n\t\t\tmargin: 0\n\t\t};\n\t\tif (verticalScrollbarWidth > 0) {\n\t\t\tdocument.body.style.paddingRight = typeof config.padding === \"number\" ? `${config.padding}px` : String(config.padding);\n\t\t\tdocument.body.style.marginRight = typeof config.margin === \"number\" ? `${config.margin}px` : String(config.margin);\n\t\t\tdocument.documentElement.style.setProperty(\"--scrollbar-width\", `${verticalScrollbarWidth}px`);\n\t\t\tdocument.body.style.overflow = \"hidden\";\n\t\t}\n\t\tif (isIOS) stopTouchMoveListener = useEventListener(document, \"touchmove\", (e) => preventDefault(e), { passive: false });\n\t\tnextTick(() => {\n\t\t\tif (!locked.value) return;\n\t\t\tdocument.body.style.pointerEvents = \"none\";\n\t\t\tdocument.body.style.overflow = \"hidden\";\n\t\t});\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"sync\"\n\t});\n\treturn map;\n});\nfunction useBodyScrollLock(initialState) {\n\tconst id = Math.random().toString(36).substring(2, 7);\n\tconst map = useBodyLockStackCount();\n\tmap.value.set(id, initialState ?? false);\n\tconst locked = computed({\n\t\tget: () => map.value.get(id) ?? false,\n\t\tset: (value) => map.value.set(id, value)\n\t});\n\ttryOnBeforeUnmount(() => {\n\t\tmap.value.delete(id);\n\t});\n\treturn locked;\n}\nfunction checkOverflowScroll(ele) {\n\tconst style = window.getComputedStyle(ele);\n\tif (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) return true;\n\telse {\n\t\tconst parent = ele.parentNode;\n\t\tif (!(parent instanceof Element) || parent.tagName === \"BODY\") return false;\n\t\treturn checkOverflowScroll(parent);\n\t}\n}\nfunction preventDefault(rawEvent) {\n\tconst e = rawEvent || window.event;\n\tconst _target = e.target;\n\tif (_target instanceof Element && checkOverflowScroll(_target)) return false;\n\tif (e.touches.length > 1) return true;\n\tif (e.preventDefault && e.cancelable) e.preventDefault();\n\treturn false;\n}\n\n//#endregion\nexport { useBodyScrollLock };\n//# sourceMappingURL=useBodyScrollLock.js.map","import { camelize, getCurrentInstance, toHandlerKey } from \"vue\";\n\n//#region src/shared/useEmitAsProps.ts\n/**\n* The `useEmitAsProps` function is a TypeScript utility that converts emitted events into props for a\n* Vue component.\n* @param emit - The `emit` parameter is a function that is used to emit events from a component. It\n* takes two parameters: `name` which is the name of the event to be emitted, and `...args` which are\n* the arguments to be passed along with the event.\n* @returns The function `useEmitAsProps` returns an object that maps event names to functions that\n* call the `emit` function with the corresponding event name and arguments.\n*/\nfunction useEmitAsProps(emit) {\n\tconst vm = getCurrentInstance();\n\tconst events = vm?.type.emits;\n\tconst result = {};\n\tif (!events?.length) console.warn(`No emitted event found. Please check component: ${vm?.type.__name}`);\n\tevents?.forEach((ev) => {\n\t\tresult[toHandlerKey(camelize(ev))] = (...arg) => emit(ev, ...arg);\n\t});\n\treturn result;\n}\n\n//#endregion\nexport { useEmitAsProps };\n//# sourceMappingURL=useEmitAsProps.js.map","import { watchEffect } from \"vue\";\nimport { isClient } from \"@vueuse/shared\";\n\n//#region src/shared/useFocusGuards.ts\n/** Number of components which have requested interest to have focus guards */\nlet count = 0;\n/**\n* Injects a pair of focus guards at the edges of the whole DOM tree\n* to ensure `focusin` & `focusout` events can be caught consistently.\n*/\nfunction useFocusGuards() {\n\twatchEffect((cleanupFn) => {\n\t\tif (!isClient) return;\n\t\tconst edgeGuards = document.querySelectorAll(\"[data-reka-focus-guard]\");\n\t\tdocument.body.insertAdjacentElement(\"afterbegin\", edgeGuards[0] ?? createFocusGuard());\n\t\tdocument.body.insertAdjacentElement(\"beforeend\", edgeGuards[1] ?? createFocusGuard());\n\t\tcount++;\n\t\tcleanupFn(() => {\n\t\t\tif (count === 1) document.querySelectorAll(\"[data-reka-focus-guard]\").forEach((node) => node.remove());\n\t\t\tcount--;\n\t\t});\n\t});\n}\nfunction createFocusGuard() {\n\tconst element = document.createElement(\"span\");\n\telement.setAttribute(\"data-reka-focus-guard\", \"\");\n\telement.tabIndex = 0;\n\telement.style.outline = \"none\";\n\telement.style.opacity = \"0\";\n\telement.style.position = \"fixed\";\n\telement.style.pointerEvents = \"none\";\n\treturn element;\n}\n\n//#endregion\nexport { useFocusGuards };\n//# sourceMappingURL=useFocusGuards.js.map","import { camelize, computed, getCurrentInstance, toRef } from \"vue\";\n\n//#region src/shared/useForwardProps.ts\n/**\n* The `useForwardProps` function in TypeScript takes in a set of props and returns a computed value\n* that combines default props with assigned props from the current instance.\n* @param {T} props - The `props` parameter is an object that represents the props passed to a\n* component.\n* @returns computed value that combines the default props, preserved props, and assigned props.\n*/\nfunction useForwardProps(props) {\n\tconst vm = getCurrentInstance();\n\tconst defaultProps = Object.keys(vm?.type.props ?? {}).reduce((prev, curr) => {\n\t\tconst defaultValue = (vm?.type.props[curr]).default;\n\t\tif (defaultValue !== void 0) prev[curr] = defaultValue;\n\t\treturn prev;\n\t}, {});\n\tconst refProps = toRef(props);\n\treturn computed(() => {\n\t\tconst preservedProps = {};\n\t\tconst assignedProps = vm?.vnode.props ?? {};\n\t\tObject.keys(assignedProps).forEach((key) => {\n\t\t\tpreservedProps[camelize(key)] = assignedProps[key];\n\t\t});\n\t\treturn Object.keys({\n\t\t\t...defaultProps,\n\t\t\t...preservedProps\n\t\t}).reduce((prev, curr) => {\n\t\t\tif (refProps.value[curr] !== void 0) prev[curr] = refProps.value[curr];\n\t\t\treturn prev;\n\t\t}, {});\n\t});\n}\n\n//#endregion\nexport { useForwardProps };\n//# sourceMappingURL=useForwardProps.js.map","import { useEmitAsProps } from \"./useEmitAsProps.js\";\nimport { useForwardProps } from \"./useForwardProps.js\";\nimport { computed } from \"vue\";\n\n//#region src/shared/useForwardPropsEmits.ts\n/**\n* The function `useForwardPropsEmits` takes in props and an optional emit function, and returns a\n* computed object that combines the parsed props and emits as props.\n* @param {T} props - The `props` parameter is of type `T`, which is a generic type that extends the\n* parameters of the `useForwardProps` function. It represents the props object that is passed to the\n* `useForwardProps` function.\n* @param [emit] - The `emit` parameter is a function that can be used to emit events. It takes two\n* arguments: `name`, which is the name of the event to be emitted, and `args`, which are the arguments\n* to be passed along with the event.\n* @returns a computed property that combines the parsed\n* props and emits as props.\n*/\nfunction useForwardPropsEmits(props, emit) {\n\tconst parsedProps = useForwardProps(props);\n\tconst emitsAsProps = emit ? useEmitAsProps(emit) : {};\n\treturn computed(() => ({\n\t\t...parsedProps.value,\n\t\t...emitsAsProps\n\t}));\n}\n\n//#endregion\nexport { useForwardPropsEmits };\n//# sourceMappingURL=useForwardPropsEmits.js.map","var getDefaultParent = function (originalTarget) {\n if (typeof document === 'undefined') {\n return null;\n }\n var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;\n return sampleTarget.ownerDocument.body;\n};\nvar counterMap = new WeakMap();\nvar uncontrolledNodes = new WeakMap();\nvar markerMap = {};\nvar lockCount = 0;\nvar unwrapHost = function (node) {\n return node && (node.host || unwrapHost(node.parentNode));\n};\nvar correctTargets = function (parent, targets) {\n return targets\n .map(function (target) {\n if (parent.contains(target)) {\n return target;\n }\n var correctedTarget = unwrapHost(target);\n if (correctedTarget && parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');\n return null;\n })\n .filter(function (x) { return Boolean(x); });\n};\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @param {String} [controlAttribute] - html Attribute to control\n * @return {Undo} undo command\n */\nvar applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {\n var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n var markerCounter = markerMap[markerName];\n var hiddenNodes = [];\n var elementsToKeep = new Set();\n var elementsToStop = new Set(targets);\n var keep = function (el) {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n elementsToKeep.add(el);\n keep(el.parentNode);\n };\n targets.forEach(keep);\n var deep = function (parent) {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n Array.prototype.forEach.call(parent.children, function (node) {\n if (elementsToKeep.has(node)) {\n deep(node);\n }\n else {\n try {\n var attr = node.getAttribute(controlAttribute);\n var alreadyHidden = attr !== null && attr !== 'false';\n var counterValue = (counterMap.get(node) || 0) + 1;\n var markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, 'true');\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n catch (e) {\n console.error('aria-hidden: cannot operate on ', node, e);\n }\n }\n });\n };\n deep(parentNode);\n elementsToKeep.clear();\n lockCount++;\n return function () {\n hiddenNodes.forEach(function (node) {\n var counterValue = counterMap.get(node) - 1;\n var markerValue = markerCounter.get(node) - 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n if (!counterValue) {\n if (!uncontrolledNodes.has(node)) {\n node.removeAttribute(controlAttribute);\n }\n uncontrolledNodes.delete(node);\n }\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n lockCount--;\n if (!lockCount) {\n // clear\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledNodes = new WeakMap();\n markerMap = {};\n }\n };\n};\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var hideOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-aria-hidden'; }\n var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n var activeParentNode = parentNode || getDefaultParent(originalTarget);\n if (!activeParentNode) {\n return function () { return null; };\n }\n // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10\n // and script elements, as they have no impact on accessibility.\n targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script')));\n return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');\n};\n/**\n * Marks everything except given node(or nodes) as inert\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var inertOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-inert-ed'; }\n var activeParentNode = parentNode || getDefaultParent(originalTarget);\n if (!activeParentNode) {\n return function () { return null; };\n }\n return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert');\n};\n/**\n * @returns if current browser supports inert\n */\nexport var supportsInert = function () {\n return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert');\n};\n/**\n * Automatic function to \"suppress\" DOM elements - _hide_ or _inert_ in the best possible way\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Undo} undo command\n */\nexport var suppressOthers = function (originalTarget, parentNode, markerName) {\n if (markerName === void 0) { markerName = 'data-suppressed'; }\n return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);\n};\n","import { onUnmounted, watch } from \"vue\";\nimport { unrefElement } from \"@vueuse/core\";\nimport { hideOthers } from \"aria-hidden\";\n\n//#region src/shared/useHideOthers.ts\n/**\n* The `useHideOthers` function is a TypeScript function that takes a target element reference and\n* hides all other elements in ARIA when the target element is present, and restores the visibility of the\n* hidden elements when the target element is removed.\n* @param {MaybeElementRef} target - The `target` parameter is a reference to the element that you want\n* to hide other elements when it is clicked or focused.\n*/\nfunction useHideOthers(target) {\n\tlet undo;\n\twatch(() => unrefElement(target), (el) => {\n\t\tlet isInsideClosedPopover = false;\n\t\ttry {\n\t\t\tisInsideClosedPopover = !!el?.closest(\"[popover]:not(:popover-open)\");\n\t\t} catch {}\n\t\tif (el && !isInsideClosedPopover) undo = hideOthers(el);\n\t\telse if (undo) undo();\n\t});\n\tonUnmounted(() => {\n\t\tif (undo) undo();\n\t});\n}\n\n//#endregion\nexport { useHideOthers };\n//# sourceMappingURL=useHideOthers.js.map","import { injectConfigProviderContext } from \"../ConfigProvider/ConfigProvider.js\";\nimport * as vue from \"vue\";\n\n//#region src/shared/useId.ts\nlet count = 0;\n/**\n* The `useId` function generates a unique identifier using a provided deterministic ID or a default\n* one prefixed with \"reka-\", or the provided one via `useId` props from `<ConfigProvider>`.\n* @param {string | null | undefined} [deterministicId] - The `useId` function you provided takes an\n* optional parameter `deterministicId`, which can be a string, null, or undefined. If\n* `deterministicId` is provided, the function will return it. Otherwise, it will generate an id using\n* the `useId` function obtained\n*/\nfunction useId(deterministicId, prefix = \"reka\") {\n\tif (deterministicId) return deterministicId;\n\tlet id;\n\tif (\"useId\" in vue) id = vue.useId?.();\n\telse {\n\t\tconst configProviderContext = injectConfigProviderContext({ useId: void 0 });\n\t\tid = configProviderContext.useId?.() ?? `${++count}`;\n\t}\n\treturn prefix ? `${prefix}-${id}` : id;\n}\n\n//#endregion\nexport { useId };\n//# sourceMappingURL=useId.js.map","import { computed, onMounted, ref } from \"vue\";\nimport { unrefElement } from \"@vueuse/core\";\n\n//#region src/shared/useSize.ts\nfunction useSize(element) {\n\tconst size = ref();\n\tconst width = computed(() => size.value?.width ?? 0);\n\tconst height = computed(() => size.value?.height ?? 0);\n\tonMounted(() => {\n\t\tconst el = unrefElement(element);\n\t\tif (el) {\n\t\t\tsize.value = {\n\t\t\t\twidth: el.offsetWidth,\n\t\t\t\theight: el.offsetHeight\n\t\t\t};\n\t\t\tconst resizeObserver = new ResizeObserver((entries) => {\n\t\t\t\tif (!Array.isArray(entries)) return;\n\t\t\t\tif (!entries.length) return;\n\t\t\t\tconst entry = entries[0];\n\t\t\t\tlet width$1;\n\t\t\t\tlet height$1;\n\t\t\t\tif (\"borderBoxSize\" in entry) {\n\t\t\t\t\tconst borderSizeEntry = entry.borderBoxSize;\n\t\t\t\t\tconst borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n\t\t\t\t\twidth$1 = borderSize.inlineSize;\n\t\t\t\t\theight$1 = borderSize.blockSize;\n\t\t\t\t} else {\n\t\t\t\t\twidth$1 = el.offsetWidth;\n\t\t\t\t\theight$1 = el.offsetHeight;\n\t\t\t\t}\n\t\t\t\tsize.value = {\n\t\t\t\t\twidth: width$1,\n\t\t\t\t\theight: height$1\n\t\t\t\t};\n\t\t\t});\n\t\t\tresizeObserver.observe(el, { box: \"border-box\" });\n\t\t\treturn () => resizeObserver.unobserve(el);\n\t\t} else size.value = void 0;\n\t});\n\treturn {\n\t\twidth,\n\t\theight\n\t};\n}\n\n//#endregion\nexport { useSize };\n//# sourceMappingURL=useSize.js.map","import { ref } from \"vue\";\n\n//#region src/shared/useStateMachine.ts\n/**\n* The `useStateMachine` function is a TypeScript function that creates a state machine and returns the\n* current state and a dispatch function to update the state based on events.\n* @param initialState - The `initialState` parameter is the initial state of the state machine. It\n* represents the starting point of the state machine's state.\n* @param machine - The `machine` parameter is an object that represents a state machine. It should\n* have keys that correspond to the possible states of the machine, and the values should be objects\n* that represent the possible events and their corresponding next states.\n* @returns The `useStateMachine` function returns an object with two properties: `state` and\n* `dispatch`.\n*/\nfunction useStateMachine(initialState, machine) {\n\tconst state = ref(initialState);\n\tfunction reducer(event) {\n\t\tconst nextState = machine[state.value][event];\n\t\treturn nextState ?? state.value;\n\t}\n\tconst dispatch = (event) => {\n\t\tstate.value = reducer(event);\n\t};\n\treturn {\n\t\tstate,\n\t\tdispatch\n\t};\n}\n\n//#endregion\nexport { useStateMachine };\n//# sourceMappingURL=useStateMachine.js.map","import { useStateMachine } from \"../shared/useStateMachine.js\";\nimport { computed, nextTick, onUnmounted, ref, watch } from \"vue\";\nimport { defaultWindow } from \"@vueuse/core\";\nimport { isClient } from \"@vueuse/shared\";\n\n//#region src/Presence/usePresence.ts\nfunction usePresence(present, node) {\n\tconst stylesRef = ref({});\n\tconst prevAnimationNameRef = ref(\"none\");\n\tconst prevPresentRef = ref(present);\n\tconst initialState = present.value ? \"mounted\" : \"unmounted\";\n\tlet timeoutId;\n\tconst ownerWindow = node.value?.ownerDocument.defaultView ?? defaultWindow;\n\tconst { state, dispatch } = useStateMachine(initialState, {\n\t\tmounted: {\n\t\t\tUNMOUNT: \"unmounted\",\n\t\t\tANIMATION_OUT: \"unmountSuspended\"\n\t\t},\n\t\tunmountSuspended: {\n\t\t\tMOUNT: \"mounted\",\n\t\t\tANIMATION_END: \"unmounted\"\n\t\t},\n\t\tunmounted: { MOUNT: \"mounted\" }\n\t});\n\tconst dispatchCustomEvent = (name) => {\n\t\tif (isClient) {\n\t\t\tconst customEvent = new CustomEvent(name, {\n\t\t\t\tbubbles: false,\n\t\t\t\tcancelable: false\n\t\t\t});\n\t\t\tnode.value?.dispatchEvent(customEvent);\n\t\t}\n\t};\n\twatch(present, async (currentPresent, prevPresent) => {\n\t\tconst hasPresentChanged = prevPresent !== currentPresent;\n\t\tawait nextTick();\n\t\tif (hasPresentChanged) {\n\t\t\tconst prevAnimationName = prevAnimationNameRef.value;\n\t\t\tconst currentAnimationName = getAnimationName(node.value);\n\t\t\tif (currentPresent) {\n\t\t\t\tdispatch(\"MOUNT\");\n\t\t\t\tdispatchCustomEvent(\"enter\");\n\t\t\t\tif (currentAnimationName === \"none\") dispatchCustomEvent(\"after-enter\");\n\t\t\t} else if (currentAnimationName === \"none\" || currentAnimationName === \"undefined\" || stylesRef.value?.display === \"none\") {\n\t\t\t\tdispatch(\"UNMOUNT\");\n\t\t\t\tdispatchCustomEvent(\"leave\");\n\t\t\t\tdispatchCustomEvent(\"after-leave\");\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t* When `present` changes to `false`, we check changes to animation-name to\n\t\t\t\t* determine whether an animation has started. We chose this approach (reading\n\t\t\t\t* computed styles) because there is no `animationrun` event and `animationstart`\n\t\t\t\t* fires after `animation-delay` has expired which would be too late.\n\t\t\t\t*/\n\t\t\t\tconst isAnimating = prevAnimationName !== currentAnimationName;\n\t\t\t\tif (prevPresent && isAnimating) {\n\t\t\t\t\tdispatch(\"ANIMATION_OUT\");\n\t\t\t\t\tdispatchCustomEvent(\"leave\");\n\t\t\t\t} else {\n\t\t\t\t\tdispatch(\"UNMOUNT\");\n\t\t\t\t\tdispatchCustomEvent(\"after-leave\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, { immediate: true });\n\t/**\n\t* Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n\t* event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n\t* make sure we only trigger ANIMATION_END for the currently active animation.\n\t*/\n\tconst handleAnimationEnd = (event) => {\n\t\tconst currentAnimationName = getAnimationName(node.value);\n\t\tconst isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n\t\tconst directionName = state.value === \"mounted\" ? \"enter\" : \"leave\";\n\t\tif (event.target === node.value && isCurrentAnimation) {\n\t\t\tdispatchCustomEvent(`after-${directionName}`);\n\t\t\tdispatch(\"ANIMATION_END\");\n\t\t\tif (!prevPresentRef.value) {\n\t\t\t\tconst currentFillMode = node.value.style.animationFillMode;\n\t\t\t\tnode.value.style.animationFillMode = \"forwards\";\n\t\t\t\ttimeoutId = ownerWindow?.setTimeout(() => {\n\t\t\t\t\tif (node.value?.style.animationFillMode === \"forwards\") node.value.style.animationFillMode = currentFillMode;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (event.target === node.value && currentAnimationName === \"none\") dispatch(\"ANIMATION_END\");\n\t};\n\tconst handleAnimationStart = (event) => {\n\t\tif (event.target === node.value) prevAnimationNameRef.value = getAnimationName(node.value);\n\t};\n\tconst watcher = watch(node, (newNode, oldNode) => {\n\t\tif (newNode) {\n\t\t\tstylesRef.value = getComputedStyle(newNode);\n\t\t\tnewNode.addEventListener(\"animationstart\", handleAnimationStart);\n\t\t\tnewNode.addEventListener(\"animationcancel\", handleAnimationEnd);\n\t\t\tnewNode.addEventListener(\"animationend\", handleAnimationEnd);\n\t\t} else {\n\t\t\tdispatch(\"ANIMATION_END\");\n\t\t\tif (timeoutId !== void 0) ownerWindow?.clearTimeout(timeoutId);\n\t\t\toldNode?.removeEventListener(\"animationstart\", handleAnimationStart);\n\t\t\toldNode?.removeEventListener(\"animationcancel\", handleAnimationEnd);\n\t\t\toldNode?.removeEventListener(\"animationend\", handleAnimationEnd);\n\t\t}\n\t}, { immediate: true });\n\tconst stateWatcher = watch(state, () => {\n\t\tconst currentAnimationName = getAnimationName(node.value);\n\t\tprevAnimationNameRef.value = state.value === \"mounted\" ? currentAnimationName : \"none\";\n\t});\n\tonUnmounted(() => {\n\t\twatcher();\n\t\tstateWatcher();\n\t});\n\tconst isPresent = computed(() => [\"mounted\", \"unmountSuspended\"].includes(state.value));\n\treturn { isPresent };\n}\nfunction getAnimationName(node) {\n\treturn node ? getComputedStyle(node).animationName || \"none\" : \"none\";\n}\n\n//#endregion\nexport { usePresence };\n//# sourceMappingURL=usePresence.js.map","import { renderSlotFragments } from \"../shared/renderSlotFragments.js\";\nimport { usePresence } from \"./usePresence.js\";\nimport { defineComponent, getCurrentInstance, h, ref, toRefs } from \"vue\";\nimport { unrefElement } from \"@vueuse/core\";\n\n//#region src/Presence/Presence.ts\nvar Presence_default = defineComponent({\n\tname: \"Presence\",\n\tprops: {\n\t\tpresent: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true\n\t\t},\n\t\tforceMount: { type: Boolean }\n\t},\n\tslots: {},\n\tsetup(props, { slots, expose }) {\n\t\tconst { present, forceMount } = toRefs(props);\n\t\tconst node = ref();\n\t\tconst { isPresent } = usePresence(present, node);\n\t\texpose({ present: isPresent });\n\t\tlet children = slots.default({ present: isPresent.value });\n\t\tchildren = renderSlotFragments(children || []);\n\t\tconst instance = getCurrentInstance();\n\t\tif (children && children?.length > 1) {\n\t\t\tconst componentName = instance?.parent?.type.name ? `<${instance.parent.type.name} />` : \"component\";\n\t\t\tthrow new Error([\n\t\t\t\t`Detected an invalid children for \\`${componentName}\\` for \\`Presence\\` component.`,\n\t\t\t\t\"\",\n\t\t\t\t\"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.\",\n\t\t\t\t\"You can apply a few solutions:\",\n\t\t\t\t[\"Provide a single child element so that `presence` directive attach correctly.\", \"Ensure the first child is an actual element instead of a raw text node or comment node.\"].map((line) => ` - ${line}`).join(\"\\n\")\n\t\t\t].join(\"\\n\"));\n\t\t}\n\t\treturn () => {\n\t\t\tif (forceMount.value || present.value || isPresent.value) return h(slots.default({ present: isPresent.value })[0], { ref: (v) => {\n\t\t\t\tconst el = unrefElement(v);\n\t\t\t\tif (typeof el?.hasAttribute === \"undefined\") return el;\n\t\t\t\tif (el?.hasAttribute(\"data-reka-popper-content-wrapper\")) node.value = el.firstElementChild;\n\t\t\t\telse node.value = el;\n\t\t\t\treturn el;\n\t\t\t} });\n\t\t\telse return null;\n\t\t};\n\t}\n});\n\n//#endregion\nexport { Presence_default };\n//# sourceMappingURL=Presence.js.map","import { handleAndDispatchCustomEvent } from \"../shared/handleAndDispatchCustomEvent.js\";\nimport { nextTick, ref, toValue, watchEffect } from \"vue\";\nimport { isClient } from \"@vueuse/shared\";\n\n//#region src/DismissableLayer/utils.ts\nconst POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nconst FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nfunction isLayerExist(layerElement, targetElement) {\n\tif (!(targetElement instanceof Element)) return false;\n\tconst targetLayer = targetElement.closest(\"[data-dismissable-layer]\");\n\tconst mainLayer = layerElement.dataset.dismissableLayer === \"\" ? layerElement : layerElement.querySelector(\"[data-dismissable-layer]\");\n\tconst nodeList = Array.from(layerElement.ownerDocument.querySelectorAll(\"[data-dismissable-layer]\"));\n\tif (targetLayer && (mainLayer === targetLayer || nodeList.indexOf(mainLayer) < nodeList.indexOf(targetLayer))) return true;\n\telse return false;\n}\n/**\n* Listens for `pointerdown` outside a DOM subtree. We use `pointerdown` rather than `pointerup`\n* to mimic layer dismissing behaviour present in OS.\n* Returns props to pass to the node we want to check for outside events.\n*/\nfunction usePointerDownOutside(onPointerDownOutside, element, enabled = true) {\n\tconst ownerDocument = element?.value?.ownerDocument ?? globalThis?.document;\n\tconst isPointerInsideDOMTree = ref(false);\n\tconst handleClickRef = ref(() => {});\n\twatchEffect((cleanupFn) => {\n\t\tif (!isClient || !toValue(enabled)) return;\n\t\tconst handlePointerDown = async (event) => {\n\t\t\tconst target = event.target;\n\t\t\tif (!element?.value || !target) return;\n\t\t\tif (isLayerExist(element.value, target)) {\n\t\t\t\tisPointerInsideDOMTree.value = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (event.target && !isPointerInsideDOMTree.value) {\n\t\t\t\tconst eventDetail = { originalEvent: event };\n\t\t\t\tfunction handleAndDispatchPointerDownOutsideEvent() {\n\t\t\t\t\thandleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, onPointerDownOutside, eventDetail);\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t* On touch devices, we need to wait for a click event because browsers implement\n\t\t\t\t* a ~350ms delay between the time the user stops touching the display and when the\n\t\t\t\t* browser executes events. We need to ensure we don't reactivate pointer-events within\n\t\t\t\t* this timeframe otherwise the browser may execute events that should have been prevented.\n\t\t\t\t*\n\t\t\t\t* Additionally, this also lets us deal automatically with cancellations when a click event\n\t\t\t\t* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.\n\t\t\t\t*\n\t\t\t\t* This is why we also continuously remove the previous listener, because we cannot be\n\t\t\t\t* certain that it was raised, and therefore cleaned-up.\n\t\t\t\t*/\n\t\t\t\tif (event.pointerType === \"touch\") {\n\t\t\t\t\townerDocument.removeEventListener(\"click\", handleClickRef.value);\n\t\t\t\t\thandleClickRef.value = handleAndDispatchPointerDownOutsideEvent;\n\t\t\t\t\townerDocument.addEventListener(\"click\", handleClickRef.value, { once: true });\n\t\t\t\t} else handleAndDispatchPointerDownOutsideEvent();\n\t\t\t} else ownerDocument.removeEventListener(\"click\", handleClickRef.value);\n\t\t\tisPointerInsideDOMTree.value = false;\n\t\t};\n\t\t/**\n\t\t* if this hook executes in a component that mounts via a `pointerdown` event, the event\n\t\t* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n\t\t* this by delaying the event listener registration on the document.\n\t\t* This is how the DOM works, ie:\n\t\t* ```\n\t\t* button.addEventListener('pointerdown', () => {\n\t\t* console.log('I will log');\n\t\t* document.addEventListener('pointerdown', () => {\n\t\t* console.log('I will also log');\n\t\t* })\n\t\t* });\n\t\t*/\n\t\tconst timerId = window.setTimeout(() => {\n\t\t\townerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n\t\t}, 0);\n\t\tcleanupFn(() => {\n\t\t\twindow.clearTimeout(timerId);\n\t\t\townerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n\t\t\townerDocument.removeEventListener(\"click\", handleClickRef.value);\n\t\t});\n\t});\n\treturn { onPointerDownCapture: () => {\n\t\tif (!toValue(enabled)) return;\n\t\tisPointerInsideDOMTree.value = true;\n\t} };\n}\n/**\n* Listens for when focus happens outside a DOM subtree.\n* Returns props to pass to the root (node) of the subtree we want to check.\n*/\nfunction useFocusOutside(onFocusOutside, element, enabled = true) {\n\tconst ownerDocument = element?.value?.ownerDocument ?? globalThis?.document;\n\tconst isFocusInsideDOMTree = ref(false);\n\twatchEffect((cleanupFn) => {\n\t\tif (!isClient || !toValue(enabled)) return;\n\t\tconst handleFocus = async (event) => {\n\t\t\tif (!element?.value) return;\n\t\t\tawait nextTick();\n\t\t\tawait nextTick();\n\t\t\tconst target = event.target;\n\t\t\tif (!element.value || !target || isLayerExist(element.value, target)) return;\n\t\t\tif (event.target && !isFocusInsideDOMTree.value) {\n\t\t\t\tconst eventDetail = { originalEvent: event };\n\t\t\t\thandleAndDispatchCustomEvent(FOCUS_OUTSIDE, onFocusOutside, eventDetail);\n\t\t\t}\n\t\t};\n\t\townerDocument.addEventListener(\"focusin\", handleFocus);\n\t\tcleanupFn(() => ownerDocument.removeEventListener(\"focusin\", handleFocus));\n\t});\n\treturn {\n\t\tonFocusCapture: () => {\n\t\t\tif (!toValue(enabled)) return;\n\t\t\tisFocusInsideDOMTree.value = true;\n\t\t},\n\t\tonBlurCapture: () => {\n\t\t\tif (!toValue(enabled)) return;\n\t\t\tisFocusInsideDOMTree.value = false;\n\t\t}\n\t};\n}\n\n//#endregion\nexport { useFocusOutside, usePointerDownOutside };\n//# sourceMappingURL=utils.js.map","import { isNullish } from \"../shared/nullish.js\";\nimport { useForwardExpose } from \"../shared/useForwardExpose.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { useFocusOutside, usePointerDownOutside } from \"./utils.js\";\nimport { computed, createBlock, defineComponent, nextTick, normalizeStyle, openBlock, reactive, renderSlot, unref, watchEffect, withCtx } from \"vue\";\nimport { onKeyStroke } from \"@vueuse/core\";\n\n//#region src/DismissableLayer/DismissableLayer.vue?vue&type=script&setup=true&lang.ts\nconst context = reactive({\n\tlayersRoot: /* @__PURE__ */ new Set(),\n\tlayersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n\toriginalBodyPointerEvents: void 0,\n\tbranches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"DismissableLayer\",\n\tprops: {\n\t\tdisableOutsidePointerEvents: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t}\n\t},\n\temits: [\n\t\t\"escapeKeyDown\",\n\t\t\"pointerDownOutside\",\n\t\t\"focusOutside\",\n\t\t\"interactOutside\",\n\t\t\"dismiss\"\n\t],\n\tsetup(__props, { emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst { forwardRef, currentElement: layerElement } = useForwardExpose();\n\t\tconst ownerDocument = computed(() => layerElement.value?.ownerDocument ?? globalThis.document);\n\t\tconst layers = computed(() => context.layersRoot);\n\t\tconst index = computed(() => {\n\t\t\treturn layerElement.value ? Array.from(layers.value).indexOf(layerElement.value) : -1;\n\t\t});\n\t\tconst isBodyPointerEventsDisabled = computed(() => {\n\t\t\treturn context.layersWithOutsidePointerEventsDisabled.size > 0;\n\t\t});\n\t\tconst isPointerEventsEnabled = computed(() => {\n\t\t\tconst localLayers = Array.from(layers.value);\n\t\t\tconst [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n\t\t\tconst highestLayerWithOutsidePointerEventsDisabledIndex = localLayers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n\t\t\treturn index.value >= highestLayerWithOutsidePointerEventsDisabledIndex;\n\t\t});\n\t\tconst pointerDownOutside = usePointerDownOutside(async (event) => {\n\t\t\tconst isPointerDownOnBranch = [...context.branches].some((branch) => branch?.contains(event.target));\n\t\t\tif (!isPointerEventsEnabled.value || isPointerDownOnBranch) return;\n\t\t\temits(\"pointerDownOutside\", event);\n\t\t\temits(\"interactOutside\", event);\n\t\t\tawait nextTick();\n\t\t\tif (!event.defaultPrevented) emits(\"dismiss\");\n\t\t}, layerElement);\n\t\tconst focusOutside = useFocusOutside((event) => {\n\t\t\tconst isFocusInBranch = [...context.branches].some((branch) => branch?.contains(event.target));\n\t\t\tif (isFocusInBranch) return;\n\t\t\temits(\"focusOutside\", event);\n\t\t\temits(\"interactOutside\", event);\n\t\t\tif (!event.defaultPrevented) emits(\"dismiss\");\n\t\t}, layerElement);\n\t\tonKeyStroke(\"Escape\", (event) => {\n\t\t\tconst isHighestLayer = index.value === layers.value.size - 1;\n\t\t\tif (!isHighestLayer) return;\n\t\t\temits(\"escapeKeyDown\", event);\n\t\t\tif (!event.defaultPrevented) emits(\"dismiss\");\n\t\t});\n\t\twatchEffect((cleanupFn) => {\n\t\t\tif (!layerElement.value) return;\n\t\t\tif (props.disableOutsidePointerEvents) {\n\t\t\t\tif (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n\t\t\t\t\tcontext.originalBodyPointerEvents = ownerDocument.value.body.style.pointerEvents;\n\t\t\t\t\townerDocument.value.body.style.pointerEvents = \"none\";\n\t\t\t\t}\n\t\t\t\tcontext.layersWithOutsidePointerEventsDisabled.add(layerElement.value);\n\t\t\t}\n\t\t\tlayers.value.add(layerElement.value);\n\t\t\tcleanupFn(() => {\n\t\t\t\tif (props.disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1 && !isNullish(context.originalBodyPointerEvents)) ownerDocument.value.body.style.pointerEvents = context.originalBodyPointerEvents;\n\t\t\t});\n\t\t});\n\t\twatchEffect((cleanupFn) => {\n\t\t\tcleanupFn(() => {\n\t\t\t\tif (!layerElement.value) return;\n\t\t\t\tlayers.value.delete(layerElement.value);\n\t\t\t\tcontext.layersWithOutsidePointerEventsDisabled.delete(layerElement.value);\n\t\t\t});\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), {\n\t\t\t\tref: unref(forwardRef),\n\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\tas: _ctx.as,\n\t\t\t\t\"data-dismissable-layer\": \"\",\n\t\t\t\tstyle: normalizeStyle({ pointerEvents: isBodyPointerEventsDisabled.value ? isPointerEventsEnabled.value ? \"auto\" : \"none\" : void 0 }),\n\t\t\t\tonFocusCapture: unref(focusOutside).onFocusCapture,\n\t\t\t\tonBlurCapture: unref(focusOutside).onBlurCapture,\n\t\t\t\tonPointerdownCapture: unref(pointerDownOutside).onPointerDownCapture\n\t\t\t}, {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\")]),\n\t\t\t\t_: 3\n\t\t\t}, 8, [\n\t\t\t\t\"as-child\",\n\t\t\t\t\"as\",\n\t\t\t\t\"style\",\n\t\t\t\t\"onFocusCapture\",\n\t\t\t\t\"onBlurCapture\",\n\t\t\t\t\"onPointerdownCapture\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/DismissableLayer/DismissableLayer.vue\nvar DismissableLayer_default = DismissableLayer_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { DismissableLayer_default, context };\n//# sourceMappingURL=DismissableLayer.js.map","import { ref } from \"vue\";\nimport { createGlobalState } from \"@vueuse/core\";\n\n//#region src/FocusScope/stack.ts\nconst useFocusStackState = createGlobalState(() => {\n\tconst stack = ref([]);\n\treturn stack;\n});\nfunction createFocusScopesStack() {\n\t/** A stack of focus scopes, with the active one at the top */\n\tconst stack = useFocusStackState();\n\treturn {\n\t\tadd(focusScope) {\n\t\t\tconst activeFocusScope = stack.value[0];\n\t\t\tif (focusScope !== activeFocusScope) activeFocusScope?.pause();\n\t\t\tstack.value = arrayRemove(stack.value, focusScope);\n\t\t\tstack.value.unshift(focusScope);\n\t\t},\n\t\tremove(focusScope) {\n\t\t\tstack.value = arrayRemove(stack.value, focusScope);\n\t\t\tstack.value[0]?.resume();\n\t\t}\n\t};\n}\nfunction arrayRemove(array, item) {\n\tconst updatedArray = [...array];\n\tconst index = updatedArray.indexOf(item);\n\tif (index !== -1) updatedArray.splice(index, 1);\n\treturn updatedArray;\n}\n\n//#endregion\nexport { createFocusScopesStack };\n//# sourceMappingURL=stack.js.map","import { getActiveElement } from \"../shared/getActiveElement.js\";\n\n//#region src/FocusScope/utils.ts\nconst AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nconst AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nconst EVENT_OPTIONS = {\n\tbubbles: false,\n\tcancelable: true\n};\n/**\n* Attempts focusing the first element in a list of candidates.\n* Stops when focus has actually moved.\n*/\nfunction focusFirst(candidates, { select = false } = {}) {\n\tconst previouslyFocusedElement = getActiveElement();\n\tfor (const candidate of candidates) {\n\t\tfocus(candidate, { select });\n\t\tif (getActiveElement() !== previouslyFocusedElement) return true;\n\t}\n}\n/**\n* Returns the first and last tabbable elements inside a container.\n*/\nfunction getTabbableEdges(container) {\n\tconst candidates = getTabbableCandidates(container);\n\tconst first = findVisible(candidates, container);\n\tconst last = findVisible(candidates.reverse(), container);\n\treturn [first, last];\n}\n/**\n* Returns a list of potential tabbable candidates.\n*\n* NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n* elements are not visible. This cannot be worked out easily by just reading a property, but rather\n* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n*\n* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n*/\nfunction getTabbableCandidates(container) {\n\tconst nodes = [];\n\tconst walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {\n\t\tconst isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n\t\tif (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n\t\treturn node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n\t} });\n\twhile (walker.nextNode()) nodes.push(walker.currentNode);\n\treturn nodes;\n}\n/**\n* Returns the first visible element in a list.\n* NOTE: Only checks visibility up to the `container`.\n*/\nfunction findVisible(elements, container) {\n\tfor (const element of elements) if (!isHidden(element, { upTo: container })) return element;\n}\nfunction isHidden(node, { upTo }) {\n\tif (getComputedStyle(node).visibility === \"hidden\") return true;\n\twhile (node) {\n\t\tif (upTo !== void 0 && node === upTo) return false;\n\t\tif (getComputedStyle(node).display === \"none\") return true;\n\t\tnode = node.parentElement;\n\t}\n\treturn false;\n}\nfunction isSelectableInput(element) {\n\treturn element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n\tif (element && element.focus) {\n\t\tconst previouslyFocusedElement = getActiveElement();\n\t\telement.focus({ preventScroll: true });\n\t\tif (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();\n\t}\n}\n\n//#endregion\nexport { AUTOFOCUS_ON_MOUNT, AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS, focus, focusFirst, getTabbableCandidates, getTabbableEdges };\n//# sourceMappingURL=utils.js.map","import { getActiveElement } from \"../shared/getActiveElement.js\";\nimport { useForwardExpose } from \"../shared/useForwardExpose.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { createFocusScopesStack } from \"./stack.js\";\nimport { AUTOFOCUS_ON_MOUNT, AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS, focus, focusFirst, getTabbableCandidates, getTabbableEdges } from \"./utils.js\";\nimport { createBlock, defineComponent, nextTick, openBlock, reactive, ref, renderSlot, unref, watchEffect, withCtx } from \"vue\";\nimport { isClient } from \"@vueuse/shared\";\n\n//#region src/FocusScope/FocusScope.vue?vue&type=script&setup=true&lang.ts\nvar FocusScope_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"FocusScope\",\n\tprops: {\n\t\tloop: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false\n\t\t},\n\t\ttrapped: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t}\n\t},\n\temits: [\"mountAutoFocus\", \"unmountAutoFocus\"],\n\tsetup(__props, { emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst { currentRef, currentElement } = useForwardExpose();\n\t\tconst lastFocusedElementRef = ref(null);\n\t\tconst focusScopesStack = createFocusScopesStack();\n\t\tconst focusScope = reactive({\n\t\t\tpaused: false,\n\t\t\tpause() {\n\t\t\t\tthis.paused = true;\n\t\t\t},\n\t\t\tresume() {\n\t\t\t\tthis.paused = false;\n\t\t\t}\n\t\t});\n\t\twatchEffect((cleanupFn) => {\n\t\t\tif (!isClient) return;\n\t\t\tconst container = currentElement.value;\n\t\t\tif (!props.trapped) return;\n\t\t\tfunction handleFocusIn(event) {\n\t\t\t\tif (focusScope.paused || !container) return;\n\t\t\t\tconst target = event.target;\n\t\t\t\tif (container.contains(target)) lastFocusedElementRef.value = target;\n\t\t\t\telse focus(lastFocusedElementRef.value, { select: true });\n\t\t\t}\n\t\t\tfunction handleFocusOut(event) {\n\t\t\t\tif (focusScope.paused || !container) return;\n\t\t\t\tconst relatedTarget = event.relatedTarget;\n\t\t\t\tif (relatedTarget === null) return;\n\t\t\t\tif (!container.contains(relatedTarget)) focus(lastF