1import{v as b,a1 as T,L as g,H as O,b as d,K as D,ab as _,R as h,A as i,e as l,ax as C,a4 as N,az as H,x as f}from"./q-B7_OLekH.js";import{_ as m}from"./q-BKZ00VYc.js";import{s as q}from"./q-Bmc9iZ7v.js";import{S as j,e as Z}from"./q-9rfzHdSS.js";import{c as $,d as J}from"./q-DCXBv3i3.js";import{V as A}from"./q-BdjGOZ__.js";import{H as ee,a as te,b as le,c as oe,d as ae,e as ne,f as re,g as se,h as ie}from"./q-C5Vbajvp.js";const ue=({track:e})=>{const[a,o,t]=b(),n=e(()=>t.value),s=e(()=>o.options);if(o.onSearchChange$)a.value=s;else if(!(o.searchable??!1)||!n)a.value=s;else{const v=n.toLowerCase();a.value=s.filter(c=>c.label.toLowerCase().includes(v)||c.value.toLowerCase().includes(v)||c.searchTags?.toLowerCase().includes(v))}},ce=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_z0cgJ6GHCAc:ue},Symbol.toStringTag,{value:"Module"})),de=(e,a)=>{const[o,t]=b();if(e.stopPropagation(),Array.isArray(t.value)){const n=t.value.filter(s=>s!==a);t.value=n,o.onChange$?.(n.length>0?n:void 0)}},_e=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_8t1Xil957Qo:de},Symbol.toStringTag,{value:"Module"})),me=e=>{T();const a=(e.size??"md")==="xs",o=e.leadingIconName?q[e.leadingIconName]:null,t=g(e.multiple??!1?Array.isArray(e.value)?e.value.map(String):e.value!==void 0?[String(e.value)]:[]:e.value!==void 0?String(e.value):"");O(d(()=>m(()=>Promise.resolve().then(()=>he),void 0),"s_zdyL50IH0zQ",[e,t]));const n=g(""),s=g(!1),v=g(e.options),c=g(!1);O(d(()=>m(()=>Promise.resolve().then(()=>je),void 0),"s_2bw5TwFOrvY",[s,e])),O(d(()=>m(()=>Promise.resolve().then(()=>Ie),void 0),"s_CidVAsbKioY",[e,n])),O(d(()=>m(()=>Promise.resolve().then(()=>ce),void 0),"s_z0cgJ6GHCAc",[v,e,n]));const S=d(()=>m(()=>Promise.resolve().then(()=>we),void 0),"s_6kj1rbVC8II",[e,n,t,c]),M=d(()=>m(()=>Promise.resolve().then(()=>_e),void 0),"s_8t1Xil957Qo",[e,t]),U=d(()=>m(()=>Promise.resolve().then(()=>Le),void 0),"s_3Re7egyhfuA",[e,n,t]),w=g(),L=g(0);D(d(()=>m(()=>import("./q-BfJjICST.js"),[]),"s_pOZkqHd9D0Q",[s,e,n,t,c,w])),D(d(()=>m(()=>import("./q-CZeSQIoA.js"),[]),"s_083eWojnFRU",[w,L]));const V=d(()=>m(()=>Promise.resolve().then(()=>ve),void 0),"s_7zhM4AuZiDM",[s,e]),W=d(()=>m(()=>Promise.resolve().then(()=>xe),void 0),"s_aGb0eFPXSzU",[e,n,t,c,w]),p=!(e.multiple??!1)&&t.value&&!Array.isArray(t.value)?e.options.find(r=>String(r.value)===t.value):void 0,z=p?.label,F=!(e.multiple??!1)&&!(e.hideSelectedLabel??!1)&&z&&!n.value,E=!(e.hideSelectedLabel??!1)&&!(e.multiple??!1)&&t.value&&!n.value?z||(e.placeholder??"Select..."):(e.multiple??!1)&&Array.isArray(t.value)&&t.value.length>0?"":e.placeholder??"Select...",X=!(e.multiple??!1)&&!(e.hideSelectedLabel??!1)&&!!p?.icon&&!n.value,G=e.multiple??!1?Array.isArray(t.value)&&t.value.length>0:t.value&&t.value!=="";return _("div",{class:A(a?"inline-block":"w-full",e.class)},null,[e.label&&_("label",null,{class:"block text-xs font-regular opacity-70 mb-1.5"},h(r=>r.label,[e]),3,"mo_0"),i(ie,{"bind:value":t,onChange$:S,"bind:open":s,get multiple(){return e.multiple??!1},get disabled(){return e.disabled},filter:!1,class:A("relative",a?"w-auto":"w-full"),children:[_("div",{class:A("relative",a?"w-auto":"w-full")},null,i(ee,{ref:w,class:A("group relative flex items-center gap-2 border text-left font-medium",a?"w-auto min-w-[120px] max-w-[260px] rounded-md h-8 px-2 text-xs":"w-full rounded-full h-11 sm:h-12 px-4 text-base sm:text-sm","bg-[var(--ui-bg-muted)]/50","transition-colors duration-200",e.error?"border-red-400/60 hover:border-red-400/80 focus-within:border-red-400":"border-default hover:border-[var(--ui-border-accented)] hover:bg-[var(--ui-bg-muted)]/80 focus-within:border-amber-500 focus-within:bg-[var(--ui-bg-muted)] focus-within:ring-1 focus-within:ring-amber-500/50","data-[open]:border-amber-500 data-[open]:bg-[var(--ui-bg-muted)] data-[open]:ring-1 data-[open]:ring-amber-500/50",e.disabled&&"opacity-50 cursor-not-allowed pointer-events-none"),onClick$:d(()=>m(()=>Promise.resolve().then(()=>Ce),void 0),"s_o2CjIUU9V28",[s,e]),children:[o&&i(o,{class:"h-3.5 w-3.5 text-muted shrink-0",[l]:{class:l}},3,"mo_1"),_("div",null,{class:"flex grow flex-wrap items-center gap-1.5 overflow-hidden"},[X&&i(j,{get src(){return p.icon},modifiers:{width:20,height:20},class:"h-5 w-5 shrink-0",[l]:{src:C(p,"icon"),modifiers:l,class:l}},3,p.icon),(e.multiple??!1)&&Array.isArray(t.value)&&t.value.map(r=>{T();const x=e.options.find(y=>String(y.value)===r);return _("span",null,{class:"inline-flex items-center gap-1 rounded-md bg-muted border border-default px-2 py-0.5 text-xs font-medium text-highlighted z-10"},[x?.icon&&i(j,{get src(){return x.icon},modifiers:{width:14,height:14},class:"w-3.5 h-3.5",[l]:{src:C(x,"icon"),modifiers:l,class:l}},3,"mo_2"),x?.label||r,(e.clearable??!1)&&_("button",{onPointerDown$:d(()=>m(()=>Promise.resolve().then(()=>Se),void 0),"s_pt2ESkU021s",[M,r])},{type:"button",class:"cursor-pointer rounded-full p-0.5 hover:bg-[var(--ui-bg-accented)] hover:text-red-400 focus:outline-none"},i($,{class:"h-3 w-3",[l]:{class:l}},3,"mo_3"),0,"mo_4")],1,r)}),_("div",null,{class:"relative flex-1 min-w-[50px]"},i(te,{size:Math.max(4,(E?.length??0)+1),class:["w-full bg-transparent focus:outline-none font-medium truncate text-highlighted",F?"placeholder:text-[var(--ui-text-highlighted)]":"placeholder:text-[var(--ui-text-muted)]"],placeholder:E,"bind:value":n,get readOnly(){return!(e.searchable??!1)},get disabled(){return e.disabled},onClick$:V,onFocus$:V,onBlur$:W,get style(){return{cursor:e.searchable??!1?"text":"pointer"}},[l]:{"bind:value":l,readOnly:h(r=>!(r.searchable??!1),[e]),disabled:h(r=>r.disabled,[e]),onClick$:l,onFocus$:l,onBlur$:l,style:h(r=>({cursor:r.searchable??!1?"text":"pointer"}),[e])}},3,"mo_5"),1,null)],1,null),_("div",null,{class:"flex items-center gap-1 shrink-0"},[(e.clearable??!1)&&G&&_("button",null,{type:"button",class:"cursor-pointer rounded-full p-1 text-muted hover:bg-[var(--ui-bg-accented)] hover:text-red-400 transition-colors z-10",onClick$:U},i($,{class:"h-4 w-4",[l]:{class:l}},3,"mo_6"),1,"mo_7"),i(le,{class:"group-data-[open]:rotate-180 transition-transform duration-200 text-muted",children:i(J,{class:"h-4 w-4",[l]:{class:l}},3,"mo_8"),[l]:{class:l}},1,"mo_9")],1,null)],[l]:{ref:l,onClick$:l}},1,"mo_10"),1,null),i(oe,{flip:!0,gutter:4,class:"z-[9999] rounded-2xl border border-default bg-muted p-1 shadow-xl transition-opacity duration-150 data-[open]:opacity-100 data-[closed]:opacity-0 data-[closed]:pointer-events-none",get style(){return{width:`${L.value}px`}},children:_("div",null,{class:"max-h-60 overflow-y-auto p-1 scrollbar-thin scrollbar-thumb-[var(--ui-border)] scrollbar-track-transparent"},(()=>{const r=v.value,x=(e.displayLimit??50)>0?e.displayLimit??50:r.length,y=t.value,Q=Array.isArray(y)?y:y?[y]:[],k=r.slice(0,x),Y=ne
1w Set(k.map(u=>u.value)),B=Q.filter(u=>!Y.has(u)).map(u=>r.find(I=>I.value===u)).filter(Boolean),P=[...k,...B],R=r.length,K=R>P.length;return P.length===0?i(ae,{class:"px-3 py-6 text-sm text-muted text-center",children:"No results found",[l]:{class:l}},3,"mo_11"):i(N,{children:[P.map(u=>{T();const I=e.multiple??!1?Array.isArray(t.value)&&t.value.includes(u.value):t.value===u.value;return i(ne,{get value(){return u.value},get disabled(){return u.disabled},class:A("group flex cursor-pointer select-none items-center justify-between","rounded-lg px-3 py-2 text-sm font-medium outline-none transition-all duration-150","text-default data-[highlighted]:bg-[var(--ui-bg-accented)] data-[highlighted]:text-[var(--ui-text-highlighted)]","data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",I&&"bg-primary/10 text-primary"),children:[_("div",null,{class:"flex items-center gap-2"},[u.icon&&i(j,{get src(){return u.icon},modifiers:{width:20,height:20},class:"w-5 h-5 shrink-0",[l]:{src:C(u,"icon"),modifiers:l,class:l}},3,"mo_12"),i(re,{children:H(u,"label")},1,"mo_13")],1,null),I&&i(se,{children:i(Z,{class:"h-4 w-4",[l]:{class:l}},3,"mo_14")},1,"mo_15")],[l]:{value:C(u,"value"),disabled:C(u,"disabled")}},1,u.value)}),K&&_("div",null,{class:"px-3 py-2 text-xs text-center text-muted border-t border-default mt-1 pt-2"},["Showing ",H(P,"length")," of ",R," â type to filter more"],1,"mo_16")]},1,"mo_17")})(),1,null),[l]:{flip:l,gutter:l,class:l,style:h(r=>({width:`${r.value}px`}),[L])}},1,"mo_18")],[l]:{"bind:value":l,onChange$:l,"bind:open":l,multiple:h(r=>r.multiple??!1,[e]),disabled:h(r=>r.disabled,[e]),filter:l}},1,"mo_19"),e.error&&_("p",null,{class:"mt-1 text-xs text-red-500"},h(r=>r.error,[e]),3,"mo_20")],1,"mo_21")},$e=Object.freeze(Object.defineProperty({__proto__:null,s_Ujc2fpItrjA:me},Symbol.toStringTag,{value:"Module"})),be=()=>{const[e,a]=b();a.disabled||e.value||(e.value=!0)},ve=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_7zhM4AuZiDM:be},Symbol.toStringTag,{value:"Module"})),fe=({track:e})=>{const[a,o]=b(),t=e(()=>a.value);if(a.multiple??!1)if(Array.isArray(t)){const n=t.map(String),s=Array.isArray(o.value)?o.value:[];n.length===s.length&&n.every(S=>s.includes(S))||(o.value=n)}else if(t!=null){const n=[String(t)],s=Array.isArray(o.value)?o.value:[];n.length===s.length&&n.every(S=>s.includes(S))||(o.value=n)}else{if(Array.isArray(o.value)&&o.value.length===0)return;o.value=[]}else if(t==null){if(o.value==="")return;o.value=""}else{const n=String(t);if(o.value===n)return;o.value=n}},he=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_zdyL50IH0zQ:fe},Symbol.toStringTag,{value:"Module"})),ge=()=>{const[e,a,o,t,n]=b();if(e.hideSelectedLabel??!1){const s=!(e.multiple??!1)&&o.value&&!Array.isArray(o.value)?e.options.find(c=>String(c.value)===o.value)?.label:void 0,v=!!s&&a.value===s;if(t.value||v){a.value="";const c=n.value?.querySelector("input");c&&(c.value="",requestAnimationFrame(()=>{c.value=""})),t.value=!1}}e.onBlur$?.()},xe=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_aGb0eFPXSzU:ge},Symbol.toStringTag,{value:"Module"})),ye=e=>{const[a,o]=b();return a(e,o)},Se=Object.freeze(Object.defineProperty({__proto__:null,s_pt2ESkU021s:ye},Symbol.toStringTag,{value:"Module"})),pe=()=>{const[e,a]=b();a.disabled||e.value||(e.value=!0)},Ce=Object.freeze(Object.defineProperty({__proto__:null,s_o2CjIUU9V28:pe},Symbol.toStringTag,{value:"Module"})),Ae=e=>{const[a,o,t,n]=b();t.value=e,a.hideSelectedLabel??!1?n.value=!0:(a.multiple??!1)||(o.value=""),a.onChange$?.(Array.isArray(e)&&e.length===0||e===""?void 0:e)},we=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_6kj1rbVC8II:Ae},Symbol.toStringTag,{value:"Module"})),Pe=({track:e})=>{const[a,o]=b(),t=e(()=>o.value);a.onSearchChange$?.(t)},Ie=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_CidVAsbKioY:Pe},Symbol.toStringTag,{value:"Module"})),Oe=e=>{const[a,o,t]=b();e.stopPropagation();const n=a.multiple??!1?[]:"";t.value=n,o.value="",a.onChange$?.(void 0)},Le=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_3Re7egyhfuA:Oe},Symbol.toStringTag,{value:"Module"})),Te=({track:e})=>{const[a,o]=b();e(()=>
1o.disabled),o.disabled&&a.value&&(a.value=!1)},je=Object.freeze(Object.defineProperty({__proto__:null,_hW:f,s_2bw5TwFOrvY:Te},Symbol.toStringTag,{value:"Module"}));export{f as _hW,$e as c,Te as s_2bw5TwFOrvY,Oe as s_3Re7egyhfuA,Ae as s_6kj1rbVC8II,be as s_7zhM4AuZiDM,de as s_8t1Xil957Qo,Pe as s_CidVAsbKioY,me as s_Ujc2fpItrjA,ge as s_aGb0eFPXSzU,pe as s_o2CjIUU9V28,ye as s_pt2ESkU021s,ue as s_z0cgJ6GHCAc,fe as s_zdyL50IH0zQ};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.