@qualcomm-ui/react-mdx 1.0.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.min.css +1 -1
- package/dist/docs-layout/index.js +1 -1
- package/dist/docs-layout/index.js.map +4 -4
- package/dist/docs-layout/layout/page-links.d.ts +1 -1
- package/dist/docs-layout/layout/page-links.d.ts.map +1 -1
- package/dist/docs-layout/layout/sidebar.d.ts.map +1 -1
- package/dist/icons/github.d.ts +3 -0
- package/dist/icons/github.d.ts.map +1 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/icons/index.js.map +7 -0
- package/dist/site-search/index.js +1 -1
- package/dist/site-search/index.js.map +4 -4
- package/dist/site-search/search-result-item.d.ts.map +1 -1
- package/dist/site-search/site-search.d.ts.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +8 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/site-search/grouped-result-item.tsx", "../../../../common/dom/src/query/caret.ts", "../../../../common/dom/src/query/node.ts", "../../../../common/dom/src/query/computed-style.ts", "../../../../common/dom/src/query/data-url.ts", "../../../../common/dom/src/query/platform.ts", "../../../../common/dom/src/query/event.ts", "../../../../common/dom/src/query/form.ts", "../../../../common/dom/src/query/tabbable.ts", "../../../../common/dom/src/query/initial-focus.ts", "../../../../common/dom/src/query/raf.ts", "../../../../common/dom/src/query/mutation-observer.ts", "../../../../common/dom/src/query/navigate.ts", "../../../../common/dom/src/query/overflow.ts", "../../../../common/dom/src/query/shared.ts", "../../../../common/dom/src/query/point.ts", "../../../../common/dom/src/query/pointer-lock.ts", "../../../../common/dom/src/query/text-selection.ts", "../../../../common/dom/src/query/pointer-move.ts", "../../../../common/dom/src/query/press.ts", "../../../../common/dom/src/query/proxy-tab-focus.ts", "../../../../common/dom/src/query/query.ts", "../../../../common/dom/src/query/scope.ts", "../../../../common/dom/src/query/searchable.ts", "../../../../common/dom/src/query/set.ts", "../../../../common/dom/src/query/typeahead.ts", "../../../../common/dom/src/query/visual-viewport.ts", "../../../../common/dom/src/query/visually-hidden.ts", "../../../../common/dom/src/query/wait-for.ts", "../../../../common/dom/src/focus-visible/focus-visible.ts", "../../src/site-search/search-result-item.tsx", "../../src/site-search/site-search.tsx", "../../src/site-search/use-grouped-results.ts", "../../src/site-search/use-site-search.ts"],
|
|
4
|
-
"sourcesContent": ["import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { FileTextIcon } from \"lucide-react\";\nimport { isFocusVisible } from \"@qualcomm-ui/dom/focus-visible\";\nimport { Icon } from \"@qualcomm-ui/react/icon\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { clsx } from \"@qualcomm-ui/utils/clsx\";\nexport function GroupedResultItem({\n active,\n className,\n item,\n ref,\n ...props\n}) {\n return /* @__PURE__ */jsxs(PolymorphicElement, {\n ref,\n as: \"button\",\n className: clsx(\"qui-site-search__list-item qui-menu-item__root\", className),\n \"data-focus-visible\": booleanDataAttr(isFocusVisible()),\n \"data-highlighted\": booleanDataAttr(active),\n ...props,\n children: [/* @__PURE__ */jsx(Icon, {\n className: \"qui-site-search__item-icon\",\n icon: FileTextIcon,\n size: \"lg\"\n }), /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-site-search__list-item-content\",\n children: [/* @__PURE__ */jsx(\"span\", {\n className: \"qui-site-search__content\",\n children: item.title\n }), /* @__PURE__ */jsx(\"div\", {\n className: \"qui-site-search__metadata\",\n children: item.categoryId\n })]\n })]\n });\n}", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function isCaretAtStart(\n input: HTMLInputElement | HTMLTextAreaElement | null,\n): boolean {\n if (!input) {\n return false\n }\n try {\n return input.selectionStart === 0 && input.selectionEnd === 0\n } catch {\n return input.value === \"\"\n }\n}\n\nexport function setCaretToEnd(\n input: HTMLInputElement | HTMLTextAreaElement | null,\n): void {\n if (!input) {\n return\n }\n const start = input.selectionStart ?? 0\n const end = input.selectionEnd ?? 0\n if (Math.abs(end - start) !== 0) {\n return\n }\n if (start !== 0) {\n return\n }\n input.setSelectionRange(input.value.length, input.value.length)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isObject} from \"@qualcomm-ui/utils/guard\"\n\nconst ELEMENT_NODE: typeof Node.ELEMENT_NODE = 1\nconst DOCUMENT_NODE: typeof Node.DOCUMENT_NODE = 9\nconst DOCUMENT_FRAGMENT_NODE: typeof Node.DOCUMENT_FRAGMENT_NODE = 11\n\nexport const isHTMLElement = (el: any): el is HTMLElement =>\n isObject(el) &&\n el.nodeType === ELEMENT_NODE &&\n typeof el.nodeName === \"string\"\n\nexport const isDocument = (el: any): el is Document =>\n isObject(el) && el.nodeType === DOCUMENT_NODE\n\nexport const isWindow = (el: any): el is Window =>\n isObject(el) && el === el.window\n\nexport const isVisualViewport = (el: any): el is VisualViewport =>\n isObject(el) && el.constructor.name === \"VisualViewport\"\n\nexport const getNodeName = (node: Node | Window): string => {\n if (isHTMLElement(node)) {\n return node.localName || \"\"\n }\n return \"#document\"\n}\n\nexport function isRootElement(node: Node): boolean {\n return [\"html\", \"body\", \"#document\"].includes(getNodeName(node))\n}\n\nexport const isNode = (el: any): el is Node =>\n isObject(el) && el.nodeType !== undefined\n\nexport const isShadowRoot = (el: any): el is ShadowRoot =>\n isNode(el) && el.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in el\n\nexport const isInputElement = (el: any): el is HTMLInputElement =>\n isHTMLElement(el) && el.localName === \"input\"\n\nexport const isAnchorElement = (\n el: HTMLElement | null | undefined,\n): el is HTMLAnchorElement => !!el?.matches(\"a[href]\")\n\nexport function isElementVisible(el: Node): boolean {\n if (!isHTMLElement(el)) {\n return false\n }\n return (\n el.offsetWidth > 0 || el.offsetHeight > 0 || el.getClientRects().length > 0\n )\n}\n\nconst TEXTAREA_SELECT_REGEX = /(textarea|select)/\n\nexport function isEditableElement(\n el: HTMLElement | EventTarget | null,\n): boolean {\n if (el == null || !isHTMLElement(el)) {\n return false\n }\n try {\n return (\n (isInputElement(el) && el.selectionStart != null) ||\n TEXTAREA_SELECT_REGEX.test(el.localName) ||\n el.isContentEditable ||\n el.getAttribute(\"contenteditable\") === \"true\" ||\n el.getAttribute(\"contenteditable\") === \"\"\n )\n } catch {\n return false\n }\n}\n\ntype Target = HTMLElement | EventTarget | null | undefined\n\nexport function contains(parent: Target, child: Target): boolean {\n if (!parent || !child) {\n return false\n }\n if (!isHTMLElement(parent) || !isHTMLElement(child)) {\n return false\n }\n const rootNode = child.getRootNode?.()\n if (parent === child) {\n return true\n }\n if (parent.contains(child)) {\n return true\n }\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child\n while (next) {\n if (parent === next) {\n return true\n }\n // @ts-ignore\n next = next.parentNode || next.host\n }\n }\n return false\n}\n\nexport function getDocument(\n el: Element | Window | Node | Document | null | undefined,\n): Document {\n if (isDocument(el)) {\n return el\n }\n if (isWindow(el)) {\n return el.document\n }\n return el?.ownerDocument ?? document\n}\n\nexport function getDocumentElement(\n el: Element | Node | Window | Document | null | undefined,\n): HTMLElement {\n return getDocument(el).documentElement\n}\n\nexport function getWindow(\n el: Node | ShadowRoot | Document | null | undefined,\n): Window & typeof globalThis {\n if (isShadowRoot(el)) {\n return getWindow(el.host)\n }\n if (isDocument(el)) {\n return el.defaultView ?? window\n }\n if (isHTMLElement(el)) {\n return el.ownerDocument?.defaultView ?? window\n }\n return window\n}\n\nexport function getActiveElement(\n rootNode: Document | ShadowRoot,\n): HTMLElement | null {\n let activeElement = rootNode.activeElement as HTMLElement | null\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement as HTMLElement | null\n if (el === activeElement) {\n break\n } else {\n activeElement = el\n }\n }\n return activeElement\n}\n\nexport function getParentNode(node: Node): Node {\n if (getNodeName(node) === \"html\") {\n return node\n }\n const result =\n (node as any).assignedSlot ||\n node.parentNode ||\n (isShadowRoot(node) && node.host) ||\n getDocumentElement(node)\n return isShadowRoot(result) ? result.host : result\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getWindow} from \"./node\"\n\nconst styleCache = new WeakMap<Element, CSSStyleDeclaration>()\n\nexport function getComputedStyle(el: Element): CSSStyleDeclaration | undefined {\n if (!styleCache.has(el)) {\n styleCache.set(el, getWindow(el).getComputedStyle(el))\n }\n return styleCache.get(el)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getWindow} from \"./node\"\n\nexport type DataUrlType = \"image/png\" | \"image/jpeg\" | \"image/svg+xml\"\n\nexport interface DataUrlOptions {\n /**\n * The background color of the canvas.\n * Useful when type is `image/jpeg`\n */\n background?: string | undefined\n /**\n * The quality of the image\n * @default 0.92\n */\n quality?: number | undefined\n /**\n * The type of the image\n */\n type: DataUrlType\n}\n\nexport function getDataUrl(\n svg: SVGSVGElement | undefined | null,\n opts: DataUrlOptions,\n): Promise<string> {\n const {background, quality = 0.92, type} = opts\n\n if (!svg) {\n throw new Error(\"[@qualcomm-ui/dom/query]: Could not find the svg element\")\n }\n\n const win = getWindow(svg)\n const doc = win.document\n\n const svgBounds = svg.getBoundingClientRect()\n\n const svgClone = svg.cloneNode(true) as SVGSVGElement\n if (!svgClone.hasAttribute(\"viewBox\")) {\n svgClone.setAttribute(\n \"viewBox\",\n `0 0 ${svgBounds.width} ${svgBounds.height}`,\n )\n }\n\n const serializer = new win.XMLSerializer()\n const source = `<?xml version=\"1.0\" standalone=\"no\"?>\\r\\n${serializer.serializeToString(\n svgClone,\n )}`\n const svgString = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`\n\n if (type === \"image/svg+xml\") {\n return Promise.resolve(svgString).then((str) => {\n svgClone.remove()\n return str\n })\n }\n\n const dpr = win.devicePixelRatio || 1\n\n const canvas = doc.createElement(\"canvas\")\n const image = new win.Image()\n image.src = svgString\n\n canvas.width = svgBounds.width * dpr\n canvas.height = svgBounds.height * dpr\n\n const context = canvas.getContext(\"2d\")\n\n if (!context) {\n throw new Error(\"[getDataUrl]: Could not get the canvas context\")\n }\n\n if (type === \"image/jpeg\" || background) {\n context.fillStyle = background || \"white\"\n context.fillRect(0, 0, canvas.width, canvas.height)\n }\n\n return new Promise((resolve) => {\n image.onload = () => {\n context?.drawImage(image, 0, 0, canvas.width, canvas.height)\n resolve(canvas.toDataURL(type, quality))\n svgClone.remove()\n }\n })\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function isDom(): boolean {\n return typeof document !== \"undefined\"\n}\n\ninterface NavigatorUserAgentData {\n brands: Array<{brand: string; version: string}>\n mobile: boolean\n platform: string\n}\n\nexport function getPlatform(): string {\n const agent = (navigator as any).userAgentData as\n | NavigatorUserAgentData\n | undefined\n return agent?.platform ?? navigator.platform\n}\n\nexport function getUserAgent(): string {\n const ua = (navigator as any).userAgentData as\n | NavigatorUserAgentData\n | undefined\n if (ua && Array.isArray(ua.brands)) {\n return ua.brands.map(({brand, version}) => `${brand}/${version}`).join(\" \")\n }\n return navigator.userAgent\n}\n\nfunction pt(v: RegExp) {\n return isDom() && v.test(getPlatform())\n}\n\nfunction ua(v: RegExp) {\n return isDom() && v.test(getUserAgent())\n}\n\nconst vn = (v: RegExp) => isDom() && v.test(navigator.vendor)\n\nexport function isTouchDevice(): boolean {\n return isDom() && !!navigator.maxTouchPoints\n}\n\nexport function isMac(): boolean {\n return pt(/^Mac/)\n}\n\nexport function isSafari(): boolean {\n return isApple() && vn(/apple/i)\n}\n\nexport function isFirefox(): boolean {\n return ua(/firefox\\//i)\n}\n\nexport function isApple(): boolean {\n return pt(/mac|iphone|ipad|ipod/i)\n}\n\nexport function isIos(): boolean {\n return pt(/iP(hone|ad|od)|iOS/)\n}\n\nexport function isWebKit(): boolean {\n return ua(/AppleWebKit/)\n}\n\nexport function isAndroid(): boolean {\n const re = /android/i\n return pt(re) || ua(re)\n}\n\n/**\n * Returns the keyboard modifier key: CMD if on Mac, Ctrl if on Windows or Linux.\n *\n * @param ssrFallback fallback value to render during SSR.\n */\nexport function getModifierKey(ssrFallback: string = \"Ctrl\"): string {\n return isMac() ? \"\u2318\" : ssrFallback\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {MaybeFn} from \"@qualcomm-ui/utils/guard\"\n\nimport {contains} from \"./node\"\nimport {isAndroid, isApple, isMac} from \"./platform\"\nimport type {AnyPointerEvent, EventKeyOptions, NativeEvent} from \"./types\"\n\nexport function getBeforeInputValue(\n event: Pick<InputEvent, \"currentTarget\">,\n): string {\n const {selectionEnd, selectionStart, value} =\n event.currentTarget as HTMLInputElement\n return (\n value.slice(0, selectionStart ?? -1) +\n (event as any).data +\n value.slice(selectionEnd ?? -1)\n )\n}\n\nfunction getComposedPath(event: any): EventTarget[] | undefined {\n return event.composedPath?.() ?? event.nativeEvent?.composedPath?.()\n}\n\nexport function getEventTarget<T extends EventTarget>(\n event: Partial<Pick<UIEvent, \"target\" | \"composedPath\">>,\n): T | null {\n const composedPath = getComposedPath(event)\n return (composedPath?.[0] ?? event.target) as T | null\n}\n\nexport function isSelfTarget(\n event: Partial<Pick<UIEvent, \"currentTarget\" | \"target\" | \"composedPath\">>,\n): boolean {\n return contains(event.currentTarget as Node, getEventTarget(event))\n}\n\nexport function isOpeningInNewTab(\n event: Pick<MouseEvent, \"currentTarget\" | \"metaKey\" | \"ctrlKey\">,\n): boolean {\n const element = event.currentTarget as\n | HTMLAnchorElement\n | HTMLButtonElement\n | HTMLInputElement\n | null\n if (!element) {\n return false\n }\n\n const isAppleDevice = isApple()\n if (isAppleDevice && !event.metaKey) {\n return false\n }\n if (!isAppleDevice && !event.ctrlKey) {\n return false\n }\n\n const localName = element.localName\n\n if (localName === \"a\") {\n return true\n }\n if (localName === \"button\" && element.type === \"submit\") {\n return true\n }\n if (localName === \"input\" && element.type === \"submit\") {\n return true\n }\n\n return false\n}\n\nexport function isDownloadingEvent(\n event: Pick<MouseEvent, \"altKey\" | \"currentTarget\">,\n): boolean {\n const element = event.currentTarget as\n | HTMLAnchorElement\n | HTMLButtonElement\n | HTMLInputElement\n | null\n if (!element) {\n return false\n }\n const localName = element.localName\n if (!event.altKey) {\n return false\n }\n if (localName === \"a\") {\n return true\n }\n if (localName === \"button\" && element.type === \"submit\") {\n return true\n }\n if (localName === \"input\" && element.type === \"submit\") {\n return true\n }\n return false\n}\n\nexport function isComposingEvent(event: any): boolean {\n return getNativeEvent(event).isComposing\n}\n\nexport function isKeyboardClick(\n e: Pick<MouseEvent, \"detail\" | \"clientX\" | \"clientY\">,\n): boolean {\n return e.detail === 0 || (e.clientX === 0 && e.clientY === 0)\n}\n\nexport function isPrintableKey(\n e: Pick<KeyboardEvent, \"key\" | \"ctrlKey\" | \"metaKey\">,\n): boolean {\n return e.key.length === 1 && !e.ctrlKey && !e.metaKey\n}\n\nexport function isVirtualPointerEvent(e: PointerEvent): boolean {\n return (\n (e.width === 0 && e.height === 0) ||\n (e.width === 1 &&\n e.height === 1 &&\n e.pressure === 0 &&\n e.detail === 0 &&\n e.pointerType === \"mouse\")\n )\n}\n\nexport function isVirtualClick(e: MouseEvent | PointerEvent): boolean {\n if ((e as any).mozInputSource === 0 && e.isTrusted) {\n return true\n }\n if (isAndroid() && (e as PointerEvent).pointerType) {\n return e.type === \"click\" && e.buttons === 1\n }\n return e.detail === 0 && !(e as PointerEvent).pointerType\n}\n\nexport function isLeftClick(e: Pick<MouseEvent, \"button\">): boolean {\n return e.button === 0\n}\n\nexport function isContextMenuEvent(\n e: Pick<MouseEvent, \"button\" | \"ctrlKey\" | \"metaKey\">,\n): boolean {\n return e.button === 2 || (isMac() && e.ctrlKey && e.button === 0)\n}\n\nexport function isModifierKey(\n e: Pick<KeyboardEvent, \"ctrlKey\" | \"metaKey\" | \"altKey\">,\n): boolean {\n return e.ctrlKey || e.altKey || e.metaKey\n}\n\nexport const isTouchEvent = (event: AnyPointerEvent): event is TouchEvent =>\n \"touches\" in event && event.touches.length > 0\n\nconst keyMap: Record<string, string> = {\n \" \": \"Space\",\n \",\": \"Comma\",\n Down: \"ArrowDown\",\n Esc: \"Escape\",\n Left: \"ArrowLeft\",\n Right: \"ArrowRight\",\n Up: \"ArrowUp\",\n}\n\nconst rtlKeyMap: Record<string, string> = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\",\n}\n\nexport function getEventKey(\n event: Pick<KeyboardEvent, \"key\">,\n options: EventKeyOptions = {},\n): string {\n const {dir = \"ltr\", orientation = \"horizontal\"} = options\n let key = event.key\n key = keyMap[key] ?? key\n const isRtl = dir === \"rtl\" && orientation === \"horizontal\"\n if (isRtl && key in rtlKeyMap) {\n key = rtlKeyMap[key]\n }\n return key\n}\n\nexport function getNativeEvent<E>(event: E): NativeEvent<E> {\n return (event as any).nativeEvent ?? event\n}\n\nconst pageKeys = new Set([\"PageUp\", \"PageDown\"])\nconst arrowKeys = new Set([\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"])\n\nexport function getEventStep(\n event: Pick<KeyboardEvent, \"ctrlKey\" | \"metaKey\" | \"key\" | \"shiftKey\">,\n): 1 | 0.1 | 10 {\n if (event.ctrlKey || event.metaKey) {\n return 0.1\n } else {\n const isPageKey = pageKeys.has(event.key)\n const isSkipKey = isPageKey || (event.shiftKey && arrowKeys.has(event.key))\n return isSkipKey ? 10 : 1\n }\n}\n\nexport function getEventPoint(\n event: any,\n type: \"page\" | \"client\" = \"client\",\n): {x: number; y: number} {\n const point = isTouchEvent(event)\n ? event.touches[0] || event.changedTouches[0]\n : event\n return {x: point[`${type}X`], y: point[`${type}Y`]}\n}\n\ninterface DOMEventMap\n extends DocumentEventMap,\n WindowEventMap,\n HTMLElementEventMap {}\n\nexport const addDomEvent = <K extends keyof DOMEventMap>(\n target: MaybeFn<EventTarget | null>,\n eventName: K,\n handler: (event: DOMEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n) => {\n const node = typeof target === \"function\" ? target() : target\n node?.addEventListener(eventName, handler as any, options)\n return (): void => {\n node?.removeEventListener(eventName, handler as any, options)\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getWindow} from \"./node\"\nimport type {HTMLElementWithValue} from \"./types\"\n\ninterface DescriptorOptions {\n property?: \"value\" | \"checked\" | undefined\n type?:\n | \"HTMLInputElement\"\n | \"HTMLTextAreaElement\"\n | \"HTMLSelectElement\"\n | undefined\n}\n\nfunction getDescriptor(el: HTMLElement, options: DescriptorOptions) {\n const {property = \"value\", type = \"HTMLInputElement\"} = options\n const proto = getWindow(el)[type].prototype\n return Object.getOwnPropertyDescriptor(proto, property) ?? {}\n}\n\nfunction getElementType(\n el: HTMLElementWithValue,\n):\n | \"HTMLInputElement\"\n | \"HTMLTextAreaElement\"\n | \"HTMLSelectElement\"\n | undefined {\n if (el.localName === \"input\") {\n return \"HTMLInputElement\"\n }\n if (el.localName === \"textarea\") {\n return \"HTMLTextAreaElement\"\n }\n if (el.localName === \"select\") {\n return \"HTMLSelectElement\"\n }\n return undefined\n}\n\nexport function setElementValue(\n el: HTMLElementWithValue | null,\n value: string,\n property: \"value\" | \"checked\" = \"value\",\n): void {\n if (!el) {\n return\n }\n const type = getElementType(el)\n if (type) {\n const descriptor = getDescriptor(el, {property, type})\n descriptor.set?.call(el, value)\n }\n el.setAttribute(property, value)\n}\n\nexport function setElementChecked(\n el: HTMLInputElement | null,\n checked: boolean,\n): void {\n if (!el) {\n return\n }\n const descriptor = getDescriptor(el, {\n property: \"checked\",\n type: \"HTMLInputElement\",\n })\n descriptor.set?.call(el, checked)\n // react applies the `checked` automatically when we call the descriptor\n // but for consistency with vanilla JS, we need to do it manually as well\n if (checked) {\n el.setAttribute(\"checked\", \"\")\n } else {\n el.removeAttribute(\"checked\")\n }\n}\n\nexport interface InputValueEventOptions {\n bubbles?: boolean\n value: string | number\n}\n\nexport function dispatchInputValueEvent(\n el: HTMLElementWithValue | null,\n options: InputValueEventOptions,\n): void {\n const {bubbles = true, value} = options\n\n if (!el) {\n return\n }\n\n const win = getWindow(el)\n if (!(el instanceof win.HTMLInputElement)) {\n return\n }\n\n setElementValue(el, `${value}`)\n el.dispatchEvent(new win.Event(\"input\", {bubbles}))\n}\n\nexport interface CheckedEventOptions {\n bubbles?: boolean\n checked: boolean\n}\n\nexport function dispatchInputCheckedEvent(\n el: HTMLInputElement | null,\n options: CheckedEventOptions,\n): void {\n const {bubbles = true, checked} = options\n if (!el) {\n return\n }\n const win = getWindow(el)\n if (!(el instanceof win.HTMLInputElement)) {\n return\n }\n setElementChecked(el, checked)\n el.dispatchEvent(new win.Event(\"click\", {bubbles}))\n}\n\nfunction getClosestForm(el: HTMLElement) {\n return isFormElement(el) ? el.form : el.closest(\"form\")\n}\n\nfunction isFormElement(el: HTMLElement): el is HTMLElementWithValue {\n return el.matches(\"textarea, input, select, button\")\n}\n\nfunction trackFormReset(\n el: HTMLElement | null | undefined,\n callback: VoidFunction,\n) {\n if (!el) {\n return\n }\n const form = getClosestForm(el)\n const onReset = (e: Event) => {\n if (e.defaultPrevented) {\n return\n }\n callback()\n }\n form?.addEventListener(\"reset\", onReset, {passive: true})\n return () => form?.removeEventListener(\"reset\", onReset)\n}\n\nfunction trackFieldsetDisabled(\n el: HTMLElement | null | undefined,\n callback: (disabled: boolean) => void,\n) {\n const fieldset = el?.closest(\"fieldset\")\n if (!fieldset) {\n return\n }\n callback(fieldset.disabled)\n const win = getWindow(fieldset)\n const obs = new win.MutationObserver(() => callback(fieldset.disabled))\n obs.observe(fieldset, {\n attributeFilter: [\"disabled\"],\n attributes: true,\n })\n return () => obs.disconnect()\n}\n\nexport interface TrackFormControlOptions {\n onFieldsetDisabledChange: (disabled: boolean) => void\n onFormReset: VoidFunction\n}\n\nexport function trackFormControl(\n el: HTMLElement | null,\n options: TrackFormControlOptions,\n): VoidFunction | undefined {\n if (!el) {\n return\n }\n const {onFieldsetDisabledChange, onFormReset} = options\n const cleanups = [\n trackFormReset(el, onFormReset),\n trackFieldsetDisabled(el, onFieldsetDisabledChange),\n ]\n return (): void => cleanups.forEach((cleanup) => cleanup?.())\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isEditableElement, isElementVisible, isHTMLElement} from \"./node\"\n\ntype IncludeContainerType = boolean | \"if-empty\"\n\nconst isFrame = (el: any): el is HTMLIFrameElement =>\n isHTMLElement(el) && el.tagName === \"IFRAME\"\n\nconst hasTabIndex = (el: Element) =>\n !Number.isNaN(parseInt(el.getAttribute(\"tabindex\") || \"0\", 10))\nconst hasNegativeTabIndex = (el: Element) =>\n parseInt(el.getAttribute(\"tabindex\") || \"0\", 10) < 0\n\nconst focusableSelector =\n /* #__PURE__ */ \"input:not([type='hidden']):not([disabled]), select:not([disabled]), \" +\n \"textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], \" +\n \"iframe, object, embed, area[href], audio[controls], video[controls], \" +\n \"[contenteditable]:not([contenteditable='false']), details > summary:first-of-type\"\n\nexport function getFocusables(\n container: Pick<HTMLElement, \"querySelectorAll\"> | null,\n includeContainer: IncludeContainerType = false,\n): HTMLElement[] {\n if (!container) {\n return []\n }\n const elements = Array.from(\n container.querySelectorAll<HTMLElement>(focusableSelector),\n )\n\n const include =\n // eslint-disable-next-line eqeqeq\n includeContainer == true ||\n (includeContainer === \"if-empty\" && elements.length === 0)\n if (include && isHTMLElement(container) && isFocusable(container)) {\n elements.unshift(container)\n }\n\n const focusableElements = elements.filter(isFocusable)\n\n focusableElements.forEach((element, i) => {\n if (isFrame(element) && element.contentDocument) {\n const frameBody = element.contentDocument.body\n focusableElements.splice(i, 1, ...getFocusables(frameBody))\n }\n })\n\n return focusableElements\n}\n\nexport function isFocusable(\n element: HTMLElement | null,\n): element is HTMLElement {\n if (!element || element.closest(\"[inert]\")) {\n return false\n }\n return element.matches(focusableSelector) && isElementVisible(element)\n}\n\nexport function getFirstFocusable(\n container: HTMLElement | null,\n includeContainer?: IncludeContainerType,\n): HTMLElement | null {\n const [first] = getFocusables(container, includeContainer)\n return first || null\n}\n\nexport function getTabbables(\n container: HTMLElement | null | undefined,\n includeContainer?: IncludeContainerType,\n): HTMLElement[] {\n if (!container) {\n return []\n }\n const elements = Array.from(\n container.querySelectorAll<HTMLElement>(focusableSelector),\n )\n const tabbableElements = elements.filter(isTabbable)\n\n if (includeContainer && isTabbable(container)) {\n tabbableElements.unshift(container)\n }\n\n tabbableElements.forEach((element, i) => {\n if (isFrame(element) && element.contentDocument) {\n const frameBody = element.contentDocument.body\n const allFrameTabbable = getTabbables(frameBody)\n tabbableElements.splice(i, 1, ...allFrameTabbable)\n }\n })\n\n if (!tabbableElements.length && includeContainer) {\n return elements\n }\n\n return tabbableElements\n}\n\nexport function isTabbable(el: HTMLElement | null): el is HTMLElement {\n if (el != null && el.tabIndex > 0) {\n return true\n }\n return isFocusable(el) && !hasNegativeTabIndex(el)\n}\n\nexport function getFirstTabbable(\n container: HTMLElement | null,\n includeContainer?: IncludeContainerType,\n): HTMLElement | null {\n const [first] = getTabbables(container, includeContainer)\n return first || null\n}\n\nexport function getLastTabbable(\n container: HTMLElement | null,\n includeContainer?: IncludeContainerType,\n): HTMLElement | null {\n const elements = getTabbables(container, includeContainer)\n return elements[elements.length - 1] || null\n}\n\nexport function getTabbableEdges(\n container: HTMLElement | null | undefined,\n includeContainer?: IncludeContainerType,\n): [HTMLElement, HTMLElement] | [null, null] {\n const elements = getTabbables(container, includeContainer)\n const first = elements[0] || null\n const last = elements[elements.length - 1] || null\n return [first, last]\n}\n\nexport function getNextTabbable(\n container: HTMLElement | null,\n current?: HTMLElement | null,\n): HTMLElement | null {\n const tabbables = getTabbables(container)\n const doc = container?.ownerDocument || document\n const currentElement = current ?? (doc.activeElement as HTMLElement | null)\n if (!currentElement) {\n return null\n }\n const index = tabbables.indexOf(currentElement)\n return tabbables[index + 1] || null\n}\n\nexport function getTabIndex(node: HTMLElement | SVGElement): number {\n if (node.tabIndex < 0) {\n if (\n (/^(audio|video|details)$/.test(node.localName) ||\n isEditableElement(node)) &&\n !hasTabIndex(node)\n ) {\n return 0\n }\n }\n return node.tabIndex\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getTabbableEdges, getTabbables} from \"./tabbable\"\n\n/**\n * Represents options for managing the initial focus within a focusable area.\n */\nexport interface InitialFocusOptions {\n enabled?: boolean | undefined\n filter?: ((el: HTMLElement) => boolean) | undefined\n getInitialEl?: (() => HTMLElement | null) | undefined\n root: HTMLElement | null\n}\n\n/**\n * Determines and returns the initial focusable element based on the provided\n * options.\n *\n * @param {InitialFocusOptions} options - Configuration options for determining the initial focus element.\n * @param {boolean} [options.enabled=true] - Whether the focus logic should be processed.\n * @param {(HTMLElement | (() => HTMLElement | null | undefined))} [options.getInitialEl] - A specific element or a function returning an element to set as the initial focus target.\n * @param {HTMLElement} [options.root] - The root container within which to search for focusable elements.\n * @param {(node: HTMLElement) => boolean} [options.filter] - A function to filter and prioritize focusable elements.\n * @return {HTMLElement | undefined} The element to receive initial focus, or `undefined` if no suitable element is found.\n */\nexport function getInitialFocus(\n options: InitialFocusOptions,\n): HTMLElement | undefined {\n const {enabled = true, filter, getInitialEl, root} = options\n\n if (!enabled) {\n return\n }\n\n let node: HTMLElement | null | undefined = null\n\n node ||= typeof getInitialEl === \"function\" ? getInitialEl() : getInitialEl\n node ||= root?.querySelector<HTMLElement>(\"[data-autofocus],[autofocus]\")\n\n if (!node) {\n const tabbables = getTabbables(root)\n node = filter ? tabbables.filter(filter)[0] : tabbables[0]\n }\n\n return node || root || undefined\n}\n\nexport function isValidTabEvent(\n event: Pick<KeyboardEvent, \"shiftKey\" | \"currentTarget\">,\n): boolean {\n const container = event.currentTarget as HTMLElement | null\n if (!container) {\n return false\n }\n\n const [firstTabbable, lastTabbable] = getTabbableEdges(container)\n const doc = container.ownerDocument || document\n\n if (doc.activeElement === firstTabbable && event.shiftKey) {\n return false\n }\n if (doc.activeElement === lastTabbable && !event.shiftKey) {\n return false\n }\n if (!firstTabbable && !lastTabbable) {\n return false\n }\n\n return true\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function nextTick(fn: VoidFunction): VoidFunction {\n const set = new Set<VoidFunction>()\n function raf(fn: VoidFunction) {\n const id = globalThis.requestAnimationFrame(fn)\n set.add(() => globalThis.cancelAnimationFrame(id))\n }\n raf(() => raf(fn))\n return function cleanup() {\n set.forEach((fn) => fn())\n }\n}\n\nexport function raf(fn: VoidFunction | (() => VoidFunction)): VoidFunction {\n let cleanup: VoidFunction | undefined | void\n const id = globalThis.requestAnimationFrame?.(() => {\n cleanup = fn()\n })\n return () => {\n globalThis.cancelAnimationFrame?.(id)\n cleanup?.()\n }\n}\n\nexport function queueBeforeEvent(\n el: EventTarget,\n type: string,\n cb: () => void,\n): VoidFunction {\n const cancelTimer = raf(() => {\n el.removeEventListener(type, exec, true)\n cb()\n })\n const exec = () => {\n cancelTimer()\n cb()\n }\n el.addEventListener(type, exec, {capture: true, once: true})\n return cancelTimer\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {raf} from \"./raf\"\nimport type {MaybeElement, MaybeElementOrFn} from \"./types\"\n\nexport interface ObserveAttributeOptions {\n attributes: string[]\n callback(record: MutationRecord): void\n defer?: boolean | undefined\n}\n\nfunction observeAttributesImpl(\n node: MaybeElement,\n options: ObserveAttributeOptions,\n) {\n if (!node) {\n return\n }\n const {attributes, callback: fn} = options\n const win = node.ownerDocument.defaultView || window\n const obs = new win.MutationObserver((changes: any) => {\n for (const change of changes) {\n if (\n change.type === \"attributes\" &&\n change.attributeName &&\n attributes.includes(change.attributeName)\n ) {\n fn(change)\n }\n }\n })\n obs.observe(node, {attributeFilter: attributes, attributes: true})\n return () => obs.disconnect()\n}\n\nexport function observeAttributes(\n nodeOrFn: MaybeElementOrFn,\n options: ObserveAttributeOptions,\n): VoidFunction {\n const {defer} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn\n cleanups.push(observeAttributesImpl(node, options))\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n\nexport interface ObserveChildrenOptions {\n callback: MutationCallback\n defer?: boolean | undefined\n}\n\nfunction observeChildrenImpl(\n node: MaybeElement,\n options: ObserveChildrenOptions,\n) {\n const {callback: fn} = options\n if (!node) {\n return\n }\n const win = node.ownerDocument.defaultView || window\n const obs = new win.MutationObserver(fn)\n obs.observe(node, {childList: true, subtree: true})\n return () => obs.disconnect()\n}\n\nexport function observeChildren(\n nodeOrFn: MaybeElementOrFn,\n options: ObserveChildrenOptions,\n): VoidFunction {\n const {defer} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn\n cleanups.push(observeChildrenImpl(node, options))\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isFirefox} from \"./platform\"\nimport {queueBeforeEvent} from \"./raf\"\n\nexport function clickIfLink(el: HTMLAnchorElement): void {\n const click = () => el.click()\n if (isFirefox()) {\n queueBeforeEvent(el, \"keyup\", click)\n } else {\n queueMicrotask(click)\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {\n getDocument,\n getParentNode,\n getWindow,\n isHTMLElement,\n isRootElement,\n isVisualViewport,\n} from \"./node\"\n\nexport type OverflowAncestor = Array<\n VisualViewport | Window | HTMLElement | null\n>\n\nexport function getNearestOverflowAncestor(el: Node): HTMLElement {\n const parentNode = getParentNode(el)\n if (isRootElement(parentNode)) {\n return getDocument(parentNode).body\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode\n }\n return getNearestOverflowAncestor(parentNode)\n}\n\nexport function getOverflowAncestors(\n el: HTMLElement,\n list: OverflowAncestor = [],\n): OverflowAncestor {\n const scrollableAncestor = getNearestOverflowAncestor(el)\n const isBody = scrollableAncestor === el.ownerDocument.body\n const win = getWindow(scrollableAncestor)\n if (isBody) {\n return list.concat(\n win,\n win.visualViewport || [],\n isOverflowElement(scrollableAncestor) ? scrollableAncestor : [],\n )\n }\n return list.concat(\n scrollableAncestor,\n getOverflowAncestors(scrollableAncestor, []),\n )\n}\n\nconst getElementRect = (el: HTMLElement | Window | VisualViewport) => {\n if (isHTMLElement(el)) {\n return el.getBoundingClientRect()\n }\n if (isVisualViewport(el)) {\n return {bottom: el.height, left: 0, right: el.width, top: 0}\n }\n return {bottom: el.innerHeight, left: 0, right: el.innerWidth, top: 0}\n}\n\nexport function isInView(\n el: HTMLElement | Window | VisualViewport,\n ancestor: HTMLElement | Window | VisualViewport,\n): boolean {\n if (!isHTMLElement(el)) {\n return true\n }\n const ancestorRect = getElementRect(ancestor)\n const elRect = el.getBoundingClientRect()\n return (\n elRect.top >= ancestorRect.top &&\n elRect.left >= ancestorRect.left &&\n elRect.bottom <= ancestorRect.bottom &&\n elRect.right <= ancestorRect.right\n )\n}\n\nconst OVERFLOW_RE = /auto|scroll|overlay|hidden|clip/\n\nexport function isOverflowElement(el: HTMLElement): boolean {\n const win = getWindow(el)\n const {display, overflow, overflowX, overflowY} = win.getComputedStyle(el)\n return (\n OVERFLOW_RE.test(overflow + overflowY + overflowX) &&\n ![\"inline\", \"contents\"].includes(display)\n )\n}\n\nexport interface ScrollOptions extends ScrollIntoViewOptions {\n rootEl: HTMLElement | null\n}\n\nfunction isScrollable(el: HTMLElement): boolean {\n return el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth\n}\n\nexport function scrollIntoView(\n el: HTMLElement | null | undefined,\n options?: ScrollOptions,\n): void {\n const {rootEl, ...scrollOptions} = options || {}\n if (!el || !rootEl) {\n return\n }\n if (!isOverflowElement(rootEl) || !isScrollable(rootEl)) {\n return\n }\n el.scrollIntoView(scrollOptions)\n}\n\nexport interface ScrollPosition {\n scrollLeft: number\n scrollTop: number\n}\n\nexport function getScrollPosition(\n element: HTMLElement | Window,\n): ScrollPosition {\n if (isHTMLElement(element)) {\n return {scrollLeft: element.scrollLeft, scrollTop: element.scrollTop}\n }\n return {scrollLeft: element.scrollX, scrollTop: element.scrollY}\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function clamp(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\nexport function wrap<T>(v: T[], idx: number): T[] {\n return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length])\n}\n\nexport function pipe<T>(...fns: Array<(arg: T) => T>): (arg: T) => T {\n return (arg: T) => fns.reduce((acc, fn) => fn(acc), arg)\n}\n\nexport const MAX_Z_INDEX = 2147483647\n\nexport function sanitize(str: string): string {\n return str\n .split(\"\")\n .map((char) => {\n const code = char.charCodeAt(0)\n if (code > 0 && code < 128) {\n return char\n }\n if (code >= 128 && code <= 255) {\n return `/x${code.toString(16)}`.replace(\"/\", \"\\\\\")\n }\n return \"\"\n })\n .join(\"\")\n .trim()\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {clamp} from \"./shared\"\nimport type {Point} from \"./types\"\n\nexport interface PercentValueOptions {\n dir?: \"ltr\" | \"rtl\" | undefined\n inverted?: boolean | {x?: boolean; y?: boolean} | undefined\n orientation?: \"vertical\" | \"horizontal\" | undefined\n}\n\nexport function getRelativePoint(\n point: Point,\n element: HTMLElement,\n): {\n getPercentValue: (options?: PercentValueOptions) => number\n offset: {x: number; y: number}\n percent: {x: number; y: number}\n} {\n const {height, left, top, width} = element.getBoundingClientRect()\n const offset = {x: point.x - left, y: point.y - top}\n const percent = {x: clamp(offset.x / width), y: clamp(offset.y / height)}\n\n function getPercentValue(options: PercentValueOptions = {}): number {\n const {dir = \"ltr\", inverted, orientation = \"horizontal\"} = options\n const invertX = typeof inverted === \"object\" ? inverted.x : inverted\n const invertY = typeof inverted === \"object\" ? inverted.y : inverted\n if (orientation === \"horizontal\") {\n return dir === \"rtl\" || invertX ? 1 - percent.x : percent.x\n }\n return invertY ? 1 - percent.y : percent.y\n }\n return {getPercentValue, offset, percent}\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent} from \"./event\"\n\nexport function requestPointerLock(\n doc: Document,\n fn?: (locked: boolean) => void,\n): VoidFunction | undefined {\n const body = doc.body\n\n const supported =\n \"pointerLockElement\" in doc || \"mozPointerLockElement\" in doc\n const isLocked = () => !!doc.pointerLockElement\n\n function onPointerChange() {\n fn?.(isLocked())\n }\n\n function onPointerError(event: Event) {\n if (isLocked()) {\n fn?.(false)\n }\n console.error(\"PointerLock error occurred:\", event)\n doc.exitPointerLock()\n }\n\n if (!supported) {\n return\n }\n\n try {\n body.requestPointerLock()\n } catch {}\n\n // prettier-ignore\n const cleanup = [\n addDomEvent(doc, \"pointerlockchange\", onPointerChange, false),\n addDomEvent(doc, \"pointerlockerror\", onPointerError, false)\n ]\n\n return () => {\n cleanup.forEach((cleanup) => cleanup())\n doc.exitPointerLock()\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isIos} from \"./platform\"\nimport {nextTick, raf} from \"./raf\"\n\ntype State = \"default\" | \"disabled\" | \"restoring\"\n\nlet state: State = \"default\"\nlet userSelect = \"\"\nconst elementMap = new WeakMap<HTMLElement, string>()\n\nexport interface DisableTextSelectionOptions<T = MaybeElement> {\n defer?: boolean | undefined\n doc?: Document | undefined\n target?: T | undefined\n}\n\nfunction disableTextSelectionImpl(options: DisableTextSelectionOptions = {}) {\n const {doc, target} = options\n\n const docNode = doc ?? document\n const rootEl = docNode.documentElement\n\n if (isIos()) {\n if (state === \"default\") {\n userSelect = rootEl.style.webkitUserSelect\n rootEl.style.webkitUserSelect = \"none\"\n }\n\n state = \"disabled\"\n } else if (target) {\n elementMap.set(target, target.style.userSelect)\n target.style.userSelect = \"none\"\n }\n\n return () => restoreTextSelection({doc: docNode, target})\n}\n\nexport function restoreTextSelection(\n options: DisableTextSelectionOptions = {},\n): void {\n const {doc, target} = options\n\n const docNode = doc ?? document\n const rootEl = docNode.documentElement\n\n if (isIos()) {\n if (state !== \"disabled\") {\n return\n }\n state = \"restoring\"\n\n setTimeout(() => {\n nextTick(() => {\n if (state === \"restoring\") {\n if (rootEl.style.webkitUserSelect === \"none\") {\n rootEl.style.webkitUserSelect = userSelect || \"\"\n }\n userSelect = \"\"\n state = \"default\"\n }\n })\n }, 300)\n } else {\n if (target && elementMap.has(target)) {\n const prevUserSelect = elementMap.get(target)\n\n if (target.style.userSelect === \"none\") {\n target.style.userSelect = prevUserSelect ?? \"\"\n }\n\n if (target.getAttribute(\"style\") === \"\") {\n target.removeAttribute(\"style\")\n }\n elementMap.delete(target)\n }\n }\n}\n\ntype MaybeElement = HTMLElement | null | undefined\n\ntype NodeOrFn = MaybeElement | (() => MaybeElement)\n\nexport function disableTextSelection(\n options: DisableTextSelectionOptions<NodeOrFn> = {},\n): VoidFunction {\n const {defer, target, ...restOptions} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof target === \"function\" ? target() : target\n cleanups.push(disableTextSelectionImpl({...restOptions, target: node}))\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent, getEventPoint} from \"./event\"\nimport {disableTextSelection} from \"./text-selection\"\nimport type {Point} from \"./types\"\n\nexport interface PointerMoveDetails {\n /**\n * The event that triggered the move.\n */\n event: PointerEvent\n /**\n * The current position of the pointer.\n */\n point: Point\n}\n\nexport interface PointerMoveHandlers {\n /**\n * Called when the pointer moves.\n */\n onPointerMove: (details: PointerMoveDetails) => void\n /**\n * Called when the pointer is released.\n */\n onPointerUp: VoidFunction\n}\n\nexport function trackPointerMove(\n doc: Document,\n handlers: PointerMoveHandlers,\n): VoidFunction {\n const {onPointerMove, onPointerUp} = handlers\n\n const handleMove = (event: PointerEvent) => {\n const point = getEventPoint(event)\n\n const distance = Math.sqrt(point.x ** 2 + point.y ** 2)\n const moveBuffer = event.pointerType === \"touch\" ? 10 : 5\n\n if (distance < moveBuffer) {\n return\n }\n\n // Because Safari doesn't trigger mouseup events when it's above a `<select>`\n if (event.pointerType === \"mouse\" && event.button === 0) {\n onPointerUp()\n return\n }\n\n onPointerMove({event, point})\n }\n\n const cleanups = [\n addDomEvent(doc, \"pointermove\", handleMove, false),\n addDomEvent(doc, \"pointerup\", onPointerUp, false),\n addDomEvent(doc, \"pointercancel\", onPointerUp, false),\n addDomEvent(doc, \"contextmenu\", onPointerUp, false),\n disableTextSelection({doc}),\n ]\n\n return (): void => {\n cleanups.forEach((cleanup) => cleanup())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {noop} from \"@qualcomm-ui/utils/functions\"\n\nimport {addDomEvent, getEventPoint, getEventTarget} from \"./event\"\nimport {contains, getDocument, getWindow} from \"./node\"\nimport {pipe} from \"./shared\"\nimport type {Point} from \"./types\"\n\nexport interface PressDetails {\n /**\n * The event that triggered the move.\n */\n event: PointerEvent\n /**\n * The current position of the pointer.\n */\n point: Point\n}\n\nexport interface TrackPressOptions {\n /**\n * A function that determines if the key is valid for the press event.\n */\n isValidKey?(event: KeyboardEvent): boolean\n /**\n * The element that will be used to track the keyboard focus events.\n */\n keyboardNode?: Element | null | undefined\n /**\n * A function that will be called when the pointer is pressed.\n */\n onPress?(details: PressDetails): void\n /**\n * A function that will be called when the pointer is pressed up or cancelled.\n */\n onPressEnd?(details: PressDetails): void\n /**\n * A function that will be called when the pointer is pressed down.\n */\n onPressStart?(details: PressDetails): void\n /**\n * The element that will be used to track the pointer events.\n */\n pointerNode: Element | null\n}\n\nexport function trackPress(options: TrackPressOptions): VoidFunction {\n const {\n isValidKey = (e) => e.key === \"Enter\",\n pointerNode,\n keyboardNode = pointerNode,\n onPress,\n onPressEnd,\n onPressStart,\n } = options\n\n if (!pointerNode) {\n return noop\n }\n\n const win = getWindow(pointerNode)\n const doc = getDocument(pointerNode)\n\n let removeStartListeners: VoidFunction = noop\n let removeEndListeners: VoidFunction = noop\n let removeAccessibleListeners: VoidFunction = noop\n\n const getInfo = (event: PointerEvent): PressDetails => ({\n event,\n point: getEventPoint(event),\n })\n\n function startPress(event: PointerEvent) {\n onPressStart?.(getInfo(event))\n }\n\n function cancelPress(event: PointerEvent) {\n onPressEnd?.(getInfo(event))\n }\n\n const startPointerPress = (startEvent: PointerEvent) => {\n removeEndListeners()\n\n const endPointerPress = (endEvent: PointerEvent) => {\n const target = getEventTarget<Element>(endEvent)\n if (contains(pointerNode, target)) {\n onPress?.(getInfo(endEvent))\n } else {\n onPressEnd?.(getInfo(endEvent))\n }\n }\n\n const removePointerUpListener = addDomEvent(\n win,\n \"pointerup\",\n endPointerPress,\n {once: true, passive: !onPress},\n )\n const removePointerCancelListener = addDomEvent(\n win,\n \"pointercancel\",\n cancelPress,\n {\n once: true,\n passive: !onPressEnd,\n },\n )\n\n removeEndListeners = pipe(\n removePointerUpListener,\n removePointerCancelListener,\n )\n\n if (\n doc.activeElement === keyboardNode &&\n startEvent.pointerType === \"mouse\"\n ) {\n startEvent.preventDefault()\n }\n\n startPress(startEvent)\n }\n\n const removePointerListener = addDomEvent(\n pointerNode,\n \"pointerdown\",\n startPointerPress,\n {passive: !onPressStart},\n )\n const removeFocusListener = addDomEvent(\n keyboardNode,\n \"focus\",\n startAccessiblePress,\n )\n\n removeStartListeners = pipe(removePointerListener, removeFocusListener)\n\n function startAccessiblePress() {\n const handleKeydown = (keydownEvent: KeyboardEvent) => {\n if (!isValidKey(keydownEvent)) {\n return\n }\n\n const handleKeyup = (keyupEvent: KeyboardEvent) => {\n if (!isValidKey(keyupEvent)) {\n return\n }\n const evt = new win.PointerEvent(\"pointerup\")\n const info = getInfo(evt)\n onPress?.(info)\n onPressEnd?.(info)\n }\n\n removeEndListeners()\n removeEndListeners = addDomEvent(keyboardNode, \"keyup\", handleKeyup)\n\n const evt = new win.PointerEvent(\"pointerdown\")\n startPress(evt)\n }\n\n const handleBlur = () => {\n const evt = new win.PointerEvent(\"pointercancel\")\n cancelPress(evt)\n }\n\n const removeKeydownListener = addDomEvent(\n keyboardNode,\n \"keydown\",\n handleKeydown,\n )\n const removeBlurListener = addDomEvent(keyboardNode, \"blur\", handleBlur)\n\n removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener)\n }\n\n return () => {\n removeStartListeners()\n removeEndListeners()\n removeAccessibleListeners()\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent} from \"./event\"\nimport {raf} from \"./raf\"\nimport {getNextTabbable, getTabbableEdges} from \"./tabbable\"\nimport type {MaybeElement, MaybeElementOrFn} from \"./types\"\n\n/**\n *\n * Options that tune the behaviour of {@link proxyTabFocus}.\n *\n * @template T The element type (or getter returning that element) supplied\n * to `triggerElement`.\n */\nexport interface ProxyTabFocusOptions<T = MaybeElement> {\n /**\n * Register the key-down listener during the next animation frame instead of\n * immediately. Enable this when the element(s) involved are not yet present\n * in the DOM at the moment you call `proxyTabFocus`.\n */\n defer?: boolean | undefined\n\n /**\n * Hook that fires right before focus is moved by the proxy logic.\n *\n * When provided, the callback is responsible for moving focus\u2014call\n * `elementToFocus.focus()` yourself.\n * If omitted, `proxyTabFocus` performs `elementToFocus.focus()` automatically.\n */\n onFocus?: ((elementToFocus: HTMLElement) => void) | undefined\n\n /**\n * Invoked exactly once, the first time keyboard focus \"enters\" the container\n * via the proxy (i.e. when the user Tabs from `triggerElement` into\n * `container` or Shift-Tabs from the element after `triggerElement`\n * back into `container`).\n */\n onFocusEnter?: VoidFunction | undefined\n\n /**\n * Element that acts as the gateway into/out of the focus-trap area, or a function\n * returning that element.\n *\n * Tab *forward* from `triggerElement` lands on the first tabbable element in the\n * container.\n *\n * Shift-Tab *backward* from the element immediately **after** `triggerElement`\n * lands on the last tabbable element in the container.\n */\n triggerElement?: T | undefined\n}\n\nfunction proxyTabFocusImpl(\n container: MaybeElement,\n options: ProxyTabFocusOptions = {},\n): VoidFunction {\n const {onFocus, onFocusEnter, triggerElement} = options\n\n const doc = container?.ownerDocument || document\n const body = doc.body\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== \"Tab\") {\n return\n }\n\n let elementToFocus: MaybeElement | undefined = null\n\n // get all tabbable elements within the container\n const [firstTabbable, lastTabbable] = getTabbableEdges(container, true)\n const nextTabbableAfterTrigger = getNextTabbable(body, triggerElement)\n\n const noTabbableElements = !firstTabbable && !lastTabbable\n\n // if we're focused on the element after the reference element and the user tabs\n // backwards we want to focus the last tabbable element\n if (event.shiftKey && nextTabbableAfterTrigger === doc.activeElement) {\n onFocusEnter?.()\n elementToFocus = lastTabbable\n }\n // if we're focused on the first tabbable element and the user tabs backwards\n // we want to focus the reference element\n else if (\n event.shiftKey &&\n (doc.activeElement === firstTabbable || noTabbableElements)\n ) {\n elementToFocus = triggerElement\n }\n // if we're focused on the reference element and the user tabs forwards\n // we want to focus the first tabbable element\n else if (!event.shiftKey && doc.activeElement === triggerElement) {\n onFocusEnter?.()\n elementToFocus = firstTabbable\n }\n // if we're focused on the last tabbable element and the user tabs forwards\n // we want to focus the next tabbable element after the reference element\n else if (\n !event.shiftKey &&\n (doc.activeElement === lastTabbable || noTabbableElements)\n ) {\n elementToFocus = nextTabbableAfterTrigger\n }\n\n if (!elementToFocus) {\n return\n }\n\n event.preventDefault()\n\n if (typeof onFocus === \"function\") {\n onFocus(elementToFocus)\n } else {\n elementToFocus.focus()\n }\n }\n\n // listen for the tab key in the capture phase\n return addDomEvent(doc, \"keydown\", onKeyDown, true)\n}\n\n/**\n * Installs keyboard Tab trapping for a DOM subtree.\n *\n * When focus is on `triggerElement` (or inside `container`) and the user\n * presses Tab / Shift + Tab, the handler redirects focus so it never leaves the\n * `container`. The listener is added to the owning document in the *capture*\n * phase and stays active until the cleanup function returned by this call is\n * executed.\n *\n * @template T\n *\n * @returns {VoidFunction} Call this function to remove the `keydown` listener and clean up internal resources.\n */\nexport function proxyTabFocus(\n container: MaybeElementOrFn,\n options: ProxyTabFocusOptions<MaybeElementOrFn>,\n): VoidFunction {\n const {defer, triggerElement, ...restOptions} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof container === \"function\" ? container() : container\n const trigger =\n typeof triggerElement === \"function\" ? triggerElement() : triggerElement\n cleanups.push(\n proxyTabFocusImpl(node, {triggerElement: trigger, ...restOptions}),\n )\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\ntype Root = Document | Element | null | undefined\n\nexport function queryAll<T extends Element = HTMLElement>(\n root: Root,\n selector: string,\n): T[] {\n return Array.from(root?.querySelectorAll<T>(selector) ?? [])\n}\n\nexport function query<T extends Element = HTMLElement>(\n root: Root,\n selector: string,\n): T | null {\n return root?.querySelector<T>(selector) ?? null\n}\n\nexport type ItemToId<T> = (v: T) => string\n\ninterface Item {\n id: string\n}\n\nexport function defaultItemToId<T extends Item>(v: T): string {\n return v.id\n}\n\nexport function itemById<T extends Item>(\n v: T[],\n id: string,\n itemToId: ItemToId<T> = defaultItemToId,\n): T | undefined {\n return v.find((item) => itemToId(item) === id)\n}\n\nexport function indexOfId<T extends Item>(\n v: T[],\n id: string,\n itemToId: ItemToId<T> = defaultItemToId,\n): number {\n const item = itemById(v, id, itemToId)\n return item ? v.indexOf(item) : -1\n}\n\nexport function nextById<T extends Item>(v: T[], id: string, loop = true): T {\n let idx = indexOfId(v, id)\n idx = loop ? (idx + 1) % v.length : Math.min(idx + 1, v.length - 1)\n return v[idx]\n}\n\nexport function prevById<T extends Item>(\n v: T[],\n id: string,\n loop = true,\n): T | null {\n let idx = indexOfId(v, id)\n if (idx === -1) {\n return loop ? v[v.length - 1] : null\n }\n idx = loop ? (idx - 1 + v.length) % v.length : Math.max(0, idx - 1)\n return v[idx]\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {Scope} from \"@qualcomm-ui/utils/machine\"\n\nimport {getActiveElement, getDocument} from \"./node\"\n\nexport function createScope<T>(\n props: Pick<Scope, \"getRootNode\"> & T,\n): Scope & T {\n const getRootNode = () =>\n (props.getRootNode?.() as Document | ShadowRoot | undefined) ?? document\n const getDoc = () => getDocument(getRootNode())\n const getWin = () => getDoc().defaultView ?? window\n const getActiveElementFn = () => getActiveElement(getRootNode())\n const isActiveElement = (elem: HTMLElement | null) =>\n elem === getActiveElementFn()\n const getById = <T extends Element = HTMLElement>(id: string) =>\n getRootNode().getElementById(id) as T | null\n\n const dom = {\n getActiveElement: getActiveElementFn,\n getById,\n getDoc,\n getRootNode,\n getWin,\n isActiveElement,\n }\n\n return {...props, ...dom}\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {defaultItemToId, indexOfId, type ItemToId} from \"./query\"\nimport {sanitize, wrap} from \"./shared\"\n\nfunction getValueText<T extends SearchableItem>(el: T): string {\n return sanitize(el.dataset?.valuetext ?? el.textContent ?? \"\")\n}\n\nfunction match(valueText: string, query: string): boolean {\n return valueText.trim().toLowerCase().startsWith(query.toLowerCase())\n}\n\nexport interface SearchableItem {\n dataset?: any\n id: string\n textContent: string | null\n}\n\nexport function getByText<T extends SearchableItem>(\n v: T[],\n text: string,\n currentId?: string | null,\n itemToId: ItemToId<T> = defaultItemToId,\n): T | undefined {\n const index = currentId ? indexOfId(v, currentId, itemToId) : -1\n let items = currentId ? wrap(v, index) : v\n const isSingleKey = text.length === 1\n if (isSingleKey) {\n items = items.filter((item) => itemToId(item) !== currentId)\n }\n return items.find((item) => match(getValueText(item), text))\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nconst cleanups = new WeakMap<Element, Map<string, () => void>>()\n\nfunction set(\n element: Element,\n key: string,\n setup: () => () => void,\n): VoidFunction {\n if (!cleanups.has(element)) {\n cleanups.set(element, new Map())\n }\n\n const elementCleanups = cleanups.get(element)\n const prevCleanup = elementCleanups?.get(key)\n\n if (!prevCleanup) {\n elementCleanups?.set(key, setup())\n return () => {\n elementCleanups?.get(key)?.()\n elementCleanups?.delete(key)\n }\n }\n\n const cleanup = setup()\n\n const nextCleanup = () => {\n cleanup()\n prevCleanup()\n elementCleanups?.delete(key)\n }\n\n elementCleanups?.set(key, nextCleanup)\n\n return () => {\n const isCurrent = elementCleanups?.get(key) === nextCleanup\n if (!isCurrent) {\n return\n }\n cleanup()\n elementCleanups.set(key, prevCleanup)\n }\n}\n\nexport function setAttribute(\n element: Element,\n attr: string,\n value: string,\n): VoidFunction {\n const setup = () => {\n const previousValue = element.getAttribute(attr)\n element.setAttribute(attr, value)\n return () => {\n if (previousValue == null) {\n element.removeAttribute(attr)\n } else {\n element.setAttribute(attr, previousValue)\n }\n }\n }\n\n return set(element, attr, setup)\n}\n\nexport function setProperty<T extends Element, K extends keyof T & string>(\n element: T,\n property: K,\n value: T[K],\n): VoidFunction {\n const setup = () => {\n const exists = property in element\n const previousValue = element[property]\n element[property] = value\n return () => {\n if (!exists) {\n delete element[property]\n } else {\n element[property] = previousValue\n }\n }\n }\n\n return set(element, property, setup)\n}\n\nexport function setStyle(\n element: HTMLElement | null | undefined,\n style: Partial<CSSStyleDeclaration>,\n): VoidFunction {\n if (!element) {\n return () => {}\n }\n\n const setup = () => {\n const prevStyle = element.style.cssText\n Object.assign(element.style, style)\n return () => {\n element.style.cssText = prevStyle\n }\n }\n\n return set(element, \"style\", setup)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ItemToId} from \"./query\"\nimport {getByText, type SearchableItem} from \"./searchable\"\n\nexport interface TypeaheadState {\n keysSoFar: string\n timer: number\n}\n\nexport interface TypeaheadOptions<T> {\n activeId: string | null\n itemToId?: ItemToId<T> | undefined\n key: string\n state: TypeaheadState\n timeout?: number | undefined\n}\n\nfunction getByTypeaheadImpl<T extends SearchableItem>(\n baseItems: T[],\n options: TypeaheadOptions<T>,\n): T | undefined {\n const {activeId, itemToId, key, state, timeout = 350} = options\n\n const search = state.keysSoFar + key\n const isRepeated =\n search.length > 1 && Array.from(search).every((char) => char === search[0])\n\n const query = isRepeated ? search[0] : search\n\n const items = baseItems.slice()\n\n const next = getByText(items, query, activeId, itemToId)\n\n function cleanup() {\n clearTimeout(state.timer)\n state.timer = -1\n }\n\n function update(value: string) {\n state.keysSoFar = value\n cleanup()\n\n if (value !== \"\") {\n state.timer = +setTimeout(() => {\n update(\"\")\n cleanup()\n }, timeout)\n }\n }\n\n update(search)\n\n return next\n}\n\nexport const getByTypeahead: typeof getByTypeaheadImpl & {\n defaultOptions: {\n keysSoFar: string\n timer: number\n }\n isValidEvent: typeof isValidTypeaheadEvent\n} = /* #__PURE__ */ Object.assign(getByTypeaheadImpl, {\n defaultOptions: {keysSoFar: \"\", timer: -1},\n isValidEvent: isValidTypeaheadEvent,\n})\n\nfunction isValidTypeaheadEvent(\n event: Pick<KeyboardEvent, \"key\" | \"ctrlKey\" | \"metaKey\">,\n): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent} from \"./event\"\n\nexport interface ViewportSize {\n height: number\n width: number\n}\n\nexport function trackVisualViewport(\n doc: Document,\n fn: (data: ViewportSize) => void,\n): VoidFunction {\n const win = doc?.defaultView || window\n const onResize = () => {\n fn?.(getViewportSize(win))\n }\n onResize()\n return addDomEvent(win.visualViewport ?? win, \"resize\", onResize)\n}\n\nfunction getViewportSize(win: Window): ViewportSize {\n return {\n height: win.visualViewport?.height || win.innerHeight,\n width: win.visualViewport?.width || win.innerWidth,\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport const visuallyHiddenStyle = {\n border: \"0\",\n clip: \"rect(0 0 0 0)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n wordWrap: \"normal\",\n} as const\n\nexport function setVisuallyHidden(el: HTMLElement): void {\n Object.assign(el.style, visuallyHiddenStyle)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isHTMLElement} from \"./node\"\n\ntype ElementGetter = () => Element | null\n\nconst fps = 1000 / 60\n\nexport function waitForElement(\n query: ElementGetter,\n cb: (el: HTMLElement) => void,\n): VoidFunction {\n const el = query()\n if (isHTMLElement(el) && el.isConnected) {\n cb(el)\n return () => void 0\n } else {\n const timerId = setInterval(() => {\n const el = query()\n if (isHTMLElement(el) && el.isConnected) {\n cb(el)\n clearInterval(timerId)\n }\n }, fps)\n return () => clearInterval(timerId)\n }\n}\n\nexport function waitForElements(\n queries: ElementGetter[],\n cb: (el: HTMLElement) => void,\n): VoidFunction {\n const cleanups: VoidFunction[] = []\n queries?.forEach((query) => {\n const clean = waitForElement(query, cb)\n cleanups.push(clean)\n })\n return () => {\n cleanups.forEach((fn) => fn())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\n/**\n * Credit: Huge props to the team at Adobe for inspiring this implementation.\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocusVisible.ts\n */\n\nimport {\n getDocument,\n getEventTarget,\n getWindow,\n isMac,\n} from \"@qualcomm-ui/dom/query\"\n\nfunction isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n if ((event as any).mozInputSource === 0 && event.isTrusted) {\n return true\n }\n return event.detail === 0 && !(event as PointerEvent).pointerType\n}\n\nfunction isValidKey(e: KeyboardEvent) {\n return !(\n e.metaKey ||\n (!isMac() && e.altKey) ||\n e.ctrlKey ||\n e.key === \"Control\" ||\n e.key === \"Shift\" ||\n e.key === \"Meta\"\n )\n}\n\nconst nonTextInputTypes = new Set([\n \"checkbox\",\n \"radio\",\n \"range\",\n \"color\",\n \"file\",\n \"image\",\n \"button\",\n \"submit\",\n \"reset\",\n])\n\nfunction isKeyboardFocusEvent(\n isTextInput: boolean,\n modality: Modality,\n e: HandlerEvent,\n) {\n const target = e ? getEventTarget<Element>(e) : null\n const win = getWindow(target)\n\n isTextInput =\n isTextInput ||\n (target instanceof win.HTMLInputElement &&\n !nonTextInputTypes.has(target?.type)) ||\n target instanceof win.HTMLTextAreaElement ||\n (target instanceof win.HTMLElement && target.isContentEditable)\n\n return !(\n isTextInput &&\n modality === \"keyboard\" &&\n e instanceof win.KeyboardEvent &&\n !Reflect.has(FOCUS_VISIBLE_INPUT_KEYS, e.key)\n )\n}\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nexport type Modality = \"keyboard\" | \"pointer\" | \"virtual\"\n\ntype RootNode = Document | ShadowRoot | Node\n\ntype HandlerEvent =\n | PointerEvent\n | MouseEvent\n | KeyboardEvent\n | FocusEvent\n | null\n\ntype Handler = (modality: Modality, e: HandlerEvent) => void\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nlet currentModality: Modality | null = null\n\nconst changeHandlers = new Set<Handler>()\n\ninterface GlobalListenerData {\n focus: VoidFunction\n}\n\nexport const listenerMap: Map<Window, GlobalListenerData> = new Map<\n Window,\n GlobalListenerData\n>()\n\nlet hasEventBeforeFocus = false\nlet hasBlurredWindowRecently = false\n\n// Only Tab or Esc keys will make focus visible on text input elements\nconst FOCUS_VISIBLE_INPUT_KEYS = {\n Escape: true,\n Tab: true,\n}\n\nfunction triggerChangeHandlers(modality: Modality, e: HandlerEvent) {\n for (const handler of changeHandlers) {\n handler(modality, e)\n }\n}\n\nfunction handleKeyboardEvent(e: KeyboardEvent) {\n hasEventBeforeFocus = true\n if (isValidKey(e)) {\n currentModality = \"keyboard\"\n triggerChangeHandlers(\"keyboard\", e)\n }\n}\n\nfunction handlePointerEvent(e: PointerEvent | MouseEvent) {\n currentModality = \"pointer\"\n if (e.type === \"mousedown\" || e.type === \"pointerdown\") {\n hasEventBeforeFocus = true\n triggerChangeHandlers(\"pointer\", e)\n }\n}\n\nfunction handleClickEvent(e: MouseEvent) {\n if (isVirtualClick(e)) {\n hasEventBeforeFocus = true\n currentModality = \"virtual\"\n }\n}\n\nfunction handleFocusEvent(e: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n const target = getEventTarget(e)\n\n if (\n target === getWindow(target as Element) ||\n target === getDocument(target as Element)\n ) {\n return\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch\n // to virtual modality. This occurs, for example, when navigating a form with the\n // next/previous buttons on iOS.\n if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n currentModality = \"virtual\"\n triggerChangeHandlers(\"virtual\", e)\n }\n\n hasEventBeforeFocus = false\n hasBlurredWindowRecently = false\n}\n\nfunction handleWindowBlur() {\n // When the window is blurred, reset state. This is necessary when tabbing out of\n // the window, for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false\n hasBlurredWindowRecently = true\n}\n\n/**\n * Setup global event listeners to control when keyboard focus style should be\n * visible.\n */\nfunction setupGlobalFocusEvents(root?: RootNode) {\n if (typeof window === \"undefined\" || listenerMap.get(getWindow(root))) {\n return\n }\n\n const win = getWindow(root)\n const doc = getDocument(root)\n\n const focus = win.HTMLElement.prototype.focus\n win.HTMLElement.prototype.focus = function () {\n // For programmatic focus, we remove the focus visible state to prevent showing\n // focus rings When `options.focusVisible` is supported in most browsers, we can\n // remove this @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible\n currentModality = \"virtual\"\n triggerChangeHandlers(\"virtual\", null)\n\n hasEventBeforeFocus = true\n focus.apply(\n this,\n arguments as unknown as [options?: FocusOptions | undefined],\n )\n }\n\n doc.addEventListener(\"keydown\", handleKeyboardEvent, true)\n doc.addEventListener(\"keyup\", handleKeyboardEvent, true)\n doc.addEventListener(\"click\", handleClickEvent, true)\n\n win.addEventListener(\"focus\", handleFocusEvent, true)\n win.addEventListener(\"blur\", handleWindowBlur, false)\n\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.addEventListener(\"pointerdown\", handlePointerEvent, true)\n doc.addEventListener(\"pointermove\", handlePointerEvent, true)\n doc.addEventListener(\"pointerup\", handlePointerEvent, true)\n } else {\n doc.addEventListener(\"mousedown\", handlePointerEvent, true)\n doc.addEventListener(\"mousemove\", handlePointerEvent, true)\n doc.addEventListener(\"mouseup\", handlePointerEvent, true)\n }\n\n // Add unmount handler\n win.addEventListener(\n \"beforeunload\",\n () => {\n tearDownWindowFocusTracking(root)\n },\n {once: true},\n )\n\n listenerMap.set(win, {focus})\n}\n\nconst tearDownWindowFocusTracking = (\n root?: RootNode,\n loadListener?: () => void,\n) => {\n const win = getWindow(root)\n const doc = getDocument(root)\n\n if (loadListener) {\n doc.removeEventListener(\"DOMContentLoaded\", loadListener)\n }\n\n if (!listenerMap.has(win)) {\n return\n }\n\n win.HTMLElement.prototype.focus = listenerMap.get(win)?.focus ?? (() => {})\n\n doc.removeEventListener(\"keydown\", handleKeyboardEvent, true)\n doc.removeEventListener(\"keyup\", handleKeyboardEvent, true)\n doc.removeEventListener(\"click\", handleClickEvent, true)\n win.removeEventListener(\"focus\", handleFocusEvent, true)\n win.removeEventListener(\"blur\", handleWindowBlur, false)\n\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.removeEventListener(\"pointerdown\", handlePointerEvent, true)\n doc.removeEventListener(\"pointermove\", handlePointerEvent, true)\n doc.removeEventListener(\"pointerup\", handlePointerEvent, true)\n } else {\n doc.removeEventListener(\"mousedown\", handlePointerEvent, true)\n doc.removeEventListener(\"mousemove\", handlePointerEvent, true)\n doc.removeEventListener(\"mouseup\", handlePointerEvent, true)\n }\n\n listenerMap.delete(win)\n}\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nexport function getInteractionModality(): Modality | null {\n return currentModality\n}\n\nexport function setInteractionModality(modality: Modality): void {\n currentModality = modality\n triggerChangeHandlers(modality, null)\n}\n\nexport interface InteractionModalityChangeDetails {\n /** The modality of the interaction that caused the focus to be visible. */\n modality: Modality | null\n}\n\nexport interface InteractionModalityProps {\n /** Callback to be called when the interaction modality changes. */\n onChange: (details: InteractionModalityChangeDetails) => void\n /** The root element to track focus visibility for. */\n root?: RootNode | undefined\n}\n\nexport function trackInteractionModality(\n props: InteractionModalityProps,\n): VoidFunction {\n const {onChange, root} = props\n\n setupGlobalFocusEvents(root)\n\n onChange({modality: currentModality})\n\n const handler = () => onChange({modality: currentModality})\n\n changeHandlers.add(handler)\n return () => {\n changeHandlers.delete(handler)\n }\n}\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nexport function isFocusVisible(): boolean {\n return currentModality === \"keyboard\"\n}\n\nexport interface FocusVisibleChangeDetails {\n /** Whether keyboard focus is visible globally. */\n isFocusVisible: boolean\n /** The modality of the interaction that caused the focus to be visible. */\n modality: Modality | null\n}\n\nexport interface FocusVisibleProps {\n /** Whether the element will be auto focused. */\n autoFocus?: boolean | undefined\n /** Whether the element is a text input. */\n isTextInput?: boolean | undefined\n /** Callback to be called when the focus visibility changes. */\n onChange?: ((details: FocusVisibleChangeDetails) => void) | undefined\n /** The root element to track focus visibility for. */\n root?: RootNode | undefined\n}\n\nexport function trackFocusVisible(props: FocusVisibleProps = {}): VoidFunction {\n const {autoFocus, isTextInput, onChange, root} = props\n\n setupGlobalFocusEvents(root)\n\n onChange?.({\n isFocusVisible: autoFocus || isFocusVisible(),\n modality: currentModality,\n })\n\n const handler = (modality: Modality, e: HandlerEvent) => {\n if (!isKeyboardFocusEvent(!!isTextInput, modality, e)) {\n return\n }\n onChange?.({isFocusVisible: isFocusVisible(), modality})\n }\n\n changeHandlers.add(handler)\n\n return () => {\n changeHandlers.delete(handler)\n }\n}\n", "import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useRef } from \"react\";\nimport { HashIcon, TablePropertiesIcon, TextSearchIcon } from \"lucide-react\";\nimport { isFocusVisible } from \"@qualcomm-ui/dom/focus-visible\";\nimport { Icon } from \"@qualcomm-ui/react/icon\";\nimport { HighlightText } from \"@qualcomm-ui/react-core/highlight\";\nimport { useMergedRef } from \"@qualcomm-ui/react-core/refs\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { clsx } from \"@qualcomm-ui/utils/clsx\";\nfunction getSearchResultIcon(item) {\n if (item.isDocProp) {\n return TablePropertiesIcon;\n }\n if (item.type === \"content\") {\n return TextSearchIcon;\n }\n return HashIcon;\n}\nexport function SearchResultItem(t0) {\n const {\n active,\n className,\n inputValue,\n isChild: t1,\n item,\n ref,\n ...props\n } = t0;\n const isChild = t1 === undefined ? false : t1;\n const rootRef = useRef(null);\n const mergedRef = useMergedRef(ref, rootRef);\n const icon = getSearchResultIcon(item);\n return jsxs(PolymorphicElement, {\n ref: mergedRef,\n as: \"button\",\n className: clsx(\"qui-site-search__list-item\", \"qui-menu-item__root\", className),\n \"data-child\": booleanDataAttr(isChild),\n \"data-focus-visible\": booleanDataAttr(isFocusVisible()),\n \"data-highlighted\": booleanDataAttr(active),\n \"data-type\": item.type,\n ...props,\n children: [icon ? jsx(Icon, {\n className: \"qui-site-search__item-icon\",\n icon,\n size: \"lg\"\n }) : null, jsx(\"div\", {\n className: \"qui-site-search__list-item-content\",\n children: item.type === \"content\" && item.content ? jsxs(Fragment, {\n children: [jsx(\"span\", {\n className: \"qui-site-search__content\",\n children: jsx(HighlightText, {\n ignoreCase: true,\n matchAll: true,\n query: inputValue.split(\" \").at(-1) ?? \"\",\n text: item.content.map(_temp).join(\"\")\n })\n }), jsx(\"div\", {\n className: \"qui-site-search__metadata\",\n children: item.heading\n })]\n }) : jsxs(Fragment, {\n children: [jsx(\"span\", {\n className: \"qui-site-search__content\",\n children: item.heading\n }), item.title && jsx(\"div\", {\n className: \"qui-site-search__metadata\",\n children: item.title\n })]\n })\n })]\n });\n}\nfunction _temp(content) {\n return content.content;\n}", "import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useFloating, useInteractions, useListNavigation } from \"@floating-ui/react\";\nimport { SearchIcon } from \"lucide-react\";\nimport { getSelectorsByUserAgent, OsTypes } from \"react-device-detect\";\nimport { trackFocusVisible } from \"@qualcomm-ui/dom/focus-visible\";\nimport { Dialog } from \"@qualcomm-ui/react/dialog\";\nimport { HeaderBar } from \"@qualcomm-ui/react/header-bar\";\nimport { TextInput } from \"@qualcomm-ui/react/text-input\";\nimport { useDebounce } from \"@qualcomm-ui/react-core/effects\";\nimport { Portal } from \"@qualcomm-ui/react-core/portal\";\nimport { useMdxDocsContext } from \"@qualcomm-ui/react-mdx/context\";\nimport { GroupedResultItem } from \"./grouped-result-item\";\nimport { SearchResultItem } from \"./search-result-item\";\nimport { useGroupedResults } from \"./use-grouped-results\";\nexport function SiteSearch({\n noResults = \"No results found...\"\n}) {\n const [showDialog, setShowDialog] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const inputRef = useRef(null);\n const dialogInputRef = useRef(null);\n const dialogInputContainerRef = useRef(null);\n const listRef = useRef([]);\n const [activeIndex, setActiveIndex] = useState(null);\n const {\n renderLink: Link\n } = useMdxDocsContext();\n useEffect(() => {\n const unsub = trackFocusVisible({\n root: document.documentElement\n });\n return () => {\n unsub();\n };\n }, []);\n const {\n context,\n refs\n } = useFloating({\n open: showDialog\n });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef,\n loop: true,\n onNavigate: index => {\n setActiveIndex(index);\n }\n });\n const debouncedInputValue = useDebounce(inputValue, 100);\n const groupedResults = useGroupedResults(debouncedInputValue);\n const onInputChange = useCallback(value => {\n setInputValue(value);\n }, []);\n useEffect(() => {\n const {\n osName\n } = getSelectorsByUserAgent(window.navigator.userAgent);\n const isMac = osName === OsTypes.MAC_OS;\n function listener(event) {\n if (event.key === \"k\" && (isMac && event.metaKey || !isMac && event.ctrlKey)) {\n inputRef.current?.focus();\n event.preventDefault();\n }\n }\n window.addEventListener(\"keydown\", listener);\n return () => {\n window.removeEventListener(\"keydown\", listener);\n };\n }, [showDialog]);\n const onListItemKeyDown = useCallback(event_0 => {\n switch (event_0.key) {\n case \"Enter\":\n case \"Space\":\n break;\n case \"Tab\":\n dialogInputRef.current?.focus();\n event_0.preventDefault();\n break;\n case \"ArrowDown\":\n break;\n case \"ArrowUp\":\n break;\n default:\n dialogInputRef.current?.focus?.();\n break;\n }\n }, []);\n const onInputKeyDown = useCallback(event_1 => {\n switch (event_1.key) {\n case \"ArrowDown\":\n event_1.preventDefault();\n listRef.current[0]?.focus();\n break;\n case \"ArrowUp\":\n event_1.preventDefault();\n break;\n }\n }, []);\n const {\n getFloatingProps,\n getItemProps,\n getReferenceProps\n } = useInteractions([listNavigation]);\n return /* @__PURE__ */jsxs(Dialog.Root, {\n onOpenChange: open => {\n setShowDialog(open);\n },\n open: showDialog,\n restoreFocus: false,\n children: [/* @__PURE__ */jsx(Dialog.Trigger, {\n children: /* @__PURE__ */jsx(\"div\", {\n \"aria-label\": \"Search the documentation\",\n className: \"qui-site-search__mobile-icon\",\n role: \"searchbox\",\n children: /* @__PURE__ */jsx(HeaderBar.ActionIconButton, {\n \"aria-label\": \"Search\",\n icon: SearchIcon\n })\n })\n }), /* @__PURE__ */jsxs(Portal, {\n children: [/* @__PURE__ */jsx(Dialog.Backdrop, {\n className: \"qui-site-search__mobile-dialog-backdrop\"\n }), /* @__PURE__ */jsx(Dialog.Positioner, {\n children: /* @__PURE__ */jsx(Dialog.Content, {\n className: \"qui-site-search__mobile-dialog-content\",\n onClick: event_2 => {\n if (!dialogInputContainerRef.current?.contains(event_2.target)) {\n setShowDialog(false);\n }\n },\n style: {\n background: \"transparent\",\n border: 0,\n padding: 0\n },\n children: /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-site-search__mobile-input-wrapper\",\n children: [/* @__PURE__ */jsx(TextInput, {\n ...getReferenceProps({\n onKeyDown: onInputKeyDown\n }),\n ref: dialogInputContainerRef,\n className: \"q-background-2\",\n inputProps: {\n ref: dialogInputRef\n },\n onValueChange: onInputChange,\n placeholder: \"Search the docs\",\n size: \"lg\",\n startIcon: SearchIcon,\n value: inputValue\n }), inputValue.length ? /* @__PURE__ */jsx(\"div\", {\n ref: refs.setFloating,\n ...getFloatingProps(),\n className: \"qui-site-search__floating-panel-mobile\",\n children: groupedResults.length ? /* @__PURE__ */jsx(Fragment, {\n children: groupedResults.map(result => /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-site-search__result-group-wrapper\",\n children: [/* @__PURE__ */jsx(GroupedResultItem, {\n active: result.index === activeIndex,\n render: /* @__PURE__ */jsx(Link, {\n href: result.pathname\n }),\n ...getItemProps({\n onKeyDown: onListItemKeyDown,\n ref: ref => {\n listRef.current[result.index] = ref;\n },\n tabIndex: -1\n }),\n item: result\n }), /* @__PURE__ */jsx(\"div\", {\n className: \"qui-site-search__result-group\",\n children: result.items.map(item => /* @__PURE__ */jsx(SearchResultItem, {\n inputValue,\n ...getItemProps({\n onKeyDown: onListItemKeyDown,\n ref: ref_0 => {\n listRef.current[item.index] = ref_0;\n },\n tabIndex: -1\n }),\n active: item.index === activeIndex,\n isChild: true,\n item,\n render: /* @__PURE__ */jsx(Link, {\n href: item.href\n })\n }, item.id))\n })]\n }, `${result.id}-${result.categoryId}`))\n }) : noResults ? /* @__PURE__ */jsx(\"div\", {\n className: \"qui-site-search__no-results\",\n children: noResults\n }) : null\n }) : null, \" \"]\n })\n })\n })]\n })]\n });\n}", "import { useMemo } from \"react\";\nimport { useSiteContext } from \"@qualcomm-ui/react-mdx/context\";\nimport { useSiteSearch } from \"./use-site-search\";\nexport function useGroupedResults(query) {\n const {\n searchIndex\n } = useSiteContext();\n const search = useSiteSearch(searchIndex);\n return useMemo(() => {\n if (!query.trim()) {\n return [];\n }\n const results = search(query);\n const groups = /* @__PURE__ */new Map();\n const groupOrder = [];\n for (const result of results) {\n const basePath = result.href.split(\"#\")[0];\n const key = `${basePath}::${result.title}`;\n if (!groups.has(key)) {\n groups.set(key, []);\n groupOrder.push(key);\n }\n groups.get(key).push(result);\n }\n let currentIndex = 0;\n const grouped = [];\n for (const key_0 of groupOrder) {\n const items = groups.get(key_0);\n const firstItem = items[0];\n const basePath_0 = firstItem.href.split(\"#\")[0];\n const categoryId = firstItem.categories[0] || \"Other\";\n grouped.push({\n categoryId,\n id: `${basePath_0}-${firstItem.title}`,\n index: currentIndex++,\n items: items.map(item => ({\n ...item,\n index: currentIndex++\n })),\n pathname: basePath_0,\n title: firstItem.title\n });\n }\n return grouped;\n }, [query, search]);\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { useCallback } from \"react\";\nimport Fuzzysort from \"fuzzysort\";\nimport { formatSearchResults } from \"@qualcomm-ui/mdx-common\";\nexport function doSiteSearch(input, searchIndex) {\n const allResults = formatSearchResults(Fuzzysort.go(input, searchIndex, {\n keys: [\"title\", \"heading\", \"content\"],\n limit: 50,\n threshold: 0.2\n }));\n const pageContentMap = /* @__PURE__ */new Map();\n for (const result of allResults) {\n const basePath = result.href.split(\"#\")[0];\n if (!pageContentMap.has(basePath)) {\n pageContentMap.set(basePath, []);\n }\n pageContentMap.get(basePath).push(result);\n }\n const filtered = [];\n for (const [, pageResults] of pageContentMap) {\n const contentResults = pageResults.filter(r => r.type === \"content\");\n const headingResults = pageResults.filter(r => r.type !== \"content\");\n if (contentResults.length > 0) {\n filtered.push(...contentResults);\n } else {\n filtered.push(headingResults[0]);\n }\n }\n return filtered;\n}\nexport function useSiteSearch(searchIndex) {\n const $ = _c(2);\n let t0;\n if ($[0] !== searchIndex) {\n t0 = input => doSiteSearch(input, searchIndex);\n $[0] = searchIndex;\n $[1] = t0;\n } else {\n t0 = $[1];\n }\n return t0;\n}"],
|
|
5
|
-
"mappings": ";AAAA,OAAS,OAAAA,EAAK,QAAAC,MAAY,oBAC1B,OAAS,gBAAAC,OAAoB,eEK7B,OAAQ,YAAAC,MAAe,2BiBAvB,OAAQ,QAAAC,OAAW,+BjBEnB,IAAMC,GAAyC,EACzCC,GAA2C,EAC3CC,GAA6D,GAEtDC,GAAiBC,GAC5BC,EAASD,CAAE,GACXA,EAAG,WAAaJ,IAChB,OAAOI,EAAG,UAAa,SAEZE,EAAcF,GACzBC,EAASD,CAAE,GAAKA,EAAG,WAAaH,GAErBM,GAAYH,GACvBC,EAASD,CAAE,GAAKA,IAAOA,EAAG,OAgBrB,IAAMI,GAAUC,GACrBC,EAASD,CAAE,GAAKA,EAAG,WAAa,OAErBE,GAAgBF,GAC3BD,GAAOC,CAAE,GAAKA,EAAG,WAAaG,IAA0B,SAAUH,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C,EACvB,QAAS,GACT,KAAA+C,EACA,OAAuBV,EAAInC,EAAM,CAC/B,KAAM6C,EAAK,IACb,CAAC,CACH,EAAGA,EAAK,EAAE,CAAC,CACb,CAAC,CAAC,CACJ,EAAG,GAAGH,EAAO,EAAE,IAAIA,EAAO,UAAU,EAAE,CAAC,CACzC,CAAC,EAAIvD,EAA2BgD,EAAI,MAAO,CACzC,UAAW,8BACX,SAAUhD,CACZ,CAAC,EAAI,IACP,CAAC,EAAI,KAAM,GAAG,CAChB,CAAC,CACH,CAAC,CACH,CAAC,CAAC,CACJ,CAAC,CAAC,CACJ,CAAC,CACH",
|
|
6
|
-
"names": ["jsx", "jsxs", "FileTextIcon", "isObject", "noop", "ELEMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "isHTMLElement", "el", "isObject", "isDocument", "isWindow", "isNode", "el", "isObject", "isShadowRoot", "DOCUMENT_FRAGMENT_NODE", "getDocument", "el", "isDocument", "isWindow", "getWindow", "el", "isShadowRoot", "isDocument", "isHTMLElement", "isDom", "getPlatform", "pt", "v", "isDom", "getPlatform", "isMac", "pt", "getComposedPath", "event", "getEventTarget", "wrap", "v", "idx", "_", "index", "sanitize", "str", "char", "code", "defaultItemToId", "v", "itemById", "id", "itemToId", "item", "indexOfId", "getValueText", "el", "sanitize", "match", "valueText", "query", "getByText", "v", "text", "currentId", "itemToId", "defaultItemToId", "index", "indexOfId", "items", "wrap", "item", "getByTypeaheadImpl", "baseItems", "options", "activeId", "itemToId", "key", "state", "timeout", "search", "query", "char", "items", "next", "getByText", "cleanup", "update", "value", "getByTypeahead", "isValidTypeaheadEvent", "event", "fps", "isVirtualClick", "event", "isValidKey", "
|
|
3
|
+
"sources": ["../../../../../node_modules/.pnpm/my-ua-parser@2.0.4/node_modules/my-ua-parser/ua-parser.js", "../../src/site-search/grouped-result-item.tsx", "../../../../common/dom/src/query/caret.ts", "../../../../common/dom/src/query/node.ts", "../../../../common/dom/src/query/computed-style.ts", "../../../../common/dom/src/query/data-url.ts", "../../../../common/dom/src/query/platform.ts", "../../../../common/dom/src/query/event.ts", "../../../../common/dom/src/query/form.ts", "../../../../common/dom/src/query/tabbable.ts", "../../../../common/dom/src/query/initial-focus.ts", "../../../../common/dom/src/query/raf.ts", "../../../../common/dom/src/query/mutation-observer.ts", "../../../../common/dom/src/query/navigate.ts", "../../../../common/dom/src/query/overflow.ts", "../../../../common/dom/src/query/shared.ts", "../../../../common/dom/src/query/point.ts", "../../../../common/dom/src/query/pointer-lock.ts", "../../../../common/dom/src/query/text-selection.ts", "../../../../common/dom/src/query/pointer-move.ts", "../../../../common/dom/src/query/press.ts", "../../../../common/dom/src/query/proxy-tab-focus.ts", "../../../../common/dom/src/query/query.ts", "../../../../common/dom/src/query/scope.ts", "../../../../common/dom/src/query/searchable.ts", "../../../../common/dom/src/query/set.ts", "../../../../common/dom/src/query/typeahead.ts", "../../../../common/dom/src/query/visual-viewport.ts", "../../../../common/dom/src/query/visually-hidden.ts", "../../../../common/dom/src/query/wait-for.ts", "../../../../common/dom/src/focus-visible/focus-visible.ts", "../../src/site-search/search-result-item.tsx", "../../src/site-search/site-search.tsx", "../../src/site-search/use-grouped-results.ts", "../../src/site-search/use-site-search.ts"],
|
|
4
|
+
"sourcesContent": ["/////////////////////////////////////////////////////////////////////////////////\n/* my-ua-parser\n Copyright \u00A9 2024 Matteo Collina <hello@matteocollina.com>\n Copyright \u00A9 2012-2023 Faisal Salman <f@faisalman.com>\n MIT License *//*\n Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.\n Supports browser & node.js environment. \n Source : https://github.com/mcollina/my-ua-parser */\n/////////////////////////////////////////////////////////////////////////////////\n\n(function (window, undefined) {\n\n 'use strict';\n\n //////////////\n // Constants\n /////////////\n\n\n var EMPTY = '',\n UNKNOWN = '?',\n FUNC_TYPE = 'function',\n UNDEF_TYPE = 'undefined',\n OBJ_TYPE = 'object',\n STR_TYPE = 'string',\n MAJOR = 'major',\n MODEL = 'model',\n NAME = 'name',\n TYPE = 'type',\n VENDOR = 'vendor',\n VERSION = 'version',\n ARCHITECTURE= 'architecture',\n CONSOLE = 'console',\n MOBILE = 'mobile',\n TABLET = 'tablet',\n SMARTTV = 'smarttv',\n WEARABLE = 'wearable',\n EMBEDDED = 'embedded',\n UA_MAX_LENGTH = 500;\n\n var AMAZON = 'Amazon',\n APPLE = 'Apple',\n ASUS = 'ASUS',\n BLACKBERRY = 'BlackBerry',\n BROWSER = 'Browser',\n CHROME = 'Chrome',\n EDGE = 'Edge',\n FIREFOX = 'Firefox',\n GOOGLE = 'Google',\n HUAWEI = 'Huawei',\n LG = 'LG',\n MICROSOFT = 'Microsoft',\n MOTOROLA = 'Motorola',\n OPERA = 'Opera',\n SAMSUNG = 'Samsung',\n SHARP = 'Sharp',\n SONY = 'Sony',\n XIAOMI = 'Xiaomi',\n ZEBRA = 'Zebra',\n FACEBOOK = 'Facebook',\n CHROMIUM_OS = 'Chromium OS',\n MAC_OS = 'Mac OS';\n\n ///////////\n // Helper\n //////////\n\n var extend = function (regexes, extensions) {\n var mergedRegexes = {};\n for (var i in regexes) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes[i]);\n } else {\n mergedRegexes[i] = regexes[i];\n }\n }\n return mergedRegexes;\n },\n enumerize = function (arr) {\n var enums = {};\n for (var i=0; i<arr.length; i++) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n },\n has = function (str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n },\n lowerize = function (str) {\n return str.toLowerCase();\n },\n majorize = function (version) {\n return typeof(version) === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split('.')[0] : undefined;\n },\n trim = function (str, len) {\n if (typeof(str) === STR_TYPE) {\n str = str.replace(/^\\s\\s*/, EMPTY);\n return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n\n ///////////////\n // Map helper\n //////////////\n\n var rgxMapper = function (ua, arrays) {\n\n var i = 0, j, k, p, q, matches, match;\n\n // loop through all regexes maps\n while (i < arrays.length && !matches) {\n\n var regex = arrays[i], // even sequence (0,2,4,..)\n props = arrays[i + 1]; // odd sequence (1,3,5,..)\n j = k = 0;\n\n // try matching uastring with regexes\n while (j < regex.length && !matches) {\n\n if (!regex[j]) { break; }\n matches = regex[j++].exec(ua);\n\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n // check if given property is actually array\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length === 2) {\n if (typeof q[1] == FUNC_TYPE) {\n // assign modified match\n this[q[0]] = q[1].call(this, match);\n } else {\n // assign given value, ignore regex match\n this[q[0]] = q[1];\n }\n } else if (q.length === 3) {\n // check whether function or regex\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n // call function (usually string mapper)\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;\n } else {\n // sanitize match using given regex\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;\n }\n } else if (q.length === 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;\n }\n } else {\n this[q] = match ? match : undefined;\n }\n }\n }\n }\n i += 2;\n }\n },\n\n strMapper = function (str, map) {\n\n for (var i in map) {\n // check if current value is array\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n } else if (has(map[i], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n return str;\n };\n\n ///////////////\n // String map\n //////////////\n\n // Safari < 3.0\n var oldSafariMap = {\n '1.0' : '/8',\n '1.2' : '/1',\n '1.3' : '/3',\n '2.0' : '/412',\n '2.0.2' : '/416',\n '2.0.3' : '/417',\n '2.0.4' : '/419',\n '?' : '/'\n },\n windowsVersionMap = {\n 'ME' : '4.90',\n 'NT 3.11' : 'NT3.51',\n 'NT 4.0' : 'NT4.0',\n '2000' : 'NT 5.0',\n 'XP' : ['NT 5.1', 'NT 5.2'],\n 'Vista' : 'NT 6.0',\n '7' : 'NT 6.1',\n '8' : 'NT 6.2',\n '8.1' : 'NT 6.3',\n '10' : ['NT 6.4', 'NT 10.0'],\n 'RT' : 'ARM'\n };\n\n //////////////\n // Regex map\n /////////////\n\n var regexes = {\n\n browser : [[\n\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i // Chrome for Android/iOS\n ], [VERSION, [NAME, 'Chrome']], [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i // Microsoft Edge\n ], [VERSION, [NAME, 'Edge']], [\n\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i, // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i, // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i // Opera\n ], [NAME, VERSION], [\n /opios[\\/ ]+([\\w\\.]+)/i // Opera mini on iphone >= 8.0\n ], [VERSION, [NAME, OPERA+' Mini']], [\n /\\bop(?:rg)?x\\/([\\w\\.]+)/i // Opera GX\n ], [VERSION, [NAME, OPERA+' GX']], [\n /\\bopr\\/([\\w\\.]+)/i // Opera Webkit\n ], [VERSION, [NAME, OPERA]], [\n\n // Mixed\n /\\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\\/ ]?([\\w\\.]+)/i // Baidu\n ], [VERSION, [NAME, 'Baidu']], [\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant|iemobile|slim)\\s?(?:browser)?[\\/ ]?([\\w\\.]*)/i, // Avant/IEMobile/SlimBrowser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i, // Internet Explorer\n\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(heytap|ovi)browser\\/([\\d\\.]+)/i, // Heytap/Ovi\n /(weibo)__([\\d\\.]+)/i // Weibo\n ], [NAME, VERSION], [\n /\\bddg\\/([\\w\\.]+)/i // DuckDuckGo\n ], [VERSION, [NAME, 'DuckDuckGo']], [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i // UCBrowser\n ], [VERSION, [NAME, 'UC'+BROWSER]], [\n /microm.+\\bqbcore\\/([\\w\\.]+)/i, // WeChat Desktop for Windows Built-in Browser\n /\\bqbcore\\/([\\w\\.]+).+microm/i,\n /micromessenger\\/([\\w\\.]+)/i // WeChat\n ], [VERSION, [NAME, 'WeChat']], [\n /konqueror\\/([\\w\\.]+)/i // Konqueror\n ], [VERSION, [NAME, 'Konqueror']], [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i // IE11\n ], [VERSION, [NAME, 'IE']], [\n /ya(?:search)?browser\\/([\\w\\.]+)/i // Yandex\n ], [VERSION, [NAME, 'Yandex']], [\n /slbrowser\\/([\\w\\.]+)/i // Smart Lenovo Browser\n ], [VERSION, [NAME, 'Smart Lenovo '+BROWSER]], [\n /(avast|avg)\\/([\\w\\.]+)/i // Avast/AVG Secure Browser\n ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [\n /\\bfocus\\/([\\w\\.]+)/i // Firefox Focus\n ], [VERSION, [NAME, FIREFOX+' Focus']], [\n /\\bopt\\/([\\w\\.]+)/i // Opera Touch\n ], [VERSION, [NAME, OPERA+' Touch']], [\n /coc_coc\\w+\\/([\\w\\.]+)/i // Coc Coc Browser\n ], [VERSION, [NAME, 'Coc Coc']], [\n /dolfin\\/([\\w\\.]+)/i // Dolphin\n ], [VERSION, [NAME, 'Dolphin']], [\n /coast\\/([\\w\\.]+)/i // Opera Coast\n ], [VERSION, [NAME, OPERA+' Coast']], [\n /miuibrowser\\/([\\w\\.]+)/i // MIUI Browser\n ], [VERSION, [NAME, 'MIUI '+BROWSER]], [\n /fxios\\/([-\\w\\.]+)/i // Firefox for iOS\n ], [VERSION, [NAME, FIREFOX]], [\n /\\bqihu|(qi?ho?o?|360)browser/i // 360\n ], [[NAME, '360 ' + BROWSER]], [\n /(oculus|sailfish|huawei|vivo)browser\\/([\\w\\.]+)/i\n ], [[NAME, /(.+)/, '$1 ' + BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser\n /samsungbrowser\\/([\\w\\.]+)/i // Samsung Internet\n ], [VERSION, [NAME, SAMSUNG + ' Internet']], [\n /(comodo_dragon)\\/([\\w\\.]+)/i // Comodo Dragon\n ], [[NAME, /_/g, ' '], VERSION], [\n /metasr[\\/ ]?([\\d\\.]+)/i // Sogou Explorer\n ], [VERSION, [NAME, 'Sogou Explorer']], [\n /(sogou)mo\\w+\\/([\\d\\.]+)/i // Sogou Mobile\n ], [[NAME, 'Sogou Mobile'], VERSION], [\n /(electron)\\/([\\w\\.]+) safari/i, // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i, // Tesla\n /m?(qqbrowser|2345Explorer)[\\/ ]?([\\w\\.]+)/i // QQBrowser/2345 Browser\n ], [NAME, VERSION], [\n /(lbbrowser)/i, // LieBao Browser\n /\\[(linkedin)app\\]/i // LinkedIn App for iOS & Android\n ], [NAME], [\n\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i // Facebook App for iOS & Android\n ], [[NAME, FACEBOOK], VERSION], [\n /(Klarna)\\/([\\w\\.]+)/i, // Klarna Shopping Browser for iOS & Android\n /(kakao(?:talk|story))[\\/ ]([\\w\\.]+)/i, // Kakao App\n /(naver)\\(.*?(\\d+\\.[\\w\\.]+).*\\)/i, // Naver InApp\n /safari (line)\\/([\\w\\.]+)/i, // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i, // Line App for Android\n /(alipay)client\\/([\\w\\.]+)/i, // Alipay\n /(twitter)(?:and| f.+e\\/([\\w\\.]+))/i, // Twitter\n /(chromium|instagram|snapchat)[\\/ ]([-\\w\\.]+)/i // Chromium/Instagram/Snapchat\n ], [NAME, VERSION], [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i // Google Search Appliance on iOS\n ], [VERSION, [NAME, 'GSA']], [\n /musical_ly(?:.+app_?version\\/|_)([\\w\\.]+)/i // TikTok\n ], [VERSION, [NAME, 'TikTok']], [\n\n /headlesschrome(?:\\/([\\w\\.]+)| )/i // Chrome Headless\n ], [VERSION, [NAME, CHROME+' Headless']], [\n\n / wv\\).+(chrome)\\/([\\w\\.]+)/i // Chrome WebView\n ], [[NAME, CHROME+' WebView'], VERSION], [\n\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i // Android Browser\n ], [VERSION, [NAME, 'Android '+BROWSER]], [\n\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia\n ], [NAME, VERSION], [\n\n /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i // Mobile Safari\n ], [VERSION, [NAME, 'Mobile Safari']], [\n /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile\n ], [VERSION, NAME], [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i // Safari < 3.0\n ], [NAME, [VERSION, strMapper, oldSafariMap]], [\n\n /(webkit|khtml)\\/([\\w\\.]+)/i\n ], [NAME, VERSION], [\n\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i // Netscape\n ], [[NAME, 'Netscape'], VERSION], [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i // Firefox Reality\n ], [VERSION, [NAME, FIREFOX+' Reality']], [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i, // Flow\n /(swiftfox)/i, // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i, // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i, // Mozilla\n\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i, // Links\n /panasonic;(viera)/i // Panasonic Viera\n ], [NAME, VERSION], [\n \n /(cobalt)\\/([\\w\\.]+)/i // Cobalt\n ], [NAME, [VERSION, /master.|lts./, \"\"]]\n ],\n\n cpu : [[\n\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i // AMD64 (x64)\n ], [[ARCHITECTURE, 'amd64']], [\n\n /(ia32(?=;))/i // IA32 (quicktime)\n ], [[ARCHITECTURE, lowerize]], [\n\n /((?:i[346]|x)86)[;\\)]/i // IA32 (x86)\n ], [[ARCHITECTURE, 'ia32']], [\n\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i // ARM64\n ], [[ARCHITECTURE, 'arm64']], [\n\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i // ARMHF\n ], [[ARCHITECTURE, 'armhf']], [\n\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ], [[ARCHITECTURE, 'arm']], [\n\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i // PowerPC\n ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [\n\n /(sun4\\w)[;\\)]/i // SPARC\n ], [[ARCHITECTURE, 'sparc']], [\n\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ], [[ARCHITECTURE, lowerize]]\n ],\n\n device : [[\n\n //////////////////////////\n // MOBILES & TABLETS\n /////////////////////////\n\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|sc[g-]?[\\d]+a?|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [\n\n // Apple\n /(?:\\/|\\()(ip(?:hone|od)[\\w, ]*)(?:\\/|;)/i // iPod/iPhone\n ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [\n /\\((ipad);[-\\w\\),; ]+apple/i, // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [\n /(macintosh);/i\n ], [MODEL, [VENDOR, APPLE]], [\n\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [\n\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [\n\n // Xiaomi\n /\\b(poco[\\w ]+|m2\\d{3}j\\d\\d[a-z]{2})(?: bui|\\))/i, // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i, // Xiaomi Hongmi 'numeric' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i, // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i, // Xiaomi Redmi\n /oid[^\\)]+; (m?[12][0-389][01]\\w{3,6}[c-y])( bui|; wv|\\))/i, // Xiaomi Redmi 'numeric' models\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i // Xiaomi Mi\n ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [\n /oid[^\\)]+; (2\\d{4}(283|rpbf)[cgl])( bui|\\))/i, // Redmi Pad\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i // Mi Pad tablets\n ],[[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [\n\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [\n /\\b(opd2\\d{3}a?) bui/i\n ], [MODEL, [VENDOR, 'OPPO'], [TYPE, TABLET]], [\n\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [\n\n // Realme\n /\\b(rmx[1-3]\\d{3})(?: bui|;|\\))/i\n ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [\n\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [\n /\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i\n ], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [\n\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [\n\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [\n\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [\n\n // Google\n /(pixel c)\\b/i // Google Pixel C\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i // Google Pixel\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [\n\n // Sony\n /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [\n /sony tablet [ps]/i,\n /\\b(?:sony)?sgp\\w+(?: bui|\\))/i\n ], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [\n\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [\n\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\\))/i, // Kindle Fire without Silk / Echo Show\n /(kf[a-z]+)( bui|\\)).+silk\\//i // Kindle Fire HD\n ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i // Fire Phone\n ], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [\n\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i // BlackBerry PlayBook\n ], [MODEL, VENDOR, [TYPE, TABLET]], [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i // BlackBerry 10\n ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [\n\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [\n / (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i\n ], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [\n\n // HTC\n /(nexus 9)/i // HTC Nexus 9\n ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i, // HTC\n\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\\.))|sony(?!-bra))[-_ ]?([-\\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [\n\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [\n\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [\n \n // Ulefone\n /; ((?:power )?armor(?:[\\w ]{0,8}))(?: bui|\\))/i\n ], [MODEL, [VENDOR, 'Ulefone'], [TYPE, MOBILE]], [\n\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i, // HP iPAQ\n /(asus)-?(\\w+)/i, // Asus\n /(microsoft); (lumia[\\w ]+)/i, // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i, // Lenovo\n /(jolla)/i, // Jolla\n /(oppo) ?([\\w ]+) bui/i // OPPO\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /(kobo)\\s(ereader|touch)/i, // Kobo\n /(archos) (gamepad2?)/i, // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i, // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i, // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i, // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i, // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i, // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i // Vodafone\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /(surface duo)/i // Surface Duo\n ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i // Fairphone\n ], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [\n /(u304aa)/i // AT&T\n ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [\n /\\bsie-(\\w*)/i // Siemens\n ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [\n /\\b(rct\\w+) b/i // RCA Tablets\n ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [\n /\\b(venue[\\d ]{2,7}) b/i // Dell Venue Tablets\n ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [\n /\\b(q(?:mv|ta)\\w+) b/i // Verizon Tablet\n ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i // Barnes & Noble Tablet\n ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [\n /\\b(tm\\d{3}\\w+) b/i\n ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [\n /\\b(k88) b/i // ZTE K Series Tablet\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [\n /\\b(nx\\d{3}j) b/i // ZTE Nubia\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [\n /\\b(gen\\d{3}) b.+49h/i // Swiss GEN Mobile\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [\n /\\b(zur\\d{3}) b/i // Swiss ZUR Tablet\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [\n /\\b((zeki)?tb.*\\b) b/i // Zeki Tablets\n ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i // Dragon Touch Tablet\n ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [\n /\\b(ns-?\\w{0,9}) b/i // Insignia Tablets\n ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [\n /\\b((nxa|next)-?\\w{0,9}) b/i // NextBook Tablets\n ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones\n ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [\n /\\b(lvtel\\-)?(v1[12]) b/i // LvTel Phones\n ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [\n /\\b(ph-1) /i // Essential PH-1\n ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i // Envizen Tablets\n ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [\n /\\b(trio[-\\w\\. ]+) b/i // MachSpeed Tablets\n ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [\n /\\btu_(1491) b/i // Rotor Tablets\n ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [\n /(shield[\\w ]+) b/i // Nvidia Shield Tablets\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [\n /(sprint) (\\w+)/i // Sprint Phones\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /(kin\\.[onetw]{3})/i // Microsoft Kin\n ], [[MODEL, /\\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i // Zebra\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [\n /droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [\n\n ///////////////////\n // SMARTTVS\n ///////////////////\n\n /smart-tv.+(samsung)/i // Samsung\n ], [VENDOR, [TYPE, SMARTTV]], [\n /hbbtv.+maple;(\\d+)/i\n ], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i // LG SmartTV\n ], [[VENDOR, LG], [TYPE, SMARTTV]], [\n /(apple) ?tv/i // Apple TV\n ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [\n /crkey/i // Google Chromecast\n ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [\n /droid.+aft(\\w+)( bui|\\))/i // Fire TV\n ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [\n /\\(dtv[\\);].+(aquos)/i,\n /(aquos-tv[\\w ]+)\\)/i // Sharp\n ], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],[\n /(bravia[\\w ]+)( bui|\\))/i // Sony\n ], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [\n /(mitv-\\w{5}) bui/i // Xiaomi\n ], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [\n /Hbbtv.*(technisat) (.*);/i // TechniSAT\n ], [VENDOR, MODEL, [TYPE, SMARTTV]], [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i, // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w\\+ ]*; *([\\w\\d][^;]*);([^;]*)/i // HbbTV devices\n ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i // SmartTV from Unidentified Vendors\n ], [[TYPE, SMARTTV]], [\n\n ///////////////////\n // CONSOLES\n ///////////////////\n\n /(ouya)/i, // Ouya\n /(nintendo) ([wids3utch]+)/i // Nintendo\n ], [VENDOR, MODEL, [TYPE, CONSOLE]], [\n /droid.+; (shield) bui/i // Nvidia\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [\n /(playstation [345portablevi]+)/i // Playstation\n ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i // Microsoft Xbox\n ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [\n\n ///////////////////\n // WEARABLES\n ///////////////////\n\n /((pebble))app/i // Pebble\n ], [VENDOR, MODEL, [TYPE, WEARABLE]], [\n /(watch)(?: ?os[,\\/]|\\d,\\d\\/)[\\d\\.]+/i // Apple Watch\n ], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [\n /droid.+; (glass) \\d/i // Google Glass\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [\n /droid.+; (wt63?0{2,3})\\)/i\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [\n /(quest( \\d| pro)?)/i // Oculus Quest\n ], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [\n\n ///////////////////\n // EMBEDDED\n ///////////////////\n\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i // Tesla\n ], [VENDOR, [TYPE, EMBEDDED]], [\n /(aeobc)\\b/i // Echo Dot\n ], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [\n\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n\n /droid .+?; ([^;]+?)(?: bui|; wv\\)|\\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors\n ], [MODEL, [TYPE, MOBILE]], [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors\n ], [MODEL, [TYPE, TABLET]], [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i // Unidentifiable Tablet\n ], [[TYPE, TABLET]], [\n /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile\n ], [[TYPE, MOBILE]], [\n /(android[-\\w\\. ]{0,9});.+buil/i // Generic Android Device\n ], [MODEL, [VENDOR, 'Generic']]\n ],\n\n engine : [[\n\n /windows.+ edge\\/([\\w\\.]+)/i // EdgeHTML\n ], [VERSION, [NAME, EDGE+'HTML']], [\n\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i // Blink\n ], [VERSION, [NAME, 'Blink']], [\n\n /(presto)\\/([\\w\\.]+)/i, // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i, // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i, // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i, // iCab\n /\\b(libweb)/i\n ], [NAME, VERSION], [\n\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i // Gecko\n ], [VERSION, NAME]\n ],\n\n os : [[\n\n // Windows\n /microsoft (windows) (vista|xp)/i // Windows (iTunes)\n ], [NAME, VERSION], [\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i // Windows Phone\n ], [NAME, [VERSION, strMapper, windowsVersionMap]], [\n /windows nt 6\\.2; (arm)/i, // Windows RT\n /windows[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i,\n /(?:win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i\n ], [[VERSION, strMapper, windowsVersionMap], [NAME, 'Windows']], [\n\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i, // iOS\n /(?:ios;fbsv\\/|iphone.+ios[\\/ ])([\\d\\.]+)/i,\n /cfnetwork\\/.+darwin/i\n ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i // Mac OS\n ], [[NAME, MAC_OS], [VERSION, /_/g, '.']], [\n\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS\n ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i, // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i, // Tizen/KaiOS\n /\\((series40);/i // Series 40\n ], [NAME, VERSION], [\n /\\(bb(10);/i // BlackBerry 10\n ], [VERSION, [NAME, BLACKBERRY]], [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i // Symbian\n ], [VERSION, [NAME, 'Symbian']], [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i // Firefox OS\n ], [VERSION, [NAME, FIREFOX+' OS']], [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i // WebOS\n ], [VERSION, [NAME, 'webOS']], [\n /watch(?: ?os[,\\/]|\\d,\\d\\/)([\\d\\.]+)/i // watchOS\n ], [VERSION, [NAME, 'watchOS']], [\n\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i // Google Chromecast\n ], [VERSION, [NAME, CHROME+'cast']], [\n /(cros) [\\w]+(?:\\)| ([\\w\\.]+)\\b)/i // Chromium OS\n ], [[NAME, CHROMIUM_OS], VERSION],[\n\n // Smart TVs\n /panasonic;(viera)/i, // Panasonic Viera\n /(netrange)mmh/i, // Netrange\n /(nettv)\\/(\\d+\\.[\\w\\.]+)/i, // NetTV\n\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S)\n\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i, // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i, // Mint\n /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i, // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i, // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i // Haiku\n ], [NAME, VERSION], [\n /(sunos) ?([\\w\\.\\d]*)/i // Solaris\n ], [[NAME, 'Solaris'], VERSION], [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i, // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i, // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS\n /(unix) ?([\\w\\.]*)/i // UNIX\n ], [NAME, VERSION]\n ]\n };\n\n /////////////////\n // Constructor\n ////////////////\n\n var UAParser = function (ua, extensions) {\n\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined;\n }\n\n if (!(this instanceof UAParser)) {\n return new UAParser(ua, extensions).getResult();\n }\n\n var _navigator = (typeof window !== UNDEF_TYPE && window.navigator) ? window.navigator : undefined;\n var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY);\n var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined;\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n var _isSelfNav = _navigator && _navigator.userAgent == _ua;\n\n this.getBrowser = function () {\n var _browser = {};\n _browser[NAME] = undefined;\n _browser[VERSION] = undefined;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser[MAJOR] = majorize(_browser[VERSION]);\n // Brave-specific detection\n if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {\n _browser[NAME] = 'Brave';\n }\n return _browser;\n };\n this.getCPU = function () {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function () {\n var _device = {};\n _device[VENDOR] = undefined;\n _device[MODEL] = undefined;\n _device[TYPE] = undefined;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {\n _device[TYPE] = MOBILE;\n }\n // iPadOS-specific detection: identified as Mac, but has some iOS-only properties\n if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {\n _device[MODEL] = 'iPad';\n _device[TYPE] = TABLET;\n }\n return _device;\n };\n this.getEngine = function () {\n var _engine = {};\n _engine[NAME] = undefined;\n _engine[VERSION] = undefined;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function () {\n var _os = {};\n _os[NAME] = undefined;\n _os[VERSION] = undefined;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != 'Unknown') {\n _os[NAME] = _uach.platform \n .replace(/chrome os/i, CHROMIUM_OS)\n .replace(/macos/i, MAC_OS); // backward compatibility\n }\n return _os;\n };\n this.getResult = function () {\n return {\n ua : this.getUA(),\n browser : this.getBrowser(),\n engine : this.getEngine(),\n os : this.getOS(),\n device : this.getDevice(),\n cpu : this.getCPU()\n };\n };\n this.getUA = function () {\n return _ua;\n };\n this.setUA = function (ua) {\n _ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n\n UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]);\n UAParser.CPU = enumerize([ARCHITECTURE]);\n UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);\n UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]);\n\n ///////////\n // Export\n //////////\n\n // check js environment\n if (typeof(exports) !== UNDEF_TYPE) {\n // nodejs env\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser;\n }\n exports.UAParser = UAParser;\n } else {\n // requirejs env (optional)\n if (typeof(define) === FUNC_TYPE && define.amd) {\n define(function () {\n return UAParser;\n });\n } else if (typeof window !== UNDEF_TYPE) {\n // browser env\n window.UAParser = UAParser;\n }\n }\n\n // jQuery/Zepto specific (optional)\n // Note:\n // In AMD env the global scope should be kept clean, but jQuery is an exception.\n // jQuery always exports to global scope, unless jQuery.noConflict(true) is used,\n // and we should catch that.\n var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser();\n $.ua = parser.getResult();\n $.ua.get = function () {\n return parser.getUA();\n };\n $.ua.set = function (ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n\n})(typeof window === 'object' ? window : this);\n", "import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { FileTextIcon } from \"lucide-react\";\nimport { isFocusVisible } from \"@qualcomm-ui/dom/focus-visible\";\nimport { Icon } from \"@qualcomm-ui/react/icon\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { clsx } from \"@qualcomm-ui/utils/clsx\";\nexport function GroupedResultItem({\n active,\n className,\n item,\n ref,\n ...props\n}) {\n return /* @__PURE__ */jsxs(PolymorphicElement, {\n ref,\n as: \"button\",\n className: clsx(\"qui-site-search__list-item qui-menu-item__root\", className),\n \"data-focus-visible\": booleanDataAttr(isFocusVisible()),\n \"data-highlighted\": booleanDataAttr(active),\n ...props,\n children: [/* @__PURE__ */jsx(Icon, {\n className: \"qui-site-search__item-icon\",\n icon: FileTextIcon,\n size: \"lg\"\n }), /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-site-search__list-item-content\",\n children: [/* @__PURE__ */jsx(\"span\", {\n className: \"qui-site-search__content\",\n children: item.title\n }), /* @__PURE__ */jsx(\"div\", {\n className: \"qui-site-search__metadata\",\n children: item.categoryId\n })]\n })]\n });\n}", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function isCaretAtStart(\n input: HTMLInputElement | HTMLTextAreaElement | null,\n): boolean {\n if (!input) {\n return false\n }\n try {\n return input.selectionStart === 0 && input.selectionEnd === 0\n } catch {\n return input.value === \"\"\n }\n}\n\nexport function setCaretToEnd(\n input: HTMLInputElement | HTMLTextAreaElement | null,\n): void {\n if (!input) {\n return\n }\n const start = input.selectionStart ?? 0\n const end = input.selectionEnd ?? 0\n if (Math.abs(end - start) !== 0) {\n return\n }\n if (start !== 0) {\n return\n }\n input?.setSelectionRange?.(input.value.length, input.value.length)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isObject} from \"@qualcomm-ui/utils/guard\"\n\nconst ELEMENT_NODE: typeof Node.ELEMENT_NODE = 1\nconst DOCUMENT_NODE: typeof Node.DOCUMENT_NODE = 9\nconst DOCUMENT_FRAGMENT_NODE: typeof Node.DOCUMENT_FRAGMENT_NODE = 11\n\nexport const isHTMLElement = (el: any): el is HTMLElement =>\n isObject(el) &&\n el.nodeType === ELEMENT_NODE &&\n typeof el.nodeName === \"string\"\n\nexport const isDocument = (el: any): el is Document =>\n isObject(el) && el.nodeType === DOCUMENT_NODE\n\nexport const isWindow = (el: any): el is Window =>\n isObject(el) && el === el.window\n\nexport const isVisualViewport = (el: any): el is VisualViewport =>\n isObject(el) && el.constructor.name === \"VisualViewport\"\n\nexport const getNodeName = (node: Node | Window): string => {\n if (isHTMLElement(node)) {\n return node.localName || \"\"\n }\n return \"#document\"\n}\n\nexport function isRootElement(node: Node): boolean {\n return [\"html\", \"body\", \"#document\"].includes(getNodeName(node))\n}\n\nexport const isNode = (el: any): el is Node =>\n isObject(el) && el.nodeType !== undefined\n\nexport const isShadowRoot = (el: any): el is ShadowRoot =>\n isNode(el) && el.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in el\n\nexport const isInputElement = (el: any): el is HTMLInputElement =>\n isHTMLElement(el) && el.localName === \"input\"\n\nexport const isAnchorElement = (\n el: HTMLElement | null | undefined,\n): el is HTMLAnchorElement => !!el?.matches(\"a[href]\")\n\nexport function isElementVisible(el: Node): boolean {\n if (!isHTMLElement(el)) {\n return false\n }\n return (\n el.offsetWidth > 0 || el.offsetHeight > 0 || el.getClientRects().length > 0\n )\n}\n\nconst TEXTAREA_SELECT_REGEX = /(textarea|select)/\n\nexport function isEditableElement(\n el: HTMLElement | EventTarget | null,\n): boolean {\n if (el == null || !isHTMLElement(el)) {\n return false\n }\n try {\n return (\n (isInputElement(el) && el.selectionStart != null) ||\n TEXTAREA_SELECT_REGEX.test(el.localName) ||\n el.isContentEditable ||\n el.getAttribute(\"contenteditable\") === \"true\" ||\n el.getAttribute(\"contenteditable\") === \"\"\n )\n } catch {\n return false\n }\n}\n\ntype Target = HTMLElement | EventTarget | null | undefined\n\nexport function contains(parent: Target, child: Target): boolean {\n if (!parent || !child) {\n return false\n }\n if (!isHTMLElement(parent) || !isHTMLElement(child)) {\n return false\n }\n const rootNode = child.getRootNode?.()\n if (parent === child) {\n return true\n }\n if (parent.contains(child)) {\n return true\n }\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child\n while (next) {\n if (parent === next) {\n return true\n }\n // @ts-ignore\n next = next.parentNode || next.host\n }\n }\n return false\n}\n\nexport function getDocument(\n el: Element | Window | Node | Document | null | undefined,\n): Document {\n if (isDocument(el)) {\n return el\n }\n if (isWindow(el)) {\n return el.document\n }\n return el?.ownerDocument ?? document\n}\n\nexport function getDocumentElement(\n el: Element | Node | Window | Document | null | undefined,\n): HTMLElement {\n return getDocument(el).documentElement\n}\n\nexport function getWindow(\n el: Node | ShadowRoot | Document | null | undefined,\n): Window & typeof globalThis {\n if (isShadowRoot(el)) {\n return getWindow(el.host)\n }\n if (isDocument(el)) {\n return el.defaultView ?? window\n }\n if (isHTMLElement(el)) {\n return el.ownerDocument?.defaultView ?? window\n }\n return window\n}\n\nexport function getActiveElement(\n rootNode: Document | ShadowRoot,\n): HTMLElement | null {\n let activeElement = rootNode.activeElement as HTMLElement | null\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement as HTMLElement | null\n if (el === activeElement) {\n break\n } else {\n activeElement = el\n }\n }\n return activeElement\n}\n\nexport function getParentNode(node: Node): Node {\n if (getNodeName(node) === \"html\") {\n return node\n }\n const result =\n (node as any).assignedSlot ||\n node.parentNode ||\n (isShadowRoot(node) && node.host) ||\n getDocumentElement(node)\n return isShadowRoot(result) ? result.host : result\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getWindow} from \"./node\"\n\nconst styleCache = new WeakMap<Element, CSSStyleDeclaration>()\n\nexport function getComputedStyle(el: Element): CSSStyleDeclaration | undefined {\n if (!styleCache.has(el)) {\n styleCache.set(el, getWindow(el).getComputedStyle(el))\n }\n return styleCache.get(el)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getWindow} from \"./node\"\n\nexport type DataUrlType = \"image/png\" | \"image/jpeg\" | \"image/svg+xml\"\n\nexport interface DataUrlOptions {\n /**\n * The background color of the canvas.\n * Useful when type is `image/jpeg`\n */\n background?: string | undefined\n /**\n * The quality of the image\n * @default 0.92\n */\n quality?: number | undefined\n /**\n * The type of the image\n */\n type: DataUrlType\n}\n\nexport function getDataUrl(\n svg: SVGSVGElement | undefined | null,\n opts: DataUrlOptions,\n): Promise<string> {\n const {background, quality = 0.92, type} = opts\n\n if (!svg) {\n throw new Error(\"[@qualcomm-ui/dom/query]: Could not find the svg element\")\n }\n\n const win = getWindow(svg)\n const doc = win.document\n\n const svgBounds = svg.getBoundingClientRect()\n\n const svgClone = svg.cloneNode(true) as SVGSVGElement\n if (!svgClone.hasAttribute(\"viewBox\")) {\n svgClone.setAttribute(\n \"viewBox\",\n `0 0 ${svgBounds.width} ${svgBounds.height}`,\n )\n }\n\n const serializer = new win.XMLSerializer()\n const source = `<?xml version=\"1.0\" standalone=\"no\"?>\\r\\n${serializer.serializeToString(\n svgClone,\n )}`\n const svgString = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(source)}`\n\n if (type === \"image/svg+xml\") {\n return Promise.resolve(svgString).then((str) => {\n svgClone.remove()\n return str\n })\n }\n\n const dpr = win.devicePixelRatio || 1\n\n const canvas = doc.createElement(\"canvas\")\n const image = new win.Image()\n image.src = svgString\n\n canvas.width = svgBounds.width * dpr\n canvas.height = svgBounds.height * dpr\n\n const context = canvas.getContext(\"2d\")\n\n if (!context) {\n throw new Error(\"[getDataUrl]: Could not get the canvas context\")\n }\n\n if (type === \"image/jpeg\" || background) {\n context.fillStyle = background || \"white\"\n context.fillRect(0, 0, canvas.width, canvas.height)\n }\n\n return new Promise((resolve) => {\n image.onload = () => {\n context?.drawImage(image, 0, 0, canvas.width, canvas.height)\n resolve(canvas.toDataURL(type, quality))\n svgClone.remove()\n }\n })\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function isDom(): boolean {\n return typeof document !== \"undefined\"\n}\n\ninterface NavigatorUserAgentData {\n brands: Array<{brand: string; version: string}>\n mobile: boolean\n platform: string\n}\n\nexport function getPlatform(): string {\n const agent = (navigator as any).userAgentData as\n | NavigatorUserAgentData\n | undefined\n return agent?.platform ?? navigator.platform\n}\n\nexport function getUserAgent(): string {\n const ua = (navigator as any).userAgentData as\n | NavigatorUserAgentData\n | undefined\n if (ua && Array.isArray(ua.brands)) {\n return ua.brands.map(({brand, version}) => `${brand}/${version}`).join(\" \")\n }\n return navigator.userAgent\n}\n\nfunction pt(v: RegExp) {\n return isDom() && v.test(getPlatform())\n}\n\nfunction ua(v: RegExp) {\n return isDom() && v.test(getUserAgent())\n}\n\nconst vn = (v: RegExp) => isDom() && v.test(navigator.vendor)\n\nexport function isTouchDevice(): boolean {\n return isDom() && !!navigator.maxTouchPoints\n}\n\nexport function isMac(): boolean {\n return pt(/^Mac/)\n}\n\nexport function isSafari(): boolean {\n return isApple() && vn(/apple/i)\n}\n\nexport function isFirefox(): boolean {\n return ua(/firefox\\//i)\n}\n\nexport function isApple(): boolean {\n return pt(/mac|iphone|ipad|ipod/i)\n}\n\nexport function isIos(): boolean {\n return pt(/iP(hone|ad|od)|iOS/)\n}\n\nexport function isWebKit(): boolean {\n return ua(/AppleWebKit/)\n}\n\nexport function isAndroid(): boolean {\n const re = /android/i\n return pt(re) || ua(re)\n}\n\n/**\n * Returns the keyboard modifier key: CMD if on Mac, Ctrl if on Windows or Linux.\n *\n * @param ssrFallback fallback value to render during SSR.\n */\nexport function getModifierKey(ssrFallback: string = \"Ctrl\"): string {\n return isMac() ? \"\u2318\" : ssrFallback\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {MaybeFn} from \"@qualcomm-ui/utils/guard\"\n\nimport {contains} from \"./node\"\nimport {isAndroid, isApple, isMac} from \"./platform\"\nimport type {AnyPointerEvent, EventKeyOptions, NativeEvent} from \"./types\"\n\nexport function getBeforeInputValue(\n event: Pick<InputEvent, \"currentTarget\">,\n): string {\n const {selectionEnd, selectionStart, value} =\n event.currentTarget as HTMLInputElement\n return (\n value.slice(0, selectionStart ?? -1) +\n (event as any).data +\n value.slice(selectionEnd ?? -1)\n )\n}\n\nfunction getComposedPath(event: any): EventTarget[] | undefined {\n return event.composedPath?.() ?? event.nativeEvent?.composedPath?.()\n}\n\nexport function getEventTarget<T extends EventTarget>(\n event: Partial<Pick<UIEvent, \"target\" | \"composedPath\">>,\n): T | null {\n const composedPath = getComposedPath(event)\n return (composedPath?.[0] ?? event.target) as T | null\n}\n\nexport function isSelfTarget(\n event: Partial<Pick<UIEvent, \"currentTarget\" | \"target\" | \"composedPath\">>,\n): boolean {\n return contains(event.currentTarget as Node, getEventTarget(event))\n}\n\nexport function isOpeningInNewTab(\n event: Pick<MouseEvent, \"currentTarget\" | \"metaKey\" | \"ctrlKey\">,\n): boolean {\n const element = event.currentTarget as\n | HTMLAnchorElement\n | HTMLButtonElement\n | HTMLInputElement\n | null\n if (!element) {\n return false\n }\n\n const isAppleDevice = isApple()\n if (isAppleDevice && !event.metaKey) {\n return false\n }\n if (!isAppleDevice && !event.ctrlKey) {\n return false\n }\n\n const localName = element.localName\n\n if (localName === \"a\") {\n return true\n }\n if (localName === \"button\" && element.type === \"submit\") {\n return true\n }\n if (localName === \"input\" && element.type === \"submit\") {\n return true\n }\n\n return false\n}\n\nexport function isDownloadingEvent(\n event: Pick<MouseEvent, \"altKey\" | \"currentTarget\">,\n): boolean {\n const element = event.currentTarget as\n | HTMLAnchorElement\n | HTMLButtonElement\n | HTMLInputElement\n | null\n if (!element) {\n return false\n }\n const localName = element.localName\n if (!event.altKey) {\n return false\n }\n if (localName === \"a\") {\n return true\n }\n if (localName === \"button\" && element.type === \"submit\") {\n return true\n }\n if (localName === \"input\" && element.type === \"submit\") {\n return true\n }\n return false\n}\n\nexport function isComposingEvent(event: any): boolean {\n return getNativeEvent(event).isComposing\n}\n\nexport function isKeyboardClick(\n e: Pick<MouseEvent, \"detail\" | \"clientX\" | \"clientY\">,\n): boolean {\n return e.detail === 0 || (e.clientX === 0 && e.clientY === 0)\n}\n\nexport function isPrintableKey(\n e: Pick<KeyboardEvent, \"key\" | \"ctrlKey\" | \"metaKey\">,\n): boolean {\n return e.key.length === 1 && !e.ctrlKey && !e.metaKey\n}\n\nexport function isVirtualPointerEvent(e: PointerEvent): boolean {\n return (\n (e.width === 0 && e.height === 0) ||\n (e.width === 1 &&\n e.height === 1 &&\n e.pressure === 0 &&\n e.detail === 0 &&\n e.pointerType === \"mouse\")\n )\n}\n\nexport function isVirtualClick(e: MouseEvent | PointerEvent): boolean {\n if ((e as any).mozInputSource === 0 && e.isTrusted) {\n return true\n }\n if (isAndroid() && (e as PointerEvent).pointerType) {\n return e.type === \"click\" && e.buttons === 1\n }\n return e.detail === 0 && !(e as PointerEvent).pointerType\n}\n\nexport function isLeftClick(e: Pick<MouseEvent, \"button\">): boolean {\n return e.button === 0\n}\n\nexport function isContextMenuEvent(\n e: Pick<MouseEvent, \"button\" | \"ctrlKey\" | \"metaKey\">,\n): boolean {\n return e.button === 2 || (isMac() && e.ctrlKey && e.button === 0)\n}\n\nexport function isModifierKey(\n e: Pick<KeyboardEvent, \"ctrlKey\" | \"metaKey\" | \"altKey\">,\n): boolean {\n return e.ctrlKey || e.altKey || e.metaKey\n}\n\nexport const isTouchEvent = (event: AnyPointerEvent): event is TouchEvent =>\n \"touches\" in event && event.touches.length > 0\n\nconst keyMap: Record<string, string> = {\n \" \": \"Space\",\n \",\": \"Comma\",\n Down: \"ArrowDown\",\n Esc: \"Escape\",\n Left: \"ArrowLeft\",\n Right: \"ArrowRight\",\n Up: \"ArrowUp\",\n}\n\nconst rtlKeyMap: Record<string, string> = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\",\n}\n\nexport function getEventKey(\n event: Pick<KeyboardEvent, \"key\">,\n options: EventKeyOptions = {},\n): string {\n const {dir = \"ltr\", orientation = \"horizontal\"} = options\n let key = event.key\n key = keyMap[key] ?? key\n const isRtl = dir === \"rtl\" && orientation === \"horizontal\"\n if (isRtl && key in rtlKeyMap) {\n key = rtlKeyMap[key]\n }\n return key\n}\n\nexport function getNativeEvent<E>(event: E): NativeEvent<E> {\n return (event as any).nativeEvent ?? event\n}\n\nconst pageKeys = new Set([\"PageUp\", \"PageDown\"])\nconst arrowKeys = new Set([\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"])\n\nexport function getEventStep(\n event: Pick<KeyboardEvent, \"ctrlKey\" | \"metaKey\" | \"key\" | \"shiftKey\">,\n): 1 | 0.1 | 10 {\n if (event.ctrlKey || event.metaKey) {\n return 0.1\n } else {\n const isPageKey = pageKeys.has(event.key)\n const isSkipKey = isPageKey || (event.shiftKey && arrowKeys.has(event.key))\n return isSkipKey ? 10 : 1\n }\n}\n\nexport function getEventPoint(\n event: any,\n type: \"page\" | \"client\" = \"client\",\n): {x: number; y: number} {\n const point = isTouchEvent(event)\n ? event.touches[0] || event.changedTouches[0]\n : event\n return {x: point[`${type}X`], y: point[`${type}Y`]}\n}\n\ninterface DOMEventMap\n extends DocumentEventMap,\n WindowEventMap,\n HTMLElementEventMap {}\n\nexport const addDomEvent = <K extends keyof DOMEventMap>(\n target: MaybeFn<EventTarget | null>,\n eventName: K,\n handler: (event: DOMEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n) => {\n const node = typeof target === \"function\" ? target() : target\n node?.addEventListener(eventName, handler as any, options)\n return (): void => {\n node?.removeEventListener(eventName, handler as any, options)\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getWindow} from \"./node\"\nimport type {HTMLElementWithValue} from \"./types\"\n\ninterface DescriptorOptions {\n property?: \"value\" | \"checked\" | undefined\n type?:\n | \"HTMLInputElement\"\n | \"HTMLTextAreaElement\"\n | \"HTMLSelectElement\"\n | undefined\n}\n\nfunction getDescriptor(el: HTMLElement, options: DescriptorOptions) {\n const {property = \"value\", type = \"HTMLInputElement\"} = options\n const proto = getWindow(el)[type].prototype\n return Object.getOwnPropertyDescriptor(proto, property) ?? {}\n}\n\nfunction getElementType(\n el: HTMLElementWithValue,\n):\n | \"HTMLInputElement\"\n | \"HTMLTextAreaElement\"\n | \"HTMLSelectElement\"\n | undefined {\n if (el.localName === \"input\") {\n return \"HTMLInputElement\"\n }\n if (el.localName === \"textarea\") {\n return \"HTMLTextAreaElement\"\n }\n if (el.localName === \"select\") {\n return \"HTMLSelectElement\"\n }\n return undefined\n}\n\nexport function setElementValue(\n el: HTMLElementWithValue | null,\n value: string,\n property: \"value\" | \"checked\" = \"value\",\n): void {\n if (!el) {\n return\n }\n const type = getElementType(el)\n if (type) {\n const descriptor = getDescriptor(el, {property, type})\n descriptor.set?.call(el, value)\n }\n el.setAttribute(property, value)\n}\n\nexport function setElementChecked(\n el: HTMLInputElement | null,\n checked: boolean,\n): void {\n if (!el) {\n return\n }\n const descriptor = getDescriptor(el, {\n property: \"checked\",\n type: \"HTMLInputElement\",\n })\n descriptor.set?.call(el, checked)\n // react applies the `checked` automatically when we call the descriptor\n // but for consistency with vanilla JS, we need to do it manually as well\n if (checked) {\n el.setAttribute(\"checked\", \"\")\n } else {\n el.removeAttribute(\"checked\")\n }\n}\n\nexport interface InputValueEventOptions {\n bubbles?: boolean\n value: string | number\n}\n\nexport function dispatchInputValueEvent(\n el: HTMLElementWithValue | null,\n options: InputValueEventOptions,\n): void {\n const {bubbles = true, value} = options\n\n if (!el) {\n return\n }\n\n const win = getWindow(el)\n if (!(el instanceof win.HTMLInputElement)) {\n return\n }\n\n setElementValue(el, `${value}`)\n el.dispatchEvent(new win.Event(\"input\", {bubbles}))\n}\n\nexport interface CheckedEventOptions {\n bubbles?: boolean\n checked: boolean\n}\n\nexport function dispatchInputCheckedEvent(\n el: HTMLInputElement | null,\n options: CheckedEventOptions,\n): void {\n const {bubbles = true, checked} = options\n if (!el) {\n return\n }\n const win = getWindow(el)\n if (!(el instanceof win.HTMLInputElement)) {\n return\n }\n setElementChecked(el, checked)\n el.dispatchEvent(new win.Event(\"click\", {bubbles}))\n}\n\nfunction getClosestForm(el: HTMLElement) {\n return isFormElement(el) ? el.form : el.closest(\"form\")\n}\n\nfunction isFormElement(el: HTMLElement): el is HTMLElementWithValue {\n return el.matches(\"textarea, input, select, button\")\n}\n\nfunction trackFormReset(\n el: HTMLElement | null | undefined,\n callback: VoidFunction,\n) {\n if (!el) {\n return\n }\n const form = getClosestForm(el)\n const onReset = (e: Event) => {\n if (e.defaultPrevented) {\n return\n }\n callback()\n }\n form?.addEventListener(\"reset\", onReset, {passive: true})\n return () => form?.removeEventListener(\"reset\", onReset)\n}\n\nfunction trackFieldsetDisabled(\n el: HTMLElement | null | undefined,\n callback: (disabled: boolean) => void,\n) {\n const fieldset = el?.closest(\"fieldset\")\n if (!fieldset) {\n return\n }\n callback(fieldset.disabled)\n const win = getWindow(fieldset)\n const obs = new win.MutationObserver(() => callback(fieldset.disabled))\n obs.observe(fieldset, {\n attributeFilter: [\"disabled\"],\n attributes: true,\n })\n return () => obs.disconnect()\n}\n\nexport interface TrackFormControlOptions {\n onFieldsetDisabledChange: (disabled: boolean) => void\n onFormReset: VoidFunction\n}\n\nexport function trackFormControl(\n el: HTMLElement | null,\n options: TrackFormControlOptions,\n): VoidFunction | undefined {\n if (!el) {\n return\n }\n const {onFieldsetDisabledChange, onFormReset} = options\n const cleanups = [\n trackFormReset(el, onFormReset),\n trackFieldsetDisabled(el, onFieldsetDisabledChange),\n ]\n return (): void => cleanups.forEach((cleanup) => cleanup?.())\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isEditableElement, isElementVisible, isHTMLElement} from \"./node\"\n\ntype IncludeContainerType = boolean | \"if-empty\"\n\nconst isFrame = (el: any): el is HTMLIFrameElement =>\n isHTMLElement(el) && el.tagName === \"IFRAME\"\n\nconst hasTabIndex = (el: Element) =>\n !Number.isNaN(parseInt(el.getAttribute(\"tabindex\") || \"0\", 10))\nconst hasNegativeTabIndex = (el: Element) =>\n parseInt(el.getAttribute(\"tabindex\") || \"0\", 10) < 0\n\nconst focusableSelector =\n /* #__PURE__ */ \"input:not([type='hidden']):not([disabled]), select:not([disabled]), \" +\n \"textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], \" +\n \"iframe, object, embed, area[href], audio[controls], video[controls], \" +\n \"[contenteditable]:not([contenteditable='false']), details > summary:first-of-type\"\n\nexport function getFocusables(\n container: Pick<HTMLElement, \"querySelectorAll\"> | null,\n includeContainer: IncludeContainerType = false,\n): HTMLElement[] {\n if (!container) {\n return []\n }\n const elements = Array.from(\n container.querySelectorAll<HTMLElement>(focusableSelector),\n )\n\n const include =\n // eslint-disable-next-line eqeqeq\n includeContainer == true ||\n (includeContainer === \"if-empty\" && elements.length === 0)\n if (include && isHTMLElement(container) && isFocusable(container)) {\n elements.unshift(container)\n }\n\n const focusableElements = elements.filter(isFocusable)\n\n focusableElements.forEach((element, i) => {\n if (isFrame(element) && element.contentDocument) {\n const frameBody = element.contentDocument.body\n focusableElements.splice(i, 1, ...getFocusables(frameBody))\n }\n })\n\n return focusableElements\n}\n\nexport function isFocusable(\n element: HTMLElement | null,\n): element is HTMLElement {\n if (!element || element.closest(\"[inert]\")) {\n return false\n }\n return element.matches(focusableSelector) && isElementVisible(element)\n}\n\nexport function getFirstFocusable(\n container: HTMLElement | null,\n includeContainer?: IncludeContainerType,\n): HTMLElement | null {\n const [first] = getFocusables(container, includeContainer)\n return first || null\n}\n\nexport function getTabbables(\n container: HTMLElement | null | undefined,\n includeContainer?: IncludeContainerType,\n): HTMLElement[] {\n if (!container) {\n return []\n }\n const elements = Array.from(\n container.querySelectorAll<HTMLElement>(focusableSelector),\n )\n const tabbableElements = elements.filter(isTabbable)\n\n if (includeContainer && isTabbable(container)) {\n tabbableElements.unshift(container)\n }\n\n tabbableElements.forEach((element, i) => {\n if (isFrame(element) && element.contentDocument) {\n const frameBody = element.contentDocument.body\n const allFrameTabbable = getTabbables(frameBody)\n tabbableElements.splice(i, 1, ...allFrameTabbable)\n }\n })\n\n if (!tabbableElements.length && includeContainer) {\n return elements\n }\n\n return tabbableElements\n}\n\nexport function isTabbable(el: HTMLElement | null): el is HTMLElement {\n if (el != null && el.tabIndex > 0) {\n return true\n }\n return isFocusable(el) && !hasNegativeTabIndex(el)\n}\n\nexport function getFirstTabbable(\n container: HTMLElement | null,\n includeContainer?: IncludeContainerType,\n): HTMLElement | null {\n const [first] = getTabbables(container, includeContainer)\n return first || null\n}\n\nexport function getLastTabbable(\n container: HTMLElement | null,\n includeContainer?: IncludeContainerType,\n): HTMLElement | null {\n const elements = getTabbables(container, includeContainer)\n return elements[elements.length - 1] || null\n}\n\nexport function getTabbableEdges(\n container: HTMLElement | null | undefined,\n includeContainer?: IncludeContainerType,\n): [HTMLElement, HTMLElement] | [null, null] {\n const elements = getTabbables(container, includeContainer)\n const first = elements[0] || null\n const last = elements[elements.length - 1] || null\n return [first, last]\n}\n\nexport function getNextTabbable(\n container: HTMLElement | null,\n current?: HTMLElement | null,\n): HTMLElement | null {\n const tabbables = getTabbables(container)\n const doc = container?.ownerDocument || document\n const currentElement = current ?? (doc.activeElement as HTMLElement | null)\n if (!currentElement) {\n return null\n }\n const index = tabbables.indexOf(currentElement)\n return tabbables[index + 1] || null\n}\n\nexport function getTabIndex(node: HTMLElement | SVGElement): number {\n if (node.tabIndex < 0) {\n if (\n (/^(audio|video|details)$/.test(node.localName) ||\n isEditableElement(node)) &&\n !hasTabIndex(node)\n ) {\n return 0\n }\n }\n return node.tabIndex\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {getTabbableEdges, getTabbables} from \"./tabbable\"\n\n/**\n * Represents options for managing the initial focus within a focusable area.\n */\nexport interface InitialFocusOptions {\n enabled?: boolean | undefined\n filter?: ((el: HTMLElement) => boolean) | undefined\n getInitialEl?: (() => HTMLElement | null) | undefined\n root: HTMLElement | null\n}\n\n/**\n * Determines and returns the initial focusable element based on the provided\n * options.\n *\n * @param {InitialFocusOptions} options - Configuration options for determining the initial focus element.\n * @param {boolean} [options.enabled=true] - Whether the focus logic should be processed.\n * @param {(HTMLElement | (() => HTMLElement | null | undefined))} [options.getInitialEl] - A specific element or a function returning an element to set as the initial focus target.\n * @param {HTMLElement} [options.root] - The root container within which to search for focusable elements.\n * @param {(node: HTMLElement) => boolean} [options.filter] - A function to filter and prioritize focusable elements.\n * @return {HTMLElement | undefined} The element to receive initial focus, or `undefined` if no suitable element is found.\n */\nexport function getInitialFocus(\n options: InitialFocusOptions,\n): HTMLElement | undefined {\n const {enabled = true, filter, getInitialEl, root} = options\n\n if (!enabled) {\n return\n }\n\n let node: HTMLElement | null | undefined = null\n\n node ||= typeof getInitialEl === \"function\" ? getInitialEl() : getInitialEl\n node ||= root?.querySelector<HTMLElement>(\"[data-autofocus],[autofocus]\")\n\n if (!node) {\n const tabbables = getTabbables(root)\n node = filter ? tabbables.filter(filter)[0] : tabbables[0]\n }\n\n return node || root || undefined\n}\n\nexport function isValidTabEvent(\n event: Pick<KeyboardEvent, \"shiftKey\" | \"currentTarget\">,\n): boolean {\n const container = event.currentTarget as HTMLElement | null\n if (!container) {\n return false\n }\n\n const [firstTabbable, lastTabbable] = getTabbableEdges(container)\n const doc = container.ownerDocument || document\n\n if (doc.activeElement === firstTabbable && event.shiftKey) {\n return false\n }\n if (doc.activeElement === lastTabbable && !event.shiftKey) {\n return false\n }\n if (!firstTabbable && !lastTabbable) {\n return false\n }\n\n return true\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function nextTick(fn: VoidFunction): VoidFunction {\n const set = new Set<VoidFunction>()\n function raf(fn: VoidFunction) {\n const id = globalThis.requestAnimationFrame(fn)\n set.add(() => globalThis.cancelAnimationFrame(id))\n }\n raf(() => raf(fn))\n return function cleanup() {\n set.forEach((fn) => fn())\n }\n}\n\nexport function raf(fn: VoidFunction | (() => VoidFunction)): VoidFunction {\n let cleanup: VoidFunction | undefined | void\n const id = globalThis.requestAnimationFrame?.(() => {\n cleanup = fn()\n })\n return () => {\n globalThis.cancelAnimationFrame?.(id)\n cleanup?.()\n }\n}\n\nexport function queueBeforeEvent(\n el: EventTarget,\n type: string,\n cb: () => void,\n): VoidFunction {\n const cancelTimer = raf(() => {\n el.removeEventListener(type, exec, true)\n cb()\n })\n const exec = () => {\n cancelTimer()\n cb()\n }\n el.addEventListener(type, exec, {capture: true, once: true})\n return cancelTimer\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {raf} from \"./raf\"\nimport type {MaybeElement, MaybeElementOrFn} from \"./types\"\n\nexport interface ObserveAttributeOptions {\n attributes: string[]\n callback(record: MutationRecord): void\n defer?: boolean | undefined\n}\n\nfunction observeAttributesImpl(\n node: MaybeElement,\n options: ObserveAttributeOptions,\n) {\n if (!node) {\n return\n }\n const {attributes, callback: fn} = options\n const win = node.ownerDocument.defaultView || window\n const obs = new win.MutationObserver((changes: any) => {\n for (const change of changes) {\n if (\n change.type === \"attributes\" &&\n change.attributeName &&\n attributes.includes(change.attributeName)\n ) {\n fn(change)\n }\n }\n })\n obs.observe(node, {attributeFilter: attributes, attributes: true})\n return () => obs.disconnect()\n}\n\nexport function observeAttributes(\n nodeOrFn: MaybeElementOrFn,\n options: ObserveAttributeOptions,\n): VoidFunction {\n const {defer} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn\n cleanups.push(observeAttributesImpl(node, options))\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n\nexport interface ObserveChildrenOptions {\n callback: MutationCallback\n defer?: boolean | undefined\n}\n\nfunction observeChildrenImpl(\n node: MaybeElement,\n options: ObserveChildrenOptions,\n) {\n const {callback: fn} = options\n if (!node) {\n return\n }\n const win = node.ownerDocument.defaultView || window\n const obs = new win.MutationObserver(fn)\n obs.observe(node, {childList: true, subtree: true})\n return () => obs.disconnect()\n}\n\nexport function observeChildren(\n nodeOrFn: MaybeElementOrFn,\n options: ObserveChildrenOptions,\n): VoidFunction {\n const {defer} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof nodeOrFn === \"function\" ? nodeOrFn() : nodeOrFn\n cleanups.push(observeChildrenImpl(node, options))\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isFirefox} from \"./platform\"\nimport {queueBeforeEvent} from \"./raf\"\n\nexport function clickIfLink(el: HTMLAnchorElement): void {\n const click = () => el.click()\n if (isFirefox()) {\n queueBeforeEvent(el, \"keyup\", click)\n } else {\n queueMicrotask(click)\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {\n getDocument,\n getParentNode,\n getWindow,\n isHTMLElement,\n isRootElement,\n isVisualViewport,\n} from \"./node\"\n\nexport type OverflowAncestor = Array<\n VisualViewport | Window | HTMLElement | null\n>\n\nexport function getNearestOverflowAncestor(el: Node): HTMLElement {\n const parentNode = getParentNode(el)\n if (isRootElement(parentNode)) {\n return getDocument(parentNode).body\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode\n }\n return getNearestOverflowAncestor(parentNode)\n}\n\nexport function getOverflowAncestors(\n el: HTMLElement,\n list: OverflowAncestor = [],\n): OverflowAncestor {\n const scrollableAncestor = getNearestOverflowAncestor(el)\n const isBody = scrollableAncestor === el.ownerDocument.body\n const win = getWindow(scrollableAncestor)\n if (isBody) {\n return list.concat(\n win,\n win.visualViewport || [],\n isOverflowElement(scrollableAncestor) ? scrollableAncestor : [],\n )\n }\n return list.concat(\n scrollableAncestor,\n getOverflowAncestors(scrollableAncestor, []),\n )\n}\n\nconst getElementRect = (el: HTMLElement | Window | VisualViewport) => {\n if (isHTMLElement(el)) {\n return el.getBoundingClientRect()\n }\n if (isVisualViewport(el)) {\n return {bottom: el.height, left: 0, right: el.width, top: 0}\n }\n return {bottom: el.innerHeight, left: 0, right: el.innerWidth, top: 0}\n}\n\nexport function isInView(\n el: HTMLElement | Window | VisualViewport,\n ancestor: HTMLElement | Window | VisualViewport,\n): boolean {\n if (!isHTMLElement(el)) {\n return true\n }\n const ancestorRect = getElementRect(ancestor)\n const elRect = el.getBoundingClientRect()\n return (\n elRect.top >= ancestorRect.top &&\n elRect.left >= ancestorRect.left &&\n elRect.bottom <= ancestorRect.bottom &&\n elRect.right <= ancestorRect.right\n )\n}\n\nconst OVERFLOW_RE = /auto|scroll|overlay|hidden|clip/\n\nexport function isOverflowElement(el: HTMLElement): boolean {\n const win = getWindow(el)\n const {display, overflow, overflowX, overflowY} = win.getComputedStyle(el)\n return (\n OVERFLOW_RE.test(overflow + overflowY + overflowX) &&\n ![\"inline\", \"contents\"].includes(display)\n )\n}\n\nexport interface ScrollOptions extends ScrollIntoViewOptions {\n rootEl: HTMLElement | null\n}\n\nfunction isScrollable(el: HTMLElement): boolean {\n return el.scrollHeight > el.clientHeight || el.scrollWidth > el.clientWidth\n}\n\nexport function scrollIntoView(\n el: HTMLElement | null | undefined,\n options?: ScrollOptions,\n): void {\n const {rootEl, ...scrollOptions} = options || {}\n if (!el || !rootEl) {\n return\n }\n if (!isOverflowElement(rootEl) || !isScrollable(rootEl)) {\n return\n }\n el.scrollIntoView(scrollOptions)\n}\n\nexport interface ScrollPosition {\n scrollLeft: number\n scrollTop: number\n}\n\nexport function getScrollPosition(\n element: HTMLElement | Window,\n): ScrollPosition {\n if (isHTMLElement(element)) {\n return {scrollLeft: element.scrollLeft, scrollTop: element.scrollTop}\n }\n return {scrollLeft: element.scrollX, scrollTop: element.scrollY}\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport function clamp(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\nexport function wrap<T>(v: T[], idx: number): T[] {\n return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length])\n}\n\nexport function pipe<T>(...fns: Array<(arg: T) => T>): (arg: T) => T {\n return (arg: T) => fns.reduce((acc, fn) => fn(acc), arg)\n}\n\nexport const MAX_Z_INDEX = 2147483647\n\nexport function sanitize(str: string): string {\n return str\n .split(\"\")\n .map((char) => {\n const code = char.charCodeAt(0)\n if (code > 0 && code < 128) {\n return char\n }\n if (code >= 128 && code <= 255) {\n return `/x${code.toString(16)}`.replace(\"/\", \"\\\\\")\n }\n return \"\"\n })\n .join(\"\")\n .trim()\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {clamp} from \"./shared\"\nimport type {Point} from \"./types\"\n\nexport interface PercentValueOptions {\n dir?: \"ltr\" | \"rtl\" | undefined\n inverted?: boolean | {x?: boolean; y?: boolean} | undefined\n orientation?: \"vertical\" | \"horizontal\" | undefined\n}\n\nexport function getRelativePoint(\n point: Point,\n element: HTMLElement,\n): {\n getPercentValue: (options?: PercentValueOptions) => number\n offset: {x: number; y: number}\n percent: {x: number; y: number}\n} {\n const {height, left, top, width} = element.getBoundingClientRect()\n const offset = {x: point.x - left, y: point.y - top}\n const percent = {x: clamp(offset.x / width), y: clamp(offset.y / height)}\n\n function getPercentValue(options: PercentValueOptions = {}): number {\n const {dir = \"ltr\", inverted, orientation = \"horizontal\"} = options\n const invertX = typeof inverted === \"object\" ? inverted.x : inverted\n const invertY = typeof inverted === \"object\" ? inverted.y : inverted\n if (orientation === \"horizontal\") {\n return dir === \"rtl\" || invertX ? 1 - percent.x : percent.x\n }\n return invertY ? 1 - percent.y : percent.y\n }\n return {getPercentValue, offset, percent}\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent} from \"./event\"\n\nexport function requestPointerLock(\n doc: Document,\n fn?: (locked: boolean) => void,\n): VoidFunction | undefined {\n const body = doc.body\n\n const supported =\n \"pointerLockElement\" in doc || \"mozPointerLockElement\" in doc\n const isLocked = () => !!doc.pointerLockElement\n\n function onPointerChange() {\n fn?.(isLocked())\n }\n\n function onPointerError(event: Event) {\n if (isLocked()) {\n fn?.(false)\n }\n console.error(\"PointerLock error occurred:\", event)\n doc.exitPointerLock()\n }\n\n if (!supported) {\n return\n }\n\n try {\n body.requestPointerLock()\n } catch {}\n\n // prettier-ignore\n const cleanup = [\n addDomEvent(doc, \"pointerlockchange\", onPointerChange, false),\n addDomEvent(doc, \"pointerlockerror\", onPointerError, false)\n ]\n\n return () => {\n cleanup.forEach((cleanup) => cleanup())\n doc.exitPointerLock()\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isIos} from \"./platform\"\nimport {nextTick, raf} from \"./raf\"\n\ntype State = \"default\" | \"disabled\" | \"restoring\"\n\nlet state: State = \"default\"\nlet userSelect = \"\"\nconst elementMap = new WeakMap<HTMLElement, string>()\n\nexport interface DisableTextSelectionOptions<T = MaybeElement> {\n defer?: boolean | undefined\n doc?: Document | undefined\n target?: T | undefined\n}\n\nfunction disableTextSelectionImpl(options: DisableTextSelectionOptions = {}) {\n const {doc, target} = options\n\n const docNode = doc ?? document\n const rootEl = docNode.documentElement\n\n if (isIos()) {\n if (state === \"default\") {\n userSelect = rootEl.style.webkitUserSelect\n rootEl.style.webkitUserSelect = \"none\"\n }\n\n state = \"disabled\"\n } else if (target) {\n elementMap.set(target, target.style.userSelect)\n target.style.userSelect = \"none\"\n }\n\n return () => restoreTextSelection({doc: docNode, target})\n}\n\nexport function restoreTextSelection(\n options: DisableTextSelectionOptions = {},\n): void {\n const {doc, target} = options\n\n const docNode = doc ?? document\n const rootEl = docNode.documentElement\n\n if (isIos()) {\n if (state !== \"disabled\") {\n return\n }\n state = \"restoring\"\n\n setTimeout(() => {\n nextTick(() => {\n if (state === \"restoring\") {\n if (rootEl.style.webkitUserSelect === \"none\") {\n rootEl.style.webkitUserSelect = userSelect || \"\"\n }\n userSelect = \"\"\n state = \"default\"\n }\n })\n }, 300)\n } else {\n if (target && elementMap.has(target)) {\n const prevUserSelect = elementMap.get(target)\n\n if (target.style.userSelect === \"none\") {\n target.style.userSelect = prevUserSelect ?? \"\"\n }\n\n if (target.getAttribute(\"style\") === \"\") {\n target.removeAttribute(\"style\")\n }\n elementMap.delete(target)\n }\n }\n}\n\ntype MaybeElement = HTMLElement | null | undefined\n\ntype NodeOrFn = MaybeElement | (() => MaybeElement)\n\nexport function disableTextSelection(\n options: DisableTextSelectionOptions<NodeOrFn> = {},\n): VoidFunction {\n const {defer, target, ...restOptions} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof target === \"function\" ? target() : target\n cleanups.push(disableTextSelectionImpl({...restOptions, target: node}))\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent, getEventPoint} from \"./event\"\nimport {disableTextSelection} from \"./text-selection\"\nimport type {Point} from \"./types\"\n\nexport interface PointerMoveDetails {\n /**\n * The event that triggered the move.\n */\n event: PointerEvent\n /**\n * The current position of the pointer.\n */\n point: Point\n}\n\nexport interface PointerMoveHandlers {\n /**\n * Called when the pointer moves.\n */\n onPointerMove: (details: PointerMoveDetails) => void\n /**\n * Called when the pointer is released.\n */\n onPointerUp: VoidFunction\n}\n\nexport function trackPointerMove(\n doc: Document,\n handlers: PointerMoveHandlers,\n): VoidFunction {\n const {onPointerMove, onPointerUp} = handlers\n\n const handleMove = (event: PointerEvent) => {\n const point = getEventPoint(event)\n\n const distance = Math.sqrt(point.x ** 2 + point.y ** 2)\n const moveBuffer = event.pointerType === \"touch\" ? 10 : 5\n\n if (distance < moveBuffer) {\n return\n }\n\n // Because Safari doesn't trigger mouseup events when it's above a `<select>`\n if (event.pointerType === \"mouse\" && event.button === 0) {\n onPointerUp()\n return\n }\n\n onPointerMove({event, point})\n }\n\n const cleanups = [\n addDomEvent(doc, \"pointermove\", handleMove, false),\n addDomEvent(doc, \"pointerup\", onPointerUp, false),\n addDomEvent(doc, \"pointercancel\", onPointerUp, false),\n addDomEvent(doc, \"contextmenu\", onPointerUp, false),\n disableTextSelection({doc}),\n ]\n\n return (): void => {\n cleanups.forEach((cleanup) => cleanup())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {noop} from \"@qualcomm-ui/utils/functions\"\n\nimport {addDomEvent, getEventPoint, getEventTarget} from \"./event\"\nimport {contains, getDocument, getWindow} from \"./node\"\nimport {pipe} from \"./shared\"\nimport type {Point} from \"./types\"\n\nexport interface PressDetails {\n /**\n * The event that triggered the move.\n */\n event: PointerEvent\n /**\n * The current position of the pointer.\n */\n point: Point\n}\n\nexport interface TrackPressOptions {\n /**\n * A function that determines if the key is valid for the press event.\n */\n isValidKey?(event: KeyboardEvent): boolean\n /**\n * The element that will be used to track the keyboard focus events.\n */\n keyboardNode?: Element | null | undefined\n /**\n * A function that will be called when the pointer is pressed.\n */\n onPress?(details: PressDetails): void\n /**\n * A function that will be called when the pointer is pressed up or cancelled.\n */\n onPressEnd?(details: PressDetails): void\n /**\n * A function that will be called when the pointer is pressed down.\n */\n onPressStart?(details: PressDetails): void\n /**\n * The element that will be used to track the pointer events.\n */\n pointerNode: Element | null\n}\n\nexport function trackPress(options: TrackPressOptions): VoidFunction {\n const {\n isValidKey = (e) => e.key === \"Enter\",\n pointerNode,\n keyboardNode = pointerNode,\n onPress,\n onPressEnd,\n onPressStart,\n } = options\n\n if (!pointerNode) {\n return noop\n }\n\n const win = getWindow(pointerNode)\n const doc = getDocument(pointerNode)\n\n let removeStartListeners: VoidFunction = noop\n let removeEndListeners: VoidFunction = noop\n let removeAccessibleListeners: VoidFunction = noop\n\n const getInfo = (event: PointerEvent): PressDetails => ({\n event,\n point: getEventPoint(event),\n })\n\n function startPress(event: PointerEvent) {\n onPressStart?.(getInfo(event))\n }\n\n function cancelPress(event: PointerEvent) {\n onPressEnd?.(getInfo(event))\n }\n\n const startPointerPress = (startEvent: PointerEvent) => {\n removeEndListeners()\n\n const endPointerPress = (endEvent: PointerEvent) => {\n const target = getEventTarget<Element>(endEvent)\n if (contains(pointerNode, target)) {\n onPress?.(getInfo(endEvent))\n } else {\n onPressEnd?.(getInfo(endEvent))\n }\n }\n\n const removePointerUpListener = addDomEvent(\n win,\n \"pointerup\",\n endPointerPress,\n {once: true, passive: !onPress},\n )\n const removePointerCancelListener = addDomEvent(\n win,\n \"pointercancel\",\n cancelPress,\n {\n once: true,\n passive: !onPressEnd,\n },\n )\n\n removeEndListeners = pipe(\n removePointerUpListener,\n removePointerCancelListener,\n )\n\n if (\n doc.activeElement === keyboardNode &&\n startEvent.pointerType === \"mouse\"\n ) {\n startEvent.preventDefault()\n }\n\n startPress(startEvent)\n }\n\n const removePointerListener = addDomEvent(\n pointerNode,\n \"pointerdown\",\n startPointerPress,\n {passive: !onPressStart},\n )\n const removeFocusListener = addDomEvent(\n keyboardNode,\n \"focus\",\n startAccessiblePress,\n )\n\n removeStartListeners = pipe(removePointerListener, removeFocusListener)\n\n function startAccessiblePress() {\n const handleKeydown = (keydownEvent: KeyboardEvent) => {\n if (!isValidKey(keydownEvent)) {\n return\n }\n\n const handleKeyup = (keyupEvent: KeyboardEvent) => {\n if (!isValidKey(keyupEvent)) {\n return\n }\n const evt = new win.PointerEvent(\"pointerup\")\n const info = getInfo(evt)\n onPress?.(info)\n onPressEnd?.(info)\n }\n\n removeEndListeners()\n removeEndListeners = addDomEvent(keyboardNode, \"keyup\", handleKeyup)\n\n const evt = new win.PointerEvent(\"pointerdown\")\n startPress(evt)\n }\n\n const handleBlur = () => {\n const evt = new win.PointerEvent(\"pointercancel\")\n cancelPress(evt)\n }\n\n const removeKeydownListener = addDomEvent(\n keyboardNode,\n \"keydown\",\n handleKeydown,\n )\n const removeBlurListener = addDomEvent(keyboardNode, \"blur\", handleBlur)\n\n removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener)\n }\n\n return () => {\n removeStartListeners()\n removeEndListeners()\n removeAccessibleListeners()\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent} from \"./event\"\nimport {raf} from \"./raf\"\nimport {getNextTabbable, getTabbableEdges} from \"./tabbable\"\nimport type {MaybeElement, MaybeElementOrFn} from \"./types\"\n\n/**\n *\n * Options that tune the behaviour of {@link proxyTabFocus}.\n *\n * @template T The element type (or getter returning that element) supplied\n * to `triggerElement`.\n */\nexport interface ProxyTabFocusOptions<T = MaybeElement> {\n /**\n * Register the key-down listener during the next animation frame instead of\n * immediately. Enable this when the element(s) involved are not yet present\n * in the DOM at the moment you call `proxyTabFocus`.\n */\n defer?: boolean | undefined\n\n /**\n * Hook that fires right before focus is moved by the proxy logic.\n *\n * When provided, the callback is responsible for moving focus\u2014call\n * `elementToFocus.focus()` yourself.\n * If omitted, `proxyTabFocus` performs `elementToFocus.focus()` automatically.\n */\n onFocus?: ((elementToFocus: HTMLElement) => void) | undefined\n\n /**\n * Invoked exactly once, the first time keyboard focus \"enters\" the container\n * via the proxy (i.e. when the user Tabs from `triggerElement` into\n * `container` or Shift-Tabs from the element after `triggerElement`\n * back into `container`).\n */\n onFocusEnter?: VoidFunction | undefined\n\n /**\n * Element that acts as the gateway into/out of the focus-trap area, or a function\n * returning that element.\n *\n * Tab *forward* from `triggerElement` lands on the first tabbable element in the\n * container.\n *\n * Shift-Tab *backward* from the element immediately **after** `triggerElement`\n * lands on the last tabbable element in the container.\n */\n triggerElement?: T | undefined\n}\n\nfunction proxyTabFocusImpl(\n container: MaybeElement,\n options: ProxyTabFocusOptions = {},\n): VoidFunction {\n const {onFocus, onFocusEnter, triggerElement} = options\n\n const doc = container?.ownerDocument || document\n const body = doc.body\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== \"Tab\") {\n return\n }\n\n let elementToFocus: MaybeElement | undefined = null\n\n // get all tabbable elements within the container\n const [firstTabbable, lastTabbable] = getTabbableEdges(container, true)\n const nextTabbableAfterTrigger = getNextTabbable(body, triggerElement)\n\n const noTabbableElements = !firstTabbable && !lastTabbable\n\n // if we're focused on the element after the reference element and the user tabs\n // backwards we want to focus the last tabbable element\n if (event.shiftKey && nextTabbableAfterTrigger === doc.activeElement) {\n onFocusEnter?.()\n elementToFocus = lastTabbable\n }\n // if we're focused on the first tabbable element and the user tabs backwards\n // we want to focus the reference element\n else if (\n event.shiftKey &&\n (doc.activeElement === firstTabbable || noTabbableElements)\n ) {\n elementToFocus = triggerElement\n }\n // if we're focused on the reference element and the user tabs forwards\n // we want to focus the first tabbable element\n else if (!event.shiftKey && doc.activeElement === triggerElement) {\n onFocusEnter?.()\n elementToFocus = firstTabbable\n }\n // if we're focused on the last tabbable element and the user tabs forwards\n // we want to focus the next tabbable element after the reference element\n else if (\n !event.shiftKey &&\n (doc.activeElement === lastTabbable || noTabbableElements)\n ) {\n elementToFocus = nextTabbableAfterTrigger\n }\n\n if (!elementToFocus) {\n return\n }\n\n event.preventDefault()\n\n if (typeof onFocus === \"function\") {\n onFocus(elementToFocus)\n } else {\n elementToFocus.focus()\n }\n }\n\n // listen for the tab key in the capture phase\n return addDomEvent(doc, \"keydown\", onKeyDown, true)\n}\n\n/**\n * Installs keyboard Tab trapping for a DOM subtree.\n *\n * When focus is on `triggerElement` (or inside `container`) and the user\n * presses Tab / Shift + Tab, the handler redirects focus so it never leaves the\n * `container`. The listener is added to the owning document in the *capture*\n * phase and stays active until the cleanup function returned by this call is\n * executed.\n *\n * @template T\n *\n * @returns {VoidFunction} Call this function to remove the `keydown` listener and clean up internal resources.\n */\nexport function proxyTabFocus(\n container: MaybeElementOrFn,\n options: ProxyTabFocusOptions<MaybeElementOrFn>,\n): VoidFunction {\n const {defer, triggerElement, ...restOptions} = options\n const func = defer ? raf : (v: any) => v()\n const cleanups: (VoidFunction | undefined)[] = []\n cleanups.push(\n func(() => {\n const node = typeof container === \"function\" ? container() : container\n const trigger =\n typeof triggerElement === \"function\" ? triggerElement() : triggerElement\n cleanups.push(\n proxyTabFocusImpl(node, {triggerElement: trigger, ...restOptions}),\n )\n }),\n )\n return () => {\n cleanups.forEach((fn) => fn?.())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\ntype Root = Document | Element | null | undefined\n\nexport function queryAll<T extends Element = HTMLElement>(\n root: Root,\n selector: string,\n): T[] {\n return Array.from(root?.querySelectorAll<T>(selector) ?? [])\n}\n\nexport function query<T extends Element = HTMLElement>(\n root: Root,\n selector: string,\n): T | null {\n return root?.querySelector<T>(selector) ?? null\n}\n\nexport type ItemToId<T> = (v: T) => string\n\ninterface Item {\n id: string\n}\n\nexport function defaultItemToId<T extends Item>(v: T): string {\n return v.id\n}\n\nexport function itemById<T extends Item>(\n v: T[],\n id: string,\n itemToId: ItemToId<T> = defaultItemToId,\n): T | undefined {\n return v.find((item) => itemToId(item) === id)\n}\n\nexport function indexOfId<T extends Item>(\n v: T[],\n id: string,\n itemToId: ItemToId<T> = defaultItemToId,\n): number {\n const item = itemById(v, id, itemToId)\n return item ? v.indexOf(item) : -1\n}\n\nexport function nextById<T extends Item>(v: T[], id: string, loop = true): T {\n let idx = indexOfId(v, id)\n idx = loop ? (idx + 1) % v.length : Math.min(idx + 1, v.length - 1)\n return v[idx]\n}\n\nexport function prevById<T extends Item>(\n v: T[],\n id: string,\n loop = true,\n): T | null {\n let idx = indexOfId(v, id)\n if (idx === -1) {\n return loop ? v[v.length - 1] : null\n }\n idx = loop ? (idx - 1 + v.length) % v.length : Math.max(0, idx - 1)\n return v[idx]\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {Scope} from \"@qualcomm-ui/utils/machine\"\n\nimport {getActiveElement, getDocument} from \"./node\"\n\nexport function createScope<T>(\n props: Pick<Scope, \"getRootNode\"> & T,\n): Scope & T {\n const getRootNode = () =>\n (props.getRootNode?.() as Document | ShadowRoot | undefined) ?? document\n const getDoc = () => getDocument(getRootNode())\n const getWin = () => getDoc().defaultView ?? window\n const getActiveElementFn = () => getActiveElement(getRootNode())\n const isActiveElement = (elem: HTMLElement | null) =>\n elem === getActiveElementFn()\n const getById = <T extends Element = HTMLElement>(id: string) =>\n getRootNode().getElementById(id) as T | null\n\n const dom = {\n getActiveElement: getActiveElementFn,\n getById,\n getDoc,\n getRootNode,\n getWin,\n isActiveElement,\n }\n\n return {...props, ...dom}\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {defaultItemToId, indexOfId, type ItemToId} from \"./query\"\nimport {sanitize, wrap} from \"./shared\"\n\nfunction getValueText<T extends SearchableItem>(el: T): string {\n return sanitize(el.dataset?.valuetext ?? el.textContent ?? \"\")\n}\n\nfunction match(valueText: string, query: string): boolean {\n return valueText.trim().toLowerCase().startsWith(query.toLowerCase())\n}\n\nexport interface SearchableItem {\n dataset?: any\n id: string\n textContent: string | null\n}\n\nexport function getByText<T extends SearchableItem>(\n v: T[],\n text: string,\n currentId?: string | null,\n itemToId: ItemToId<T> = defaultItemToId,\n): T | undefined {\n const index = currentId ? indexOfId(v, currentId, itemToId) : -1\n let items = currentId ? wrap(v, index) : v\n const isSingleKey = text.length === 1\n if (isSingleKey) {\n items = items.filter((item) => itemToId(item) !== currentId)\n }\n return items.find((item) => match(getValueText(item), text))\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nconst cleanups = new WeakMap<Element, Map<string, () => void>>()\n\nfunction set(\n element: Element,\n key: string,\n setup: () => () => void,\n): VoidFunction {\n if (!cleanups.has(element)) {\n cleanups.set(element, new Map())\n }\n\n const elementCleanups = cleanups.get(element)\n const prevCleanup = elementCleanups?.get(key)\n\n if (!prevCleanup) {\n elementCleanups?.set(key, setup())\n return () => {\n elementCleanups?.get(key)?.()\n elementCleanups?.delete(key)\n }\n }\n\n const cleanup = setup()\n\n const nextCleanup = () => {\n cleanup()\n prevCleanup()\n elementCleanups?.delete(key)\n }\n\n elementCleanups?.set(key, nextCleanup)\n\n return () => {\n const isCurrent = elementCleanups?.get(key) === nextCleanup\n if (!isCurrent) {\n return\n }\n cleanup()\n elementCleanups.set(key, prevCleanup)\n }\n}\n\nexport function setAttribute(\n element: Element,\n attr: string,\n value: string,\n): VoidFunction {\n const setup = () => {\n const previousValue = element.getAttribute(attr)\n element.setAttribute(attr, value)\n return () => {\n if (previousValue == null) {\n element.removeAttribute(attr)\n } else {\n element.setAttribute(attr, previousValue)\n }\n }\n }\n\n return set(element, attr, setup)\n}\n\nexport function setProperty<T extends Element, K extends keyof T & string>(\n element: T,\n property: K,\n value: T[K],\n): VoidFunction {\n const setup = () => {\n const exists = property in element\n const previousValue = element[property]\n element[property] = value\n return () => {\n if (!exists) {\n delete element[property]\n } else {\n element[property] = previousValue\n }\n }\n }\n\n return set(element, property, setup)\n}\n\nexport function setStyle(\n element: HTMLElement | null | undefined,\n style: Partial<CSSStyleDeclaration>,\n): VoidFunction {\n if (!element) {\n return () => {}\n }\n\n const setup = () => {\n const prevStyle = element.style.cssText\n Object.assign(element.style, style)\n return () => {\n element.style.cssText = prevStyle\n }\n }\n\n return set(element, \"style\", setup)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport type {ItemToId} from \"./query\"\nimport {getByText, type SearchableItem} from \"./searchable\"\n\nexport interface TypeaheadState {\n keysSoFar: string\n timer: number\n}\n\nexport interface TypeaheadOptions<T> {\n activeId: string | null\n itemToId?: ItemToId<T> | undefined\n key: string\n state: TypeaheadState\n timeout?: number | undefined\n}\n\nfunction getByTypeaheadImpl<T extends SearchableItem>(\n baseItems: T[],\n options: TypeaheadOptions<T>,\n): T | undefined {\n const {activeId, itemToId, key, state, timeout = 350} = options\n\n const search = state.keysSoFar + key\n const isRepeated =\n search.length > 1 && Array.from(search).every((char) => char === search[0])\n\n const query = isRepeated ? search[0] : search\n\n const items = baseItems.slice()\n\n const next = getByText(items, query, activeId, itemToId)\n\n function cleanup() {\n clearTimeout(state.timer)\n state.timer = -1\n }\n\n function update(value: string) {\n state.keysSoFar = value\n cleanup()\n\n if (value !== \"\") {\n state.timer = +setTimeout(() => {\n update(\"\")\n cleanup()\n }, timeout)\n }\n }\n\n update(search)\n\n return next\n}\n\nexport const getByTypeahead: typeof getByTypeaheadImpl & {\n defaultOptions: {\n keysSoFar: string\n timer: number\n }\n isValidEvent: typeof isValidTypeaheadEvent\n} = /* #__PURE__ */ Object.assign(getByTypeaheadImpl, {\n defaultOptions: {keysSoFar: \"\", timer: -1},\n isValidEvent: isValidTypeaheadEvent,\n})\n\nfunction isValidTypeaheadEvent(\n event: Pick<KeyboardEvent, \"key\" | \"ctrlKey\" | \"metaKey\">,\n): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {addDomEvent} from \"./event\"\n\nexport interface ViewportSize {\n height: number\n width: number\n}\n\nexport function trackVisualViewport(\n doc: Document,\n fn: (data: ViewportSize) => void,\n): VoidFunction {\n const win = doc?.defaultView || window\n const onResize = () => {\n fn?.(getViewportSize(win))\n }\n onResize()\n return addDomEvent(win.visualViewport ?? win, \"resize\", onResize)\n}\n\nfunction getViewportSize(win: Window): ViewportSize {\n return {\n height: win.visualViewport?.height || win.innerHeight,\n width: win.visualViewport?.width || win.innerWidth,\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nexport const visuallyHiddenStyle = {\n border: \"0\",\n clip: \"rect(0 0 0 0)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: \"0\",\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n wordWrap: \"normal\",\n} as const\n\nexport function setVisuallyHidden(el: HTMLElement): void {\n Object.assign(el.style, visuallyHiddenStyle)\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\nimport {isHTMLElement} from \"./node\"\n\ntype ElementGetter = () => Element | null\n\nconst fps = 1000 / 60\n\nexport function waitForElement(\n query: ElementGetter,\n cb: (el: HTMLElement) => void,\n): VoidFunction {\n const el = query()\n if (isHTMLElement(el) && el.isConnected) {\n cb(el)\n return () => void 0\n } else {\n const timerId = setInterval(() => {\n const el = query()\n if (isHTMLElement(el) && el.isConnected) {\n cb(el)\n clearInterval(timerId)\n }\n }, fps)\n return () => clearInterval(timerId)\n }\n}\n\nexport function waitForElements(\n queries: ElementGetter[],\n cb: (el: HTMLElement) => void,\n): VoidFunction {\n const cleanups: VoidFunction[] = []\n queries?.forEach((query) => {\n const clean = waitForElement(query, cb)\n cleanups.push(clean)\n })\n return () => {\n cleanups.forEach((fn) => fn())\n }\n}\n", "// Modified from https://github.com/chakra-ui/zag\n// MIT License\n// Changes from Qualcomm Technologies, Inc. are provided under the following license:\n// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n// SPDX-License-Identifier: BSD-3-Clause-Clear\n\n/**\n * Credit: Huge props to the team at Adobe for inspiring this implementation.\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocusVisible.ts\n */\n\nimport {\n getDocument,\n getEventTarget,\n getWindow,\n isMac,\n} from \"@qualcomm-ui/dom/query\"\n\nfunction isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n if ((event as any).mozInputSource === 0 && event.isTrusted) {\n return true\n }\n return event.detail === 0 && !(event as PointerEvent).pointerType\n}\n\nfunction isValidKey(e: KeyboardEvent) {\n return !(\n e.metaKey ||\n (!isMac() && e.altKey) ||\n e.ctrlKey ||\n e.key === \"Control\" ||\n e.key === \"Shift\" ||\n e.key === \"Meta\"\n )\n}\n\nconst nonTextInputTypes = new Set([\n \"checkbox\",\n \"radio\",\n \"range\",\n \"color\",\n \"file\",\n \"image\",\n \"button\",\n \"submit\",\n \"reset\",\n])\n\nfunction isKeyboardFocusEvent(\n isTextInput: boolean,\n modality: Modality,\n e: HandlerEvent,\n) {\n const target = e ? getEventTarget<Element>(e) : null\n const win = getWindow(target)\n\n isTextInput =\n isTextInput ||\n (target instanceof win.HTMLInputElement &&\n !nonTextInputTypes.has(target?.type)) ||\n target instanceof win.HTMLTextAreaElement ||\n (target instanceof win.HTMLElement && target.isContentEditable)\n\n return !(\n isTextInput &&\n modality === \"keyboard\" &&\n e instanceof win.KeyboardEvent &&\n !Reflect.has(FOCUS_VISIBLE_INPUT_KEYS, e.key)\n )\n}\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nexport type Modality = \"keyboard\" | \"pointer\" | \"virtual\"\n\ntype RootNode = Document | ShadowRoot | Node\n\ntype HandlerEvent =\n | PointerEvent\n | MouseEvent\n | KeyboardEvent\n | FocusEvent\n | null\n\ntype Handler = (modality: Modality, e: HandlerEvent) => void\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nlet currentModality: Modality | null = null\n\nconst changeHandlers = new Set<Handler>()\n\ninterface GlobalListenerData {\n focus: VoidFunction\n}\n\nexport const listenerMap: Map<Window, GlobalListenerData> = new Map<\n Window,\n GlobalListenerData\n>()\n\nlet hasEventBeforeFocus = false\nlet hasBlurredWindowRecently = false\n\n// Only Tab or Esc keys will make focus visible on text input elements\nconst FOCUS_VISIBLE_INPUT_KEYS = {\n Escape: true,\n Tab: true,\n}\n\nfunction triggerChangeHandlers(modality: Modality, e: HandlerEvent) {\n for (const handler of changeHandlers) {\n handler(modality, e)\n }\n}\n\nfunction handleKeyboardEvent(e: KeyboardEvent) {\n hasEventBeforeFocus = true\n if (isValidKey(e)) {\n currentModality = \"keyboard\"\n triggerChangeHandlers(\"keyboard\", e)\n }\n}\n\nfunction handlePointerEvent(e: PointerEvent | MouseEvent) {\n currentModality = \"pointer\"\n if (e.type === \"mousedown\" || e.type === \"pointerdown\") {\n hasEventBeforeFocus = true\n triggerChangeHandlers(\"pointer\", e)\n }\n}\n\nfunction handleClickEvent(e: MouseEvent) {\n if (isVirtualClick(e)) {\n hasEventBeforeFocus = true\n currentModality = \"virtual\"\n }\n}\n\nfunction handleFocusEvent(e: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n const target = getEventTarget(e)\n\n if (\n target === getWindow(target as Element) ||\n target === getDocument(target as Element)\n ) {\n return\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch\n // to virtual modality. This occurs, for example, when navigating a form with the\n // next/previous buttons on iOS.\n if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {\n currentModality = \"virtual\"\n triggerChangeHandlers(\"virtual\", e)\n }\n\n hasEventBeforeFocus = false\n hasBlurredWindowRecently = false\n}\n\nfunction handleWindowBlur() {\n // When the window is blurred, reset state. This is necessary when tabbing out of\n // the window, for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false\n hasBlurredWindowRecently = true\n}\n\n/**\n * Setup global event listeners to control when keyboard focus style should be\n * visible.\n */\nfunction setupGlobalFocusEvents(root?: RootNode) {\n if (typeof window === \"undefined\" || listenerMap.get(getWindow(root))) {\n return\n }\n\n const win = getWindow(root)\n const doc = getDocument(root)\n\n const focus = win.HTMLElement.prototype.focus\n win.HTMLElement.prototype.focus = function () {\n // For programmatic focus, we remove the focus visible state to prevent showing\n // focus rings When `options.focusVisible` is supported in most browsers, we can\n // remove this @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#focusvisible\n currentModality = \"virtual\"\n triggerChangeHandlers(\"virtual\", null)\n\n hasEventBeforeFocus = true\n focus.apply(\n this,\n arguments as unknown as [options?: FocusOptions | undefined],\n )\n }\n\n doc.addEventListener(\"keydown\", handleKeyboardEvent, true)\n doc.addEventListener(\"keyup\", handleKeyboardEvent, true)\n doc.addEventListener(\"click\", handleClickEvent, true)\n\n win.addEventListener(\"focus\", handleFocusEvent, true)\n win.addEventListener(\"blur\", handleWindowBlur, false)\n\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.addEventListener(\"pointerdown\", handlePointerEvent, true)\n doc.addEventListener(\"pointermove\", handlePointerEvent, true)\n doc.addEventListener(\"pointerup\", handlePointerEvent, true)\n } else {\n doc.addEventListener(\"mousedown\", handlePointerEvent, true)\n doc.addEventListener(\"mousemove\", handlePointerEvent, true)\n doc.addEventListener(\"mouseup\", handlePointerEvent, true)\n }\n\n // Add unmount handler\n win.addEventListener(\n \"beforeunload\",\n () => {\n tearDownWindowFocusTracking(root)\n },\n {once: true},\n )\n\n listenerMap.set(win, {focus})\n}\n\nconst tearDownWindowFocusTracking = (\n root?: RootNode,\n loadListener?: () => void,\n) => {\n const win = getWindow(root)\n const doc = getDocument(root)\n\n if (loadListener) {\n doc.removeEventListener(\"DOMContentLoaded\", loadListener)\n }\n\n if (!listenerMap.has(win)) {\n return\n }\n\n win.HTMLElement.prototype.focus = listenerMap.get(win)?.focus ?? (() => {})\n\n doc.removeEventListener(\"keydown\", handleKeyboardEvent, true)\n doc.removeEventListener(\"keyup\", handleKeyboardEvent, true)\n doc.removeEventListener(\"click\", handleClickEvent, true)\n win.removeEventListener(\"focus\", handleFocusEvent, true)\n win.removeEventListener(\"blur\", handleWindowBlur, false)\n\n if (typeof win.PointerEvent !== \"undefined\") {\n doc.removeEventListener(\"pointerdown\", handlePointerEvent, true)\n doc.removeEventListener(\"pointermove\", handlePointerEvent, true)\n doc.removeEventListener(\"pointerup\", handlePointerEvent, true)\n } else {\n doc.removeEventListener(\"mousedown\", handlePointerEvent, true)\n doc.removeEventListener(\"mousemove\", handlePointerEvent, true)\n doc.removeEventListener(\"mouseup\", handlePointerEvent, true)\n }\n\n listenerMap.delete(win)\n}\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nexport function getInteractionModality(): Modality | null {\n return currentModality\n}\n\nexport function setInteractionModality(modality: Modality): void {\n currentModality = modality\n triggerChangeHandlers(modality, null)\n}\n\nexport interface InteractionModalityChangeDetails {\n /** The modality of the interaction that caused the focus to be visible. */\n modality: Modality | null\n}\n\nexport interface InteractionModalityProps {\n /** Callback to be called when the interaction modality changes. */\n onChange: (details: InteractionModalityChangeDetails) => void\n /** The root element to track focus visibility for. */\n root?: RootNode | undefined\n}\n\nexport function trackInteractionModality(\n props: InteractionModalityProps,\n): VoidFunction {\n const {onChange, root} = props\n\n setupGlobalFocusEvents(root)\n\n onChange({modality: currentModality})\n\n const handler = () => onChange({modality: currentModality})\n\n changeHandlers.add(handler)\n return () => {\n changeHandlers.delete(handler)\n }\n}\n\n// /\n// //////////////////////////////////////////////////////////////////////////////////////////\n\nexport function isFocusVisible(): boolean {\n return currentModality === \"keyboard\"\n}\n\nexport interface FocusVisibleChangeDetails {\n /** Whether keyboard focus is visible globally. */\n isFocusVisible: boolean\n /** The modality of the interaction that caused the focus to be visible. */\n modality: Modality | null\n}\n\nexport interface FocusVisibleProps {\n /** Whether the element will be auto focused. */\n autoFocus?: boolean | undefined\n /** Whether the element is a text input. */\n isTextInput?: boolean | undefined\n /** Callback to be called when the focus visibility changes. */\n onChange?: ((details: FocusVisibleChangeDetails) => void) | undefined\n /** The root element to track focus visibility for. */\n root?: RootNode | undefined\n}\n\nexport function trackFocusVisible(props: FocusVisibleProps = {}): VoidFunction {\n const {autoFocus, isTextInput, onChange, root} = props\n\n setupGlobalFocusEvents(root)\n\n onChange?.({\n isFocusVisible: autoFocus || isFocusVisible(),\n modality: currentModality,\n })\n\n const handler = (modality: Modality, e: HandlerEvent) => {\n if (!isKeyboardFocusEvent(!!isTextInput, modality, e)) {\n return\n }\n onChange?.({isFocusVisible: isFocusVisible(), modality})\n }\n\n changeHandlers.add(handler)\n\n return () => {\n changeHandlers.delete(handler)\n }\n}\n", "import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useRef } from \"react\";\nimport { HashIcon, TablePropertiesIcon, TextSearchIcon } from \"lucide-react\";\nimport { isFocusVisible } from \"@qualcomm-ui/dom/focus-visible\";\nimport { Icon } from \"@qualcomm-ui/react/icon\";\nimport { HighlightText } from \"@qualcomm-ui/react-core/highlight\";\nimport { useMergedRef } from \"@qualcomm-ui/react-core/refs\";\nimport { PolymorphicElement } from \"@qualcomm-ui/react-core/system\";\nimport { booleanDataAttr } from \"@qualcomm-ui/utils/attributes\";\nimport { clsx } from \"@qualcomm-ui/utils/clsx\";\nfunction getSearchResultIcon(item) {\n if (item.isDocProp) {\n return TablePropertiesIcon;\n }\n if (item.type === \"content\") {\n return TextSearchIcon;\n }\n return HashIcon;\n}\nexport function SearchResultItem(t0) {\n const {\n active,\n className,\n inputValue,\n isChild: t1,\n item,\n ref,\n ...props\n } = t0;\n const isChild = t1 === undefined ? false : t1;\n const rootRef = useRef(null);\n const mergedRef = useMergedRef(ref, rootRef);\n const icon = getSearchResultIcon(item);\n return jsxs(PolymorphicElement, {\n ref: mergedRef,\n as: \"button\",\n className: clsx(\"qui-site-search__list-item\", \"qui-menu-item__root\", className),\n \"data-child\": booleanDataAttr(isChild),\n \"data-focus-visible\": booleanDataAttr(isFocusVisible()),\n \"data-highlighted\": booleanDataAttr(active),\n \"data-type\": item.type,\n ...props,\n children: [icon ? jsx(Icon, {\n className: \"qui-site-search__item-icon\",\n icon,\n size: \"lg\"\n }) : null, jsx(\"div\", {\n className: \"qui-site-search__list-item-content\",\n children: item.type === \"content\" && item.content ? jsxs(Fragment, {\n children: [jsx(\"span\", {\n className: \"qui-site-search__content\",\n children: jsx(HighlightText, {\n ignoreCase: true,\n matchAll: true,\n query: inputValue.length > 1 ? inputValue.split(\" \").at(-1) ?? \"\" : \"\",\n text: item.content.map(_temp).join(\"\")\n })\n }), jsx(\"div\", {\n className: \"qui-site-search__metadata\",\n children: item.heading\n })]\n }) : jsxs(Fragment, {\n children: [jsx(\"span\", {\n className: \"qui-site-search__content\",\n children: item.heading\n }), item.title && jsx(\"div\", {\n className: \"qui-site-search__metadata\",\n children: item.title\n })]\n })\n })]\n });\n}\nfunction _temp(content) {\n return content.content;\n}", "import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useFloating, useInteractions, useListNavigation } from \"@floating-ui/react\";\nimport { SearchIcon } from \"lucide-react\";\nimport { trackFocusVisible } from \"@qualcomm-ui/dom/focus-visible\";\nimport { Dialog } from \"@qualcomm-ui/react/dialog\";\nimport { HeaderBar } from \"@qualcomm-ui/react/header-bar\";\nimport { Kbd } from \"@qualcomm-ui/react/kbd\";\nimport { TextInput } from \"@qualcomm-ui/react/text-input\";\nimport { useDebounce } from \"@qualcomm-ui/react-core/effects\";\nimport { Portal } from \"@qualcomm-ui/react-core/portal\";\nimport { useMdxDocsContext } from \"@qualcomm-ui/react-mdx/context\";\nimport { GroupedResultItem } from \"./grouped-result-item\";\nimport { SearchResultItem } from \"./search-result-item\";\nimport { useGroupedResults } from \"./use-grouped-results\";\nexport function SiteSearch({\n noResults = \"No results found...\"\n}) {\n const [showDialog, setShowDialog] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const dialogInputRef = useRef(null);\n const dialogInputContainerRef = useRef(null);\n const listRef = useRef([]);\n const [activeIndex, setActiveIndex] = useState(null);\n const [isMac, setIsMac] = useState(false);\n const {\n renderLink: Link\n } = useMdxDocsContext();\n useEffect(() => {\n const unsub = trackFocusVisible({\n root: document.documentElement\n });\n return () => {\n unsub();\n };\n }, []);\n const {\n context,\n refs\n } = useFloating({\n open: showDialog\n });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef,\n loop: true,\n onNavigate: index => {\n setActiveIndex(index);\n }\n });\n const debouncedInputValue = useDebounce(inputValue, 100);\n const groupedResults = useGroupedResults(debouncedInputValue);\n const onInputChange = useCallback(value => {\n setInputValue(value);\n }, []);\n useEffect(() => {\n let cleanup;\n async function setup() {\n let isMac2 = false;\n try {\n const UaParser = await import(\"my-ua-parser\").then(m => m.UAParser);\n const userAgent = new UaParser(window.navigator.userAgent);\n const osName = userAgent.getOS().name;\n isMac2 = osName === \"Mac OS\";\n } catch {\n isMac2 = /Mac/i.test(window.navigator.userAgent);\n }\n setIsMac(isMac2);\n function listener(event) {\n if (event.key === \"k\" && (isMac2 && event.metaKey || !isMac2 && event.ctrlKey)) {\n setShowDialog(true);\n event.preventDefault();\n }\n }\n window.addEventListener(\"keydown\", listener);\n cleanup = () => {\n window.removeEventListener(\"keydown\", listener);\n };\n }\n void setup();\n return () => {\n cleanup?.();\n };\n }, []);\n const onListItemKeyDown = useCallback(event_0 => {\n switch (event_0.key) {\n case \"Enter\":\n case \"Space\":\n break;\n case \"Tab\":\n dialogInputRef.current?.focus();\n event_0.preventDefault();\n break;\n case \"ArrowDown\":\n break;\n case \"ArrowUp\":\n break;\n default:\n dialogInputRef.current?.focus?.();\n break;\n }\n }, []);\n const onInputKeyDown = useCallback(event_1 => {\n switch (event_1.key) {\n case \"ArrowDown\":\n event_1.preventDefault();\n listRef.current[0]?.focus();\n break;\n case \"ArrowUp\":\n event_1.preventDefault();\n break;\n }\n }, []);\n const {\n getFloatingProps,\n getItemProps,\n getReferenceProps\n } = useInteractions([listNavigation]);\n return /* @__PURE__ */jsxs(Dialog.Root, {\n onOpenChange: open => {\n setShowDialog(open);\n },\n open: showDialog,\n restoreFocus: false,\n children: [/* @__PURE__ */jsx(Dialog.Trigger, {\n children: /* @__PURE__ */jsxs(\"div\", {\n \"aria-label\": \"Search the documentation\",\n className: \"qui-site-search__trigger\",\n role: \"searchbox\",\n children: [/* @__PURE__ */jsx(HeaderBar.ActionIconButton, {\n \"aria-label\": \"Search\",\n className: \"qui-site-search__mobile-icon-button\",\n icon: SearchIcon\n }), /* @__PURE__ */jsx(TextInput, {\n className: \"qui-site-search__text-input\",\n endIcon: /* @__PURE__ */jsxs(Kbd, {\n children: [/* @__PURE__ */jsx(\"div\", {\n children: isMac ? \"\\u2318\" : \"CTRL\"\n }), /* @__PURE__ */jsx(\"div\", {\n children: \"+\"\n }), /* @__PURE__ */jsx(\"div\", {\n children: \"K\"\n })]\n }),\n inputProps: {\n \"aria-label\": \"Search the docs\"\n },\n onFocus: () => setShowDialog(true),\n placeholder: \"Search the docs\",\n size: \"sm\",\n startIcon: SearchIcon,\n value: \"\"\n })]\n })\n }), /* @__PURE__ */jsxs(Portal, {\n children: [/* @__PURE__ */jsx(Dialog.Backdrop, {\n className: \"qui-site-search__mobile-dialog-backdrop\"\n }), /* @__PURE__ */jsx(Dialog.Positioner, {\n children: /* @__PURE__ */jsx(Dialog.Content, {\n className: \"qui-site-search__mobile-dialog-content\",\n onClick: event_2 => {\n if (!dialogInputContainerRef.current?.contains(event_2.target)) {\n setShowDialog(false);\n }\n },\n style: {\n background: \"transparent\",\n border: 0,\n padding: 0\n },\n children: /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-site-search__mobile-input-wrapper\",\n children: [/* @__PURE__ */jsx(TextInput, {\n ...getReferenceProps({\n onKeyDown: onInputKeyDown\n }),\n ref: dialogInputContainerRef,\n className: \"q-background-2\",\n inputProps: {\n ref: dialogInputRef\n },\n onValueChange: onInputChange,\n placeholder: \"Search the docs\",\n size: \"lg\",\n startIcon: SearchIcon,\n value: inputValue\n }), inputValue.length ? /* @__PURE__ */jsx(\"div\", {\n ref: refs.setFloating,\n ...getFloatingProps(),\n className: \"qui-site-search__floating-panel-mobile\",\n children: groupedResults.length ? /* @__PURE__ */jsx(Fragment, {\n children: groupedResults.map(result => /* @__PURE__ */jsxs(\"div\", {\n className: \"qui-site-search__result-group-wrapper\",\n children: [/* @__PURE__ */jsx(GroupedResultItem, {\n active: result.index === activeIndex,\n render: /* @__PURE__ */jsx(Link, {\n href: result.pathname\n }),\n ...getItemProps({\n onKeyDown: onListItemKeyDown,\n ref: ref => {\n listRef.current[result.index] = ref;\n },\n tabIndex: -1\n }),\n item: result\n }), /* @__PURE__ */jsx(\"div\", {\n className: \"qui-site-search__result-group\",\n children: result.items.map(item => /* @__PURE__ */jsx(SearchResultItem, {\n inputValue,\n ...getItemProps({\n onKeyDown: onListItemKeyDown,\n ref: ref_0 => {\n listRef.current[item.index] = ref_0;\n },\n tabIndex: -1\n }),\n active: item.index === activeIndex,\n isChild: true,\n item,\n render: /* @__PURE__ */jsx(Link, {\n href: item.href\n })\n }, item.id))\n })]\n }, `${result.id}-${result.categoryId}`))\n }) : noResults ? /* @__PURE__ */jsx(\"div\", {\n className: \"qui-site-search__no-results\",\n children: noResults\n }) : null\n }) : null, \" \"]\n })\n })\n })]\n })]\n });\n}", "import { useMemo } from \"react\";\nimport { useSiteContext } from \"@qualcomm-ui/react-mdx/context\";\nimport { useSiteSearch } from \"./use-site-search\";\nexport function useGroupedResults(query) {\n const {\n searchIndex\n } = useSiteContext();\n const search = useSiteSearch(searchIndex);\n return useMemo(() => {\n if (!query.trim()) {\n return [];\n }\n const results = search(query);\n const groups = /* @__PURE__ */new Map();\n const groupOrder = [];\n for (const result of results) {\n const basePath = result.href.split(\"#\")[0];\n const key = `${basePath}::${result.title}`;\n if (!groups.has(key)) {\n groups.set(key, []);\n groupOrder.push(key);\n }\n groups.get(key).push(result);\n }\n let currentIndex = 0;\n const grouped = [];\n for (const key_0 of groupOrder) {\n const items = groups.get(key_0);\n const firstItem = items[0];\n const basePath_0 = firstItem.href.split(\"#\")[0];\n const categoryId = firstItem.categories[0] || \"Other\";\n grouped.push({\n categoryId,\n id: `${basePath_0}-${firstItem.title}`,\n index: currentIndex++,\n items: items.map(item => ({\n ...item,\n index: currentIndex++\n })),\n pathname: basePath_0,\n title: firstItem.title\n });\n }\n return grouped;\n }, [query, search]);\n}", "import { c as _c } from \"react/compiler-runtime\";\nimport { useCallback } from \"react\";\nimport Fuzzysort from \"fuzzysort\";\nimport { formatSearchResults } from \"@qualcomm-ui/mdx-common\";\nexport function doSiteSearch(input, searchIndex) {\n const allResults = formatSearchResults(Fuzzysort.go(input, searchIndex, {\n keys: [\"title\", \"heading\", \"content\"],\n limit: 50,\n threshold: 0.2\n }));\n const pageContentMap = /* @__PURE__ */new Map();\n for (const result of allResults) {\n const basePath = result.href.split(\"#\")[0];\n if (!pageContentMap.has(basePath)) {\n pageContentMap.set(basePath, []);\n }\n pageContentMap.get(basePath).push(result);\n }\n const filtered = [];\n for (const [, pageResults] of pageContentMap) {\n const contentResults = pageResults.filter(r => r.type === \"content\");\n const headingResults = pageResults.filter(r => r.type !== \"content\");\n if (contentResults.length > 0) {\n filtered.push(...contentResults);\n } else {\n filtered.push(headingResults[0]);\n }\n }\n return filtered;\n}\nexport function useSiteSearch(searchIndex) {\n const $ = _c(2);\n let t0;\n if ($[0] !== searchIndex) {\n t0 = input => doSiteSearch(input, searchIndex);\n $[0] = searchIndex;\n $[1] = t0;\n } else {\n t0 = $[1];\n }\n return t0;\n}"],
|
|
5
|
+
"mappings": ";0hBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,eAUC,SAAUC,EAAQC,EAAW,CAE1B,aAOA,IAAIC,EAAc,GACdC,EAAc,IACdC,EAAc,WACdC,EAAc,YACdC,EAAc,SACdC,EAAc,SACdC,EAAc,QACdC,EAAc,QACdC,EAAc,OACdC,EAAc,OACdC,EAAc,SACdC,EAAc,UACdC,EAAc,eACdC,EAAc,UACdC,EAAc,SACdC,EAAc,SACdC,EAAc,UACdC,EAAc,WACdC,EAAc,WACdC,EAAgB,IAEhBC,EAAU,SACVC,EAAU,QACVC,EAAU,OACVC,EAAa,aACbC,EAAU,UACVC,EAAU,SACVC,EAAU,OACVC,EAAU,UACVC,EAAU,SACVC,GAAU,SACVC,GAAU,KACVC,GAAY,YACZC,GAAY,WACZC,EAAU,QACVC,GAAU,UACVC,GAAU,QACVC,GAAU,OACVC,GAAU,SACVC,GAAU,QACVC,GAAc,WACdC,GAAc,cACdC,GAAU,SAMVC,GAAS,SAAUC,EAASC,EAAY,CACpC,IAAIC,EAAgB,CAAC,EACrB,QAASC,KAAKH,EACNC,EAAWE,CAAC,GAAKF,EAAWE,CAAC,EAAE,OAAS,IAAM,EAC9CD,EAAcC,CAAC,EAAIF,EAAWE,CAAC,EAAE,OAAOH,EAAQG,CAAC,CAAC,EAElDD,EAAcC,CAAC,EAAIH,EAAQG,CAAC,EAGpC,OAAOD,CACX,EACAE,GAAY,SAAUC,EAAK,CAEvB,QADIC,EAAQ,CAAC,EACJH,EAAE,EAAGA,EAAEE,EAAI,OAAQF,IACxBG,EAAMD,EAAIF,CAAC,EAAE,YAA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JSMin", "exports", "module", "window", "undefined", "EMPTY", "UNKNOWN", "FUNC_TYPE", "UNDEF_TYPE", "OBJ_TYPE", "STR_TYPE", "MAJOR", "MODEL", "NAME", "TYPE", "VENDOR", "VERSION", "ARCHITECTURE", "CONSOLE", "MOBILE", "TABLET", "SMARTTV", "WEARABLE", "EMBEDDED", "UA_MAX_LENGTH", "AMAZON", "APPLE", "ASUS", "BLACKBERRY", "BROWSER", "CHROME", "EDGE", "FIREFOX", "GOOGLE", "HUAWEI", "LG", "MICROSOFT", "MOTOROLA", "OPERA", "SAMSUNG", "SHARP", "SONY", "XIAOMI", "ZEBRA", "FACEBOOK", "CHROMIUM_OS", "MAC_OS", "extend", "regexes", "extensions", "mergedRegexes", "i", "enumerize", "arr", "enums", "has", "str1", "str2", "lowerize", "str", "majorize", "version", "trim", "len", "rgxMapper", "ua", "arrays", "j", "k", "p", "q", "matches", "match", "regex", "props", "strMapper", "map", "oldSafariMap", "windowsVersionMap", "UAParser", "_navigator", "_ua", "_uach", "_rgxmap", "_isSelfNav", "_browser", "_cpu", "_device", "_engine", "_os", "$", "parser", "result", "prop", "jsx", "jsxs", "FileTextIcon", "isObject", "noop", "ELEMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "isHTMLElement", "el", "isObject", "isDocument", "isWindow", "isNode", "el", "isObject", "isShadowRoot", "DOCUMENT_FRAGMENT_NODE", "getDocument", "el", "isDocument", "isWindow", "getWindow", "el", "isShadowRoot", "isDocument", "isHTMLElement", "isDom", "getPlatform", "pt", "v", "isDom", "getPlatform", "isMac", "pt", "getComposedPath", "event", "getEventTarget", "wrap", "v", "idx", "_", "index", "sanitize", "str", "char", "code", "defaultItemToId", "v", "itemById", "id", "itemToId", "item", "indexOfId", "getValueText", "el", "sanitize", "match", "valueText", "query", "getByText", "v", "text", "currentId", "itemToId", "defaultItemToId", "index", "indexOfId", "items", "wrap", "item", "getByTypeaheadImpl", "baseItems", "options", "activeId", "itemToId", "key", "state", "timeout", "search", "query", "char", "items", "next", "getByText", "cleanup", "update", "value", "getByTypeahead", "isValidTypeaheadEvent", "event", "fps", "isVirtualClick", "event", "isValidKey", "isMac", "nonTextInputTypes", "isKeyboardFocusEvent", "isTextInput", "modality", "e", "target", "getEventTarget", "win", "getWindow", "FOCUS_VISIBLE_INPUT_KEYS", "currentModality", "changeHandlers", "listenerMap", "hasEventBeforeFocus", "hasBlurredWindowRecently", "triggerChangeHandlers", "handler", "handleKeyboardEvent", "handlePointerEvent", "handleClickEvent", "handleFocusEvent", "getDocument", "handleWindowBlur", "setupGlobalFocusEvents", "root", "doc", "focus", "tearDownWindowFocusTracking", "loadListener", "isFocusVisible", "currentModality", "trackFocusVisible", "props", "autoFocus", "isTextInput", "onChange", "root", "setupGlobalFocusEvents", "handler", "modality", "e", "isKeyboardFocusEvent", "changeHandlers", "Icon", "PolymorphicElement", "booleanDataAttr", "clsx", "GroupedResultItem", "active", "className", "item", "ref", "props", "jsxs", "m", "jsx", "FileTextIcon", "Fragment", "jsx", "jsxs", "useRef", "HashIcon", "TablePropertiesIcon", "TextSearchIcon", "Icon", "HighlightText", "useMergedRef", "PolymorphicElement", "booleanDataAttr", "clsx", "getSearchResultIcon", "item", "TablePropertiesIcon", "TextSearchIcon", "HashIcon", "SearchResultItem", "t0", "active", "className", "inputValue", "t1", "ref", "props", "isChild", "rootRef", "useRef", "mergedRef", "icon", "jsxs", "m", "jsx", "Fragment", "_temp", "content", "Fragment", "jsx", "jsxs", "useCallback", "useEffect", "useRef", "useState", "useFloating", "useInteractions", "useListNavigation", "SearchIcon", "Dialog", "HeaderBar", "Kbd", "TextInput", "useDebounce", "Portal", "useMdxDocsContext", "useMemo", "useSiteContext", "_c", "Fuzzysort", "formatSearchResults", "doSiteSearch", "input", "searchIndex", "allResults", "pageContentMap", "result", "basePath", "filtered", "pageResults", "contentResults", "r", "headingResults", "useSiteSearch", "$", "t0", "useGroupedResults", "query", "searchIndex", "useSiteContext", "search", "useSiteSearch", "useMemo", "results", "groups", "groupOrder", "result", "key", "currentIndex", "grouped", "key_0", "items", "firstItem", "basePath_0", "categoryId", "item", "SiteSearch", "noResults", "showDialog", "setShowDialog", "useState", "inputValue", "setInputValue", "dialogInputRef", "useRef", "dialogInputContainerRef", "listRef", "activeIndex", "setActiveIndex", "isMac", "setIsMac", "Link", "useMdxDocsContext", "useEffect", "unsub", "R", "context", "refs", "useFloating", "listNavigation", "useListNavigation", "index", "debouncedInputValue", "useDebounce", "groupedResults", "useGroupedResults", "onInputChange", "useCallback", "value", "cleanup", "setup", "isMac2", "UaParser", "m", "listener", "event", "onListItemKeyDown", "event_0", "onInputKeyDown", "event_1", "getFloatingProps", "getItemProps", "getReferenceProps", "useInteractions", "jsxs", "Dialog", "open", "jsx", "HeaderBar", "SearchIcon", "TextInput", "Kbd", "Portal", "event_2", "Fragment", "result", "GroupedResultItem", "ref", "item", "SearchResultItem", "ref_0"]
|
|
7
7
|
}
|