@qualcomm-ui/react-mdx 1.0.3 → 1.1.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/code-highlight/code-highlight.d.ts +3 -1
- package/dist/code-highlight/code-highlight.d.ts.map +1 -1
- package/dist/code-highlight/index.js +1 -2
- package/dist/code-highlight/index.js.map +3 -3
- package/dist/copy-to-clipboard/copy-to-clipboard-button.d.ts.map +1 -1
- package/dist/copy-to-clipboard/copy-to-clipboard-icon-button.d.ts +3 -2
- package/dist/copy-to-clipboard/copy-to-clipboard-icon-button.d.ts.map +1 -1
- package/dist/copy-to-clipboard/copy-to-clipboard-inline-icon-button.d.ts +7 -0
- package/dist/copy-to-clipboard/copy-to-clipboard-inline-icon-button.d.ts.map +1 -0
- package/dist/copy-to-clipboard/index.d.ts +1 -0
- package/dist/copy-to-clipboard/index.d.ts.map +1 -1
- package/dist/copy-to-clipboard/index.js +1 -1
- package/dist/copy-to-clipboard/index.js.map +4 -4
- package/dist/docs-layout/index.js +1 -1
- package/dist/docs-layout/index.js.map +3 -3
- package/dist/docs-layout/internal/shiki-pre.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/npm-install-tabs/index.js +1 -1
- package/dist/npm-install-tabs/index.js.map +3 -3
- package/dist/npm-install-tabs/npm-install-tabs.d.ts.map +1 -1
- package/dist/shiki/index.js +1 -1
- package/dist/shiki/index.js.map +2 -2
- package/dist/shiki/shiki-highlighter.d.ts.map +1 -1
- package/dist/site-search/index.js +1 -1
- package/dist/site-search/index.js.map +4 -4
- package/dist/site-search/site-search.d.ts.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/dist/typedoc/index.js +1 -1
- package/dist/typedoc/index.js.map +2 -2
- package/package.json +6 -4
package/dist/shiki/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/shiki/shiki-highlighter.tsx", "../../src/shiki/shiki-instance.ts"],
|
|
4
|
-
"sourcesContent": ["import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport QuickLru from \"quick-lru\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { dummyTypeName, shikiHighlighter, supportedLangs } from \"./shiki-instance\";\nconst transformers = [{\n postprocess(html) {\n const index = html.indexOf(dummyTypeName);\n if (index > -1) {\n return html.substring(\n // add 7 characters to account for the trailing </span>\n index + dummyTypeName.length + 7).replace(\">=\", \">\");\n }\n return html;\n }\n}];\nconst shikiCache = new QuickLru({\n maxSize: 1e3\n});\nexport function ShikiHighlighter(t0) {\n const $ = _c(10);\n let t1;\n if ($[0] !== t0) {\n const {\n cache,\n code,\n langAlias,\n language: languageProp,\n shikiConfig,\n ...props\n } = t0;\n let t2;\n if ($[2] !== cache || $[3] !== code || $[4] !== langAlias || $[5] !== languageProp || $[6] !== shikiConfig) {\n bb0: {\n const language = langAlias?.[languageProp ?? \"\"] ?? languageProp;\n const resolvedConfig = {\n ...shikiConfig,\n defaultColor: \"light-dark()\",\n lang: language && supportedLangs.has(language) ? language : \"tsx\",\n structure: \"inline\",\n themes: {\n dark: \"dark\",\n light: \"light\"\n }\n };\n const shouldCache = cache && !resolvedConfig?.grammarState?.getScopes && !resolvedConfig?.grammarState?.getInternalStack && !resolvedConfig?.transformers;\n const cacheKey = shouldCache ? `${code}-${JSON.stringify(resolvedConfig)}` : \"\";\n if (shouldCache) {\n let t3;\n if ($[8] !== cacheKey) {\n t3 = shikiCache.get(cacheKey);\n $[8] = cacheKey;\n $[9] = t3;\n } else {\n t3 = $[9];\n }\n const cached = t3;\n if (cached) {\n t2 = cached;\n break bb0;\n }\n }\n const result = shikiHighlighter.codeToHtml(code, {\n ...resolvedConfig,\n transformers\n });\n if (shouldCache) {\n shikiCache.set(cacheKey, result);\n }\n t2 = result;\n }\n $[2] = cache;\n $[3] = code;\n $[4] = langAlias;\n $[5] = languageProp;\n $[6] = shikiConfig;\n $[7] = t2;\n } else {\n t2 = $[7];\n }\n const highlighted = t2;\n const mergedProps = mergeProps({\n className: \"shiki-code\"\n }, props);\n t1 = jsx(\"pre\", {\n ...mergedProps,\n
|
|
5
|
-
"mappings": "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
|
|
4
|
+
"sourcesContent": ["import { c as _c } from \"react/compiler-runtime\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useMemo } from \"react\";\nimport QuickLru from \"quick-lru\";\nimport { mergeProps } from \"@qualcomm-ui/utils/merge-props\";\nimport { dummyTypeName, shikiHighlighter, supportedLangs } from \"./shiki-instance\";\nconst transformers = [{\n postprocess(html) {\n const index = html.indexOf(dummyTypeName);\n if (index > -1) {\n return html.substring(\n // add 7 characters to account for the trailing </span>\n index + dummyTypeName.length + 7).replace(\">=\", \">\");\n }\n return html;\n }\n}];\nconst shikiCache = new QuickLru({\n maxSize: 1e3\n});\nexport function ShikiHighlighter(t0) {\n const $ = _c(10);\n let t1;\n if ($[0] !== t0) {\n const {\n cache,\n code,\n langAlias,\n language: languageProp,\n shikiConfig,\n ...props\n } = t0;\n let t2;\n if ($[2] !== cache || $[3] !== code || $[4] !== langAlias || $[5] !== languageProp || $[6] !== shikiConfig) {\n bb0: {\n const language = langAlias?.[languageProp ?? \"\"] ?? languageProp;\n const resolvedConfig = {\n ...shikiConfig,\n defaultColor: \"light-dark()\",\n lang: language && supportedLangs.has(language) ? language : \"tsx\",\n structure: \"inline\",\n themes: {\n dark: \"dark\",\n light: \"light\"\n }\n };\n const shouldCache = cache && !resolvedConfig?.grammarState?.getScopes && !resolvedConfig?.grammarState?.getInternalStack && !resolvedConfig?.transformers;\n const cacheKey = shouldCache ? `${code}-${JSON.stringify(resolvedConfig)}` : \"\";\n if (shouldCache) {\n let t3;\n if ($[8] !== cacheKey) {\n t3 = shikiCache.get(cacheKey);\n $[8] = cacheKey;\n $[9] = t3;\n } else {\n t3 = $[9];\n }\n const cached = t3;\n if (cached) {\n t2 = cached;\n break bb0;\n }\n }\n const result = shikiHighlighter.codeToHtml(code, {\n ...resolvedConfig,\n transformers\n });\n if (shouldCache) {\n shikiCache.set(cacheKey, result);\n }\n t2 = result;\n }\n $[2] = cache;\n $[3] = code;\n $[4] = langAlias;\n $[5] = languageProp;\n $[6] = shikiConfig;\n $[7] = t2;\n } else {\n t2 = $[7];\n }\n const highlighted = t2;\n const mergedProps = mergeProps({\n className: \"shiki-code\"\n }, props);\n t1 = jsx(\"pre\", {\n ...mergedProps,\n dangerouslySetInnerHTML: {\n __html: highlighted\n }\n });\n $[0] = t0;\n $[1] = t1;\n } else {\n t1 = $[1];\n }\n return t1;\n}", "import angularHtml from \"@shikijs/langs/angular-html\";\nimport angularTs from \"@shikijs/langs/angular-ts\";\nimport json from \"@shikijs/langs/json\";\nimport shell from \"@shikijs/langs/shell\";\nimport tsx from \"@shikijs/langs/tsx\";\nimport typescript from \"@shikijs/langs/typescript\";\nimport light from \"@shikijs/themes/github-light-high-contrast\";\nimport { createHighlighterCore } from \"react-shiki/core\";\nimport { createJavaScriptRegexEngine } from \"shiki\";\nimport { quiCustomDarkTheme } from \"@qualcomm-ui/mdx-common\";\nconst jsEngine = createJavaScriptRegexEngine({\n forgiving: true\n});\nconst langs = [tsx, typescript, json, shell, angularTs, angularHtml];\nexport const supportedLangs = /* @__PURE__ */new Set([\"tsx\", \"typescript\", \"json\", \"shell\", \"angular-ts\", \"angular-html\"]);\nexport const shikiHighlighter = await createHighlighterCore({\n engine: jsEngine,\n langs,\n themes: [{\n ...quiCustomDarkTheme,\n name: \"dark\"\n }, {\n ...light,\n name: \"light\"\n }]\n});\nexport const dummyTypeName = \"___extra_special_dummy_type_that_will_be_stripped\";\nexport const dummyTypePrefix = `type ${dummyTypeName}=`;"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["_c", "jsx", "QuickLru", "mergeProps", "angularHtml", "angularTs", "json", "shell", "tsx", "typescript", "light", "createHighlighterCore", "createJavaScriptRegexEngine", "quiCustomDarkTheme", "jsEngine", "langs", "supportedLangs", "shikiHighlighter", "dummyTypeName", "dummyTypePrefix", "transformers", "html", "index", "dummyTypeName", "shikiCache", "QuickLru", "ShikiHighlighter", "t0", "$", "_c", "t1", "cache", "code", "langAlias", "languageProp", "shikiConfig", "props", "t2", "bb0", "language", "resolvedConfig", "supportedLangs", "shouldCache", "cacheKey", "t3", "cached", "result", "shikiHighlighter", "highlighted", "mergedProps", "mergeProps", "jsx"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shiki-highlighter.d.ts","sourceRoot":"","sources":["../../src/shiki/shiki-highlighter.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,YAAY,EAAU,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAA;AAKrE,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IACrE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,cAAc,GAAG,MAAM,CAAC,CAAA;CAC1E;AAqBD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,WAAW,EACX,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"shiki-highlighter.d.ts","sourceRoot":"","sources":["../../src/shiki/shiki-highlighter.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,YAAY,EAAU,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAA;AAElD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAA;AAKrE,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IACrE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,cAAc,GAAG,MAAM,CAAC,CAAA;CAC1E;AAqBD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,WAAW,EACX,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG,YAAY,CA+CtC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as F,jsxs as Z}from"react/jsx-runtime";import{FileTextIcon as Kt}from"lucide-react";import{isObject as S}from"@qualcomm-ui/utils/guard";import{noop as be}from"@qualcomm-ui/utils/functions";var dt=1,mt=9,pt=11,ht=t=>S(t)&&t.nodeType===dt&&typeof t.nodeName=="string",U=t=>S(t)&&t.nodeType===mt,gt=t=>S(t)&&t===t.window;var vt=t=>S(t)&&t.nodeType!==void 0,yt=t=>vt(t)&&t.nodeType===pt&&"host"in t;function A(t){return U(t)?t:gt(t)?t.document:t?.ownerDocument??document}function v(t){return yt(t)?v(t.host):U(t)?t.defaultView??window:ht(t)?t.ownerDocument?.defaultView??window:window}function bt(){return typeof document<"u"}function wt(){return navigator.userAgentData?.platform??navigator.platform}function Et(t){return bt()&&t.test(wt())}function W(){return Et(/^Mac/)}function xt(t){return t.composedPath?.()??t.nativeEvent?.composedPath?.()}function P(t){return xt(t)?.[0]??t.target}function kt(t,n){return t.map((e,r)=>t[(Math.max(n,0)+r)%t.length])}function Tt(t){return t.split("").map(n=>{let e=n.charCodeAt(0);return e>0&&e<128?n:e>=128&&e<=255?`/x${e.toString(16)}`.replace("/","\\"):""}).join("").trim()}function R(t){return t.id}function It(t,n,e=R){return t.find(r=>e(r)===n)}function Lt(t,n,e=R){let r=It(t,n,e);return r?t.indexOf(r):-1}function St(t){return Tt(t.dataset?.valuetext??t.textContent??"")}function At(t,n){return t.trim().toLowerCase().startsWith(n.toLowerCase())}function Nt(t,n,e,r=R){let i=e?Lt(t,e,r):-1,o=e?kt(t,i):t;return n.length===1&&(o=o.filter(s=>r(s)!==e)),o.find(s=>At(St(s),n))}function Dt(t,n){let{activeId:e,itemToId:r,key:i,state:o,timeout:s=350}=n,l=o.keysSoFar+i,u=l.length>1&&Array.from(l).every(g=>g===l[0])?l[0]:l,m=t.slice(),c=Nt(m,u,e,r);function p(){clearTimeout(o.timer),o.timer=-1}function E(g){o.keysSoFar=g,p(),g!==""&&(o.timer=+setTimeout(()=>{E(""),p()},s))}return E(l),c}var we=Object.assign(Dt,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:Ct});function Ct(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey}var Ee=1e3/60;function Mt(t){return t.mozInputSource===0&&t.isTrusted?!0:t.detail===0&&!t.pointerType}function Pt(t){return!(t.metaKey||!W()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var Rt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function _t(t,n,e){let r=e?P(e):null,i=v(r);return t=t||r instanceof i.HTMLInputElement&&!Rt.has(r?.type)||r instanceof i.HTMLTextAreaElement||r instanceof i.HTMLElement&&r.isContentEditable,!(t&&n==="keyboard"&&e instanceof i.KeyboardEvent&&!Reflect.has(Vt,e.key))}var b=null,_=new Set,k=new Map,y=!1,V=!1,Vt={Escape:!0,Tab:!0};function D(t,n){for(let e of _)e(t,n)}function N(t){y=!0,Pt(t)&&(b="keyboard",D("keyboard",t))}function d(t){b="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(y=!0,D("pointer",t))}function z(t){Mt(t)&&(y=!0,b="virtual")}function X(t){let n=P(t);n===v(n)||n===A(n)||(!y&&!V&&(b="virtual",D("virtual",t)),y=!1,V=!1)}function G(){y=!1,V=!0}function Ft(t){if(typeof window>"u"||k.get(v(t)))return;let n=v(t),e=A(t),r=n.HTMLElement.prototype.focus;n.HTMLElement.prototype.focus=function(){b="virtual",D("virtual",null),y=!0,r.apply(this,arguments)},e.addEventListener("keydown",N,!0),e.addEventListener("keyup",N,!0),e.addEventListener("click",z,!0),n.addEventListener("focus",X,!0),n.addEventListener("blur",G,!1),typeof n.PointerEvent<"u"?(e.addEventListener("pointerdown",d,!0),e.addEventListener("pointermove",d,!0),e.addEventListener("pointerup",d,!0)):(e.addEventListener("mousedown",d,!0),e.addEventListener("mousemove",d,!0),e.addEventListener("mouseup",d,!0)),n.addEventListener("beforeunload",()=>{qt(t)},{once:!0}),k.set(n,{focus:r})}var qt=(t,n)=>{let e=v(t),r=A(t);n&&r.removeEventListener("DOMContentLoaded",n),k.has(e)&&(e.HTMLElement.prototype.focus=k.get(e)?.focus??(()=>{}),r.removeEventListener("keydown",N,!0),r.removeEventListener("keyup",N,!0),r.removeEventListener("click",z,!0),e.removeEventListener("focus",X,!0),e.removeEventListener("blur",G,!1),typeof e.PointerEvent<"u"?(r.removeEventListener("pointerdown",d,!0),r.removeEventListener("pointermove",d,!0),r.removeEventListener("pointerup",d,!0)):(r.removeEventListener("mousedown",d,!0),r.removeEventListener("mousemove",d,!0),r.removeEventListener("mouseup",d,!0)),k.delete(e))};function x(){return b==="keyboard"}function Y(t={}){let{autoFocus:n,isTextInput:e,onChange:r,root:i}=t;Ft(i),r?.({isFocusVisible:n||x(),modality:b});let o=(s,l)=>{_t(!!e,s,l)&&r?.({isFocusVisible:x(),modality:s})};return _.add(o),()=>{_.delete(o)}}import{Icon as Ht}from"@qualcomm-ui/react/icon";import{PolymorphicElement as Ot}from"@qualcomm-ui/react-core/system";import{booleanDataAttr as J}from"@qualcomm-ui/utils/attributes";import{clsx as Bt}from"@qualcomm-ui/utils/clsx";function Q({active:t,className:n,item:e,ref:r,...i}){return Z(Ot,{ref:r,as:"button",className:Bt("qui-site-search__list-item qui-menu-item__root",n),"data-focus-visible":J(x()),"data-highlighted":J(t),...i,children:[F(Ht,{className:"qui-site-search__item-icon",icon:Kt,size:"lg"}),Z("div",{className:"qui-site-search__list-item-content",children:[F("span",{className:"qui-site-search__content",children:e.title}),F("div",{className:"qui-site-search__metadata",children:e.categoryId})]})]})}import{Fragment as tt,jsx as w,jsxs as q}from"react/jsx-runtime";import{useRef as $t}from"react";import{HashIcon as jt,TablePropertiesIcon as Ut,TextSearchIcon as Wt}from"lucide-react";import{Icon as zt}from"@qualcomm-ui/react/icon";import{HighlightText as Xt}from"@qualcomm-ui/react-core/highlight";import{useMergedRef as Gt}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as Yt}from"@qualcomm-ui/react-core/system";import{booleanDataAttr as K}from"@qualcomm-ui/utils/attributes";import{clsx as Zt}from"@qualcomm-ui/utils/clsx";function Jt(t){return t.isDocProp?Ut:t.type==="content"?Wt:jt}function et(t){let{active:n,className:e,inputValue:r,isChild:i,item:o,ref:s,...l}=t,u=i===void 0?!1:i,m=$t(null),c=Gt(s,m),p=Jt(o);return q(Yt,{ref:c,as:"button",className:Zt("qui-site-search__list-item","qui-menu-item__root",e),"data-child":K(u),"data-focus-visible":K(x()),"data-highlighted":K(n),"data-type":o.type,...l,children:[p?w(zt,{className:"qui-site-search__item-icon",icon:p,size:"lg"}):null,w("div",{className:"qui-site-search__list-item-content",children:o.type==="content"&&o.content?q(tt,{children:[w("span",{className:"qui-site-search__content",children:w(Xt,{ignoreCase:!0,matchAll:!0,query:r.split(" ").at(-1)??"",text:o.content.map(Qt).join("")})}),w("div",{className:"qui-site-search__metadata",children:o.heading})]}):q(tt,{children:[w("span",{className:"qui-site-search__content",children:o.heading}),o.title&&w("div",{className:"qui-site-search__metadata",children:o.title})]})})]})}function Qt(t){return t.content}import{Fragment as ae,jsx as f,jsxs as C}from"react/jsx-runtime";import{useCallback as H,useEffect as ot,useRef as M,useState as O}from"react";import{useFloating as se,useInteractions as le,useListNavigation as ue}from"@floating-ui/react";import{SearchIcon as it}from"lucide-react";import{getSelectorsByUserAgent as ce,OsTypes as fe}from"react-device-detect";import{Dialog as T}from"@qualcomm-ui/react/dialog";import{HeaderBar as de}from"@qualcomm-ui/react/header-bar";import{TextInput as me}from"@qualcomm-ui/react/text-input";import{useDebounce as pe}from"@qualcomm-ui/react-core/effects";import{Portal as he}from"@qualcomm-ui/react-core/portal";import{useMdxDocsContext as ge}from"@qualcomm-ui/react-mdx/context";import{useMemo as oe}from"react";import{useSiteContext as ie}from"@qualcomm-ui/react-mdx/context";import{c as te}from"react/compiler-runtime";import"react";import ee from"fuzzysort";import{formatSearchResults as ne}from"@qualcomm-ui/mdx-common";function re(t,n){let e=ne(ee.go(t,n,{keys:["title","heading","content"],limit:50,threshold:.2})),r=new Map;for(let o of e){let s=o.href.split("#")[0];r.has(s)||r.set(s,[]),r.get(s).push(o)}let i=[];for(let[,o]of r){let s=o.filter(u=>u.type==="content"),l=o.filter(u=>u.type!=="content");s.length>0?i.push(...s):i.push(l[0])}return i}function nt(t){let n=te(2),e;return n[0]!==t?(e=r=>re(r,t),n[0]=t,n[1]=e):e=n[1],e}function rt(t){let{searchIndex:n}=ie(),e=nt(n);return oe(()=>{if(!t.trim())return[];let r=e(t),i=new Map,o=[];for(let u of r){let c=`${u.href.split("#")[0]}::${u.title}`;i.has(c)||(i.set(c,[]),o.push(c)),i.get(c).push(u)}let s=0,l=[];for(let u of o){let m=i.get(u),c=m[0],p=c.href.split("#")[0],E=c.categories[0]||"Other";l.push({categoryId:E,id:`${p}-${c.title}`,index:s++,items:m.map(g=>({...g,index:s++})),pathname:p,title:c.title})}return l},[t,e])}function gn({noResults:t="No results found..."}){let[n,e]=O(!1),[r,i]=O(""),o=M(null),s=M(null),l=M(null),u=M([]),[m,c]=O(null),{renderLink:p}=ge();ot(()=>{let a=Y({root:document.documentElement});return()=>{a()}},[]);let{context:E,refs:g}=se({open:n}),at=ue(E,{activeIndex:m,listRef:u,loop:!0,onNavigate:a=>{c(a)}}),st=pe(r,100),B=rt(st),lt=H(a=>{i(a)},[]);ot(()=>{let{osName:a}=ce(window.navigator.userAgent),h=a===fe.MAC_OS;function I(L){L.key==="k"&&(h&&L.metaKey||!h&&L.ctrlKey)&&(o.current?.focus(),L.preventDefault())}return window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I)}},[n]);let $=H(a=>{switch(a.key){case"Enter":case"Space":break;case"Tab":s.current?.focus(),a.preventDefault();break;case"ArrowDown":break;case"ArrowUp":break;default:s.current?.focus?.();break}},[]),ut=H(a=>{switch(a.key){case"ArrowDown":a.preventDefault(),u.current[0]?.focus();break;case"ArrowUp":a.preventDefault();break}},[]),{getFloatingProps:ct,getItemProps:j,getReferenceProps:ft}=le([at]);return C(T.Root,{onOpenChange:a=>{e(a)},open:n,restoreFocus:!1,children:[f(T.Trigger,{children:f("div",{"aria-label":"Search the documentation",className:"qui-site-search__mobile-icon",role:"searchbox",children:f(de.ActionIconButton,{"aria-label":"Search",icon:it})})}),C(he,{children:[f(T.Backdrop,{className:"qui-site-search__mobile-dialog-backdrop"}),f(T.Positioner,{children:f(T.Content,{className:"qui-site-search__mobile-dialog-content",onClick:a=>{l.current?.contains(a.target)||e(!1)},style:{background:"transparent",border:0,padding:0},children:C("div",{className:"qui-site-search__mobile-input-wrapper",children:[f(me,{...ft({onKeyDown:ut}),ref:l,className:"q-background-2",inputProps:{ref:s},onValueChange:lt,placeholder:"Search the docs",size:"lg",startIcon:it,value:r}),r.length?f("div",{ref:g.setFloating,...ct(),className:"qui-site-search__floating-panel-mobile",children:B.length?f(ae,{children:B.map(a=>C("div",{className:"qui-site-search__result-group-wrapper",children:[f(Q,{active:a.index===m,render:f(p,{href:a.pathname}),...j({onKeyDown:$,ref:h=>{u.current[a.index]=h},tabIndex:-1}),item:a}),f("div",{className:"qui-site-search__result-group",children:a.items.map(h=>f(et,{inputValue:r,...j({onKeyDown:$,ref:I=>{u.current[h.index]=I},tabIndex:-1}),active:h.index===m,isChild:!0,item:h,render:f(p,{href:h.href})},h.id))})]},`${a.id}-${a.categoryId}`))}):t?f("div",{className:"qui-site-search__no-results",children:t}):null}):null," "]})})})]})]})}export{Q as GroupedResultItem,et as SearchResultItem,gn as SiteSearch,re as doSiteSearch,rt as useGroupedResults,nt as useSiteSearch};
|
|
2
|
+
var ot=Object.create;var Fe=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var st=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var ut=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports);var dt=(e,o,s,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let p of st(o))!ct.call(e,p)&&p!==s&&Fe(e,p,{get:()=>o[p],enumerable:!(l=at(o,p))||l.enumerable});return e};var ft=(e,o,s)=>(s=e!=null?ot(lt(e)):{},dt(o||!e||!e.__esModule?Fe(s,"default",{value:e,enumerable:!0}):s,e));var Qe=ut((ee,de)=>{"use strict";(function(e,o){"use strict";var s="",l="?",p="function",u="undefined",v="object",E="string",k="major",i="model",r="name",t="type",n="vendor",a="version",S="architecture",D="console",m="mobile",f="tablet",T="smarttv",R="wearable",W="embedded",$=500,O="Amazon",q="Apple",h="ASUS",_="BlackBerry",A="Browser",V="Chrome",P="Edge",G="Firefox",X="Google",ie="Huawei",me="LG",pe="Microsoft",Le="Motorola",Y="Opera",ne="Samsung",Me="Sharp",re="Sony",be="Xiaomi",he="Zebra",Re="Facebook",Ce="Chromium OS",Pe="Mac OS",it=function(b,g){var d={};for(var y in b)g[y]&&g[y].length%2===0?d[y]=g[y].concat(b[y]):d[y]=b[y];return d},oe=function(b){for(var g={},d=0;d<b.length;d++)g[b[d].toUpperCase()]=b[d];return g},De=function(b,g){return typeof b===E?Z(g).indexOf(Z(b))!==-1:!1},Z=function(b){return b.toLowerCase()},nt=function(b){return typeof b===E?b.replace(/[^\d\.]/g,s).split(".")[0]:o},we=function(b,g){if(typeof b===E)return b=b.replace(/^\s\s*/,s),typeof g===u?b:b.substring(0,$)},J=function(b,g){for(var d=0,y,C,L,w,c,M;d<g.length&&!c;){var ve=g[d],Ve=g[d+1];for(y=C=0;y<ve.length&&!c&&ve[y];)if(c=ve[y++].exec(b),c)for(L=0;L<Ve.length;L++)M=c[++C],w=Ve[L],typeof w===v&&w.length>0?w.length===2?typeof w[1]==p?this[w[0]]=w[1].call(this,M):this[w[0]]=w[1]:w.length===3?typeof w[1]===p&&!(w[1].exec&&w[1].test)?this[w[0]]=M?w[1].call(this,M,w[2]):o:this[w[0]]=M?M.replace(w[1],w[2]):o:w.length===4&&(this[w[0]]=M?w[3].call(this,M.replace(w[1],w[2])):o):this[w]=M||o;d+=2}},ge=function(b,g){for(var d in g)if(typeof g[d]===v&&g[d].length>0){for(var y=0;y<g[d].length;y++)if(De(g[d][y],b))return d===l?o:d}else if(De(g[d],b))return d===l?o:d;return b},rt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Oe={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},qe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[a,[r,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[a,[r,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[r,a],[/opios[\/ ]+([\w\.]+)/i],[a,[r,Y+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[a,[r,Y+" GX"]],[/\bopr\/([\w\.]+)/i],[a,[r,Y]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[a,[r,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(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,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[r,a],[/\bddg\/([\w\.]+)/i],[a,[r,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[a,[r,"UC"+A]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[a,[r,"WeChat"]],[/konqueror\/([\w\.]+)/i],[a,[r,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[a,[r,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[a,[r,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[a,[r,"Smart Lenovo "+A]],[/(avast|avg)\/([\w\.]+)/i],[[r,/(.+)/,"$1 Secure "+A],a],[/\bfocus\/([\w\.]+)/i],[a,[r,G+" Focus"]],[/\bopt\/([\w\.]+)/i],[a,[r,Y+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[a,[r,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[a,[r,"Dolphin"]],[/coast\/([\w\.]+)/i],[a,[r,Y+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[a,[r,"MIUI "+A]],[/fxios\/([-\w\.]+)/i],[a,[r,G]],[/\bqihu|(qi?ho?o?|360)browser/i],[[r,"360 "+A]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[r,/(.+)/,"$1 "+A],a],[/samsungbrowser\/([\w\.]+)/i],[a,[r,ne+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],a],[/metasr[\/ ]?([\d\.]+)/i],[a,[r,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[r,"Sogou Mobile"],a],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[r,a],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[r],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[r,Re],a],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[r,a],[/\bgsa\/([\w\.]+) .*safari\//i],[a,[r,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[a,[r,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[a,[r,V+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[r,V+" WebView"],a],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[a,[r,"Android "+A]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[r,a],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[a,[r,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[a,r],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[r,[a,ge,rt]],[/(webkit|khtml)\/([\w\.]+)/i],[r,a],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[r,"Netscape"],a],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[a,[r,G+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[r,a],[/(cobalt)\/([\w\.]+)/i],[r,[a,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[S,"amd64"]],[/(ia32(?=;))/i],[[S,Z]],[/((?:i[346]|x)86)[;\)]/i],[[S,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[S,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[S,"armhf"]],[/windows (ce|mobile); ppc;/i],[[S,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[S,/ower/,s,Z]],[/(sun4\w)[;\)]/i],[[S,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[S,Z]]],device:[[/\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],[i,[n,ne],[t,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[i,[n,ne],[t,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[i,[n,q],[t,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[i,[n,q],[t,f]],[/(macintosh);/i],[i,[n,q]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[i,[n,Me],[t,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[i,[n,ie],[t,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[i,[n,ie],[t,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[i,/_/g," "],[n,be],[t,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[i,/_/g," "],[n,be],[t,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[i,[n,"OPPO"],[t,m]],[/\b(opd2\d{3}a?) bui/i],[i,[n,"OPPO"],[t,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[i,[n,"Vivo"],[t,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[i,[n,"Realme"],[t,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[i,[n,Le],[t,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[i,[n,Le],[t,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[i,[n,me],[t,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[i,[n,me],[t,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[i,[n,"Lenovo"],[t,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[i,/_/g," "],[n,"Nokia"],[t,m]],[/(pixel c)\b/i],[i,[n,X],[t,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[i,[n,X],[t,m]],[/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],[i,[n,re],[t,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[i,"Xperia Tablet"],[n,re],[t,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[i,[n,"OnePlus"],[t,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[i,[n,O],[t,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[i,/(.+)/g,"Fire Phone $1"],[n,O],[t,m]],[/(playbook);[-\w\),; ]+(rim)/i],[i,n,[t,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[i,[n,_],[t,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[i,[n,h],[t,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[i,[n,h],[t,m]],[/(nexus 9)/i],[i,[n,"HTC"],[t,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[n,[i,/_/g," "],[t,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[i,[n,"Acer"],[t,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[i,[n,"Meizu"],[t,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[i,[n,"Ulefone"],[t,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[n,i,[t,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[n,i,[t,f]],[/(surface duo)/i],[i,[n,pe],[t,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[i,[n,"Fairphone"],[t,m]],[/(u304aa)/i],[i,[n,"AT&T"],[t,m]],[/\bsie-(\w*)/i],[i,[n,"Siemens"],[t,m]],[/\b(rct\w+) b/i],[i,[n,"RCA"],[t,f]],[/\b(venue[\d ]{2,7}) b/i],[i,[n,"Dell"],[t,f]],[/\b(q(?:mv|ta)\w+) b/i],[i,[n,"Verizon"],[t,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[i,[n,"Barnes & Noble"],[t,f]],[/\b(tm\d{3}\w+) b/i],[i,[n,"NuVision"],[t,f]],[/\b(k88) b/i],[i,[n,"ZTE"],[t,f]],[/\b(nx\d{3}j) b/i],[i,[n,"ZTE"],[t,m]],[/\b(gen\d{3}) b.+49h/i],[i,[n,"Swiss"],[t,m]],[/\b(zur\d{3}) b/i],[i,[n,"Swiss"],[t,f]],[/\b((zeki)?tb.*\b) b/i],[i,[n,"Zeki"],[t,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[n,"Dragon Touch"],i,[t,f]],[/\b(ns-?\w{0,9}) b/i],[i,[n,"Insignia"],[t,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[i,[n,"NextBook"],[t,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[n,"Voice"],i,[t,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[n,"LvTel"],i,[t,m]],[/\b(ph-1) /i],[i,[n,"Essential"],[t,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[i,[n,"Envizen"],[t,f]],[/\b(trio[-\w\. ]+) b/i],[i,[n,"MachSpeed"],[t,f]],[/\btu_(1491) b/i],[i,[n,"Rotor"],[t,f]],[/(shield[\w ]+) b/i],[i,[n,"Nvidia"],[t,f]],[/(sprint) (\w+)/i],[n,i,[t,m]],[/(kin\.[onetw]{3})/i],[[i,/\./g," "],[n,pe],[t,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[i,[n,he],[t,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[i,[n,he],[t,m]],[/smart-tv.+(samsung)/i],[n,[t,T]],[/hbbtv.+maple;(\d+)/i],[[i,/^/,"SmartTV"],[n,ne],[t,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[n,me],[t,T]],[/(apple) ?tv/i],[n,[i,q+" TV"],[t,T]],[/crkey/i],[[i,V+"cast"],[n,X],[t,T]],[/droid.+aft(\w+)( bui|\))/i],[i,[n,O],[t,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[i,[n,Me],[t,T]],[/(bravia[\w ]+)( bui|\))/i],[i,[n,re],[t,T]],[/(mitv-\w{5}) bui/i],[i,[n,be],[t,T]],[/Hbbtv.*(technisat) (.*);/i],[n,i,[t,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[n,we],[i,we],[t,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[t,T]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[n,i,[t,D]],[/droid.+; (shield) bui/i],[i,[n,"Nvidia"],[t,D]],[/(playstation [345portablevi]+)/i],[i,[n,re],[t,D]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[i,[n,pe],[t,D]],[/((pebble))app/i],[n,i,[t,R]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[i,[n,q],[t,R]],[/droid.+; (glass) \d/i],[i,[n,X],[t,R]],[/droid.+; (wt63?0{2,3})\)/i],[i,[n,he],[t,R]],[/(quest( \d| pro)?)/i],[i,[n,Re],[t,R]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[n,[t,W]],[/(aeobc)\b/i],[i,[n,O],[t,W]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[i,[t,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[i,[t,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[t,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[t,m]],[/(android[-\w\. ]{0,9});.+buil/i],[i,[n,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[a,[r,P+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[a,[r,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[r,a],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[a,r]],os:[[/microsoft (windows) (vista|xp)/i],[r,a],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[r,[a,ge,Oe]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[a,ge,Oe],[r,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[a,/_/g,"."],[r,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[r,Pe],[a,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[a,r],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[r,a],[/\(bb(10);/i],[a,[r,_]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[a,[r,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[a,[r,G+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[a,[r,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[a,[r,"watchOS"]],[/crkey\/([\d\.]+)/i],[a,[r,V+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[r,Ce],a],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([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,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[r,a],[/(sunos) ?([\w\.\d]*)/i],[[r,"Solaris"],a],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[r,a]]},N=function(b,g){if(typeof b===v&&(g=b,b=o),!(this instanceof N))return new N(b,g).getResult();var d=typeof e!==u&&e.navigator?e.navigator:o,y=b||(d&&d.userAgent?d.userAgent:s),C=d&&d.userAgentData?d.userAgentData:o,L=g?it(qe,g):qe,w=d&&d.userAgent==y;return this.getBrowser=function(){var c={};return c[r]=o,c[a]=o,J.call(c,y,L.browser),c[k]=nt(c[a]),w&&d&&d.brave&&typeof d.brave.isBrave==p&&(c[r]="Brave"),c},this.getCPU=function(){var c={};return c[S]=o,J.call(c,y,L.cpu),c},this.getDevice=function(){var c={};return c[n]=o,c[i]=o,c[t]=o,J.call(c,y,L.device),w&&!c[t]&&C&&C.mobile&&(c[t]=m),w&&c[i]=="Macintosh"&&d&&typeof d.standalone!==u&&d.maxTouchPoints&&d.maxTouchPoints>2&&(c[i]="iPad",c[t]=f),c},this.getEngine=function(){var c={};return c[r]=o,c[a]=o,J.call(c,y,L.engine),c},this.getOS=function(){var c={};return c[r]=o,c[a]=o,J.call(c,y,L.os),w&&!c[r]&&C&&C.platform&&C.platform!="Unknown"&&(c[r]=C.platform.replace(/chrome os/i,Ce).replace(/macos/i,Pe)),c},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(c){return y=typeof c===E&&c.length>$?we(c,$):c,this},this.setUA(y),this};N.BROWSER=oe([r,a,k]),N.CPU=oe([S]),N.DEVICE=oe([i,n,t,D,m,T,f,R,W]),N.ENGINE=N.OS=oe([r,a]),typeof ee!==u?(typeof de!==u&&de.exports&&(ee=de.exports=N),ee.UAParser=N):typeof define===p&&define.amd?define(function(){return N}):typeof e!==u&&(e.UAParser=N);var B=typeof e!==u&&(e.jQuery||e.Zepto);if(B&&!B.ua){var ae=new N;B.ua=ae.getResult(),B.ua.get=function(){return ae.getUA()},B.ua.set=function(b){ae.setUA(b);var g=ae.getResult();for(var d in g)B.ua[d]=g[d]}}})(typeof window=="object"?window:ee)});import{jsx as Te,jsxs as We}from"react/jsx-runtime";import{FileTextIcon as Kt}from"lucide-react";import{isObject as se}from"@qualcomm-ui/utils/guard";import{noop as vi}from"@qualcomm-ui/utils/functions";var mt=1,pt=9,bt=11,ht=e=>se(e)&&e.nodeType===mt&&typeof e.nodeName=="string",Ke=e=>se(e)&&e.nodeType===pt,wt=e=>se(e)&&e===e.window;var gt=e=>se(e)&&e.nodeType!==void 0,vt=e=>gt(e)&&e.nodeType===bt&&"host"in e;function le(e){return Ke(e)?e:wt(e)?e.document:e?.ownerDocument??document}function F(e){return vt(e)?F(e.host):Ke(e)?e.defaultView??window:ht(e)?e.ownerDocument?.defaultView??window:window}function yt(){return typeof document<"u"}function Et(){return navigator.userAgentData?.platform??navigator.platform}function kt(e){return yt()&&e.test(Et())}function Ue(){return kt(/^Mac/)}function xt(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function ye(e){return xt(e)?.[0]??e.target}function Tt(e,o){return e.map((s,l)=>e[(Math.max(o,0)+l)%e.length])}function At(e){return e.split("").map(o=>{let s=o.charCodeAt(0);return s>0&&s<128?o:s>=128&&s<=255?`/x${s.toString(16)}`.replace("/","\\"):""}).join("").trim()}function Ee(e){return e.id}function St(e,o,s=Ee){return e.find(l=>s(l)===o)}function _t(e,o,s=Ee){let l=St(e,o,s);return l?e.indexOf(l):-1}function Nt(e){return At(e.dataset?.valuetext??e.textContent??"")}function It(e,o){return e.trim().toLowerCase().startsWith(o.toLowerCase())}function Lt(e,o,s,l=Ee){let p=s?_t(e,s,l):-1,u=s?Tt(e,p):e;return o.length===1&&(u=u.filter(v=>l(v)!==s)),u.find(v=>It(Nt(v),o))}function Mt(e,o){let{activeId:s,itemToId:l,key:p,state:u,timeout:v=350}=o,E=u.keysSoFar+p,k=E.length>1&&Array.from(E).every(a=>a===E[0])?E[0]:E,i=e.slice(),r=Lt(i,k,s,l);function t(){clearTimeout(u.timer),u.timer=-1}function n(a){u.keysSoFar=a,t(),a!==""&&(u.timer=+setTimeout(()=>{n(""),t()},v))}return n(E),r}var yi=Object.assign(Mt,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:Rt});function Rt(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Ei=1e3/60;function Ct(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Pt(e){return!(e.metaKey||!Ue()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var Dt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ot(e,o,s){let l=s?ye(s):null,p=F(l);return e=e||l instanceof p.HTMLInputElement&&!Dt.has(l?.type)||l instanceof p.HTMLTextAreaElement||l instanceof p.HTMLElement&&l.isContentEditable,!(e&&o==="keyboard"&&s instanceof p.KeyboardEvent&&!Reflect.has(qt,s.key))}var U=null,ke=new Set,Q=new Map,K=!1,xe=!1,qt={Escape:!0,Tab:!0};function ue(e,o){for(let s of ke)s(e,o)}function ce(e){K=!0,Pt(e)&&(U="keyboard",ue("keyboard",e))}function I(e){U="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(K=!0,ue("pointer",e))}function ze(e){Ct(e)&&(K=!0,U="virtual")}function Be(e){let o=ye(e);o===F(o)||o===le(o)||(!K&&!xe&&(U="virtual",ue("virtual",e)),K=!1,xe=!1)}function He(){K=!1,xe=!0}function Vt(e){if(typeof window>"u"||Q.get(F(e)))return;let o=F(e),s=le(e),l=o.HTMLElement.prototype.focus;o.HTMLElement.prototype.focus=function(){U="virtual",ue("virtual",null),K=!0,l.apply(this,arguments)},s.addEventListener("keydown",ce,!0),s.addEventListener("keyup",ce,!0),s.addEventListener("click",ze,!0),o.addEventListener("focus",Be,!0),o.addEventListener("blur",He,!1),typeof o.PointerEvent<"u"?(s.addEventListener("pointerdown",I,!0),s.addEventListener("pointermove",I,!0),s.addEventListener("pointerup",I,!0)):(s.addEventListener("mousedown",I,!0),s.addEventListener("mousemove",I,!0),s.addEventListener("mouseup",I,!0)),o.addEventListener("beforeunload",()=>{Ft(e)},{once:!0}),Q.set(o,{focus:l})}var Ft=(e,o)=>{let s=F(e),l=le(e);o&&l.removeEventListener("DOMContentLoaded",o),Q.has(s)&&(s.HTMLElement.prototype.focus=Q.get(s)?.focus??(()=>{}),l.removeEventListener("keydown",ce,!0),l.removeEventListener("keyup",ce,!0),l.removeEventListener("click",ze,!0),s.removeEventListener("focus",Be,!0),s.removeEventListener("blur",He,!1),typeof s.PointerEvent<"u"?(l.removeEventListener("pointerdown",I,!0),l.removeEventListener("pointermove",I,!0),l.removeEventListener("pointerup",I,!0)):(l.removeEventListener("mousedown",I,!0),l.removeEventListener("mousemove",I,!0),l.removeEventListener("mouseup",I,!0)),Q.delete(s))};function H(){return U==="keyboard"}function je(e={}){let{autoFocus:o,isTextInput:s,onChange:l,root:p}=e;Vt(p),l?.({isFocusVisible:o||H(),modality:U});let u=(v,E)=>{Ot(!!s,v,E)&&l?.({isFocusVisible:H(),modality:v})};return ke.add(u),()=>{ke.delete(u)}}import{Icon as Ut}from"@qualcomm-ui/react/icon";import{PolymorphicElement as zt}from"@qualcomm-ui/react-core/system";import{booleanDataAttr as $e}from"@qualcomm-ui/utils/attributes";import{clsx as Bt}from"@qualcomm-ui/utils/clsx";function Ge({active:e,className:o,item:s,ref:l,...p}){return We(zt,{ref:l,as:"button",className:Bt("qui-site-search__list-item qui-menu-item__root",o),"data-focus-visible":$e(H()),"data-highlighted":$e(e),...p,children:[Te(Ut,{className:"qui-site-search__item-icon",icon:Kt,size:"lg"}),We("div",{className:"qui-site-search__list-item-content",children:[Te("span",{className:"qui-site-search__content",children:s.title}),Te("div",{className:"qui-site-search__metadata",children:s.categoryId})]})]})}import{Fragment as Xe,jsx as z,jsxs as Ae}from"react/jsx-runtime";import{useRef as Ht}from"react";import{HashIcon as jt,TablePropertiesIcon as Wt,TextSearchIcon as $t}from"lucide-react";import{Icon as Gt}from"@qualcomm-ui/react/icon";import{HighlightText as Xt}from"@qualcomm-ui/react-core/highlight";import{useMergedRef as Yt}from"@qualcomm-ui/react-core/refs";import{PolymorphicElement as Zt}from"@qualcomm-ui/react-core/system";import{booleanDataAttr as Se}from"@qualcomm-ui/utils/attributes";import{clsx as Jt}from"@qualcomm-ui/utils/clsx";function Qt(e){return e.isDocProp?Wt:e.type==="content"?$t:jt}function Ye(e){let{active:o,className:s,inputValue:l,isChild:p,item:u,ref:v,...E}=e,k=p===void 0?!1:p,i=Ht(null),r=Yt(v,i),t=Qt(u);return Ae(Zt,{ref:r,as:"button",className:Jt("qui-site-search__list-item","qui-menu-item__root",s),"data-child":Se(k),"data-focus-visible":Se(H()),"data-highlighted":Se(o),"data-type":u.type,...E,children:[t?z(Gt,{className:"qui-site-search__item-icon",icon:t,size:"lg"}):null,z("div",{className:"qui-site-search__list-item-content",children:u.type==="content"&&u.content?Ae(Xe,{children:[z("span",{className:"qui-site-search__content",children:z(Xt,{ignoreCase:!0,matchAll:!0,query:l.split(" ").at(-1)??"",text:u.content.map(ei).join("")})}),z("div",{className:"qui-site-search__metadata",children:u.heading})]}):Ae(Xe,{children:[z("span",{className:"qui-site-search__content",children:u.heading}),u.title&&z("div",{className:"qui-site-search__metadata",children:u.title})]})})]})}function ei(e){return e.content}import{Fragment as si,jsx as x,jsxs as j}from"react/jsx-runtime";import{useCallback as _e,useEffect as et,useRef as Ne,useState as fe}from"react";import{useFloating as li,useInteractions as ci,useListNavigation as ui}from"@floating-ui/react";import{SearchIcon as Ie}from"lucide-react";import{Dialog as te}from"@qualcomm-ui/react/dialog";import{HeaderBar as di}from"@qualcomm-ui/react/header-bar";import{Kbd as fi}from"@qualcomm-ui/react/kbd";import{TextInput as tt}from"@qualcomm-ui/react/text-input";import{useDebounce as mi}from"@qualcomm-ui/react-core/effects";import{Portal as pi}from"@qualcomm-ui/react-core/portal";import{useMdxDocsContext as bi}from"@qualcomm-ui/react-mdx/context";import{useMemo as oi}from"react";import{useSiteContext as ai}from"@qualcomm-ui/react-mdx/context";import{c as ti}from"react/compiler-runtime";import"react";import ii from"fuzzysort";import{formatSearchResults as ni}from"@qualcomm-ui/mdx-common";function ri(e,o){let s=ni(ii.go(e,o,{keys:["title","heading","content"],limit:50,threshold:.2})),l=new Map;for(let u of s){let v=u.href.split("#")[0];l.has(v)||l.set(v,[]),l.get(v).push(u)}let p=[];for(let[,u]of l){let v=u.filter(k=>k.type==="content"),E=u.filter(k=>k.type!=="content");v.length>0?p.push(...v):p.push(E[0])}return p}function Ze(e){let o=ti(2),s;return o[0]!==e?(s=l=>ri(l,e),o[0]=e,o[1]=s):s=o[1],s}function Je(e){let{searchIndex:o}=ai(),s=Ze(o);return oi(()=>{if(!e.trim())return[];let l=s(e),p=new Map,u=[];for(let k of l){let r=`${k.href.split("#")[0]}::${k.title}`;p.has(r)||(p.set(r,[]),u.push(r)),p.get(r).push(k)}let v=0,E=[];for(let k of u){let i=p.get(k),r=i[0],t=r.href.split("#")[0],n=r.categories[0]||"Other";E.push({categoryId:n,id:`${t}-${r.title}`,index:v++,items:i.map(a=>({...a,index:v++})),pathname:t,title:r.title})}return E},[e,s])}function hn({noResults:e="No results found..."}){let[o,s]=fe(!1),[l,p]=fe(""),u=Ne(null),v=Ne(null),E=Ne([]),[k,i]=fe(null),[r,t]=fe(!1),{renderLink:n}=bi();et(()=>{let h=je({root:document.documentElement});return()=>{h()}},[]);let{context:a,refs:S}=li({open:o}),D=ui(a,{activeIndex:k,listRef:E,loop:!0,onNavigate:h=>{i(h)}}),m=mi(l,100),f=Je(m),T=_e(h=>{p(h)},[]);et(()=>{let h;async function _(){let A=!1;try{let P=await Promise.resolve().then(()=>ft(Qe(),1)).then(ie=>ie.UAParser);A=new P(window.navigator.userAgent).getOS().name==="Mac OS"}catch{A=/Mac/i.test(window.navigator.userAgent)}t(A);function V(P){P.key==="k"&&(A&&P.metaKey||!A&&P.ctrlKey)&&(s(!0),P.preventDefault())}window.addEventListener("keydown",V),h=()=>{window.removeEventListener("keydown",V)}}return _(),()=>{h?.()}},[]);let R=_e(h=>{switch(h.key){case"Enter":case"Space":break;case"Tab":u.current?.focus(),h.preventDefault();break;case"ArrowDown":break;case"ArrowUp":break;default:u.current?.focus?.();break}},[]),W=_e(h=>{switch(h.key){case"ArrowDown":h.preventDefault(),E.current[0]?.focus();break;case"ArrowUp":h.preventDefault();break}},[]),{getFloatingProps:$,getItemProps:O,getReferenceProps:q}=ci([D]);return j(te.Root,{onOpenChange:h=>{s(h)},open:o,restoreFocus:!1,children:[x(te.Trigger,{children:j("div",{"aria-label":"Search the documentation",className:"qui-site-search__trigger",role:"searchbox",children:[x(di.ActionIconButton,{"aria-label":"Search",className:"qui-site-search__mobile-icon-button",icon:Ie}),x(tt,{className:"qui-site-search__text-input",endIcon:j(fi,{children:[x("div",{children:r?"\u2318":"CTRL"}),x("div",{children:"+"}),x("div",{children:"K"})]}),inputProps:{"aria-label":"Search the docs"},placeholder:"Search the docs",size:"sm",startIcon:Ie,value:""})]})}),j(pi,{children:[x(te.Backdrop,{className:"qui-site-search__mobile-dialog-backdrop"}),x(te.Positioner,{children:x(te.Content,{className:"qui-site-search__mobile-dialog-content",onClick:h=>{v.current?.contains(h.target)||s(!1)},style:{background:"transparent",border:0,padding:0},children:j("div",{className:"qui-site-search__mobile-input-wrapper",children:[x(tt,{...q({onKeyDown:W}),ref:v,className:"q-background-2",inputProps:{ref:u},onValueChange:T,placeholder:"Search the docs",size:"lg",startIcon:Ie,value:l}),l.length?x("div",{ref:S.setFloating,...$(),className:"qui-site-search__floating-panel-mobile",children:f.length?x(si,{children:f.map(h=>j("div",{className:"qui-site-search__result-group-wrapper",children:[x(Ge,{active:h.index===k,render:x(n,{href:h.pathname}),...O({onKeyDown:R,ref:_=>{E.current[h.index]=_},tabIndex:-1}),item:h}),x("div",{className:"qui-site-search__result-group",children:h.items.map(_=>x(Ye,{inputValue:l,...O({onKeyDown:R,ref:A=>{E.current[_.index]=A},tabIndex:-1}),active:_.index===k,isChild:!0,item:_,render:x(n,{href:_.href})},_.id))})]},`${h.id}-${h.categoryId}`))}):e?x("div",{className:"qui-site-search__no-results",children:e}):null}):null," "]})})})]})]})}export{Ge as GroupedResultItem,Ye as SearchResultItem,hn as SiteSearch,ri as doSiteSearch,Je as useGroupedResults,Ze as useSiteSearch};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|