import"./rolldown-runtime-BM3Ffeng.js";import{it as e}from"./element-plus-vendor-BF9PNysW.js";import{E as t,O as n,Ot as r,Pt as i,Tt as a,W as o,bt as s,ct as c,et as l,ht as u,pt as d,rt as f}from"./vue-vendor-DMUmTARL.js";import{n as p}from"./usePinyinSelectFilter-5ZowrnV-.js";var m=Object.assign({inheritAttrs:!1},{__name:`ZPinyinSelect`,props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:null},pinyinFilter:{type:Boolean,default:!0},ignoreCase:{type:Boolean,default:!0},splitByWhitespace:{type:Boolean,default:!0},debugLog:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(m,{emit:h}){let g=m,_=h,v=c(),y=a(),b=0,x=r(p({ignoreCase:g.ignoreCase,splitByWhitespace:g.splitByWhitespace}));d(()=>[g.ignoreCase,g.splitByWhitespace],([e,t])=>{x.value=p({ignoreCase:e,splitByWhitespace:t})});let S=t({get:()=>g.modelValue,set:e=>{_(`update:modelValue`,e)}}),C=t(()=>v[`filter-method`]??v.filterMethod),w=t(()=>v.remote===``||!!v.remote),T=(e,t)=>{e?.states?e.states.visible=t:e&&`visible`in e&&(e.visible=t)},E=async e=>{let t=++b,n=y.value?.optionsArray||[],r=String(e??``).trim(),i=0;if(!r){for(let e of n)T(e,!0);return}let a=await Promise.all(n.map(async e=>{let t=e?.currentLabel??``;return{option:e,matched:e?.created===!0||await x.value.isMatchKeyword(r,t)}}));if(t===b)for(let{option:e,matched:t}of a)T(e,t),t&&(i+=1)},D=t(()=>{if(typeof C.value==`function`)return C.value;if(!(!g.pinyinFilter||w.value))return E});return(t,r)=>{let a=e;return l(),n(a,o({ref_key:`selectRef`,ref:y},i(v),{modelValue:i(S),"onUpdate:modelValue":r[0]||=e=>s(S)?S.value=e:null,"filter-method":i(D)}),{default:u(()=>[f(t.$slots,`default`)]),_:3},16,[`modelValue`,`filter-method`])}}});export{m as t};