import { dequal } from "./chunk-HTVXVXIR.js"; import { nanoid } from "./chunk-HNIHZSAY.js"; import "./chunk-AYNHEKRI.js"; import { derived, readable, readonly, writable } from "./chunk-M5NJIN7F.js"; import "./chunk-X7HCJ7ZS.js"; import { SvelteComponentDev, action_destroyer, add_location, add_render_callback, append_hydration_dev, assign, binding_callbacks, bubble, check_outros, children, claim_component, claim_element, claim_space, claim_text, component_subscribe, compute_rest_props, createEventDispatcher, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, destroy_component, detach_dev, dispatch_dev, element, empty, exclude_internal_props, getContext, get_all_dirty_from_scope, get_slot_changes, get_spread_object, get_spread_update, get_store_value, group_outros, init, insert_hydration_dev, is_function, listen_dev, mount_component, noop, onDestroy, onMount, run_all, safe_not_equal, setContext, set_attributes, set_data_dev, set_data_maybe_contenteditable_dev, set_dynamic_element_data, set_style, space, subscribe, text, tick, transition_in, transition_out, update_slot_base, validate_dynamic_element, validate_slots, validate_store, validate_void_dynamic_element } from "./chunk-CNW2E2YW.js"; import "./chunk-2GBBIY5G.js"; import { __export } from "./chunk-TNDHKS54.js"; // node_modules/bits-ui/dist/bits/accordion/index.js var accordion_exports = {}; __export(accordion_exports, { Content: () => accordion_content_default, Header: () => accordion_header_default, Item: () => accordion_item_default, Root: () => accordion_default, Trigger: () => accordion_trigger_default }); // node_modules/bits-ui/dist/internal/arrays.js function arraysAreEqual(arr1, arr2) { if (arr1.length !== arr2.length) { return false; } return arr1.every((value, index) => value === arr2[index]); } // node_modules/@melt-ui/svelte/dist/internal/helpers/array.js function back(array, index, increment, loop = true) { const previousIndex = index - increment; if (previousIndex <= 0) { return loop ? array[array.length - 1] : array[0]; } return array[previousIndex]; } function forward(array, index, increment, loop = true) { const nextIndex = index + increment; if (nextIndex > array.length - 1) { return loop ? array[0] : array[array.length - 1]; } return array[nextIndex]; } function next(array, index, loop = true) { if (index === array.length - 1) { return loop ? array[0] : array[index]; } return array[index + 1]; } function prev(array, currentIndex, loop = true) { if (currentIndex <= 0) { return loop ? array[array.length - 1] : array[0]; } return array[currentIndex - 1]; } function last(array) { return array[array.length - 1]; } function wrapArray(array, startIndex) { return array.map((_, index) => array[(startIndex + index) % array.length]); } function toggle(item, array, compare = dequal) { const itemIdx = array.findIndex((innerItem) => compare(innerItem, item)); if (itemIdx !== -1) { array.splice(itemIdx, 1); } else { array.push(item); } return array; } function chunk(arr, size3) { const result = []; for (let i = 0; i < arr.length; i += size3) { result.push(arr.slice(i, i + size3)); } return result; } function isValidIndex(index, arr) { return index >= 0 && index < arr.length; } // node_modules/@melt-ui/svelte/dist/internal/helpers/style.js function styleToString(style) { return Object.keys(style).reduce((str, key) => { if (style[key] === void 0) return str; return str + `${key}:${style[key]};`; }, ""); } // node_modules/@melt-ui/svelte/dist/internal/helpers/attr.js function disabledAttr(disabled) { return disabled ? true : void 0; } var hiddenInputAttrs = { type: "hidden", "aria-hidden": true, hidden: true, tabIndex: -1, style: styleToString({ position: "absolute", opacity: 0, "pointer-events": "none", margin: 0, transform: "translateX(-100%)" }) }; function portalAttr(portal) { if (portal !== null) { return ""; } return void 0; } // node_modules/@melt-ui/svelte/dist/internal/helpers/store/lightable.js function lightable(value) { function subscribe2(run) { run(value); return () => { }; } return { subscribe: subscribe2 }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/makeElement.js function getElementByMeltId(id) { if (!isBrowser) return null; const el = document.querySelector(`[data-melt-id="${id}"]`); return isHTMLElement(el) ? el : null; } var hiddenAction = (obj) => { return new Proxy(obj, { get(target, prop, receiver) { return Reflect.get(target, prop, receiver); }, ownKeys(target) { return Reflect.ownKeys(target).filter((key) => key !== "action"); } }); }; var isFunctionWithParams = (fn) => { return typeof fn === "function"; }; var emptyMeltElement = makeElement("empty"); function makeElement(name27, args) { const { stores, action, returned } = args ?? {}; const derivedStore = (() => { if (stores && returned) { return derived(stores, (values) => { const result = returned(values); if (isFunctionWithParams(result)) { const fn = (...args2) => { return hiddenAction({ ...result(...args2), [`data-melt-${name27}`]: "", action: action ?? noop2 }); }; fn.action = action ?? noop2; return fn; } return hiddenAction({ ...result, [`data-melt-${name27}`]: "", action: action ?? noop2 }); }); } else { const returnedFn = returned; const result = returnedFn == null ? void 0 : returnedFn(); if (isFunctionWithParams(result)) { const resultFn = (...args2) => { return hiddenAction({ ...result(...args2), [`data-melt-${name27}`]: "", action: action ?? noop2 }); }; resultFn.action = action ?? noop2; return lightable(resultFn); } return lightable(hiddenAction({ ...result, [`data-melt-${name27}`]: "", action: action ?? noop2 })); } })(); const actionFn = action ?? (() => { }); actionFn.subscribe = derivedStore.subscribe; return actionFn; } function makeElementArray(name27, args) { const { stores, returned, action } = args; const { subscribe: subscribe2 } = derived(stores, (values) => returned(values).map((value) => hiddenAction({ ...value, [`data-melt-${name27}`]: "", action: action ?? noop2 }))); const actionFn = action ?? (() => { }); actionFn.subscribe = subscribe2; return actionFn; } function createElHelpers(prefix4) { const name27 = (part) => part ? `${prefix4}-${part}` : prefix4; const attribute2 = (part) => `data-melt-${prefix4}${part ? `-${part}` : ""}`; const selector10 = (part) => `[data-melt-${prefix4}${part ? `-${part}` : ""}]`; const getEl = (part) => document.querySelector(selector10(part)); return { name: name27, attribute: attribute2, selector: selector10, getEl }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/is.js var isBrowser = typeof document !== "undefined"; var isFunction = (v) => typeof v === "function"; function isDocument(element2) { return element2 instanceof Document; } function isElement(element2) { return element2 instanceof Element; } function isHTMLElement(element2) { return element2 instanceof HTMLElement; } function isHTMLInputElement(element2) { return element2 instanceof HTMLInputElement; } function isHTMLLabelElement(element2) { return element2 instanceof HTMLLabelElement; } function isHTMLButtonElement(element2) { return element2 instanceof HTMLButtonElement; } function isElementDisabled(element2) { const ariaDisabled = element2.getAttribute("aria-disabled"); const disabled = element2.getAttribute("disabled"); const dataDisabled = element2.hasAttribute("data-disabled"); if (ariaDisabled === "true" || disabled !== null || dataDisabled) { return true; } return false; } function isTouch(event) { return event.pointerType === "touch"; } function isFocusVisible(element2) { return element2.matches(":focus-visible"); } function isContentEditable(element2) { if (!isHTMLElement(element2)) return false; return element2.isContentEditable; } function isNull(value) { return value === null; } function isNumberString(value) { if (isNaN(parseInt(value))) return false; return true; } function isObject(value) { return value !== null && typeof value === "object"; } function isReadable(value) { return isObject(value) && "subscribe" in value; } // node_modules/@melt-ui/svelte/dist/internal/helpers/dom.js function getTabbableNodes(container) { const nodes = []; const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => { return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) { nodes.push(walker.currentNode); } return nodes; } // node_modules/@melt-ui/svelte/dist/internal/helpers/callbacks.js function executeCallbacks(...callbacks) { return (...args) => { for (const callback of callbacks) { if (typeof callback === "function") { callback(...args); } } }; } function noop2() { } // node_modules/@melt-ui/svelte/dist/internal/helpers/event.js function addEventListener(target, event, handler, options) { const events = Array.isArray(event) ? event : [event]; events.forEach((_event) => target.addEventListener(_event, handler, options)); return () => { events.forEach((_event) => target.removeEventListener(_event, handler, options)); }; } function addMeltEventListener(target, event, handler, options) { const events = Array.isArray(event) ? event : [event]; if (typeof handler === "function") { const handlerWithMelt = withMelt((_event) => handler(_event)); events.forEach((_event) => target.addEventListener(_event, handlerWithMelt, options)); return () => { events.forEach((_event) => target.removeEventListener(_event, handlerWithMelt, options)); }; } return () => noop2(); } function dispatchMeltEvent(originalEvent) { const node = originalEvent.currentTarget; if (!isHTMLElement(node)) return null; const customMeltEvent = new CustomEvent(`m-${originalEvent.type}`, { detail: { originalEvent }, cancelable: true }); node.dispatchEvent(customMeltEvent); return customMeltEvent; } function withMelt(handler) { return (event) => { const customEvent = dispatchMeltEvent(event); if (customEvent == null ? void 0 : customEvent.defaultPrevented) return; return handler(event); }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/highlight.js function addHighlight(element2) { element2.setAttribute("data-highlighted", ""); } function removeHighlight(element2) { element2.removeAttribute("data-highlighted"); } // node_modules/@melt-ui/svelte/dist/internal/helpers/lifecycle.js var safeOnMount = (fn) => { try { onMount(fn); } catch { return fn; } }; var safeOnDestroy = (fn) => { try { onDestroy(fn); } catch { return fn; } }; // node_modules/@melt-ui/svelte/dist/internal/helpers/list.js function getOptions(el) { return Array.from(el.querySelectorAll('[role="option"]:not([data-disabled])')).filter((el2) => isHTMLElement(el2)); } // node_modules/@melt-ui/svelte/dist/internal/helpers/locale.js function getElemDirection(elem) { const style = window.getComputedStyle(elem); const direction = style.getPropertyValue("direction"); return direction; } // node_modules/@melt-ui/svelte/dist/internal/helpers/object.js function omit(obj, ...keys) { const result = {}; for (const key of Object.keys(obj)) { if (!keys.includes(key)) { result[key] = obj[key]; } } return result; } function stripValues(inputObject, toStrip, recursive) { return Object.fromEntries(Object.entries(inputObject).filter(([_, value]) => !dequal(value, toStrip))); } function removeUndefined(obj) { const result = {}; for (const key in obj) { const value = obj[key]; if (value !== void 0) { result[key] = value; } } return result; } // node_modules/@melt-ui/svelte/dist/internal/helpers/withGet.js function withGet(store) { return { ...store, get: () => get_store_value(store) }; } withGet.writable = function(initial) { const internal = writable(initial); let value = initial; return { subscribe: internal.subscribe, set(newValue) { internal.set(newValue); value = newValue; }, update(updater) { const newValue = updater(value); internal.set(newValue); value = newValue; }, get() { return value; } }; }; withGet.derived = function(stores, fn) { const subscribers = /* @__PURE__ */ new Map(); const get = () => { const values = Array.isArray(stores) ? stores.map((store) => store.get()) : stores.get(); return fn(values); }; const subscribe2 = (subscriber) => { const unsubscribers = []; const storesArr = Array.isArray(stores) ? stores : [stores]; storesArr.forEach((store) => { unsubscribers.push(store.subscribe(() => { subscriber(get()); })); }); subscriber(get()); subscribers.set(subscriber, unsubscribers); return () => { const unsubscribers2 = subscribers.get(subscriber); if (unsubscribers2) { for (const unsubscribe of unsubscribers2) { unsubscribe(); } } subscribers.delete(subscriber); }; }; return { get, subscribe: subscribe2 }; }; // node_modules/@melt-ui/svelte/dist/internal/helpers/overridable.js var overridable = (_store, onChange) => { const store = withGet(_store); const update = (updater, sideEffect) => { store.update((curr) => { const next2 = updater(curr); let res = next2; if (onChange) { res = onChange({ curr, next: next2 }); } sideEffect == null ? void 0 : sideEffect(res); return res; }); }; const set = (curr) => { update(() => curr); }; return { ...store, update, set }; }; // node_modules/@melt-ui/svelte/dist/internal/helpers/sleep.js function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } // node_modules/@melt-ui/svelte/dist/internal/helpers/id.js function generateId() { return nanoid(10); } function generateIds(args) { return args.reduce((acc, curr) => { acc[curr] = generateId(); return acc; }, {}); } // node_modules/@melt-ui/svelte/dist/internal/helpers/keyboard.js var kbd = { ALT: "Alt", ARROW_DOWN: "ArrowDown", ARROW_LEFT: "ArrowLeft", ARROW_RIGHT: "ArrowRight", ARROW_UP: "ArrowUp", BACKSPACE: "Backspace", CAPS_LOCK: "CapsLock", CONTROL: "Control", DELETE: "Delete", END: "End", ENTER: "Enter", ESCAPE: "Escape", F1: "F1", F10: "F10", F11: "F11", F12: "F12", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", HOME: "Home", META: "Meta", PAGE_DOWN: "PageDown", PAGE_UP: "PageUp", SHIFT: "Shift", SPACE: " ", TAB: "Tab", CTRL: "Control", ASTERISK: "*", A: "a", P: "p" }; var FIRST_KEYS = [kbd.ARROW_DOWN, kbd.PAGE_UP, kbd.HOME]; var LAST_KEYS = [kbd.ARROW_UP, kbd.PAGE_DOWN, kbd.END]; var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS]; var SELECTION_KEYS = [kbd.ENTER, kbd.SPACE]; var getNextKey = (dir = "ltr", orientation = "horizontal") => { return { horizontal: dir === "rtl" ? kbd.ARROW_LEFT : kbd.ARROW_RIGHT, vertical: kbd.ARROW_DOWN }[orientation]; }; var getPrevKey = (dir = "ltr", orientation = "horizontal") => { return { horizontal: dir === "rtl" ? kbd.ARROW_RIGHT : kbd.ARROW_LEFT, vertical: kbd.ARROW_UP }[orientation]; }; var getDirectionalKeys = (dir = "ltr", orientation = "horizontal") => { return { nextKey: getNextKey(dir, orientation), prevKey: getPrevKey(dir, orientation) }; }; // node_modules/@melt-ui/svelte/dist/internal/helpers/debounce.js function debounce(fn, wait = 500) { let timeout = null; return function(...args) { const later = () => { timeout = null; fn(...args); }; timeout && clearTimeout(timeout); timeout = setTimeout(later, wait); }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/platform.js var isDom = () => typeof window !== "undefined"; function getPlatform() { const agent = navigator.userAgentData; return (agent == null ? void 0 : agent.platform) ?? navigator.platform; } var pt = (v) => isDom() && v.test(getPlatform().toLowerCase()); var ua = (v) => isDom() && v.test(navigator.userAgent); var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints; var isMac = () => pt(/^mac/) && !isTouchDevice(); var isFirefox = () => ua(/firefox\//i); var isApple = () => pt(/mac|iphone|ipad|ipod/i); var isIos = () => isApple() && !isMac(); // node_modules/@melt-ui/svelte/dist/internal/helpers/polygon/hull.js function makeHull(points) { const newPoints = points.slice(); newPoints.sort(POINT_COMPARATOR); return makeHullPresorted(newPoints); } function makeHullPresorted(points) { if (points.length <= 1) return points.slice(); const upperHull = []; for (let i = 0; i < points.length; i++) { const p = points[i]; while (upperHull.length >= 2) { const q = upperHull[upperHull.length - 1]; const r = upperHull[upperHull.length - 2]; if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop(); else break; } upperHull.push(p); } upperHull.pop(); const lowerHull = []; for (let i = points.length - 1; i >= 0; i--) { const p = points[i]; while (lowerHull.length >= 2) { const q = lowerHull[lowerHull.length - 1]; const r = lowerHull[lowerHull.length - 2]; if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop(); else break; } lowerHull.push(p); } lowerHull.pop(); if (upperHull.length == 1 && lowerHull.length == 1 && upperHull[0].x == lowerHull[0].x && upperHull[0].y == lowerHull[0].y) return upperHull; else return upperHull.concat(lowerHull); } function POINT_COMPARATOR(a, b) { if (a.x < b.x) return -1; else if (a.x > b.x) return 1; else if (a.y < b.y) return -1; else if (a.y > b.y) return 1; else return 0; } // node_modules/@melt-ui/svelte/dist/internal/helpers/polygon/index.js function getPointsFromEl(el) { const rect = el.getBoundingClientRect(); return [ { x: rect.left, y: rect.top }, { x: rect.right, y: rect.top }, { x: rect.right, y: rect.bottom }, { x: rect.left, y: rect.bottom } ]; } function makeHullFromElements(els) { const points = els.flatMap((el) => getPointsFromEl(el)); return makeHull(points); } function pointInPolygon(point, polygon) { let inside = false; for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { const xi = polygon[i].x; const yi = polygon[i].y; const xj = polygon[j].x; const yj = polygon[j].y; const intersect = yi > point.y !== yj > point.y && point.x < (xj - xi) * (point.y - yi) / (yj - yi) + xi; if (intersect) inside = !inside; } return inside; } // node_modules/@melt-ui/svelte/dist/internal/helpers/scroll.js var LOCK_CLASSNAME = "data-melt-scroll-lock"; function assignStyle(el, style) { if (!el) return; const previousStyle = el.style.cssText; Object.assign(el.style, style); return () => { el.style.cssText = previousStyle; }; } function setCSSProperty(el, property, value) { if (!el) return; const previousValue = el.style.getPropertyValue(property); el.style.setProperty(property, value); return () => { if (previousValue) { el.style.setProperty(property, previousValue); } else { el.style.removeProperty(property); } }; } function getPaddingProperty(documentElement) { const documentLeft = documentElement.getBoundingClientRect().left; const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft; return scrollbarX ? "paddingLeft" : "paddingRight"; } function removeScroll(_document) { const doc = _document ?? document; const win = doc.defaultView ?? window; const { documentElement, body } = doc; const locked = body.hasAttribute(LOCK_CLASSNAME); if (locked) return noop2; body.setAttribute(LOCK_CLASSNAME, ""); const scrollbarWidth = win.innerWidth - documentElement.clientWidth; const setScrollbarWidthProperty = () => setCSSProperty(documentElement, "--scrollbar-width", `${scrollbarWidth}px`); const paddingProperty = getPaddingProperty(documentElement); const scrollbarSidePadding = win.getComputedStyle(body)[paddingProperty]; const setStyle = () => assignStyle(body, { overflow: "hidden", [paddingProperty]: `calc(${scrollbarSidePadding} + ${scrollbarWidth}px)` }); const setIOSStyle = () => { const { scrollX, scrollY, visualViewport } = win; const offsetLeft = (visualViewport == null ? void 0 : visualViewport.offsetLeft) ?? 0; const offsetTop = (visualViewport == null ? void 0 : visualViewport.offsetTop) ?? 0; const restoreStyle = assignStyle(body, { position: "fixed", overflow: "hidden", top: `${-(scrollY - Math.floor(offsetTop))}px`, left: `${-(scrollX - Math.floor(offsetLeft))}px`, right: "0", [paddingProperty]: `calc(${scrollbarSidePadding} + ${scrollbarWidth}px)` }); return () => { restoreStyle == null ? void 0 : restoreStyle(); win.scrollTo(scrollX, scrollY); }; }; const cleanups = [setScrollbarWidthProperty(), isIos() ? setIOSStyle() : setStyle()]; return () => { cleanups.forEach((fn) => fn == null ? void 0 : fn()); body.removeAttribute(LOCK_CLASSNAME); }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/store/derivedVisible.js function derivedVisible(obj) { const { open, forceVisible, activeTrigger } = obj; return derived([open, forceVisible, activeTrigger], ([$open, $forceVisible, $activeTrigger]) => ($open || $forceVisible) && $activeTrigger !== null); } // node_modules/@melt-ui/svelte/dist/internal/helpers/store/effect.js function effect(stores, fn) { let cb = void 0; const destroy = derived(stores, (stores2) => { cb == null ? void 0 : cb(); cb = fn(stores2); }).subscribe(noop2); const unsub = () => { destroy(); cb == null ? void 0 : cb(); }; safeOnDestroy(unsub); return unsub; } // node_modules/@melt-ui/svelte/dist/internal/helpers/store/toWritableStores.js function toWritableStores(properties) { const result = {}; Object.keys(properties).forEach((key) => { const propertyKey = key; const value = properties[propertyKey]; result[propertyKey] = withGet(writable(value)); }); return result; } // node_modules/@melt-ui/svelte/dist/internal/helpers/rovingFocus.js function handleRovingFocus(nextElement) { if (!isBrowser) return; sleep(1).then(() => { const currentFocusedElement = document.activeElement; if (!isHTMLElement(currentFocusedElement) || currentFocusedElement === nextElement) return; currentFocusedElement.tabIndex = -1; if (nextElement) { nextElement.tabIndex = 0; nextElement.focus(); } }); } function getFocusableElements() { return Array.from(document.querySelectorAll('a[href]:not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])')); } function getNextFocusable(currentElement) { const focusableElements = getFocusableElements(); const currentIndex = focusableElements.indexOf(currentElement); const nextIndex = currentIndex + 1; const nextElement = focusableElements[nextIndex]; if (nextIndex < focusableElements.length && isHTMLElement(nextElement)) { return nextElement; } return null; } function getPreviousFocusable(currentElement) { const focusableElements = getFocusableElements(); const currentIndex = focusableElements.indexOf(currentElement); const previousIndex = currentIndex - 1; const prevElement = focusableElements[previousIndex]; if (previousIndex >= 0 && isHTMLElement(prevElement)) { return prevElement; } return null; } // node_modules/@melt-ui/svelte/dist/internal/helpers/typeahead.js var ignoredKeys = /* @__PURE__ */ new Set(["Shift", "Control", "Alt", "Meta", "CapsLock", "NumLock"]); var defaults = { onMatch: handleRovingFocus, getCurrentItem: () => document.activeElement }; function createTypeaheadSearch(args = {}) { const withDefaults = { ...defaults, ...args }; const typed = withGet(writable([])); const resetTyped = debounce(() => { typed.update(() => []); }); const handleTypeaheadSearch = (key, items) => { if (ignoredKeys.has(key)) return; const currentItem = withDefaults.getCurrentItem(); const $typed = get_store_value(typed); if (!Array.isArray($typed)) { return; } $typed.push(key.toLowerCase()); typed.set($typed); const candidateItems = items.filter((item) => { if (item.getAttribute("disabled") === "true" || item.getAttribute("aria-disabled") === "true" || item.hasAttribute("data-disabled")) { return false; } return true; }); const isRepeated = $typed.length > 1 && $typed.every((char) => char === $typed[0]); const normalizeSearch = isRepeated ? $typed[0] : $typed.join(""); const currentItemIndex = isHTMLElement(currentItem) ? candidateItems.indexOf(currentItem) : -1; let wrappedItems = wrapArray(candidateItems, Math.max(currentItemIndex, 0)); const excludeCurrentItem = normalizeSearch.length === 1; if (excludeCurrentItem) { wrappedItems = wrappedItems.filter((v) => v !== currentItem); } const nextItem = wrappedItems.find((item) => (item == null ? void 0 : item.innerText) && item.innerText.toLowerCase().startsWith(normalizeSearch.toLowerCase())); if (isHTMLElement(nextItem) && nextItem !== currentItem) { withDefaults.onMatch(nextItem); } resetTyped(); }; return { typed, resetTyped, handleTypeaheadSearch }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/elements.js function getPortalParent(node) { let parent = node.parentElement; while (isHTMLElement(parent) && !parent.hasAttribute("data-portal")) { parent = parent.parentElement; } return parent || "body"; } function getPortalDestination(node, portalProp) { if (portalProp !== void 0) return portalProp; const portalParent = getPortalParent(node); if (portalParent === "body") return document.body; return null; } // node_modules/@melt-ui/svelte/dist/internal/helpers/ignore.js function createClickOutsideIgnore(meltId) { return (e) => { const target = e.target; const triggerEl = getElementByMeltId(meltId); if (!triggerEl || !isElement(target)) return false; const id = triggerEl.id; if (isHTMLLabelElement(target) && id === target.htmlFor) { return true; } if (target.closest(`label[for="${id}"]`)) { return true; } return false; }; } // node_modules/@melt-ui/svelte/dist/internal/helpers/focus.js async function handleFocus(args) { const { prop, defaultEl } = args; await Promise.all([sleep(1), tick]); if (prop === void 0) { defaultEl == null ? void 0 : defaultEl.focus(); return; } const returned = isFunction(prop) ? prop(defaultEl) : prop; if (typeof returned === "string") { const el = document.querySelector(returned); if (!isHTMLElement(el)) return; el.focus(); } else if (isHTMLElement(returned)) { returned.focus(); } } // node_modules/@melt-ui/svelte/dist/internal/helpers/math.js function snapValueToStep(value, min2, max2, step) { const remainder = (value - (isNaN(min2) ? 0 : min2)) % step; let snappedValue = Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder; if (!isNaN(min2)) { if (snappedValue < min2) { snappedValue = min2; } else if (!isNaN(max2) && snappedValue > max2) { snappedValue = min2 + Math.floor((max2 - min2) / step) * step; } } else if (!isNaN(max2) && snappedValue > max2) { snappedValue = Math.floor(max2 / step) * step; } const string = step.toString(); const index = string.indexOf("."); const precision = index >= 0 ? string.length - index : 0; if (precision > 0) { const pow = Math.pow(10, precision); snappedValue = Math.round(snappedValue * pow) / pow; } return snappedValue; } function clamp(min2, value, max2) { return Math.max(min2, Math.min(value, max2)); } // node_modules/@melt-ui/svelte/dist/builders/accordion/create.js var { name, selector } = createElHelpers("accordion"); var defaults2 = { multiple: false, disabled: false, forceVisible: false }; var createAccordion = (props) => { const withDefaults = { ...defaults2, ...props }; const options = toWritableStores(omit(withDefaults, "value", "onValueChange", "defaultValue")); const meltIds = generateIds(["root"]); const { disabled, forceVisible } = options; const valueWritable = withDefaults.value ?? writable(withDefaults.defaultValue); const value = overridable(valueWritable, withDefaults == null ? void 0 : withDefaults.onValueChange); const isSelected = (key, v) => { if (v === void 0) return false; if (typeof v === "string") return v === key; return v.includes(key); }; const isSelectedStore = derived(value, ($value) => { return (key) => isSelected(key, $value); }); const root = makeElement(name(), { returned: () => ({ "data-melt-id": meltIds.root }) }); const parseItemProps = (props2) => { if (typeof props2 === "string") { return { value: props2 }; } else { return props2; } }; const parseHeadingProps = (props2) => { if (typeof props2 === "number") { return { level: props2 }; } else { return props2; } }; const item = makeElement(name("item"), { stores: value, returned: ($value) => { return (props2) => { const { value: itemValue, disabled: disabled2 } = parseItemProps(props2); return { "data-state": isSelected(itemValue, $value) ? "open" : "closed", "data-disabled": disabledAttr(disabled2) }; }; } }); const trigger = makeElement(name("trigger"), { stores: [value, disabled], returned: ([$value, $disabled]) => { return (props2) => { const { value: itemValue, disabled: disabled2 } = parseItemProps(props2); return { disabled: disabledAttr($disabled || disabled2), "aria-expanded": isSelected(itemValue, $value) ? true : false, "aria-disabled": disabled2 ? true : false, "data-disabled": disabledAttr(disabled2), "data-value": itemValue, "data-state": isSelected(itemValue, $value) ? "open" : "closed" }; }; }, action: (node) => { const unsub = executeCallbacks(addMeltEventListener(node, "click", () => { const disabled2 = node.dataset.disabled === "true"; const itemValue = node.dataset.value; if (disabled2 || !itemValue) return; handleValueUpdate(itemValue); }), addMeltEventListener(node, "keydown", (e) => { if (![kbd.ARROW_DOWN, kbd.ARROW_UP, kbd.HOME, kbd.END].includes(e.key)) { return; } e.preventDefault(); if (e.key === kbd.SPACE || e.key === kbd.ENTER) { const disabled2 = node.dataset.disabled === "true"; const itemValue = node.dataset.value; if (disabled2 || !itemValue) return; handleValueUpdate(itemValue); return; } const el = e.target; const rootEl = getElementByMeltId(meltIds.root); if (!rootEl || !isHTMLElement(el)) return; const items = Array.from(rootEl.querySelectorAll(selector("trigger"))); const candidateItems = items.filter((item2) => { if (!isHTMLElement(item2)) return false; return item2.dataset.disabled !== "true"; }); if (!candidateItems.length) return; const elIdx = candidateItems.indexOf(el); if (e.key === kbd.ARROW_DOWN) { candidateItems[(elIdx + 1) % candidateItems.length].focus(); } if (e.key === kbd.ARROW_UP) { candidateItems[(elIdx - 1 + candidateItems.length) % candidateItems.length].focus(); } if (e.key === kbd.HOME) { candidateItems[0].focus(); } if (e.key === kbd.END) { candidateItems[candidateItems.length - 1].focus(); } })); return { destroy: unsub }; } }); const content = makeElement(name("content"), { stores: [value, disabled, forceVisible], returned: ([$value, $disabled, $forceVisible]) => { return (props2) => { const { value: itemValue } = parseItemProps(props2); const isVisible = isSelected(itemValue, $value) || $forceVisible; return { "data-state": isVisible ? "open" : "closed", "data-disabled": disabledAttr($disabled), "data-value": itemValue, hidden: isVisible ? void 0 : true, style: styleToString({ display: isVisible ? void 0 : "none" }) }; }; }, action: (node) => { tick().then(() => { const contentId = generateId(); const triggerId = generateId(); const parentTrigger = document.querySelector(`${selector("trigger")}, [data-value="${node.dataset.value}"]`); if (!isHTMLElement(parentTrigger)) return; node.id = contentId; parentTrigger.setAttribute("aria-controls", contentId); parentTrigger.id = triggerId; }); } }); const heading = makeElement(name("heading"), { returned: () => { return (props2) => { const { level } = parseHeadingProps(props2); return { role: "heading", "aria-level": level, "data-heading-level": level }; }; } }); function handleValueUpdate(itemValue) { value.update(($value) => { if ($value === void 0) { return withDefaults.multiple ? [itemValue] : itemValue; } if (Array.isArray($value)) { if ($value.includes(itemValue)) { return $value.filter((v) => v !== itemValue); } $value.push(itemValue); return $value; } return $value === itemValue ? void 0 : itemValue; }); } return { ids: meltIds, elements: { root, item, trigger, content, heading }, states: { value }, helpers: { isSelected: isSelectedStore }, options }; }; // node_modules/@melt-ui/svelte/dist/builders/avatar/create.js var defaults3 = { src: "", delayMs: 0, onLoadingStatusChange: void 0 }; var createAvatar = (props) => { const withDefaults = { ...defaults3, ...props }; const options = toWritableStores(omit(withDefaults, "loadingStatus", "onLoadingStatusChange")); const { src, delayMs } = options; const loadingStatusWritable = withDefaults.loadingStatus ?? writable("loading"); const loadingStatus = overridable(loadingStatusWritable, withDefaults == null ? void 0 : withDefaults.onLoadingStatusChange); effect([src, delayMs], ([$src, $delayMs]) => { if (isBrowser) { const image2 = new Image(); image2.src = $src; image2.onload = () => { if (delayMs !== void 0) { const timerId = window.setTimeout(() => { loadingStatus.set("loaded"); }, $delayMs); return () => window.clearTimeout(timerId); } else { loadingStatus.set("loaded"); } }; image2.onerror = () => { loadingStatus.set("error"); }; } }); const image = makeElement("avatar-image", { stores: [src, loadingStatus], returned: ([$src, $loadingStatus]) => { const imageStyles = styleToString({ display: $loadingStatus === "loaded" ? "block" : "none" }); return { src: $src, style: imageStyles }; } }); const fallback = makeElement("avatar-fallback", { stores: [loadingStatus], returned: ([$loadingStatus]) => { return { style: $loadingStatus === "loaded" ? styleToString({ display: "none" }) : void 0, hidden: $loadingStatus === "loaded" ? true : void 0 }; } }); return { elements: { image, fallback }, states: { loadingStatus }, options }; }; // node_modules/@melt-ui/svelte/dist/builders/checkbox/create.js var defaults4 = { disabled: false, required: false, name: void 0, value: "on", defaultChecked: false }; function createCheckbox(props) { const withDefaults = { ...defaults4, ...props }; const options = toWritableStores(omit(withDefaults, "checked", "defaultChecked")); const { disabled, name: name27, required, value } = options; const checkedWritable = withDefaults.checked ?? writable(withDefaults.defaultChecked); const checked = overridable(checkedWritable, withDefaults == null ? void 0 : withDefaults.onCheckedChange); const root = makeElement("checkbox", { stores: [checked, disabled, required], returned: ([$checked, $disabled, $required]) => { return { "data-disabled": disabledAttr($disabled), disabled: disabledAttr($disabled), "data-state": $checked === "indeterminate" ? "indeterminate" : $checked ? "checked" : "unchecked", type: "button", role: "checkbox", "aria-checked": $checked === "indeterminate" ? "mixed" : $checked, "aria-required": $required }; }, action: (node) => { const unsub = executeCallbacks(addMeltEventListener(node, "keydown", (e) => { if (e.key === kbd.ENTER) e.preventDefault(); }), addMeltEventListener(node, "click", () => { if (disabled.get()) return; checked.update((value2) => { if (value2 === "indeterminate") return true; return !value2; }); })); return { destroy: unsub }; } }); const input = makeElement("checkbox-input", { stores: [checked, name27, value, required, disabled], returned: ([$checked, $name, $value, $required, $disabled]) => { return { type: "checkbox", "aria-hidden": true, hidden: true, tabindex: -1, name: $name, value: $value, checked: $checked === "indeterminate" ? false : $checked, required: $required, disabled: disabledAttr($disabled), style: styleToString({ position: "absolute", opacity: 0, "pointer-events": "none", margin: 0, transform: "translateX(-100%)" }) }; } }); const isIndeterminate = derived(checked, ($checked) => $checked === "indeterminate"); const isChecked = derived(checked, ($checked) => $checked === true); return { elements: { root, input }, states: { checked }, helpers: { isIndeterminate, isChecked }, options }; } // node_modules/@melt-ui/svelte/dist/builders/collapsible/create.js var defaults5 = { defaultOpen: false, disabled: false, forceVisible: false }; var { name: name2 } = createElHelpers("collapsible"); function createCollapsible(props) { const withDefaults = { ...defaults5, ...props }; const options = toWritableStores(omit(withDefaults, "open", "defaultOpen", "onOpenChange")); const { disabled, forceVisible } = options; const openWritable = withDefaults.open ?? writable(withDefaults.defaultOpen); const open = overridable(openWritable, withDefaults == null ? void 0 : withDefaults.onOpenChange); const root = makeElement(name2(), { stores: [open, disabled], returned: ([$open, $disabled]) => ({ "data-state": $open ? "open" : "closed", "data-disabled": disabledAttr($disabled) }) }); const trigger = makeElement(name2("trigger"), { stores: [open, disabled], returned: ([$open, $disabled]) => ({ "data-state": $open ? "open" : "closed", "data-disabled": disabledAttr($disabled), disabled: disabledAttr($disabled) }), action: (node) => { const unsub = addMeltEventListener(node, "click", () => { const disabled2 = node.dataset.disabled !== void 0; if (disabled2) return; open.update(($open) => !$open); }); return { destroy: unsub }; } }); const isVisible = derived([open, forceVisible], ([$open, $forceVisible]) => $open || $forceVisible); const content = makeElement(name2("content"), { stores: [isVisible, disabled], returned: ([$isVisible, $disabled]) => ({ "data-state": $isVisible ? "open" : "closed", "data-disabled": disabledAttr($disabled), hidden: $isVisible ? void 0 : true, style: styleToString({ display: $isVisible ? void 0 : "none" }) }) }); return { elements: { root, trigger, content }, states: { open }, options }; } // node_modules/@melt-ui/svelte/dist/internal/actions/click-outside/action.js var documentClickStore = readable(void 0, (set) => { function clicked(event) { set(event); set(void 0); } const unsubscribe = addEventListener(document, "pointerup", clicked, { passive: false, capture: true }); return unsubscribe; }); // node_modules/@melt-ui/svelte/dist/internal/actions/escape-keydown/action.js var documentEscapeKeyStore = readable(void 0, (set) => { function keydown(event) { if (event && event.key === kbd.ESCAPE) { set(event); } set(void 0); } const unsubscribe = addEventListener(document, "keydown", keydown, { passive: false }); return unsubscribe; }); var useEscapeKeydown = (node, config = {}) => { let unsub = noop2; function update(config2 = {}) { unsub(); const options = { enabled: true, ...config2 }; const enabled = isReadable(options.enabled) ? options.enabled : readable(options.enabled); unsub = executeCallbacks( // Handle escape keydowns documentEscapeKeyStore.subscribe((e) => { var _a; if (!e || !get_store_value(enabled)) return; const target = e.target; if (!isHTMLElement(target) || target.closest("[data-escapee]") !== node) { return; } e.preventDefault(); if (options.ignore) { if (isFunction(options.ignore)) { if (options.ignore(e)) return; } else if (Array.isArray(options.ignore)) { if (options.ignore.length > 0 && options.ignore.some((ignoreEl) => { return ignoreEl && target === ignoreEl; })) return; } } (_a = options.handler) == null ? void 0 : _a.call(options, e); }), effect(enabled, ($enabled) => { if ($enabled) { node.dataset.escapee = ""; } else { delete node.dataset.escapee; } }) ); } update(config); return { update, destroy() { node.removeAttribute("data-escapee"); unsub(); } }; }; // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs var sides = ["top", "right", "bottom", "left"]; var alignments = ["start", "end"]; var placements = sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []); var min = Math.min; var max = Math.max; var round = Math.round; var floor = Math.floor; var createCoords = (v) => ({ x: v, y: v }); var oppositeSideMap = { left: "right", right: "left", bottom: "top", top: "bottom" }; var oppositeAlignmentMap = { start: "end", end: "start" }; function clamp2(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === "function" ? value(param) : value; } function getSide(placement) { return placement.split("-")[0]; } function getAlignment(placement) { return placement.split("-")[1]; } function getOppositeAxis(axis) { return axis === "x" ? "y" : "x"; } function getAxisLength(axis) { return axis === "y" ? "height" : "width"; } function getSideAxis(placement) { return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x"; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]); } function getSideList(side, isStart, rtl) { const lr = ["left", "right"]; const rl = ["right", "left"]; const tb = ["top", "bottom"]; const bt = ["bottom", "top"]; switch (side) { case "top": case "bottom": if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case "left": case "right": return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === "start", rtl); if (alignment) { list = list.map((side) => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== "number" ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } // node_modules/@floating-ui/core/dist/floating-ui.core.mjs function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = getSide(placement); const isVertical = sideAxis === "y"; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case "top": coords = { x: commonX, y: reference.y - floating.height }; break; case "bottom": coords = { x: commonX, y: reference.y + reference.height }; break; case "right": coords = { x: reference.x + reference.width, y: commonY }; break; case "left": coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (getAlignment(placement)) { case "start": coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case "end": coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } var computePosition = async (reference, floating, config) => { const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform2 } = config; const validMiddleware = middleware.filter(Boolean); const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating)); let rects = await platform2.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let middlewareData = {}; let resetCount = 0; for (let i = 0; i < validMiddleware.length; i++) { const { name: name27, fn } = validMiddleware[i]; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform: platform2, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData = { ...middlewareData, [name27]: { ...middlewareData[name27], ...data } }; if (reset && resetCount <= 50) { resetCount++; if (typeof reset === "object") { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform2.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform: platform2, rects, elements, strategy } = state; const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state); const paddingObject = getPaddingObject(padding); const altContext = elementContext === "floating" ? "reference" : "floating"; const element2 = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = rectToClientRect(await platform2.getClippingRect({ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element2))) != null ? _await$platform$isEle : true) ? element2 : element2.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)), boundary, rootBoundary, strategy })); const rect = elementContext === "floating" ? { ...rects.floating, x, y } : rects.reference; const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)); const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({ elements, rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } var arrow = (options) => ({ name: "arrow", options, async fn(state) { const { x, y, placement, rects, platform: platform2, elements, middlewareData } = state; const { element: element2, padding = 0 } = evaluate(options, state) || {}; if (element2 == null) { return {}; } const paddingObject = getPaddingObject(padding); const coords = { x, y }; const axis = getAlignmentAxis(placement); const length = getAxisLength(axis); const arrowDimensions = await platform2.getDimensions(element2); const isYAxis = axis === "y"; const minProp = isYAxis ? "top" : "left"; const maxProp = isYAxis ? "bottom" : "right"; const clientProp = isYAxis ? "clientHeight" : "clientWidth"; const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; const startDiff = coords[axis] - rects.reference[axis]; const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element2)); let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) { clientSize = elements.floating[clientProp] || rects.floating[length]; } const centerToReference = endDiff / 2 - startDiff / 2; const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; const minPadding = min(paddingObject[minProp], largestPossiblePadding); const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); const min$1 = minPadding; const max2 = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset2 = clamp2(min$1, center, max2); const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0; return { [axis]: coords[axis] + alignmentOffset, data: { [axis]: offset2, centerOffset: center - offset2 - alignmentOffset, ...shouldAddOffset && { alignmentOffset } }, reset: shouldAddOffset }; } }); var flip = function(options) { if (options === void 0) { options = {}; } return { name: "flip", options, async fn(state) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform: platform2, elements } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state); if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = getSide(placement); const isBasePlacement = getSide(initialPlacement) === initialPlacement; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements2 = [initialPlacement, ...fallbackPlacements]; const overflow = await detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides2 = getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides2[0]], overflow[sides2[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; if (!overflows.every((side2) => side2 <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements2[nextIndex]; if (nextPlacement) { return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; if (!resetPlacement) { switch (fallbackStrategy) { case "bestFit": { var _overflowsData$map$so; const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0]; if (placement2) { resetPlacement = placement2; } break; } case "initialPlacement": resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; async function convertValueToCoords(state, options) { const { placement, platform: platform2, elements } = state; const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)); const side = getSide(placement); const alignment = getAlignment(placement); const isVertical = getSideAxis(placement) === "y"; const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = evaluate(options, state); let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...rawValue }; if (alignment && typeof alignmentAxis === "number") { crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } var offset = function(options) { if (options === void 0) { options = 0; } return { name: "offset", options, async fn(state) { var _middlewareData$offse, _middlewareData$arrow; const { x, y, placement, middlewareData } = state; const diffCoords = await convertValueToCoords(state, options); if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } return { x: x + diffCoords.x, y: y + diffCoords.y, data: { ...diffCoords, placement } }; } }; }; var shift = function(options) { if (options === void 0) { options = {}; } return { name: "shift", options, async fn(state) { const { x, y, placement } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => { let { x: x2, y: y2 } = _ref; return { x: x2, y: y2 }; } }, ...detectOverflowOptions } = evaluate(options, state); const coords = { x, y }; const overflow = await detectOverflow(state, detectOverflowOptions); const crossAxis = getSideAxis(getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === "y" ? "top" : "left"; const maxSide = mainAxis === "y" ? "bottom" : "right"; const min2 = mainAxisCoord + overflow[minSide]; const max2 = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp2(min2, mainAxisCoord, max2); } if (checkCrossAxis) { const minSide = crossAxis === "y" ? "top" : "left"; const maxSide = crossAxis === "y" ? "bottom" : "right"; const min2 = crossAxisCoord + overflow[minSide]; const max2 = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp2(min2, crossAxisCoord, max2); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y } }; } }; }; var size = function(options) { if (options === void 0) { options = {}; } return { name: "size", options, async fn(state) { const { placement, rects, platform: platform2, elements } = state; const { apply = () => { }, ...detectOverflowOptions } = evaluate(options, state); const overflow = await detectOverflow(state, detectOverflowOptions); const side = getSide(placement); const alignment = getAlignment(placement); const isYAxis = getSideAxis(placement) === "y"; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === "top" || side === "bottom") { heightSide = side; widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; } else { widthSide = side; heightSide = alignment === "end" ? "top" : "bottom"; } const overflowAvailableHeight = height - overflow[heightSide]; const overflowAvailableWidth = width - overflow[widthSide]; const noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if (isYAxis) { const maximumClippingWidth = width - overflow.left - overflow.right; availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth; } else { const maximumClippingHeight = height - overflow.top - overflow.bottom; availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight; } if (noShift && !alignment) { const xMin = max(overflow.left, 0); const xMax = max(overflow.right, 0); const yMin = max(overflow.top, 0); const yMax = max(overflow.bottom, 0); if (isYAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); const nextDimensions = await platform2.getDimensions(elements.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function getNodeName(node) { if (isNode(node)) { return (node.nodeName || "").toLowerCase(); } return "#document"; } function getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { return value instanceof Node || value instanceof getWindow(value).Node; } function isElement2(value) { return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement2(value) { return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { if (typeof ShadowRoot === "undefined") { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } function isOverflowElement(element2) { const { overflow, overflowX, overflowY, display } = getComputedStyle2(element2); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display); } function isTableElement(element2) { return ["table", "td", "th"].includes(getNodeName(element2)); } function isContainingBlock(element2) { const webkit = isWebKit(); const css = getComputedStyle2(element2); return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value)); } function getContainingBlock(element2) { let currentNode = getParentNode(element2); while (isHTMLElement2(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = getParentNode(currentNode); } } return null; } function isWebKit() { if (typeof CSS === "undefined" || !CSS.supports) return false; return CSS.supports("-webkit-backdrop-filter", "none"); } function isLastTraversableNode(node) { return ["html", "body", "#document"].includes(getNodeName(node)); } function getComputedStyle2(element2) { return getWindow(element2).getComputedStyle(element2); } function getNodeScroll(element2) { if (isElement2(element2)) { return { scrollLeft: element2.scrollLeft, scrollTop: element2.scrollTop }; } return { scrollLeft: element2.pageXOffset, scrollTop: element2.pageYOffset }; } function getParentNode(node) { if (getNodeName(node) === "html") { return node; } const result = ( // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node) ); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement2(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element2) { const css = getComputedStyle2(element2); let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement2(element2); const offsetWidth = hasOffset ? element2.offsetWidth : width; const offsetHeight = hasOffset ? element2.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element2) { return !isElement2(element2) ? element2.contextElement : element2; } function getScale(element2) { const domElement = unwrapElement(element2); if (!isHTMLElement2(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? round(rect.width) : rect.width) / width; let y = ($ ? round(rect.height) : rect.height) / height; if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } var noOffsets = createCoords(0); function getVisualOffsets(element2) { const win = getWindow(element2); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element2, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element2)) { return false; } return isFixed; } function getBoundingClientRect(element2, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element2.getBoundingClientRect(); const domElement = unwrapElement(element2); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (isElement2(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element2); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement2(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = currentWin.frameElement; while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = getComputedStyle2(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = getWindow(currentIFrame); currentIFrame = currentWin.frameElement; } } return rectToClientRect({ width, height, x, y }); } var topLayerSelectors = [":popover-open", ":modal"]; function isTopLayer(floating) { return topLayerSelectors.some((selector10) => { try { return floating.matches(selector10); } catch (e) { return false; } }); } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements, rect, offsetParent, strategy } = _ref; const isFixed = strategy === "fixed"; const documentElement = getDocumentElement(offsetParent); const topLayer = elements ? isTopLayer(elements.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); const isOffsetParentAnElement = isHTMLElement2(offsetParent); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement2(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getClientRects(element2) { return Array.from(element2.getClientRects()); } function getWindowScrollBarX(element2) { return getBoundingClientRect(getDocumentElement(element2)).left + getNodeScroll(element2).scrollLeft; } function getDocumentRect(element2) { const html = getDocumentElement(element2); const scroll = getNodeScroll(element2); const body = element2.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element2); const y = -scroll.scrollTop; if (getComputedStyle2(body).direction === "rtl") { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function getViewportRect(element2, strategy) { const win = getWindow(element2); const html = getDocumentElement(element2); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === "fixed") { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } function getInnerBoundingClientRect(element2, strategy) { const clientRect = getBoundingClientRect(element2, true, strategy === "fixed"); const top = clientRect.top + element2.clientTop; const left = clientRect.left + element2.clientLeft; const scale = isHTMLElement2(element2) ? getScale(element2) : createCoords(1); const width = element2.clientWidth * scale.x; const height = element2.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element2, clippingAncestor, strategy) { let rect; if (clippingAncestor === "viewport") { rect = getViewportRect(element2, strategy); } else if (clippingAncestor === "document") { rect = getDocumentRect(getDocumentElement(element2)); } else if (isElement2(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element2); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return rectToClientRect(rect); } function hasFixedPositionAncestor(element2, stopNode) { const parentNode = getParentNode(element2); if (parentNode === stopNode || !isElement2(parentNode) || isLastTraversableNode(parentNode)) { return false; } return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); } function getClippingElementAncestors(element2, cache) { const cachedResult = cache.get(element2); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element2, [], false).filter((el) => isElement2(el) && getNodeName(el) !== "body"); let currentContainingBlockComputedStyle = null; const elementIsFixed = getComputedStyle2(element2).position === "fixed"; let currentNode = elementIsFixed ? getParentNode(element2) : element2; while (isElement2(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = getComputedStyle2(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === "fixed") { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element2, currentNode); if (shouldDropCurrentNode) { result = result.filter((ancestor) => ancestor !== currentNode); } else { currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element2, result); return result; } function getClippingRect(_ref) { let { element: element2, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element2, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element2, clippingAncestor, strategy); accRect.top = max(rect.top, accRect.top); accRect.right = min(rect.right, accRect.right); accRect.bottom = min(rect.bottom, accRect.bottom); accRect.left = max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element2, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element2) { const { width, height } = getCssDimensions(element2); return { width, height }; } function getRectRelativeToOffsetParent(element2, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement2(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === "fixed"; const rect = getBoundingClientRect(element2, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } const x = rect.left + scroll.scrollLeft - offsets.x; const y = rect.top + scroll.scrollTop - offsets.y; return { x, y, width: rect.width, height: rect.height }; } function getTrueOffsetParent(element2, polyfill) { if (!isHTMLElement2(element2) || getComputedStyle2(element2).position === "fixed") { return null; } if (polyfill) { return polyfill(element2); } return element2.offsetParent; } function getOffsetParent(element2, polyfill) { const window2 = getWindow(element2); if (!isHTMLElement2(element2) || isTopLayer(element2)) { return window2; } let offsetParent = getTrueOffsetParent(element2, polyfill); while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static" && !isContainingBlock(offsetParent))) { return window2; } return offsetParent || getContainingBlock(element2) || window2; } var getElementRects = async function(data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, ...await getDimensionsFn(data.floating) } }; }; function isRTL(element2) { return getComputedStyle2(element2).direction === "rtl"; } var platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement: isElement2, isRTL }; function observeMove(element2, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element2); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const { left, top, width, height } = element2.getBoundingClientRect(); if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 100); } else { refresh(false, ratio); } } isFirstUpdate = false; } try { io = new IntersectionObserver(handleObserve, { ...options, // Handle