const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/omit.js"),r=require("../config-provider/DisabledContext.js"),i=require("../_util/props-util/initDefaultProps.js"),a=require("../config-provider/renderEmpty.js"),o=require("../config-provider/hooks/useConfigInject.js"),s=require("../_util/vue-types/index.js"),c=require("../_util/statusUtils.js"),l=require("../_util/transition.js"),u=require("../form/FormItemContext.js"),d=require("../space/Compact.js"),f=require("../vc-select/OptGroup.js"),p=require("../vc-select/Option.js"),m=require("../vc-select/Select.js"),h=require("../vc-select/index.js"),g=require("./style/index.js"),_=require("./utils/iconUtil.js");let v=require("vue");var y=()=>({...n.default(m.selectProps(),[`inputIcon`,`mode`,`getInputElement`,`getRawInputElement`,`backfill`]),value:e.someType([Array,Object,String,Number]),defaultValue:e.someType([Array,Object,String,Number]),notFoundContent:s.default.any,suffixIcon:s.default.any,itemIcon:s.default.any,size:e.stringType(),mode:e.stringType(),bordered:e.booleanType(!0),transitionName:String,choiceTransitionName:e.stringType(``),popupClassName:String,dropdownClassName:String,placement:e.stringType(),status:e.stringType(),"onUpdate:value":e.functionType()}),b=`SECRET_COMBOBOX_MODE_DO_NOT_USE`,x=(0,v.defineComponent)({compatConfig:{MODE:3},name:`ASelect`,Option:p.default,OptGroup:f.default,inheritAttrs:!1,props:i.default(y(),{listHeight:256,listItemHeight:24}),SECRET_COMBOBOX_MODE_DO_NOT_USE:b,slots:Object,setup(e,{attrs:i,emit:s,slots:f,expose:p}){let m=(0,v.ref)(),y=u.useInjectFormItemContext(),x=u.FormItemInputContext.useInject(),S=(0,v.computed)(()=>c.getMergedStatus(x.status,e.status)),C=()=>{m.value?.focus()},w=()=>{m.value?.blur()},T=e=>{m.value?.scrollTo(e)},E=(0,v.computed)(()=>{let{mode:t}=e;if(t!==`combobox`)return t===b?`combobox`:t}),{prefixCls:D,direction:O,configProvider:k,renderEmpty:A,size:j,getPrefixCls:M,getPopupContainer:N,disabled:P,select:F}=o.default(`select`,e),{compactSize:I,compactItemClassnames:L}=d.useCompactItemContext(D,O),R=(0,v.computed)(()=>I.value||j.value),z=r.useInjectDisabled(),B=(0,v.computed)(()=>P.value??z.value),[V,H]=g.default(D),U=(0,v.computed)(()=>M()),W=(0,v.computed)(()=>e.placement===void 0?O.value===`rtl`?`bottomRight`:`bottomLeft`:e.placement),G=(0,v.computed)(()=>l.getTransitionName(U.value,l.getTransitionDirection(W.value),e.transitionName)),K=(0,v.computed)(()=>t.default({[`${D.value}-lg`]:R.value===`large`,[`${D.value}-sm`]:R.value===`small`,[`${D.value}-rtl`]:O.value===`rtl`,[`${D.value}-borderless`]:!e.bordered,[`${D.value}-in-form-item`]:x.isFormItemInput},c.getStatusClassNames(D.value,S.value,x.hasFeedback),L.value,H.value)),q=(...e)=>{s(`update:value`,e[0]),s(`change`,...e),y.onFieldChange()},J=e=>{s(`blur`,e),y.onFieldBlur()};p({blur:w,focus:C,scrollTo:T});let Y=(0,v.computed)(()=>E.value===`multiple`||E.value===`tags`),X=(0,v.computed)(()=>e.showArrow===void 0?e.loading||!(Y.value||E.value===`combobox`):e.showArrow);return()=>{let{notFoundContent:r,listHeight:o=256,listItemHeight:s=24,popupClassName:c,dropdownClassName:l,virtual:u,dropdownMatchSelectWidth:d,id:p=y.id.value,placeholder:g=f.placeholder?.(),showArrow:b}=e,{hasFeedback:S,feedbackIcon:C}=x,{}=k,w;w=r===void 0?f.notFoundContent?f.notFoundContent():E.value===`combobox`?null:A?.(`Select`)||(0,v.createVNode)(a.DefaultRenderEmpty,{componentName:`Select`},null):r;let{suffixIcon:T,itemIcon:j,removeIcon:M,clearIcon:P}=_.default({...e,multiple:Y.value,prefixCls:D.value,hasFeedback:S,feedbackIcon:C,showArrow:X.value},f),I=n.default(e,[`prefixCls`,`suffixIcon`,`itemIcon`,`removeIcon`,`clearIcon`,`size`,`bordered`,`status`]),L=t.default(c||l,{[`${D.value}-dropdown-${O.value}`]:O.value===`rtl`},H.value);return V((0,v.createVNode)(h.default,{ref:m,virtual:u,dropdownMatchSelectWidth:d,...I,...i,showSearch:e.showSearch??F?.value?.showSearch,placeholder:g,listHeight:o,listItemHeight:s,mode:E.value,prefixCls:D.value,direction:O.value,inputIcon:T,menuItemSelectedIcon:j,removeIcon:M,clearIcon:P,notFoundContent:w,class:[K.value,i.class],getPopupContainer:N?.value,dropdownClassName:L,onChange:q,onBlur:J,id:p,dropdownRender:I.dropdownRender||f.dropdownRender,transitionName:G.value,children:f.default?.(),tagRender:e.tagRender||f.tagRender,optionLabelRender:f.optionLabel,maxTagPlaceholder:e.maxTagPlaceholder||f.maxTagPlaceholder,showArrow:S||b,disabled:B.value},{option:f.option}))}}});x.install=function(e){return e.component(x.name,x),e.component(x.Option.displayName,x.Option),e.component(x.OptGroup.displayName,x.OptGroup),e};var S=x.Option,C=x.OptGroup;exports.SelectOptGroup=C,exports.SelectOption=S,exports.default=x,exports.selectProps=y;