import{B as e,D as t,E as n,H as r,It as i,L as a,Mt as o,O as ee,Q as s,R as te,U as ne,V as re,W as c,Z as l,_t as u,at as d,d as ie,ft as f,g as ae,ht as p,i as oe,jt as se,mt as m,ot as ce,pt as le,r as ue,s as h,st as de,t as fe,tt as g,yt as _}from"./BA99CCI5.js";import"./xihTtKlq.js";import"./DGo8yE5j.js";import{t as pe}from"./ELQnUoYO.js";import{t as v}from"./_ZYKMtmp.js";import{t as me}from"./CBnPEgB1.js";import{t as he}from"./B66v-P2b.js";import{t as ge}from"./B_SLuu8u2.js";import{t as _e}from"./C3FImjIr2.js";var ve=c(`<span> </span>`),ye=c(`<div><!> <div><!> <!></div></div>`);function y(c,y){o(y,!1);let b=p(),x=p(),S=p(),C=p(),w=p(),T=p(),E=p(),D=p(),O=p(),k=p(),A=h(y,`label`,8,void 0),j=h(y,`value`,8),M=h(y,`options`,8),N=h(y,`placeholder`,8,`Select...`),be=h(y,`minWidth`,8,`8rem`),xe=h(y,`position`,8,`left`),Se=h(y,`mobilePosition`,8,null),Ce=h(y,`placement`,8,`auto`),P=h(y,`compact`,8,!1),F=h(y,`compactButton`,8,void 0),I=h(y,`compactDropdown`,8,void 0),L=h(y,`compactDropdownThreshold`,8,0),R=h(y,`responsiveButton`,8,!1),z=h(y,`responsiveDropdown`,8,!1),we=h(y,`mobileDropdownShortLabels`,8,!1),B=h(y,`fullWidth`,8,!1),Te=h(y,`fixed`,8,!1),V=h(y,`width`,8,void 0),H=h(y,`justify`,8,null),U=h(y,`disabled`,8,!1),W=h(y,`buttonSize`,8,null),Ee=h(y,`menuOnboarding`,8,void 0),De=fe(),G=p(!1),K=p(!1),q=null,J=p(),Y=p(`bottom`);oe(()=>{(R()||z())&&typeof window<`u`&&(q=window.matchMedia(`(max-width: 1279px)`),u(K,q.matches),q.addEventListener(`change`,X))}),ue(()=>{q&&q.removeEventListener(`change`,X)});function X(e){u(K,e.matches)}function Oe(e){return we()&&s(K)?e.shortLabel??e.label:e.label}function ke(e){De(`change`,e),u(G,!1)}d(()=>(l(M()),l(j())),()=>{u(b,M().find(e=>e.value===j()))}),d(()=>s(b),()=>{u(x,s(b)?.icon??null)}),d(()=>(s(b),l(N())),()=>{u(S,s(b)?.shortLabel?s(b).shortLabel:s(b)?.label||N())}),d(()=>s(b),()=>{u(C,!s(b))}),d(()=>(l(F()),l(R()),s(K),l(P())),()=>{u(w,F()??(R()?s(K):P()))}),d(()=>(l(I()),l(z()),s(K),l(L()),l(M()),l(P())),()=>{u(T,I()===void 0?z()&&s(K)?!0:L()>0&&M().length>=L()||P():I())}),d(()=>(l(W()),s(w)),()=>{u(E,W()??(s(w)?`xs`:`sm`))}),d(()=>(l(H()),l(B()),l(V())),()=>{u(D,H()??(B()||V()?`between`:`center`))}),d(()=>(s(G),s(Y),v),()=>{u(O,s(G)&&s(Y)===`top`?me:v)}),d(()=>s(w),()=>{u(k,s(w)?`text-xs text-neutral-500 dark:text-neutral-400`:`text-sm text-neutral-500 dark:text-neutral-400`)}),ce(),ie();var Z=ye();let Ae;var je=f(Z),Me=e=>{var a=ve(),o=f(a,!0);i(a),de(()=>{n(a,1,t(s(k))),re(o,A())}),r(e,a)};e(je,e=>{A()&&e(Me)});var Q=m(je,2);let Ne;var $=f(Q);{let e=_(()=>s(C)?`text-neutral-400 dark:text-neutral-500`:``);he($,{get text(){return s(S)},get icon(){return s(O)},iconPosition:`right`,get leadingIcon(){return s(x)},get size(){return s(E)},get fullWidth(){return B()},get disabled(){return U()},get justify(){return s(D)},get textColor(){return s(e)},$$events:{click:()=>!U()&&u(G,!s(G))}})}var Pe=m($,2),Fe=e=>{pe(e,{get position(){return xe()},get mobilePosition(){return Se()},get placement(){return Ce()},get minWidth(){return be()},get compact(){return s(T)},get fixed(){return Te()},get triggerEl(){return s(J)},get onboarding(){return Ee()},$$events:{placementchange:e=>u(Y,e.detail)},children:(e,t)=>{var n=ne(),i=le(n);a(i,1,M,te,(e,t)=>{{let n=_(()=>(s(t),g(()=>Oe(s(t))))),r=_(()=>(l(j()),s(t),g(()=>j()===s(t).value)));_e(e,{get label(){return s(n)},get icon(){return s(t),g(()=>s(t).icon)},get selected(){return s(r)},get compact(){return s(T)},$$events:{click:()=>ke(s(t).value)}})}}),r(e,n)},$$slots:{default:!0}})};e(Pe,e=>{s(G)&&e(Fe)}),i(Q),ae(Q,e=>u(J,e),()=>s(J)),ee(Q,(e,t)=>ge?.(e,t),()=>()=>u(G,!1)),i(Z),de(()=>{Ae=n(Z,1,`flex items-center gap-2 ${V()??``??``}`,null,Ae,{"w-full":B()&&!V()}),Ne=n(Q,1,`relative`,null,Ne,{"flex-1":B()})}),r(c,Z),se()}export{y as t};