import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{$P as t,TO as n,aD as r}from"./lucide-C4oWPzu4.js";import{p as i,t as a}from"./utils-Bs-0X7qI.js";import{r as o}from"./bundle-mjs-C4g7ASB5.js";import{o as s,r as c,t as l}from"./popover-IgibKFXN.js";import{t as u}from"./separator-rMQ-O2ZT.js";import{t as d}from"./button-B-NlEi4h.js";import{t as f}from"./badge-CoY2mFvb.js";import{a as p,c as m,i as h,o as g,r as _,s as v,t as y}from"./command-UrZBX4CI.js";var b=i();e(t(),1);var x=o();function S(e){let t=(0,b.c)(39),{className:i,title:o,options:S,selectedValue:C,onSelectionChange:w}=e,T;if(t[0]!==S||t[1]!==C){let e;t[3]===C?e=t[4]:(e=e=>e.value===C,t[3]=C,t[4]=e),T=S.find(e),t[0]=S,t[1]=C,t[2]=T}else T=t[2];let E=T,D;t[5]===i?D=t[6]:(D=a(`border-dashed`,i),t[5]=i,t[6]=D);let O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,x.jsx)(r,{className:`mr-2 size-4`}),t[7]=O):O=t[7];let k;t[8]!==E||t[9]!==C?(k=C&&E&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(u,{orientation:`vertical`,className:`mx-2 h-4`}),(0,x.jsx)(f,{variant:`secondary`,className:`rounded-sm px-1 font-normal`,children:E.label})]}),t[8]=E,t[9]=C,t[10]=k):k=t[10];let A;t[11]!==D||t[12]!==k||t[13]!==o?(A=(0,x.jsx)(s,{asChild:!0,children:(0,x.jsxs)(d,{variant:`outline`,size:`sm`,className:D,children:[O,o,k]})}),t[11]=D,t[12]=k,t[13]=o,t[14]=A):A=t[14];let j;t[15]===o?j=t[16]:(j=(0,x.jsx)(p,{placeholder:o}),t[15]=o,t[16]=j);let M;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,x.jsx)(_,{children:`未找到结果`}),t[17]=M):M=t[17];let N;if(t[18]!==w||t[19]!==S||t[20]!==C){let e;t[22]!==w||t[23]!==C?(e=e=>{let t=C===e.value;return(0,x.jsxs)(g,{onSelect:()=>{w(t?void 0:e.value)},children:[(0,x.jsx)(`div`,{className:a(`border-primary mr-2 flex size-4 items-center justify-center rounded-sm border`,t?`bg-primary text-primary-foreground`:`opacity-50 [&_svg]:invisible`),children:(0,x.jsx)(n,{className:`size-4`})}),e.icon&&(0,x.jsx)(e.icon,{className:`text-muted-foreground mr-2 size-4`}),(0,x.jsx)(`span`,{children:e.label})]},e.value)},t[22]=w,t[23]=C,t[24]=e):e=t[24],N=S.map(e),t[18]=w,t[19]=S,t[20]=C,t[21]=N}else N=t[21];let P;t[25]===N?P=t[26]:(P=(0,x.jsx)(h,{children:N}),t[25]=N,t[26]=P);let F;t[27]!==w||t[28]!==C?(F=C&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(m,{}),(0,x.jsx)(h,{children:(0,x.jsx)(g,{onSelect:()=>w(void 0),className:`justify-center text-center`,children:`清除筛选`})})]}),t[27]=w,t[28]=C,t[29]=F):F=t[29];let I;t[30]!==F||t[31]!==P?(I=(0,x.jsxs)(v,{children:[M,P,F]}),t[30]=F,t[31]=P,t[32]=I):I=t[32];let L;t[33]!==I||t[34]!==j?(L=(0,x.jsx)(c,{className:`w-[200px] p-0`,align:`start`,children:(0,x.jsxs)(y,{children:[j,I]})}),t[33]=I,t[34]=j,t[35]=L):L=t[35];let R;return t[36]!==L||t[37]!==A?(R=(0,x.jsxs)(l,{children:[A,L]}),t[36]=L,t[37]=A,t[38]=R):R=t[38],R}export{S as t};