Files
relaticle-comments/assets/C4Bgkocn.js
github-actions[bot] d45f686ca6 Deploy 1.x docs
2026-03-27 12:10:39 +00:00

5 lines
74 KiB
JavaScript

import{c as B,t as se,u as Pt,d as ne,w as ge,o as C,a as D,m as H,V as Vt,b as je,e as V,f as Y,F as ae,r as me,i as Ht,g as Nt,h as we,j as jt,k as Wt,l as yt,n as xe,p as K,q as N,s as c,P as ce,v as ee,x as _e,y as Gt,z as We,A as bt,B as X,C as ve,D as Ge,E as Ut,G as Yt,H as Xt,I as xt,J as At,K as Qt,L as Jt,M as Je,N as Zt,O as es,Q as Ue,R as ts,S as ss,T as is,U as ns,W as ls,X as as,Y as rs,Z as te,_ as St,$ as Ct,a0 as Et,a1 as It,a2 as os,a3 as De,a4 as us,a5 as cs,a6 as Lt,a7 as ds,a8 as hs,a9 as Oe,aa as fs,ab as Ae,ac as q,ad as ps,ae as ms,af as Ze,ag as fe,ah as ke,ai as gs,aj as wt,ak as et,al as Ke,am as Ee,an as vs,ao as Re,ap as ys,aq as bs,ar as xs,as as As,at as Ss,au as Cs,av as tt,aw as st,ax as it,ay as Es,az as Is,aA as Ls}from"./DklXDfzJ.js";import{f as Ce}from"./BO9r3vVu.js";import{_ as ws}from"./BfoQBf7N.js";function Fs(i){return B(()=>se(i)?!!Pt(i)?.closest("form"):!0)}function Ms(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}var _s=ne({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const t=i,{primitiveElement:e,currentElement:s}=je(),n=B(()=>t.checked??t.value);return ge(n,(l,a)=>{if(!s.value)return;const r=s.value,o=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(o,"value").set;if(f&&l!==a){const g=new Event("input",{bubbles:!0}),u=new Event("change",{bubbles:!0});f.call(r,l),r.dispatchEvent(g),r.dispatchEvent(u)}}),(l,a)=>(C(),D(Vt,H({ref_key:"primitiveElement",ref:e},{...t,...l.$attrs},{as:"input"}),null,16))}}),nt=_s,ks=ne({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const t=i,e=B(()=>typeof t.value=="object"&&Array.isArray(t.value)&&t.value.length===0&&t.required),s=B(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((n,l)=>typeof n=="object"?Object.entries(n).map(([a,r])=>({name:`${t.name}[${l}][${a}]`,value:r})):{name:`${t.name}[${l}]`,value:n}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([n,l])=>({name:`${t.name}[${n}]`,value:l})):[]);return(n,l)=>(C(),V(ae,null,[Y(" We render single input if it's required "),e.value?(C(),D(nt,H({key:n.name},{...t,...n.$attrs},{name:n.name,value:n.value}),null,16,["name","value"])):(C(!0),V(ae,{key:1},me(s.value,a=>(C(),D(nt,H({key:a.name},{ref_for:!0},{...t,...n.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))],2112))}}),Bs=ks;function lt(i){return i?.querySelector("[data-state=checked]")}function zs(i,t,e){return i===void 0?!1:Array.isArray(i)?i.some(s=>re(s,t,e)):re(i,t,e)}function re(i,t,e){return i===void 0||t===void 0?!1:typeof i=="string"?i===t:typeof e=="function"?e(i,t):typeof e=="string"?i?.[e]===t?.[e]:Ht(i,t)}const[Fe,Ts]=We("ListboxRoot");var Ds=ne({__name:"ListboxRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:"vertical"},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1,default:"toggle"},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","entryFocus","leave"],setup(i,{expose:t,emit:e}){const s=i,n=e,{multiple:l,highlightOnHover:a,orientation:r,disabled:o,selectionBehavior:p,dir:f}=Nt(s),{getItems:g}=we({isProvider:!0}),{handleTypeaheadSearch:u}=jt(),{primitiveElement:d,currentElement:m}=je(),v=Ms(),x=Wt(f),E=Fs(m),I=ee(),O=ee(!1),k=ee(!0),F=yt(s,"modelValue",n,{defaultValue:s.defaultValue??(l.value?[]:void 0),passive:s.modelValue===void 0,deep:!0});function J(y){if(O.value=!0,s.multiple){const w=Array.isArray(F.value)?[...F.value]:[],M=w.findIndex(P=>re(P,y,s.by));s.selectionBehavior==="toggle"?(M===-1?w.push(y):w.splice(M,1),F.value=w):(F.value=[y],I.value=y)}else s.selectionBehavior==="toggle"&&re(F.value,y,s.by)?F.value=void 0:F.value=y;setTimeout(()=>{O.value=!1},1)}const b=ee(null),z=ee(null),R=ee(!1),W=ee(!1),Z=_e(),G=_e(),L=_e();function _(){return g().map(y=>y.ref).filter(y=>y.dataset.disabled!=="")}function h(y,w=!0){if(!y)return;b.value=y,k.value&&b.value.focus(),w&&b.value.scrollIntoView({block:"nearest"});const M=g().find(P=>P.ref===y);n("highlight",M)}function $(y){if(R.value)L.trigger(y);else{const w=g().find(M=>re(M.value,y,s.by));w&&(b.value=w.ref,h(w.ref))}}function A(y){b.value&&b.value.isConnected&&(y.preventDefault(),y.stopPropagation(),W.value||b.value.click())}function T(y){if(k.value){if(O.value=!0,R.value)G.trigger(y);else{const w=y.altKey||y.ctrlKey||y.metaKey;if(w&&y.key==="a"&&l.value){const M=g(),P=M.map(he=>he.value);F.value=[...P],y.preventDefault(),h(M[M.length-1].ref)}else if(!w){const M=u(y.key,g());M&&h(M)}}setTimeout(()=>{O.value=!1},1)}}function U(){W.value=!0}function j(){xe(()=>{W.value=!1})}function de(){xe(()=>{const y=new KeyboardEvent("keydown",{key:"PageUp"});Xe(y)})}function Me(y){const w=b.value;w?.isConnected&&(z.value=w),b.value=null,n("leave",y)}function Rt(y){const w=new CustomEvent("listbox.entryFocus",{bubbles:!1,cancelable:!0});if(y.currentTarget?.dispatchEvent(w),n("entryFocus",w),!w.defaultPrevented)if(z.value)h(z.value);else{const M=_()?.[0];h(M)}}function Xe(y){const w=Gt(y,r.value,x.value);if(!w)return;let M=_();if(b.value){if(w==="last")M.reverse();else if(w==="prev"||w==="next"){w==="prev"&&M.reverse();const P=M.indexOf(b.value);M=M.slice(P+1)}qt(y,M[0])}if(M.length){const P=!b.value&&w==="prev"?M.length-1:0;h(M[P])}if(R.value)return G.trigger(y)}function qt(y,w){if(!(R.value||s.selectionBehavior!=="replace"||!l.value||!Array.isArray(F.value)||(y.altKey||y.ctrlKey||y.metaKey)&&!y.shiftKey)&&y.shiftKey){const P=g().filter(be=>be.ref.dataset.disabled!=="");let he=P.find(be=>be.ref===w)?.value;if(y.key===v.END?he=P[P.length-1].value:y.key===v.HOME&&(he=P[0].value),!he||!I.value)return;const $t=Ce(P.map(be=>be.value),I.value,he);F.value=$t}}async function Qe(y){if(await xe(),R.value)Z.trigger(y);else{const w=_(),M=w.find(P=>P.dataset.state==="checked");M?h(M):w.length&&h(w[0])}}return ge(F,()=>{O.value||xe(()=>{Qe()})},{immediate:!0,deep:!0}),t({highlightedElement:b,highlightItem:$,highlightFirstItem:de,highlightSelected:Qe,getItems:g}),Ts({modelValue:F,onValueChange:J,multiple:l,orientation:r,dir:x,disabled:o,highlightOnHover:a,highlightedElement:b,isVirtual:R,virtualFocusHook:Z,virtualKeydownHook:G,virtualHighlightHook:L,by:s.by,firstValue:I,selectionBehavior:p,focusable:k,onLeave:Me,onEnter:Rt,changeHighlight:h,onKeydownEnter:A,onKeydownNavigation:Xe,onKeydownTypeAhead:T,onCompositionStart:U,onCompositionEnd:j,highlightFirstItem:de}),(y,w)=>(C(),D(c(ce),{ref_key:"primitiveElement",ref:d,as:y.as,"as-child":y.asChild,dir:c(x),"data-disabled":c(o)?"":void 0,onPointerleave:Me,onFocusout:w[0]||(w[0]=async M=>{const P=M.relatedTarget||M.target;await xe(),b.value&&c(m)&&!c(m).contains(P)&&Me(M)})},{default:K(()=>[N(y.$slots,"default",{modelValue:c(F)}),c(E)&&y.name?(C(),D(c(Bs),{key:0,name:y.name,value:c(F),disabled:c(o),required:y.required},null,8,["name","value","disabled","required"])):Y("v-if",!0)]),_:3},8,["as","as-child","dir","data-disabled"]))}}),Os=Ds,Ks=ne({__name:"ListboxContent",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const{CollectionSlot:t}=we(),e=Fe(),s=bt(!1,10);return(n,l)=>(C(),D(c(t),null,{default:K(()=>[X(c(ce),{role:"listbox",as:n.as,"as-child":n.asChild,tabindex:c(e).focusable.value?c(e).highlightedElement.value?"-1":"0":"-1","aria-orientation":c(e).orientation.value,"aria-multiselectable":!!c(e).multiple.value,"data-orientation":c(e).orientation.value,onMousedown:l[0]||(l[0]=Ge(a=>s.value=!0,["left"])),onFocus:l[1]||(l[1]=a=>{c(s)||c(e).onEnter(a)}),onKeydown:[l[2]||(l[2]=ve(a=>{c(e).orientation.value==="vertical"&&(a.key==="ArrowLeft"||a.key==="ArrowRight")||c(e).orientation.value==="horizontal"&&(a.key==="ArrowUp"||a.key==="ArrowDown")||(a.preventDefault(),c(e).focusable.value&&c(e).onKeydownNavigation(a))},["down","up","left","right","home","end"])),ve(c(e).onKeydownEnter,["enter"]),c(e).onKeydownTypeAhead]},{default:K(()=>[N(n.$slots,"default")]),_:3},8,["as","as-child","tabindex","aria-orientation","aria-multiselectable","data-orientation","onKeydown"])]),_:3}))}}),Rs=Ks,qs=ne({__name:"ListboxFilter",props:{modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(i,{emit:t}){const e=i,n=yt(e,"modelValue",t,{defaultValue:"",passive:e.modelValue===void 0}),l=Fe(),{primitiveElement:a,currentElement:r}=je(),o=B(()=>e.disabled||l.disabled.value||!1),p=ee();return Ut(()=>p.value=l.highlightedElement.value?.id),Yt(()=>{l.focusable.value=!1,setTimeout(()=>{e.autoFocus&&r.value?.focus()},1)}),Xt(()=>{l.focusable.value=!0}),(f,g)=>(C(),D(c(ce),{ref_key:"primitiveElement",ref:a,as:f.as,"as-child":f.asChild,value:c(n),disabled:o.value?"":void 0,"data-disabled":o.value?"":void 0,"aria-disabled":o.value??void 0,"aria-activedescendant":p.value,type:"text",onKeydown:[ve(Ge(c(l).onKeydownNavigation,["prevent"]),["down","up","home","end"]),ve(c(l).onKeydownEnter,["enter"])],onInput:g[0]||(g[0]=u=>{n.value=u.target.value,c(l).highlightFirstItem()}),onCompositionstart:c(l).onCompositionStart,onCompositionend:c(l).onCompositionEnd},{default:K(()=>[N(f.$slots,"default",{modelValue:c(n)})]),_:3},8,["as","as-child","value","disabled","data-disabled","aria-disabled","aria-activedescendant","onKeydown","onCompositionstart","onCompositionend"]))}}),$s=qs;const[Ps,Vs]=We("ListboxGroup");var Hs=ne({__name:"ListboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(i){const t=i,e=xt(void 0,"reka-listbox-group");return Vs({id:e}),(s,n)=>(C(),D(c(ce),H({role:"group"},t,{"aria-labelledby":c(e)}),{default:K(()=>[N(s.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),Ns=Hs,js=ne({__name:"ListboxGroupLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(i){const t=i,e=Ps({id:""});return(s,n)=>(C(),D(c(ce),H(t,{id:c(e).id}),{default:K(()=>[N(s.$slots,"default")]),_:3},16,["id"]))}}),Ws=js;const Gs="listbox.select",[Us,Ys]=We("ListboxItem");var Xs=ne({__name:"ListboxItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["select"],setup(i,{emit:t}){const e=i,s=t,n=xt(void 0,"reka-listbox-item"),{CollectionItem:l}=we(),{forwardRef:a,currentElement:r}=At(),o=Fe(),p=B(()=>r.value===o.highlightedElement.value),f=B(()=>zs(o.modelValue.value,e.value,o.by)),g=B(()=>o.disabled.value||e.disabled);async function u(m){s("select",m),!m?.defaultPrevented&&!g.value&&m&&(o.onValueChange(e.value),o.changeHighlight(r.value))}function d(m){const v={originalEvent:m,value:e.value};Jt(Gs,u,v)}return Ys({isSelected:f}),(m,v)=>(C(),D(c(l),{value:m.value},{default:K(()=>[Qt([p.value,f.value],()=>X(c(ce),H({id:c(n)},m.$attrs,{ref:c(a),role:"option",tabindex:c(o).focusable.value?p.value?"0":"-1":-1,"aria-selected":f.value,as:m.as,"as-child":m.asChild,disabled:g.value?"":void 0,"data-disabled":g.value?"":void 0,"data-highlighted":p.value?"":void 0,"data-state":f.value?"checked":"unchecked",onClick:d,onKeydown:ve(Ge(d,["prevent"]),["space"]),onPointermove:v[0]||(v[0]=()=>{c(o).highlightedElement.value!==c(r)&&c(o).highlightOnHover.value&&!c(o).focusable.value&&c(o).changeHighlight(c(r),!1)})}),{default:K(()=>[N(m.$slots,"default")]),_:3},16,["id","tabindex","aria-selected","as","as-child","disabled","data-disabled","data-highlighted","data-state","onKeydown"]),v,1)]),_:3},8,["value"]))}}),Qs=Xs,Js=ne({__name:"ListboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(i){const t=i;At();const e=Us();return(s,n)=>c(e).isSelected.value?(C(),D(c(ce),H({key:0,"aria-hidden":"true"},t),{default:K(()=>[N(s.$slots,"default")]),_:3},16)):Y("v-if",!0)}}),Zs=Js;function pe(i,t,e){let s=e.initialDeps??[],n,l=!0;function a(){var r,o,p;let f;e.key&&((r=e.debug)!=null&&r.call(e))&&(f=Date.now());const g=i();if(!(g.length!==s.length||g.some((m,v)=>s[v]!==m)))return n;s=g;let d;if(e.key&&((o=e.debug)!=null&&o.call(e))&&(d=Date.now()),n=t(...g),e.key&&((p=e.debug)!=null&&p.call(e))){const m=Math.round((Date.now()-f)*100)/100,v=Math.round((Date.now()-d)*100)/100,x=v/16,E=(I,O)=>{for(I=String(I);I.length<O;)I=" "+I;return I};console.info(`%c⏱ ${E(v,5)} /${E(m,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,e?.key)}return e?.onChange&&!(l&&e.skipInitialOnChange)&&e.onChange(n),l=!1,n}return a.updateDeps=r=>{s=r},a}function at(i,t){if(i===void 0)throw new Error("Unexpected undefined");return i}const ei=(i,t)=>Math.abs(i-t)<1.01,ti=(i,t,e)=>{let s;return function(...n){i.clearTimeout(s),s=i.setTimeout(()=>t.apply(this,n),e)}},rt=i=>{const{offsetWidth:t,offsetHeight:e}=i;return{width:t,height:e}},si=i=>i,ii=i=>{const t=Math.max(i.startIndex-i.overscan,0),e=Math.min(i.endIndex+i.overscan,i.count-1),s=[];for(let n=t;n<=e;n++)s.push(n);return s},ni=(i,t)=>{const e=i.scrollElement;if(!e)return;const s=i.targetWindow;if(!s)return;const n=a=>{const{width:r,height:o}=a;t({width:Math.round(r),height:Math.round(o)})};if(n(rt(e)),!s.ResizeObserver)return()=>{};const l=new s.ResizeObserver(a=>{const r=()=>{const o=a[0];if(o?.borderBoxSize){const p=o.borderBoxSize[0];if(p){n({width:p.inlineSize,height:p.blockSize});return}}n(rt(e))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return l.observe(e,{box:"border-box"}),()=>{l.unobserve(e)}},ot={passive:!0},ut=typeof window>"u"?!0:"onscrollend"in window,li=(i,t)=>{const e=i.scrollElement;if(!e)return;const s=i.targetWindow;if(!s)return;let n=0;const l=i.options.useScrollendEvent&&ut?()=>{}:ti(s,()=>{t(n,!1)},i.options.isScrollingResetDelay),a=f=>()=>{const{horizontal:g,isRtl:u}=i.options;n=g?e.scrollLeft*(u&&-1||1):e.scrollTop,l(),t(n,f)},r=a(!0),o=a(!1);e.addEventListener("scroll",r,ot);const p=i.options.useScrollendEvent&&ut;return p&&e.addEventListener("scrollend",o,ot),()=>{e.removeEventListener("scroll",r),p&&e.removeEventListener("scrollend",o)}},ai=(i,t,e)=>{if(t?.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return i[e.options.horizontal?"offsetWidth":"offsetHeight"]},ri=(i,{adjustments:t=0,behavior:e},s)=>{var n,l;const a=i+t;(l=(n=s.scrollElement)==null?void 0:n.scrollTo)==null||l.call(n,{[s.options.horizontal?"left":"top"]:a,behavior:e})};class oi{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,s,n;return((n=(s=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:s.now)==null?void 0:n.call(s))??Date.now()},this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(n=>{n.forEach(l=>{const a=()=>{const r=l.target,o=this.indexFromElement(r);if(!r.isConnected){this.observer.unobserve(r);return}this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(r,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var n;(n=s())==null||n.disconnect(),e=null},observe:n=>{var l;return(l=s())==null?void 0:l.observe(n,{box:"border-box"})},unobserve:n=>{var l;return(l=s())==null?void 0:l.unobserve(n)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,n])=>{typeof n>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:si,rangeExtractor:ii,onChange:()=>{},measureElement:ai,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,n;(n=(s=this.options).onChange)==null||n.call(s,this,e)},this.maybeNotify=pe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const n=new Map,l=new Map;for(let a=s-1;a>=0;a--){const r=e[a];if(n.has(r.lane))continue;const o=l.get(r.lane);if(o==null||r.end>o.end?l.set(r.lane,r):r.end<o.end&&n.set(r.lane,!0),n.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((a,r)=>a.end===r.end?a.index-r.index:a.end-r.end)[0]:void 0},this.getMeasurementOptions=pe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,s,n,l,a,r)=>(this.prevLanes!==void 0&&this.prevLanes!==r&&(this.lanesChangedFlag=!0),this.prevLanes=r,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:n,getItemKey:l,enabled:a,lanes:r}),{key:!1}),this.getMeasurements=pe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:n,getItemKey:l,enabled:a,lanes:r},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const u of this.laneAssignments.keys())u>=e&&this.laneAssignments.delete(u);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const p=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,p),g=new Array(r).fill(void 0);for(let u=0;u<p;u++){const d=f[u];d&&(g[d.lane]=u)}for(let u=p;u<e;u++){const d=l(u),m=this.laneAssignments.get(u);let v,x;if(m!==void 0&&this.options.lanes>1){v=m;const k=g[v],F=k!==void 0?f[k]:void 0;x=F?F.end+this.options.gap:s+n}else{const k=this.options.lanes===1?f[u-1]:this.getFurthestMeasurement(f,u);x=k?k.end+this.options.gap:s+n,v=k?k.lane:u%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(u,v)}const E=o.get(d),I=typeof E=="number"?E:this.options.estimateSize(u),O=x+I;f[u]={index:u,start:x,size:I,end:O,key:d,lane:v},g[v]=u}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,n,l)=>this.range=e.length>0&&s>0?ui({measurements:e,outerSize:s,scrollOffset:n,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pe(()=>{let e=null,s=null;const n=this.calculateRange();return n&&(e=n.startIndex,s=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,n,l,a)=>l===null||a===null?[]:e({startIndex:l,endIndex:a,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,n=e.getAttribute(s);return n?parseInt(n,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(n!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,n-l),r=Math.min(this.options.count-1,n+l);return e>=a&&e<=r}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((a,r)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(r))});return}const s=this.indexFromElement(e),n=this.options.getItemKey(s),l=this.elementsCache.get(n);l!==e&&(l&&this.observer.unobserve(l),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,s)=>{var n;const l=this.measurementsCache[e];if(!l)return;const a=this.itemSizeCache.get(l.key)??l.size,r=s-a;r!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,r,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,s)),this.notify(!1))},this.getVirtualItems=pe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const n=[];for(let l=0,a=e.length;l<a;l++){const r=e[l],o=s[r];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return at(s[Ft(0,s.length-1,n=>at(s[n]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,s,n=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),a=this.getScrollOffset();s==="auto"&&(s=e>=a+l?"end":"start"),s==="center"?e+=(n-l)/2:s==="end"&&(e-=l);const r=this.getMaxScrollOffset();return Math.max(Math.min(r,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),l=this.getScrollOffset(),a=this.measurementsCache[e];if(!a)return;if(s==="auto")if(a.end>=l+n-this.options.scrollPaddingEnd)s="end";else if(a.start<=l+this.options.scrollPaddingStart)s="start";else return[l,s];if(s==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),s];const r=s==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,s,a.size),s]},this.scrollToOffset=(e,{align:s="start",behavior:n="auto"}={})=>{const l=this.getOffsetForAlignment(e,s),a=this.now();this.scrollState={index:null,align:s,behavior:n,startedAt:a,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:s="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const l=this.getOffsetForIndex(e,s);if(!l)return;const[a,r]=l,o=this.now();this.scrollState={index:e,align:r,behavior:n,startedAt:o,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:s="auto"}={})=>{const n=this.getScrollOffset()+e,l=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:l,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let n;if(s.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((e=s[s.length-1])==null?void 0:e.end)??0;else{const l=Array(this.options.lanes).fill(null);let a=s.length-1;for(;a>=0&&l.some(r=>r===null);){const r=s[a];l[r.lane]===null&&(l[r.lane]=r.end),a--}n=Math.max(...l.filter(r=>r!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=s?s[0]:this.scrollState.lastTargetOffset,l=1,a=n!==this.scrollState.lastTargetOffset;if(!a&&ei(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ft=(i,t,e,s)=>{for(;i<=t;){const n=(i+t)/2|0,l=e(n);if(l<s)i=n+1;else if(l>s)t=n-1;else return n}return i>0?i-1:0};function ui({measurements:i,outerSize:t,scrollOffset:e,lanes:s}){const n=i.length-1,l=o=>i[o].start;if(i.length<=s)return{startIndex:0,endIndex:n};let a=Ft(0,n,l,e),r=a;if(s===1)for(;r<n&&i[r].end<e+t;)r++;else if(s>1){const o=Array(s).fill(0);for(;r<n&&o.some(f=>f<e+t);){const f=i[r];o[f.lane]=f.end,r++}const p=Array(s).fill(e+t);for(;a>=0&&p.some(f=>f>=e);){const f=i[a];p[f.lane]=f.start,a--}a=Math.max(0,a-a%s),r=Math.min(n,r+(s-1-r%s))}return{startIndex:a,endIndex:r}}function ci(i){const t=new oi(c(i)),e=es(t),s=t._didMount();return ge(()=>c(i).getScrollElement(),n=>{n&&t._willUpdate()},{immediate:!0}),ge(()=>c(i),n=>{t.setOptions({...n,onChange:(l,a)=>{var r;Je(e),(r=n.onChange)==null||r.call(n,l,a)}}),t._willUpdate(),Je(e)},{immediate:!0}),Zt(s),e}function di(i){return ci(B(()=>({observeElementRect:ni,observeElementOffset:li,scrollToFn:ri,...c(i)})))}var hi=ne({__name:"ListboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:[Number,Function],required:!1},textContent:{type:Function,required:!1}},setup(i){const t=i,e=Ue(),s=Fe(),n=ts(),{getItems:l}=we();s.isVirtual.value=!0;const a=B(()=>{const u=n.value;if(u){const d=window.getComputedStyle(u);return{start:Number.parseFloat(d.paddingBlockStart||d.paddingTop),end:Number.parseFloat(d.paddingBlockEnd||d.paddingBottom)}}else return{start:0,end:0}}),r=di({get scrollPaddingStart(){return a.value.start},get scrollPaddingEnd(){return a.value.end},get count(){return t.options.length},get horizontal(){return s.orientation.value==="horizontal"},estimateSize(u){return typeof t.estimateSize=="function"?t.estimateSize(u):t.estimateSize??28},getScrollElement(){return n.value},overscan:t.overscan??12}),o=B(()=>r.value.getVirtualItems().map(u=>{const d=e.default({option:t.options[u.index],virtualizer:r.value,virtualItem:u})[0],m=d.type===ae&&Array.isArray(d.children)?d.children[0]:d;return{item:u,is:rs(m,{key:`${u.key}`,"data-index":u.index,"aria-setsize":t.options.length,"aria-posinset":u.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${u.start}px)`,overflowAnchor:"none"}})}}));s.virtualFocusHook.on(u=>{const d=t.options.findIndex(m=>Array.isArray(s.modelValue.value)?re(m,s.modelValue.value[0],s.by):re(m,s.modelValue.value,s.by));d!==-1?(u?.preventDefault(),r.value.scrollToIndex(d,{align:"start"}),requestAnimationFrame(()=>{const m=lt(n.value);m&&(s.changeHighlight(m),u&&m?.focus())})):s.highlightFirstItem()}),s.virtualHighlightHook.on(u=>{const d=t.options.findIndex(m=>re(m,u,s.by));r.value.scrollToIndex(d,{align:"start"}),requestAnimationFrame(()=>{const m=lt(n.value);m&&s.changeHighlight(m)})});const p=bt("",1e3),f=B(()=>{const u=d=>t.textContent?t.textContent(d):d?.toString().toLowerCase();return t.options.map((d,m)=>({index:m,textContent:u(d)}))});function g(u,d){if(!s.firstValue?.value||!s.multiple.value||!Array.isArray(s.modelValue.value))return;const v=l().filter(E=>E.ref.dataset.disabled!=="").find(E=>E.ref===s.highlightedElement.value)?.value;if(!v)return;let x=null;switch(d){case"prev":case"next":{x=Ce(t.options,s.firstValue.value,v);break}case"first":{x=Ce(t.options,s.firstValue.value,t.options?.[0]);break}case"last":{x=Ce(t.options,s.firstValue.value,t.options?.[t.options.length-1]);break}}s.modelValue.value=x}return s.virtualKeydownHook.on(u=>{const d=u.altKey||u.ctrlKey||u.metaKey;if(u.key==="Tab"&&!d)return;let v=ss[u.key];if(d&&u.key==="a"&&s.multiple.value?(u.preventDefault(),s.modelValue.value=[...t.options],v="last"):u.shiftKey&&v&&g(u,v),["first","last"].includes(v)){u.preventDefault();const x=v==="first"?0:t.options.length-1;r.value.scrollToIndex(x),requestAnimationFrame(()=>{const E=l(),I=v==="first"?E[0]:E[E.length-1];I&&s.changeHighlight(I.ref)})}else if(!v&&!d){p.value+=u.key;const x=Number(is()?.getAttribute("data-index")),E=f.value[x].textContent,I=f.value.map(F=>F.textContent??""),O=ns(I,p.value,E),k=f.value.find(F=>F.textContent===O);k&&(r.value.scrollToIndex(k.index,{align:"start"}),requestAnimationFrame(()=>{const F=n.value.querySelector(`[data-index="${k.index}"]`);F instanceof HTMLElement&&s.changeHighlight(F)}))}}),(u,d)=>(C(),V("div",{"data-reka-virtualizer":"",style:as({position:"relative",width:"100%",height:`${c(r).getTotalSize()}px`})},[(C(!0),V(ae,null,me(o.value,({is:m,item:v})=>(C(),D(ls(m),{key:v.index}))),128))],4))}}),fi=hi;function le(i){return Array.isArray?Array.isArray(i):kt(i)==="[object Array]"}function pi(i){if(typeof i=="string")return i;let t=i+"";return t=="0"&&1/i==-1/0?"-0":t}function mi(i){return i==null?"":pi(i)}function ie(i){return typeof i=="string"}function Mt(i){return typeof i=="number"}function gi(i){return i===!0||i===!1||vi(i)&&kt(i)=="[object Boolean]"}function _t(i){return typeof i=="object"}function vi(i){return _t(i)&&i!==null}function Q(i){return i!=null}function Be(i){return!i.trim().length}function kt(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(i)}const yi="Incorrect 'index' type",bi=i=>`Invalid value for key ${i}`,xi=i=>`Pattern length exceeds max of ${i}.`,Ai=i=>`Missing ${i} property in key`,Si=i=>`Property 'weight' in key '${i}' must be a positive integer`,ct=Object.prototype.hasOwnProperty;class Ci{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(s=>{let n=Bt(s);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(s=>{s.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bt(i){let t=null,e=null,s=null,n=1,l=null;if(ie(i)||le(i))s=i,t=dt(i),e=qe(i);else{if(!ct.call(i,"name"))throw new Error(Ai("name"));const a=i.name;if(s=a,ct.call(i,"weight")&&(n=i.weight,n<=0))throw new Error(Si(a));t=dt(a),e=qe(a),l=i.getFn}return{path:t,id:e,weight:n,src:s,getFn:l}}function dt(i){return le(i)?i:i.split(".")}function qe(i){return le(i)?i.join("."):i}function Ei(i,t){let e=[],s=!1;const n=(l,a,r)=>{if(Q(l))if(!a[r])e.push(l);else{let o=a[r];const p=l[o];if(!Q(p))return;if(r===a.length-1&&(ie(p)||Mt(p)||gi(p)))e.push(mi(p));else if(le(p)){s=!0;for(let f=0,g=p.length;f<g;f+=1)n(p[f],a,r+1)}else a.length&&n(p,a,r+1)}};return n(i,ie(t)?t.split("."):t,0),s?e:e[0]}const Ii={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Li={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(i,t)=>i.score===t.score?i.idx<t.idx?-1:1:i.score<t.score?-1:1},wi={location:0,threshold:.6,distance:100},Fi={useExtendedSearch:!1,getFn:Ei,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var S={...Li,...Ii,...wi,...Fi};const Mi=/[^ ]+/g;function _i(i=1,t=3){const e=new Map,s=Math.pow(10,t);return{get(n){const l=n.match(Mi).length;if(e.has(l))return e.get(l);const a=1/Math.pow(l,.5*i),r=parseFloat(Math.round(a*s)/s);return e.set(l,r),r},clear(){e.clear()}}}class Ye{constructor({getFn:t=S.getFn,fieldNormWeight:e=S.fieldNormWeight}={}){this.norm=_i(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((e,s)=>{this._keysMap[e.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ie(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();ie(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e<s;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!Q(t)||Be(t))return;let s={v:t,i:e,n:this.norm.get(t)};this.records.push(s)}_addObject(t,e){let s={i:e,$:{}};this.keys.forEach((n,l)=>{let a=n.getFn?n.getFn(t):this.getFn(t,n.path);if(Q(a)){if(le(a)){let r=[];const o=[{nestedArrIndex:-1,value:a}];for(;o.length;){const{nestedArrIndex:p,value:f}=o.pop();if(Q(f))if(ie(f)&&!Be(f)){let g={v:f,i:p,n:this.norm.get(f)};r.push(g)}else le(f)&&f.forEach((g,u)=>{o.push({nestedArrIndex:u,value:g})})}s.$[l]=r}else if(ie(a)&&!Be(a)){let r={v:a,n:this.norm.get(a)};s.$[l]=r}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function zt(i,t,{getFn:e=S.getFn,fieldNormWeight:s=S.fieldNormWeight}={}){const n=new Ye({getFn:e,fieldNormWeight:s});return n.setKeys(i.map(Bt)),n.setSources(t),n.create(),n}function ki(i,{getFn:t=S.getFn,fieldNormWeight:e=S.fieldNormWeight}={}){const{keys:s,records:n}=i,l=new Ye({getFn:t,fieldNormWeight:e});return l.setKeys(s),l.setIndexRecords(n),l}function Se(i,{errors:t=0,currentLocation:e=0,expectedLocation:s=0,distance:n=S.distance,ignoreLocation:l=S.ignoreLocation}={}){const a=t/i.length;if(l)return a;const r=Math.abs(s-e);return n?a+r/n:r?1:a}function Bi(i=[],t=S.minMatchCharLength){let e=[],s=-1,n=-1,l=0;for(let a=i.length;l<a;l+=1){let r=i[l];r&&s===-1?s=l:!r&&s!==-1&&(n=l-1,n-s+1>=t&&e.push([s,n]),s=-1)}return i[l-1]&&l-s>=t&&e.push([s,l-1]),e}const ue=32;function zi(i,t,e,{location:s=S.location,distance:n=S.distance,threshold:l=S.threshold,findAllMatches:a=S.findAllMatches,minMatchCharLength:r=S.minMatchCharLength,includeMatches:o=S.includeMatches,ignoreLocation:p=S.ignoreLocation}={}){if(t.length>ue)throw new Error(xi(ue));const f=t.length,g=i.length,u=Math.max(0,Math.min(s,g));let d=l,m=u;const v=r>1||o,x=v?Array(g):[];let E;for(;(E=i.indexOf(t,m))>-1;){let b=Se(t,{currentLocation:E,expectedLocation:u,distance:n,ignoreLocation:p});if(d=Math.min(b,d),m=E+f,v){let z=0;for(;z<f;)x[E+z]=1,z+=1}}m=-1;let I=[],O=1,k=f+g;const F=1<<f-1;for(let b=0;b<f;b+=1){let z=0,R=k;for(;z<R;)Se(t,{errors:b,currentLocation:u+R,expectedLocation:u,distance:n,ignoreLocation:p})<=d?z=R:k=R,R=Math.floor((k-z)/2+z);k=R;let W=Math.max(1,u-R+1),Z=a?g:Math.min(u+R,g)+f,G=Array(Z+2);G[Z+1]=(1<<b)-1;for(let _=Z;_>=W;_-=1){let h=_-1,$=e[i.charAt(h)];if(v&&(x[h]=+!!$),G[_]=(G[_+1]<<1|1)&$,b&&(G[_]|=(I[_+1]|I[_])<<1|1|I[_+1]),G[_]&F&&(O=Se(t,{errors:b,currentLocation:h,expectedLocation:u,distance:n,ignoreLocation:p}),O<=d)){if(d=O,m=h,m<=u)break;W=Math.max(1,2*u-m)}}if(Se(t,{errors:b+1,currentLocation:u,expectedLocation:u,distance:n,ignoreLocation:p})>d)break;I=G}const J={isMatch:m>=0,score:Math.max(.001,O)};if(v){const b=Bi(x,r);b.length?o&&(J.indices=b):J.isMatch=!1}return J}function Ti(i){let t={};for(let e=0,s=i.length;e<s;e+=1){const n=i.charAt(e);t[n]=(t[n]||0)|1<<s-e-1}return t}const Ie=String.prototype.normalize?(i=>i.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(i=>i);class Tt{constructor(t,{location:e=S.location,threshold:s=S.threshold,distance:n=S.distance,includeMatches:l=S.includeMatches,findAllMatches:a=S.findAllMatches,minMatchCharLength:r=S.minMatchCharLength,isCaseSensitive:o=S.isCaseSensitive,ignoreDiacritics:p=S.ignoreDiacritics,ignoreLocation:f=S.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:n,includeMatches:l,findAllMatches:a,minMatchCharLength:r,isCaseSensitive:o,ignoreDiacritics:p,ignoreLocation:f},t=o?t:t.toLowerCase(),t=p?Ie(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const g=(d,m)=>{this.chunks.push({pattern:d,alphabet:Ti(d),startIndex:m})},u=this.pattern.length;if(u>ue){let d=0;const m=u%ue,v=u-m;for(;d<v;)g(this.pattern.substr(d,ue),d),d+=ue;if(m){const x=u-ue;g(this.pattern.substr(x),x)}}else g(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,ignoreDiacritics:s,includeMatches:n}=this.options;if(t=e?t:t.toLowerCase(),t=s?Ie(t):t,this.pattern===t){let v={isMatch:!0,score:0};return n&&(v.indices=[[0,t.length-1]]),v}const{location:l,distance:a,threshold:r,findAllMatches:o,minMatchCharLength:p,ignoreLocation:f}=this.options;let g=[],u=0,d=!1;this.chunks.forEach(({pattern:v,alphabet:x,startIndex:E})=>{const{isMatch:I,score:O,indices:k}=zi(t,v,x,{location:l+E,distance:a,threshold:r,findAllMatches:o,minMatchCharLength:p,includeMatches:n,ignoreLocation:f});I&&(d=!0),u+=O,I&&k&&(g=[...g,...k])});let m={isMatch:d,score:d?u/this.chunks.length:1};return d&&n&&(m.indices=g),m}}class oe{constructor(t){this.pattern=t}static isMultiMatch(t){return ht(t,this.multiRegex)}static isSingleMatch(t){return ht(t,this.singleRegex)}search(){}}function ht(i,t){const e=i.match(t);return e?e[1]:null}class Di extends oe{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Oi extends oe{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Ki extends oe{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Ri extends oe{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class qi extends oe{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class $i extends oe{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Dt extends oe{constructor(t,{location:e=S.location,threshold:s=S.threshold,distance:n=S.distance,includeMatches:l=S.includeMatches,findAllMatches:a=S.findAllMatches,minMatchCharLength:r=S.minMatchCharLength,isCaseSensitive:o=S.isCaseSensitive,ignoreDiacritics:p=S.ignoreDiacritics,ignoreLocation:f=S.ignoreLocation}={}){super(t),this._bitapSearch=new Tt(t,{location:e,threshold:s,distance:n,includeMatches:l,findAllMatches:a,minMatchCharLength:r,isCaseSensitive:o,ignoreDiacritics:p,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Ot extends oe{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,s;const n=[],l=this.pattern.length;for(;(s=t.indexOf(this.pattern,e))>-1;)e=s+l,n.push([s,e-1]);const a=!!n.length;return{isMatch:a,score:a?0:1,indices:n}}}const $e=[Di,Ot,Ki,Ri,$i,qi,Oi,Dt],ft=$e.length,Pi=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Vi="|";function Hi(i,t={}){return i.split(Vi).map(e=>{let s=e.trim().split(Pi).filter(l=>l&&!!l.trim()),n=[];for(let l=0,a=s.length;l<a;l+=1){const r=s[l];let o=!1,p=-1;for(;!o&&++p<ft;){const f=$e[p];let g=f.isMultiMatch(r);g&&(n.push(new f(g,t)),o=!0)}if(!o)for(p=-1;++p<ft;){const f=$e[p];let g=f.isSingleMatch(r);if(g){n.push(new f(g,t));break}}}return n})}const Ni=new Set([Dt.type,Ot.type]);class ji{constructor(t,{isCaseSensitive:e=S.isCaseSensitive,ignoreDiacritics:s=S.ignoreDiacritics,includeMatches:n=S.includeMatches,minMatchCharLength:l=S.minMatchCharLength,ignoreLocation:a=S.ignoreLocation,findAllMatches:r=S.findAllMatches,location:o=S.location,threshold:p=S.threshold,distance:f=S.distance}={}){this.query=null,this.options={isCaseSensitive:e,ignoreDiacritics:s,includeMatches:n,minMatchCharLength:l,findAllMatches:r,ignoreLocation:a,location:o,threshold:p,distance:f},t=e?t:t.toLowerCase(),t=s?Ie(t):t,this.pattern=t,this.query=Hi(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:n,ignoreDiacritics:l}=this.options;t=n?t:t.toLowerCase(),t=l?Ie(t):t;let a=0,r=[],o=0;for(let p=0,f=e.length;p<f;p+=1){const g=e[p];r.length=0,a=0;for(let u=0,d=g.length;u<d;u+=1){const m=g[u],{isMatch:v,indices:x,score:E}=m.search(t);if(v){if(a+=1,o+=E,s){const I=m.constructor.type;Ni.has(I)?r=[...r,...x]:r.push(x)}}else{o=0,a=0,r.length=0;break}}if(a){let u={isMatch:!0,score:o/a};return s&&(u.indices=r),u}}return{isMatch:!1,score:1}}}const Pe=[];function Wi(...i){Pe.push(...i)}function Ve(i,t){for(let e=0,s=Pe.length;e<s;e+=1){let n=Pe[e];if(n.condition(i,t))return new n(i,t)}return new Tt(i,t)}const Le={AND:"$and",OR:"$or"},He={PATH:"$path",PATTERN:"$val"},Ne=i=>!!(i[Le.AND]||i[Le.OR]),Gi=i=>!!i[He.PATH],Ui=i=>!le(i)&&_t(i)&&!Ne(i),pt=i=>({[Le.AND]:Object.keys(i).map(t=>({[t]:i[t]}))});function Kt(i,t,{auto:e=!0}={}){const s=n=>{let l=Object.keys(n);const a=Gi(n);if(!a&&l.length>1&&!Ne(n))return s(pt(n));if(Ui(n)){const o=a?n[He.PATH]:l[0],p=a?n[He.PATTERN]:n[o];if(!ie(p))throw new Error(bi(o));const f={keyId:qe(o),pattern:p};return e&&(f.searcher=Ve(p,t)),f}let r={children:[],operator:l[0]};return l.forEach(o=>{const p=n[o];le(p)&&p.forEach(f=>{r.children.push(s(f))})}),r};return Ne(i)||(i=pt(i)),s(i)}function Yi(i,{ignoreFieldNorm:t=S.ignoreFieldNorm}){i.forEach(e=>{let s=1;e.matches.forEach(({key:n,norm:l,score:a})=>{const r=n?n.weight:null;s*=Math.pow(a===0&&r?Number.EPSILON:a,(r||1)*(t?1:l))}),e.score=s})}function Xi(i,t){const e=i.matches;t.matches=[],Q(e)&&e.forEach(s=>{if(!Q(s.indices)||!s.indices.length)return;const{indices:n,value:l}=s;let a={indices:n,value:l};s.key&&(a.key=s.key.src),s.idx>-1&&(a.refIndex=s.idx),t.matches.push(a)})}function Qi(i,t){t.score=i.score}function Ji(i,t,{includeMatches:e=S.includeMatches,includeScore:s=S.includeScore}={}){const n=[];return e&&n.push(Xi),s&&n.push(Qi),i.map(l=>{const{idx:a}=l,r={item:t[a],refIndex:a};return n.length&&n.forEach(o=>{o(l,r)}),r})}class ye{constructor(t,e={},s){this.options={...S,...e},this.options.useExtendedSearch,this._keyStore=new Ci(this.options.keys),this.setCollection(t,s)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof Ye))throw new Error(yi);this._myIndex=e||zt(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Q(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let s=0,n=this._docs.length;s<n;s+=1){const l=this._docs[s];t(l,s)&&(this.removeAt(s),s-=1,n-=1,e.push(l))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:s,includeScore:n,shouldSort:l,sortFn:a,ignoreFieldNorm:r}=this.options;let o=ie(t)?ie(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Yi(o,{ignoreFieldNorm:r}),l&&o.sort(a),Mt(e)&&e>-1&&(o=o.slice(0,e)),Ji(o,this._docs,{includeMatches:s,includeScore:n})}_searchStringList(t){const e=Ve(t,this.options),{records:s}=this._myIndex,n=[];return s.forEach(({v:l,i:a,n:r})=>{if(!Q(l))return;const{isMatch:o,score:p,indices:f}=e.searchIn(l);o&&n.push({item:l,idx:a,matches:[{score:p,value:l,norm:r,indices:f}]})}),n}_searchLogical(t){const e=Kt(t,this.options),s=(r,o,p)=>{if(!r.children){const{keyId:g,searcher:u}=r,d=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(o,g),searcher:u});return d&&d.length?[{idx:p,item:o,matches:d}]:[]}const f=[];for(let g=0,u=r.children.length;g<u;g+=1){const d=r.children[g],m=s(d,o,p);if(m.length)f.push(...m);else if(r.operator===Le.AND)return[]}return f},n=this._myIndex.records,l={},a=[];return n.forEach(({$:r,i:o})=>{if(Q(r)){let p=s(e,r,o);p.length&&(l[o]||(l[o]={idx:o,item:r,matches:[]},a.push(l[o])),p.forEach(({matches:f})=>{l[o].matches.push(...f)}))}}),a}_searchObjectList(t){const e=Ve(t,this.options),{keys:s,records:n}=this._myIndex,l=[];return n.forEach(({$:a,i:r})=>{if(!Q(a))return;let o=[];s.forEach((p,f)=>{o.push(...this._findMatches({key:p,value:a[f],searcher:e}))}),o.length&&l.push({idx:r,item:a,matches:o})}),l}_findMatches({key:t,value:e,searcher:s}){if(!Q(e))return[];let n=[];if(le(e))e.forEach(({v:l,i:a,n:r})=>{if(!Q(l))return;const{isMatch:o,score:p,indices:f}=s.searchIn(l);o&&n.push({score:p,key:t,value:l,idx:a,norm:r,indices:f})});else{const{v:l,n:a}=e,{isMatch:r,score:o,indices:p}=s.searchIn(l);r&&n.push({score:o,key:t,value:l,norm:a,indices:p})}return n}}ye.version="7.1.0";ye.createIndex=zt;ye.parseIndex=ki;ye.config=S;ye.parseQuery=Kt;Wi(ji);function Zi(i,t,e){const s=()=>{var l,a;return new ye((l=se(t))!==null&&l!==void 0?l:[],(a=se(e))===null||a===void 0?void 0:a.fuseOptions)},n=ee(s());return ge(()=>{var l;return(l=se(e))===null||l===void 0?void 0:l.fuseOptions},()=>{n.value=s()},{deep:!0}),ge(()=>se(t),l=>{n.value.setCollection(l)},{deep:!0}),{fuse:n,results:B(()=>{const l=se(e);if(l?.matchAllWhenSearchEmpty&&!se(i))return se(t).map((r,o)=>({item:r,refIndex:o}));const a=l?.resultLimit;return n.value.search(se(i),a?{limit:a}:void 0)})}}const en={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function tn(i){return i.replace(/[&<>"']/g,t=>en[t])}function sn(i){return/&(?:amp|lt|gt|quot|#39);/.test(i)}function ze(i){return sn(i)?i:tn(i)}function nn(i,t){let e="",s=0,n=!1;for(let l=i.length-1;l>=0;l--){if(i[l]===">")n=!0;else if(i[l]==="<"){n=!1,e=i[l]+e;continue}if(n||s++,s<=t)e=i[l]+e;else{e="..."+e;break}}return e}function mt(i,t,e,s){function n(l,a=[]){l=l||"";let r="",o=0;a.forEach(f=>{if(f.length===2&&f[0]===f[1])return;const g=f[1]+1,u=g-f[0]>=t.length;r+=[ze(l.substring(o,f[0])),u&&"<mark>",ze(l.substring(f[0],g)),u&&"</mark>"].filter(Boolean).join(""),o=g}),r+=ze(l.substring(o));const p=r.indexOf("<mark>");return p!==-1&&(r=nn(r,r.length-p)),r}if(i.matches?.length){for(const l of i.matches)if(!(e&&l.key!==e)&&!s?.includes(l.key))return n(l.value,l.indices)}}function ln(i,t){if(typeof i!="object"||i===null)return!1;const e=te(i,t);return e!=null&&e!==""}function gt(i,t){return t?{xs:44,sm:48,md:52,lg:56,xl:60}[i]:{xs:24,sm:28,md:32,lg:36,xl:40}[i]}function an(i,t,e,s){const n=gt(t,!0),l=gt(t,!1);return s?()=>n:e?a=>ln(i[a],e)?n:l:()=>l}const rn={slots:{root:"flex flex-col min-h-0 min-w-0 divide-y divide-default",input:"",close:"",back:"p-0",content:"relative overflow-hidden flex flex-col",footer:"p-1",viewport:"relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",item:"group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75",itemLeadingIcon:"shrink-0",itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex items-center",itemTrailingIcon:"shrink-0",itemTrailingHighlightedIcon:"shrink-0 text-dimmed hidden group-data-highlighted:inline-flex",itemTrailingKbds:"hidden lg:inline-flex items-center shrink-0",itemTrailingKbdsSize:"",itemWrapper:"flex-1 flex flex-col text-start min-w-0",itemLabel:"truncate space-x-1 text-dimmed",itemDescription:"truncate text-muted",itemLabelBase:"text-highlighted [&>mark]:text-inverted [&>mark]:bg-primary",itemLabelPrefix:"text-default",itemLabelSuffix:"text-dimmed [&>mark]:text-inverted [&>mark]:bg-primary"},variants:{virtualize:{true:{viewport:"p-1 isolate"},false:{viewport:"divide-y divide-default"}},size:{xs:{input:"[&>input]:h-10",empty:"py-3 text-xs",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailing:"gap-1",itemTrailingIcon:"size-4",itemTrailingHighlightedIcon:"size-4",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"sm"},sm:{input:"[&>input]:h-11",empty:"py-4 text-xs",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailing:"gap-1.5",itemTrailingIcon:"size-4",itemTrailingHighlightedIcon:"size-4",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"sm"},md:{input:"[&>input]:h-12",empty:"py-6 text-sm",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailing:"gap-1.5",itemTrailingIcon:"size-5",itemTrailingHighlightedIcon:"size-5",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"md"},lg:{input:"[&>input]:h-13",empty:"py-7 text-sm",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailing:"gap-2",itemTrailingIcon:"size-5",itemTrailingHighlightedIcon:"size-5",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"md"},xl:{input:"[&>input]:h-14",empty:"py-8 text-base",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailing:"gap-2",itemTrailingIcon:"size-6",itemTrailingHighlightedIcon:"size-6",itemTrailingKbds:"gap-0.5",itemTrailingKbdsSize:"lg"}},active:{true:{item:"text-highlighted before:bg-elevated",itemLeadingIcon:"text-default"},false:{item:["text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"]}},loading:{true:{itemLeadingIcon:"animate-spin"}}},defaultVariants:{size:"md"}},on=["innerHTML"],un=["innerHTML"],cn=Object.assign({inheritAttrs:!1},{__name:"UCommandPalette",props:Ke({as:{type:null,required:!1},size:{type:null,required:!1},icon:{type:null,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1,default:!0},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1,default:!0},backIcon:{type:null,required:!1},input:{type:[Boolean,Object],required:!1,default:!0},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},preserveGroupOrder:{type:Boolean,required:!1,default:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},multiple:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},selectionBehavior:{type:String,required:!1},by:{type:[String,Function],required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:Ke(["update:modelValue","highlight","entryFocus","leave","update:open"],["update:searchTerm"]),setup(i,{emit:t}){const e=i,s=t,n=Ue(),l=St(i,"searchTerm",{type:String,default:""}),{t:a}=Ct(),r=Et(),o=It("commandPalette",e),p=os(De(e,"as","disabled","multiple","modelValue","defaultValue","highlightOnHover","by"),s),f=vs(()=>e.virtualize?Re(typeof e.virtualize=="boolean"?{}:e.virtualize,{estimateSize:an(b.value,"md",e.descriptionKey,!!n["item-description"])}):!1),[g,u]=us({props:{item:{type:Object,required:!0},group:{type:Object,required:!1},index:{type:Number,required:!1}}}),d=B(()=>Ee({extend:Ee(rn),...r.ui?.commandPalette||{}})({size:e.size,virtualize:!!e.virtualize})),m=B(()=>Re({},e.fuse,{fuseOptions:{ignoreLocation:!0,threshold:.1,keys:[e.labelKey,"suffix"]},resultLimit:12,matchAllWhenSearchEmpty:!0})),v=ee([]),x=B(()=>v.value[v.value.length-1]?.placeholder||e.placeholder||a("commandPalette.placeholder")),E=B(()=>v.value?.length?[v.value[v.value.length-1]]:e.groups),I=B(()=>E.value?.filter(L=>L.id?!L.ignoreFilter:(console.warn("[@nuxt/ui] CommandPalette group is missing an `id` property"),!1))?.flatMap(L=>L.items?.map(_=>({..._,group:L.id}))||[])||[]),{results:O}=Zi(l,I,m),k=cs(O,16,!0);function F(L,_){let h=_;return L?.postFilter&&typeof L.postFilter=="function"&&(h=L.postFilter(l.value,h)),{...L,items:h.slice(0,m.value.resultLimit).map($=>({...$,labelHtml:mt($,l.value,e.labelKey),suffixHtml:mt($,l.value,void 0,[e.labelKey])}))}}const J=B(()=>{const L=E.value,_=k.value.reduce((A,T)=>{const{item:U,matches:j}=T;return U.group&&(A[U.group]||=[],A[U.group]?.push({...U,matches:j})),A},{});if(e.preserveGroupOrder){const A=[];for(const T of L||[]){if(!T.items?.length)continue;const U=T.ignoreFilter?T.items:_[T.id];if(!U?.length)continue;const j=F(T,U);j.items?.length&&A.push(j)}return A}const h=Object.entries(_).map(([A,T])=>{const U=L?.find(de=>de.id===A);if(!U)return;const j=F(U,T);return j.items?.length?j:void 0}).filter(A=>!!A);return(L?.map((A,T)=>({...A,index:T}))?.filter(A=>A.ignoreFilter&&A.items?.length)?.map(A=>({...F(A,A.items||[]),index:A.index}))?.filter(A=>A.items?.length)||[]).reduce((A,T)=>(A.splice(T.index,0,T),A),[...h])}),b=B(()=>J.value.flatMap(L=>L.items||[])),z=Lt("rootRef");function R(L){L.children?.length&&(v.value.push({id:`history-${v.value.length}`,label:L.label,slot:L.slot,placeholder:L.placeholder,items:L.children}),l.value="",z.value?.highlightFirstItem())}function W(){v.value.length&&(v.value.pop(),l.value="",z.value?.highlightFirstItem())}function Z(){l.value||W()}function G(L,_){_.children?.length?(L.preventDefault(),R(_)):_.onSelect?.(L)}return(L,_)=>(C(),V(ae,null,[X(c(g),null,{default:K(({item:h,index:$,group:A})=>[X(ds,H(c(hs)(h),{custom:""}),{default:K(({active:T,...U})=>[X(c(Qs),{value:e.valueKey?c(te)(h,e.valueKey):c(Oe)(h,["matches","group","onSelect","labelHtml","suffixHtml","children"]),disabled:h.disabled,"as-child":"",onSelect:j=>G(j,h)},{default:K(()=>[X(fs,H(U,{"data-slot":"item",class:d.value.item({class:[c(o)?.item,h.ui?.item,h.class],active:T||h.active})}),{default:K(()=>[N(L.$slots,h.slot||A?.slot||"item",{item:h,index:$,ui:d.value},()=>[N(L.$slots,h.slot?`${h.slot}-leading`:A?.slot?`${A.slot}-leading`:"item-leading",{item:h,index:$,ui:d.value},()=>[h.loading?(C(),D(Ae,{key:0,name:i.loadingIcon||c(r).ui.icons.loading,"data-slot":"itemLeadingIcon",class:q(d.value.itemLeadingIcon({class:[c(o)?.itemLeadingIcon,h.ui?.itemLeadingIcon],loading:!0}))},null,8,["name","class"])):h.icon?(C(),D(Ae,{key:1,name:h.icon,"data-slot":"itemLeadingIcon",class:q(d.value.itemLeadingIcon({class:[c(o)?.itemLeadingIcon,h.ui?.itemLeadingIcon],active:T||h.active}))},null,8,["name","class"])):h.avatar?(C(),D(ps,H({key:2,size:h.ui?.itemLeadingAvatarSize||c(o)?.itemLeadingAvatarSize||d.value.itemLeadingAvatarSize()},h.avatar,{"data-slot":"itemLeadingAvatar",class:d.value.itemLeadingAvatar({class:[c(o)?.itemLeadingAvatar,h.ui?.itemLeadingAvatar],active:T||h.active})}),null,16,["size","class"])):h.chip?(C(),D(ms,H({key:3,size:h.ui?.itemLeadingChipSize||c(o)?.itemLeadingChipSize||d.value.itemLeadingChipSize(),inset:"",standalone:""},h.chip,{"data-slot":"itemLeadingChip",class:d.value.itemLeadingChip({class:[c(o)?.itemLeadingChip,h.ui?.itemLeadingChip],active:T||h.active})}),null,16,["size","class"])):Y("",!0)]),h.prefix||h.labelHtml||c(te)(h,e.labelKey)||h.suffixHtml||h.suffix||n[h.slot?`${h.slot}-label`:A?.slot?`${A.slot}-label`:"item-label"]||c(te)(h,e.descriptionKey)||n[h.slot?`${h.slot}-description`:A?.slot?`${A.slot}-description`:"item-description"]?(C(),V("span",{key:0,"data-slot":"itemWrapper",class:q(d.value.itemWrapper({class:[c(o)?.itemWrapper,h.ui?.itemWrapper]}))},[Ze("span",{"data-slot":"itemLabel",class:q(d.value.itemLabel({class:[c(o)?.itemLabel,h.ui?.itemLabel],active:T||h.active}))},[N(L.$slots,h.slot?`${h.slot}-label`:A?.slot?`${A.slot}-label`:"item-label",{item:h,index:$,ui:d.value},()=>[h.prefix?(C(),V("span",{key:0,"data-slot":"itemLabelPrefix",class:q(d.value.itemLabelPrefix({class:[c(o)?.itemLabelPrefix,h.ui?.itemLabelPrefix]}))},fe(h.prefix),3)):Y("",!0),h.labelHtml?(C(),V("span",{key:1,"data-slot":"itemLabelBase",class:q(d.value.itemLabelBase({class:[c(o)?.itemLabelBase,h.ui?.itemLabelBase],active:T||h.active})),innerHTML:h.labelHtml},null,10,on)):(C(),V("span",{key:2,"data-slot":"itemLabelBase",class:q(d.value.itemLabelBase({class:[c(o)?.itemLabelBase,h.ui?.itemLabelBase],active:T||h.active}))},fe(c(te)(h,e.labelKey)),3)),h.suffixHtml?(C(),V("span",{key:3,"data-slot":"itemLabelSuffix",class:q(d.value.itemLabelSuffix({class:[c(o)?.itemLabelSuffix,h.ui?.itemLabelSuffix],active:T||h.active})),innerHTML:h.suffixHtml},null,10,un)):h.suffix?(C(),V("span",{key:4,"data-slot":"itemLabelSuffix",class:q(d.value.itemLabelSuffix({class:[c(o)?.itemLabelSuffix,h.ui?.itemLabelSuffix],active:T||h.active}))},fe(h.suffix),3)):Y("",!0)])],2),c(te)(h,e.descriptionKey)||n[h.slot?`${h.slot}-description`:A?.slot?`${A.slot}-description`:"item-description"]?(C(),V("span",{key:0,"data-slot":"itemDescription",class:q(d.value.itemDescription({class:[c(o)?.itemDescription,h.ui?.itemDescription]}))},[N(L.$slots,h.slot?`${h.slot}-description`:A?.slot?`${A.slot}-description`:"item-description",{item:h,index:$,ui:d.value},()=>[ke(fe(c(te)(h,e.descriptionKey)),1)])],2)):Y("",!0)],2)):Y("",!0),Ze("span",{"data-slot":"itemTrailing",class:q(d.value.itemTrailing({class:[c(o)?.itemTrailing,h.ui?.itemTrailing]}))},[N(L.$slots,h.slot?`${h.slot}-trailing`:A?.slot?`${A.slot}-trailing`:"item-trailing",{item:h,index:$,ui:d.value},()=>[h.children&&h.children.length>0?(C(),D(Ae,{key:0,name:i.childrenIcon||c(r).ui.icons.chevronRight,"data-slot":"itemTrailingIcon",class:q(d.value.itemTrailingIcon({class:[c(o)?.itemTrailingIcon,h.ui?.itemTrailingIcon]}))},null,8,["name","class"])):h.kbds?.length?(C(),V("span",{key:1,"data-slot":"itemTrailingKbds",class:q(d.value.itemTrailingKbds({class:[c(o)?.itemTrailingKbds,h.ui?.itemTrailingKbds]}))},[(C(!0),V(ae,null,me(h.kbds,(j,de)=>(C(),D(gs,H({key:de,size:h.ui?.itemTrailingKbdsSize||c(o)?.itemTrailingKbdsSize||d.value.itemTrailingKbdsSize()},{ref_for:!0},typeof j=="string"?{value:j}:j),null,16,["size"]))),128))],2)):A?.highlightedIcon?(C(),D(Ae,{key:2,name:A.highlightedIcon,"data-slot":"itemTrailingHighlightedIcon",class:q(d.value.itemTrailingHighlightedIcon({class:[c(o)?.itemTrailingHighlightedIcon,h.ui?.itemTrailingHighlightedIcon]}))},null,8,["name","class"])):Y("",!0)]),h.children?.length?Y("",!0):(C(),D(c(Zs),{key:0,"as-child":""},{default:K(()=>[X(Ae,{name:i.selectedIcon||c(r).ui.icons.check,"data-slot":"itemTrailingIcon",class:q(d.value.itemTrailingIcon({class:[c(o)?.itemTrailingIcon,h.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024))],2)])]),_:2},1040,["class"])]),_:2},1032,["value","disabled","onSelect"])]),_:2},1040)]),_:3}),X(c(Os),H({...c(p),...L.$attrs},{ref_key:"rootRef",ref:z,"selection-behavior":i.selectionBehavior,"data-slot":"root",class:d.value.root({class:[c(o)?.root,e.class]})}),{default:K(()=>[i.input?(C(),D(c($s),{key:0,modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=h=>l.value=h),"as-child":""},{default:K(()=>[X(ws,H({variant:"none",size:i.size},typeof e.input=="object"?e.input:{},{placeholder:x.value,autofocus:i.autofocus,loading:i.loading,"loading-icon":i.loadingIcon,"trailing-icon":i.trailingIcon,icon:i.icon||c(r).ui.icons.search,"data-slot":"input",class:d.value.input({class:c(o)?.input}),onKeydown:ve(Z,["backspace"])}),wt({_:2},[v.value?.length&&(i.back||n.back)?{name:"leading",fn:K(()=>[N(L.$slots,"back",{ui:d.value},()=>[X(et,H({size:i.size,icon:i.backIcon||c(r).ui.icons.arrowLeft,color:"neutral",variant:"link","aria-label":c(a)("commandPalette.back")},typeof i.back=="object"?i.back:{},{"data-slot":"back",class:d.value.back({class:c(o)?.back}),onClick:W}),null,16,["size","icon","aria-label","class"])])]),key:"0"}:void 0,i.close||n.close?{name:"trailing",fn:K(()=>[N(L.$slots,"close",{ui:d.value},()=>[i.close?(C(),D(et,H({key:0,size:i.size,icon:i.closeIcon||c(r).ui.icons.close,color:"neutral",variant:"ghost","aria-label":c(a)("commandPalette.close")},typeof i.close=="object"?i.close:{},{"data-slot":"close",class:d.value.close({class:c(o)?.close}),onClick:_[0]||(_[0]=h=>s("update:open",!1))}),null,16,["size","icon","aria-label","class"])):Y("",!0)])]),key:"1"}:void 0]),1040,["size","placeholder","autofocus","loading","loading-icon","trailing-icon","icon","class"])]),_:3},8,["modelValue"])):Y("",!0),X(c(Rs),{"data-slot":"content",class:q(d.value.content({class:c(o)?.content}))},{default:K(()=>[J.value?.length?(C(),V("div",{key:0,role:"presentation","data-slot":"viewport",class:q(d.value.viewport({class:c(o)?.viewport}))},[i.virtualize?(C(),D(c(fi),H({key:0,options:b.value,"text-content":h=>c(te)(h,e.labelKey)},f.value),{default:K(({option:h,virtualItem:$})=>[X(c(u),{item:h,index:$.index},null,8,["item","index"])]),_:1},16,["options","text-content"])):(C(!0),V(ae,{key:1},me(J.value,h=>(C(),D(c(Ns),{key:`group-${h.id}`,"data-slot":"group",class:q(d.value.group({class:c(o)?.group}))},{default:K(()=>[c(te)(h,e.labelKey)?(C(),D(c(Ws),{key:0,"data-slot":"label",class:q(d.value.label({class:c(o)?.label}))},{default:K(()=>[ke(fe(c(te)(h,e.labelKey)),1)]),_:2},1032,["class"])):Y("",!0),(C(!0),V(ae,null,me(h.items,($,A)=>(C(),D(c(u),{key:`group-${h.id}-${A}`,item:$,index:A,group:h},null,8,["item","index","group"]))),128))]),_:2},1032,["class"]))),128))],2)):(C(),V("div",{key:1,"data-slot":"empty",class:q(d.value.empty({class:c(o)?.empty}))},[N(L.$slots,"empty",{searchTerm:l.value},()=>[ke(fe(l.value?c(a)("commandPalette.noMatch",{searchTerm:l.value}):c(a)("commandPalette.noData")),1)])],2))]),_:3},8,["class"]),n.footer?(C(),V("div",{key:1,"data-slot":"footer",class:q(d.value.footer({class:c(o)?.footer}))},[N(L.$slots,"footer",{ui:d.value})],2)):Y("",!0)]),_:3},16,["selection-behavior","class"])],64))}}),dn={slots:{modal:"",input:""},variants:{fullscreen:{false:{modal:"sm:max-w-3xl h-full sm:h-[28rem]"}},size:{xs:{},sm:{},md:{},lg:{},xl:{}}},defaultVariants:{size:"md"}},hn=/^[^-]+.*-.*[^-]+$/,fn=/^[^_]+.*_.*[^_]+$/,vt=["arrowleft","arrowright","arrowup","arrowright","tab","escape","enter","backspace"];function Te(i){return/^[a-z]$/i.test(i)?`Key${i.toUpperCase()}`:/^\d$/.test(i)?`Digit${i}`:/^f\d+$/i.test(i)?i.toUpperCase():{space:"Space",enter:"Enter",escape:"Escape",tab:"Tab",backspace:"Backspace",delete:"Delete",arrowup:"ArrowUp",arrowdown:"ArrowDown",arrowleft:"ArrowLeft",arrowright:"ArrowRight"}[i.toLowerCase()]||i}function pn(i,t={}){const e=ee([]),s=()=>{e.value.splice(0,e.value.length)},n=ys(s,t.chainDelay??800),{macOS:l}=bs(),a=As(),r=t.layoutIndependent??!1,o=vt.map(u=>Te(u)),p=u=>{if(!u.key)return;const d=r?/^Key[A-Z]$/i.test(u.code):/^[a-z]{1}$/i.test(u.key),m=r?o.includes(u.code):vt.includes(u.key.toLowerCase());let v;if(e.value.push(r?u.code:u.key),e.value.length>=2){v=e.value.slice(-2).join("-");for(const x of g.value.filter(E=>E.chained))if(x.key===v){x.enabled&&(u.preventDefault(),x.handler(u)),s();return}}for(const x of g.value.filter(E=>!E.chained)){if(r){if(u.code!==x.key)continue}else if(u.key.toLowerCase()!==x.key)continue;if(u.metaKey===x.metaKey&&u.ctrlKey===x.ctrlKey&&u.altKey===x.altKey&&!((d||m||x.shiftKey||u.shiftKey&&(u.metaKey||u.ctrlKey))&&u.shiftKey!==x.shiftKey)){x.enabled&&(u.preventDefault(),x.handler(u)),s();return}}n()},f=B(()=>{const u=a.value?.tagName,d=a.value?.contentEditable;return u==="INPUT"||u==="TEXTAREA"||d==="true"||d==="plaintext-only"?a.value?.name||!0:!1}),g=B(()=>Object.entries(se(i)).map(([u,d])=>{if(!d)return null;let m;u.includes("-")&&u!=="-"&&!u.includes("_")&&!u.match(hn)?.length&&console.trace(`[Shortcut] Invalid key: "${u}"`),u.includes("_")&&u!=="_"&&!u.match(fn)?.length&&console.trace(`[Shortcut] Invalid key: "${u}"`);const v=u.includes("-")&&u!=="-"&&!u.includes("_");if(v)r?m={key:u.split("-").map(I=>Te(I)).join("-"),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1}:m={key:u.toLowerCase(),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1};else{const E=u.toLowerCase().split("_").map(O=>O);let I=E.filter(O=>!["meta","command","ctrl","shift","alt","option"].includes(O)).join("_");r&&(I=Te(I)),m={key:I,metaKey:E.includes("meta")||E.includes("command"),ctrlKey:E.includes("ctrl"),shiftKey:E.includes("shift"),altKey:E.includes("alt")||E.includes("option")}}if(m.chained=v,!l.value&&m.metaKey&&!m.ctrlKey&&(m.metaKey=!1,m.ctrlKey=!0),typeof d=="function"?m.handler=d:typeof d=="object"&&(m={...m,handler:d.handler}),!m.handler)return console.trace("[Shortcut] Invalid value"),null;let x=!0;return d.usingInput?typeof d.usingInput=="string"&&(x=f.value===d.usingInput):x=!f.value,m.enabled=x,m}).filter(Boolean));return xs("keydown",p)}const yn={__name:"UContentSearch",props:Ke({size:{type:null,required:!1},icon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},shortcut:{type:String,required:!1,default:"meta_k"},links:{type:Array,required:!1},navigation:{type:Array,required:!1},groups:{type:Array,required:!1},files:{type:Array,required:!1},fuse:{type:Object,required:!1},colorMode:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},overlay:{type:Boolean,required:!1},transition:{type:Boolean,required:!1},content:{type:Object,required:!1},dismissible:{type:Boolean,required:!1},fullscreen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:["update:searchTerm"],setup(i,{expose:t}){const e=i,s=Ue(),n=St(i,"searchTerm",{type:String,default:""}),{t:l}=Ct(),{open:a,mapNavigationItems:r,postFilter:o}=Ss(),p=Cs(),f=Et(),g=It("contentSearch",e),u=tt(De(e,"size","icon","placeholder","autofocus","loading","loadingIcon","close","closeIcon")),d=tt(De(e,"overlay","transition","content","dismissible","fullscreen","modal","portal")),m=()=>Oe(s,["content"]),v=B(()=>Re({},e.fuse,{fuseOptions:{includeMatches:!0}})),x=B(()=>Ee({extend:Ee(dn),...f.ui?.contentSearch||{}})({size:e.size,fullscreen:e.fullscreen})),E=Lt("commandPaletteRef"),I=B(()=>e.links?.length?e.links.flatMap(b=>[{...b,suffix:b.description,description:void 0,icon:b.icon||f.ui.icons.file,children:void 0},...b.children?.map(z=>({...z,prefix:b.label+" >",suffix:z.description,description:void 0,icon:z.icon||b.icon||f.ui.icons.file}))||[]]):[]),O=B(()=>e.navigation?.length?e.navigation.some(b=>!!b.children?.length)?e.navigation.map(b=>({id:b.path,label:b.title,items:r(b.children||[],e.files||[]),postFilter:o})):[{id:"docs",items:r(e.navigation,e.files||[]),postFilter:o}]:[]),k=B(()=>!e.colorMode||p?.forced?null:{id:"theme",label:l("contentSearch.theme"),items:[{label:l("colorMode.system"),icon:f.ui.icons.system,active:p.preference==="system",onSelect:()=>{p.preference="system"}},{label:l("colorMode.light"),icon:f.ui.icons.light,active:p.preference==="light",onSelect:()=>{p.preference="light"}},{label:l("colorMode.dark"),icon:f.ui.icons.dark,active:p.preference==="dark",onSelect:()=>{p.preference="dark"}}]}),F=B(()=>{const b=[];return I.value.length&&b.push({id:"links",label:l("contentSearch.links"),items:I.value}),b.push(...O.value),b.push(...e.groups||[]),k.value&&b.push(k.value),b});function J(b){b.disabled||(a.value=!1,n.value="")}return pn({[e.shortcut]:{usingInput:!0,handler:()=>a.value=!a.value}}),t({commandPaletteRef:E}),(b,z)=>(C(),D(Ls,H({open:c(a),"onUpdate:open":z[2]||(z[2]=R=>Is(a)?a.value=R:null),title:i.title||c(l)("contentSearch.title"),description:i.description||c(l)("contentSearch.description")},c(d),{"data-slot":"modal",class:x.value.modal({class:[c(g)?.modal,e.class]})}),{content:K(R=>[N(b.$slots,"content",st(it(R)),()=>[X(cn,H({ref_key:"commandPaletteRef",ref:E,"search-term":n.value,"onUpdate:searchTerm":z[0]||(z[0]=W=>n.value=W)},c(u),{groups:F.value,fuse:v.value,input:{fixed:!0},ui:c(Es)(c(Oe)(x.value,["modal"]),c(g)),"onUpdate:modelValue":J,"onUpdate:open":z[1]||(z[1]=W=>a.value=W)}),wt({_:2},[me(m(),(W,Z)=>({name:Z,fn:K(G=>[N(b.$slots,Z,st(it(G)))])}))]),1040,["search-term","groups","fuse","ui"])])]),_:3},16,["open","title","description","class"]))}};export{yn as default};