UNPKG

bootstrap-vue-next

Version:

Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development

1,497 lines (1,496 loc) 80.6 kB
require("./chunk-CoQrYLCe.js"); const require_dist = require("./dist-BJ15ThEs.js"); const require_useDefaults = require("./useDefaults-DsLf4iRY.js"); const require_useId = require("./useId-DHrBgM7P.js"); const require_BButton = require("./BButton-DBRs8Pz_.js"); const require_VisuallyHidden = require("./VisuallyHidden-DaN947I0.js"); const require_useForwardExpose = require("./useForwardExpose-DrJOy0jY.js"); const require_PopperContent = require("./PopperContent-CSwv2Fih.js"); const require_useKbd = require("./useKbd-ZZushx7D.js"); const require_VisuallyHiddenInput = require("./VisuallyHiddenInput-Biq4Qv5j.js"); const require_useStateClass = require("./useStateClass-CJ24hpkn.js"); const require_useAriaInvalid = require("./useAriaInvalid-CHHPHNLU.js"); const require_BInputGroup = require("./BInputGroup-Duk6Jk0v.js"); const require_BFormTag = require("./BFormTag-C7B-bX72.js"); const require_useFormSelect = require("./useFormSelect-nQbGZSi8.js"); let vue = require("vue"); //#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs function serialize(o) { return typeof o == "string" ? `'${o}'` : new c().serialize(o); } var c = /* @__PURE__ */ function() { class o { #t = /* @__PURE__ */ new Map(); compare(t, r) { const e = typeof t, n = typeof r; return e === "string" && n === "string" ? t.localeCompare(r) : e === "number" && n === "number" ? t - r : String.prototype.localeCompare.call(this.serialize(t, true), this.serialize(r, true)); } serialize(t, r) { if (t === null) return "null"; switch (typeof t) { case "string": return r ? t : `'${t}'`; case "bigint": return `${t}n`; case "object": return this.$object(t); case "function": return this.$function(t); } return String(t); } serializeObject(t) { const r = Object.prototype.toString.call(t); if (r !== "[object Object]") return this.serializeBuiltInType(r.length < 10 ? `unknown:${r}` : r.slice(8, -1), t); const e = t.constructor, n = e === Object || e === void 0 ? "" : e.name; if (n !== "" && globalThis[n] === e) return this.serializeBuiltInType(n, t); if (typeof t.toJSON == "function") { const i = t.toJSON(); return n + (i !== null && typeof i == "object" ? this.$object(i) : `(${this.serialize(i)})`); } return this.serializeObjectEntries(n, Object.entries(t)); } serializeBuiltInType(t, r) { const e = this["$" + t]; if (e) return e.call(this, r); if (typeof r?.entries == "function") return this.serializeObjectEntries(t, r.entries()); throw new Error(`Cannot serialize ${t}`); } serializeObjectEntries(t, r) { const e = Array.from(r).sort((i, a) => this.compare(i[0], a[0])); let n = `${t}{`; for (let i = 0; i < e.length; i++) { const [a, l] = e[i]; n += `${this.serialize(a, true)}:${this.serialize(l)}`, i < e.length - 1 && (n += ","); } return n + "}"; } $object(t) { let r = this.#t.get(t); return r === void 0 && (this.#t.set(t, `#${this.#t.size}`), r = this.serializeObject(t), this.#t.set(t, r)), r; } $function(t) { const r = Function.prototype.toString.call(t); return r.slice(-15) === "[native code] }" ? `${t.name || ""}()[native]` : `${t.name}(${t.length})${r.replace(/\s*\n\s*/g, "")}`; } $Array(t) { let r = "["; for (let e = 0; e < t.length; e++) r += this.serialize(t[e]), e < t.length - 1 && (r += ","); return r + "]"; } $Date(t) { try { return `Date(${t.toISOString()})`; } catch { return "Date(null)"; } } $ArrayBuffer(t) { return `ArrayBuffer[${new Uint8Array(t).join(",")}]`; } $Set(t) { return `Set${this.$Array(Array.from(t).sort((r, e) => this.compare(r, e)))}`; } $Map(t) { return this.serializeObjectEntries("Map", t.entries()); } } for (const s of [ "Error", "RegExp", "URL" ]) o.prototype["$" + s] = function(t) { return `${s}(${t})`; }; for (const s of [ "Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array" ]) o.prototype["$" + s] = function(t) { return `${s}[${t.join(",")}]`; }; for (const s of ["BigInt64Array", "BigUint64Array"]) o.prototype["$" + s] = function(t) { return `${s}[${t.join("n,")}${t.length > 0 ? "n" : ""}]`; }; return o; }(); function isEqual(object1, object2) { if (object1 === object2) return true; if (serialize(object1) === serialize(object2)) return true; return false; } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/arrays.js /** * The function `findValuesBetween` takes an array and two values, then returns a subarray containing * elements between the first occurrence of the start value and the first occurrence of the end value * in the array. * @param {T[]} array - The `array` parameter is an array of values of type `T`. * @param {T} start - The `start` parameter is the value that marks the beginning of the range you want * to find in the array. * @param {T} end - The `end` parameter in the `findValuesBetween` function represents the end value * that you want to find in the array. This function will return a subarray of values that are between * the `start` and `end` values in the original array. * @returns The `findValuesBetween` function returns an array of values from the input array that are * between the `start` and `end` values (inclusive). If either the `start` or `end` values are not * found in the input array, an empty array is returned. */ function findValuesBetween(array, start, end) { const startIndex = array.findIndex((i) => isEqual(i, start)); const endIndex = array.findIndex((i) => isEqual(i, end)); if (startIndex === -1 || endIndex === -1) return []; const [minIndex, maxIndex] = [startIndex, endIndex].sort((a, b) => a - b); return array.slice(minIndex, maxIndex + 1); } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFilter.js /** * Provides locale-aware string filtering functions. * Uses `Intl.Collator` for comparison to ensure proper Unicode handling. * * @param options - Optional collator options to customize comparison behavior. * See [Intl.CollatorOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) for details. * @returns An object with methods to check if a string starts with, ends with, or contains a substring. * * @example * const { startsWith, endsWith, contains } = useFilter(); * * startsWith('hello', 'he'); // true * endsWith('hello', 'lo'); // true * contains('hello', 'ell'); // true */ function useFilter(options) { const computedOptions = (0, vue.computed)(() => (0, vue.unref)(options)); const collator = (0, vue.computed)(() => new Intl.Collator("en", { usage: "search", ...computedOptions.value })); const startsWith = (string, substring) => { if (substring.length === 0) return true; string = string.normalize("NFC"); substring = substring.normalize("NFC"); return collator.value.compare(string.slice(0, substring.length), substring) === 0; }; const endsWith = (string, substring) => { if (substring.length === 0) return true; string = string.normalize("NFC"); substring = substring.normalize("NFC"); return collator.value.compare(string.slice(-substring.length), substring) === 0; }; const contains = (string, substring) => { if (substring.length === 0) return true; string = string.normalize("NFC"); substring = substring.normalize("NFC"); let scan = 0; const sliceLen = substring.length; for (; scan + sliceLen <= string.length; scan++) { const slice = string.slice(scan, scan + sliceLen); if (collator.value.compare(substring, slice) === 0) return true; } return false; }; return { startsWith, endsWith, contains }; } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFormControl.js function useFormControl(el) { return (0, vue.computed)(() => (0, vue.toValue)(el) ? Boolean(require_dist.unrefElement(el)?.closest("form")) : true); } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useTypeahead.js function useTypeahead(callback) { const search = require_dist.refAutoReset("", 1e3); const handleTypeaheadSearch = (key, items) => { search.value = search.value + key; if (callback) callback(key); else { const currentItem = require_useForwardExpose.getActiveElement(); const itemsWithTextValue = items.map((item) => ({ ...item, textValue: item.value?.textValue ?? item.ref.textContent?.trim() ?? "" })); const currentMatch = itemsWithTextValue.find((item) => item.ref === currentItem); const nextMatch = getNextMatch(itemsWithTextValue.map((item) => item.textValue), search.value, currentMatch?.textValue); const newItem = itemsWithTextValue.find((item) => item.textValue === nextMatch); if (newItem) newItem.ref.focus(); return newItem?.ref; } }; const resetTypeahead = () => { search.value = ""; }; return { search, handleTypeaheadSearch, resetTypeahead }; } /** * Wraps an array around itself at a given start index * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` */ function wrapArray(array, startIndex) { return array.map((_, index) => array[(startIndex + index) % array.length]); } /** * This is the "meat" of the typeahead matching logic. It takes in all the values, * the search and the current match, and returns the next match (or `undefined`). * * We normalize the search because if a user has repeatedly pressed a character, * we want the exact same behavior as if we only had that one character * (ie. cycle through options starting with that character) * * We also reorder the values by wrapping the array around the current match. * This is so we always look forward from the current match, and picking the first * match will always be the correct one. * * Finally, if the normalized search is exactly one character, we exclude the * current match from the values because otherwise it would be the first to match always * and focus would never move. This is as opposed to the regular case, where we * don't want focus to move if the current match still matches. */ function getNextMatch(values, search, currentMatch) { const normalizedSearch = search.length > 1 && Array.from(search).every((char) => char === search[0]) ? search[0] : search; const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0)); if (normalizedSearch.length === 1) wrappedValues = wrappedValues.filter((v) => v !== currentMatch); const nextMatch = wrappedValues.find((value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())); return nextMatch !== currentMatch ? nextMatch : void 0; } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Collection/Collection.js var ITEM_DATA_ATTR = "data-reka-collection-item"; function useCollection(options = {}) { const { key = "", isProvider = false } = options; const injectionKey = `${key}CollectionProvider`; let context; if (isProvider) { const itemMap = (0, vue.ref)(/* @__PURE__ */ new Map()); context = { collectionRef: (0, vue.ref)(), itemMap }; (0, vue.provide)(injectionKey, context); } else context = (0, vue.inject)(injectionKey); const getItems = (includeDisabledItem = false) => { const collectionNode = context.collectionRef.value; if (!collectionNode) return []; const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); const orderedItems = Array.from(context.itemMap.value.values()).sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref)); if (includeDisabledItem) return orderedItems; else return orderedItems.filter((i) => i.ref.dataset.disabled !== ""); }; const CollectionSlot = (0, vue.defineComponent)({ name: "CollectionSlot", inheritAttrs: false, setup(_, { slots, attrs }) { const { primitiveElement, currentElement } = require_VisuallyHidden.usePrimitiveElement(); (0, vue.watch)(currentElement, () => { context.collectionRef.value = currentElement.value; }); return () => (0, vue.h)(require_VisuallyHidden.Slot, { ref: primitiveElement, ...attrs }, slots); } }); const CollectionItem = (0, vue.defineComponent)({ name: "CollectionItem", inheritAttrs: false, props: { value: { validator: () => true } }, setup(props, { slots, attrs }) { const { primitiveElement, currentElement } = require_VisuallyHidden.usePrimitiveElement(); (0, vue.watchEffect)((cleanupFn) => { if (currentElement.value) { const key$1 = (0, vue.markRaw)(currentElement.value); context.itemMap.value.set(key$1, { ref: currentElement.value, value: props.value }); cleanupFn(() => context.itemMap.value.delete(key$1)); } }); return () => (0, vue.h)(require_VisuallyHidden.Slot, { ...attrs, [ITEM_DATA_ATTR]: "", ref: primitiveElement }, slots); } }); return { getItems, reactiveItems: (0, vue.computed)(() => Array.from(context.itemMap.value.values())), itemMapSize: (0, vue.computed)(() => context.itemMap.value.size), CollectionSlot, CollectionItem }; } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/utils.js function valueComparator(value, currentValue, comparator) { if (value === void 0) return false; else if (Array.isArray(value)) return value.some((val) => compare(val, currentValue, comparator)); else return compare(value, currentValue, comparator); } function compare(value, currentValue, comparator) { if (value === void 0 || currentValue === void 0) return false; if (typeof value === "string") return value === currentValue; if (typeof comparator === "function") return comparator(value, currentValue); if (typeof comparator === "string") return value?.[comparator] === currentValue?.[comparator]; return isEqual(value, currentValue); } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/RovingFocus/utils.js var MAP_KEY_TO_FOCUS_INTENT = { ArrowLeft: "prev", ArrowUp: "prev", ArrowRight: "next", ArrowDown: "next", PageUp: "first", Home: "first", PageDown: "last", End: "last" }; function getDirectionAwareKey(key, dir) { if (dir !== "rtl") return key; return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key; } function getFocusIntent(event, orientation, dir) { const key = getDirectionAwareKey(event.key, dir); if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0; if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0; return MAP_KEY_TO_FOCUS_INTENT[key]; } //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxRoot.js var [injectListboxRootContext, provideListboxRootContext] = require_VisuallyHidden.createContext("ListboxRoot"); var ListboxRoot_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ListboxRoot", props: { modelValue: { type: null, required: false }, defaultValue: { type: null, required: false }, multiple: { type: Boolean, required: false }, orientation: { type: String, required: false, default: "vertical" }, dir: { type: String, required: false }, disabled: { type: Boolean, required: false }, selectionBehavior: { type: String, required: false, default: "toggle" }, highlightOnHover: { type: Boolean, required: false }, by: { type: [String, Function], required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: [ "update:modelValue", "highlight", "entryFocus", "leave" ], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const emits = __emit; const { multiple, highlightOnHover, orientation, disabled, selectionBehavior, dir: propDir } = (0, vue.toRefs)(props); const { getItems } = useCollection({ isProvider: true }); const { handleTypeaheadSearch } = useTypeahead(); const { primitiveElement, currentElement } = require_VisuallyHidden.usePrimitiveElement(); const kbd = require_useKbd.useKbd(); const dir = require_VisuallyHidden.useDirection(propDir); const isFormControl = useFormControl(currentElement); const firstValue = (0, vue.ref)(); const isUserAction = (0, vue.ref)(false); const focusable = (0, vue.ref)(true); const modelValue = require_dist.useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue ?? (multiple.value ? [] : void 0), passive: props.modelValue === void 0, deep: true }); function onValueChange(val) { isUserAction.value = true; if (props.multiple) { const modelArray = Array.isArray(modelValue.value) ? [...modelValue.value] : []; const index = modelArray.findIndex((i) => compare(i, val, props.by)); if (props.selectionBehavior === "toggle") { index === -1 ? modelArray.push(val) : modelArray.splice(index, 1); modelValue.value = modelArray; } else { modelValue.value = [val]; firstValue.value = val; } } else if (props.selectionBehavior === "toggle") if (compare(modelValue.value, val, props.by)) modelValue.value = void 0; else modelValue.value = val; else modelValue.value = val; setTimeout(() => { isUserAction.value = false; }, 1); } const highlightedElement = (0, vue.ref)(null); const previousElement = (0, vue.ref)(null); const isVirtual = (0, vue.ref)(false); const isComposing = (0, vue.ref)(false); const virtualFocusHook = require_dist.createEventHook(); const virtualKeydownHook = require_dist.createEventHook(); const virtualHighlightHook = require_dist.createEventHook(); function getCollectionItem() { return getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== ""); } function changeHighlight(el, scrollIntoView = true) { if (!el) return; highlightedElement.value = el; if (focusable.value) highlightedElement.value.focus(); if (scrollIntoView) highlightedElement.value.scrollIntoView({ block: "nearest" }); emits("highlight", getItems().find((i) => i.ref === el)); } function highlightItem(value) { if (isVirtual.value) virtualHighlightHook.trigger(value); else { const item = getItems().find((i) => compare(i.value, value, props.by)); if (item) { highlightedElement.value = item.ref; changeHighlight(item.ref); } } } function onKeydownEnter(event) { if (highlightedElement.value && highlightedElement.value.isConnected) { event.preventDefault(); event.stopPropagation(); if (!isComposing.value) highlightedElement.value.click(); } } function onKeydownTypeAhead(event) { if (!focusable.value) return; isUserAction.value = true; if (isVirtual.value) virtualKeydownHook.trigger(event); else { const isMetaKey = event.altKey || event.ctrlKey || event.metaKey; if (isMetaKey && event.key === "a" && multiple.value) { const collection = getItems(); modelValue.value = [...collection.map((i) => i.value)]; event.preventDefault(); changeHighlight(collection[collection.length - 1].ref); } else if (!isMetaKey) { const el = handleTypeaheadSearch(event.key, getItems()); if (el) changeHighlight(el); } } setTimeout(() => { isUserAction.value = false; }, 1); } function onCompositionStart() { isComposing.value = true; } function onCompositionEnd() { (0, vue.nextTick)(() => { isComposing.value = false; }); } function highlightFirstItem() { (0, vue.nextTick)(() => { onKeydownNavigation(new KeyboardEvent("keydown", { key: "PageUp" })); }); } function onLeave(event) { const el = highlightedElement.value; if (el?.isConnected) previousElement.value = el; highlightedElement.value = null; emits("leave", event); } function onEnter(event) { const entryFocusEvent = new CustomEvent("listbox.entryFocus", { bubbles: false, cancelable: true }); event.currentTarget?.dispatchEvent(entryFocusEvent); emits("entryFocus", entryFocusEvent); if (entryFocusEvent.defaultPrevented) return; if (previousElement.value) changeHighlight(previousElement.value); else { const el = getCollectionItem()?.[0]; changeHighlight(el); } } function onKeydownNavigation(event) { const intent = getFocusIntent(event, orientation.value, dir.value); if (!intent) return; let collection = getCollectionItem(); if (highlightedElement.value) { if (intent === "last") collection.reverse(); else if (intent === "prev" || intent === "next") { if (intent === "prev") collection.reverse(); const currentIndex = collection.indexOf(highlightedElement.value); collection = collection.slice(currentIndex + 1); } handleMultipleReplace(event, collection[0]); } if (collection.length) { const index = !highlightedElement.value && intent === "prev" ? collection.length - 1 : 0; changeHighlight(collection[index]); } if (isVirtual.value) return virtualKeydownHook.trigger(event); } function handleMultipleReplace(event, targetEl) { if (isVirtual.value || props.selectionBehavior !== "replace" || !multiple.value || !Array.isArray(modelValue.value)) return; if ((event.altKey || event.ctrlKey || event.metaKey) && !event.shiftKey) return; if (event.shiftKey) { const collection = getItems().filter((i) => i.ref.dataset.disabled !== ""); let lastValue = collection.find((i) => i.ref === targetEl)?.value; if (event.key === kbd.END) lastValue = collection[collection.length - 1].value; else if (event.key === kbd.HOME) lastValue = collection[0].value; if (!lastValue || !firstValue.value) return; modelValue.value = findValuesBetween(collection.map((i) => i.value), firstValue.value, lastValue); } } async function highlightSelected(event) { await (0, vue.nextTick)(); if (isVirtual.value) virtualFocusHook.trigger(event); else { const collection = getCollectionItem(); const item = collection.find((i) => i.dataset.state === "checked"); if (item) changeHighlight(item); else if (collection.length) changeHighlight(collection[0]); } } (0, vue.watch)(modelValue, () => { if (!isUserAction.value) (0, vue.nextTick)(() => { highlightSelected(); }); }, { immediate: true, deep: true }); __expose({ highlightedElement, highlightItem, highlightFirstItem, highlightSelected, getItems }); provideListboxRootContext({ modelValue, onValueChange, multiple, orientation, dir, disabled, highlightOnHover, highlightedElement, isVirtual, virtualFocusHook, virtualKeydownHook, virtualHighlightHook, by: props.by, firstValue, selectionBehavior, focusable, onLeave, onEnter, changeHighlight, onKeydownEnter, onKeydownNavigation, onKeydownTypeAhead, onCompositionStart, onCompositionEnd, highlightFirstItem }); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_VisuallyHidden.Primitive), { ref_key: "primitiveElement", ref: primitiveElement, as: _ctx.as, "as-child": _ctx.asChild, dir: (0, vue.unref)(dir), "data-disabled": (0, vue.unref)(disabled) ? "" : void 0, onPointerleave: onLeave, onFocusout: _cache[0] || (_cache[0] = async (event) => { const target = event.relatedTarget || event.target; await (0, vue.nextTick)(); if (highlightedElement.value && (0, vue.unref)(currentElement) && !(0, vue.unref)(currentElement).contains(target)) onLeave(event); }) }, { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", { modelValue: (0, vue.unref)(modelValue) }), (0, vue.unref)(isFormControl) && _ctx.name ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_VisuallyHiddenInput.VisuallyHiddenInput_default), { key: 0, name: _ctx.name, value: (0, vue.unref)(modelValue), disabled: (0, vue.unref)(disabled), required: _ctx.required }, null, 8, [ "name", "value", "disabled", "required" ])) : (0, vue.createCommentVNode)("v-if", true)]), _: 3 }, 8, [ "as", "as-child", "dir", "data-disabled" ]); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxContent.js var ListboxContent_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ListboxContent", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const { CollectionSlot } = useCollection(); const rootContext = injectListboxRootContext(); const isClickFocus = require_dist.refAutoReset(false, 10); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(CollectionSlot), null, { default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(require_VisuallyHidden.Primitive), { role: "listbox", as: _ctx.as, "as-child": _ctx.asChild, tabindex: (0, vue.unref)(rootContext).focusable.value ? (0, vue.unref)(rootContext).highlightedElement.value ? "-1" : "0" : "-1", "aria-orientation": (0, vue.unref)(rootContext).orientation.value, "aria-multiselectable": !!(0, vue.unref)(rootContext).multiple.value, "data-orientation": (0, vue.unref)(rootContext).orientation.value, onMousedown: _cache[0] || (_cache[0] = (0, vue.withModifiers)(($event) => isClickFocus.value = true, ["left"])), onFocus: _cache[1] || (_cache[1] = (ev) => { if ((0, vue.unref)(isClickFocus)) return; (0, vue.unref)(rootContext).onEnter(ev); }), onKeydown: [ _cache[2] || (_cache[2] = (0, vue.withKeys)((event) => { if ((0, vue.unref)(rootContext).orientation.value === "vertical" && (event.key === "ArrowLeft" || event.key === "ArrowRight") || (0, vue.unref)(rootContext).orientation.value === "horizontal" && (event.key === "ArrowUp" || event.key === "ArrowDown")) return; event.preventDefault(); (0, vue.unref)(rootContext).focusable.value && (0, vue.unref)(rootContext).onKeydownNavigation(event); }, [ "down", "up", "left", "right", "home", "end" ])), (0, vue.withKeys)((0, vue.unref)(rootContext).onKeydownEnter, ["enter"]), (0, vue.unref)(rootContext).onKeydownTypeAhead ] }, { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]), _: 3 }, 8, [ "as", "as-child", "tabindex", "aria-orientation", "aria-multiselectable", "data-orientation", "onKeydown" ])]), _: 3 }); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxFilter.js var ListboxFilter_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ListboxFilter", props: { modelValue: { type: String, required: false }, autoFocus: { type: Boolean, required: false }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "input" } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const modelValue = require_dist.useVModel(props, "modelValue", __emit, { defaultValue: "", passive: props.modelValue === void 0 }); const rootContext = injectListboxRootContext(); const { primitiveElement, currentElement } = require_VisuallyHidden.usePrimitiveElement(); const disabled = (0, vue.computed)(() => props.disabled || rootContext.disabled.value || false); const activedescendant = (0, vue.ref)(); (0, vue.watchSyncEffect)(() => activedescendant.value = rootContext.highlightedElement.value?.id); (0, vue.onMounted)(() => { rootContext.focusable.value = false; setTimeout(() => { if (props.autoFocus) currentElement.value?.focus(); }, 1); }); (0, vue.onUnmounted)(() => { rootContext.focusable.value = true; }); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_VisuallyHidden.Primitive), { ref_key: "primitiveElement", ref: primitiveElement, as: _ctx.as, "as-child": _ctx.asChild, value: (0, vue.unref)(modelValue), disabled: disabled.value ? "" : void 0, "data-disabled": disabled.value ? "" : void 0, "aria-disabled": disabled.value ?? void 0, "aria-activedescendant": activedescendant.value, type: "text", onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)((0, vue.unref)(rootContext).onKeydownNavigation, ["prevent"]), [ "down", "up", "home", "end" ]), (0, vue.withKeys)((0, vue.unref)(rootContext).onKeydownEnter, ["enter"])], onInput: _cache[0] || (_cache[0] = (event) => { modelValue.value = event.target.value; (0, vue.unref)(rootContext).highlightFirstItem(); }), onCompositionstart: (0, vue.unref)(rootContext).onCompositionStart, onCompositionend: (0, vue.unref)(rootContext).onCompositionEnd }, { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", { modelValue: (0, vue.unref)(modelValue) })]), _: 3 }, 8, [ "as", "as-child", "value", "disabled", "data-disabled", "aria-disabled", "aria-activedescendant", "onKeydown", "onCompositionstart", "onCompositionend" ]); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxItem.js var LISTBOX_SELECT = "listbox.select"; var [injectListboxItemContext, provideListboxItemContext] = require_VisuallyHidden.createContext("ListboxItem"); var ListboxItem_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ListboxItem", props: { value: { type: null, required: true }, disabled: { type: Boolean, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "div" } }, emits: ["select"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const id = require_PopperContent.useId(void 0, "reka-listbox-item"); const { CollectionItem } = useCollection(); const { forwardRef, currentElement } = require_useForwardExpose.useForwardExpose(); const rootContext = injectListboxRootContext(); const isHighlighted = (0, vue.computed)(() => currentElement.value === rootContext.highlightedElement.value); const isSelected = (0, vue.computed)(() => valueComparator(rootContext.modelValue.value, props.value, rootContext.by)); const disabled = (0, vue.computed)(() => rootContext.disabled.value || props.disabled); async function handleSelect(ev) { emits("select", ev); if (ev?.defaultPrevented) return; if (!disabled.value && ev) { rootContext.onValueChange(props.value); rootContext.changeHighlight(currentElement.value); } } function handleSelectCustomEvent(ev) { require_PopperContent.handleAndDispatchCustomEvent(LISTBOX_SELECT, handleSelect, { originalEvent: ev, value: props.value }); } provideListboxItemContext({ isSelected }); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(CollectionItem), { value: _ctx.value }, { default: (0, vue.withCtx)(() => [(0, vue.withMemo)([isHighlighted.value, isSelected.value], () => (0, vue.createVNode)((0, vue.unref)(require_VisuallyHidden.Primitive), (0, vue.mergeProps)({ id: (0, vue.unref)(id) }, _ctx.$attrs, { ref: (0, vue.unref)(forwardRef), role: "option", tabindex: (0, vue.unref)(rootContext).focusable.value ? isHighlighted.value ? "0" : "-1" : -1, "aria-selected": isSelected.value, as: _ctx.as, "as-child": _ctx.asChild, disabled: disabled.value ? "" : void 0, "data-disabled": disabled.value ? "" : void 0, "data-highlighted": isHighlighted.value ? "" : void 0, "data-state": isSelected.value ? "checked" : "unchecked", onClick: handleSelectCustomEvent, onKeydown: (0, vue.withKeys)((0, vue.withModifiers)(handleSelectCustomEvent, ["prevent"]), ["space"]), onPointermove: _cache[0] || (_cache[0] = () => { if ((0, vue.unref)(rootContext).highlightedElement.value === (0, vue.unref)(currentElement)) return; if ((0, vue.unref)(rootContext).highlightOnHover.value && !(0, vue.unref)(rootContext).focusable.value) (0, vue.unref)(rootContext).changeHighlight((0, vue.unref)(currentElement), false); }) }), { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "tabindex", "aria-selected", "as", "as-child", "disabled", "data-disabled", "data-highlighted", "data-state", "onKeydown" ]), _cache, 1)]), _: 3 }, 8, ["value"]); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxItemIndicator.js var ListboxItemIndicator_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ListboxItemIndicator", props: { asChild: { type: Boolean, required: false }, as: { type: null, required: false, default: "span" } }, setup(__props) { const props = __props; require_useForwardExpose.useForwardExpose(); const itemContext = injectListboxItemContext(); return (_ctx, _cache) => { return (0, vue.unref)(itemContext).isSelected.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_VisuallyHidden.Primitive), (0, vue.mergeProps)({ key: 0, "aria-hidden": "true" }, props), { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]), _: 3 }, 16)) : (0, vue.createCommentVNode)("v-if", true); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxRoot.js var [injectComboboxRootContext, provideComboboxRootContext] = require_VisuallyHidden.createContext("ComboboxRoot"); var ComboboxRoot_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ComboboxRoot", props: { open: { type: Boolean, required: false, default: void 0 }, defaultOpen: { type: Boolean, required: false }, resetSearchTermOnBlur: { type: Boolean, required: false, default: true }, resetSearchTermOnSelect: { type: Boolean, required: false, default: true }, openOnFocus: { type: Boolean, required: false, default: false }, openOnClick: { type: Boolean, required: false, default: false }, ignoreFilter: { type: Boolean, required: false }, resetModelValueOnClear: { type: Boolean, required: false, default: false }, modelValue: { type: null, required: false }, defaultValue: { type: null, required: false }, multiple: { type: Boolean, required: false }, dir: { type: String, required: false }, disabled: { type: Boolean, required: false }, highlightOnHover: { type: Boolean, required: false, default: true }, by: { type: [String, Function], required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, name: { type: String, required: false }, required: { type: Boolean, required: false } }, emits: [ "update:modelValue", "highlight", "update:open" ], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const emits = __emit; const { primitiveElement, currentElement: parentElement } = require_VisuallyHidden.usePrimitiveElement(); const { multiple, disabled, ignoreFilter, resetSearchTermOnSelect, openOnFocus, openOnClick, dir: propDir, resetModelValueOnClear, highlightOnHover } = (0, vue.toRefs)(props); const dir = require_VisuallyHidden.useDirection(propDir); const modelValue = require_dist.useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue ?? (multiple.value ? [] : void 0), passive: props.modelValue === void 0, deep: true }); const open = require_dist.useVModel(props, "open", emits, { defaultValue: props.defaultOpen, passive: props.open === void 0 }); async function onOpenChange(val) { open.value = val; filterSearch.value = ""; if (val) { await (0, vue.nextTick)(); primitiveElement.value?.highlightSelected(); isUserInputted.value = true; inputElement.value?.focus(); } else { isUserInputted.value = false; setTimeout(() => { if (!val && props.resetSearchTermOnBlur) resetSearchTerm.trigger(); }, 1); } } const resetSearchTerm = require_dist.createEventHook(); const isUserInputted = (0, vue.ref)(false); const isVirtual = (0, vue.ref)(false); const inputElement = (0, vue.ref)(); const triggerElement = (0, vue.ref)(); const highlightedElement = (0, vue.computed)(() => primitiveElement.value?.highlightedElement ?? void 0); const allItems = (0, vue.ref)(/* @__PURE__ */ new Map()); const allGroups = (0, vue.ref)(/* @__PURE__ */ new Map()); const { contains } = useFilter({ sensitivity: "base" }); const filterSearch = (0, vue.ref)(""); const filterState = (0, vue.computed)((oldValue) => { if (!filterSearch.value || props.ignoreFilter || isVirtual.value) return { count: allItems.value.size, items: oldValue?.items ?? /* @__PURE__ */ new Map(), groups: oldValue?.groups ?? new Set(allGroups.value.keys()) }; let itemCount = 0; const filteredItems = /* @__PURE__ */ new Map(); const filteredGroups = /* @__PURE__ */ new Set(); for (const [id, value] of allItems.value) { const score = contains(value, filterSearch.value); filteredItems.set(id, score ? 1 : 0); if (score) itemCount++; } for (const [groupId, group] of allGroups.value) for (const itemId of group) if (filteredItems.get(itemId) > 0) { filteredGroups.add(groupId); break; } return { count: itemCount, items: filteredItems, groups: filteredGroups }; }); const inst = (0, vue.getCurrentInstance)(); (0, vue.onMounted)(() => { if (inst?.exposed) { inst.exposed.highlightItem = primitiveElement.value?.highlightItem; inst.exposed.highlightFirstItem = primitiveElement.value?.highlightFirstItem; inst.exposed.highlightSelected = primitiveElement.value?.highlightSelected; } }); __expose({ filtered: filterState, highlightedElement, highlightItem: primitiveElement.value?.highlightItem, highlightFirstItem: primitiveElement.value?.highlightFirstItem, highlightSelected: primitiveElement.value?.highlightSelected }); provideComboboxRootContext({ modelValue, multiple, disabled, open, onOpenChange, contentId: "", isUserInputted, isVirtual, inputElement, highlightedElement, onInputElementChange: (val) => inputElement.value = val, triggerElement, onTriggerElementChange: (val) => triggerElement.value = val, parentElement, resetSearchTermOnSelect, onResetSearchTerm: resetSearchTerm.on, allItems, allGroups, filterSearch, filterState, ignoreFilter, openOnFocus, openOnClick, resetModelValueOnClear }); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_PopperContent.PopperRoot_default), null, { default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(ListboxRoot_default), (0, vue.mergeProps)({ ref_key: "primitiveElement", ref: primitiveElement }, _ctx.$attrs, { modelValue: (0, vue.unref)(modelValue), "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (0, vue.isRef)(modelValue) ? modelValue.value = $event : null), style: { pointerEvents: (0, vue.unref)(open) ? "auto" : void 0 }, as: _ctx.as, "as-child": _ctx.asChild, dir: (0, vue.unref)(dir), multiple: (0, vue.unref)(multiple), name: _ctx.name, required: _ctx.required, disabled: (0, vue.unref)(disabled), "highlight-on-hover": (0, vue.unref)(highlightOnHover), by: props.by, onHighlight: _cache[1] || (_cache[1] = ($event) => emits("highlight", $event)) }), { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", { open: (0, vue.unref)(open), modelValue: (0, vue.unref)(modelValue) })]), _: 3 }, 16, [ "modelValue", "style", "as", "as-child", "dir", "multiple", "name", "required", "disabled", "highlight-on-hover", "by" ])]), _: 3 }); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxAnchor.js var ComboboxAnchor_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ComboboxAnchor", props: { reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false } }, setup(__props) { const { forwardRef } = require_useForwardExpose.useForwardExpose(); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_PopperContent.PopperAnchor_default), { "as-child": "", reference: _ctx.reference }, { default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(require_VisuallyHidden.Primitive), (0, vue.mergeProps)({ ref: (0, vue.unref)(forwardRef), "as-child": _ctx.asChild, as: _ctx.as }, _ctx.$attrs), { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]), _: 3 }, 16, ["as-child", "as"])]), _: 3 }, 8, ["reference"]); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxContentImpl.js var [injectComboboxContentContext, provideComboboxContentContext] = require_VisuallyHidden.createContext("ComboboxContent"); var ComboboxContentImpl_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ComboboxContentImpl", props: { position: { type: String, required: false, default: "inline" }, bodyLock: { type: Boolean, required: false }, hideWhenEmpty: { type: Boolean, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false }, hideShiftedArrow: { type: Boolean, required: false }, sticky: { type: String, required: false }, hideWhenDetached: { type: Boolean, required: false }, positionStrategy: { type: String, required: false }, updatePositionStrategy: { type: String, required: false }, disableUpdateOnLayoutShift: { type: Boolean, required: false }, prioritizePosition: { type: Boolean, required: false }, reference: { type: null, required: false }, asChild: { type: Boolean, required: false }, as: { type: null, required: false }, disableOutsidePointerEvents: { type: Boolean, required: false } }, emits: [ "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside" ], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const { position } = (0, vue.toRefs)(props); const rootContext = injectComboboxRootContext(); const isEmpty = (0, vue.computed)(() => rootContext.ignoreFilter.value ? rootContext.allItems.value.size === 0 : rootContext.filterState.value.count === 0); const { forwardRef, currentElement } = require_useForwardExpose.useForwardExpose(); require_PopperContent.useBodyScrollLock(props.bodyLock); require_PopperContent.useFocusGuards(); require_PopperContent.useHideOthers(rootContext.parentElement); const forwardedProps = require_PopperContent.useForwardProps((0, vue.computed)(() => { if (props.position === "popper") return props; else return {}; }).value); const popperStyle = { "boxSizing": "border-box", "--reka-combobox-content-transform-origin": "var(--reka-popper-transform-origin)", "--reka-combobox-content-available-width": "var(--reka-popper-available-width)", "--reka-combobox-content-available-height": "var(--reka-popper-available-height)", "--reka-combobox-trigger-width": "var(--reka-popper-anchor-width)", "--reka-combobox-trigger-height": "var(--reka-popper-anchor-height)" }; provideComboboxContentContext({ position }); const isInputWithinContent = (0, vue.ref)(false); (0, vue.onMounted)(() => { if (rootContext.inputElement.value) { isInputWithinContent.value = currentElement.value.contains(rootContext.inputElement.value); if (isInputWithinContent.value) rootContext.inputElement.value.focus(); } }); (0, vue.onUnmounted)(() => { const activeElement = require_useForwardExpose.getActiveElement(); if (isInputWithinContent.value && (!activeElement || activeElement === document.body)) rootContext.triggerElement.value?.focus(); }); return (_ctx, _cache) => { return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ListboxContent_default), { "as-child": "" }, { default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(require_PopperContent.FocusScope_default), { "as-child": "", onMountAutoFocus: _cache[5] || (_cache[5] = (0, vue.withModifiers)(() => {}, ["prevent"])), onUnmountAutoFocus: _cache[6] || (_cache[6] = (0, vue.withModifiers)(() => {}, ["prevent"])) }, { default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(require_PopperContent.DismissableLayer_default), { "as-child": "", "disable-outside-pointer-events": _ctx.disableOutsidePointerEvents, onDismiss: _cache[0] || (_cache[0] = ($event) => (0, vue.unref)(rootContext).onOpenChange(false)), onFocusOutside: _cache[1] || (_cache[1] = (ev) => { if ((0, vue.unref)(rootContext).parentElement.value?.contains(ev.target)) ev.preventDefault(); emits("focusOutside", ev); }), onInteractOutside: _cache[2] || (_cache[2] = ($event) => emits("interactOutside", $event)), onEscapeKeyDown: _cache[3] || (_cache[3] = ($event) => emits("escapeKeyDown", $event)), onPointerDownOutside: _cache[4] || (_cache[4] = (ev) => { if ((0, vue.unref)(rootContext).parentElement.value?.contains(ev.target)) ev.preventDefault(); emits("pointerDownOutside", ev); }) }, { default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(position) === "popper" ? (0, vue.unref)(require_PopperContent.PopperContent_default) : (0, vue.unref)(require_VisuallyHidden.Primitive)), (0, vue.mergeProps)({ ..._ctx.$attrs, ...(0, vue.unref)(forwardedProps) }, { id: (0, vue.unref)(rootContext).contentId, ref: (0, vue.unref)(forwardRef), "data-state": (0, vue.unref)(rootContext).open.value ? "open" : "closed", "data-empty": isEmpty.value ? "" : void 0, style: { display: props.hideWhenEmpty && isEmpty.value ? "none" : "flex", flexDirection: "column", outline: "none", ...(0, vue.unref)(position) === "popper" ? popperStyle : {} } }), { default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]), _: 3 }, 16, [ "id", "data-state", "data-empty", "style" ]))]), _: 3 }, 8, ["disable-outside-pointer-events"])]), _: 3 })]), _: 3 }); }; } }); //#endregion //#region ../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxContent.js var ComboboxContent_default = /* @__PURE__ */ (0, vue.defineComponent)({ __name: "ComboboxContent", props: { forceMount: { type: Boolean, required: false }, position: { type: String, required: false }, bodyLock: { type: Boolean, required: false }, hideWhenEmpty: { type: Boolean, required: false }, side: { type: null, required: false }, sideOffset: { type: Number, required: false }, sideFlip: { type: Boolean, required: false }, align: { type: null, required: false }, alignOffset: { type: Number, required: false }, alignFlip: { type: Boolean, required: false }, avoidCollisions: { type: Boolean, required: false }, collisionBoundary: { type: null, required: false }, collisionPadding: { type: [Number, Object], required: false }, arrowPadding: { type: Number, required: false },