{kn(Vn)})},Mn=(Vn=[],_n)=>{if(!isObject$4(_n))return Vn.indexOf(_n);const Qn=e.valueKey;let jn=-1;return Vn.some((Un,Xn)=>get(Un,Qn)===get(_n,Qn)?(jn=Xn,!0):!1),jn},Fn=()=>{n.softFocus=!0;const Vn=k.value||L.value;Vn&&Vn?.focus()},kn=Vn=>{var _n,Qn,jn,Un,Xn;const Zn=Array.isArray(Vn)?Vn[0]:Vn;let to=null;if(Zn?.value){const ro=he.value.filter(lo=>lo.value===Zn.value);ro.length>0&&(to=ro[0].$el)}if(oe.value&&to){const ro=(Un=(jn=(Qn=(_n=oe.value)==null?void 0:_n.popperRef)==null?void 0:Qn.contentRef)==null?void 0:jn.querySelector)==null?void 0:Un.call(jn,`.${$.be("dropdown","wrap")}`);ro&&scrollIntoView$2(ro,to)}(Xn=le.value)==null||Xn.handleScroll()},Nn=Vn=>{n.optionsCount++,n.filteredOptionsCount++,n.options.set(Vn.value,Vn),n.cachedOptions.set(Vn.value,Vn)},Rn=(Vn,_n)=>{n.options.get(Vn)===_n&&(n.optionsCount--,n.filteredOptionsCount--,n.options.delete(Vn))},wn=Vn=>{Vn.code!==EVENT_CODE.backspace&&Tn(!1),n.inputLength=k.value.value.length*15+20,Et()},Tn=Vn=>{if(!Array.isArray(n.selected))return;const _n=n.selected[n.selected.length-1];if(!!_n)return Vn===!0||Vn===!1?(_n.hitState=Vn,Vn):(_n.hitState=!_n.hitState,_n.hitState)},xn=Vn=>{const _n=Vn.target.value;if(Vn.type==="compositionend")n.isOnComposition=!1,nextTick(()=>Pt(_n));else{const Qn=_n[_n.length-1]||"";n.isOnComposition=!isKorean(Qn)}},Bn=()=>{nextTick(()=>kn(n.selected))},Ln=Vn=>{n.softFocus?n.softFocus=!1:((e.automaticDropdown||e.filterable)&&(e.filterable&&!n.visible&&(n.menuVisibleOnFocus=!0),n.visible=!0),r.emit("focus",Vn))},Hn=()=>{var Vn;n.visible=!1,(Vn=L.value)==null||Vn.blur()},zn=Vn=>{nextTick(()=>{n.isSilentBlur?n.isSilentBlur=!1:r.emit("blur",Vn)}),n.softFocus=!1},Jn=Vn=>{Pn(Vn)},co=()=>{n.visible=!1},Gn=Vn=>{n.visible&&(Vn.preventDefault(),Vn.stopPropagation(),n.visible=!1)},eo=()=>{var Vn;Ie.value||(n.menuVisibleOnFocus?n.menuVisibleOnFocus=!1:n.visible=!n.visible,n.visible&&((Vn=k.value||L.value)==null||Vn.focus()))},ao=()=>{n.visible?he.value[n.hoverIndex]&&Dn(he.value[n.hoverIndex],void 0):eo()},ho=Vn=>isObject$4(Vn.value)?get(Vn.value,e.valueKey):Vn.value,Yn=computed(()=>he.value.filter(Vn=>Vn.visible).every(Vn=>Vn.disabled)),Wn=Vn=>{if(!n.visible){n.visible=!0;return}if(!(n.options.size===0||n.filteredOptionsCount===0)&&!n.isOnComposition&&!Yn.value){Vn==="next"?(n.hoverIndex++,n.hoverIndex===n.options.size&&(n.hoverIndex=0)):Vn==="prev"&&(n.hoverIndex--,n.hoverIndex<0&&(n.hoverIndex=n.options.size-1));const _n=he.value[n.hoverIndex];(_n.disabled===!0||_n.states.groupDisabled===!0||!_n.visible)&&Wn(Vn),nextTick(()=>kn(ue.value))}};return{optionsArray:he,selectSize:Ne,handleResize:bn,debouncedOnInputChange:On,debouncedQueryChange:En,deletePrevTag:In,deleteTag:$n,deleteSelected:Pn,handleOptionSelect:Dn,scrollToOption:kn,readonly:Ce,resetInputHeight:Et,showClose:_e,iconComponent:At,iconReverse:qe,showNewOption:$e,collapseTagSize:Ue,setSelected:hn,managePlaceholder:Lt,selectDisabled:Ie,emptyText:Ve,toggleLastOptionHitState:Tn,resetInputState:wn,handleComposition:xn,onOptionCreate:Nn,onOptionDestroy:Rn,handleMenuEnter:Bn,handleFocus:Ln,blur:Hn,handleBlur:zn,handleClearClick:Jn,handleClose:co,handleKeydownEscape:Gn,toggleMenu:eo,selectOption:ao,getValueKey:ho,navigateOptions:Wn,dropMenuVisible:kt,queryChange:pe,groupQueryChange:de,reference:L,input:k,tooltipRef:oe,tags:re,selectWrapper:ae,scrollbar:le}},COMPONENT_NAME$5="ElSelect",_sfc_main$1g=defineComponent({name:COMPONENT_NAME$5,componentName:COMPONENT_NAME$5,components:{ElInput,ElSelectMenu:ElSelectMenu$1,ElOption:Option$2,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:isValidComponentSize},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:[String,Object],default:circle_close_default},fitInputWidth:{type:Boolean,default:!1},suffixIcon:{type:[String,Object],default:arrow_up_default},tagType:{...tagProps.type,default:"info"},validateEvent:{type:Boolean,default:!0}},emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur"],setup(e,n){const r=useNamespace("select"),g=useNamespace("input"),{t:$}=useLocale(),L=useSelectStates(e),{optionsArray:k,selectSize:oe,readonly:re,handleResize:ae,collapseTagSize:le,debouncedOnInputChange:ue,debouncedQueryChange:pe,deletePrevTag:de,deleteTag:Fe,deleteSelected:ze,handleOptionSelect:Ce,scrollToOption:Ie,setSelected:_e,resetInputHeight:At,managePlaceholder:qe,showClose:xe,selectDisabled:Ve,iconComponent:he,iconReverse:Oe,showNewOption:$e,emptyText:Ne,toggleLastOptionHitState:Ue,resetInputState:kt,handleComposition:Et,onOptionCreate:Pt,onOptionDestroy:Lt,handleMenuEnter:vn,handleFocus:hn,blur:Dt,handleBlur:jt,handleClearClick:bn,handleClose:Sn,handleKeydownEscape:Cn,toggleMenu:On,selectOption:En,getValueKey:An,navigateOptions:In,dropMenuVisible:$n,reference:Pn,input:Dn,tooltipRef:Mn,tags:Fn,selectWrapper:kn,scrollbar:Nn,queryChange:Rn,groupQueryChange:wn}=useSelect$2(e,L,n),{focus:Tn}=useFocus(Pn),{inputWidth:xn,selected:Bn,inputLength:Ln,filteredOptionsCount:Hn,visible:zn,softFocus:Jn,selectedLabel:co,hoverIndex:Gn,query:eo,inputHovering:ao,currentPlaceholder:ho,menuVisibleOnFocus:Yn,isOnComposition:Wn,isSilentBlur:Vn,options:_n,cachedOptions:Qn,optionsCount:jn,prefixWidth:Un,tagInMultiLine:Xn}=toRefs(L),Zn=computed(()=>{const lo=[r.b()],uo=unref(oe);return uo&&lo.push(r.m(uo)),e.disabled&&lo.push(r.m("disabled")),lo}),to=computed(()=>({maxWidth:`${unref(xn)-32}px`,width:"100%"}));provide(selectKey,reactive({props:e,options:_n,optionsArray:k,cachedOptions:Qn,optionsCount:jn,filteredOptionsCount:Hn,hoverIndex:Gn,handleOptionSelect:Ce,onOptionCreate:Pt,onOptionDestroy:Lt,selectWrapper:kn,selected:Bn,setSelected:_e,queryChange:Rn,groupQueryChange:wn})),onMounted(()=>{L.cachedPlaceHolder=ho.value=e.placeholder||$("el.select.placeholder"),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(ho.value=""),useResizeObserver(kn,ae),e.remote&&e.multiple&&At(),nextTick(()=>{const lo=Pn.value&&Pn.value.$el;if(!!lo&&(xn.value=lo.getBoundingClientRect().width,n.slots.prefix)){const uo=lo.querySelector(`.${g.e("prefix")}`);Un.value=Math.max(uo.getBoundingClientRect().width+5,30)}}),_e()}),e.multiple&&!Array.isArray(e.modelValue)&&n.emit(UPDATE_MODEL_EVENT,[]),!e.multiple&&Array.isArray(e.modelValue)&&n.emit(UPDATE_MODEL_EVENT,"");const ro=computed(()=>{var lo,uo;return(uo=(lo=Mn.value)==null?void 0:lo.popperRef)==null?void 0:uo.contentRef});return{tagInMultiLine:Xn,prefixWidth:Un,selectSize:oe,readonly:re,handleResize:ae,collapseTagSize:le,debouncedOnInputChange:ue,debouncedQueryChange:pe,deletePrevTag:de,deleteTag:Fe,deleteSelected:ze,handleOptionSelect:Ce,scrollToOption:Ie,inputWidth:xn,selected:Bn,inputLength:Ln,filteredOptionsCount:Hn,visible:zn,softFocus:Jn,selectedLabel:co,hoverIndex:Gn,query:eo,inputHovering:ao,currentPlaceholder:ho,menuVisibleOnFocus:Yn,isOnComposition:Wn,isSilentBlur:Vn,options:_n,resetInputHeight:At,managePlaceholder:qe,showClose:xe,selectDisabled:Ve,iconComponent:he,iconReverse:Oe,showNewOption:$e,emptyText:Ne,toggleLastOptionHitState:Ue,resetInputState:kt,handleComposition:Et,handleMenuEnter:vn,handleFocus:hn,blur:Dt,handleBlur:jt,handleClearClick:bn,handleClose:Sn,handleKeydownEscape:Cn,toggleMenu:On,selectOption:En,getValueKey:An,navigateOptions:In,dropMenuVisible:$n,focus:Tn,reference:Pn,input:Dn,tooltipRef:Mn,popperPaneRef:ro,tags:Fn,selectWrapper:kn,scrollbar:Nn,wrapperKls:Zn,selectTagsStyle:to,nsSelect:r}}}),_hoisted_1$T={class:"select-trigger"},_hoisted_2$F=["disabled","autocomplete"],_hoisted_3$m={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function _sfc_render$I(e,n,r,g,$,L){const k=resolveComponent("el-tag"),oe=resolveComponent("el-tooltip"),re=resolveComponent("el-icon"),ae=resolveComponent("el-input"),le=resolveComponent("el-option"),ue=resolveComponent("el-scrollbar"),pe=resolveComponent("el-select-menu"),de=resolveDirective("click-outside");return withDirectives((openBlock(),createElementBlock("div",{ref:"selectWrapper",class:normalizeClass(e.wrapperKls),onClick:n[22]||(n[22]=withModifiers((...Fe)=>e.toggleMenu&&e.toggleMenu(...Fe),["stop"]))},[createVNode(oe,{ref:"tooltipRef",visible:e.dropMenuVisible,placement:"bottom-start",teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$T,[e.multiple?(openBlock(),createElementBlock("div",{key:0,ref:"tags",class:normalizeClass(e.nsSelect.e("tags")),style:normalizeStyle(e.selectTagsStyle)},[e.collapseTags&&e.selected.length?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass([e.nsSelect.b("tags-wrapper"),{"has-prefix":e.prefixWidth&&e.selected.length}])},[createVNode(k,{closable:!e.selectDisabled&&!e.selected[0].isDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:e.tagType,"disable-transitions":"",onClose:n[0]||(n[0]=Fe=>e.deleteTag(Fe,e.selected[0]))},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text")),style:normalizeStyle({maxWidth:e.inputWidth-123+"px"})},toDisplayString(e.selected[0].currentLabel),7)]),_:1},8,["closable","size","hit","type"]),e.selected.length>1?(openBlock(),createBlock(k,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:withCtx(()=>[e.collapseTagsTooltip?(openBlock(),createBlock(oe,{key:0,disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text"))},"+ "+toDisplayString(e.selected.length-1),3)]),content:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(e.nsSelect.e("collapse-tags"))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.selected.slice(1),(Fe,ze)=>(openBlock(),createElementBlock("div",{key:ze,class:normalizeClass(e.nsSelect.e("collapse-tag"))},[(openBlock(),createBlock(k,{key:e.getValueKey(Fe),class:"in-tooltip",closable:!e.selectDisabled&&!Fe.isDisabled,size:e.collapseTagSize,hit:Fe.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:Ce=>e.deleteTag(Ce,Fe)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text")),style:normalizeStyle({maxWidth:e.inputWidth-75+"px"})},toDisplayString(Fe.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(e.nsSelect.e("tags-text"))},"+ "+toDisplayString(e.selected.length-1),3))]),_:1},8,["size","type"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createCommentVNode(" "),e.collapseTags?createCommentVNode("v-if",!0):(openBlock(),createBlock(Transition,{key:1,onAfterLeave:e.resetInputHeight},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass([e.nsSelect.b("tags-wrapper"),{"has-prefix":e.prefixWidth&&e.selected.length}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.selected,Fe=>(openBlock(),createBlock(k,{key:e.getValueKey(Fe),closable:!e.selectDisabled&&!Fe.isDisabled,size:e.collapseTagSize,hit:Fe.hitState,type:e.tagType,"disable-transitions":"",onClose:ze=>e.deleteTag(ze,Fe)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelect.e("tags-text")),style:normalizeStyle({maxWidth:e.inputWidth-75+"px"})},toDisplayString(Fe.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],2)]),_:1},8,["onAfterLeave"])),createCommentVNode("
"),e.filterable?withDirectives((openBlock(),createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":n[1]||(n[1]=Fe=>e.query=Fe),type:"text",class:normalizeClass([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:normalizeStyle({marginLeft:e.prefixWidth&&!e.selected.length||e.tagInMultiLine?`${e.prefixWidth}px`:"",flexGrow:1,width:`${e.inputLength/(e.inputWidth-32)}%`,maxWidth:`${e.inputWidth-42}px`}),onFocus:n[2]||(n[2]=(...Fe)=>e.handleFocus&&e.handleFocus(...Fe)),onBlur:n[3]||(n[3]=(...Fe)=>e.handleBlur&&e.handleBlur(...Fe)),onKeyup:n[4]||(n[4]=(...Fe)=>e.managePlaceholder&&e.managePlaceholder(...Fe)),onKeydown:[n[5]||(n[5]=(...Fe)=>e.resetInputState&&e.resetInputState(...Fe)),n[6]||(n[6]=withKeys(withModifiers(Fe=>e.navigateOptions("next"),["prevent"]),["down"])),n[7]||(n[7]=withKeys(withModifiers(Fe=>e.navigateOptions("prev"),["prevent"]),["up"])),n[8]||(n[8]=withKeys((...Fe)=>e.handleKeydownEscape&&e.handleKeydownEscape(...Fe),["esc"])),n[9]||(n[9]=withKeys(withModifiers((...Fe)=>e.selectOption&&e.selectOption(...Fe),["stop","prevent"]),["enter"])),n[10]||(n[10]=withKeys((...Fe)=>e.deletePrevTag&&e.deletePrevTag(...Fe),["delete"])),n[11]||(n[11]=withKeys(Fe=>e.visible=!1,["tab"]))],onCompositionstart:n[12]||(n[12]=(...Fe)=>e.handleComposition&&e.handleComposition(...Fe)),onCompositionupdate:n[13]||(n[13]=(...Fe)=>e.handleComposition&&e.handleComposition(...Fe)),onCompositionend:n[14]||(n[14]=(...Fe)=>e.handleComposition&&e.handleComposition(...Fe)),onInput:n[15]||(n[15]=(...Fe)=>e.debouncedQueryChange&&e.debouncedQueryChange(...Fe))},null,46,_hoisted_2$F)),[[vModelText,e.query]]):createCommentVNode("v-if",!0)],6)):createCommentVNode("v-if",!0),createVNode(ae,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":n[16]||(n[16]=Fe=>e.selectedLabel=Fe),type:"text",placeholder:e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:normalizeClass([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[n[17]||(n[17]=withKeys(withModifiers(Fe=>e.navigateOptions("next"),["stop","prevent"]),["down"])),n[18]||(n[18]=withKeys(withModifiers(Fe=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),withKeys(withModifiers(e.selectOption,["stop","prevent"]),["enter"]),withKeys(e.handleKeydownEscape,["esc"]),n[19]||(n[19]=withKeys(Fe=>e.visible=!1,["tab"]))],onMouseenter:n[20]||(n[20]=Fe=>e.inputHovering=!0),onMouseleave:n[21]||(n[21]=Fe=>e.inputHovering=!1)},createSlots({suffix:withCtx(()=>[e.iconComponent&&!e.showClose?(openBlock(),createBlock(re,{key:0,class:normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(openBlock(),createBlock(re,{key:1,class:normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:withCtx(()=>[createBaseVNode("div",_hoisted_3$m,[renderSlot(e.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])])]),content:withCtx(()=>[createVNode(pe,null,{default:withCtx(()=>[withDirectives(createVNode(ue,{ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:normalizeClass([e.nsSelect.is("empty",!e.allowCreate&&Boolean(e.query)&&e.filteredOptionsCount===0)])},{default:withCtx(()=>[e.showNewOption?(openBlock(),createBlock(le,{key:0,value:e.query,created:!0},null,8,["value"])):createCommentVNode("v-if",!0),renderSlot(e.$slots,"default")]),_:3},8,["wrap-class","view-class","class"]),[[vShow,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&e.options.size===0)?(openBlock(),createElementBlock(Fragment,{key:0},[e.$slots.empty?renderSlot(e.$slots,"empty",{key:0}):(openBlock(),createElementBlock("p",{key:1,class:normalizeClass(e.nsSelect.be("dropdown","empty"))},toDisplayString(e.emptyText),3))],64)):createCommentVNode("v-if",!0)]),_:3})]),_:3},8,["visible","teleported","popper-class","effect","transition","persistent","onShow"])],2)),[[de,e.handleClose,e.popperPaneRef]])}var Select$1=_export_sfc$2(_sfc_main$1g,[["render",_sfc_render$I],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);const _sfc_main$1f=defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},setup(e){const n=useNamespace("select"),r=ref(!0),g=getCurrentInstance(),$=ref([]);provide(selectGroupKey,reactive({...toRefs(e)}));const L=inject(selectKey);onMounted(()=>{$.value=k(g.subTree)});const k=re=>{const ae=[];return Array.isArray(re.children)&&re.children.forEach(le=>{var ue;le.type&&le.type.name==="ElOption"&&le.component&&le.component.proxy?ae.push(le.component.proxy):(ue=le.children)!=null&&ue.length&&ae.push(...k(le))}),ae},{groupQueryChange:oe}=toRaw(L);return watch(oe,()=>{r.value=$.value.some(re=>re.visible===!0)}),{visible:r,ns:n}}});function _sfc_render$H(e,n,r,g,$,L){return withDirectives((openBlock(),createElementBlock("ul",{class:normalizeClass(e.ns.be("group","wrap"))},[createBaseVNode("li",{class:normalizeClass(e.ns.be("group","title"))},toDisplayString(e.label),3),createBaseVNode("li",null,[createBaseVNode("ul",{class:normalizeClass(e.ns.b("group"))},[renderSlot(e.$slots,"default")],2)])],2)),[[vShow,e.visible]])}var OptionGroup=_export_sfc$2(_sfc_main$1f,[["render",_sfc_render$H],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);const ElSelect=withInstall(Select$1,{Option:Option$2,OptionGroup}),ElOption=withNoopInstall(Option$2),ElOptionGroup=withNoopInstall(OptionGroup),usePagination=()=>inject(elPaginationKey,{}),paginationSizesProps=buildProps({pageSize:{type:Number,required:!0},pageSizes:{type:definePropType(Array),default:()=>mutable([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,size:{type:String,default:"default"}}),__default__$x={name:"ElPaginationSizes"},_sfc_main$1e=defineComponent({...__default__$x,props:paginationSizesProps,emits:["page-size-change"],setup(e,{emit:n}){const r=e,{t:g}=useLocale(),$=useNamespace("pagination"),L=usePagination(),k=ref(r.pageSize);watch(()=>r.pageSizes,(ae,le)=>{if(!isEqual$1(ae,le)&&Array.isArray(ae)){const ue=ae.includes(r.pageSize)?r.pageSize:r.pageSizes[0];n("page-size-change",ue)}}),watch(()=>r.pageSize,ae=>{k.value=ae});const oe=computed(()=>r.pageSizes);function re(ae){var le;ae!==k.value&&(k.value=ae,(le=L.handleSizeChange)==null||le.call(L,Number(ae)))}return(ae,le)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref($).e("sizes"))},[createVNode(unref(ElSelect),{"model-value":k.value,disabled:ae.disabled,"popper-class":ae.popperClass,size:ae.size,onChange:re},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(oe),ue=>(openBlock(),createBlock(unref(ElOption),{key:ue,value:ue,label:ue+unref(g)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size"])],2))}});var Sizes=_export_sfc$2(_sfc_main$1e,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/sizes.vue"]]);const _hoisted_1$S=["disabled"],__default__$w={name:"ElPaginationJumper"},_sfc_main$1d=defineComponent({...__default__$w,setup(e){const{t:n}=useLocale(),r=useNamespace("pagination"),{pageCount:g,disabled:$,currentPage:L,changeEvent:k}=usePagination(),oe=ref(),re=computed(()=>{var ue;return(ue=oe.value)!=null?ue:L?.value});function ae(ue){oe.value=+ue}function le(ue){ue=Math.trunc(+ue),k?.(+ue),oe.value=void 0}return(ue,pe)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(r).e("jump")),disabled:unref($)},[createTextVNode(toDisplayString(unref(n)("el.pagination.goto"))+" ",1),createVNode(unref(ElInput),{size:"small",class:normalizeClass([unref(r).e("editor"),unref(r).is("in-pagination")]),min:1,max:unref(g),disabled:unref($),"model-value":unref(re),type:"number","onUpdate:modelValue":ae,onChange:le},null,8,["class","max","disabled","model-value"]),createTextVNode(" "+toDisplayString(unref(n)("el.pagination.pageClassifier")),1)],10,_hoisted_1$S))}});var Jumper=_export_sfc$2(_sfc_main$1d,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/jumper.vue"]]);const paginationTotalProps=buildProps({total:{type:Number,default:1e3}}),_hoisted_1$R=["disabled"],__default__$v={name:"ElPaginationTotal"},_sfc_main$1c=defineComponent({...__default__$v,props:paginationTotalProps,setup(e){const{t:n}=useLocale(),r=useNamespace("pagination"),{disabled:g}=usePagination();return($,L)=>(openBlock(),createElementBlock("span",{class:normalizeClass(unref(r).e("total")),disabled:unref(g)},toDisplayString(unref(n)("el.pagination.total",{total:$.total})),11,_hoisted_1$R))}});var Total=_export_sfc$2(_sfc_main$1c,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/total.vue"]]);const paginationPagerProps=buildProps({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),_hoisted_1$Q=["onKeyup"],_hoisted_2$E=["aria-current","tabindex"],_hoisted_3$l=["tabindex"],_hoisted_4$i=["aria-current","tabindex"],_hoisted_5$e=["tabindex"],_hoisted_6$a=["aria-current","tabindex"],__default__$u={name:"ElPaginationPager"},_sfc_main$1b=defineComponent({...__default__$u,props:paginationPagerProps,emits:["change"],setup(e,{emit:n}){const r=e,g=useNamespace("pager"),$=useNamespace("icon"),L=ref(!1),k=ref(!1),oe=ref(!1),re=ref(!1),ae=ref(!1),le=ref(!1),ue=computed(()=>{const Ie=r.pagerCount,_e=(Ie-1)/2,At=Number(r.currentPage),qe=Number(r.pageCount);let xe=!1,Ve=!1;qe>Ie&&(At>Ie-_e&&(xe=!0),Atr.disabled?-1:0);watchEffect(()=>{const Ie=(r.pagerCount-1)/2;L.value=!1,k.value=!1,r.pageCount>r.pagerCount&&(r.currentPage>r.pagerCount-Ie&&(L.value=!0),r.currentPageqe&&(At=qe)),At!==xe&&n("change",At)}return(Ie,_e)=>(openBlock(),createElementBlock("ul",{class:normalizeClass(unref(g).b()),onClick:Ce,onKeyup:withKeys(ze,["enter"])},[Ie.pageCount>0?(openBlock(),createElementBlock("li",{key:0,class:normalizeClass([[unref(g).is("active",Ie.currentPage===1),unref(g).is("disabled",Ie.disabled)],"number"]),"aria-current":Ie.currentPage===1,tabindex:unref(pe)}," 1 ",10,_hoisted_2$E)):createCommentVNode("v-if",!0),L.value?(openBlock(),createElementBlock("li",{key:1,class:normalizeClass(["more","btn-quickprev",unref($).b(),unref(g).is("disabled",Ie.disabled)]),tabindex:unref(pe),onMouseenter:_e[0]||(_e[0]=At=>de(!0)),onMouseleave:_e[1]||(_e[1]=At=>oe.value=!1),onFocus:_e[2]||(_e[2]=At=>Fe(!0)),onBlur:_e[3]||(_e[3]=At=>ae.value=!1)},[oe.value||ae.value?(openBlock(),createBlock(unref(d_arrow_left_default),{key:0})):(openBlock(),createBlock(unref(more_filled_default),{key:1}))],42,_hoisted_3$l)):createCommentVNode("v-if",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(ue),At=>(openBlock(),createElementBlock("li",{key:At,class:normalizeClass([[unref(g).is("active",Ie.currentPage===At),unref(g).is("disabled",Ie.disabled)],"number"]),"aria-current":Ie.currentPage===At,tabindex:unref(pe)},toDisplayString(At),11,_hoisted_4$i))),128)),k.value?(openBlock(),createElementBlock("li",{key:2,class:normalizeClass(["more","btn-quicknext",unref($).b(),unref(g).is("disabled",Ie.disabled)]),tabindex:unref(pe),onMouseenter:_e[4]||(_e[4]=At=>de()),onMouseleave:_e[5]||(_e[5]=At=>re.value=!1),onFocus:_e[6]||(_e[6]=At=>Fe()),onBlur:_e[7]||(_e[7]=At=>le.value=!1)},[re.value||le.value?(openBlock(),createBlock(unref(d_arrow_right_default),{key:0})):(openBlock(),createBlock(unref(more_filled_default),{key:1}))],42,_hoisted_5$e)):createCommentVNode("v-if",!0),Ie.pageCount>1?(openBlock(),createElementBlock("li",{key:3,class:normalizeClass([[unref(g).is("active",Ie.currentPage===Ie.pageCount),unref(g).is("disabled",Ie.disabled)],"number"]),"aria-current":Ie.currentPage===Ie.pageCount,tabindex:unref(pe)},toDisplayString(Ie.pageCount),11,_hoisted_6$a)):createCommentVNode("v-if",!0)],42,_hoisted_1$Q))}});var Pager=_export_sfc$2(_sfc_main$1b,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);const isAbsent=e=>typeof e!="number",paginationProps=buildProps({total:Number,pageSize:Number,defaultPageSize:Number,currentPage:Number,defaultCurrentPage:Number,pageCount:Number,pagerCount:{type:Number,validator:e=>typeof e=="number"&&Math.trunc(e)===e&&e>4&&e<22&&e%2===1,default:7},layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:definePropType(Array),default:()=>mutable([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},nextText:{type:String,default:""},small:Boolean,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean}),paginationEmits={"update:current-page":e=>typeof e=="number","update:page-size":e=>typeof e=="number","size-change":e=>typeof e=="number","current-change":e=>typeof e=="number","prev-click":e=>typeof e=="number","next-click":e=>typeof e=="number"},componentName="ElPagination";var Pagination=defineComponent({name:componentName,props:paginationProps,emits:paginationEmits,setup(e,{emit:n,slots:r}){const{t:g}=useLocale(),$=useNamespace("pagination"),L=getCurrentInstance().vnode.props||{},k="onUpdate:currentPage"in L||"onUpdate:current-page"in L||"onCurrentChange"in L,oe="onUpdate:pageSize"in L||"onUpdate:page-size"in L||"onSizeChange"in L,re=computed(()=>{if(isAbsent(e.total)&&isAbsent(e.pageCount)||!isAbsent(e.currentPage)&&!k)return!1;if(e.layout.includes("sizes")){if(isAbsent(e.pageCount)){if(!isAbsent(e.total)&&!isAbsent(e.pageSize)&&!oe)return!1}else if(!oe)return!1}return!0}),ae=ref(isAbsent(e.defaultPageSize)?10:e.defaultPageSize),le=ref(isAbsent(e.defaultCurrentPage)?1:e.defaultCurrentPage),ue=computed({get(){return isAbsent(e.pageSize)?ae.value:e.pageSize},set(At){isAbsent(e.pageSize)&&(ae.value=At),oe&&(n("update:page-size",At),n("size-change",At))}}),pe=computed(()=>{let At=0;return isAbsent(e.pageCount)?isAbsent(e.total)||(At=Math.max(1,Math.ceil(e.total/ue.value))):At=e.pageCount,At}),de=computed({get(){return isAbsent(e.currentPage)?le.value:e.currentPage},set(At){let qe=At;At<1?qe=1:At>pe.value&&(qe=pe.value),isAbsent(e.currentPage)&&(le.value=qe),k&&(n("update:current-page",qe),n("current-change",qe))}});watch(pe,At=>{de.value>At&&(de.value=At)});function Fe(At){de.value=At}function ze(At){ue.value=At;const qe=pe.value;de.value>qe&&(de.value=qe)}function Ce(){e.disabled||(de.value-=1,n("prev-click",de.value))}function Ie(){e.disabled||(de.value+=1,n("next-click",de.value))}function _e(At,qe){At&&(At.props||(At.props={}),At.props.class=[At.props.class,qe].join(" "))}return provide(elPaginationKey,{pageCount:pe,disabled:computed(()=>e.disabled),currentPage:de,changeEvent:Fe,handleSizeChange:ze}),()=>{var At,qe;if(!re.value)return g("el.pagination.deprecationWarning"),null;if(!e.layout||e.hideOnSinglePage&&pe.value<=1)return null;const xe=[],Ve=[],he=h$2("div",{class:$.e("rightwrapper")},Ve),Oe={prev:h$2(Prev,{disabled:e.disabled,currentPage:de.value,prevText:e.prevText,onClick:Ce}),jumper:h$2(Jumper),pager:h$2(Pager,{currentPage:de.value,pageCount:pe.value,pagerCount:e.pagerCount,onChange:Fe,disabled:e.disabled}),next:h$2(Next,{disabled:e.disabled,currentPage:de.value,pageCount:pe.value,nextText:e.nextText,onClick:Ie}),sizes:h$2(Sizes,{pageSize:ue.value,pageSizes:e.pageSizes,popperClass:e.popperClass,disabled:e.disabled,size:e.small?"small":"default"}),slot:(qe=(At=r?.default)==null?void 0:At.call(r))!=null?qe:null,total:h$2(Total,{total:isAbsent(e.total)?0:e.total})},$e=e.layout.split(",").map(Ue=>Ue.trim());let Ne=!1;return $e.forEach(Ue=>{if(Ue==="->"){Ne=!0;return}Ne?Ve.push(Oe[Ue]):xe.push(Oe[Ue])}),_e(xe[0],$.is("first")),_e(xe[xe.length-1],$.is("last")),Ne&&Ve.length>0&&(_e(Ve[0],$.is("first")),_e(Ve[Ve.length-1],$.is("last")),xe.push(he)),h$2("div",{role:"pagination","aria-label":"pagination",class:[$.b(),$.is("background",e.background),{[$.m("small")]:e.small}]},xe)}}});const ElPagination=withInstall(Pagination),popconfirmProps=buildProps({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:buttonTypes,default:"primary"},cancelButtonType:{type:String,values:buttonTypes,default:"text"},icon:{type:iconPropType,default:question_filled_default},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1},hideAfter:{type:Number,default:200},onConfirm:{type:definePropType(Function)},onCancel:{type:definePropType(Function)},teleported:useTooltipContentProps.teleported,persistent:useTooltipContentProps.persistent}),__default__$t={name:"ElPopconfirm"},_sfc_main$1a=defineComponent({...__default__$t,props:popconfirmProps,setup(e){const n=e,{t:r}=useLocale(),g=useNamespace("popconfirm"),$=ref(),L=()=>{var le,ue;(ue=(le=$.value)==null?void 0:le.onClose)==null||ue.call(le)},k=le=>{var ue;(ue=n.onConfirm)==null||ue.call(n,le),L()},oe=le=>{var ue;(ue=n.onCancel)==null||ue.call(n,le),L()},re=computed(()=>n.confirmButtonText||r("el.popconfirm.confirmButtonText")),ae=computed(()=>n.cancelButtonText||r("el.popconfirm.cancelButtonText"));return(le,ue)=>(openBlock(),createBlock(unref(ElTooltip),{ref_key:"tooltipRef",ref:$,trigger:"click",effect:"light","popper-class":`${unref(g).namespace.value}-popover`,teleported:le.teleported,"fallback-placements":["bottom","top","right","left"],"hide-after":le.hideAfter,persistent:le.persistent},{content:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(unref(g).b())},[createBaseVNode("div",{class:normalizeClass(unref(g).e("main"))},[!le.hideIcon&&le.icon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(g).e("icon")),style:normalizeStyle({color:le.iconColor})},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(le.icon)))]),_:1},8,["class","style"])):createCommentVNode("v-if",!0),createTextVNode(" "+toDisplayString(le.title),1)],2),createBaseVNode("div",{class:normalizeClass(unref(g).e("action"))},[createVNode(unref(ElButton),{size:"small",type:le.cancelButtonType==="text"?"":le.cancelButtonType,text:le.cancelButtonType==="text",onClick:oe},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(ae)),1)]),_:1},8,["type","text"]),createVNode(unref(ElButton),{size:"small",type:le.confirmButtonType==="text"?"":le.confirmButtonType,text:le.confirmButtonType==="text",onClick:k},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(re)),1)]),_:1},8,["type","text"])],2)],2)]),default:withCtx(()=>[le.$slots.reference?renderSlot(le.$slots,"reference",{key:0}):createCommentVNode("v-if",!0)]),_:3},8,["popper-class","teleported","hide-after","persistent"]))}});var Popconfirm=_export_sfc$2(_sfc_main$1a,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popconfirm/src/popconfirm.vue"]]);const ElPopconfirm=withInstall(Popconfirm),popoverProps=buildProps({trigger:useTooltipTriggerProps.trigger,placement:dropdownProps.placement,disabled:useTooltipTriggerProps.disabled,visible:useTooltipContentProps.visible,transition:useTooltipContentProps.transition,popperOptions:dropdownProps.popperOptions,tabindex:dropdownProps.tabindex,content:useTooltipContentProps.content,popperStyle:useTooltipContentProps.popperStyle,popperClass:useTooltipContentProps.popperClass,enterable:{...useTooltipContentProps.enterable,default:!0},effect:{...useTooltipContentProps.effect,default:"light"},teleported:useTooltipContentProps.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),popoverEmits={"update:visible":e=>isBoolean(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},__default__$s={name:"ElPopover"},_sfc_main$19=defineComponent({...__default__$s,props:popoverProps,emits:popoverEmits,setup(e,{expose:n,emit:r}){const g=e,$="onUpdate:visible",L=computed(()=>g[$]),k=useNamespace("popover"),oe=ref(),re=computed(()=>{var Ie;return(Ie=unref(oe))==null?void 0:Ie.popperRef}),ae=computed(()=>[{width:addUnit(g.width)},g.popperStyle]),le=computed(()=>[k.b(),g.popperClass,{[k.m("plain")]:!!g.content}]),ue=computed(()=>g.transition==="el-fade-in-linear"),pe=()=>{var Ie;(Ie=oe.value)==null||Ie.hide()},de=()=>{r("before-enter")},Fe=()=>{r("before-leave")},ze=()=>{r("after-enter")},Ce=()=>{r("update:visible",!1),r("after-leave")};return n({popperRef:re,hide:pe}),(Ie,_e)=>(openBlock(),createBlock(unref(ElTooltip),mergeProps({ref_key:"tooltipRef",ref:oe},Ie.$attrs,{trigger:Ie.trigger,placement:Ie.placement,disabled:Ie.disabled,visible:Ie.visible,transition:Ie.transition,"popper-options":Ie.popperOptions,tabindex:Ie.tabindex,content:Ie.content,offset:Ie.offset,"show-after":Ie.showAfter,"hide-after":Ie.hideAfter,"auto-close":Ie.autoClose,"show-arrow":Ie.showArrow,"aria-label":Ie.title,effect:Ie.effect,enterable:Ie.enterable,"popper-class":unref(le),"popper-style":unref(ae),teleported:Ie.teleported,persistent:Ie.persistent,"gpu-acceleration":unref(ue),"onUpdate:visible":unref(L),onBeforeShow:de,onBeforeHide:Fe,onShow:ze,onHide:Ce}),{content:withCtx(()=>[Ie.title?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(k).e("title")),role:"title"},toDisplayString(Ie.title),3)):createCommentVNode("v-if",!0),renderSlot(Ie.$slots,"default",{},()=>[createTextVNode(toDisplayString(Ie.content),1)])]),default:withCtx(()=>[Ie.$slots.reference?renderSlot(Ie.$slots,"reference",{key:0}):createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var Popover=_export_sfc$2(_sfc_main$19,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popover/src/popover.vue"]]);const attachEvents=(e,n)=>{const r=n.arg||n.value,g=r?.popperRef;g&&(g.triggerRef=e)};var PopoverDirective={mounted(e,n){attachEvents(e,n)},updated(e,n){attachEvents(e,n)}};const VPopover="popover",ElPopoverDirective=withInstallDirective(PopoverDirective,VPopover),ElPopover=withInstall(Popover,{directive:ElPopoverDirective}),progressProps=buildProps({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:e=>e>=0&&e<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:{type:Boolean,default:!1},duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:definePropType(String),default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:definePropType([String,Array,Function]),default:""},format:{type:definePropType(Function),default:e=>`${e}%`}}),_hoisted_1$P=["aria-valuenow"],_hoisted_2$D={viewBox:"0 0 100 100"},_hoisted_3$k=["d","stroke","stroke-width"],_hoisted_4$h=["d","stroke","opacity","stroke-linecap","stroke-width"],_hoisted_5$d={key:0},__default__$r={name:"ElProgress"},_sfc_main$18=defineComponent({...__default__$r,props:progressProps,setup(e){const n=e,r={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},g=useNamespace("progress"),$=computed(()=>({width:`${n.percentage}%`,animationDuration:`${n.duration}s`,backgroundColor:_e(n.percentage)})),L=computed(()=>(n.strokeWidth/n.width*100).toFixed(1)),k=computed(()=>["circle","dashboard"].includes(n.type)?Number.parseInt(`${50-Number.parseFloat(L.value)/2}`,10):0),oe=computed(()=>{const At=k.value,qe=n.type==="dashboard";return`
+ M 50 50
+ m 0 ${qe?"":"-"}${At}
+ a ${At} ${At} 0 1 1 0 ${qe?"-":""}${At*2}
+ a ${At} ${At} 0 1 1 0 ${qe?"":"-"}${At*2}
+ `}),re=computed(()=>2*Math.PI*k.value),ae=computed(()=>n.type==="dashboard"?.75:1),le=computed(()=>`${-1*re.value*(1-ae.value)/2}px`),ue=computed(()=>({strokeDasharray:`${re.value*ae.value}px, ${re.value}px`,strokeDashoffset:le.value})),pe=computed(()=>({strokeDasharray:`${re.value*ae.value*(n.percentage/100)}px, ${re.value}px`,strokeDashoffset:le.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),de=computed(()=>{let At;return n.color?At=_e(n.percentage):At=r[n.status]||r.default,At}),Fe=computed(()=>n.status==="warning"?warning_filled_default:n.type==="line"?n.status==="success"?circle_check_default:circle_close_default:n.status==="success"?check_default:close_default),ze=computed(()=>n.type==="line"?12+n.strokeWidth*.4:n.width*.111111+2),Ce=computed(()=>n.format(n.percentage));function Ie(At){const qe=100/At.length;return At.map((Ve,he)=>isString$2(Ve)?{color:Ve,percentage:(he+1)*qe}:Ve).sort((Ve,he)=>Ve.percentage-he.percentage)}const _e=At=>{var qe;const{color:xe}=n;if(isFunction$1(xe))return xe(At);if(isString$2(xe))return xe;{const Ve=Ie(xe);for(const he of Ve)if(he.percentage>At)return he.color;return(qe=Ve[Ve.length-1])==null?void 0:qe.color}};return(At,qe)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(g).b(),unref(g).m(At.type),unref(g).is(At.status),{[unref(g).m("without-text")]:!At.showText,[unref(g).m("text-inside")]:At.textInside}]),role:"progressbar","aria-valuenow":At.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[At.type==="line"?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(g).b("bar"))},[createBaseVNode("div",{class:normalizeClass(unref(g).be("bar","outer")),style:normalizeStyle({height:`${At.strokeWidth}px`})},[createBaseVNode("div",{class:normalizeClass([unref(g).be("bar","inner"),{[unref(g).bem("bar","inner","indeterminate")]:At.indeterminate}]),style:normalizeStyle(unref($))},[(At.showText||At.$slots.default)&&At.textInside?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(g).be("bar","innerText"))},[renderSlot(At.$slots,"default",{percentage:At.percentage},()=>[createBaseVNode("span",null,toDisplayString(unref(Ce)),1)])],2)):createCommentVNode("v-if",!0)],6)],6)],2)):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(g).b("circle")),style:normalizeStyle({height:`${At.width}px`,width:`${At.width}px`})},[(openBlock(),createElementBlock("svg",_hoisted_2$D,[createBaseVNode("path",{class:normalizeClass(unref(g).be("circle","track")),d:unref(oe),stroke:`var(${unref(g).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-width":unref(L),fill:"none",style:normalizeStyle(unref(ue))},null,14,_hoisted_3$k),createBaseVNode("path",{class:normalizeClass(unref(g).be("circle","path")),d:unref(oe),stroke:unref(de),fill:"none",opacity:At.percentage?1:0,"stroke-linecap":At.strokeLinecap,"stroke-width":unref(L),style:normalizeStyle(unref(pe))},null,14,_hoisted_4$h)]))],6)),(At.showText||At.$slots.default)&&!At.textInside?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(unref(g).e("text")),style:normalizeStyle({fontSize:`${unref(ze)}px`})},[renderSlot(At.$slots,"default",{percentage:At.percentage},()=>[At.status?(openBlock(),createBlock(unref(ElIcon),{key:1},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(Fe))))]),_:1})):(openBlock(),createElementBlock("span",_hoisted_5$d,toDisplayString(unref(Ce)),1))])],6)):createCommentVNode("v-if",!0)],10,_hoisted_1$P))}});var Progress=_export_sfc$2(_sfc_main$18,[["__file","/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]]);const ElProgress=withInstall(Progress),rateProps=buildProps({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:definePropType([Array,Object]),default:()=>mutable(["","",""])},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:definePropType([Array,Object]),default:()=>[star_filled_default,star_filled_default,star_filled_default]},voidIcon:{type:iconPropType,default:()=>star_default},disabledVoidIcon:{type:iconPropType,default:()=>star_filled_default},disabled:{type:Boolean},allowHalf:{type:Boolean},showText:{type:Boolean},showScore:{type:Boolean},textColor:{type:String,default:""},texts:{type:definePropType(Array),default:()=>mutable(["Extremely bad","Disappointed","Fair","Satisfied","Surprise"])},scoreTemplate:{type:String,default:"{value}"},size:{type:String,validator:isValidComponentSize},label:{type:String,default:void 0}}),rateEmits={[CHANGE_EVENT]:e=>isNumber(e),[UPDATE_MODEL_EVENT]:e=>isNumber(e)},_hoisted_1$O=["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax"],_hoisted_2$C=["onMousemove","onClick"],__default__$q={name:"ElRate"},_sfc_main$17=defineComponent({...__default__$q,props:rateProps,emits:rateEmits,setup(e,{expose:n,emit:r}){const g=e;function $(vn,hn){const Dt=Sn=>isObject$4(Sn),jt=Object.keys(hn).map(Sn=>+Sn).filter(Sn=>{const Cn=hn[Sn];return(Dt(Cn)?Cn.excluded:!1)?vnSn-Cn),bn=hn[jt[0]];return Dt(bn)&&bn.value||bn}const L=inject(formContextKey,void 0),k=inject(formItemContextKey,void 0),oe=useSize(),re=useNamespace("rate"),{inputId:ae,isLabeledByFormItem:le}=useFormItemInputId(g,{formItemContext:k}),ue=ref(g.modelValue),pe=ref(-1),de=ref(!0),Fe=computed(()=>[re.b(),re.m(oe.value)]),ze=computed(()=>g.disabled||L?.disabled),Ce=computed(()=>re.cssVarBlock({"void-color":g.voidColor,"disabled-void-color":g.disabledVoidColor,"fill-color":qe.value})),Ie=computed(()=>{let vn="";return g.showScore?vn=g.scoreTemplate.replace(/\{\s*value\s*\}/,ze.value?`${g.modelValue}`:`${ue.value}`):g.showText&&(vn=g.texts[Math.ceil(ue.value)-1]),vn}),_e=computed(()=>g.modelValue*100-Math.floor(g.modelValue)*100),At=computed(()=>isArray$4(g.colors)?{[g.lowThreshold]:g.colors[0],[g.highThreshold]:{value:g.colors[1],excluded:!0},[g.max]:g.colors[2]}:g.colors),qe=computed(()=>{const vn=$(ue.value,At.value);return isObject$4(vn)?"":vn}),xe=computed(()=>{let vn="";return ze.value?vn=`${_e.value}%`:g.allowHalf&&(vn="50%"),{color:qe.value,width:vn}}),Ve=computed(()=>isArray$4(g.icons)?{[g.lowThreshold]:g.icons[0],[g.highThreshold]:{value:g.icons[1],excluded:!0},[g.max]:g.icons[2]}:g.icons),he=computed(()=>$(g.modelValue,Ve.value)),Oe=computed(()=>ze.value?g.disabledVoidIcon:g.voidIcon),$e=computed(()=>$(ue.value,Ve.value)),Ne=computed(()=>{const vn=Array.from({length:g.max}),hn=ue.value;return vn.fill($e.value,0,hn),vn.fill(Oe.value,hn,g.max),vn});function Ue(vn){const hn=ze.value&&_e.value>0&&vn-1g.modelValue,Dt=g.allowHalf&&de.value&&vn-.5<=ue.value&&vn>ue.value;return hn||Dt}function kt(vn){ze.value||(g.allowHalf&&de.value?(r(UPDATE_MODEL_EVENT,ue.value),g.modelValue!==ue.value&&r("change",ue.value)):(r(UPDATE_MODEL_EVENT,vn),g.modelValue!==vn&&r("change",vn)))}function Et(vn){if(ze.value)return;let hn=ue.value;const Dt=vn.code;return Dt===EVENT_CODE.up||Dt===EVENT_CODE.right?(g.allowHalf?hn+=.5:hn+=1,vn.stopPropagation(),vn.preventDefault()):(Dt===EVENT_CODE.left||Dt===EVENT_CODE.down)&&(g.allowHalf?hn-=.5:hn-=1,vn.stopPropagation(),vn.preventDefault()),hn=hn<0?0:hn,hn=hn>g.max?g.max:hn,r(UPDATE_MODEL_EVENT,hn),r("change",hn),hn}function Pt(vn,hn){if(!ze.value){if(g.allowHalf){let Dt=hn.target;hasClass(Dt,re.e("item"))&&(Dt=Dt.querySelector(`.${re.e("icon")}`)),(Dt.clientWidth===0||hasClass(Dt,re.e("decimal")))&&(Dt=Dt.parentNode),de.value=hn.offsetX*2<=Dt.clientWidth,ue.value=de.value?vn-.5:vn}else ue.value=vn;pe.value=vn}}function Lt(){ze.value||(g.allowHalf&&(de.value=g.modelValue!==Math.floor(g.modelValue)),ue.value=g.modelValue,pe.value=-1)}return watch(()=>g.modelValue,vn=>{ue.value=vn,de.value=g.modelValue!==Math.floor(g.modelValue)}),g.modelValue||r(UPDATE_MODEL_EVENT,0),n({setCurrentValue:Pt,resetCurrentValue:Lt}),(vn,hn)=>{var Dt;return openBlock(),createElementBlock("div",{id:unref(ae),class:normalizeClass([unref(Fe),unref(re).is("disabled",unref(ze))]),role:"slider","aria-label":unref(le)?void 0:vn.label||"rating","aria-labelledby":unref(le)?(Dt=unref(k))==null?void 0:Dt.labelId:void 0,"aria-valuenow":ue.value,"aria-valuetext":unref(Ie)||void 0,"aria-valuemin":"0","aria-valuemax":vn.max,tabindex:"0",style:normalizeStyle(unref(Ce)),onKeydown:Et},[(openBlock(!0),createElementBlock(Fragment,null,renderList(vn.max,(jt,bn)=>(openBlock(),createElementBlock("span",{key:bn,class:normalizeClass(unref(re).e("item")),onMousemove:Sn=>Pt(jt,Sn),onMouseleave:Lt,onClick:Sn=>kt(jt)},[createVNode(unref(ElIcon),{class:normalizeClass([unref(re).e("icon"),{hover:pe.value===jt},unref(re).is("active",jt<=ue.value)])},{default:withCtx(()=>[Ue(jt)?createCommentVNode("v-if",!0):(openBlock(),createBlock(resolveDynamicComponent(unref(Ne)[jt-1]),{key:0})),Ue(jt)?(openBlock(),createBlock(unref(ElIcon),{key:1,style:normalizeStyle(unref(xe)),class:normalizeClass([unref(re).e("icon"),unref(re).e("decimal")])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(he))))]),_:1},8,["style","class"])):createCommentVNode("v-if",!0)]),_:2},1032,["class"])],42,_hoisted_2$C))),128)),vn.showText||vn.showScore?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref(re).e("text"))},toDisplayString(unref(Ie)),3)):createCommentVNode("v-if",!0)],46,_hoisted_1$O)}}});var Rate=_export_sfc$2(_sfc_main$17,[["__file","/home/runner/work/element-plus/element-plus/packages/components/rate/src/rate.vue"]]);const ElRate=withInstall(Rate),IconMap={success:"icon-success",warning:"icon-warning",error:"icon-error",info:"icon-info"},IconComponentMap={[IconMap.success]:circle_check_filled_default,[IconMap.warning]:warning_filled_default,[IconMap.error]:circle_close_filled_default,[IconMap.info]:info_filled_default},resultProps=buildProps({title:{type:String,default:""},subTitle:{type:String,default:""},icon:{type:String,values:["success","warning","info","error"],default:"info"}}),__default__$p={name:"ElResult"},_sfc_main$16=defineComponent({...__default__$p,props:resultProps,setup(e){const n=e,r=useNamespace("result"),g=computed(()=>{const $=n.icon,L=$&&IconMap[$]?IconMap[$]:"icon-info",k=IconComponentMap[L]||IconComponentMap["icon-info"];return{class:L,component:k}});return($,L)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(r).b())},[createBaseVNode("div",{class:normalizeClass(unref(r).e("icon"))},[renderSlot($.$slots,"icon",{},()=>[unref(g).component?(openBlock(),createBlock(resolveDynamicComponent(unref(g).component),{key:0,class:normalizeClass(unref(g).class)},null,8,["class"])):createCommentVNode("v-if",!0)])],2),$.title||$.$slots.title?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(r).e("title"))},[renderSlot($.$slots,"title",{},()=>[createBaseVNode("p",null,toDisplayString($.title),1)])],2)):createCommentVNode("v-if",!0),$.subTitle||$.$slots["sub-title"]?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(r).e("subtitle"))},[renderSlot($.$slots,"sub-title",{},()=>[createBaseVNode("p",null,toDisplayString($.subTitle),1)])],2)):createCommentVNode("v-if",!0),$.$slots.extra?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(unref(r).e("extra"))},[renderSlot($.$slots,"extra")],2)):createCommentVNode("v-if",!0)],2))}});var Result=_export_sfc$2(_sfc_main$16,[["__file","/home/runner/work/element-plus/element-plus/packages/components/result/src/result.vue"]]);const ElResult=withInstall(Result),RowJustify=["start","center","end","space-around","space-between","space-evenly"],RowAlign=["top","middle","bottom"],rowProps=buildProps({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:RowJustify,default:"start"},align:{type:String,values:RowAlign,default:"top"}}),__default__$o={name:"ElRow"},_sfc_main$15=defineComponent({...__default__$o,props:rowProps,setup(e){const n=e,r=useNamespace("row"),g=computed(()=>n.gutter);provide(rowContextKey,{gutter:g});const $=computed(()=>{const L={};return n.gutter&&(L.marginRight=L.marginLeft=`-${n.gutter/2}px`),L});return(L,k)=>(openBlock(),createBlock(resolveDynamicComponent(L.tag),{class:normalizeClass([unref(r).b(),unref(r).is(`justify-${n.justify}`,L.justify!=="start"),unref(r).is(`align-${n.align}`,L.align!=="top")]),style:normalizeStyle(unref($))},{default:withCtx(()=>[renderSlot(L.$slots,"default")]),_:3},8,["class","style"]))}});var Row=_export_sfc$2(_sfc_main$15,[["__file","/home/runner/work/element-plus/element-plus/packages/components/row/src/row.vue"]]);const ElRow=withInstall(Row);var safeIsNaN=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function isEqual(e,n){return!!(e===n||safeIsNaN(e)&&safeIsNaN(n))}function areInputsEqual(e,n){if(e.length!==n.length)return!1;for(var r=0;r{const n=getCurrentInstance().proxy.$props;return computed(()=>{const r=(g,$,L)=>({});return n.perfMode?memoize(r):memoizeOne(r)})},DEFAULT_DYNAMIC_LIST_ITEM_SIZE=50,ITEM_RENDER_EVT="itemRendered",SCROLL_EVT="scroll",FORWARD="forward",BACKWARD="backward",AUTO_ALIGNMENT="auto",SMART_ALIGNMENT="smart",START_ALIGNMENT="start",CENTERED_ALIGNMENT="center",END_ALIGNMENT="end",HORIZONTAL="horizontal",VERTICAL="vertical",LTR$1="ltr",RTL$1="rtl",RTL_OFFSET_NAG="negative",RTL_OFFSET_POS_ASC="positive-ascending",RTL_OFFSET_POS_DESC="positive-descending",ScrollbarDirKey={[HORIZONTAL]:"left",[VERTICAL]:"top"},SCROLLBAR_MIN_SIZE=20,LayoutKeys={[HORIZONTAL]:"deltaX",[VERTICAL]:"deltaY"},useWheel=({atEndEdge:e,atStartEdge:n,layout:r},g)=>{let $,L=0;const k=re=>re<0&&n.value||re>0&&e.value;return{hasReachedEdge:k,onWheel:re=>{cAF($);const ae=re[LayoutKeys[r.value]];k(L)&&k(L+ae)||(L+=ae,isFirefox()||re.preventDefault(),$=rAF(()=>{g(L),L=0}))}}},itemSize=buildProp({type:definePropType([Number,Function]),required:!0}),estimatedItemSize=buildProp({type:Number}),cache$1=buildProp({type:Number,default:2}),direction=buildProp({type:String,values:["ltr","rtl"],default:"ltr"}),initScrollOffset=buildProp({type:Number,default:0}),total=buildProp({type:Number,required:!0}),layout=buildProp({type:String,values:["horizontal","vertical"],default:VERTICAL}),virtualizedProps=buildProps({className:{type:String,default:""},containerElement:{type:definePropType([String,Object]),default:"div"},data:{type:definePropType(Array),default:()=>mutable([])},direction,height:{type:[String,Number],required:!0},innerElement:{type:[String,Object],default:"div"},style:{type:definePropType([Object,String,Array])},useIsScrolling:{type:Boolean,default:!1},width:{type:[Number,String],required:!1},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:{type:Boolean,default:!1}}),virtualizedListProps=buildProps({cache:cache$1,estimatedItemSize,layout,initScrollOffset,total,itemSize,...virtualizedProps}),scrollbarSize={type:Number,default:6},startGap={type:Number,default:0},endGap={type:Number,default:2},virtualizedGridProps=buildProps({columnCache:cache$1,columnWidth:itemSize,estimatedColumnWidth:estimatedItemSize,estimatedRowHeight:estimatedItemSize,initScrollLeft:initScrollOffset,initScrollTop:initScrollOffset,itemKey:{type:definePropType(Function),default:({columnIndex:e,rowIndex:n})=>`${n}:${e}`},rowCache:cache$1,rowHeight:itemSize,totalColumn:total,totalRow:total,hScrollbarSize:scrollbarSize,vScrollbarSize:scrollbarSize,scrollbarStartGap:startGap,scrollbarEndGap:endGap,...virtualizedProps}),virtualizedScrollbarProps=buildProps({alwaysOn:Boolean,class:String,layout,total,ratio:{type:Number,required:!0},clientSize:{type:Number,required:!0},scrollFrom:{type:Number,required:!0},scrollbarSize,startGap,endGap,visible:Boolean}),getScrollDir=(e,n)=>ee===LTR$1||e===RTL$1||e===HORIZONTAL,isRTL=e=>e===RTL$1;let cachedRTLResult=null;function getRTLOffsetType(e=!1){if(cachedRTLResult===null||e){const n=document.createElement("div"),r=n.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";const g=document.createElement("div"),$=g.style;return $.width="100px",$.height="100px",n.appendChild(g),document.body.appendChild(n),n.scrollLeft>0?cachedRTLResult=RTL_OFFSET_POS_DESC:(n.scrollLeft=1,n.scrollLeft===0?cachedRTLResult=RTL_OFFSET_NAG:cachedRTLResult=RTL_OFFSET_POS_ASC),document.body.removeChild(n),cachedRTLResult}return cachedRTLResult}function renderThumbStyle({move:e,size:n,bar:r},g){const $={},L=`translate${r.axis}(${e}px)`;return $[r.size]=n,$.transform=L,$.msTransform=L,$.webkitTransform=L,g==="horizontal"?$.height="100%":$.width="100%",$}const ScrollBar=defineComponent({name:"ElVirtualScrollBar",props:virtualizedScrollbarProps,emits:["scroll","start-move","stop-move"],setup(e,{emit:n}){const r=computed(()=>e.startGap+e.endGap),g=useNamespace("virtual-scrollbar"),$=useNamespace("scrollbar"),L=ref(),k=ref();let oe=null,re=null;const ae=reactive({isDragging:!1,traveled:0}),le=computed(()=>BAR_MAP[e.layout]),ue=computed(()=>e.clientSize-unref(r)),pe=computed(()=>({position:"absolute",width:`${HORIZONTAL===e.layout?ue.value:e.scrollbarSize}px`,height:`${HORIZONTAL===e.layout?e.scrollbarSize:ue.value}px`,[ScrollbarDirKey[e.layout]]:"2px",right:"2px",bottom:"2px",borderRadius:"4px"})),de=computed(()=>{const Ve=e.ratio,he=e.clientSize;if(Ve>=100)return Number.POSITIVE_INFINITY;if(Ve>=50)return Ve*he/100;const Oe=he/3;return Math.floor(Math.min(Math.max(Ve*he,SCROLLBAR_MIN_SIZE),Oe))}),Fe=computed(()=>{if(!Number.isFinite(de.value))return{display:"none"};const Ve=`${de.value}px`;return renderThumbStyle({bar:le.value,size:Ve,move:ae.traveled},e.layout)}),ze=computed(()=>Math.floor(e.clientSize-de.value-unref(r))),Ce=()=>{window.addEventListener("mousemove",qe),window.addEventListener("mouseup",At);const Ve=unref(k);!Ve||(re=document.onselectstart,document.onselectstart=()=>!1,Ve.addEventListener("touchmove",qe),Ve.addEventListener("touchend",At))},Ie=()=>{window.removeEventListener("mousemove",qe),window.removeEventListener("mouseup",At),document.onselectstart=re,re=null;const Ve=unref(k);!Ve||(Ve.removeEventListener("touchmove",qe),Ve.removeEventListener("touchend",At))},_e=Ve=>{Ve.stopImmediatePropagation(),!(Ve.ctrlKey||[1,2].includes(Ve.button))&&(ae.isDragging=!0,ae[le.value.axis]=Ve.currentTarget[le.value.offset]-(Ve[le.value.client]-Ve.currentTarget.getBoundingClientRect()[le.value.direction]),n("start-move"),Ce())},At=()=>{ae.isDragging=!1,ae[le.value.axis]=0,n("stop-move"),Ie()},qe=Ve=>{const{isDragging:he}=ae;if(!he||!k.value||!L.value)return;const Oe=ae[le.value.axis];if(!Oe)return;cAF(oe);const $e=(L.value.getBoundingClientRect()[le.value.direction]-Ve[le.value.client])*-1,Ne=k.value[le.value.offset]-Oe,Ue=$e-Ne;oe=rAF(()=>{ae.traveled=Math.max(e.startGap,Math.min(Ue,ze.value)),n("scroll",Ue,ze.value)})},xe=Ve=>{const he=Math.abs(Ve.target.getBoundingClientRect()[le.value.direction]-Ve[le.value.client]),Oe=k.value[le.value.offset]/2,$e=he-Oe;ae.traveled=Math.max(0,Math.min($e,ze.value)),n("scroll",$e,ze.value)};return watch(()=>e.scrollFrom,Ve=>{ae.isDragging||(ae.traveled=Math.ceil(Ve*ze.value))}),onBeforeUnmount(()=>{Ie()}),()=>h$2("div",{role:"presentation",ref:L,class:[g.b(),e.class,(e.alwaysOn||ae.isDragging)&&"always-on"],style:pe.value,onMousedown:withModifiers(xe,["stop","prevent"]),onTouchstartPrevent:_e},h$2("div",{ref:k,class:$.e("thumb"),style:Fe.value,onMousedown:_e},[]))}}),createList=({name:e,getOffset:n,getItemSize:r,getItemOffset:g,getEstimatedTotalSize:$,getStartIndexForOffset:L,getStopIndexForStartIndex:k,initCache:oe,clearCache:re,validateProps:ae})=>defineComponent({name:e??"ElVirtualList",props:virtualizedListProps,emits:[ITEM_RENDER_EVT,SCROLL_EVT],setup(le,{emit:ue,expose:pe}){ae(le);const de=getCurrentInstance(),Fe=useNamespace("vl"),ze=ref(oe(le,de)),Ce=useCache(),Ie=ref(),_e=ref(),At=ref(),qe=ref({isScrolling:!1,scrollDir:"forward",scrollOffset:isNumber(le.initScrollOffset)?le.initScrollOffset:0,updateRequested:!1,isScrollbarDragging:!1,scrollbarAlwaysOn:le.scrollbarAlwaysOn}),xe=computed(()=>{const{total:On,cache:En}=le,{isScrolling:An,scrollDir:In,scrollOffset:$n}=unref(qe);if(On===0)return[0,0,0,0];const Pn=L(le,$n,unref(ze)),Dn=k(le,Pn,$n,unref(ze)),Mn=!An||In===BACKWARD?Math.max(1,En):1,Fn=!An||In===FORWARD?Math.max(1,En):1;return[Math.max(0,Pn-Mn),Math.max(0,Math.min(On-1,Dn+Fn)),Pn,Dn]}),Ve=computed(()=>$(le,unref(ze))),he=computed(()=>isHorizontal(le.layout)),Oe=computed(()=>[{position:"relative",[`overflow-${he.value?"x":"y"}`]:"scroll",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:le.direction,height:isNumber(le.height)?`${le.height}px`:le.height,width:isNumber(le.width)?`${le.width}px`:le.width},le.style]),$e=computed(()=>{const On=unref(Ve),En=unref(he);return{height:En?"100%":`${On}px`,pointerEvents:unref(qe).isScrolling?"none":void 0,width:En?`${On}px`:"100%"}}),Ne=computed(()=>he.value?le.width:le.height),{onWheel:Ue}=useWheel({atStartEdge:computed(()=>qe.value.scrollOffset<=0),atEndEdge:computed(()=>qe.value.scrollOffset>=Ve.value),layout:computed(()=>le.layout)},On=>{var En,An;(An=(En=At.value).onMouseUp)==null||An.call(En),hn(Math.min(qe.value.scrollOffset+On,Ve.value-Ne.value))}),kt=()=>{const{total:On}=le;if(On>0){const[$n,Pn,Dn,Mn]=unref(xe);ue(ITEM_RENDER_EVT,$n,Pn,Dn,Mn)}const{scrollDir:En,scrollOffset:An,updateRequested:In}=unref(qe);ue(SCROLL_EVT,En,An,In)},Et=On=>{const{clientHeight:En,scrollHeight:An,scrollTop:In}=On.currentTarget,$n=unref(qe);if($n.scrollOffset===In)return;const Pn=Math.max(0,Math.min(In,An-En));qe.value={...$n,isScrolling:!0,scrollDir:getScrollDir($n.scrollOffset,Pn),scrollOffset:Pn,updateRequested:!1},nextTick(bn)},Pt=On=>{const{clientWidth:En,scrollLeft:An,scrollWidth:In}=On.currentTarget,$n=unref(qe);if($n.scrollOffset===An)return;const{direction:Pn}=le;let Dn=An;if(Pn===RTL$1)switch(getRTLOffsetType()){case RTL_OFFSET_NAG:{Dn=-An;break}case RTL_OFFSET_POS_DESC:{Dn=In-En-An;break}}Dn=Math.max(0,Math.min(Dn,In-En)),qe.value={...$n,isScrolling:!0,scrollDir:getScrollDir($n.scrollOffset,Dn),scrollOffset:Dn,updateRequested:!1},nextTick(bn)},Lt=On=>{unref(he)?Pt(On):Et(On),kt()},vn=(On,En)=>{const An=(Ve.value-Ne.value)/En*On;hn(Math.min(Ve.value-Ne.value,An))},hn=On=>{On=Math.max(On,0),On!==unref(qe).scrollOffset&&(qe.value={...unref(qe),scrollOffset:On,scrollDir:getScrollDir(unref(qe).scrollOffset,On),updateRequested:!0},nextTick(bn))},Dt=(On,En=AUTO_ALIGNMENT)=>{const{scrollOffset:An}=unref(qe);On=Math.max(0,Math.min(On,le.total-1)),hn(n(le,On,En,An,unref(ze)))},jt=On=>{const{direction:En,itemSize:An,layout:In}=le,$n=Ce.value(re&&An,re&&In,re&&En);let Pn;if(hasOwn($n,String(On)))Pn=$n[On];else{const Dn=g(le,On,unref(ze)),Mn=r(le,On,unref(ze)),Fn=unref(he),kn=En===RTL$1,Nn=Fn?Dn:0;$n[On]=Pn={position:"absolute",left:kn?void 0:`${Nn}px`,right:kn?`${Nn}px`:void 0,top:Fn?0:`${Dn}px`,height:Fn?"100%":`${Mn}px`,width:Fn?`${Mn}px`:"100%"}}return Pn},bn=()=>{qe.value.isScrolling=!1,nextTick(()=>{Ce.value(-1,null,null)})},Sn=()=>{const On=Ie.value;On&&(On.scrollTop=0)};onMounted(()=>{if(!isClient)return;const{initScrollOffset:On}=le,En=unref(Ie);isNumber(On)&&En&&(unref(he)?En.scrollLeft=On:En.scrollTop=On),kt()}),onUpdated(()=>{const{direction:On,layout:En}=le,{scrollOffset:An,updateRequested:In}=unref(qe),$n=unref(Ie);if(In&&$n)if(En===HORIZONTAL)if(On===RTL$1)switch(getRTLOffsetType()){case"negative":{$n.scrollLeft=-An;break}case"positive-ascending":{$n.scrollLeft=An;break}default:{const{clientWidth:Pn,scrollWidth:Dn}=$n;$n.scrollLeft=Dn-Pn-An;break}}else $n.scrollLeft=An;else $n.scrollTop=An});const Cn={ns:Fe,clientSize:Ne,estimatedTotalSize:Ve,windowStyle:Oe,windowRef:Ie,innerRef:_e,innerStyle:$e,itemsToRender:xe,scrollbarRef:At,states:qe,getItemStyle:jt,onScroll:Lt,onScrollbarScroll:vn,onWheel:Ue,scrollTo:hn,scrollToItem:Dt,resetScrollTop:Sn};return pe({windowRef:Ie,innerRef:_e,getItemStyleCache:Ce,scrollTo:hn,scrollToItem:Dt,resetScrollTop:Sn,states:qe}),Cn},render(le){var ue;const{$slots:pe,className:de,clientSize:Fe,containerElement:ze,data:Ce,getItemStyle:Ie,innerElement:_e,itemsToRender:At,innerStyle:qe,layout:xe,total:Ve,onScroll:he,onScrollbarScroll:Oe,onWheel:$e,states:Ne,useIsScrolling:Ue,windowStyle:kt,ns:Et}=le,[Pt,Lt]=At,vn=resolveDynamicComponent(ze),hn=resolveDynamicComponent(_e),Dt=[];if(Ve>0)for(let Cn=Pt;Cn<=Lt;Cn++)Dt.push((ue=pe.default)==null?void 0:ue.call(pe,{data:Ce,key:Cn,index:Cn,isScrolling:Ue?Ne.isScrolling:void 0,style:Ie(Cn)}));const jt=[h$2(hn,{style:qe,ref:"innerRef"},isString$2(hn)?Dt:{default:()=>Dt})],bn=h$2(ScrollBar,{ref:"scrollbarRef",clientSize:Fe,layout:xe,onScroll:Oe,ratio:Fe*100/this.estimatedTotalSize,scrollFrom:Ne.scrollOffset/(this.estimatedTotalSize-Fe),total:Ve}),Sn=h$2(vn,{class:[Et.e("window"),de],style:kt,onScroll:he,onWheel:$e,ref:"windowRef",key:0},isString$2(vn)?[jt]:{default:()=>[jt]});return h$2("div",{key:0,class:[Et.e("wrapper"),Ne.scrollbarAlwaysOn?"always-on":""]},[Sn,bn])}}),FixedSizeList=createList({name:"ElFixedSizeList",getItemOffset:({itemSize:e},n)=>n*e,getItemSize:({itemSize:e})=>e,getEstimatedTotalSize:({total:e,itemSize:n})=>n*e,getOffset:({height:e,total:n,itemSize:r,layout:g,width:$},L,k,oe)=>{const re=isHorizontal(g)?$:e,ae=Math.max(0,n*r-re),le=Math.min(ae,L*r),ue=Math.max(0,(L+1)*r-re);switch(k===SMART_ALIGNMENT&&(oe>=ue-re&&oe<=le+re?k=AUTO_ALIGNMENT:k=CENTERED_ALIGNMENT),k){case START_ALIGNMENT:return le;case END_ALIGNMENT:return ue;case CENTERED_ALIGNMENT:{const pe=Math.round(ue+(le-ue)/2);return peae+Math.floor(re/2)?ae:pe}case AUTO_ALIGNMENT:default:return oe>=ue&&oe<=le?oe:oeMath.max(0,Math.min(e-1,Math.floor(r/n))),getStopIndexForStartIndex:({height:e,total:n,itemSize:r,layout:g,width:$},L,k)=>{const oe=L*r,re=isHorizontal(g)?$:e,ae=Math.ceil((re+k-oe)/r);return Math.max(0,Math.min(n-1,L+ae-1))},initCache(){},clearCache:!0,validateProps(){}}),getItemFromCache$1=(e,n,r)=>{const{itemSize:g}=e,{items:$,lastVisitedIndex:L}=r;if(n>L){let k=0;if(L>=0){const oe=$[L];k=oe.offset+oe.size}for(let oe=L+1;oe<=n;oe++){const re=g(oe);$[oe]={offset:k,size:re},k+=re}r.lastVisitedIndex=n}return $[n]},findItem$1=(e,n,r)=>{const{items:g,lastVisitedIndex:$}=n;return($>0?g[$].offset:0)>=r?bs$1(e,n,0,$,r):es$1(e,n,Math.max(0,$),r)},bs$1=(e,n,r,g,$)=>{for(;r<=g;){const L=r+Math.floor((g-r)/2),k=getItemFromCache$1(e,L,n).offset;if(k===$)return L;k<$?r=L+1:k>$&&(g=L-1)}return Math.max(0,r-1)},es$1=(e,n,r,g)=>{const{total:$}=e;let L=1;for(;r<$&&getItemFromCache$1(e,r,n).offset{let $=0;if(g>=e&&(g=e-1),g>=0){const oe=n[g];$=oe.offset+oe.size}const k=(e-g-1)*r;return $+k},DynamicSizeList=createList({name:"ElDynamicSizeList",getItemOffset:(e,n,r)=>getItemFromCache$1(e,n,r).offset,getItemSize:(e,n,{items:r})=>r[n].size,getEstimatedTotalSize,getOffset:(e,n,r,g,$)=>{const{height:L,layout:k,width:oe}=e,re=isHorizontal(k)?oe:L,ae=getItemFromCache$1(e,n,$),le=getEstimatedTotalSize(e,$),ue=Math.max(0,Math.min(le-re,ae.offset)),pe=Math.max(0,ae.offset-re+ae.size);switch(r===SMART_ALIGNMENT&&(g>=pe-re&&g<=ue+re?r=AUTO_ALIGNMENT:r=CENTERED_ALIGNMENT),r){case START_ALIGNMENT:return ue;case END_ALIGNMENT:return pe;case CENTERED_ALIGNMENT:return Math.round(pe+(ue-pe)/2);case AUTO_ALIGNMENT:default:return g>=pe&&g<=ue?g:gfindItem$1(e,r,n),getStopIndexForStartIndex:(e,n,r,g)=>{const{height:$,total:L,layout:k,width:oe}=e,re=isHorizontal(k)?oe:$,ae=getItemFromCache$1(e,n,g),le=r+re;let ue=ae.offset+ae.size,pe=n;for(;pe{var L,k;r.lastVisitedIndex=Math.min(r.lastVisitedIndex,g-1),(L=n.exposed)==null||L.getItemStyleCache(-1),$&&((k=n.proxy)==null||k.$forceUpdate())},r},clearCache:!1,validateProps:({itemSize:e})=>{}}),useGridWheel=({atXEndEdge:e,atXStartEdge:n,atYEndEdge:r,atYStartEdge:g},$)=>{let L=null,k=0,oe=0;const re=(le,ue)=>{const pe=le<0&&n.value||le>0&&e.value,de=ue<0&&g.value||ue>0&&r.value;return pe&&de};return{hasReachedEdge:re,onWheel:le=>{cAF(L);let ue=le.deltaX,pe=le.deltaY;Math.abs(ue)>Math.abs(pe)?pe=0:ue=0,le.shiftKey&&pe!==0&&(ue=pe,pe=0),!(re(k,oe)&&re(k+ue,oe+pe))&&(k+=ue,oe+=pe,isFirefox()||le.preventDefault(),L=rAF(()=>{$(k,oe),k=0,oe=0}))}}},createGrid=({name:e,clearCache:n,getColumnPosition:r,getColumnStartIndexForOffset:g,getColumnStopIndexForStartIndex:$,getEstimatedTotalHeight:L,getEstimatedTotalWidth:k,getColumnOffset:oe,getRowOffset:re,getRowPosition:ae,getRowStartIndexForOffset:le,getRowStopIndexForStartIndex:ue,initCache:pe,injectToInstance:de,validateProps:Fe})=>defineComponent({name:e??"ElVirtualList",props:virtualizedGridProps,emits:[ITEM_RENDER_EVT,SCROLL_EVT],setup(ze,{emit:Ce,expose:Ie,slots:_e}){const At=useNamespace("vl");Fe(ze);const qe=getCurrentInstance(),xe=ref(pe(ze,qe));de?.(qe,xe);const Ve=ref(),he=ref(),Oe=ref(),$e=ref(null),Ne=ref({isScrolling:!1,scrollLeft:isNumber(ze.initScrollLeft)?ze.initScrollLeft:0,scrollTop:isNumber(ze.initScrollTop)?ze.initScrollTop:0,updateRequested:!1,xAxisScrollDir:FORWARD,yAxisScrollDir:FORWARD}),Ue=useCache(),kt=computed(()=>Number.parseInt(`${ze.height}`,10)),Et=computed(()=>Number.parseInt(`${ze.width}`,10)),Pt=computed(()=>{const{totalColumn:xn,totalRow:Bn,columnCache:Ln}=ze,{isScrolling:Hn,xAxisScrollDir:zn,scrollLeft:Jn}=unref(Ne);if(xn===0||Bn===0)return[0,0,0,0];const co=g(ze,Jn,unref(xe)),Gn=$(ze,co,Jn,unref(xe)),eo=!Hn||zn===BACKWARD?Math.max(1,Ln):1,ao=!Hn||zn===FORWARD?Math.max(1,Ln):1;return[Math.max(0,co-eo),Math.max(0,Math.min(xn-1,Gn+ao)),co,Gn]}),Lt=computed(()=>{const{totalColumn:xn,totalRow:Bn,rowCache:Ln}=ze,{isScrolling:Hn,yAxisScrollDir:zn,scrollTop:Jn}=unref(Ne);if(xn===0||Bn===0)return[0,0,0,0];const co=le(ze,Jn,unref(xe)),Gn=ue(ze,co,Jn,unref(xe)),eo=!Hn||zn===BACKWARD?Math.max(1,Ln):1,ao=!Hn||zn===FORWARD?Math.max(1,Ln):1;return[Math.max(0,co-eo),Math.max(0,Math.min(Bn-1,Gn+ao)),co,Gn]}),vn=computed(()=>L(ze,unref(xe))),hn=computed(()=>k(ze,unref(xe))),Dt=computed(()=>{var xn;return[{position:"relative",overflow:"hidden",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:ze.direction,height:isNumber(ze.height)?`${ze.height}px`:ze.height,width:isNumber(ze.width)?`${ze.width}px`:ze.width},(xn=ze.style)!=null?xn:{}]}),jt=computed(()=>{const xn=`${unref(hn)}px`;return{height:`${unref(vn)}px`,pointerEvents:unref(Ne).isScrolling?"none":void 0,width:xn}}),bn=()=>{const{totalColumn:xn,totalRow:Bn}=ze;if(xn>0&&Bn>0){const[Gn,eo,ao,ho]=unref(Pt),[Yn,Wn,Vn,_n]=unref(Lt);Ce(ITEM_RENDER_EVT,{columnCacheStart:Gn,columnCacheEnd:eo,rowCacheStart:Yn,rowCacheEnd:Wn,columnVisibleStart:ao,columnVisibleEnd:ho,rowVisibleStart:Vn,rowVisibleEnd:_n})}const{scrollLeft:Ln,scrollTop:Hn,updateRequested:zn,xAxisScrollDir:Jn,yAxisScrollDir:co}=unref(Ne);Ce(SCROLL_EVT,{xAxisScrollDir:Jn,scrollLeft:Ln,yAxisScrollDir:co,scrollTop:Hn,updateRequested:zn})},Sn=xn=>{const{clientHeight:Bn,clientWidth:Ln,scrollHeight:Hn,scrollLeft:zn,scrollTop:Jn,scrollWidth:co}=xn.currentTarget,Gn=unref(Ne);if(Gn.scrollTop===Jn&&Gn.scrollLeft===zn)return;let eo=zn;if(isRTL(ze.direction))switch(getRTLOffsetType()){case RTL_OFFSET_NAG:eo=-zn;break;case RTL_OFFSET_POS_DESC:eo=co-Ln-zn;break}Ne.value={...Gn,isScrolling:!0,scrollLeft:eo,scrollTop:Math.max(0,Math.min(Jn,Hn-Bn)),updateRequested:!0,xAxisScrollDir:getScrollDir(Gn.scrollLeft,eo),yAxisScrollDir:getScrollDir(Gn.scrollTop,Jn)},nextTick(()=>Pn()),Dn(),bn()},Cn=(xn,Bn)=>{const Ln=unref(kt),Hn=(vn.value-Ln)/Bn*xn;An({scrollTop:Math.min(vn.value-Ln,Hn)})},On=(xn,Bn)=>{const Ln=unref(Et),Hn=(hn.value-Ln)/Bn*xn;An({scrollLeft:Math.min(hn.value-Ln,Hn)})},{onWheel:En}=useGridWheel({atXStartEdge:computed(()=>Ne.value.scrollLeft<=0),atXEndEdge:computed(()=>Ne.value.scrollLeft>=hn.value),atYStartEdge:computed(()=>Ne.value.scrollTop<=0),atYEndEdge:computed(()=>Ne.value.scrollTop>=vn.value)},(xn,Bn)=>{var Ln,Hn,zn,Jn;(Hn=(Ln=he.value)==null?void 0:Ln.onMouseUp)==null||Hn.call(Ln),(Jn=(zn=he.value)==null?void 0:zn.onMouseUp)==null||Jn.call(zn);const co=unref(Et),Gn=unref(kt);An({scrollLeft:Math.min(Ne.value.scrollLeft+xn,hn.value-co),scrollTop:Math.min(Ne.value.scrollTop+Bn,vn.value-Gn)})}),An=({scrollLeft:xn=Ne.value.scrollLeft,scrollTop:Bn=Ne.value.scrollTop})=>{xn=Math.max(xn,0),Bn=Math.max(Bn,0);const Ln=unref(Ne);Bn===Ln.scrollTop&&xn===Ln.scrollLeft||(Ne.value={...Ln,xAxisScrollDir:getScrollDir(Ln.scrollLeft,xn),yAxisScrollDir:getScrollDir(Ln.scrollTop,Bn),scrollLeft:xn,scrollTop:Bn,updateRequested:!0},nextTick(()=>Pn()),Dn(),bn())},In=(xn=0,Bn=0,Ln=AUTO_ALIGNMENT)=>{const Hn=unref(Ne);Bn=Math.max(0,Math.min(Bn,ze.totalColumn-1)),xn=Math.max(0,Math.min(xn,ze.totalRow-1));const zn=getScrollBarWidth(At.namespace.value),Jn=unref(xe),co=L(ze,Jn),Gn=k(ze,Jn);An({scrollLeft:oe(ze,Bn,Ln,Hn.scrollLeft,Jn,Gn>ze.width?zn:0),scrollTop:re(ze,xn,Ln,Hn.scrollTop,Jn,co>ze.height?zn:0)})},$n=(xn,Bn)=>{const{columnWidth:Ln,direction:Hn,rowHeight:zn}=ze,Jn=Ue.value(n&&Ln,n&&zn,n&&Hn),co=`${xn},${Bn}`;if(hasOwn(Jn,co))return Jn[co];{const[,Gn]=r(ze,Bn,unref(xe)),eo=unref(xe),ao=isRTL(Hn),[ho,Yn]=ae(ze,xn,eo),[Wn]=r(ze,Bn,eo);return Jn[co]={position:"absolute",left:ao?void 0:`${Gn}px`,right:ao?`${Gn}px`:void 0,top:`${Yn}px`,height:`${ho}px`,width:`${Wn}px`},Jn[co]}},Pn=()=>{Ne.value.isScrolling=!1,nextTick(()=>{Ue.value(-1,null,null)})};onMounted(()=>{if(!isClient)return;const{initScrollLeft:xn,initScrollTop:Bn}=ze,Ln=unref(Ve);Ln&&(isNumber(xn)&&(Ln.scrollLeft=xn),isNumber(Bn)&&(Ln.scrollTop=Bn)),bn()});const Dn=()=>{const{direction:xn}=ze,{scrollLeft:Bn,scrollTop:Ln,updateRequested:Hn}=unref(Ne),zn=unref(Ve);if(Hn&&zn){if(xn===RTL$1)switch(getRTLOffsetType()){case RTL_OFFSET_NAG:{zn.scrollLeft=-Bn;break}case RTL_OFFSET_POS_ASC:{zn.scrollLeft=Bn;break}default:{const{clientWidth:Jn,scrollWidth:co}=zn;zn.scrollLeft=co-Jn-Bn;break}}else zn.scrollLeft=Math.max(0,Bn);zn.scrollTop=Math.max(0,Ln)}},{resetAfterColumnIndex:Mn,resetAfterRowIndex:Fn,resetAfter:kn}=qe.proxy;Ie({windowRef:Ve,innerRef:$e,getItemStyleCache:Ue,scrollTo:An,scrollToItem:In,states:Ne,resetAfterColumnIndex:Mn,resetAfterRowIndex:Fn,resetAfter:kn});const Nn=()=>{const{scrollbarAlwaysOn:xn,scrollbarStartGap:Bn,scrollbarEndGap:Ln,totalColumn:Hn,totalRow:zn}=ze,Jn=unref(Et),co=unref(kt),Gn=unref(hn),eo=unref(vn),{scrollLeft:ao,scrollTop:ho}=unref(Ne),Yn=h$2(ScrollBar,{ref:he,alwaysOn:xn,startGap:Bn,endGap:Ln,class:At.e("horizontal"),clientSize:Jn,layout:"horizontal",onScroll:On,ratio:Jn*100/Gn,scrollFrom:ao/(Gn-Jn),total:zn,visible:!0}),Wn=h$2(ScrollBar,{ref:Oe,alwaysOn:xn,startGap:Bn,endGap:Ln,class:At.e("vertical"),clientSize:co,layout:"vertical",onScroll:Cn,ratio:co*100/eo,scrollFrom:ho/(eo-co),total:Hn,visible:!0});return{horizontalScrollbar:Yn,verticalScrollbar:Wn}},Rn=()=>{var xn;const[Bn,Ln]=unref(Pt),[Hn,zn]=unref(Lt),{data:Jn,totalColumn:co,totalRow:Gn,useIsScrolling:eo,itemKey:ao}=ze,ho=[];if(Gn>0&&co>0)for(let Yn=Hn;Yn<=zn;Yn++)for(let Wn=Bn;Wn<=Ln;Wn++)ho.push((xn=_e.default)==null?void 0:xn.call(_e,{columnIndex:Wn,data:Jn,key:ao({columnIndex:Wn,data:Jn,rowIndex:Yn}),isScrolling:eo?unref(Ne).isScrolling:void 0,style:$n(Yn,Wn),rowIndex:Yn}));return ho},wn=()=>{const xn=resolveDynamicComponent(ze.innerElement),Bn=Rn();return[h$2(xn,{style:unref(jt),ref:$e},isString$2(xn)?Bn:{default:()=>Bn})]};return()=>{const xn=resolveDynamicComponent(ze.containerElement),{horizontalScrollbar:Bn,verticalScrollbar:Ln}=Nn(),Hn=wn();return h$2("div",{key:0,class:At.e("wrapper")},[h$2(xn,{class:ze.className,style:unref(Dt),onScroll:Sn,onWheel:En,ref:Ve},isString$2(xn)?Hn:{default:()=>Hn}),Bn,Ln])}}}),FixedSizeGrid=createGrid({name:"ElFixedSizeGrid",getColumnPosition:({columnWidth:e},n)=>[e,n*e],getRowPosition:({rowHeight:e},n)=>[e,n*e],getEstimatedTotalHeight:({totalRow:e,rowHeight:n})=>n*e,getEstimatedTotalWidth:({totalColumn:e,columnWidth:n})=>n*e,getColumnOffset:({totalColumn:e,columnWidth:n,width:r},g,$,L,k,oe)=>{r=Number(r);const re=Math.max(0,e*n-r),ae=Math.min(re,g*n),le=Math.max(0,g*n-r+oe+n);switch($==="smart"&&(L>=le-r&&L<=ae+r?$=AUTO_ALIGNMENT:$=CENTERED_ALIGNMENT),$){case START_ALIGNMENT:return ae;case END_ALIGNMENT:return le;case CENTERED_ALIGNMENT:{const ue=Math.round(le+(ae-le)/2);return uere+Math.floor(r/2)?re:ue}case AUTO_ALIGNMENT:default:return L>=le&&L<=ae?L:le>ae||L{n=Number(n);const re=Math.max(0,r*e-n),ae=Math.min(re,g*e),le=Math.max(0,g*e-n+oe+e);switch($===SMART_ALIGNMENT&&(L>=le-n&&L<=ae+n?$=AUTO_ALIGNMENT:$=CENTERED_ALIGNMENT),$){case START_ALIGNMENT:return ae;case END_ALIGNMENT:return le;case CENTERED_ALIGNMENT:{const ue=Math.round(le+(ae-le)/2);return uere+Math.floor(n/2)?re:ue}case AUTO_ALIGNMENT:default:return L>=le&&L<=ae?L:le>ae||LMath.max(0,Math.min(n-1,Math.floor(r/e))),getColumnStopIndexForStartIndex:({columnWidth:e,totalColumn:n,width:r},g,$)=>{const L=g*e,k=Math.ceil((r+$-L)/e);return Math.max(0,Math.min(n-1,g+k-1))},getRowStartIndexForOffset:({rowHeight:e,totalRow:n},r)=>Math.max(0,Math.min(n-1,Math.floor(r/e))),getRowStopIndexForStartIndex:({rowHeight:e,totalRow:n,height:r},g,$)=>{const L=g*e,k=Math.ceil((r+$-L)/e);return Math.max(0,Math.min(n-1,g+k-1))},initCache:()=>{},clearCache:!0,validateProps:({columnWidth:e,rowHeight:n})=>{}}),{max,min,floor}=Math,ACCESS_SIZER_KEY_MAP={column:"columnWidth",row:"rowHeight"},ACCESS_LAST_VISITED_KEY_MAP={column:"lastVisitedColumnIndex",row:"lastVisitedRowIndex"},getItemFromCache=(e,n,r,g)=>{const[$,L,k]=[r[g],e[ACCESS_SIZER_KEY_MAP[g]],r[ACCESS_LAST_VISITED_KEY_MAP[g]]];if(n>k){let oe=0;if(k>=0){const re=$[k];oe=re.offset+re.size}for(let re=k+1;re<=n;re++){const ae=L(re);$[re]={offset:oe,size:ae},oe+=ae}r[ACCESS_LAST_VISITED_KEY_MAP[g]]=n}return $[n]},bs=(e,n,r,g,$,L)=>{for(;r<=g;){const k=r+floor((g-r)/2),oe=getItemFromCache(e,k,n,L).offset;if(oe===$)return k;oe<$?r=k+1:g=k-1}return max(0,r-1)},es=(e,n,r,g,$)=>{const L=$==="column"?e.totalColumn:e.totalRow;let k=1;for(;r{const[$,L]=[n[g],n[ACCESS_LAST_VISITED_KEY_MAP[g]]];return(L>0?$[L].offset:0)>=r?bs(e,n,0,L,r,g):es(e,n,max(0,L),r,g)},getEstimatedTotalHeight=({totalRow:e},{estimatedRowHeight:n,lastVisitedRowIndex:r,row:g})=>{let $=0;if(r>=e&&(r=e-1),r>=0){const oe=g[r];$=oe.offset+oe.size}const k=(e-r-1)*n;return $+k},getEstimatedTotalWidth=({totalColumn:e},{column:n,estimatedColumnWidth:r,lastVisitedColumnIndex:g})=>{let $=0;if(g>e&&(g=e-1),g>=0){const oe=n[g];$=oe.offset+oe.size}const k=(e-g-1)*r;return $+k},ACCESS_ESTIMATED_SIZE_KEY_MAP={column:getEstimatedTotalWidth,row:getEstimatedTotalHeight},getOffset$1=(e,n,r,g,$,L,k)=>{const[oe,re]=[L==="row"?e.height:e.width,ACCESS_ESTIMATED_SIZE_KEY_MAP[L]],ae=getItemFromCache(e,n,$,L),le=re(e,$),ue=max(0,min(le-oe,ae.offset)),pe=max(0,ae.offset-oe+k+ae.size);switch(r===SMART_ALIGNMENT&&(g>=pe-oe&&g<=ue+oe?r=AUTO_ALIGNMENT:r=CENTERED_ALIGNMENT),r){case START_ALIGNMENT:return ue;case END_ALIGNMENT:return pe;case CENTERED_ALIGNMENT:return Math.round(pe+(ue-pe)/2);case AUTO_ALIGNMENT:default:return g>=pe&&g<=ue?g:pe>ue||g{const g=getItemFromCache(e,n,r,"column");return[g.size,g.offset]},getRowPosition:(e,n,r)=>{const g=getItemFromCache(e,n,r,"row");return[g.size,g.offset]},getColumnOffset:(e,n,r,g,$,L)=>getOffset$1(e,n,r,g,$,"column",L),getRowOffset:(e,n,r,g,$,L)=>getOffset$1(e,n,r,g,$,"row",L),getColumnStartIndexForOffset:(e,n,r)=>findItem(e,r,n,"column"),getColumnStopIndexForStartIndex:(e,n,r,g)=>{const $=getItemFromCache(e,n,g,"column"),L=r+e.width;let k=$.offset+$.size,oe=n;for(;oefindItem(e,r,n,"row"),getRowStopIndexForStartIndex:(e,n,r,g)=>{const{totalRow:$,height:L}=e,k=getItemFromCache(e,n,g,"row"),oe=r+L;let re=k.size+k.offset,ae=n;for(;ae<$-1&&re{const r=({columnIndex:L,rowIndex:k},oe)=>{var re,ae;oe=isUndefined(oe)?!0:oe,isNumber(L)&&(n.value.lastVisitedColumnIndex=Math.min(n.value.lastVisitedColumnIndex,L-1)),isNumber(k)&&(n.value.lastVisitedRowIndex=Math.min(n.value.lastVisitedRowIndex,k-1)),(re=e.exposed)==null||re.getItemStyleCache.value(-1,null,null),oe&&((ae=e.proxy)==null||ae.$forceUpdate())},g=(L,k)=>{r({columnIndex:L},k)},$=(L,k)=>{r({rowIndex:L},k)};Object.assign(e.proxy,{resetAfterColumnIndex:g,resetAfterRowIndex:$,resetAfter:r})},initCache:({estimatedColumnWidth:e=DEFAULT_DYNAMIC_LIST_ITEM_SIZE,estimatedRowHeight:n=DEFAULT_DYNAMIC_LIST_ITEM_SIZE})=>({column:{},estimatedColumnWidth:e,estimatedRowHeight:n,lastVisitedColumnIndex:-1,lastVisitedRowIndex:-1,row:{}}),clearCache:!1,validateProps:({columnWidth:e,rowHeight:n})=>{}}),_sfc_main$14=defineComponent({props:{item:{type:Object,required:!0},style:Object,height:Number},setup(){return{ns:useNamespace("select")}}});function _sfc_render$G(e,n,r,g,$,L){return e.item.isTitle?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.ns.be("group","title")),style:normalizeStyle([e.style,{lineHeight:`${e.height}px`}])},toDisplayString(e.item.label),7)):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.ns.be("group","split")),style:normalizeStyle(e.style)},[createBaseVNode("span",{class:normalizeClass(e.ns.be("group","split-dash")),style:normalizeStyle({top:`${e.height/2}px`})},null,6)],6))}var GroupItem=_export_sfc$2(_sfc_main$14,[["render",_sfc_render$G],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/group-item.vue"]]);function useOption(e,{emit:n}){return{hoverItem:()=>{e.disabled||n("hover",e.index)},selectOptionClick:()=>{e.disabled||n("select",e.item,e.index)}}}const SelectProps={allowCreate:Boolean,autocomplete:{type:String,default:"none"},automaticDropdown:Boolean,clearable:Boolean,clearIcon:{type:[String,Object],default:circle_close_default},effect:{type:String,default:"light"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},defaultFirstOption:Boolean,disabled:Boolean,estimatedOptionHeight:{type:Number,default:void 0},filterable:Boolean,filterMethod:Function,height:{type:Number,default:170},itemHeight:{type:Number,default:34},id:String,loading:Boolean,loadingText:String,label:String,modelValue:[Array,String,Number,Boolean,Object],multiple:Boolean,multipleLimit:{type:Number,default:0},name:String,noDataText:String,noMatchText:String,remoteMethod:Function,reserveKeyword:{type:Boolean,default:!0},options:{type:Array,required:!0},placeholder:{type:String},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,size:{type:String,validator:isValidComponentSize},valueKey:{type:String,default:"value"},scrollbarAlwaysOn:{type:Boolean,default:!1},validateEvent:{type:Boolean,default:!0}},OptionProps={data:Array,disabled:Boolean,hovering:Boolean,item:Object,index:Number,style:Object,selected:Boolean,created:Boolean},_sfc_main$13=defineComponent({props:OptionProps,emits:["select","hover"],setup(e,{emit:n}){const r=useNamespace("select"),{hoverItem:g,selectOptionClick:$}=useOption(e,{emit:n});return{ns:r,hoverItem:g,selectOptionClick:$}}}),_hoisted_1$N=["aria-selected"];function _sfc_render$F(e,n,r,g,$,L){return openBlock(),createElementBlock("li",{"aria-selected":e.selected,style:normalizeStyle(e.style),class:normalizeClass([e.ns.be("dropdown","option-item"),e.ns.is("selected",e.selected),e.ns.is("disabled",e.disabled),e.ns.is("created",e.created),{hover:e.hovering}]),onMouseenter:n[0]||(n[0]=(...k)=>e.hoverItem&&e.hoverItem(...k)),onClick:n[1]||(n[1]=withModifiers((...k)=>e.selectOptionClick&&e.selectOptionClick(...k),["stop"]))},[renderSlot(e.$slots,"default",{item:e.item,index:e.index,disabled:e.disabled},()=>[createBaseVNode("span",null,toDisplayString(e.item.label),1)])],46,_hoisted_1$N)}var OptionItem=_export_sfc$2(_sfc_main$13,[["render",_sfc_render$F],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/option-item.vue"]]);const selectV2InjectionKey="ElSelectV2Injection";var ElSelectMenu=defineComponent({name:"ElSelectDropdown",props:{data:{type:Array,required:!0},hoveringIndex:Number,width:Number},setup(e,{slots:n,expose:r}){const g=inject(selectV2InjectionKey),$=useNamespace("select"),L=ref([]),k=ref(),oe=computed(()=>isUndefined(g.props.estimatedOptionHeight)),re=computed(()=>oe.value?{itemSize:g.props.itemHeight}:{estimatedSize:g.props.estimatedOptionHeight,itemSize:he=>L.value[he]}),ae=(he=[],Oe)=>{const{props:{valueKey:$e}}=g;return isObject$4(Oe)?he&&he.some(Ne=>get(Ne,$e)===get(Oe,$e)):he.includes(Oe)},le=(he,Oe)=>{if(isObject$4(Oe)){const{valueKey:$e}=g.props;return get(he,$e)===get(Oe,$e)}else return he===Oe},ue=(he,Oe)=>{const{valueKey:$e}=g.props;return g.props.multiple?ae(he,get(Oe,$e)):le(he,get(Oe,$e))},pe=(he,Oe)=>{const{disabled:$e,multiple:Ne,multipleLimit:Ue}=g.props;return $e||!Oe&&(Ne?Ue>0&&he.length>=Ue:!1)},de=he=>e.hoveringIndex===he;r({listRef:k,isSized:oe,isItemDisabled:pe,isItemHovering:de,isItemSelected:ue,scrollToItem:he=>{const Oe=k.value;Oe&&Oe.scrollToItem(he)},resetScrollTop:()=>{const he=k.value;he&&he.resetScrollTop()}});const Ce=he=>{const{index:Oe,data:$e,style:Ne}=he,Ue=unref(oe),{itemSize:kt,estimatedSize:Et}=unref(re),{modelValue:Pt}=g.props,{onSelect:Lt,onHover:vn}=g,hn=$e[Oe];if(hn.type==="Group")return createVNode(GroupItem,{item:hn,style:Ne,height:Ue?kt:Et},null);const Dt=ue(Pt,hn),jt=pe(Pt,Dt),bn=de(Oe);return createVNode(OptionItem,mergeProps(he,{selected:Dt,disabled:hn.disabled||jt,created:!!hn.created,hovering:bn,item:hn,onSelect:Lt,onHover:vn}),{default:Sn=>{var Cn;return((Cn=n.default)==null?void 0:Cn.call(n,Sn))||createVNode("span",null,[hn.label])}})},{onKeyboardNavigate:Ie,onKeyboardSelect:_e}=g,At=()=>{Ie("forward")},qe=()=>{Ie("backward")},xe=()=>{g.expanded=!1},Ve=he=>{const{code:Oe}=he,{tab:$e,esc:Ne,down:Ue,up:kt,enter:Et}=EVENT_CODE;switch(Oe!==$e&&(he.preventDefault(),he.stopPropagation()),Oe){case $e:case Ne:{xe();break}case Ue:{At();break}case kt:{qe();break}case Et:{_e();break}}};return()=>{var he;const{data:Oe,width:$e}=e,{height:Ne,multiple:Ue,scrollbarAlwaysOn:kt}=g.props;if(Oe.length===0)return createVNode("div",{class:$.b("dropdown"),style:{width:`${$e}px`}},[(he=n.empty)==null?void 0:he.call(n)]);const Et=unref(oe)?FixedSizeList:DynamicSizeList;return createVNode("div",{class:[$.b("dropdown"),$.is("multiple",Ue)]},[createVNode(Et,mergeProps({ref:k},unref(re),{className:$.be("dropdown","list"),scrollbarAlwaysOn:kt,data:Oe,height:Ne,width:$e,total:Oe.length,onKeydown:Ve}),{default:Pt=>createVNode(Ce,Pt,null)})])}}});function useAllowCreate(e,n){const r=ref(0),g=ref(null),$=computed(()=>e.allowCreate&&e.filterable);function L(le){const ue=pe=>pe.value===le;return e.options&&e.options.some(ue)||n.createdOptions.some(ue)}function k(le){!$.value||(e.multiple&&le.created?r.value++:g.value=le)}function oe(le){if($.value)if(le&&le.length>0&&!L(le)){const ue={value:le,label:le,created:!0,disabled:!1};n.createdOptions.length>=r.value?n.createdOptions[r.value]=ue:n.createdOptions.push(ue)}else if(e.multiple)n.createdOptions.length=r.value;else{const ue=g.value;n.createdOptions.length=0,ue&&ue.created&&n.createdOptions.push(ue)}}function re(le){if(!$.value||!le||!le.created||le.created&&e.reserveKeyword&&n.inputValue===le.label)return;const ue=n.createdOptions.findIndex(pe=>pe.value===le.value);~ue&&(n.createdOptions.splice(ue,1),r.value--)}function ae(){$.value&&(n.createdOptions.length=0,r.value=0)}return{createNewOption:oe,removeNewOption:re,selectNewOption:k,clearAllNewOption:ae}}const flattenOptions=e=>{const n=[];return e.forEach(r=>{isArray$4(r.options)?(n.push({label:r.label,isTitle:!0,type:"Group"}),r.options.forEach(g=>{n.push(g)}),n.push({type:"Group"})):n.push(r)}),n};function useInput(e){const n=ref(!1);return{handleCompositionStart:()=>{n.value=!0},handleCompositionUpdate:L=>{const k=L.target.value,oe=k[k.length-1]||"";n.value=!isKorean(oe)},handleCompositionEnd:L=>{n.value&&(n.value=!1,isFunction$1(e)&&e(L))}}}const DEFAULT_INPUT_PLACEHOLDER="",MINIMUM_INPUT_WIDTH=11,TAG_BASE_WIDTH={larget:51,default:42,small:33},useSelect$1=(e,n)=>{const{t:r}=useLocale(),g=useNamespace("select-v2"),$=useNamespace("input"),{form:L,formItem:k}=useFormItem(),oe=reactive({inputValue:DEFAULT_INPUT_PLACEHOLDER,displayInputValue:DEFAULT_INPUT_PLACEHOLDER,calculatedWidth:0,cachedPlaceholder:"",cachedOptions:[],createdOptions:[],createdLabel:"",createdSelected:!1,currentPlaceholder:"",hoveringIndex:-1,comboBoxHovering:!1,isOnComposition:!1,isSilentBlur:!1,isComposing:!1,inputLength:20,selectWidth:200,initialInputHeight:0,previousQuery:null,previousValue:"",query:"",selectedLabel:"",softFocus:!1,tagInMultiLine:!1}),re=ref(-1),ae=ref(-1),le=ref(null),ue=ref(null),pe=ref(null),de=ref(null),Fe=ref(null),ze=ref(null),Ce=ref(null),Ie=ref(!1),_e=computed(()=>e.disabled||L?.disabled),At=computed(()=>{const oo=kt.value.length*34;return oo>e.height?e.height:oo}),qe=computed(()=>e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!==""),xe=computed(()=>{const oo=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:qe.value;return e.clearable&&!_e.value&&oe.comboBoxHovering&&oo}),Ve=computed(()=>e.remote&&e.filterable?"":arrow_up_default),he=computed(()=>Ve.value&&g.is("reverse",Ie.value)),Oe=computed(()=>k?.validateState||""),$e=computed(()=>ValidateComponentsMap[Oe.value]),Ne=computed(()=>e.remote?300:0),Ue=computed(()=>{const oo=kt.value;return e.loading?e.loadingText||r("el.select.loading"):e.remote&&oe.inputValue===""&&oo.length===0?!1:e.filterable&&oe.inputValue&&oo.length>0?e.noMatchText||r("el.select.noMatch"):oo.length===0?e.noDataText||r("el.select.noData"):null}),kt=computed(()=>{const oo=go=>{var Co;const Kn=oe.inputValue;return Kn?(Co=go.label)==null?void 0:Co.includes(Kn):!0};return e.loading?[]:flattenOptions(e.options.concat(oe.createdOptions).map(go=>{if(isArray$4(go.options)){const Co=go.options.filter(oo);if(Co.length>0)return{...go,options:Co}}else if(e.remote||oo(go))return go;return null}).filter(go=>go!==null))}),Et=computed(()=>kt.value.every(oo=>oo.disabled)),Pt=useSize(),Lt=computed(()=>Pt.value==="small"?"small":"default"),vn=computed(()=>{const oo=ze.value,go=Lt.value||"default",Co=oo?Number.parseInt(getComputedStyle(oo).paddingLeft):0,Kn=oo?Number.parseInt(getComputedStyle(oo).paddingRight):0;return oe.selectWidth-Kn-Co-TAG_BASE_WIDTH[go]}),hn=()=>{var oo;ae.value=((oo=Fe.value)==null?void 0:oo.offsetWidth)||200},Dt=computed(()=>({width:`${oe.calculatedWidth===0?MINIMUM_INPUT_WIDTH:Math.ceil(oe.calculatedWidth)+MINIMUM_INPUT_WIDTH}px`})),jt=computed(()=>isArray$4(e.modelValue)?e.modelValue.length===0&&!oe.displayInputValue:e.filterable?oe.displayInputValue.length===0:!0),bn=computed(()=>{const oo=e.placeholder||r("el.select.placeholder");return e.multiple?oo:oe.selectedLabel||oo}),Sn=computed(()=>{var oo,go;return(go=(oo=de.value)==null?void 0:oo.popperRef)==null?void 0:go.contentRef}),Cn=computed(()=>{if(e.multiple){const oo=e.modelValue.length;if(e.modelValue.length>0)return kt.value.findIndex(go=>go.value===e.modelValue[oo-1])}else if(e.modelValue)return kt.value.findIndex(oo=>oo.value===e.modelValue);return-1}),On=computed({get(){return Ie.value&&Ue.value!==!1},set(oo){Ie.value=oo}}),{createNewOption:En,removeNewOption:An,selectNewOption:In,clearAllNewOption:$n}=useAllowCreate(e,oe),{handleCompositionStart:Pn,handleCompositionUpdate:Dn,handleCompositionEnd:Mn}=useInput(oo=>to(oo)),Fn=()=>{var oo,go,Co;(go=(oo=ue.value).focus)==null||go.call(oo),(Co=de.value)==null||Co.updatePopper()},kn=()=>{if(!e.automaticDropdown&&!_e.value)return oe.isComposing&&(oe.softFocus=!0),nextTick(()=>{var oo,go;Ie.value=!Ie.value,(go=(oo=ue.value)==null?void 0:oo.focus)==null||go.call(oo)})},Nn=()=>(e.filterable&&oe.inputValue!==oe.selectedLabel&&(oe.query=oe.selectedLabel),wn(oe.inputValue),nextTick(()=>{En(oe.inputValue)})),Rn=debounce(Nn,Ne.value),wn=oo=>{oe.previousQuery!==oo&&(oe.previousQuery=oo,e.filterable&&isFunction$1(e.filterMethod)?e.filterMethod(oo):e.filterable&&e.remote&&isFunction$1(e.remoteMethod)&&e.remoteMethod(oo))},Tn=oo=>{isEqual$1(e.modelValue,oo)||n(CHANGE_EVENT,oo)},xn=oo=>{n(UPDATE_MODEL_EVENT,oo),Tn(oo),oe.previousValue=oo.toString()},Bn=(oo=[],go)=>{if(!isObject$4(go))return oo.indexOf(go);const Co=e.valueKey;let Kn=-1;return oo.some((io,fo)=>get(io,Co)===get(go,Co)?(Kn=fo,!0):!1),Kn},Ln=oo=>isObject$4(oo)?get(oo,e.valueKey):oo,Hn=oo=>isObject$4(oo)?oo.label:oo,zn=()=>{if(!(e.collapseTags&&!e.filterable))return nextTick(()=>{var oo,go;if(!ue.value)return;const Co=ze.value;Fe.value.height=Co.offsetHeight,Ie.value&&Ue.value!==!1&&((go=(oo=de.value)==null?void 0:oo.updatePopper)==null||go.call(oo))})},Jn=()=>{var oo,go;if(co(),hn(),(go=(oo=de.value)==null?void 0:oo.updatePopper)==null||go.call(oo),e.multiple)return zn()},co=()=>{const oo=ze.value;oo&&(oe.selectWidth=oo.getBoundingClientRect().width)},Gn=(oo,go,Co=!0)=>{var Kn,io;if(e.multiple){let fo=e.modelValue.slice();const vo=Bn(fo,Ln(oo));vo>-1?(fo=[...fo.slice(0,vo),...fo.slice(vo+1)],oe.cachedOptions.splice(vo,1),An(oo)):(e.multipleLimit<=0||fo.length{const{valueKey:Co}=e,Kn=e.modelValue.indexOf(get(go,Co));if(Kn>-1&&!_e.value){const io=[...e.modelValue.slice(0,Kn),...e.modelValue.slice(Kn+1)];return oe.cachedOptions.splice(Kn,1),xn(io),n("remove-tag",get(go,Co)),oe.softFocus=!0,An(go),nextTick(Fn)}oo.stopPropagation()},ao=oo=>{const go=oe.isComposing;oe.isComposing=!0,oe.softFocus?oe.softFocus=!1:go||n("focus",oo)},ho=()=>(oe.softFocus=!1,nextTick(()=>{var oo,go;(go=(oo=ue.value)==null?void 0:oo.blur)==null||go.call(oo),Ce.value&&(oe.calculatedWidth=Ce.value.getBoundingClientRect().width),oe.isSilentBlur?oe.isSilentBlur=!1:oe.isComposing&&n("blur"),oe.isComposing=!1})),Yn=()=>{oe.displayInputValue.length>0?_n(""):Ie.value=!1},Wn=oo=>{if(oe.displayInputValue.length===0){oo.preventDefault();const go=e.modelValue.slice();go.pop(),An(oe.cachedOptions.pop()),xn(go)}},Vn=()=>{let oo;return isArray$4(e.modelValue)?oo=[]:oo="",oe.softFocus=!0,e.multiple?oe.cachedOptions=[]:oe.selectedLabel="",Ie.value=!1,xn(oo),n("clear"),$n(),nextTick(Fn)},_n=oo=>{oe.displayInputValue=oo,oe.inputValue=oo},Qn=(oo,go=void 0)=>{const Co=kt.value;if(!["forward","backward"].includes(oo)||_e.value||Co.length<=0||Et.value)return;if(!Ie.value)return kn();go===void 0&&(go=oe.hoveringIndex);let Kn=-1;oo==="forward"?(Kn=go+1,Kn>=Co.length&&(Kn=0)):oo==="backward"&&(Kn=go-1,Kn<0&&(Kn=Co.length-1));const io=Co[Kn];if(io.disabled||io.type==="Group")return Qn(oo,Kn);Un(Kn),uo(Kn)},jn=()=>{if(Ie.value)~oe.hoveringIndex&&kt.value[oe.hoveringIndex]&&Gn(kt.value[oe.hoveringIndex],oe.hoveringIndex,!1);else return kn()},Un=oo=>{oe.hoveringIndex=oo},Xn=()=>{oe.hoveringIndex=-1},Zn=()=>{var oo;const go=ue.value;go&&((oo=go.focus)==null||oo.call(go))},to=oo=>{const go=oo.target.value;if(_n(go),oe.displayInputValue.length>0&&!Ie.value&&(Ie.value=!0),oe.calculatedWidth=Ce.value.getBoundingClientRect().width,e.multiple&&zn(),e.remote)Rn();else return Nn()},ro=()=>(Ie.value=!1,ho()),lo=()=>(oe.inputValue=oe.displayInputValue,nextTick(()=>{~Cn.value&&(Un(Cn.value),uo(oe.hoveringIndex))})),uo=oo=>{pe.value.scrollToItem(oo)},yo=()=>{if(Xn(),e.multiple)if(e.modelValue.length>0){let oo=!1;oe.cachedOptions.length=0,oe.previousValue=e.modelValue.toString(),e.modelValue.forEach(go=>{const Co=kt.value.findIndex(Kn=>Ln(Kn)===go);~Co&&(oe.cachedOptions.push(kt.value[Co]),oo||Un(Co),oo=!0)})}else oe.cachedOptions=[],oe.previousValue="";else if(qe.value){oe.previousValue=e.modelValue;const oo=kt.value,go=oo.findIndex(Co=>Ln(Co)===Ln(e.modelValue));~go?(oe.selectedLabel=oo[go].label,Un(go)):oe.selectedLabel=`${e.modelValue}`}else oe.selectedLabel="",oe.previousValue="";$n(),hn()};return watch(Ie,oo=>{var go,Co;n("visible-change",oo),oo?(Co=(go=de.value).update)==null||Co.call(go):(oe.displayInputValue="",oe.previousQuery=null,En(""))}),watch(()=>e.modelValue,(oo,go)=>{var Co;(!oo||oo.toString()!==oe.previousValue)&&yo(),!isEqual$1(oo,go)&&e.validateEvent&&((Co=k?.validate)==null||Co.call(k,"change").catch(Kn=>void 0))},{deep:!0}),watch(()=>e.options,()=>{const oo=ue.value;(!oo||oo&&document.activeElement!==oo)&&yo()},{deep:!0}),watch(kt,()=>nextTick(pe.value.resetScrollTop)),onMounted(()=>{yo()}),useResizeObserver(Fe,Jn),{collapseTagSize:Lt,currentPlaceholder:bn,expanded:Ie,emptyText:Ue,popupHeight:At,debounce:Ne,filteredOptions:kt,iconComponent:Ve,iconReverse:he,inputWrapperStyle:Dt,popperSize:ae,dropdownMenuVisible:On,hasModelValue:qe,shouldShowPlaceholder:jt,selectDisabled:_e,selectSize:Pt,showClearBtn:xe,states:oe,tagMaxWidth:vn,nsSelectV2:g,nsInput:$,calculatorRef:Ce,controlRef:le,inputRef:ue,menuRef:pe,popper:de,selectRef:Fe,selectionRef:ze,popperRef:Sn,validateState:Oe,validateIcon:$e,debouncedOnInputChange:Rn,deleteTag:eo,getLabel:Hn,getValueKey:Ln,handleBlur:ho,handleClear:Vn,handleClickOutside:ro,handleDel:Wn,handleEsc:Yn,handleFocus:ao,handleMenuEnter:lo,handleResize:Jn,toggleMenu:kn,scrollTo:uo,onInput:to,onKeyboardNavigate:Qn,onKeyboardSelect:jn,onSelect:Gn,onHover:Un,onUpdateInputValue:_n,handleCompositionStart:Pn,handleCompositionEnd:Mn,handleCompositionUpdate:Dn}},_sfc_main$12=defineComponent({name:"ElSelectV2",components:{ElSelectMenu,ElTag,ElTooltip,ElIcon},directives:{ClickOutside,ModelText:vModelText},props:SelectProps,emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:n}){const r=useSelect$1(e,n);return provide(selectV2InjectionKey,{props:reactive({...toRefs(e),height:r.popupHeight}),onSelect:r.onSelect,onHover:r.onHover,onKeyboardNavigate:r.onKeyboardNavigate,onKeyboardSelect:r.onKeyboardSelect}),r}}),_hoisted_1$M={key:0},_hoisted_2$B=["id","autocomplete","aria-expanded","aria-labelledby","disabled","readonly","name","unselectable"],_hoisted_3$j=["textContent"],_hoisted_4$g=["id","aria-labelledby","aria-expanded","autocomplete","disabled","name","readonly","unselectable"],_hoisted_5$c=["textContent"];function _sfc_render$E(e,n,r,g,$,L){const k=resolveComponent("el-tag"),oe=resolveComponent("el-tooltip"),re=resolveComponent("el-icon"),ae=resolveComponent("el-select-menu"),le=resolveDirective("model-text"),ue=resolveDirective("click-outside");return withDirectives((openBlock(),createElementBlock("div",{ref:"selectRef",class:normalizeClass([e.nsSelectV2.b(),e.nsSelectV2.m(e.selectSize)]),onClick:n[23]||(n[23]=withModifiers((...pe)=>e.toggleMenu&&e.toggleMenu(...pe),["stop"])),onMouseenter:n[24]||(n[24]=pe=>e.states.comboBoxHovering=!0),onMouseleave:n[25]||(n[25]=pe=>e.states.comboBoxHovering=!1)},[createVNode(oe,{ref:"popper",visible:e.dropdownMenuVisible,teleported:e.teleported,"popper-class":[e.nsSelectV2.e("popper"),e.popperClass],"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,placement:"bottom-start",pure:"",transition:`${e.nsSelectV2.namespace.value}-zoom-in-top`,trigger:"click",persistent:e.persistent,onBeforeShow:e.handleMenuEnter,onHide:n[22]||(n[22]=pe=>e.states.inputValue=e.states.displayInputValue)},{default:withCtx(()=>{var pe;return[createBaseVNode("div",{ref:"selectionRef",class:normalizeClass([e.nsSelectV2.e("wrapper"),e.nsSelectV2.is("focused",e.states.isComposing),e.nsSelectV2.is("hovering",e.states.comboBoxHovering),e.nsSelectV2.is("filterable",e.filterable),e.nsSelectV2.is("disabled",e.selectDisabled)])},[e.$slots.prefix?(openBlock(),createElementBlock("div",_hoisted_1$M,[renderSlot(e.$slots,"prefix")])):createCommentVNode("v-if",!0),e.multiple?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.nsSelectV2.e("selection"))},[e.collapseTags&&e.modelValue.length>0?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.nsSelectV2.e("selected-item"))},[createVNode(k,{closable:!e.selectDisabled&&!((pe=e.states.cachedOptions[0])!=null&&pe.disable),size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:n[0]||(n[0]=de=>e.deleteTag(de,e.states.cachedOptions[0]))},{default:withCtx(()=>{var de;return[createBaseVNode("span",{class:normalizeClass(e.nsSelectV2.e("tags-text")),style:normalizeStyle({maxWidth:`${e.tagMaxWidth}px`})},toDisplayString((de=e.states.cachedOptions[0])==null?void 0:de.label),7)]}),_:1},8,["closable","size"]),e.modelValue.length>1?(openBlock(),createBlock(k,{key:0,closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""},{default:withCtx(()=>[e.collapseTagsTooltip?(openBlock(),createBlock(oe,{key:0,disabled:e.dropdownMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:!1},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelectV2.e("tags-text")),style:normalizeStyle({maxWidth:`${e.tagMaxWidth}px`})},"+ "+toDisplayString(e.modelValue.length-1),7)]),content:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(e.nsSelectV2.e("selection"))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.states.cachedOptions.slice(1),(de,Fe)=>(openBlock(),createElementBlock("div",{key:Fe,class:normalizeClass(e.nsSelectV2.e("selected-item"))},[(openBlock(),createBlock(k,{key:e.getValueKey(de),closable:!e.selectDisabled&&!de.disabled,size:e.collapseTagSize,class:"in-tooltip",type:"info","disable-transitions":"",onClose:ze=>e.deleteTag(ze,de)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelectV2.e("tags-text")),style:normalizeStyle({maxWidth:`${e.tagMaxWidth}px`})},toDisplayString(e.getLabel(de)),7)]),_:2},1032,["closable","size","onClose"]))],2))),128))],2)]),_:1},8,["disabled","effect"])):(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(e.nsSelectV2.e("tags-text")),style:normalizeStyle({maxWidth:`${e.tagMaxWidth}px`})},"+ "+toDisplayString(e.modelValue.length-1),7))]),_:1},8,["size"])):createCommentVNode("v-if",!0)],2)):(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(e.states.cachedOptions,(de,Fe)=>(openBlock(),createElementBlock("div",{key:Fe,class:normalizeClass(e.nsSelectV2.e("selected-item"))},[(openBlock(),createBlock(k,{key:e.getValueKey(de),closable:!e.selectDisabled&&!de.disabled,size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:ze=>e.deleteTag(ze,de)},{default:withCtx(()=>[createBaseVNode("span",{class:normalizeClass(e.nsSelectV2.e("tags-text")),style:normalizeStyle({maxWidth:`${e.tagMaxWidth}px`})},toDisplayString(e.getLabel(de)),7)]),_:2},1032,["closable","size","onClose"]))],2))),128)),createBaseVNode("div",{class:normalizeClass([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")]),style:normalizeStyle(e.inputWrapperStyle)},[withDirectives(createBaseVNode("input",{id:e.id,ref:"inputRef",autocomplete:e.autocomplete,"aria-autocomplete":"list","aria-haspopup":"listbox",autocapitalize:"off","aria-expanded":e.expanded,"aria-labelledby":e.label,class:normalizeClass([e.nsSelectV2.is(e.selectSize),e.nsSelectV2.e("combobox-input")]),disabled:e.disabled,role:"combobox",readonly:!e.filterable,spellcheck:"false",type:"text",name:e.name,unselectable:e.expanded?"on":void 0,"onUpdate:modelValue":n[1]||(n[1]=(...de)=>e.onUpdateInputValue&&e.onUpdateInputValue(...de)),onFocus:n[2]||(n[2]=(...de)=>e.handleFocus&&e.handleFocus(...de)),onInput:n[3]||(n[3]=(...de)=>e.onInput&&e.onInput(...de)),onCompositionstart:n[4]||(n[4]=(...de)=>e.handleCompositionStart&&e.handleCompositionStart(...de)),onCompositionupdate:n[5]||(n[5]=(...de)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...de)),onCompositionend:n[6]||(n[6]=(...de)=>e.handleCompositionEnd&&e.handleCompositionEnd(...de)),onKeydown:[n[7]||(n[7]=withKeys(withModifiers(de=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),n[8]||(n[8]=withKeys(withModifiers(de=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),n[9]||(n[9]=withKeys(withModifiers((...de)=>e.onKeyboardSelect&&e.onKeyboardSelect(...de),["stop","prevent"]),["enter"])),n[10]||(n[10]=withKeys(withModifiers((...de)=>e.handleEsc&&e.handleEsc(...de),["stop","prevent"]),["esc"])),n[11]||(n[11]=withKeys(withModifiers((...de)=>e.handleDel&&e.handleDel(...de),["stop"]),["delete"]))]},null,42,_hoisted_2$B),[[le,e.states.displayInputValue]]),e.filterable?(openBlock(),createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:normalizeClass(e.nsSelectV2.e("input-calculator")),textContent:toDisplayString(e.states.displayInputValue)},null,10,_hoisted_3$j)):createCommentVNode("v-if",!0)],6)],2)):(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode("div",{class:normalizeClass([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")])},[withDirectives(createBaseVNode("input",{id:e.id,ref:"inputRef","aria-autocomplete":"list","aria-haspopup":"listbox","aria-labelledby":e.label,"aria-expanded":e.expanded,autocapitalize:"off",autocomplete:e.autocomplete,class:normalizeClass(e.nsSelectV2.e("combobox-input")),disabled:e.disabled,name:e.name,role:"combobox",readonly:!e.filterable,spellcheck:"false",type:"text",unselectable:e.expanded?"on":void 0,onCompositionstart:n[12]||(n[12]=(...de)=>e.handleCompositionStart&&e.handleCompositionStart(...de)),onCompositionupdate:n[13]||(n[13]=(...de)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...de)),onCompositionend:n[14]||(n[14]=(...de)=>e.handleCompositionEnd&&e.handleCompositionEnd(...de)),onFocus:n[15]||(n[15]=(...de)=>e.handleFocus&&e.handleFocus(...de)),onInput:n[16]||(n[16]=(...de)=>e.onInput&&e.onInput(...de)),onKeydown:[n[17]||(n[17]=withKeys(withModifiers(de=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),n[18]||(n[18]=withKeys(withModifiers(de=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),n[19]||(n[19]=withKeys(withModifiers((...de)=>e.onKeyboardSelect&&e.onKeyboardSelect(...de),["stop","prevent"]),["enter"])),n[20]||(n[20]=withKeys(withModifiers((...de)=>e.handleEsc&&e.handleEsc(...de),["stop","prevent"]),["esc"]))],"onUpdate:modelValue":n[21]||(n[21]=(...de)=>e.onUpdateInputValue&&e.onUpdateInputValue(...de))},null,42,_hoisted_4$g),[[le,e.states.displayInputValue]])],2),e.filterable?(openBlock(),createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:normalizeClass([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-calculator")]),textContent:toDisplayString(e.states.displayInputValue)},null,10,_hoisted_5$c)):createCommentVNode("v-if",!0)],64)),e.shouldShowPlaceholder?(openBlock(),createElementBlock("span",{key:3,class:normalizeClass([e.nsSelectV2.e("placeholder"),e.nsSelectV2.is("transparent",e.states.isComposing||(e.placeholder&&e.multiple?e.modelValue.length===0:!e.hasModelValue))])},toDisplayString(e.currentPlaceholder),3)):createCommentVNode("v-if",!0),createBaseVNode("span",{class:normalizeClass(e.nsSelectV2.e("suffix"))},[e.iconComponent?withDirectives((openBlock(),createBlock(re,{key:0,class:normalizeClass([e.nsSelectV2.e("caret"),e.nsInput.e("icon"),e.iconReverse])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])),[[vShow,!e.showClearBtn]]):createCommentVNode("v-if",!0),e.showClearBtn&&e.clearIcon?(openBlock(),createBlock(re,{key:1,class:normalizeClass([e.nsSelectV2.e("caret"),e.nsInput.e("icon")]),onClick:withModifiers(e.handleClear,["prevent","stop"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0),e.validateState&&e.validateIcon?(openBlock(),createBlock(re,{key:2,class:normalizeClass([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.validateIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],2)]}),content:withCtx(()=>[createVNode(ae,{ref:"menuRef",data:e.filteredOptions,width:e.popperSize,"hovering-index":e.states.hoveringIndex,"scrollbar-always-on":e.scrollbarAlwaysOn},{default:withCtx(pe=>[renderSlot(e.$slots,"default",normalizeProps(guardReactiveProps(pe)))]),empty:withCtx(()=>[renderSlot(e.$slots,"empty",{},()=>[createBaseVNode("p",{class:normalizeClass(e.nsSelectV2.e("empty"))},toDisplayString(e.emptyText?e.emptyText:""),3)])]),_:3},8,["data","width","hovering-index","scrollbar-always-on"])]),_:3},8,["visible","teleported","popper-class","popper-options","effect","transition","persistent","onBeforeShow"])],34)),[[ue,e.handleClickOutside,e.popperRef]])}var Select=_export_sfc$2(_sfc_main$12,[["render",_sfc_render$E],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/select.vue"]]);Select.install=e=>{e.component(Select.name,Select)};const _Select=Select,ElSelectV2=_Select,skeletonProps=buildProps({animated:{type:Boolean,default:!1},count:{type:Number,default:1},rows:{type:Number,default:3},loading:{type:Boolean,default:!0},throttle:{type:Number}}),skeletonItemProps=buildProps({variant:{type:String,values:["circle","rect","h1","h3","text","caption","p","image","button"],default:"text"}}),__default__$n={name:"ElSkeletonItem"},_sfc_main$11=defineComponent({...__default__$n,props:skeletonItemProps,setup(e){const n=useNamespace("skeleton");return(r,g)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(n).e("item"),unref(n).e(r.variant)])},[r.variant==="image"?(openBlock(),createBlock(unref(picture_filled_default),{key:0})):createCommentVNode("v-if",!0)],2))}});var SkeletonItem=_export_sfc$2(_sfc_main$11,[["__file","/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton-item.vue"]]);const __default__$m={name:"ElSkeleton"},_sfc_main$10=defineComponent({...__default__$m,props:skeletonProps,setup(e,{expose:n}){const r=e,g=useNamespace("skeleton"),$=useThrottleRender(toRef(r,"loading"),r.throttle);return n({uiLoading:$}),(L,k)=>unref($)?(openBlock(),createElementBlock("div",mergeProps({key:0,class:[unref(g).b(),unref(g).is("animated",L.animated)]},L.$attrs),[(openBlock(!0),createElementBlock(Fragment,null,renderList(L.count,oe=>(openBlock(),createElementBlock(Fragment,{key:oe},[L.loading?renderSlot(L.$slots,"template",{key:oe},()=>[createVNode(SkeletonItem,{class:normalizeClass(unref(g).is("first")),variant:"p"},null,8,["class"]),(openBlock(!0),createElementBlock(Fragment,null,renderList(L.rows,re=>(openBlock(),createBlock(SkeletonItem,{key:re,class:normalizeClass([unref(g).e("paragraph"),unref(g).is("last",re===L.rows&&L.rows>1)]),variant:"p"},null,8,["class"]))),128))]):createCommentVNode("v-if",!0)],64))),128))],16)):renderSlot(L.$slots,"default",normalizeProps(mergeProps({key:1},L.$attrs)))}});var Skeleton=_export_sfc$2(_sfc_main$10,[["__file","/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton.vue"]]);const ElSkeleton=withInstall(Skeleton,{SkeletonItem}),ElSkeletonItem=withNoopInstall(SkeletonItem),sliderProps=buildProps({modelValue:{type:definePropType([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:useSizeProp,inputSize:useSizeProp,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:definePropType(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},label:{type:String,default:void 0},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:definePropType(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:Ee,default:"top"},marks:{type:definePropType(Object)},validateEvent:{type:Boolean,default:!0}}),isValidValue$1=e=>isNumber(e)||isArray$4(e)&&e.every(isNumber),sliderEmits={[UPDATE_MODEL_EVENT]:isValidValue$1,[INPUT_EVENT]:isValidValue$1,[CHANGE_EVENT]:isValidValue$1},useLifecycle=(e,n,r)=>{const g=ref();return onMounted(async()=>{e.range?(Array.isArray(e.modelValue)?(n.firstValue=Math.max(e.min,e.modelValue[0]),n.secondValue=Math.min(e.max,e.modelValue[1])):(n.firstValue=e.min,n.secondValue=e.max),n.oldValue=[n.firstValue,n.secondValue]):(typeof e.modelValue!="number"||Number.isNaN(e.modelValue)?n.firstValue=e.min:n.firstValue=Math.min(e.max,Math.max(e.min,e.modelValue)),n.oldValue=n.firstValue),useEventListener(window,"resize",r),await nextTick(),r()}),{sliderWrapper:g}},useMarks=e=>computed(()=>e.marks?Object.keys(e.marks).map(parseFloat).sort((r,g)=>r-g).filter(r=>r<=e.max&&r>=e.min).map(r=>({point:r,position:(r-e.min)*100/(e.max-e.min),mark:e.marks[r]})):[]),useSlide=(e,n,r)=>{const{form:g,formItem:$}=useFormItem(),L=shallowRef(),k=ref(),oe=ref(),re={firstButton:k,secondButton:oe},ae=computed(()=>e.disabled||g?.disabled||!1),le=computed(()=>Math.min(n.firstValue,n.secondValue)),ue=computed(()=>Math.max(n.firstValue,n.secondValue)),pe=computed(()=>e.range?`${100*(ue.value-le.value)/(e.max-e.min)}%`:`${100*(n.firstValue-e.min)/(e.max-e.min)}%`),de=computed(()=>e.range?`${100*(le.value-e.min)/(e.max-e.min)}%`:"0%"),Fe=computed(()=>e.vertical?{height:e.height}:{}),ze=computed(()=>e.vertical?{height:pe.value,bottom:de.value}:{width:pe.value,left:de.value}),Ce=()=>{L.value&&(n.sliderSize=L.value[`client${e.vertical?"Height":"Width"}`])},Ie=Ue=>{const kt=e.min+Ue*(e.max-e.min)/100;if(!e.range)return k;let Et;return Math.abs(le.value-kt)n.secondValue?"firstButton":"secondButton",re[Et]},_e=Ue=>{const kt=Ie(Ue);return kt.value.setPosition(Ue),kt},At=Ue=>{n.firstValue=Ue,xe(e.range?[le.value,ue.value]:Ue)},qe=Ue=>{n.secondValue=Ue,e.range&&xe([le.value,ue.value])},xe=Ue=>{r(UPDATE_MODEL_EVENT,Ue),r(INPUT_EVENT,Ue)},Ve=async()=>{await nextTick(),r(CHANGE_EVENT,e.range?[le.value,ue.value]:e.modelValue)},he=Ue=>{var kt,Et,Pt,Lt,vn,hn;if(ae.value||n.dragging)return;Ce();let Dt=0;if(e.vertical){const jt=(Pt=(Et=(kt=Ue.touches)==null?void 0:kt.item(0))==null?void 0:Et.clientY)!=null?Pt:Ue.clientY;Dt=(L.value.getBoundingClientRect().bottom-jt)/n.sliderSize*100}else{const jt=(hn=(vn=(Lt=Ue.touches)==null?void 0:Lt.item(0))==null?void 0:vn.clientX)!=null?hn:Ue.clientX,bn=L.value.getBoundingClientRect().left;Dt=(jt-bn)/n.sliderSize*100}if(!(Dt<0||Dt>100))return _e(Dt)};return{elFormItem:$,slider:L,firstButton:k,secondButton:oe,sliderDisabled:ae,minValue:le,maxValue:ue,runwayStyle:Fe,barStyle:ze,resetSize:Ce,setPosition:_e,emitChange:Ve,onSliderWrapperPrevent:Ue=>{var kt,Et;(((kt=re.firstButton.value)==null?void 0:kt.dragging)||((Et=re.secondButton.value)==null?void 0:Et.dragging))&&Ue.preventDefault()},onSliderClick:Ue=>{he(Ue)&&Ve()},onSliderDown:async Ue=>{const kt=he(Ue);kt&&(await nextTick(),kt.value.onButtonDown(Ue))},setFirstValue:At,setSecondValue:qe}},{left,down,right,up,home,end,pageUp,pageDown}=EVENT_CODE,useTooltip=(e,n,r)=>{const g=ref(),$=ref(!1),L=computed(()=>n.value instanceof Function),k=computed(()=>L.value&&n.value(e.modelValue)||e.modelValue),oe=debounce(()=>{r.value&&($.value=!0)},50),re=debounce(()=>{r.value&&($.value=!1)},50);return{tooltip:g,tooltipVisible:$,formatValue:k,displayTooltip:oe,hideTooltip:re}},useSliderButton=(e,n,r)=>{const{disabled:g,min:$,max:L,step:k,showTooltip:oe,precision:re,sliderSize:ae,formatTooltip:le,emitChange:ue,resetSize:pe,updateDragging:de}=inject(sliderContextKey),{tooltip:Fe,tooltipVisible:ze,formatValue:Ce,displayTooltip:Ie,hideTooltip:_e}=useTooltip(e,le,oe),At=ref(),qe=computed(()=>`${(e.modelValue-$.value)/(L.value-$.value)*100}%`),xe=computed(()=>e.vertical?{bottom:qe.value}:{left:qe.value}),Ve=()=>{n.hovering=!0,Ie()},he=()=>{n.hovering=!1,n.dragging||_e()},Oe=Cn=>{g.value||(Cn.preventDefault(),Dt(Cn),window.addEventListener("mousemove",jt),window.addEventListener("touchmove",jt),window.addEventListener("mouseup",bn),window.addEventListener("touchend",bn),window.addEventListener("contextmenu",bn),At.value.focus())},$e=Cn=>{g.value||(n.newPosition=Number.parseFloat(qe.value)+Cn/(L.value-$.value)*100,Sn(n.newPosition),ue())},Ne=()=>{$e(-k.value)},Ue=()=>{$e(k.value)},kt=()=>{$e(-k.value*4)},Et=()=>{$e(k.value*4)},Pt=()=>{g.value||(Sn(0),ue())},Lt=()=>{g.value||(Sn(100),ue())},vn=Cn=>{let On=!0;[left,down].includes(Cn.key)?Ne():[right,up].includes(Cn.key)?Ue():Cn.key===home?Pt():Cn.key===end?Lt():Cn.key===pageDown?kt():Cn.key===pageUp?Et():On=!1,On&&Cn.preventDefault()},hn=Cn=>{let On,En;return Cn.type.startsWith("touch")?(En=Cn.touches[0].clientY,On=Cn.touches[0].clientX):(En=Cn.clientY,On=Cn.clientX),{clientX:On,clientY:En}},Dt=Cn=>{n.dragging=!0,n.isClick=!0;const{clientX:On,clientY:En}=hn(Cn);e.vertical?n.startY=En:n.startX=On,n.startPosition=Number.parseFloat(qe.value),n.newPosition=n.startPosition},jt=Cn=>{if(n.dragging){n.isClick=!1,Ie(),pe();let On;const{clientX:En,clientY:An}=hn(Cn);e.vertical?(n.currentY=An,On=(n.startY-n.currentY)/ae.value*100):(n.currentX=En,On=(n.currentX-n.startX)/ae.value*100),n.newPosition=n.startPosition+On,Sn(n.newPosition)}},bn=()=>{n.dragging&&(setTimeout(()=>{n.dragging=!1,n.hovering||_e(),n.isClick||(Sn(n.newPosition),ue())},0),window.removeEventListener("mousemove",jt),window.removeEventListener("touchmove",jt),window.removeEventListener("mouseup",bn),window.removeEventListener("touchend",bn),window.removeEventListener("contextmenu",bn))},Sn=async Cn=>{if(Cn===null||Number.isNaN(+Cn))return;Cn<0?Cn=0:Cn>100&&(Cn=100);const On=100/((L.value-$.value)/k.value);let An=Math.round(Cn/On)*On*(L.value-$.value)*.01+$.value;An=Number.parseFloat(An.toFixed(re.value)),An!==e.modelValue&&r(UPDATE_MODEL_EVENT,An),!n.dragging&&e.modelValue!==n.oldValue&&(n.oldValue=e.modelValue),await nextTick(),n.dragging&&Ie(),Fe.value.updatePopper()};return watch(()=>n.dragging,Cn=>{de(Cn)}),{disabled:g,button:At,tooltip:Fe,tooltipVisible:ze,showTooltip:oe,wrapperStyle:xe,formatValue:Ce,handleMouseEnter:Ve,handleMouseLeave:he,onButtonDown:Oe,onKeyDown:vn,setPosition:Sn}},useStops=(e,n,r,g)=>({stops:computed(()=>{if(!e.showStops||e.min>e.max)return[];if(e.step===0)return[];const k=(e.max-e.min)/e.step,oe=100*e.step/(e.max-e.min),re=Array.from({length:k-1}).map((ae,le)=>(le+1)*oe);return e.range?re.filter(ae=>ae<100*(r.value-e.min)/(e.max-e.min)||ae>100*(g.value-e.min)/(e.max-e.min)):re.filter(ae=>ae>100*(n.firstValue-e.min)/(e.max-e.min))}),getStopStyle:k=>e.vertical?{bottom:`${k}%`}:{left:`${k}%`}}),useWatch$1=(e,n,r,g,$,L)=>{const k=ae=>{$(UPDATE_MODEL_EVENT,ae),$(INPUT_EVENT,ae)},oe=()=>e.range?![r.value,g.value].every((ae,le)=>ae===n.oldValue[le]):e.modelValue!==n.oldValue,re=()=>{var ae,le;if(e.min>e.max){throwError("Slider","min should not be greater than max.");return}const ue=e.modelValue;e.range&&Array.isArray(ue)?ue[1]e.max?k([e.max,e.max]):ue[0]e.max?k([ue[0],e.max]):(n.firstValue=ue[0],n.secondValue=ue[1],oe()&&(e.validateEvent&&((ae=L?.validate)==null||ae.call(L,"change").catch(pe=>void 0)),n.oldValue=ue.slice())):!e.range&&typeof ue=="number"&&!Number.isNaN(ue)&&(uee.max?k(e.max):(n.firstValue=ue,oe()&&(e.validateEvent&&((le=L?.validate)==null||le.call(L,"change").catch(pe=>void 0)),n.oldValue=ue)))};re(),watch(()=>n.dragging,ae=>{ae||re()}),watch(()=>e.modelValue,(ae,le)=>{n.dragging||Array.isArray(ae)&&Array.isArray(le)&&ae.every((ue,pe)=>ue===le[pe])&&n.firstValue===ae[0]&&n.secondValue===ae[1]||re()},{deep:!0}),watch(()=>[e.min,e.max],()=>{re()})},sliderButtonProps=buildProps({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:Ee,default:"top"}}),sliderButtonEmits={[UPDATE_MODEL_EVENT]:e=>isNumber(e)},_hoisted_1$L=["tabindex"],__default__$l={name:"ElSliderButton"},_sfc_main$$=defineComponent({...__default__$l,props:sliderButtonProps,emits:sliderButtonEmits,setup(e,{expose:n,emit:r}){const g=e,$=useNamespace("slider"),L=reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:g.modelValue}),{disabled:k,button:oe,tooltip:re,showTooltip:ae,tooltipVisible:le,wrapperStyle:ue,formatValue:pe,handleMouseEnter:de,handleMouseLeave:Fe,onButtonDown:ze,onKeyDown:Ce,setPosition:Ie}=useSliderButton(g,L,r),{hovering:_e,dragging:At}=toRefs(L);return n({onButtonDown:ze,onKeyDown:Ce,setPosition:Ie,hovering:_e,dragging:At}),(qe,xe)=>(openBlock(),createElementBlock("div",{ref_key:"button",ref:oe,class:normalizeClass([unref($).e("button-wrapper"),{hover:unref(_e),dragging:unref(At)}]),style:normalizeStyle(unref(ue)),tabindex:unref(k)?-1:0,onMouseenter:xe[0]||(xe[0]=(...Ve)=>unref(de)&&unref(de)(...Ve)),onMouseleave:xe[1]||(xe[1]=(...Ve)=>unref(Fe)&&unref(Fe)(...Ve)),onMousedown:xe[2]||(xe[2]=(...Ve)=>unref(ze)&&unref(ze)(...Ve)),onTouchstart:xe[3]||(xe[3]=(...Ve)=>unref(ze)&&unref(ze)(...Ve)),onFocus:xe[4]||(xe[4]=(...Ve)=>unref(de)&&unref(de)(...Ve)),onBlur:xe[5]||(xe[5]=(...Ve)=>unref(Fe)&&unref(Fe)(...Ve)),onKeydown:xe[6]||(xe[6]=(...Ve)=>unref(Ce)&&unref(Ce)(...Ve))},[createVNode(unref(ElTooltip),{ref_key:"tooltip",ref:re,visible:unref(le),placement:qe.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":qe.tooltipClass,disabled:!unref(ae),persistent:""},{content:withCtx(()=>[createBaseVNode("span",null,toDisplayString(unref(pe)),1)]),default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass([unref($).e("button"),{hover:unref(_e),dragging:unref(At)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,_hoisted_1$L))}});var SliderButton=_export_sfc$2(_sfc_main$$,[["__file","/home/runner/work/element-plus/element-plus/packages/components/slider/src/button.vue"]]);const sliderMarkerProps=buildProps({mark:{type:definePropType([String,Object]),default:void 0}});var SliderMarker=defineComponent({name:"ElSliderMarker",props:sliderMarkerProps,setup(e){const n=useNamespace("slider"),r=computed(()=>isString$2(e.mark)?e.mark:e.mark.label),g=computed(()=>isString$2(e.mark)?void 0:e.mark.style);return()=>h$2("div",{class:n.e("marks-text"),style:g.value},r.value)}});const _hoisted_1$K=["id","role","aria-label","aria-labelledby"],_hoisted_2$A={key:1},__default__$k={name:"ElSlider"},_sfc_main$_=defineComponent({...__default__$k,props:sliderProps,emits:sliderEmits,setup(e,{expose:n,emit:r}){const g=e,$=useNamespace("slider"),{t:L}=useLocale(),k=reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:oe,slider:re,firstButton:ae,secondButton:le,sliderDisabled:ue,minValue:pe,maxValue:de,runwayStyle:Fe,barStyle:ze,resetSize:Ce,emitChange:Ie,onSliderWrapperPrevent:_e,onSliderClick:At,onSliderDown:qe,setFirstValue:xe,setSecondValue:Ve}=useSlide(g,k,r),{stops:he,getStopStyle:Oe}=useStops(g,k,pe,de),{inputId:$e,isLabeledByFormItem:Ne}=useFormItemInputId(g,{formItemContext:oe}),Ue=useSize(),kt=computed(()=>g.inputSize||Ue.value),Et=computed(()=>g.label||L("el.slider.defaultLabel",{min:g.min,max:g.max})),Pt=computed(()=>g.range?g.rangeStartLabel||L("el.slider.defaultRangeStartLabel"):Et.value),Lt=computed(()=>g.formatValueText?g.formatValueText(Cn.value):`${Cn.value}`),vn=computed(()=>g.rangeEndLabel||L("el.slider.defaultRangeEndLabel")),hn=computed(()=>g.formatValueText?g.formatValueText(On.value):`${On.value}`),Dt=computed(()=>[$.b(),$.m(Ue.value),$.is("vertical",g.vertical),{[$.m("with-input")]:g.showInput}]),jt=useMarks(g);useWatch$1(g,k,pe,de,r,oe);const bn=computed(()=>{const In=[g.min,g.max,g.step].map($n=>{const Pn=`${$n}`.split(".")[1];return Pn?Pn.length:0});return Math.max.apply(null,In)}),{sliderWrapper:Sn}=useLifecycle(g,k,Ce),{firstValue:Cn,secondValue:On,sliderSize:En}=toRefs(k),An=In=>{k.dragging=In};return provide(sliderContextKey,{...toRefs(g),sliderSize:En,disabled:ue,precision:bn,emitChange:Ie,resetSize:Ce,updateDragging:An}),n({onSliderClick:At}),(In,$n)=>{var Pn,Dn;return openBlock(),createElementBlock("div",{id:In.range?unref($e):void 0,ref_key:"sliderWrapper",ref:Sn,class:normalizeClass(unref(Dt)),role:In.range?"group":void 0,"aria-label":In.range&&!unref(Ne)?unref(Et):void 0,"aria-labelledby":In.range&&unref(Ne)?(Pn=unref(oe))==null?void 0:Pn.labelId:void 0,onTouchstart:$n[2]||($n[2]=(...Mn)=>unref(_e)&&unref(_e)(...Mn)),onTouchmove:$n[3]||($n[3]=(...Mn)=>unref(_e)&&unref(_e)(...Mn))},[createBaseVNode("div",{ref_key:"slider",ref:re,class:normalizeClass([unref($).e("runway"),{"show-input":In.showInput&&!In.range},unref($).is("disabled",unref(ue))]),style:normalizeStyle(unref(Fe)),onMousedown:$n[0]||($n[0]=(...Mn)=>unref(qe)&&unref(qe)(...Mn)),onTouchstart:$n[1]||($n[1]=(...Mn)=>unref(qe)&&unref(qe)(...Mn))},[createBaseVNode("div",{class:normalizeClass(unref($).e("bar")),style:normalizeStyle(unref(ze))},null,6),createVNode(SliderButton,{id:In.range?void 0:unref($e),ref_key:"firstButton",ref:ae,"model-value":unref(Cn),vertical:In.vertical,"tooltip-class":In.tooltipClass,placement:In.placement,role:"slider","aria-label":In.range||!unref(Ne)?unref(Pt):void 0,"aria-labelledby":!In.range&&unref(Ne)?(Dn=unref(oe))==null?void 0:Dn.labelId:void 0,"aria-valuemin":In.min,"aria-valuemax":In.range?unref(On):In.max,"aria-valuenow":unref(Cn),"aria-valuetext":unref(Lt),"aria-orientation":In.vertical?"vertical":"horizontal","aria-disabled":unref(ue),"onUpdate:modelValue":unref(xe)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),In.range?(openBlock(),createBlock(SliderButton,{key:0,ref_key:"secondButton",ref:le,"model-value":unref(On),vertical:In.vertical,"tooltip-class":In.tooltipClass,placement:In.placement,role:"slider","aria-label":unref(vn),"aria-valuemin":unref(Cn),"aria-valuemax":In.max,"aria-valuenow":unref(On),"aria-valuetext":unref(hn),"aria-orientation":In.vertical?"vertical":"horizontal","aria-disabled":unref(ue),"onUpdate:modelValue":unref(Ve)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):createCommentVNode("v-if",!0),In.showStops?(openBlock(),createElementBlock("div",_hoisted_2$A,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(he),(Mn,Fn)=>(openBlock(),createElementBlock("div",{key:Fn,class:normalizeClass(unref($).e("stop")),style:normalizeStyle(unref(Oe)(Mn))},null,6))),128))])):createCommentVNode("v-if",!0),unref(jt).length>0?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode("div",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(jt),(Mn,Fn)=>(openBlock(),createElementBlock("div",{key:Fn,style:normalizeStyle(unref(Oe)(Mn.position)),class:normalizeClass([unref($).e("stop"),unref($).e("marks-stop")])},null,6))),128))]),createBaseVNode("div",{class:normalizeClass(unref($).e("marks"))},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(jt),(Mn,Fn)=>(openBlock(),createBlock(unref(SliderMarker),{key:Fn,mark:Mn.mark,style:normalizeStyle(unref(Oe)(Mn.position))},null,8,["mark","style"]))),128))],2)],64)):createCommentVNode("v-if",!0)],38),In.showInput&&!In.range?(openBlock(),createBlock(unref(ElInputNumber),{key:0,ref:"input","model-value":unref(Cn),class:normalizeClass(unref($).e("input")),step:In.step,disabled:unref(ue),controls:In.showInputControls,min:In.min,max:In.max,debounce:In.debounce,size:unref(kt),"onUpdate:modelValue":unref(xe),onChange:unref(Ie)},null,8,["model-value","class","step","disabled","controls","min","max","debounce","size","onUpdate:modelValue","onChange"])):createCommentVNode("v-if",!0)],42,_hoisted_1$K)}}});var Slider$1=_export_sfc$2(_sfc_main$_,[["__file","/home/runner/work/element-plus/element-plus/packages/components/slider/src/slider.vue"]]);const ElSlider=withInstall(Slider$1),spaceItemProps=buildProps({prefixCls:{type:String}}),SpaceItem=defineComponent({name:"ElSpaceItem",props:spaceItemProps,setup(e,{slots:n}){const r=useNamespace("space"),g=computed(()=>`${e.prefixCls||r.b()}__item`);return()=>h$2("div",{class:g.value},renderSlot(n,"default"))}}),SIZE_MAP={small:8,default:12,large:16};function useSpace(e){const n=useNamespace("space"),r=computed(()=>[n.b(),n.m(e.direction),e.class]),g=ref(0),$=ref(0),L=computed(()=>{const oe=e.wrap||e.fill?{flexWrap:"wrap",marginBottom:`-${$.value}px`}:{},re={alignItems:e.alignment};return[oe,re,e.style]}),k=computed(()=>{const oe={paddingBottom:`${$.value}px`,marginRight:`${g.value}px`},re=e.fill?{flexGrow:1,minWidth:`${e.fillRatio}%`}:{};return[oe,re]});return watchEffect(()=>{const{size:oe="small",wrap:re,direction:ae,fill:le}=e;if(isArray$4(oe)){const[ue=0,pe=0]=oe;g.value=ue,$.value=pe}else{let ue;isNumber(oe)?ue=oe:ue=SIZE_MAP[oe||"small"]||SIZE_MAP.small,(re||le)&&ae==="horizontal"?g.value=$.value=ue:ae==="horizontal"?(g.value=ue,$.value=0):($.value=ue,g.value=0)}}),{classes:r,containerStyle:L,itemStyle:k}}const spaceProps=buildProps({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:definePropType([String,Object,Array]),default:""},style:{type:definePropType([String,Array,Object]),default:""},alignment:{type:definePropType(String),default:"center"},prefixCls:{type:String},spacer:{type:definePropType([Object,String,Number,Array]),default:null,validator:e=>isVNode(e)||isNumber(e)||isString$2(e)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:componentSizes,validator:e=>isNumber(e)||isArray$4(e)&&e.length===2&&e.every(isNumber)}});var Space=defineComponent({name:"ElSpace",props:spaceProps,setup(e,{slots:n}){const{classes:r,containerStyle:g,itemStyle:$}=useSpace(e);function L(k,oe="",re=[]){const{prefixCls:ae}=e;return k.forEach((le,ue)=>{isFragment(le)?isArray$4(le.children)&&le.children.forEach((pe,de)=>{isFragment(pe)&&isArray$4(pe.children)?L(pe.children,`${oe+de}-`,re):re.push(createVNode(SpaceItem,{style:$.value,prefixCls:ae,key:`nested-${oe+de}`},{default:()=>[pe]},PatchFlags.PROPS|PatchFlags.STYLE,["style","prefixCls"]))}):isValidElementNode(le)&&re.push(createVNode(SpaceItem,{style:$.value,prefixCls:ae,key:`LoopKey${oe+ue}`},{default:()=>[le]},PatchFlags.PROPS|PatchFlags.STYLE,["style","prefixCls"]))}),re}return()=>{var k;const{spacer:oe,direction:re}=e,ae=renderSlot(n,"default",{key:0},()=>[]);if(((k=ae.children)!=null?k:[]).length===0)return null;if(isArray$4(ae.children)){let le=L(ae.children);if(oe){const ue=le.length-1;le=le.reduce((pe,de,Fe)=>{const ze=[...pe,de];return Fe!==ue&&ze.push(createVNode("span",{style:[$.value,re==="vertical"?"width: 100%":null],key:Fe},[isVNode(oe)?oe:createTextVNode(oe,PatchFlags.TEXT)],PatchFlags.STYLE)),ze},[])}return createVNode("div",{class:r.value,style:g.value},le,PatchFlags.STYLE|PatchFlags.CLASS)}return ae.children}}});const ElSpace=withInstall(Space),stepsProps=buildProps({space:{type:[Number,String],default:""},active:{type:Number,default:0},direction:{type:String,default:"horizontal",values:["horizontal","vertical"]},alignCenter:{type:Boolean},simple:{type:Boolean},finishStatus:{type:String,values:["wait","process","finish","error","success"],default:"finish"},processStatus:{type:String,values:["wait","process","finish","error","success"],default:"process"}}),stepsEmits={[CHANGE_EVENT]:(e,n)=>[e,n].every(isNumber)},__default__$j={name:"ElSteps"},_sfc_main$Z=defineComponent({...__default__$j,props:stepsProps,emits:stepsEmits,setup(e,{emit:n}){const r=e,g=useNamespace("steps"),$=ref([]);return watch($,()=>{$.value.forEach((L,k)=>{L.setIndex(k)})}),provide("ElSteps",{props:r,steps:$}),watch(()=>r.active,(L,k)=>{n(CHANGE_EVENT,L,k)}),(L,k)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(g).b(),unref(g).m(L.simple?"simple":L.direction)])},[renderSlot(L.$slots,"default")],2))}});var Steps=_export_sfc$2(_sfc_main$Z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/steps/src/steps.vue"]]);const stepProps=buildProps({title:{type:String,default:""},icon:{type:iconPropType},description:{type:String,default:""},status:{type:String,values:["","wait","process","finish","error","success"],default:""}}),__default__$i={name:"ElStep"},_sfc_main$Y=defineComponent({...__default__$i,props:stepProps,setup(e){const n=e,r=useNamespace("step"),g=ref(-1),$=ref({}),L=ref(""),k=inject("ElSteps"),oe=getCurrentInstance();onMounted(()=>{watch([()=>k.props.active,()=>k.props.processStatus,()=>k.props.finishStatus],([xe])=>{At(xe)},{immediate:!0})}),onBeforeUnmount(()=>{k.steps.value=k.steps.value.filter(xe=>xe.uid!==oe?.uid)});const re=computed(()=>n.status||L.value),ae=computed(()=>{const xe=k.steps.value[g.value-1];return xe?xe.currentStatus:"wait"}),le=computed(()=>k.props.alignCenter),ue=computed(()=>k.props.direction==="vertical"),pe=computed(()=>k.props.simple),de=computed(()=>k.steps.value.length),Fe=computed(()=>{var xe;return((xe=k.steps.value[de.value-1])==null?void 0:xe.uid)===oe?.uid}),ze=computed(()=>pe.value?"":k.props.space),Ce=computed(()=>{const xe={flexBasis:typeof ze.value=="number"?`${ze.value}px`:ze.value?ze.value:`${100/(de.value-(le.value?0:1))}%`};return ue.value||Fe.value&&(xe.maxWidth=`${100/de.value}%`),xe}),Ie=xe=>{g.value=xe},_e=xe=>{let Ve=100;const he={};he.transitionDelay=`${150*g.value}ms`,xe===k.props.processStatus?Ve=0:xe==="wait"&&(Ve=0,he.transitionDelay=`${-150*g.value}ms`),he.borderWidth=Ve&&!pe.value?"1px":0,he[k.props.direction==="vertical"?"height":"width"]=`${Ve}%`,$.value=he},At=xe=>{xe>g.value?L.value=k.props.finishStatus:xe===g.value&&ae.value!=="error"?L.value=k.props.processStatus:L.value="wait";const Ve=k.steps.value[de.value-1];Ve&&Ve.calcProgress(L.value)},qe=reactive({uid:computed(()=>oe?.uid),currentStatus:re,setIndex:Ie,calcProgress:_e});return k.steps.value=[...k.steps.value,qe],(xe,Ve)=>(openBlock(),createElementBlock("div",{style:normalizeStyle(unref(Ce)),class:normalizeClass([unref(r).b(),unref(r).is(unref(pe)?"simple":unref(k).props.direction),unref(r).is("flex",unref(Fe)&&!unref(ze)&&!unref(le)),unref(r).is("center",unref(le)&&!unref(ue)&&!unref(pe))])},[createCommentVNode(" icon & line "),createBaseVNode("div",{class:normalizeClass([unref(r).e("head"),unref(r).is(unref(re))])},[unref(pe)?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(r).e("line"))},[createBaseVNode("i",{class:normalizeClass(unref(r).e("line-inner")),style:normalizeStyle($.value)},null,6)],2)),createBaseVNode("div",{class:normalizeClass([unref(r).e("icon"),unref(r).is(xe.icon||xe.$slots.icon?"icon":"text")])},[unref(re)!=="success"&&unref(re)!=="error"?renderSlot(xe.$slots,"icon",{key:0},()=>[xe.icon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(r).e("icon-inner"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(xe.icon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),!xe.icon&&!unref(pe)?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(r).e("icon-inner"))},toDisplayString(g.value+1),3)):createCommentVNode("v-if",!0)]):(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(r).e("icon-inner"),unref(r).is("status")])},{default:withCtx(()=>[unref(re)==="success"?(openBlock(),createBlock(unref(check_default),{key:0})):(openBlock(),createBlock(unref(close_default),{key:1}))]),_:1},8,["class"]))],2)],2),createCommentVNode(" title & description "),createBaseVNode("div",{class:normalizeClass(unref(r).e("main"))},[createBaseVNode("div",{class:normalizeClass([unref(r).e("title"),unref(r).is(unref(re))])},[renderSlot(xe.$slots,"title",{},()=>[createTextVNode(toDisplayString(xe.title),1)])],2),unref(pe)?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(r).e("arrow"))},null,2)):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass([unref(r).e("description"),unref(r).is(unref(re))])},[renderSlot(xe.$slots,"description",{},()=>[createTextVNode(toDisplayString(xe.description),1)])],2))],2)],6))}});var Step=_export_sfc$2(_sfc_main$Y,[["__file","/home/runner/work/element-plus/element-plus/packages/components/steps/src/item.vue"]]);const ElSteps=withInstall(Steps,{Step}),ElStep=withNoopInstall(Step),switchProps=buildProps({modelValue:{type:[Boolean,String,Number],default:!1},value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},activeIcon:{type:iconPropType,default:""},inactiveIcon:{type:iconPropType,default:""},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},borderColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String,loading:{type:Boolean,default:!1},beforeChange:{type:definePropType(Function)},size:{type:String,validator:isValidComponentSize},tabindex:{type:[String,Number]}}),switchEmits={[UPDATE_MODEL_EVENT]:e=>isBoolean(e)||isString$2(e)||isNumber(e),[CHANGE_EVENT]:e=>isBoolean(e)||isString$2(e)||isNumber(e),[INPUT_EVENT]:e=>isBoolean(e)||isString$2(e)||isNumber(e)},_hoisted_1$J=["onClick"],_hoisted_2$z=["id","aria-checked","aria-disabled","name","true-value","false-value","disabled","tabindex","onKeydown"],_hoisted_3$i=["aria-hidden"],_hoisted_4$f=["aria-hidden"],_hoisted_5$b=["aria-hidden"],_hoisted_6$9=["aria-hidden"],__default__$h={name:"ElSwitch"},_sfc_main$X=defineComponent({...__default__$h,props:switchProps,emits:switchEmits,setup(e,{expose:n,emit:r}){const g=e,$="ElSwitch",L=getCurrentInstance(),{formItem:k}=useFormItem(),oe=useSize(),re=useNamespace("switch");useDeprecated({from:'"value"',replacement:'"model-value" or "v-model"',scope:$,version:"2.3.0",ref:"https://element-plus.org/en-US/component/switch.html#attributes",type:"Attribute"},computed(()=>{var Ve;return!!((Ve=L.vnode.props)!=null&&Ve.value)}));const{inputId:ae}=useFormItemInputId(g,{formItemContext:k}),le=useDisabled$1(computed(()=>g.loading)),ue=ref(g.modelValue!==!1),pe=ref(),de=ref(),Fe=computed(()=>[re.b(),re.m(oe.value),re.is("disabled",le.value),re.is("checked",Ie.value)]),ze=computed(()=>({width:addUnit(g.width)}));watch(()=>g.modelValue,()=>{ue.value=!0}),watch(()=>g.value,()=>{ue.value=!1});const Ce=computed(()=>ue.value?g.modelValue:g.value),Ie=computed(()=>Ce.value===g.activeValue);[g.activeValue,g.inactiveValue].includes(Ce.value)||(r(UPDATE_MODEL_EVENT,g.inactiveValue),r(CHANGE_EVENT,g.inactiveValue),r(INPUT_EVENT,g.inactiveValue)),watch(Ie,Ve=>{var he;pe.value.checked=Ve,g.validateEvent&&((he=k?.validate)==null||he.call(k,"change").catch(Oe=>void 0))});const _e=()=>{const Ve=Ie.value?g.inactiveValue:g.activeValue;r(UPDATE_MODEL_EVENT,Ve),r(CHANGE_EVENT,Ve),r(INPUT_EVENT,Ve),nextTick(()=>{pe.value.checked=Ie.value})},At=()=>{if(le.value)return;const{beforeChange:Ve}=g;if(!Ve){_e();return}const he=Ve();[isPromise(he),isBoolean(he)].includes(!0)||throwError($,"beforeChange must return type `Promise` or `boolean`"),isPromise(he)?he.then($e=>{$e&&_e()}).catch($e=>{}):he&&_e()},qe=computed(()=>re.cssVarBlock({...g.activeColor?{"on-color":g.activeColor}:null,...g.inactiveColor?{"off-color":g.inactiveColor}:null,...g.borderColor?{"border-color":g.borderColor}:null})),xe=()=>{var Ve,he;(he=(Ve=pe.value)==null?void 0:Ve.focus)==null||he.call(Ve)};return onMounted(()=>{pe.value.checked=Ie.value}),n({focus:xe}),(Ve,he)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(Fe)),style:normalizeStyle(unref(qe)),onClick:withModifiers(At,["prevent"])},[createBaseVNode("input",{id:unref(ae),ref_key:"input",ref:pe,class:normalizeClass(unref(re).e("input")),type:"checkbox",role:"switch","aria-checked":unref(Ie),"aria-disabled":unref(le),name:Ve.name,"true-value":Ve.activeValue,"false-value":Ve.inactiveValue,disabled:unref(le),tabindex:Ve.tabindex,onChange:_e,onKeydown:withKeys(At,["enter"])},null,42,_hoisted_2$z),!Ve.inlinePrompt&&(Ve.inactiveIcon||Ve.inactiveText)?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass([unref(re).e("label"),unref(re).em("label","left"),unref(re).is("active",!unref(Ie))])},[Ve.inactiveIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Ve.inactiveIcon)))]),_:1})):createCommentVNode("v-if",!0),!Ve.inactiveIcon&&Ve.inactiveText?(openBlock(),createElementBlock("span",{key:1,"aria-hidden":unref(Ie)},toDisplayString(Ve.inactiveText),9,_hoisted_3$i)):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("span",{ref_key:"core",ref:de,class:normalizeClass(unref(re).e("core")),style:normalizeStyle(unref(ze))},[Ve.inlinePrompt?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(unref(re).e("inner"))},[Ve.activeIcon||Ve.inactiveIcon?(openBlock(),createElementBlock(Fragment,{key:0},[Ve.activeIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass([unref(re).is("icon"),unref(Ie)?unref(re).is("show"):unref(re).is("hide")])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Ve.activeIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),Ve.inactiveIcon?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(re).is("icon"),unref(Ie)?unref(re).is("hide"):unref(re).is("show")])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Ve.inactiveIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],64)):Ve.activeText||Ve.inactiveIcon?(openBlock(),createElementBlock(Fragment,{key:1},[Ve.activeText?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass([unref(re).is("text"),unref(Ie)?unref(re).is("show"):unref(re).is("hide")]),"aria-hidden":!unref(Ie)},toDisplayString(Ve.activeText.substring(0,3)),11,_hoisted_4$f)):createCommentVNode("v-if",!0),Ve.inactiveText?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass([unref(re).is("text"),unref(Ie)?unref(re).is("hide"):unref(re).is("show")]),"aria-hidden":unref(Ie)},toDisplayString(Ve.inactiveText.substring(0,3)),11,_hoisted_5$b)):createCommentVNode("v-if",!0)],64)):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(re).e("action"))},[Ve.loading?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(re).is("loading"))},{default:withCtx(()=>[createVNode(unref(loading_default))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2)],6),!Ve.inlinePrompt&&(Ve.activeIcon||Ve.activeText)?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass([unref(re).e("label"),unref(re).em("label","right"),unref(re).is("active",unref(Ie))])},[Ve.activeIcon?(openBlock(),createBlock(unref(ElIcon),{key:0},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(Ve.activeIcon)))]),_:1})):createCommentVNode("v-if",!0),!Ve.activeIcon&&Ve.activeText?(openBlock(),createElementBlock("span",{key:1,"aria-hidden":!unref(Ie)},toDisplayString(Ve.activeText),9,_hoisted_6$9)):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0)],14,_hoisted_1$J))}});var Switch$1=_export_sfc$2(_sfc_main$X,[["__file","/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);const ElSwitch=withInstall(Switch$1);/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(e){var n=""+e,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,$="",L=0,k=0;for(L=r.index;Ltypeof ae=="string"?get(oe,ae):ae(oe,re,e))):(n!=="$key"&&isObject$2(oe)&&"$value"in oe&&(oe=oe.$value),[isObject$2(oe)?get(oe,n):oe])},k=function(oe,re){if(g)return g(oe.value,re.value);for(let ae=0,le=oe.key.length;aere.key[ae])return 1}return 0};return e.map((oe,re)=>({value:oe,index:re,key:L?L(oe,re):null})).sort((oe,re)=>{let ae=k(oe,re);return ae||(ae=oe.index-re.index),ae*+r}).map(oe=>oe.value)},getColumnById=function(e,n){let r=null;return e.columns.forEach(g=>{g.id===n&&(r=g)}),r},getColumnByKey=function(e,n){let r=null;for(let g=0;g{if(!e)throw new Error("Row is required when get row identity");if(typeof n=="string"){if(!n.includes("."))return`${e[n]}`;const r=n.split(".");let g=e;for(const $ of r)g=g[$];return`${g}`}else if(typeof n=="function")return n.call(null,e)},getKeysMap=function(e,n){const r={};return(e||[]).forEach((g,$)=>{r[getRowIdentity(g,n)]={row:g,index:$}}),r};function mergeOptions$1(e,n){const r={};let g;for(g in e)r[g]=e[g];for(g in n)if(hasOwn(n,g)){const $=n[g];typeof $<"u"&&(r[g]=$)}return r}function parseWidth(e){return e===""||e!==void 0&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function parseMinWidth(e){return e===""||e!==void 0&&(e=parseWidth(e),Number.isNaN(e)&&(e=80)),e}function parseHeight(e){return typeof e=="number"?e:typeof e=="string"?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null}function compose(...e){return e.length===0?n=>n:e.length===1?e[0]:e.reduce((n,r)=>(...g)=>n(r(...g)))}function toggleRowStatus(e,n,r){let g=!1;const $=e.indexOf(n),L=$!==-1,k=()=>{e.push(n),g=!0},oe=()=>{e.splice($,1),g=!0};return typeof r=="boolean"?r&&!L?k():!r&&L&&oe():L?oe():k(),g}function walkTreeNode(e,n,r="children",g="hasChildren"){const $=k=>!(Array.isArray(k)&&k.length);function L(k,oe,re){n(k,oe,re),oe.forEach(ae=>{if(ae[g]){n(ae,null,re+1);return}const le=ae[r];$(le)||L(ae,le,re+1)})}e.forEach(k=>{if(k[g]){n(k,null,0);return}const oe=k[r];$(oe)||L(k,oe,0)})}let removePopper;function createTablePopper(e,n,r,g,$){const{nextZIndex:L}=useZIndex(),k=e?.dataset.prefix,oe=e?.querySelector(`.${k}-scrollbar__wrap`);function re(){const Fe=$==="light",ze=document.createElement("div");return ze.className=`${k}-popper ${Fe?"is-light":"is-dark"}`,r=escapeHtml_1(r),ze.innerHTML=r,ze.style.zIndex=String(L()),e?.appendChild(ze),ze}function ae(){const Fe=document.createElement("div");return Fe.className=`${k}-popper__arrow`,Fe}function le(){ue&&ue.update()}removePopper=()=>{try{ue&&ue.destroy(),pe&&e?.removeChild(pe),n.removeEventListener("mouseenter",le),n.removeEventListener("mouseleave",removePopper),oe?.removeEventListener("scroll",removePopper),removePopper=void 0}catch{}};let ue=null;const pe=re(),de=ae();return pe.appendChild(de),ue=yn(n,pe,{strategy:"absolute",modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"arrow",options:{element:de,padding:10}}],...g}),n.addEventListener("mouseenter",le),n.addEventListener("mouseleave",removePopper),oe?.addEventListener("scroll",removePopper),ue}const isFixedColumn=(e,n,r,g)=>{let $=0,L=e;if(g){if(g[e].colSpan>1)return{};for(let re=0;re=oe.value.length-r.states.rightFixedLeafColumnsLength.value&&(k="right");break;default:L=oe.value.length-r.states.rightFixedLeafColumnsLength.value&&(k="right")}return k?{direction:k,start:$,after:L}:{}},getFixedColumnsClass=(e,n,r,g,$)=>{const L=[],{direction:k,start:oe}=isFixedColumn(n,r,g,$);if(k){const re=k==="left";L.push(`${e}-fixed-column--${k}`),re&&oe===g.states.fixedLeafColumnsLength.value-1?L.push("is-last-column"):!re&&oe===g.states.columns.value.length-g.states.rightFixedLeafColumnsLength.value&&L.push("is-first-column")}return L};function getOffset(e,n){return e+(n.realWidth===null||Number.isNaN(n.realWidth)?Number(n.width):n.realWidth)}const getFixedColumnOffset=(e,n,r,g)=>{const{direction:$,start:L=0}=isFixedColumn(e,n,r,g);if(!$)return;const k={},oe=$==="left",re=r.states.columns.value;return oe?k.left=re.slice(0,e).reduce(getOffset,0):k.right=re.slice(L+1).reverse().reduce(getOffset,0),k},ensurePosition=(e,n)=>{!e||Number.isNaN(e[n])||(e[n]=`${e[n]}px`)};function useExpand(e){const n=getCurrentInstance(),r=ref(!1),g=ref([]);return{updateExpandRows:()=>{const re=e.data.value||[],ae=e.rowKey.value;if(r.value)g.value=re.slice();else if(ae){const le=getKeysMap(g.value,ae);g.value=re.reduce((ue,pe)=>{const de=getRowIdentity(pe,ae);return le[de]&&ue.push(pe),ue},[])}else g.value=[]},toggleRowExpansion:(re,ae)=>{toggleRowStatus(g.value,re,ae)&&n.emit("expand-change",re,g.value.slice())},setExpandRowKeys:re=>{n.store.assertRowKey();const ae=e.data.value||[],le=e.rowKey.value,ue=getKeysMap(ae,le);g.value=re.reduce((pe,de)=>{const Fe=ue[de];return Fe&&pe.push(Fe.row),pe},[])},isRowExpanded:re=>{const ae=e.rowKey.value;return ae?!!getKeysMap(g.value,ae)[getRowIdentity(re,ae)]:g.value.includes(re)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(e){const n=getCurrentInstance(),r=ref(null),g=ref(null),$=ae=>{n.store.assertRowKey(),r.value=ae,k(ae)},L=()=>{r.value=null},k=ae=>{const{data:le,rowKey:ue}=e;let pe=null;ue.value&&(pe=(unref(le)||[]).find(de=>getRowIdentity(de,ue.value)===ae)),g.value=pe,n.emit("current-change",g.value,null)};return{setCurrentRowKey:$,restoreCurrentRowKey:L,setCurrentRowByKey:k,updateCurrentRow:ae=>{const le=g.value;if(ae&&ae!==le){g.value=ae,n.emit("current-change",g.value,le);return}!ae&&le&&(g.value=null,n.emit("current-change",null,le))},updateCurrentRowData:()=>{const ae=e.rowKey.value,le=e.data.value||[],ue=g.value;if(!le.includes(ue)&&ue){if(ae){const pe=getRowIdentity(ue,ae);k(pe)}else g.value=null;g.value===null&&n.emit("current-change",null,ue)}else r.value&&(k(r.value),L())},states:{_currentRowKey:r,currentRow:g}}}function useTree$2(e){const n=ref([]),r=ref({}),g=ref(16),$=ref(!1),L=ref({}),k=ref("hasChildren"),oe=ref("children"),re=getCurrentInstance(),ae=computed(()=>{if(!e.rowKey.value)return{};const Ie=e.data.value||[];return ue(Ie)}),le=computed(()=>{const Ie=e.rowKey.value,_e=Object.keys(L.value),At={};return _e.length&&_e.forEach(qe=>{if(L.value[qe].length){const xe={children:[]};L.value[qe].forEach(Ve=>{const he=getRowIdentity(Ve,Ie);xe.children.push(he),Ve[k.value]&&!At[he]&&(At[he]={children:[]})}),At[qe]=xe}}),At}),ue=Ie=>{const _e=e.rowKey.value,At={};return walkTreeNode(Ie,(qe,xe,Ve)=>{const he=getRowIdentity(qe,_e);Array.isArray(xe)?At[he]={children:xe.map(Oe=>getRowIdentity(Oe,_e)),level:Ve}:$.value&&(At[he]={children:[],lazy:!0,level:Ve})},oe.value,k.value),At},pe=(Ie=!1,_e=(At=>(At=re.store)==null?void 0:At.states.defaultExpandAll.value)())=>{var At;const qe=ae.value,xe=le.value,Ve=Object.keys(qe),he={};if(Ve.length){const Oe=unref(r),$e=[],Ne=(kt,Et)=>{if(Ie)return n.value?_e||n.value.includes(Et):!!(_e||kt?.expanded);{const Pt=_e||n.value&&n.value.includes(Et);return!!(kt?.expanded||Pt)}};Ve.forEach(kt=>{const Et=Oe[kt],Pt={...qe[kt]};if(Pt.expanded=Ne(Et,kt),Pt.lazy){const{loaded:Lt=!1,loading:vn=!1}=Et||{};Pt.loaded=!!Lt,Pt.loading=!!vn,$e.push(kt)}he[kt]=Pt});const Ue=Object.keys(xe);$.value&&Ue.length&&$e.length&&Ue.forEach(kt=>{const Et=Oe[kt],Pt=xe[kt].children;if($e.includes(kt)){if(he[kt].children.length!==0)throw new Error("[ElTable]children must be an empty array.");he[kt].children=Pt}else{const{loaded:Lt=!1,loading:vn=!1}=Et||{};he[kt]={lazy:!0,loaded:!!Lt,loading:!!vn,expanded:Ne(Et,kt),children:Pt,level:""}}})}r.value=he,(At=re.store)==null||At.updateTableScrollY()};watch(()=>n.value,()=>{pe(!0)}),watch(()=>ae.value,()=>{pe()}),watch(()=>le.value,()=>{pe()});const de=Ie=>{n.value=Ie,pe()},Fe=(Ie,_e)=>{re.store.assertRowKey();const At=e.rowKey.value,qe=getRowIdentity(Ie,At),xe=qe&&r.value[qe];if(qe&&xe&&"expanded"in xe){const Ve=xe.expanded;_e=typeof _e>"u"?!xe.expanded:_e,r.value[qe].expanded=_e,Ve!==_e&&re.emit("expand-change",Ie,_e),re.store.updateTableScrollY()}},ze=Ie=>{re.store.assertRowKey();const _e=e.rowKey.value,At=getRowIdentity(Ie,_e),qe=r.value[At];$.value&&qe&&"loaded"in qe&&!qe.loaded?Ce(Ie,At,qe):Fe(Ie,void 0)},Ce=(Ie,_e,At)=>{const{load:qe}=re.props;qe&&!r.value[_e].loaded&&(r.value[_e].loading=!0,qe(Ie,At,xe=>{if(!Array.isArray(xe))throw new TypeError("[ElTable] data must be an array");r.value[_e].loading=!1,r.value[_e].loaded=!0,r.value[_e].expanded=!0,xe.length&&(L.value[_e]=xe),re.emit("expand-change",Ie,!0)}))};return{loadData:Ce,loadOrToggle:ze,toggleTreeExpansion:Fe,updateTreeExpandKeys:de,updateTreeData:pe,normalize:ue,states:{expandRowKeys:n,treeData:r,indent:g,lazy:$,lazyTreeNodeMap:L,lazyColumnIdentifier:k,childrenColumnName:oe}}}const sortData=(e,n)=>{const r=n.sortingColumn;return!r||typeof r.sortable=="string"?e:orderBy(e,n.sortProp,n.sortOrder,r.sortMethod,r.sortBy)},doFlattenColumns=e=>{const n=[];return e.forEach(r=>{r.children?n.push.apply(n,doFlattenColumns(r.children)):n.push(r)}),n};function useWatcher$1(){var e;const n=getCurrentInstance(),{size:r}=toRefs((e=n.proxy)==null?void 0:e.$props),g=ref(null),$=ref([]),L=ref([]),k=ref(!1),oe=ref([]),re=ref([]),ae=ref([]),le=ref([]),ue=ref([]),pe=ref([]),de=ref([]),Fe=ref([]),ze=ref(0),Ce=ref(0),Ie=ref(0),_e=ref(!1),At=ref([]),qe=ref(!1),xe=ref(!1),Ve=ref(null),he=ref({}),Oe=ref(null),$e=ref(null),Ne=ref(null),Ue=ref(null),kt=ref(null);watch($,()=>n.state&&Lt(!1),{deep:!0});const Et=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},Pt=()=>{le.value=oe.value.filter(Qn=>Qn.fixed===!0||Qn.fixed==="left"),ue.value=oe.value.filter(Qn=>Qn.fixed==="right"),le.value.length>0&&oe.value[0]&&oe.value[0].type==="selection"&&!oe.value[0].fixed&&(oe.value[0].fixed=!0,le.value.unshift(oe.value[0]));const Yn=oe.value.filter(Qn=>!Qn.fixed);re.value=[].concat(le.value).concat(Yn).concat(ue.value);const Wn=doFlattenColumns(Yn),Vn=doFlattenColumns(le.value),_n=doFlattenColumns(ue.value);ze.value=Wn.length,Ce.value=Vn.length,Ie.value=_n.length,ae.value=[].concat(Vn).concat(Wn).concat(_n),k.value=le.value.length>0||ue.value.length>0},Lt=(Yn,Wn=!1)=>{Yn&&Pt(),Wn?n.state.doLayout():n.state.debouncedUpdateLayout()},vn=Yn=>At.value.includes(Yn),hn=()=>{_e.value=!1,At.value.length&&(At.value=[],n.emit("selection-change",[]))},Dt=()=>{let Yn;if(g.value){Yn=[];const Wn=getKeysMap(At.value,g.value),Vn=getKeysMap($.value,g.value);for(const _n in Wn)hasOwn(Wn,_n)&&!Vn[_n]&&Yn.push(Wn[_n].row)}else Yn=At.value.filter(Wn=>!$.value.includes(Wn));if(Yn.length){const Wn=At.value.filter(Vn=>!Yn.includes(Vn));At.value=Wn,n.emit("selection-change",Wn.slice())}},jt=()=>(At.value||[]).slice(),bn=(Yn,Wn=void 0,Vn=!0)=>{if(toggleRowStatus(At.value,Yn,Wn)){const Qn=(At.value||[]).slice();Vn&&n.emit("select",Qn,Yn),n.emit("selection-change",Qn)}},Sn=()=>{var Yn,Wn;const Vn=xe.value?!_e.value:!(_e.value||At.value.length);_e.value=Vn;let _n=!1,Qn=0;const jn=(Wn=(Yn=n?.store)==null?void 0:Yn.states)==null?void 0:Wn.rowKey.value;$.value.forEach((Un,Xn)=>{const Zn=Xn+Qn;Ve.value?Ve.value.call(null,Un,Zn)&&toggleRowStatus(At.value,Un,Vn)&&(_n=!0):toggleRowStatus(At.value,Un,Vn)&&(_n=!0),Qn+=En(getRowIdentity(Un,jn))}),_n&&n.emit("selection-change",At.value?At.value.slice():[]),n.emit("select-all",At.value)},Cn=()=>{const Yn=getKeysMap(At.value,g.value);$.value.forEach(Wn=>{const Vn=getRowIdentity(Wn,g.value),_n=Yn[Vn];_n&&(At.value[_n.index]=Wn)})},On=()=>{var Yn,Wn,Vn;if(((Yn=$.value)==null?void 0:Yn.length)===0){_e.value=!1;return}let _n;g.value&&(_n=getKeysMap(At.value,g.value));const Qn=function(Zn){return _n?!!_n[getRowIdentity(Zn,g.value)]:At.value.includes(Zn)};let jn=!0,Un=0,Xn=0;for(let Zn=0,to=($.value||[]).length;Zn{var Wn;if(!n||!n.store)return 0;const{treeData:Vn}=n.store.states;let _n=0;const Qn=(Wn=Vn.value[Yn])==null?void 0:Wn.children;return Qn&&(_n+=Qn.length,Qn.forEach(jn=>{_n+=En(jn)})),_n},An=(Yn,Wn)=>{Array.isArray(Yn)||(Yn=[Yn]);const Vn={};return Yn.forEach(_n=>{he.value[_n.id]=Wn,Vn[_n.columnKey||_n.id]=Wn}),Vn},In=(Yn,Wn,Vn)=>{$e.value&&$e.value!==Yn&&($e.value.order=null),$e.value=Yn,Ne.value=Wn,Ue.value=Vn},$n=()=>{let Yn=unref(L);Object.keys(he.value).forEach(Wn=>{const Vn=he.value[Wn];if(!Vn||Vn.length===0)return;const _n=getColumnById({columns:ae.value},Wn);_n&&_n.filterMethod&&(Yn=Yn.filter(Qn=>Vn.some(jn=>_n.filterMethod.call(null,jn,Qn,_n))))}),Oe.value=Yn},Pn=()=>{$.value=sortData(Oe.value,{sortingColumn:$e.value,sortProp:Ne.value,sortOrder:Ue.value})},Dn=(Yn=void 0)=>{Yn&&Yn.filter||$n(),Pn()},Mn=Yn=>{const{tableHeaderRef:Wn}=n.refs;if(!Wn)return;const Vn=Object.assign({},Wn.filterPanels),_n=Object.keys(Vn);if(!!_n.length)if(typeof Yn=="string"&&(Yn=[Yn]),Array.isArray(Yn)){const Qn=Yn.map(jn=>getColumnByKey({columns:ae.value},jn));_n.forEach(jn=>{const Un=Qn.find(Xn=>Xn.id===jn);Un&&(Un.filteredValue=[])}),n.store.commit("filterChange",{column:Qn,values:[],silent:!0,multi:!0})}else _n.forEach(Qn=>{const jn=ae.value.find(Un=>Un.id===Qn);jn&&(jn.filteredValue=[])}),he.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Fn=()=>{!$e.value||(In(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:kn,toggleRowExpansion:Nn,updateExpandRows:Rn,states:wn,isRowExpanded:Tn}=useExpand({data:$,rowKey:g}),{updateTreeExpandKeys:xn,toggleTreeExpansion:Bn,updateTreeData:Ln,loadOrToggle:Hn,states:zn}=useTree$2({data:$,rowKey:g}),{updateCurrentRowData:Jn,updateCurrentRow:co,setCurrentRowKey:Gn,states:eo}=useCurrent({data:$,rowKey:g});return{assertRowKey:Et,updateColumns:Pt,scheduleLayout:Lt,isSelected:vn,clearSelection:hn,cleanSelection:Dt,getSelectionRows:jt,toggleRowSelection:bn,_toggleAllSelection:Sn,toggleAllSelection:null,updateSelectionByRowKey:Cn,updateAllSelected:On,updateFilters:An,updateCurrentRow:co,updateSort:In,execFilter:$n,execSort:Pn,execQuery:Dn,clearFilter:Mn,clearSort:Fn,toggleRowExpansion:Nn,setExpandRowKeysAdapter:Yn=>{kn(Yn),xn(Yn)},setCurrentRowKey:Gn,toggleRowExpansionAdapter:(Yn,Wn)=>{ae.value.some(({type:_n})=>_n==="expand")?Nn(Yn,Wn):Bn(Yn,Wn)},isRowExpanded:Tn,updateExpandRows:Rn,updateCurrentRowData:Jn,loadOrToggle:Hn,updateTreeData:Ln,states:{tableSize:r,rowKey:g,data:$,_data:L,isComplex:k,_columns:oe,originColumns:re,columns:ae,fixedColumns:le,rightFixedColumns:ue,leafColumns:pe,fixedLeafColumns:de,rightFixedLeafColumns:Fe,leafColumnsLength:ze,fixedLeafColumnsLength:Ce,rightFixedLeafColumnsLength:Ie,isAllSelected:_e,selection:At,reserveSelection:qe,selectOnIndeterminate:xe,selectable:Ve,filters:he,filteredData:Oe,sortingColumn:$e,sortProp:Ne,sortOrder:Ue,hoverRow:kt,...wn,...zn,...eo}}}function replaceColumn(e,n){return e.map(r=>{var g;return r.id===n.id?n:((g=r.children)!=null&&g.length&&(r.children=replaceColumn(r.children,n)),r)})}function sortColumn(e){e.forEach(n=>{var r,g;n.no=(r=n.getColumnIndex)==null?void 0:r.call(n),(g=n.children)!=null&&g.length&&sortColumn(n.children)}),e.sort((n,r)=>n.no-r.no)}function useStore(){const e=getCurrentInstance(),n=useWatcher$1();return{ns:useNamespace("table"),...n,mutations:{setData(k,oe){const re=unref(k._data)!==oe;k.data.value=oe,k._data.value=oe,e.store.execQuery(),e.store.updateCurrentRowData(),e.store.updateExpandRows(),e.store.updateTreeData(e.store.states.defaultExpandAll.value),unref(k.reserveSelection)?(e.store.assertRowKey(),e.store.updateSelectionByRowKey()):re?e.store.clearSelection():e.store.cleanSelection(),e.store.updateAllSelected(),e.$ready&&e.store.scheduleLayout()},insertColumn(k,oe,re){const ae=unref(k._columns);let le=[];re?(re&&!re.children&&(re.children=[]),re.children.push(oe),le=replaceColumn(ae,re)):(ae.push(oe),le=ae),sortColumn(le),k._columns.value=le,oe.type==="selection"&&(k.selectable.value=oe.selectable,k.reserveSelection.value=oe.reserveSelection),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},removeColumn(k,oe,re){const ae=unref(k._columns)||[];if(re)re.children.splice(re.children.findIndex(le=>le.id===oe.id),1),re.children.length===0&&delete re.children,k._columns.value=replaceColumn(ae,re);else{const le=ae.indexOf(oe);le>-1&&(ae.splice(le,1),k._columns.value=ae)}e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},sort(k,oe){const{prop:re,order:ae,init:le}=oe;if(re){const ue=unref(k.columns).find(pe=>pe.property===re);ue&&(ue.order=ae,e.store.updateSort(ue,re,ae),e.store.commit("changeSortCondition",{init:le}))}},changeSortCondition(k,oe){const{sortingColumn:re,sortProp:ae,sortOrder:le}=k;unref(le)===null&&(k.sortingColumn.value=null,k.sortProp.value=null);const ue={filter:!0};e.store.execQuery(ue),(!oe||!(oe.silent||oe.init))&&e.emit("sort-change",{column:unref(re),prop:unref(ae),order:unref(le)}),e.store.updateTableScrollY()},filterChange(k,oe){const{column:re,values:ae,silent:le}=oe,ue=e.store.updateFilters(re,ae);e.store.execQuery(),le||e.emit("filter-change",ue),e.store.updateTableScrollY()},toggleAllSelection(){e.store.toggleAllSelection()},rowSelectedChanged(k,oe){e.store.toggleRowSelection(oe),e.store.updateAllSelected()},setHoverRow(k,oe){k.hoverRow.value=oe},setCurrentRow(k,oe){e.store.updateCurrentRow(oe)}},commit:function(k,...oe){const re=e.store.mutations;if(re[k])re[k].apply(e,[e.store.states].concat(oe));else throw new Error(`Action not found: ${k}`)},updateTableScrollY:function(){nextTick(()=>e.layout.updateScrollY.apply(e.layout))}}}const InitialStateMap={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function createStore(e,n){if(!e)throw new Error("Table is required.");const r=useStore();return r.toggleAllSelection=debounce(r._toggleAllSelection,10),Object.keys(InitialStateMap).forEach(g=>{handleValue(getArrKeysValue(n,g),g,r)}),proxyTableProps(r,n),r}function proxyTableProps(e,n){Object.keys(InitialStateMap).forEach(r=>{watch(()=>getArrKeysValue(n,r),g=>{handleValue(g,r,e)})})}function handleValue(e,n,r){let g=e,$=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&($=$.key,g=g||InitialStateMap[n].default),r.states[$].value=g}function getArrKeysValue(e,n){if(n.includes(".")){const r=n.split(".");let g=e;return r.forEach($=>{g=g[$]}),g}else return e[n]}class TableLayout$1{constructor(n){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=ref(null),this.scrollX=ref(!1),this.scrollY=ref(!1),this.bodyWidth=ref(null),this.fixedWidth=ref(null),this.rightFixedWidth=ref(null),this.gutterWidth=0;for(const r in n)hasOwn(n,r)&&(isRef(this[r])?this[r].value=n[r]:this[r]=n[r]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const r=this.table.refs.scrollBarRef;if(this.table.vnode.el&&r){let g=!0;const $=this.scrollY.value;return g=r.wrap$.scrollHeight>r.wrap$.clientHeight,this.scrollY.value=g,$!==g}return!1}setHeight(n,r="height"){if(!isClient)return;const g=this.table.vnode.el;if(n=parseHeight(n),this.height.value=Number(n),!g&&(n||n===0))return nextTick(()=>this.setHeight(n,r));typeof n=="number"?(g.style[r]=`${n}px`,this.updateElsHeight()):typeof n=="string"&&(g.style[r]=n,this.updateElsHeight())}setMaxHeight(n){this.setHeight(n,"max-height")}getFlattenColumns(){const n=[];return this.table.store.states.columns.value.forEach(g=>{g.isColumnGroup?n.push.apply(n,g.columns):n.push(g)}),n}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(n){if(!n)return!0;let r=n;for(;r.tagName!=="DIV";){if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}updateColumnsWidth(){if(!isClient)return;const n=this.fit,r=this.table.vnode.el.clientWidth;let g=0;const $=this.getFlattenColumns(),L=$.filter(re=>typeof re.width!="number");if($.forEach(re=>{typeof re.width=="number"&&re.realWidth&&(re.realWidth=null)}),L.length>0&&n){if($.forEach(re=>{g+=Number(re.width||re.minWidth||80)}),g<=r){this.scrollX.value=!1;const re=r-g;if(L.length===1)L[0].realWidth=Number(L[0].minWidth||80)+re;else{const ae=L.reduce((pe,de)=>pe+Number(de.minWidth||80),0),le=re/ae;let ue=0;L.forEach((pe,de)=>{if(de===0)return;const Fe=Math.floor(Number(pe.minWidth||80)*le);ue+=Fe,pe.realWidth=Number(pe.minWidth||80)+Fe}),L[0].realWidth=Number(L[0].minWidth||80)+re-ue}}else this.scrollX.value=!0,L.forEach(re=>{re.realWidth=Number(re.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else $.forEach(re=>{!re.width&&!re.minWidth?re.realWidth=80:re.realWidth=Number(re.width||re.minWidth),g+=re.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const k=this.store.states.fixedColumns.value;if(k.length>0){let re=0;k.forEach(ae=>{re+=Number(ae.realWidth||ae.width)}),this.fixedWidth.value=re}const oe=this.store.states.rightFixedColumns.value;if(oe.length>0){let re=0;oe.forEach(ae=>{re+=Number(ae.realWidth||ae.width)}),this.rightFixedWidth.value=re}this.notifyObservers("columns")}addObserver(n){this.observers.push(n)}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&this.observers.splice(r,1)}notifyObservers(n){this.observers.forEach(g=>{var $,L;switch(n){case"columns":($=g.state)==null||$.onColumnsChange(this);break;case"scrollable":(L=g.state)==null||L.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$W=defineComponent({name:"ElTableFilterPanel",components:{ElCheckbox,ElCheckboxGroup,ElScrollbar,ElTooltip,ElIcon,ArrowDown:arrow_down_default,ArrowUp:arrow_up_default},directives:{ClickOutside},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const n=getCurrentInstance(),{t:r}=useLocale(),g=useNamespace("table-filter"),$=n?.parent;$.filterPanels.value[e.column.id]||($.filterPanels.value[e.column.id]=n);const L=ref(!1),k=ref(null),oe=computed(()=>e.column&&e.column.filters),re=computed({get:()=>{var qe;return(((qe=e.column)==null?void 0:qe.filteredValue)||[])[0]},set:qe=>{ae.value&&(typeof qe<"u"&&qe!==null?ae.value.splice(0,1,qe):ae.value.splice(0,1))}}),ae=computed({get(){return e.column?e.column.filteredValue||[]:[]},set(qe){e.column&&e.upDataColumn("filteredValue",qe)}}),le=computed(()=>e.column?e.column.filterMultiple:!0),ue=qe=>qe.value===re.value,pe=()=>{L.value=!1},de=qe=>{qe.stopPropagation(),L.value=!L.value},Fe=()=>{L.value=!1},ze=()=>{_e(ae.value),pe()},Ce=()=>{ae.value=[],_e(ae.value),pe()},Ie=qe=>{re.value=qe,_e(typeof qe<"u"&&qe!==null?ae.value:[]),pe()},_e=qe=>{e.store.commit("filterChange",{column:e.column,values:qe}),e.store.updateAllSelected()};watch(L,qe=>{e.column&&e.upDataColumn("filterOpened",qe)},{immediate:!0});const At=computed(()=>{var qe,xe;return(xe=(qe=k.value)==null?void 0:qe.popperRef)==null?void 0:xe.contentRef});return{tooltipVisible:L,multiple:le,filteredValue:ae,filterValue:re,filters:oe,handleConfirm:ze,handleReset:Ce,handleSelect:Ie,isActive:ue,t:r,ns:g,showFilterPanel:de,hideFilterPanel:Fe,popperPaneRef:At,tooltip:k}}}),_hoisted_1$I={key:0},_hoisted_2$y=["disabled"],_hoisted_3$h=["label","onClick"];function _sfc_render$D(e,n,r,g,$,L){const k=resolveComponent("el-checkbox"),oe=resolveComponent("el-checkbox-group"),re=resolveComponent("el-scrollbar"),ae=resolveComponent("arrow-up"),le=resolveComponent("arrow-down"),ue=resolveComponent("el-icon"),pe=resolveComponent("el-tooltip"),de=resolveDirective("click-outside");return openBlock(),createBlock(pe,{ref:"tooltip",visible:e.tooltipVisible,offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.ns.b(),persistent:""},{content:withCtx(()=>[e.multiple?(openBlock(),createElementBlock("div",_hoisted_1$I,[createBaseVNode("div",{class:normalizeClass(e.ns.e("content"))},[createVNode(re,{"wrap-class":e.ns.e("wrap")},{default:withCtx(()=>[createVNode(oe,{modelValue:e.filteredValue,"onUpdate:modelValue":n[0]||(n[0]=Fe=>e.filteredValue=Fe),class:normalizeClass(e.ns.e("checkbox-group"))},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.filters,Fe=>(openBlock(),createBlock(k,{key:Fe.value,label:Fe.value},{default:withCtx(()=>[createTextVNode(toDisplayString(Fe.text),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),createBaseVNode("div",{class:normalizeClass(e.ns.e("bottom"))},[createBaseVNode("button",{class:normalizeClass({[e.ns.is("disabled")]:e.filteredValue.length===0}),disabled:e.filteredValue.length===0,type:"button",onClick:n[1]||(n[1]=(...Fe)=>e.handleConfirm&&e.handleConfirm(...Fe))},toDisplayString(e.t("el.table.confirmFilter")),11,_hoisted_2$y),createBaseVNode("button",{type:"button",onClick:n[2]||(n[2]=(...Fe)=>e.handleReset&&e.handleReset(...Fe))},toDisplayString(e.t("el.table.resetFilter")),1)],2)])):(openBlock(),createElementBlock("ul",{key:1,class:normalizeClass(e.ns.e("list"))},[createBaseVNode("li",{class:normalizeClass([e.ns.e("list-item"),{[e.ns.is("active")]:e.filterValue===void 0||e.filterValue===null}]),onClick:n[3]||(n[3]=Fe=>e.handleSelect(null))},toDisplayString(e.t("el.table.clearFilter")),3),(openBlock(!0),createElementBlock(Fragment,null,renderList(e.filters,Fe=>(openBlock(),createElementBlock("li",{key:Fe.value,class:normalizeClass([e.ns.e("list-item"),e.ns.is("active",e.isActive(Fe))]),label:Fe.value,onClick:ze=>e.handleSelect(Fe.value)},toDisplayString(Fe.text),11,_hoisted_3$h))),128))],2))]),default:withCtx(()=>[withDirectives((openBlock(),createElementBlock("span",{class:normalizeClass([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:n[4]||(n[4]=(...Fe)=>e.showFilterPanel&&e.showFilterPanel(...Fe))},[createVNode(ue,null,{default:withCtx(()=>[e.column.filterOpened?(openBlock(),createBlock(ae,{key:0})):(openBlock(),createBlock(le,{key:1}))]),_:1})],2)),[[de,e.hideFilterPanel,e.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}var FilterPanel=_export_sfc$2(_sfc_main$W,[["render",_sfc_render$D],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function useLayoutObserver(e){const n=getCurrentInstance();onBeforeMount(()=>{r.value.addObserver(n)}),onMounted(()=>{g(r.value),$(r.value)}),onUpdated(()=>{g(r.value),$(r.value)}),onUnmounted(()=>{r.value.removeObserver(n)});const r=computed(()=>{const L=e.layout;if(!L)throw new Error("Can not find table layout.");return L}),g=L=>{var k;const oe=((k=e.vnode.el)==null?void 0:k.querySelectorAll("colgroup > col"))||[];if(!oe.length)return;const re=L.getFlattenColumns(),ae={};re.forEach(le=>{ae[le.id]=le});for(let le=0,ue=oe.length;le{var k,oe;const re=((k=e.vnode.el)==null?void 0:k.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let le=0,ue=re.length;le{ze.stopPropagation()},L=(ze,Ce)=>{!Ce.filters&&Ce.sortable?Fe(ze,Ce,!1):Ce.filterable&&!Ce.sortable&&$(ze),g?.emit("header-click",Ce,ze)},k=(ze,Ce)=>{g?.emit("header-contextmenu",Ce,ze)},oe=ref(null),re=ref(!1),ae=ref({}),le=(ze,Ce)=>{if(!!isClient&&!(Ce.children&&Ce.children.length>0)&&oe.value&&e.border){re.value=!0;const Ie=g;n("set-drag-visible",!0);const At=(Ie?.vnode.el).getBoundingClientRect().left,qe=r.vnode.el.querySelector(`th.${Ce.id}`),xe=qe.getBoundingClientRect(),Ve=xe.left-At+30;addClass(qe,"noclick"),ae.value={startMouseLeft:ze.clientX,startLeft:xe.right-At,startColumnLeft:xe.left-At,tableLeft:At};const he=Ie?.refs.resizeProxy;he.style.left=`${ae.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const Oe=Ne=>{const Ue=Ne.clientX-ae.value.startMouseLeft,kt=ae.value.startLeft+Ue;he.style.left=`${Math.max(Ve,kt)}px`},$e=()=>{if(re.value){const{startColumnLeft:Ne,startLeft:Ue}=ae.value,Et=Number.parseInt(he.style.left,10)-Ne;Ce.width=Ce.realWidth=Et,Ie?.emit("header-dragend",Ce.width,Ue-Ne,Ce,ze),requestAnimationFrame(()=>{e.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",re.value=!1,oe.value=null,ae.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",Oe),document.removeEventListener("mouseup",$e),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(qe,"noclick")},0)};document.addEventListener("mousemove",Oe),document.addEventListener("mouseup",$e)}},ue=(ze,Ce)=>{var Ie;if(Ce.children&&Ce.children.length>0)return;const _e=(Ie=ze.target)==null?void 0:Ie.closest("th");if(!(!Ce||!Ce.resizable)&&!re.value&&e.border){const At=_e.getBoundingClientRect(),qe=document.body.style;At.width>12&&At.right-ze.pageX<8?(qe.cursor="col-resize",hasClass(_e,"is-sortable")&&(_e.style.cursor="col-resize"),oe.value=Ce):re.value||(qe.cursor="",hasClass(_e,"is-sortable")&&(_e.style.cursor="pointer"),oe.value=null)}},pe=()=>{!isClient||(document.body.style.cursor="")},de=({order:ze,sortOrders:Ce})=>{if(ze==="")return Ce[0];const Ie=Ce.indexOf(ze||null);return Ce[Ie>Ce.length-2?0:Ie+1]},Fe=(ze,Ce,Ie)=>{var _e;ze.stopPropagation();const At=Ce.order===Ie?null:Ie||de(Ce),qe=(_e=ze.target)==null?void 0:_e.closest("th");if(qe&&hasClass(qe,"noclick")){removeClass(qe,"noclick");return}if(!Ce.sortable)return;const xe=e.store.states;let Ve=xe.sortProp.value,he;const Oe=xe.sortingColumn.value;(Oe!==Ce||Oe===Ce&&Oe.order===null)&&(Oe&&(Oe.order=null),xe.sortingColumn.value=Ce,Ve=Ce.property),At?he=Ce.order=At:he=Ce.order=null,xe.sortProp.value=Ve,xe.sortOrder.value=he,g?.store.commit("changeSortCondition")};return{handleHeaderClick:L,handleHeaderContextMenu:k,handleMouseDown:le,handleMouseMove:ue,handleMouseOut:pe,handleSortClick:Fe,handleFilterClick:$}}function useStyle$2(e){const n=inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:oe=>{const re=n?.props.headerRowStyle;return typeof re=="function"?re.call(null,{rowIndex:oe}):re},getHeaderRowClass:oe=>{const re=[],ae=n?.props.headerRowClassName;return typeof ae=="string"?re.push(ae):typeof ae=="function"&&re.push(ae.call(null,{rowIndex:oe})),re.join(" ")},getHeaderCellStyle:(oe,re,ae,le)=>{var ue;let pe=(ue=n?.props.headerCellStyle)!=null?ue:{};typeof pe=="function"&&(pe=pe.call(null,{rowIndex:oe,columnIndex:re,row:ae,column:le}));const de=le.isSubColumn?null:getFixedColumnOffset(re,le.fixed,e.store,ae);return ensurePosition(de,"left"),ensurePosition(de,"right"),Object.assign({},pe,de)},getHeaderCellClass:(oe,re,ae,le)=>{const ue=le.isSubColumn?[]:getFixedColumnsClass(r.b(),re,le.fixed,e.store,ae),pe=[le.id,le.order,le.headerAlign,le.className,le.labelClassName,...ue];le.children||pe.push("is-leaf"),le.sortable&&pe.push("is-sortable");const de=n?.props.headerCellClassName;return typeof de=="string"?pe.push(de):typeof de=="function"&&pe.push(de.call(null,{rowIndex:oe,columnIndex:re,row:ae,column:le})),pe.push(r.e("cell")),pe.filter(Fe=>Boolean(Fe)).join(" ")}}}const getAllColumns=e=>{const n=[];return e.forEach(r=>{r.children?(n.push(r),n.push.apply(n,getAllColumns(r.children))):n.push(r)}),n},convertToRows=e=>{let n=1;const r=(L,k)=>{if(k&&(L.level=k.level+1,n{r(re,L),oe+=re.colSpan}),L.colSpan=oe}else L.colSpan=1};e.forEach(L=>{L.level=1,r(L,void 0)});const g=[];for(let L=0;L{L.children?(L.rowSpan=1,L.children.forEach(k=>k.isSubColumn=!0)):L.rowSpan=n-L.level+1,g[L.level-1].push(L)}),g};function useUtils$1(e){const n=inject(TABLE_INJECTION_KEY),r=computed(()=>convertToRows(e.store.states.originColumns.value));return{isGroup:computed(()=>{const L=r.value.length>1;return L&&n&&(n.state.isGroup.value=!0),L}),toggleAllSelection:L=>{L.stopPropagation(),n?.store.commit("toggleAllSelection")},columnRows:r}}var TableHeader=defineComponent({name:"ElTableHeader",components:{ElCheckbox},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:n}){const r=getCurrentInstance(),g=inject(TABLE_INJECTION_KEY),$=useNamespace("table"),L=ref({}),{onColumnsChange:k,onScrollableChange:oe}=useLayoutObserver(g);onMounted(async()=>{await nextTick(),await nextTick();const{prop:Ve,order:he}=e.defaultSort;g?.store.commit("sort",{prop:Ve,order:he,init:!0})});const{handleHeaderClick:re,handleHeaderContextMenu:ae,handleMouseDown:le,handleMouseMove:ue,handleMouseOut:pe,handleSortClick:de,handleFilterClick:Fe}=useEvent(e,n),{getHeaderRowStyle:ze,getHeaderRowClass:Ce,getHeaderCellStyle:Ie,getHeaderCellClass:_e}=useStyle$2(e),{isGroup:At,toggleAllSelection:qe,columnRows:xe}=useUtils$1(e);return r.state={onColumnsChange:k,onScrollableChange:oe},r.filterPanels=L,{ns:$,filterPanels:L,onColumnsChange:k,onScrollableChange:oe,columnRows:xe,getHeaderRowClass:Ce,getHeaderRowStyle:ze,getHeaderCellClass:_e,getHeaderCellStyle:Ie,handleHeaderClick:re,handleHeaderContextMenu:ae,handleMouseDown:le,handleMouseMove:ue,handleMouseOut:pe,handleSortClick:de,handleFilterClick:Fe,isGroup:At,toggleAllSelection:qe}},render(){const{ns:e,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:$,getHeaderRowClass:L,getHeaderRowStyle:k,handleHeaderClick:oe,handleHeaderContextMenu:re,handleMouseDown:ae,handleMouseMove:le,handleSortClick:ue,handleMouseOut:pe,store:de,$parent:Fe}=this;let ze=1;return h$2("thead",{class:{[e.is("group")]:n}},r.map((Ce,Ie)=>h$2("tr",{class:L(Ie),key:Ie,style:k(Ie)},Ce.map((_e,At)=>(_e.rowSpan>ze&&(ze=_e.rowSpan),h$2("th",{class:$(Ie,At,Ce,_e),colspan:_e.colSpan,key:`${_e.id}-thead`,rowspan:_e.rowSpan,style:g(Ie,At,Ce,_e),onClick:qe=>oe(qe,_e),onContextmenu:qe=>re(qe,_e),onMousedown:qe=>ae(qe,_e),onMousemove:qe=>le(qe,_e),onMouseout:pe},[h$2("div",{class:["cell",_e.filteredValue&&_e.filteredValue.length>0?"highlight":"",_e.labelClassName]},[_e.renderHeader?_e.renderHeader({column:_e,$index:At,store:de,_self:Fe}):_e.label,_e.sortable&&h$2("span",{onClick:qe=>ue(qe,_e),class:"caret-wrapper"},[h$2("i",{onClick:qe=>ue(qe,_e,"ascending"),class:"sort-caret ascending"}),h$2("i",{onClick:qe=>ue(qe,_e,"descending"),class:"sort-caret descending"})]),_e.filterable&&h$2(FilterPanel,{store:de,placement:_e.filterPlacement||"bottom-start",column:_e,upDataColumn:(qe,xe)=>{_e[qe]=xe}})])]))))))}});function useEvents(e){const n=inject(TABLE_INJECTION_KEY),r=ref(""),g=ref(h$2("div")),$=(pe,de,Fe)=>{var ze;const Ce=n,Ie=getCell(pe);let _e;const At=(ze=Ce?.vnode.el)==null?void 0:ze.dataset.prefix;Ie&&(_e=getColumnByCell({columns:e.store.states.columns.value},Ie,At),_e&&Ce?.emit(`cell-${Fe}`,de,_e,Ie,pe)),Ce?.emit(`row-${Fe}`,de,_e,pe)},L=(pe,de)=>{$(pe,de,"dblclick")},k=(pe,de)=>{e.store.commit("setCurrentRow",de),$(pe,de,"click")},oe=(pe,de)=>{$(pe,de,"contextmenu")},re=debounce(pe=>{e.store.commit("setHoverRow",pe)},30),ae=debounce(()=>{e.store.commit("setHoverRow",null)},30);return{handleDoubleClick:L,handleClick:k,handleContextMenu:oe,handleMouseEnter:re,handleMouseLeave:ae,handleCellMouseEnter:(pe,de)=>{var Fe;const ze=n,Ce=getCell(pe),Ie=(Fe=ze?.vnode.el)==null?void 0:Fe.dataset.prefix;if(Ce){const Ve=getColumnByCell({columns:e.store.states.columns.value},Ce,Ie),he=ze.hoverState={cell:Ce,column:Ve,row:de};ze?.emit("cell-mouse-enter",he.row,he.column,he.cell,pe)}const _e=pe.target.querySelector(".cell");if(!(hasClass(_e,`${Ie}-tooltip`)&&_e.childNodes.length))return;const At=document.createRange();At.setStart(_e,0),At.setEnd(_e,_e.childNodes.length);const qe=At.getBoundingClientRect().width,xe=(Number.parseInt(getStyle(_e,"paddingLeft"),10)||0)+(Number.parseInt(getStyle(_e,"paddingRight"),10)||0);(qe+xe>_e.offsetWidth||_e.scrollWidth>_e.offsetWidth)&&createTablePopper(n?.refs.tableWrapper,Ce,Ce.innerText||Ce.textContent,{placement:"top",strategy:"fixed"},de.tooltipEffect)},handleCellMouseLeave:pe=>{if(!getCell(pe))return;const Fe=n?.hoverState;n?.emit("cell-mouse-leave",Fe?.row,Fe?.column,Fe?.cell,pe)},tooltipContent:r,tooltipTrigger:g}}function useStyles$1(e){const n=inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getRowStyle:(ae,le)=>{const ue=n?.props.rowStyle;return typeof ue=="function"?ue.call(null,{row:ae,rowIndex:le}):ue||null},getRowClass:(ae,le)=>{const ue=[r.e("row")];n?.props.highlightCurrentRow&&ae===e.store.states.currentRow.value&&ue.push("current-row"),e.stripe&&le%2===1&&ue.push(r.em("row","striped"));const pe=n?.props.rowClassName;return typeof pe=="string"?ue.push(pe):typeof pe=="function"&&ue.push(pe.call(null,{row:ae,rowIndex:le})),ue},getCellStyle:(ae,le,ue,pe)=>{const de=n?.props.cellStyle;let Fe=de??{};typeof de=="function"&&(Fe=de.call(null,{rowIndex:ae,columnIndex:le,row:ue,column:pe}));const ze=pe.isSubColumn?null:getFixedColumnOffset(le,e?.fixed,e.store);return ensurePosition(ze,"left"),ensurePosition(ze,"right"),Object.assign({},Fe,ze)},getCellClass:(ae,le,ue,pe)=>{const de=pe.isSubColumn?[]:getFixedColumnsClass(r.b(),le,e?.fixed,e.store),Fe=[pe.id,pe.align,pe.className,...de],ze=n?.props.cellClassName;return typeof ze=="string"?Fe.push(ze):typeof ze=="function"&&Fe.push(ze.call(null,{rowIndex:ae,columnIndex:le,row:ue,column:pe})),Fe.push(r.e("cell")),Fe.filter(Ce=>Boolean(Ce)).join(" ")},getSpan:(ae,le,ue,pe)=>{let de=1,Fe=1;const ze=n?.props.spanMethod;if(typeof ze=="function"){const Ce=ze({row:ae,column:le,rowIndex:ue,columnIndex:pe});Array.isArray(Ce)?(de=Ce[0],Fe=Ce[1]):typeof Ce=="object"&&(de=Ce.rowspan,Fe=Ce.colspan)}return{rowspan:de,colspan:Fe}},getColspanRealWidth:(ae,le,ue)=>{if(le<1)return ae[ue].realWidth;const pe=ae.map(({realWidth:de,width:Fe})=>de||Fe).slice(ue,ue+le);return Number(pe.reduce((de,Fe)=>Number(de)+Number(Fe),-1))}}}function useRender$1(e){const n=inject(TABLE_INJECTION_KEY),r=useNamespace("table"),{handleDoubleClick:g,handleClick:$,handleContextMenu:L,handleMouseEnter:k,handleMouseLeave:oe,handleCellMouseEnter:re,handleCellMouseLeave:ae,tooltipContent:le,tooltipTrigger:ue}=useEvents(e),{getRowStyle:pe,getRowClass:de,getCellStyle:Fe,getCellClass:ze,getSpan:Ce,getColspanRealWidth:Ie}=useStyles$1(e),_e=computed(()=>e.store.states.columns.value.findIndex(({type:he})=>he==="default")),At=(he,Oe)=>{const $e=n.props.rowKey;return $e?getRowIdentity(he,$e):Oe},qe=(he,Oe,$e,Ne=!1)=>{const{tooltipEffect:Ue,store:kt}=e,{indent:Et,columns:Pt}=kt.states,Lt=de(he,Oe);let vn=!0;return $e&&(Lt.push(r.em("row",`level-${$e.level}`)),vn=$e.display),h$2("tr",{style:[vn?null:{display:"none"},pe(he,Oe)],class:Lt,key:At(he,Oe),onDblclick:Dt=>g(Dt,he),onClick:Dt=>$(Dt,he),onContextmenu:Dt=>L(Dt,he),onMouseenter:()=>k(Oe),onMouseleave:oe},Pt.value.map((Dt,jt)=>{const{rowspan:bn,colspan:Sn}=Ce(he,Dt,Oe,jt);if(!bn||!Sn)return null;const Cn={...Dt};Cn.realWidth=Ie(Pt.value,Sn,jt);const On={store:e.store,_self:e.context||n,column:Cn,row:he,$index:Oe,cellIndex:jt,expanded:Ne};jt===_e.value&&$e&&(On.treeNode={indent:$e.level*Et.value,level:$e.level},typeof $e.expanded=="boolean"&&(On.treeNode.expanded=$e.expanded,"loading"in $e&&(On.treeNode.loading=$e.loading),"noLazyChildren"in $e&&(On.treeNode.noLazyChildren=$e.noLazyChildren)));const En=`${Oe},${jt}`,An=Cn.columnKey||Cn.rawColumnKey||"",In=xe(jt,Dt,On);return h$2("td",{style:Fe(Oe,jt,he,Dt),class:ze(Oe,jt,he,Dt),key:`${An}${En}`,rowspan:bn,colspan:Sn,onMouseenter:$n=>re($n,{...he,tooltipEffect:Ue}),onMouseleave:ae},[In])}))},xe=(he,Oe,$e)=>Oe.renderCell($e);return{wrappedRowRender:(he,Oe)=>{const $e=e.store,{isRowExpanded:Ne,assertRowKey:Ue}=$e,{treeData:kt,lazyTreeNodeMap:Et,childrenColumnName:Pt,rowKey:Lt}=$e.states,vn=$e.states.columns.value;if(vn.some(({type:Dt})=>Dt==="expand")){const Dt=Ne(he),jt=qe(he,Oe,void 0,Dt),bn=n.renderExpanded;return Dt?bn?[[jt,h$2("tr",{key:`expanded-row__${jt.key}`},[h$2("td",{colspan:vn.length,class:"el-table__cell el-table__expanded-cell"},[bn({row:he,$index:Oe,store:$e,expanded:Dt})])])]]:(console.error("[Element Error]renderExpanded is required."),jt):[[jt]]}else if(Object.keys(kt.value).length){Ue();const Dt=getRowIdentity(he,Lt.value);let jt=kt.value[Dt],bn=null;jt&&(bn={expanded:jt.expanded,level:jt.level,display:!0},typeof jt.lazy=="boolean"&&(typeof jt.loaded=="boolean"&&jt.loaded&&(bn.noLazyChildren=!(jt.children&&jt.children.length)),bn.loading=jt.loading));const Sn=[qe(he,Oe,bn)];if(jt){let Cn=0;const On=(An,In)=>{!(An&&An.length&&In)||An.forEach($n=>{const Pn={display:In.display&&In.expanded,level:In.level+1,expanded:!1,noLazyChildren:!1,loading:!1},Dn=getRowIdentity($n,Lt.value);if(Dn==null)throw new Error("For nested data item, row-key is required.");if(jt={...kt.value[Dn]},jt&&(Pn.expanded=jt.expanded,jt.level=jt.level||Pn.level,jt.display=!!(jt.expanded&&Pn.display),typeof jt.lazy=="boolean"&&(typeof jt.loaded=="boolean"&&jt.loaded&&(Pn.noLazyChildren=!(jt.children&&jt.children.length)),Pn.loading=jt.loading)),Cn++,Sn.push(qe($n,Oe+Cn,Pn)),jt){const Mn=Et.value[Dn]||$n[Pt.value];On(Mn,jt)}})};jt.display=!0;const En=Et.value[Dt]||he[Pt.value];On(En,jt)}return Sn}else return qe(he,Oe,void 0)},tooltipContent:le,tooltipTrigger:ue}}const defaultProps$2={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var TableBody=defineComponent({name:"ElTableBody",props:defaultProps$2,setup(e){const n=getCurrentInstance(),r=inject(TABLE_INJECTION_KEY),g=useNamespace("table"),{wrappedRowRender:$,tooltipContent:L,tooltipTrigger:k}=useRender$1(e),{onColumnsChange:oe,onScrollableChange:re}=useLayoutObserver(r);return watch(e.store.states.hoverRow,(ae,le)=>{if(!e.store.states.isComplex.value||!isClient)return;let ue=window.requestAnimationFrame;ue||(ue=pe=>window.setTimeout(pe,16)),ue(()=>{var pe;const de=(pe=n?.vnode.el)==null?void 0:pe.querySelectorAll(`.${g.e("row")}`),Fe=de[le],ze=de[ae];Fe&&removeClass(Fe,"hover-row"),ze&&addClass(ze,"hover-row")})}),onUnmounted(()=>{var ae;(ae=removePopper)==null||ae()}),onUpdated(()=>{var ae;(ae=removePopper)==null||ae()}),{ns:g,onColumnsChange:oe,onScrollableChange:re,wrappedRowRender:$,tooltipContent:L,tooltipTrigger:k}},render(){const{wrappedRowRender:e,store:n}=this,r=n.states.data.value||[];return h$2("tbody",{},[r.reduce((g,$)=>g.concat(e($,g.length)),[])])}});function hColgroup(e){const n=e.tableLayout==="auto";let r=e.columns||[];n&&r.every($=>$.width===void 0)&&(r=[]);const g=$=>{const L={key:`${e.tableLayout}_${$.id}`,style:{},name:void 0};return n?L.style={width:`${$.width}px`}:L.name=$.id,L};return h$2("colgroup",{},r.map($=>h$2("col",g($))))}hColgroup.props=["columns","tableLayout"];function useMapState(){const e=inject(TABLE_INJECTION_KEY),n=e?.store,r=computed(()=>n.states.fixedLeafColumnsLength.value),g=computed(()=>n.states.rightFixedColumns.value.length),$=computed(()=>n.states.columns.value.length),L=computed(()=>n.states.fixedColumns.value.length),k=computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:$,leftFixedCount:L,rightFixedCount:k,columns:n.states.columns}}function useStyle$1(e){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(L,k)=>{const oe=L[k],re=[r.e("cell"),oe.id,oe.align,oe.labelClassName,...getFixedColumnsClass(r.b(),k,oe.fixed,e.store)];return oe.className&&re.push(oe.className),oe.children||re.push(r.is("leaf")),re},getCellStyles:(L,k)=>{const oe=getFixedColumnOffset(k,L.fixed,e.store);return ensurePosition(oe,"left"),ensurePosition(oe,"right"),oe},columns:n}}var TableFooter=defineComponent({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:n,getCellStyles:r,columns:g}=useStyle$1(e);return{ns:useNamespace("table"),getCellClasses:n,getCellStyles:r,columns:g}},render(){const{columns:e,getCellStyles:n,getCellClasses:r,summaryMethod:g,sumText:$,ns:L}=this,k=this.store.states.data.value;let oe=[];return g?oe=g({columns:e,data:k}):e.forEach((re,ae)=>{if(ae===0){oe[ae]=$;return}const le=k.map(Fe=>Number(Fe[re.property])),ue=[];let pe=!0;le.forEach(Fe=>{if(!Number.isNaN(+Fe)){pe=!1;const ze=`${Fe}`.split(".")[1];ue.push(ze?ze.length:0)}});const de=Math.max.apply(null,ue);pe?oe[ae]="":oe[ae]=le.reduce((Fe,ze)=>{const Ce=Number(ze);return Number.isNaN(+Ce)?Fe:Number.parseFloat((Fe+ze).toFixed(Math.min(de,20)))},0)}),h$2("table",{class:L.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:e}),h$2("tbody",[h$2("tr",{},[...e.map((re,ae)=>h$2("td",{key:ae,colspan:re.colSpan,rowspan:re.rowSpan,class:r(e,ae),style:n(re,ae)},[h$2("div",{class:["cell",re.labelClassName]},[oe[ae]])]))])])])}});function useUtils(e){return{setCurrentRow:le=>{e.commit("setCurrentRow",le)},getSelectionRows:()=>e.getSelectionRows(),toggleRowSelection:(le,ue)=>{e.toggleRowSelection(le,ue,!1),e.updateAllSelected()},clearSelection:()=>{e.clearSelection()},clearFilter:le=>{e.clearFilter(le)},toggleAllSelection:()=>{e.commit("toggleAllSelection")},toggleRowExpansion:(le,ue)=>{e.toggleRowExpansionAdapter(le,ue)},clearSort:()=>{e.clearSort()},sort:(le,ue)=>{e.commit("sort",{prop:le,order:ue})}}}function useStyle(e,n,r,g){const $=ref(!1),L=ref(null),k=ref(!1),oe=Dt=>{k.value=Dt},re=ref({width:null,height:null,headerHeight:null}),ae=ref(!1),le={display:"inline-block",verticalAlign:"middle"},ue=ref(),pe=ref(0),de=ref(0),Fe=ref(0),ze=ref(0);watchEffect(()=>{n.setHeight(e.height)}),watchEffect(()=>{n.setMaxHeight(e.maxHeight)}),watch(()=>[e.currentRowKey,r.states.rowKey],([Dt,jt])=>{!unref(jt)||r.setCurrentRowKey(`${Dt}`)},{immediate:!0}),watch(()=>e.data,Dt=>{g.store.commit("setData",Dt)},{immediate:!0,deep:!0}),watchEffect(()=>{e.expandRowKeys&&r.setExpandRowKeysAdapter(e.expandRowKeys)});const Ce=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},Ie=(Dt,jt)=>{const{pixelX:bn,pixelY:Sn}=jt;Math.abs(bn)>=Math.abs(Sn)&&(g.refs.bodyWrapper.scrollLeft+=jt.pixelX/5)},_e=computed(()=>e.height||e.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),At=computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),qe=()=>{_e.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Oe)};onMounted(async()=>{await nextTick(),r.updateColumns(),$e(),requestAnimationFrame(qe);const Dt=g.vnode.el,jt=g.refs.headerWrapper;e.flexible&&Dt&&Dt.parentElement&&(Dt.parentElement.style.minWidth="0"),re.value={width:ue.value=Dt.offsetWidth,height:Dt.offsetHeight,headerHeight:e.showHeader&&jt?jt.offsetHeight:null},r.states.columns.value.forEach(bn=>{bn.filteredValue&&bn.filteredValue.length&&g.store.commit("filterChange",{column:bn,values:bn.filteredValue,silent:!0})}),g.$ready=!0});const xe=(Dt,jt)=>{if(!Dt)return;const bn=Array.from(Dt.classList).filter(Sn=>!Sn.startsWith("is-scrolling-"));bn.push(n.scrollX.value?jt:"is-scrolling-none"),Dt.className=bn.join(" ")},Ve=Dt=>{const{tableWrapper:jt}=g.refs;xe(jt,Dt)},he=Dt=>{const{tableWrapper:jt}=g.refs;return!!(jt&&jt.classList.contains(Dt))},Oe=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const An="is-scrolling-none";he(An)||Ve(An);return}const Dt=g.refs.scrollBarRef.wrap$;if(!Dt)return;const{scrollLeft:jt,offsetWidth:bn,scrollWidth:Sn}=Dt,{headerWrapper:Cn,footerWrapper:On}=g.refs;Cn&&(Cn.scrollLeft=jt),On&&(On.scrollLeft=jt);const En=Sn-bn-1;jt>=En?Ve("is-scrolling-right"):Ve(jt===0?"is-scrolling-left":"is-scrolling-middle")},$e=()=>{!g.refs.scrollBarRef||(g.refs.scrollBarRef.wrap$&&useEventListener(g.refs.scrollBarRef.wrap$,"scroll",Oe,{passive:!0}),e.fit?useResizeObserver(g.vnode.el,Ne):useEventListener(window,"resize",Ne))},Ne=()=>{var Dt,jt,bn;const Sn=g.vnode.el;if(!g.$ready||!Sn)return;let Cn=!1;const{width:On,height:En,headerHeight:An}=re.value,In=ue.value=Sn.offsetWidth;On!==In&&(Cn=!0);const $n=Sn.offsetHeight;(e.height||_e.value)&&En!==$n&&(Cn=!0);const Pn=e.tableLayout==="fixed"?g.refs.headerWrapper:(Dt=g.refs.tableHeaderRef)==null?void 0:Dt.$el;e.showHeader&&Pn?.offsetHeight!==An&&(Cn=!0),pe.value=((jt=g.refs.tableWrapper)==null?void 0:jt.scrollHeight)||0,Fe.value=Pn?.scrollHeight||0,ze.value=((bn=g.refs.footerWrapper)==null?void 0:bn.scrollHeight)||0,de.value=pe.value-Fe.value-ze.value,Cn&&(re.value={width:In,height:$n,headerHeight:e.showHeader&&Pn?.offsetHeight||0},qe())},Ue=useSize(),kt=computed(()=>{const{bodyWidth:Dt,scrollY:jt,gutterWidth:bn}=n;return Dt.value?`${Dt.value-(jt.value?bn:0)}px`:""}),Et=computed(()=>e.maxHeight?"fixed":e.tableLayout),Pt=computed(()=>{if(e.data&&e.data.length)return null;let Dt="100%";de.value&&(Dt=`${de.value}px`);const jt=ue.value;return{width:jt?`${jt}px`:"",height:Dt}}),Lt=computed(()=>e.height?{height:Number.isNaN(Number(e.height))?e.height:`${e.height}px`}:e.maxHeight?{maxHeight:Number.isNaN(Number(e.maxHeight))?e.maxHeight:`${e.maxHeight}px`}:{}),vn=computed(()=>{var Dt,jt;if(e.height)return{height:"100%"};if(e.maxHeight){if(Number.isNaN(Number(e.maxHeight)))return{maxHeight:`calc(${e.maxHeight} - ${Fe.value+ze.value}px)`};{const bn=((Dt=g.refs.headerWrapper)==null?void 0:Dt.scrollHeight)||0,Sn=((jt=g.refs.footerWrapper)==null?void 0:jt.scrollHeight)||0,Cn=e.maxHeight;if(pe.value>=Number(Cn))return{maxHeight:`${pe.value-bn-Sn}px`}}}return{}});return{isHidden:$,renderExpanded:L,setDragVisible:oe,isGroup:ae,handleMouseLeave:Ce,handleHeaderFooterMousewheel:Ie,tableSize:Ue,emptyBlockStyle:Pt,handleFixedMousewheel:(Dt,jt)=>{const bn=g.refs.bodyWrapper;if(Math.abs(jt.spinY)>0){const Sn=bn.scrollTop;jt.pixelY<0&&Sn!==0&&Dt.preventDefault(),jt.pixelY>0&&bn.scrollHeight-bn.clientHeight>Sn&&Dt.preventDefault(),bn.scrollTop+=Math.ceil(jt.pixelY/5)}else bn.scrollLeft+=Math.ceil(jt.pixelX/5)},resizeProxyVisible:k,bodyWidth:kt,resizeState:re,doLayout:qe,tableBodyStyles:At,tableLayout:Et,scrollbarViewStyle:le,tableInnerStyle:Lt,scrollbarStyle:vn}}var defaultProps$1={data:{type:Array,default:()=>[]},size:String,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean};const useScrollbar$1=()=>{const e=ref(),n=(L,k)=>{const oe=e.value;oe&&oe.scrollTo(L,k)},r=(L,k)=>{const oe=e.value;oe&&isNumber(k)&&["Top","Left"].includes(L)&&oe[`setScroll${L}`](k)};return{scrollBarRef:e,scrollTo:n,setScrollTop:L=>r("Top",L),setScrollLeft:L=>r("Left",L)}};let tableIdSeed=1;const _sfc_main$V=defineComponent({name:"ElTable",directives:{Mousewheel},components:{TableHeader,TableBody,TableFooter,ElScrollbar,hColgroup},props:defaultProps$1,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t:n}=useLocale(),r=useNamespace("table"),g=getCurrentInstance();provide(TABLE_INJECTION_KEY,g);const $=createStore(g,e);g.store=$;const L=new TableLayout$1({store:g.store,table:g,fit:e.fit,showHeader:e.showHeader});g.layout=L;const k=computed(()=>($.states.data.value||[]).length===0),{setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:ae,clearSelection:le,clearFilter:ue,toggleAllSelection:pe,toggleRowExpansion:de,clearSort:Fe,sort:ze}=useUtils($),{isHidden:Ce,renderExpanded:Ie,setDragVisible:_e,isGroup:At,handleMouseLeave:qe,handleHeaderFooterMousewheel:xe,tableSize:Ve,emptyBlockStyle:he,handleFixedMousewheel:Oe,resizeProxyVisible:$e,bodyWidth:Ne,resizeState:Ue,doLayout:kt,tableBodyStyles:Et,tableLayout:Pt,scrollbarViewStyle:Lt,tableInnerStyle:vn,scrollbarStyle:hn}=useStyle(e,L,$,g),{scrollBarRef:Dt,scrollTo:jt,setScrollLeft:bn,setScrollTop:Sn}=useScrollbar$1(),Cn=debounce(kt,50),On=`el-table_${tableIdSeed++}`;g.tableId=On,g.state={isGroup:At,resizeState:Ue,doLayout:kt,debouncedUpdateLayout:Cn};const En=computed(()=>e.sumText||n("el.table.sumText")),An=computed(()=>e.emptyText||n("el.table.emptyText"));return{ns:r,layout:L,store:$,handleHeaderFooterMousewheel:xe,handleMouseLeave:qe,tableId:On,tableSize:Ve,isHidden:Ce,isEmpty:k,renderExpanded:Ie,resizeProxyVisible:$e,resizeState:Ue,isGroup:At,bodyWidth:Ne,tableBodyStyles:Et,emptyBlockStyle:he,debouncedUpdateLayout:Cn,handleFixedMousewheel:Oe,setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:ae,clearSelection:le,clearFilter:ue,toggleAllSelection:pe,toggleRowExpansion:de,clearSort:Fe,doLayout:kt,sort:ze,t:n,setDragVisible:_e,context:g,computedSumText:En,computedEmptyText:An,tableLayout:Pt,scrollbarViewStyle:Lt,tableInnerStyle:vn,scrollbarStyle:hn,scrollBarRef:Dt,scrollTo:jt,setScrollLeft:bn,setScrollTop:Sn}}}),_hoisted_1$H=["data-prefix"],_hoisted_2$x={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$C(e,n,r,g,$,L){const k=resolveComponent("hColgroup"),oe=resolveComponent("table-header"),re=resolveComponent("table-body"),ae=resolveComponent("el-scrollbar"),le=resolveComponent("table-footer"),ue=resolveDirective("mousewheel");return openBlock(),createElementBlock("div",{ref:"tableWrapper",class:normalizeClass([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:normalizeStyle(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:n[0]||(n[0]=pe=>e.handleMouseLeave())},[createBaseVNode("div",{class:normalizeClass(e.ns.e("inner-wrapper")),style:normalizeStyle(e.tableInnerStyle)},[createBaseVNode("div",_hoisted_2$x,[renderSlot(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?withDirectives((openBlock(),createElementBlock("div",{key:0,ref:"headerWrapper",class:normalizeClass(e.ns.e("header-wrapper"))},[createBaseVNode("table",{ref:"tableHeader",class:normalizeClass(e.ns.e("header")),style:normalizeStyle(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[createVNode(k,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),createVNode(oe,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[ue,e.handleHeaderFooterMousewheel]]):createCommentVNode("v-if",!0),createBaseVNode("div",{ref:"bodyWrapper",class:normalizeClass(e.ns.e("body-wrapper"))},[createVNode(ae,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn},{default:withCtx(()=>[createBaseVNode("table",{ref:"tableBody",class:normalizeClass(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:normalizeStyle({width:e.bodyWidth,tableLayout:e.tableLayout})},[createVNode(k,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(openBlock(),createBlock(oe,{key:0,ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):createCommentVNode("v-if",!0),createVNode(re,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","row-style","store","stripe"])],6),e.isEmpty?(openBlock(),createElementBlock("div",{key:0,ref:"emptyBlock",style:normalizeStyle(e.emptyBlockStyle),class:normalizeClass(e.ns.e("empty-block"))},[createBaseVNode("span",{class:normalizeClass(e.ns.e("empty-text"))},[renderSlot(e.$slots,"empty",{},()=>[createTextVNode(toDisplayString(e.computedEmptyText),1)])],2)],6)):createCommentVNode("v-if",!0),e.$slots.append?(openBlock(),createElementBlock("div",{key:1,ref:"appendWrapper",class:normalizeClass(e.ns.e("append-wrapper"))},[renderSlot(e.$slots,"append")],2)):createCommentVNode("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),e.showSummary?withDirectives((openBlock(),createElementBlock("div",{key:1,ref:"footerWrapper",class:normalizeClass(e.ns.e("footer-wrapper"))},[createVNode(le,{border:e.border,"default-sort":e.defaultSort,store:e.store,style:normalizeStyle(e.tableBodyStyles),"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[vShow,!e.isEmpty],[ue,e.handleHeaderFooterMousewheel]]):createCommentVNode("v-if",!0),e.border||e.isGroup?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(e.ns.e("border-left-patch"))},null,2)):createCommentVNode("v-if",!0)],6),withDirectives(createBaseVNode("div",{ref:"resizeProxy",class:normalizeClass(e.ns.e("column-resize-proxy"))},null,2),[[vShow,e.resizeProxyVisible]])],46,_hoisted_1$H)}var Table=_export_sfc$2(_sfc_main$V,[["render",_sfc_render$C],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const defaultClassNames={selection:"table-column--selection",expand:"table__expand-column"},cellStarts={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},getDefaultClassName=e=>defaultClassNames[e]||"",cellForced={selection:{renderHeader({store:e}){function n(){return e.states.data.value&&e.states.data.value.length===0}return h$2(ElCheckbox,{disabled:n(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value})},renderCell({row:e,column:n,store:r,$index:g}){return h$2(ElCheckbox,{disabled:n.selectable?!n.selectable.call(null,e,g):!1,size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",e)},onClick:$=>$.stopPropagation(),modelValue:r.isSelected(e)})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:n}){let r=n+1;const g=e.index;return typeof g=="number"?r=n+g:typeof g=="function"&&(r=g(n)),h$2("div",{},[r])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:n,expanded:r}){const{ns:g}=n,$=[g.e("expand-icon")];return r&&$.push(g.em("expand-icon","expanded")),h$2("div",{class:$,onClick:function(k){k.stopPropagation(),n.toggleRowExpansion(e)}},{default:()=>[h$2(ElIcon,null,{default:()=>[h$2(arrow_right_default)]})]})},sortable:!1,resizable:!1}};function defaultRenderCell({row:e,column:n,$index:r}){var g;const $=n.property,L=$&&getProp(e,$).value;return n&&n.formatter?n.formatter(e,n,L,r):((g=L?.toString)==null?void 0:g.call(L))||""}function treeCellPrefix({row:e,treeNode:n,store:r},g=!1){const{ns:$}=r;if(!n)return g?[h$2("span",{class:$.e("placeholder")})]:null;const L=[],k=function(oe){oe.stopPropagation(),r.loadOrToggle(e)};if(n.indent&&L.push(h$2("span",{class:$.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const oe=[$.e("expand-icon"),n.expanded?$.em("expand-icon","expanded"):""];let re=arrow_right_default;n.loading&&(re=loading_default),L.push(h$2("div",{class:oe,onClick:k},{default:()=>[h$2(ElIcon,{class:{[$.is("loading")]:n.loading}},{default:()=>[h$2(re)]})]}))}else L.push(h$2("span",{class:$.e("placeholder")}));return L}function getAllAliases(e,n){return e.reduce((r,g)=>(r[g]=g,r),n)}function useWatcher(e,n){const r=getCurrentInstance();return{registerComplexWatchers:()=>{const L=["fixed"],k={realWidth:"width",realMinWidth:"minWidth"},oe=getAllAliases(L,k);Object.keys(oe).forEach(re=>{const ae=k[re];hasOwn(n,ae)&&watch(()=>n[ae],le=>{let ue=le;ae==="width"&&re==="realWidth"&&(ue=parseWidth(le)),ae==="minWidth"&&re==="realMinWidth"&&(ue=parseMinWidth(le)),r.columnConfig.value[ae]=ue,r.columnConfig.value[re]=ue;const pe=ae==="fixed";e.value.store.scheduleLayout(pe)})})},registerNormalWatchers:()=>{const L=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],k={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},oe=getAllAliases(L,k);Object.keys(oe).forEach(re=>{const ae=k[re];hasOwn(n,ae)&&watch(()=>n[ae],le=>{r.columnConfig.value[re]=le})})}}}function useRender(e,n,r){const g=getCurrentInstance(),$=ref(""),L=ref(!1),k=ref(),oe=ref(),re=useNamespace("table");watchEffect(()=>{k.value=e.align?`is-${e.align}`:null,k.value}),watchEffect(()=>{oe.value=e.headerAlign?`is-${e.headerAlign}`:k.value,oe.value});const ae=computed(()=>{let At=g.vnode.vParent||g.parent;for(;At&&!At.tableId&&!At.columnId;)At=At.vnode.vParent||At.parent;return At}),le=computed(()=>{const{store:At}=g.parent;if(!At)return!1;const{treeData:qe}=At.states,xe=qe.value;return xe&&Object.keys(xe).length>0}),ue=ref(parseWidth(e.width)),pe=ref(parseMinWidth(e.minWidth)),de=At=>(ue.value&&(At.width=ue.value),pe.value&&(At.minWidth=pe.value),At.minWidth||(At.minWidth=80),At.realWidth=Number(At.width===void 0?At.minWidth:At.width),At),Fe=At=>{const qe=At.type,xe=cellForced[qe]||{};Object.keys(xe).forEach(he=>{const Oe=xe[he];he!=="className"&&Oe!==void 0&&(At[he]=Oe)});const Ve=getDefaultClassName(qe);if(Ve){const he=`${unref(re.namespace)}-${Ve}`;At.className=At.className?`${At.className} ${he}`:he}return At},ze=At=>{Array.isArray(At)?At.forEach(xe=>qe(xe)):qe(At);function qe(xe){var Ve;((Ve=xe?.type)==null?void 0:Ve.name)==="ElTableColumn"&&(xe.vParent=g)}};return{columnId:$,realAlign:k,isSubColumn:L,realHeaderAlign:oe,columnOrTableParent:ae,setColumnWidth:de,setColumnForcedProps:Fe,setColumnRenders:At=>{e.renderHeader||At.type!=="selection"&&(At.renderHeader=Ve=>{g.columnConfig.value.label;const he=n.header;return he?he(Ve):At.label});let qe=At.renderCell;const xe=le.value;return At.type==="expand"?(At.renderCell=Ve=>h$2("div",{class:"cell"},[qe(Ve)]),r.value.renderExpanded=Ve=>n.default?n.default(Ve):n.default):(qe=qe||defaultRenderCell,At.renderCell=Ve=>{let he=null;if(n.default){const Ue=n.default(Ve);he=Ue.some(kt=>kt.type!==Comment)?Ue:qe(Ve)}else he=qe(Ve);const Oe=xe&&Ve.cellIndex===0,$e=treeCellPrefix(Ve,Oe),Ne={class:"cell",style:{}};return At.showOverflowTooltip&&(Ne.class=`${Ne.class} ${unref(re.namespace)}-tooltip`,Ne.style={width:`${(Ve.column.realWidth||Number(Ve.column.width))-1}px`}),ze(he),h$2("div",Ne,[$e,he])}),At},getPropsData:(...At)=>At.reduce((qe,xe)=>(Array.isArray(xe)&&xe.forEach(Ve=>{qe[Ve]=e[Ve]}),qe),{}),getColumnElIndex:(At,qe)=>Array.prototype.indexOf.call(At,qe)}}var defaultProps={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showTooltipWhenOverflow:Boolean,showOverflowTooltip:Boolean,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(n=>["ascending","descending",null].includes(n))}};let columnIdSeed=1;var ElTableColumn$1=defineComponent({name:"ElTableColumn",components:{ElCheckbox},props:defaultProps,setup(e,{slots:n}){const r=getCurrentInstance(),g=ref({}),$=computed(()=>{let _e=r.parent;for(;_e&&!_e.tableId;)_e=_e.parent;return _e}),{registerNormalWatchers:L,registerComplexWatchers:k}=useWatcher($,e),{columnId:oe,isSubColumn:re,realHeaderAlign:ae,columnOrTableParent:le,setColumnWidth:ue,setColumnForcedProps:pe,setColumnRenders:de,getPropsData:Fe,getColumnElIndex:ze,realAlign:Ce}=useRender(e,n,$),Ie=le.value;oe.value=`${Ie.tableId||Ie.columnId}_column_${columnIdSeed++}`,onBeforeMount(()=>{re.value=$.value!==Ie;const _e=e.type||"default",At=e.sortable===""?!0:e.sortable,qe={...cellStarts[_e],id:oe.value,type:_e,property:e.prop||e.property,align:Ce,headerAlign:ae,showOverflowTooltip:e.showOverflowTooltip||e.showTooltipWhenOverflow,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:At,index:e.index,rawColumnKey:r.vnode.key};let $e=Fe(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);$e=mergeOptions$1(qe,$e),$e=compose(de,ue,pe)($e),g.value=$e,L(),k()}),onMounted(()=>{var _e;const At=le.value,qe=re.value?At.vnode.el.children:(_e=At.refs.hiddenColumns)==null?void 0:_e.children,xe=()=>ze(qe||[],r.vnode.el);g.value.getColumnIndex=xe,xe()>-1&&$.value.store.commit("insertColumn",g.value,re.value?At.columnConfig.value:null)}),onBeforeUnmount(()=>{$.value.store.commit("removeColumn",g.value,re.value?Ie.columnConfig.value:null)}),r.columnId=oe.value,r.columnConfig=g},render(){var e,n,r;try{const g=(n=(e=this.$slots).default)==null?void 0:n.call(e,{row:{},column:{},$index:-1}),$=[];if(Array.isArray(g))for(const k of g)((r=k.type)==null?void 0:r.name)==="ElTableColumn"||k.shapeFlag&2?$.push(k):k.type===Fragment&&Array.isArray(k.children)&&k.children.forEach(oe=>{oe?.patchFlag!==1024&&!isString$2(oe?.children)&&$.push(oe)});return h$2("div",$)}catch{return h$2("div",[])}}});const ElTable=withInstall(Table,{TableColumn:ElTableColumn$1}),ElTableColumn=withNoopInstall(ElTableColumn$1);var SortOrder=(e=>(e.ASC="asc",e.DESC="desc",e))(SortOrder||{}),Alignment=(e=>(e.CENTER="center",e.RIGHT="right",e))(Alignment||{}),FixedDir=(e=>(e.LEFT="left",e.RIGHT="right",e))(FixedDir||{});const oppositeOrderMap={asc:"desc",desc:"asc"},placeholderSign=Symbol("placeholder"),calcColumnStyle=(e,n,r)=>{var g;const $={flexGrow:0,flexShrink:0,...r?{}:{flexGrow:e.flexGrow||0,flexShrink:e.flexShrink||1}};r||($.flexShrink=1);const L={...(g=e.style)!=null?g:{},...$,flexBasis:"auto",width:e.width};return n||(e.maxWidth&&(L.maxWidth=e.maxWidth),e.minWidth&&(L.minWidth=e.minWidth)),L};function useColumns(e,n,r){const g=computed(()=>unref(n).filter(ze=>!ze.hidden)),$=computed(()=>unref(g).filter(ze=>ze.fixed==="left"||ze.fixed===!0)),L=computed(()=>unref(g).filter(ze=>ze.fixed==="right")),k=computed(()=>unref(g).filter(ze=>!ze.fixed)),oe=computed(()=>{const ze=[];return unref($).forEach(Ce=>{ze.push({...Ce,placeholderSign})}),unref(k).forEach(Ce=>{ze.push(Ce)}),unref(L).forEach(Ce=>{ze.push({...Ce,placeholderSign})}),ze}),re=computed(()=>unref($).length||unref(L).length),ae=computed(()=>unref(n).reduce((Ce,Ie)=>(Ce[Ie.key]=calcColumnStyle(Ie,unref(r),e.fixed),Ce),{})),le=computed(()=>unref(g).reduce((ze,Ce)=>ze+Ce.width,0)),ue=ze=>unref(n).find(Ce=>Ce.key===ze),pe=ze=>unref(ae)[ze],de=(ze,Ce)=>{ze.width=Ce};function Fe(ze){var Ce;const{key:Ie}=ze.currentTarget.dataset;if(!Ie)return;const{sortState:_e,sortBy:At}=e;let qe=SortOrder.ASC;isObject$4(_e)?qe=oppositeOrderMap[_e[Ie]]:qe=oppositeOrderMap[At.order],(Ce=e.onColumnSort)==null||Ce.call(e,{column:ue(Ie),key:Ie,order:qe})}return{columns:n,columnsStyles:ae,columnsTotalWidth:le,fixedColumnsOnLeft:$,fixedColumnsOnRight:L,hasFixedColumns:re,mainColumns:oe,normalColumns:k,visibleColumns:g,getColumn:ue,getColumnStyle:pe,updateColumnWidth:de,onColumnSorted:Fe}}const useScrollbar=(e,{mainTableRef:n,leftTableRef:r,rightTableRef:g,onMaybeEndReached:$})=>{const L=ref({scrollLeft:0,scrollTop:0});function k(de){var Fe,ze,Ce;const{scrollTop:Ie}=de;(Fe=n.value)==null||Fe.scrollTo(de),(ze=r.value)==null||ze.scrollToTop(Ie),(Ce=g.value)==null||Ce.scrollToTop(Ie)}function oe(de){L.value=de,k(de)}function re(de){L.value.scrollTop=de,k(unref(L))}function ae(de){var Fe,ze;L.value.scrollLeft=de,(ze=(Fe=n.value)==null?void 0:Fe.scrollTo)==null||ze.call(Fe,unref(L))}function le(de){var Fe;oe(de),(Fe=e.onScroll)==null||Fe.call(e,de)}function ue({scrollTop:de}){const{scrollTop:Fe}=unref(L);de!==Fe&&re(de)}function pe(de,Fe="auto"){var ze;(ze=n.value)==null||ze.scrollToRow(de,Fe)}return watch(()=>unref(L).scrollTop,(de,Fe)=>{de>Fe&&$()}),{scrollPos:L,scrollTo:oe,scrollToLeft:ae,scrollToTop:re,scrollToRow:pe,onScroll:le,onVerticalScroll:ue}},useRow=(e,{mainTableRef:n,leftTableRef:r,rightTableRef:g,onMaybeEndReached:$})=>{const L=getCurrentInstance(),{emit:k}=L,oe=shallowRef(!1),re=shallowRef(null),ae=ref(e.defaultExpandedRowKeys||[]),le=ref(-1),ue=shallowRef(null),pe=ref({}),de=ref({}),Fe=shallowRef({}),ze=shallowRef({}),Ce=shallowRef({}),Ie=computed(()=>isNumber(e.estimatedRowHeight));function _e($e){var Ne;(Ne=e.onRowsRendered)==null||Ne.call(e,$e),$e.rowCacheEnd>unref(le)&&(le.value=$e.rowCacheEnd)}function At({hovered:$e,rowKey:Ne}){re.value=$e?Ne:null}function qe({expanded:$e,rowData:Ne,rowIndex:Ue,rowKey:kt}){var Et,Pt;const Lt=[...unref(ae)],vn=Lt.indexOf(kt);$e?vn===-1&&Lt.push(kt):vn>-1&&Lt.splice(vn,1),ae.value=Lt,k("update:expandedRowKeys",Lt),(Et=e.onRowExpand)==null||Et.call(e,{expanded:$e,rowData:Ne,rowIndex:Ue,rowKey:kt}),(Pt=e.onExpandedRowsChange)==null||Pt.call(e,Lt)}const xe=debounce(()=>{var $e,Ne,Ue,kt;oe.value=!0,pe.value={...unref(pe),...unref(de)},Ve(unref(ue),!1),de.value={},ue.value=null,($e=n.value)==null||$e.forceUpdate(),(Ne=r.value)==null||Ne.forceUpdate(),(Ue=g.value)==null||Ue.forceUpdate(),(kt=L.proxy)==null||kt.$forceUpdate(),oe.value=!1},0);function Ve($e,Ne=!1){!unref(Ie)||[n,r,g].forEach(Ue=>{const kt=unref(Ue);kt&&kt.resetAfterRowIndex($e,Ne)})}function he($e,Ne,Ue){const kt=unref(ue);(kt===null||kt>Ue)&&(ue.value=Ue),de.value[$e]=Ne}function Oe({rowKey:$e,height:Ne,rowIndex:Ue},kt){kt?kt===FixedDir.RIGHT?Ce.value[$e]=Ne:Fe.value[$e]=Ne:ze.value[$e]=Ne;const Et=Math.max(...[Fe,Ce,ze].map(Pt=>Pt.value[$e]||0));unref(pe)[$e]!==Et&&(he($e,Et,Ue),xe())}return watch(le,()=>$()),{hoveringRowKey:re,expandedRowKeys:ae,lastRenderedRowIndex:le,isDynamic:Ie,isResetting:oe,rowHeights:pe,resetAfterIndex:Ve,onRowExpanded:qe,onRowHovered:At,onRowsRendered:_e,onRowHeightChange:Oe}},useData=(e,{expandedRowKeys:n,lastRenderedRowIndex:r,resetAfterIndex:g})=>{const $=ref({}),L=computed(()=>{const oe={},{data:re,rowKey:ae}=e,le=unref(n);if(!le||!le.length)return re;const ue=[],pe=new Set;le.forEach(Fe=>pe.add(Fe));let de=re.slice();for(de.forEach(Fe=>oe[Fe[ae]]=0);de.length>0;){const Fe=de.shift();ue.push(Fe),pe.has(Fe[ae])&&Array.isArray(Fe.children)&&Fe.children.length>0&&(de=[...Fe.children,...de],Fe.children.forEach(ze=>oe[ze[ae]]=oe[Fe[ae]]+1))}return $.value=oe,ue}),k=computed(()=>{const{data:oe,expandColumnKey:re}=e;return re?unref(L):oe});return watch(k,(oe,re)=>{oe!==re&&(r.value=-1,g(0,!0))}),{data:k,depthMap:$}},sumReducer=(e,n)=>e+n,sum=e=>isArray$4(e)?e.reduce(sumReducer,0):e,tryCall=(e,n,r={})=>isFunction$1(e)?e(n):e??r,enforceUnit=e=>(["width","maxWidth","minWidth","height"].forEach(n=>{e[n]=addUnit(e[n])}),e),componentToSlot=e=>isVNode(e)?n=>h$2(e,n):e,useStyles=(e,{columnsTotalWidth:n,data:r,fixedColumnsOnLeft:g,fixedColumnsOnRight:$})=>{const L=computed(()=>{const{fixed:At,width:qe,vScrollbarSize:xe}=e,Ve=qe-xe;return At?Math.max(Math.round(unref(n)),Ve):Ve}),k=computed(()=>unref(L)+(e.fixed?e.vScrollbarSize:0)),oe=computed(()=>{const{height:At=0,maxHeight:qe=0,footerHeight:xe,hScrollbarSize:Ve}=e;if(qe>0){const he=unref(Fe),Oe=unref(re),Ne=unref(de)+he+Oe+Ve;return Math.min(Ne,qe-xe)}return At-xe}),re=computed(()=>{const{rowHeight:At,estimatedRowHeight:qe}=e,xe=unref(r);return isNumber(qe)?xe.length*qe:xe.length*At}),ae=computed(()=>{const{maxHeight:At}=e,qe=unref(oe);if(isNumber(At)&&At>0)return qe;const xe=unref(re)+unref(de)+unref(Fe);return Math.min(qe,xe)}),le=At=>At.width,ue=computed(()=>sum(unref(g).map(le))),pe=computed(()=>sum(unref($).map(le))),de=computed(()=>sum(e.headerHeight)),Fe=computed(()=>{var At;return(((At=e.fixedData)==null?void 0:At.length)||0)*e.rowHeight}),ze=computed(()=>unref(oe)-unref(de)-unref(Fe)),Ce=computed(()=>{const{style:At={},height:qe,width:xe}=e;return enforceUnit({...At,height:qe,width:xe})}),Ie=computed(()=>enforceUnit({height:e.footerHeight})),_e=computed(()=>({top:addUnit(unref(de)),bottom:addUnit(e.footerHeight),width:addUnit(e.width)}));return{bodyWidth:L,fixedTableHeight:ae,mainTableHeight:oe,leftTableWidth:ue,rightTableWidth:pe,headerWidth:k,rowsHeight:re,windowHeight:ze,footerHeight:Ie,emptyStyle:_e,rootStyle:Ce}},useAutoResize=e=>{const n=ref(),r=ref(0),g=ref(0);let $;return onMounted(()=>{$=useResizeObserver(n,([L])=>{const{width:k,height:oe}=L.contentRect,{paddingLeft:re,paddingRight:ae,paddingTop:le,paddingBottom:ue}=getComputedStyle(L.target),pe=Number.parseInt(re)||0,de=Number.parseInt(ae)||0,Fe=Number.parseInt(le)||0,ze=Number.parseInt(ue)||0;r.value=k-pe-de,g.value=oe-Fe-ze}).stop}),onBeforeUnmount(()=>{$?.()}),watch([r,g],([L,k])=>{var oe;(oe=e.onResize)==null||oe.call(e,{width:L,height:k})}),{sizer:n,width:r,height:g}};function useTable(e){const n=ref(),r=ref(),g=ref(),{columns:$,columnsStyles:L,columnsTotalWidth:k,fixedColumnsOnLeft:oe,fixedColumnsOnRight:re,hasFixedColumns:ae,mainColumns:le,onColumnSorted:ue}=useColumns(e,toRef(e,"columns"),toRef(e,"fixed")),{scrollTo:pe,scrollToLeft:de,scrollToTop:Fe,scrollToRow:ze,onScroll:Ce,onVerticalScroll:Ie,scrollPos:_e}=useScrollbar(e,{mainTableRef:n,leftTableRef:r,rightTableRef:g,onMaybeEndReached:Fn}),{expandedRowKeys:At,hoveringRowKey:qe,lastRenderedRowIndex:xe,isDynamic:Ve,isResetting:he,rowHeights:Oe,resetAfterIndex:$e,onRowExpanded:Ne,onRowHeightChange:Ue,onRowHovered:kt,onRowsRendered:Et}=useRow(e,{mainTableRef:n,leftTableRef:r,rightTableRef:g,onMaybeEndReached:Fn}),{data:Pt,depthMap:Lt}=useData(e,{expandedRowKeys:At,lastRenderedRowIndex:xe,resetAfterIndex:$e}),{bodyWidth:vn,fixedTableHeight:hn,mainTableHeight:Dt,leftTableWidth:jt,rightTableWidth:bn,headerWidth:Sn,rowsHeight:Cn,windowHeight:On,footerHeight:En,emptyStyle:An,rootStyle:In}=useStyles(e,{columnsTotalWidth:k,data:Pt,fixedColumnsOnLeft:oe,fixedColumnsOnRight:re}),$n=shallowRef(!1),Pn=ref(),Dn=computed(()=>{const kn=unref(Pt).length===0;return isArray$4(e.fixedData)?e.fixedData.length===0&&kn:kn});function Mn(kn){const{estimatedRowHeight:Nn,rowHeight:Rn,rowKey:wn}=e;return Nn?unref(Oe)[unref(Pt)[kn][wn]]||Nn:Rn}function Fn(){const{onEndReached:kn}=e;if(!kn)return;const{scrollTop:Nn}=unref(_e),Rn=unref(Cn),wn=unref(On),Tn=Rn-(Nn+wn)+e.hScrollbarSize;unref(xe)>=0&&Rn!==unref(Cn)&&kn(Tn)}return watch(()=>e.expandedRowKeys,kn=>At.value=kn,{deep:!0}),{columns:$,containerRef:Pn,mainTableRef:n,leftTableRef:r,rightTableRef:g,isDynamic:Ve,isResetting:he,isScrolling:$n,hoveringRowKey:qe,hasFixedColumns:ae,columnsStyles:L,columnsTotalWidth:k,data:Pt,expandedRowKeys:At,depthMap:Lt,fixedColumnsOnLeft:oe,fixedColumnsOnRight:re,mainColumns:le,bodyWidth:vn,emptyStyle:An,rootStyle:In,headerWidth:Sn,footerHeight:En,mainTableHeight:Dt,fixedTableHeight:hn,leftTableWidth:jt,rightTableWidth:bn,showEmpty:Dn,getRowHeight:Mn,onColumnSorted:ue,onRowHovered:kt,onRowExpanded:Ne,onRowsRendered:Et,onRowHeightChange:Ue,scrollTo:pe,scrollToLeft:de,scrollToTop:Fe,scrollToRow:ze,onScroll:Ce,onVerticalScroll:Ie}}const TableV2InjectionKey=Symbol("tableV2"),classType=String,columns={type:definePropType(Array),required:!0},fixedDataType={type:definePropType(Array)},dataType={...fixedDataType,required:!0},expandColumnKey=String,expandKeys={type:definePropType(Array),default:()=>mutable([])},requiredNumber={type:Number,required:!0},rowKey={type:definePropType([String,Number,Symbol]),default:"id"},styleType={type:definePropType(Object)},tableV2RowProps=buildProps({class:String,columns,columnsStyles:{type:definePropType(Object),required:!0},depth:Number,expandColumnKey,estimatedRowHeight:{...virtualizedGridProps.estimatedRowHeight,default:void 0},isScrolling:Boolean,onRowExpand:{type:definePropType(Function)},onRowHover:{type:definePropType(Function)},onRowHeightChange:{type:definePropType(Function)},rowData:{type:definePropType(Object),required:!0},rowEventHandlers:{type:definePropType(Object)},rowIndex:{type:Number,required:!0},rowKey,style:{type:definePropType(Object)}}),requiredNumberType={type:Number,required:!0},tableV2HeaderProps=buildProps({class:String,columns,fixedHeaderData:{type:definePropType(Array)},headerData:{type:definePropType(Array),required:!0},headerHeight:{type:definePropType([Number,Array]),default:50},rowWidth:requiredNumberType,rowHeight:{type:Number,default:50},height:requiredNumberType,width:requiredNumberType}),tableV2GridProps=buildProps({columns,data:dataType,fixedData:fixedDataType,estimatedRowHeight:tableV2RowProps.estimatedRowHeight,width:requiredNumber,height:requiredNumber,headerWidth:requiredNumber,headerHeight:tableV2HeaderProps.headerHeight,bodyWidth:requiredNumber,rowHeight:requiredNumber,cache:virtualizedListProps.cache,useIsScrolling:Boolean,scrollbarAlwaysOn:virtualizedGridProps.scrollbarAlwaysOn,scrollbarStartGap:virtualizedGridProps.scrollbarStartGap,scrollbarEndGap:virtualizedGridProps.scrollbarEndGap,class:classType,style:styleType,containerStyle:styleType,getRowHeight:{type:definePropType(Function),required:!0},rowKey:tableV2RowProps.rowKey,onRowsRendered:{type:definePropType(Function)},onScroll:{type:definePropType(Function)}}),tableV2Props=buildProps({cache:tableV2GridProps.cache,estimatedRowHeight:tableV2RowProps.estimatedRowHeight,rowKey,headerClass:{type:definePropType([String,Function])},headerProps:{type:definePropType([Object,Function])},headerCellProps:{type:definePropType([Object,Function])},headerHeight:tableV2HeaderProps.headerHeight,footerHeight:{type:Number,default:0},rowClass:{type:definePropType([String,Function])},rowProps:{type:definePropType([Object,Function])},rowHeight:{type:Number,default:50},cellProps:{type:definePropType([Object,Function])},columns,data:dataType,dataGetter:{type:definePropType(Function)},fixedData:fixedDataType,expandColumnKey:tableV2RowProps.expandColumnKey,expandedRowKeys:expandKeys,defaultExpandedRowKeys:expandKeys,class:classType,fixed:Boolean,style:{type:definePropType(Object)},width:requiredNumber,height:requiredNumber,maxHeight:Number,useIsScrolling:Boolean,indentSize:{type:Number,default:12},iconSize:{type:Number,default:12},hScrollbarSize:virtualizedGridProps.hScrollbarSize,vScrollbarSize:virtualizedGridProps.vScrollbarSize,scrollbarAlwaysOn:virtualizedScrollbarProps.alwaysOn,sortBy:{type:definePropType(Object),default:()=>({})},sortState:{type:definePropType(Object),default:void 0},onColumnSort:{type:definePropType(Function)},onExpandedRowsChange:{type:definePropType(Function)},onEndReached:{type:definePropType(Function)},onRowExpand:tableV2RowProps.onRowExpand,onScroll:tableV2GridProps.onScroll,onRowsRendered:tableV2GridProps.onRowsRendered,rowEventHandlers:tableV2RowProps.rowEventHandlers}),TableV2Cell=(e,{slots:n})=>{var r;const{cellData:g,style:$}=e,L=((r=g?.toString)==null?void 0:r.call(g))||"";return createVNode("div",{class:e.class,title:L,style:$},[n.default?n.default(e):L])};TableV2Cell.displayName="ElTableV2Cell";TableV2Cell.inheritAttrs=!1;const HeaderCell=(e,{slots:n})=>{var r,g;return n.default?n.default(e):createVNode("div",{class:e.class,title:(r=e.column)==null?void 0:r.title},[(g=e.column)==null?void 0:g.title])};HeaderCell.displayName="ElTableV2HeaderCell";HeaderCell.inheritAttrs=!1;const tableV2HeaderRowProps=buildProps({class:String,columns,columnsStyles:{type:definePropType(Object),required:!0},headerIndex:Number,style:{type:definePropType(Object)}}),TableV2HeaderRow=defineComponent({name:"ElTableV2HeaderRow",props:tableV2HeaderRowProps,setup(e,{slots:n}){return()=>{const{columns:r,columnsStyles:g,headerIndex:$,style:L}=e;let k=r.map((oe,re)=>n.cell({columns:r,column:oe,columnIndex:re,headerIndex:$,style:g[oe.key]}));return n.header&&(k=n.header({cells:k.map(oe=>isArray$4(oe)&&oe.length===1?oe[0]:oe),columns:r,headerIndex:$})),createVNode("div",{class:e.class,style:L},[k])}}}),COMPONENT_NAME$4="ElTableV2Header",TableV2Header=defineComponent({name:COMPONENT_NAME$4,props:tableV2HeaderProps,setup(e,{slots:n,expose:r}){const g=useNamespace("table-v2"),$=ref(),L=computed(()=>enforceUnit({width:e.width,height:e.height})),k=computed(()=>enforceUnit({width:e.rowWidth,height:e.height})),oe=computed(()=>castArray$1(unref(e.headerHeight))),re=ue=>{const pe=unref($);nextTick(()=>{pe?.scroll({left:ue})})},ae=()=>{const ue=g.e("fixed-header-row"),{columns:pe,fixedHeaderData:de,rowHeight:Fe}=e;return de?.map((ze,Ce)=>{var Ie;const _e=enforceUnit({height:Fe,width:"100%"});return(Ie=n.fixed)==null?void 0:Ie.call(n,{class:ue,columns:pe,rowData:ze,rowIndex:-(Ce+1),style:_e})})},le=()=>{const ue=g.e("dynamic-header-row"),{columns:pe}=e;return unref(oe).map((de,Fe)=>{var ze;const Ce=enforceUnit({width:"100%",height:de});return(ze=n.dynamic)==null?void 0:ze.call(n,{class:ue,columns:pe,headerIndex:Fe,style:Ce})})};return r({scrollToLeft:re}),()=>{if(!(e.height<=0))return createVNode("div",{ref:$,class:e.class,style:unref(L)},[createVNode("div",{style:unref(k),class:g.e("header")},[le(),ae()])])}}}),useTableRow=e=>{const{isScrolling:n}=inject(TableV2InjectionKey),r=ref(!1),g=ref(),$=computed(()=>isNumber(e.estimatedRowHeight)&&e.rowIndex>=0),L=(re=!1)=>{const ae=unref(g);if(!ae)return;const{columns:le,onRowHeightChange:ue,rowKey:pe,rowIndex:de,style:Fe}=e,{height:ze}=ae.getBoundingClientRect();r.value=!0,nextTick(()=>{if(re||ze!==Number.parseInt(Fe.height)){const Ce=le[0],Ie=Ce?.placeholderSign===placeholderSign;ue?.({rowKey:pe,height:ze,rowIndex:de},Ce&&!Ie&&Ce.fixed)}})},k=computed(()=>{const{rowData:re,rowIndex:ae,rowKey:le,onRowHover:ue}=e,pe=e.rowEventHandlers||{},de={};return Object.entries(pe).forEach(([Fe,ze])=>{isFunction$1(ze)&&(de[Fe]=Ce=>{ze({event:Ce,rowData:re,rowIndex:ae,rowKey:le})})}),ue&&[{name:"onMouseleave",hovered:!1},{name:"onMouseenter",hovered:!0}].forEach(({name:Fe,hovered:ze})=>{const Ce=de[Fe];de[Fe]=Ie=>{ue({event:Ie,hovered:ze,rowData:re,rowIndex:ae,rowKey:le}),Ce?.(Ie)}}),de}),oe=re=>{const{onRowExpand:ae,rowData:le,rowIndex:ue,rowKey:pe}=e;ae?.({expanded:re,rowData:le,rowIndex:ue,rowKey:pe})};return onMounted(()=>{unref($)&&L(!0)}),{isScrolling:n,measurable:$,measured:r,rowRef:g,eventHandlers:k,onExpand:oe}},COMPONENT_NAME$3="ElTableV2TableRow",TableV2Row=defineComponent({name:COMPONENT_NAME$3,props:tableV2RowProps,setup(e,{expose:n,slots:r,attrs:g}){const{eventHandlers:$,isScrolling:L,measurable:k,measured:oe,rowRef:re,onExpand:ae}=useTableRow(e);return n({onExpand:ae}),()=>{const{columns:le,columnsStyles:ue,expandColumnKey:pe,depth:de,rowData:Fe,rowIndex:ze,style:Ce}=e;let Ie=le.map((_e,At)=>{const qe=isArray$4(Fe.children)&&Fe.children.length>0&&_e.key===pe;return r.cell({column:_e,columns:le,columnIndex:At,depth:de,style:ue[_e.key],rowData:Fe,rowIndex:ze,isScrolling:unref(L),expandIconProps:qe?{rowData:Fe,rowIndex:ze,onExpand:ae}:void 0})});if(r.row&&(Ie=r.row({cells:Ie.map(_e=>isArray$4(_e)&&_e.length===1?_e[0]:_e),style:Ce,columns:le,depth:de,rowData:Fe,rowIndex:ze,isScrolling:unref(L)})),unref(k)){const{height:_e,...At}=Ce||{},qe=unref(oe);return createVNode("div",mergeProps({ref:re,class:e.class,style:qe?Ce:At},g,unref($)),[Ie])}return createVNode("div",mergeProps(g,{ref:re,class:e.class,style:Ce},unref($)),[Ie])}}}),SortIcon=e=>{const{sortOrder:n}=e;return createVNode(ElIcon,{size:14,class:e.class},{default:()=>[n===SortOrder.ASC?createVNode(sort_up_default,null,null):createVNode(sort_down_default,null,null)]})},ExpandIcon=e=>{const{expanded:n,expandable:r,onExpand:g,style:$,size:L}=e,k={onClick:r?()=>g(!n):void 0,class:e.class};return createVNode(ElIcon,mergeProps(k,{size:L,style:$}),{default:()=>[createVNode(arrow_right_default,null,null)]})},COMPONENT_NAME$2="ElTableV2Grid",useTableGrid=e=>{const n=ref(),r=ref(),g=computed(()=>{const{data:ze,rowHeight:Ce,estimatedRowHeight:Ie}=e;if(!Ie)return ze.length*Ce}),$=computed(()=>{const{fixedData:ze,rowHeight:Ce}=e;return(ze?.length||0)*Ce}),L=computed(()=>sum(e.headerHeight)),k=computed(()=>{const{height:ze}=e;return Math.max(0,ze-unref(L)-unref($))}),oe=computed(()=>unref(L)+unref($)>0),re=({data:ze,rowIndex:Ce})=>ze[Ce][e.rowKey];function ae({rowCacheStart:ze,rowCacheEnd:Ce,rowVisibleStart:Ie,rowVisibleEnd:_e}){var At;(At=e.onRowsRendered)==null||At.call(e,{rowCacheStart:ze,rowCacheEnd:Ce,rowVisibleStart:Ie,rowVisibleEnd:_e})}function le(ze,Ce){var Ie;(Ie=r.value)==null||Ie.resetAfterRowIndex(ze,Ce)}function ue(ze,Ce){const Ie=unref(n),_e=unref(r);!Ie||!_e||(isObject$4(ze)?(Ie.scrollToLeft(ze.scrollLeft),_e.scrollTo(ze)):(Ie.scrollToLeft(ze),_e.scrollTo({scrollLeft:ze,scrollTop:Ce})))}function pe(ze){var Ce;(Ce=unref(r))==null||Ce.scrollTo({scrollTop:ze})}function de(ze,Ce){var Ie;(Ie=unref(r))==null||Ie.scrollToItem(ze,1,Ce)}function Fe(){var ze,Ce;(ze=unref(r))==null||ze.$forceUpdate(),(Ce=unref(n))==null||Ce.$forceUpdate()}return{bodyRef:r,forceUpdate:Fe,fixedRowHeight:$,gridHeight:k,hasHeader:oe,headerHeight:L,headerRef:n,totalHeight:g,itemKey:re,onItemRendered:ae,resetAfterRowIndex:le,scrollTo:ue,scrollToTop:pe,scrollToRow:de}},TableGrid=defineComponent({name:COMPONENT_NAME$2,props:tableV2GridProps,setup(e,{slots:n,expose:r}){const{ns:g}=inject(TableV2InjectionKey),{bodyRef:$,fixedRowHeight:L,gridHeight:k,hasHeader:oe,headerRef:re,headerHeight:ae,totalHeight:le,forceUpdate:ue,itemKey:pe,onItemRendered:de,resetAfterRowIndex:Fe,scrollTo:ze,scrollToTop:Ce,scrollToRow:Ie}=useTableGrid(e);r({forceUpdate:ue,totalHeight:le,scrollTo:ze,scrollToTop:Ce,scrollToRow:Ie,resetAfterRowIndex:Fe});const _e=()=>e.bodyWidth;return()=>{const{cache:At,columns:qe,data:xe,fixedData:Ve,useIsScrolling:he,scrollbarAlwaysOn:Oe,scrollbarEndGap:$e,scrollbarStartGap:Ne,style:Ue,rowHeight:kt,bodyWidth:Et,estimatedRowHeight:Pt,headerWidth:Lt,height:vn,width:hn,getRowHeight:Dt,onScroll:jt}=e,bn=isNumber(Pt),Sn=bn?DynamicSizeGrid:FixedSizeGrid,Cn=unref(ae);return createVNode("div",{role:"table",class:[g.e("table"),e.class],style:Ue},[createVNode(Sn,{ref:$,data:xe,useIsScrolling:he,itemKey:pe,columnCache:0,columnWidth:bn?_e:Et,totalColumn:1,totalRow:xe.length,rowCache:At,rowHeight:bn?Dt:kt,width:hn,height:unref(k),class:g.e("body"),scrollbarStartGap:Ne,scrollbarEndGap:$e,scrollbarAlwaysOn:Oe,onScroll:jt,onItemRendered:de,perfMode:!1},{default:On=>{var En;const An=xe[On.rowIndex];return(En=n.row)==null?void 0:En.call(n,{...On,columns:qe,rowData:An})}}),unref(oe)&&createVNode(TableV2Header,{ref:re,class:g.e("header-wrapper"),columns:qe,headerData:xe,headerHeight:e.headerHeight,fixedHeaderData:Ve,rowWidth:Lt,rowHeight:kt,width:hn,height:Math.min(Cn+unref(L),vn)},{dynamic:n.header,fixed:n.row})])}}});function _isSlot$5(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!isVNode(e)}const MainTable=(e,{slots:n})=>{const{mainTableRef:r,...g}=e;return createVNode(TableGrid,mergeProps({ref:r},g),_isSlot$5(n)?n:{default:()=>[n]})};function _isSlot$4(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!isVNode(e)}const LeftTable$1=(e,{slots:n})=>{if(!e.columns.length)return;const{leftTableRef:r,...g}=e;return createVNode(TableGrid,mergeProps({ref:r},g),_isSlot$4(n)?n:{default:()=>[n]})};function _isSlot$3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!isVNode(e)}const LeftTable=(e,{slots:n})=>{if(!e.columns.length)return;const{rightTableRef:r,...g}=e;return createVNode(TableGrid,mergeProps({ref:r},g),_isSlot$3(n)?n:{default:()=>[n]})};function _isSlot$2(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!isVNode(e)}const RowRenderer=(e,{slots:n})=>{const{columns:r,columnsStyles:g,depthMap:$,expandColumnKey:L,expandedRowKeys:k,estimatedRowHeight:oe,hasFixedColumns:re,hoveringRowKey:ae,rowData:le,rowIndex:ue,style:pe,isScrolling:de,rowProps:Fe,rowClass:ze,rowKey:Ce,rowEventHandlers:Ie,ns:_e,onRowHovered:At,onRowExpanded:qe}=e,xe=tryCall(ze,{columns:r,rowData:le,rowIndex:ue},""),Ve=tryCall(Fe,{columns:r,rowData:le,rowIndex:ue}),he=le[Ce],Oe=$[he]||0,$e=Boolean(L),Ne=ue<0,Ue=[_e.e("row"),xe,{[_e.e(`row-depth-${Oe}`)]:$e&&ue>=0,[_e.is("expanded")]:$e&&k.includes(he),[_e.is("hovered")]:!de&&he===ae,[_e.is("fixed")]:!Oe&&Ne,[_e.is("customized")]:Boolean(n.row)}],kt=re?At:void 0,Et={...Ve,columns:r,columnsStyles:g,class:Ue,depth:Oe,expandColumnKey:L,estimatedRowHeight:Ne?void 0:oe,isScrolling:de,rowIndex:ue,rowData:le,rowKey:he,rowEventHandlers:Ie,style:pe};return createVNode(TableV2Row,mergeProps(Et,{onRowHover:kt,onRowExpand:qe}),_isSlot$2(n)?n:{default:()=>[n]})},CellRenderer=({columns:e,column:n,columnIndex:r,depth:g,expandIconProps:$,isScrolling:L,rowData:k,rowIndex:oe,style:re,expandedRowKeys:ae,ns:le,cellProps:ue,expandColumnKey:pe,indentSize:de,iconSize:Fe,rowKey:ze},{slots:Ce})=>{const Ie=enforceUnit(re);if(n.placeholderSign===placeholderSign)return createVNode("div",{class:le.em("row-cell","placeholder"),style:Ie},null);const{cellRenderer:_e,dataKey:At,dataGetter:qe}=n,Ve=componentToSlot(_e)||Ce.default||(vn=>createVNode(TableV2Cell,vn,null)),he=isFunction$1(qe)?qe({columns:e,column:n,columnIndex:r,rowData:k,rowIndex:oe}):get(k,At??""),Oe=tryCall(ue,{cellData:he,columns:e,column:n,columnIndex:r,rowIndex:oe,rowData:k}),$e={class:le.e("cell-text"),columns:e,column:n,columnIndex:r,cellData:he,isScrolling:L,rowData:k,rowIndex:oe},Ne=Ve($e),Ue=[le.e("row-cell"),n.align===Alignment.CENTER&&le.is("align-center"),n.align===Alignment.RIGHT&&le.is("align-right")],kt=oe>=0&&n.key===pe,Et=oe>=0&&ae.includes(k[ze]);let Pt;const Lt=`margin-inline-start: ${g*de}px;`;return kt&&(isObject$4($)?Pt=createVNode(ExpandIcon,mergeProps($,{class:[le.e("expand-icon"),le.is("expanded",Et)],size:Fe,expanded:Et,style:Lt,expandable:!0}),null):Pt=createVNode("div",{style:[Lt,`width: ${Fe}px; height: ${Fe}px;`].join(" ")},null)),createVNode("div",mergeProps({class:Ue,style:Ie},Oe),[Pt,Ne])};CellRenderer.inheritAttrs=!1;function _isSlot$1(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!isVNode(e)}const HeaderRenderer=({columns:e,columnsStyles:n,headerIndex:r,style:g,headerClass:$,headerProps:L,ns:k},{slots:oe})=>{const re={columns:e,headerIndex:r},ae=[k.e("header-row"),tryCall($,re,""),{[k.is("customized")]:Boolean(oe.header)}],le={...tryCall(L,re),columnsStyles:n,class:ae,columns:e,headerIndex:r,style:g};return createVNode(TableV2HeaderRow,le,_isSlot$1(oe)?oe:{default:()=>[oe]})},HeaderCellRenderer=(e,{slots:n})=>{const{column:r,ns:g,style:$,onColumnSorted:L}=e,k=enforceUnit($);if(r.placeholderSign===placeholderSign)return createVNode("div",{class:g.em("header-row-cell","placeholder"),style:k},null);const{headerCellRenderer:oe,headerClass:re,sortable:ae}=r,le={...e,class:g.e("header-cell-text")},pe=(componentToSlot(oe)||n.default||(qe=>createVNode(HeaderCell,qe,null)))(le),{sortBy:de,sortState:Fe,headerCellProps:ze}=e;let Ce,Ie;if(Fe){const qe=Fe[r.key];Ce=Boolean(oppositeOrderMap[qe]),Ie=Ce?qe:SortOrder.ASC}else Ce=r.key===de.key,Ie=Ce?de.order:SortOrder.ASC;const _e=[g.e("header-cell"),tryCall(re,e,""),r.align===Alignment.CENTER&&g.is("align-center"),r.align===Alignment.RIGHT&&g.is("align-right"),ae&&g.is("sortable")],At={...tryCall(ze,e),onClick:r.sortable?L:void 0,class:_e,style:k,["data-key"]:r.key};return createVNode("div",At,[pe,ae&&createVNode(SortIcon,{class:[g.e("sort-icon"),Ce&&g.is("sorting")],sortOrder:Ie},null)])},Footer$1=(e,{slots:n})=>{var r;return createVNode("div",{class:e.class,style:e.style},[(r=n.default)==null?void 0:r.call(n)])};Footer$1.displayName="ElTableV2Footer";const Footer=(e,{slots:n})=>createVNode("div",{class:e.class,style:e.style},[n.default?n.default():createVNode(ElEmpty,null,null)]);Footer.displayName="ElTableV2Empty";const Overlay=(e,{slots:n})=>{var r;return createVNode("div",{class:e.class,style:e.style},[(r=n.default)==null?void 0:r.call(n)])};Overlay.displayName="ElTableV2Overlay";function _isSlot(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!isVNode(e)}const COMPONENT_NAME$1="ElTableV2",TableV2=defineComponent({name:COMPONENT_NAME$1,props:tableV2Props,setup(e,{slots:n,expose:r}){const g=useNamespace("table-v2"),{columnsStyles:$,fixedColumnsOnLeft:L,fixedColumnsOnRight:k,mainColumns:oe,mainTableHeight:re,fixedTableHeight:ae,leftTableWidth:le,rightTableWidth:ue,data:pe,depthMap:de,expandedRowKeys:Fe,hasFixedColumns:ze,hoveringRowKey:Ce,mainTableRef:Ie,leftTableRef:_e,rightTableRef:At,isDynamic:qe,isResetting:xe,isScrolling:Ve,bodyWidth:he,emptyStyle:Oe,rootStyle:$e,headerWidth:Ne,footerHeight:Ue,showEmpty:kt,scrollTo:Et,scrollToLeft:Pt,scrollToTop:Lt,scrollToRow:vn,getRowHeight:hn,onColumnSorted:Dt,onRowHeightChange:jt,onRowHovered:bn,onRowExpanded:Sn,onRowsRendered:Cn,onScroll:On,onVerticalScroll:En}=useTable(e);return r({scrollTo:Et,scrollToLeft:Pt,scrollToTop:Lt,scrollToRow:vn}),provide(TableV2InjectionKey,{ns:g,isResetting:xe,hoveringRowKey:Ce,isScrolling:Ve}),()=>{const{cache:An,cellProps:In,estimatedRowHeight:$n,expandColumnKey:Pn,fixedData:Dn,headerHeight:Mn,headerClass:Fn,headerProps:kn,headerCellProps:Nn,sortBy:Rn,sortState:wn,rowHeight:Tn,rowClass:xn,rowEventHandlers:Bn,rowKey:Ln,rowProps:Hn,scrollbarAlwaysOn:zn,indentSize:Jn,iconSize:co,useIsScrolling:Gn,vScrollbarSize:eo,width:ao}=e,ho=unref(pe),Yn={cache:An,class:g.e("main"),columns:unref(oe),data:ho,fixedData:Dn,estimatedRowHeight:$n,bodyWidth:unref(he),headerHeight:Mn,headerWidth:unref(Ne),height:unref(re),mainTableRef:Ie,rowKey:Ln,rowHeight:Tn,scrollbarAlwaysOn:zn,scrollbarStartGap:2,scrollbarEndGap:eo,useIsScrolling:Gn,width:ao,getRowHeight:hn,onRowsRendered:Cn,onScroll:On},Wn=unref(le),Vn=unref(ae),_n={cache:An,class:g.e("left"),columns:unref(L),data:ho,estimatedRowHeight:$n,leftTableRef:_e,rowHeight:Tn,bodyWidth:Wn,headerWidth:Wn,headerHeight:Mn,height:Vn,rowKey:Ln,scrollbarAlwaysOn:zn,scrollbarStartGap:2,scrollbarEndGap:eo,useIsScrolling:Gn,width:Wn,getRowHeight:hn,onScroll:En},jn=unref(ue)+eo,Un={cache:An,class:g.e("right"),columns:unref(k),data:ho,estimatedRowHeight:$n,rightTableRef:At,rowHeight:Tn,bodyWidth:jn,headerWidth:jn,headerHeight:Mn,height:Vn,rowKey:Ln,scrollbarAlwaysOn:zn,scrollbarStartGap:2,scrollbarEndGap:eo,width:jn,style:`--${unref(g.namespace)}-table-scrollbar-size: ${eo}px`,useIsScrolling:Gn,getRowHeight:hn,onScroll:En},Xn=unref($),Zn={ns:g,depthMap:unref(de),columnsStyles:Xn,expandColumnKey:Pn,expandedRowKeys:unref(Fe),estimatedRowHeight:$n,hasFixedColumns:unref(ze),hoveringRowKey:unref(Ce),rowProps:Hn,rowClass:xn,rowKey:Ln,rowEventHandlers:Bn,onRowHovered:bn,onRowExpanded:Sn,onRowHeightChange:jt},to={cellProps:In,expandColumnKey:Pn,indentSize:Jn,iconSize:co,rowKey:Ln,expandedRowKeys:unref(Fe),ns:g},ro={ns:g,headerClass:Fn,headerProps:kn,columnsStyles:Xn},lo={ns:g,sortBy:Rn,sortState:wn,headerCellProps:Nn,onColumnSorted:Dt},uo={row:go=>createVNode(RowRenderer,mergeProps(go,Zn),{row:n.row,cell:Co=>n.cell?createVNode(CellRenderer,mergeProps(Co,to,{style:Xn[Co.column.key]}),{default:()=>[n.cell]}):createVNode(CellRenderer,mergeProps(Co,to,{style:Xn[Co.column.key]}),null)}),header:go=>createVNode(HeaderRenderer,mergeProps(go,ro),{header:n.header,cell:Co=>n["header-cell"]?createVNode(HeaderCellRenderer,mergeProps(Co,lo,{style:Xn[Co.column.key]}),{default:()=>[n["header-cell"]]}):createVNode(HeaderCellRenderer,mergeProps(Co,lo,{style:Xn[Co.column.key]}),null)})},yo=[e.class,g.b(),g.e("root"),{[g.is("dynamic")]:unref(qe)}],oo={class:g.e("footer"),style:unref(Ue)};return createVNode("div",{class:yo,style:unref($e)},[createVNode(MainTable,Yn,_isSlot(uo)?uo:{default:()=>[uo]}),createVNode(LeftTable$1,_n,_isSlot(uo)?uo:{default:()=>[uo]}),createVNode(LeftTable,Un,_isSlot(uo)?uo:{default:()=>[uo]}),n.footer&&createVNode(Footer$1,oo,{default:n.footer}),unref(kt)&&createVNode(Footer,{class:g.e("empty"),style:unref(Oe)},{default:n.empty}),n.overlay&&createVNode(Overlay,{class:g.e("overlay")},{default:n.overlay})])}}}),autoResizerProps=buildProps({disableWidth:Boolean,disableHeight:Boolean,onResize:{type:definePropType(Function)}}),AutoResizer=defineComponent({name:"ElAutoResizer",props:autoResizerProps,setup(e,{slots:n}){const r=useNamespace("auto-resizer"),{height:g,width:$,sizer:L}=useAutoResize(e),k={width:"100%",height:"100%"};return()=>{var oe;return createVNode("div",{ref:L,class:r.b(),style:k},[(oe=n.default)==null?void 0:oe.call(n,{height:g.value,width:$.value})])}}}),ElTableV2=withInstall(TableV2),ElAutoResizer=withInstall(AutoResizer),tabBarProps=buildProps({tabs:{type:definePropType(Array),default:()=>mutable([])}}),__default__$g={name:"ElTabBar"},_sfc_main$U=defineComponent({...__default__$g,props:tabBarProps,setup(e,{expose:n}){const r=e,g="ElTabBar",$=getCurrentInstance(),L=inject(tabsRootContextKey);L||throwError(g,"");const k=useNamespace("tabs"),oe=ref(),re=ref(),ae=()=>{let ue=0,pe=0;const de=["top","bottom"].includes(L.props.tabPosition)?"width":"height",Fe=de==="width"?"x":"y";return r.tabs.every(ze=>{var Ce,Ie,_e,At;const qe=(Ie=(Ce=$.parent)==null?void 0:Ce.refs)==null?void 0:Ie[`tab-${ze.paneName}`];if(!qe)return!1;if(!ze.active)return!0;pe=qe[`client${capitalize(de)}`];const xe=Fe==="x"?"left":"top";ue=qe.getBoundingClientRect()[xe]-((At=(_e=qe.parentElement)==null?void 0:_e.getBoundingClientRect()[xe])!=null?At:0);const Ve=window.getComputedStyle(qe);return de==="width"&&(r.tabs.length>1&&(pe-=Number.parseFloat(Ve.paddingLeft)+Number.parseFloat(Ve.paddingRight)),ue+=Number.parseFloat(Ve.paddingLeft)),!1}),{[de]:`${pe}px`,transform:`translate${capitalize(Fe)}(${ue}px)`}},le=()=>re.value=ae();return watch(()=>r.tabs,async()=>{await nextTick(),le()},{immediate:!0}),useResizeObserver(oe,()=>le()),n({ref:oe,update:le}),(ue,pe)=>(openBlock(),createElementBlock("div",{ref_key:"barRef",ref:oe,class:normalizeClass([unref(k).e("active-bar"),unref(k).is(unref(L).props.tabPosition)]),style:normalizeStyle(re.value)},null,6))}});var TabBar=_export_sfc$2(_sfc_main$U,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const tabNavProps=buildProps({panes:{type:definePropType(Array),default:()=>mutable([])},currentName:{type:[String,Number],default:""},editable:Boolean,onTabClick:{type:definePropType(Function),default:NOOP},onTabRemove:{type:definePropType(Function),default:NOOP},type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),COMPONENT_NAME="ElTabNav",TabNav=defineComponent({name:COMPONENT_NAME,props:tabNavProps,setup(e,{expose:n}){const r=getCurrentInstance(),g=inject(tabsRootContextKey);g||throwError(COMPONENT_NAME,"");const $=useNamespace("tabs"),L=useDocumentVisibility(),k=useWindowFocus(),oe=ref(),re=ref(),ae=ref(),le=ref(!1),ue=ref(0),pe=ref(!1),de=ref(!0),Fe=computed(()=>["top","bottom"].includes(g.props.tabPosition)?"width":"height"),ze=computed(()=>({transform:`translate${Fe.value==="width"?"X":"Y"}(-${ue.value}px)`})),Ce=()=>{if(!oe.value)return;const he=oe.value[`offset${capitalize(Fe.value)}`],Oe=ue.value;if(!Oe)return;const $e=Oe>he?Oe-he:0;ue.value=$e},Ie=()=>{if(!oe.value||!re.value)return;const he=re.value[`offset${capitalize(Fe.value)}`],Oe=oe.value[`offset${capitalize(Fe.value)}`],$e=ue.value;if(he-$e<=Oe)return;const Ne=he-$e>Oe*2?$e+Oe:he-Oe;ue.value=Ne},_e=async()=>{const he=re.value;if(!le.value||!ae.value||!oe.value||!he)return;await nextTick();const Oe=ae.value.querySelector(".is-active");if(!Oe)return;const $e=oe.value,Ne=["top","bottom"].includes(g.props.tabPosition),Ue=Oe.getBoundingClientRect(),kt=$e.getBoundingClientRect(),Et=Ne?he.offsetWidth-kt.width:he.offsetHeight-kt.height,Pt=ue.value;let Lt=Pt;Ne?(Ue.leftkt.right&&(Lt=Pt+Ue.right-kt.right)):(Ue.topkt.bottom&&(Lt=Pt+(Ue.bottom-kt.bottom))),Lt=Math.max(Lt,0),ue.value=Math.min(Lt,Et)},At=()=>{if(!re.value||!oe.value)return;const he=re.value[`offset${capitalize(Fe.value)}`],Oe=oe.value[`offset${capitalize(Fe.value)}`],$e=ue.value;if(Oe0&&(ue.value=0)},qe=he=>{const Oe=he.code,{up:$e,down:Ne,left:Ue,right:kt}=EVENT_CODE;if(![$e,Ne,Ue,kt].includes(Oe))return;const Et=Array.from(he.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),Pt=Et.indexOf(he.target);let Lt;Oe===Ue||Oe===$e?Pt===0?Lt=Et.length-1:Lt=Pt-1:Pt{de.value&&(pe.value=!0)},Ve=()=>pe.value=!1;return watch(L,he=>{he==="hidden"?de.value=!1:he==="visible"&&setTimeout(()=>de.value=!0,50)}),watch(k,he=>{he?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ae,At),onMounted(()=>setTimeout(()=>_e(),0)),onUpdated(()=>At()),n({scrollToActiveTab:_e,removeFocus:Ve}),watch(()=>e.panes,()=>r.update(),{flush:"post"}),()=>{const he=le.value?[createVNode("span",{class:[$.e("nav-prev"),$.is("disabled",!le.value.prev)],onClick:Ce},[createVNode(ElIcon,null,{default:()=>[createVNode(arrow_left_default,null,null)]})]),createVNode("span",{class:[$.e("nav-next"),$.is("disabled",!le.value.next)],onClick:Ie},[createVNode(ElIcon,null,{default:()=>[createVNode(arrow_right_default,null,null)]})])]:null,Oe=e.panes.map(($e,Ne)=>{var Ue,kt,Et,Pt;const Lt=$e.props.disabled,vn=(kt=(Ue=$e.props.name)!=null?Ue:$e.index)!=null?kt:`${Ne}`,hn=!Lt&&($e.isClosable||e.editable);$e.index=`${Ne}`;const Dt=hn?createVNode(ElIcon,{class:"is-icon-close",onClick:Sn=>e.onTabRemove($e,Sn)},{default:()=>[createVNode(close_default,null,null)]}):null,jt=((Pt=(Et=$e.slots).label)==null?void 0:Pt.call(Et))||$e.props.label,bn=!Lt&&$e.active?0:-1;return createVNode("div",{ref:`tab-${vn}`,class:[$.e("item"),$.is(g.props.tabPosition),$.is("active",$e.active),$.is("disabled",Lt),$.is("closable",hn),$.is("focus",pe.value)],id:`tab-${vn}`,key:`tab-${vn}`,"aria-controls":`pane-${vn}`,role:"tab","aria-selected":$e.active,tabindex:bn,onFocus:()=>xe(),onBlur:()=>Ve(),onClick:Sn=>{Ve(),e.onTabClick($e,vn,Sn)},onKeydown:Sn=>{hn&&(Sn.code===EVENT_CODE.delete||Sn.code===EVENT_CODE.backspace)&&e.onTabRemove($e,Sn)}},[jt,Dt])});return createVNode("div",{ref:ae,class:[$.e("nav-wrap"),$.is("scrollable",!!le.value),$.is(g.props.tabPosition)]},[he,createVNode("div",{class:$.e("nav-scroll"),ref:oe},[createVNode("div",{class:[$.e("nav"),$.is(g.props.tabPosition),$.is("stretch",e.stretch&&["top","bottom"].includes(g.props.tabPosition))],ref:re,style:ze.value,role:"tablist",onKeydown:qe},[e.type?null:createVNode(TabBar,{tabs:[...e.panes]},null),Oe])])])}}}),tabsProps=buildProps({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:definePropType(Function),default:()=>!0},stretch:Boolean}),isPanelName=e=>isString$2(e)||isNumber(e),tabsEmits={[UPDATE_MODEL_EVENT]:e=>isPanelName(e),"tab-click":(e,n)=>n instanceof Event,"tab-change":e=>isPanelName(e),edit:(e,n)=>["remove","add"].includes(n),"tab-remove":e=>isPanelName(e),"tab-add":()=>!0};var Tabs$1=defineComponent({name:"ElTabs",props:tabsProps,emits:tabsEmits,setup(e,{emit:n,slots:r,expose:g}){var $,L;const k=useNamespace("tabs"),oe=ref(),re=reactive({}),ae=ref((L=($=e.modelValue)!=null?$:e.activeName)!=null?L:"0"),le=ze=>{ae.value=ze,n(UPDATE_MODEL_EVENT,ze),n("tab-change",ze)},ue=async ze=>{var Ce,Ie,_e;if(!(ae.value===ze||isUndefined(ze)))try{await((Ce=e.beforeLeave)==null?void 0:Ce.call(e,ze,ae.value))!==!1&&(le(ze),(_e=(Ie=oe.value)==null?void 0:Ie.removeFocus)==null||_e.call(Ie))}catch{}},pe=(ze,Ce,Ie)=>{ze.props.disabled||(ue(Ce),n("tab-click",ze,Ie))},de=(ze,Ce)=>{ze.props.disabled||isUndefined(ze.props.name)||(Ce.stopPropagation(),n("edit",ze.props.name,"remove"),n("tab-remove",ze.props.name))},Fe=()=>{n("edit",void 0,"add"),n("tab-add")};return useDeprecated({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},computed(()=>!!e.activeName)),watch(()=>e.activeName,ze=>ue(ze)),watch(()=>e.modelValue,ze=>ue(ze)),watch(ae,async()=>{var ze;await nextTick(),(ze=oe.value)==null||ze.scrollToActiveTab()}),provide(tabsRootContextKey,{props:e,currentName:ae,registerPane:Ie=>re[Ie.uid]=Ie,unregisterPane:Ie=>delete re[Ie]}),g({currentName:ae}),()=>{const ze=e.editable||e.addable?createVNode("span",{class:k.e("new-tab"),tabindex:"0",onClick:Fe,onKeydown:_e=>{_e.code===EVENT_CODE.enter&&Fe()}},[createVNode(ElIcon,{class:k.is("icon-plus")},{default:()=>[createVNode(plus_default,null,null)]})]):null,Ce=createVNode("div",{class:[k.e("header"),k.is(e.tabPosition)]},[ze,createVNode(TabNav,{ref:oe,currentName:ae.value,editable:e.editable,type:e.type,panes:Object.values(re),stretch:e.stretch,onTabClick:pe,onTabRemove:de},null)]),Ie=createVNode("div",{class:k.e("content")},[renderSlot(r,"default")]);return createVNode("div",{class:[k.b(),k.m(e.tabPosition),{[k.m("card")]:e.type==="card",[k.m("border-card")]:e.type==="border-card"}]},[...e.tabPosition!=="bottom"?[Ce,Ie]:[Ie,Ce]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$G=["id","aria-hidden","aria-labelledby"],__default__$f={name:"ElTabPane"},_sfc_main$T=defineComponent({...__default__$f,props:tabPaneProps,setup(e){const n=e,r="ElTabPane",g=getCurrentInstance(),$=useSlots(),L=inject(tabsRootContextKey);L||throwError(r,"usage: ");const k=useNamespace("tab-pane"),oe=ref(),re=computed(()=>n.closable||L.props.closable),ae=computedEager(()=>{var Fe;return L.currentName.value===((Fe=n.name)!=null?Fe:oe.value)}),le=ref(ae.value),ue=computed(()=>{var Fe;return(Fe=n.name)!=null?Fe:oe.value}),pe=computedEager(()=>!n.lazy||le.value||ae.value);watch(ae,Fe=>{Fe&&(le.value=!0)});const de=reactive({uid:g.uid,slots:$,props:n,paneName:ue,active:ae,index:oe,isClosable:re});return onMounted(()=>{L.registerPane(de)}),onUnmounted(()=>{L.unregisterPane(de.uid)}),(Fe,ze)=>unref(pe)?withDirectives((openBlock(),createElementBlock("div",{key:0,id:`pane-${unref(ue)}`,class:normalizeClass(unref(k).b()),role:"tabpanel","aria-hidden":!unref(ae),"aria-labelledby":`tab-${unref(ue)}`},[renderSlot(Fe.$slots,"default")],10,_hoisted_1$G)),[[vShow,unref(ae)]]):createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$2(_sfc_main$T,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const ElTabs=withInstall(Tabs$1,{TabPane}),ElTabPane=withNoopInstall(TabPane),timeSelectProps=buildProps({format:{type:String,default:"HH:mm"},modelValue:String,disabled:Boolean,editable:{type:Boolean,default:!0},effect:{type:String,default:"light"},clearable:{type:Boolean,default:!0},size:useSizeProp,placeholder:String,start:{type:String,default:"09:00"},end:{type:String,default:"18:00"},step:{type:String,default:"00:30"},minTime:String,maxTime:String,name:String,prefixIcon:{type:definePropType([String,Object]),default:()=>clock_default},clearIcon:{type:definePropType([String,Object]),default:()=>circle_close_default}}),parseTime=e=>{const n=(e||"").split(":");if(n.length>=2){let r=Number.parseInt(n[0],10);const g=Number.parseInt(n[1],10),$=e.toUpperCase();return $.includes("AM")&&r===12?r=0:$.includes("PM")&&r!==12&&(r+=12),{hours:r,minutes:g}}return null},compareTime=(e,n)=>{const r=parseTime(e);if(!r)return-1;const g=parseTime(n);if(!g)return-1;const $=r.minutes+r.hours*60,L=g.minutes+g.hours*60;return $===L?0:$>L?1:-1},padTime=e=>`${e}`.padStart(2,"0"),formatTime=e=>`${padTime(e.hours)}:${padTime(e.minutes)}`,nextTime=(e,n)=>{const r=parseTime(e);if(!r)return"";const g=parseTime(n);if(!g)return"";const $={hours:r.hours,minutes:r.minutes};return $.minutes+=g.minutes,$.hours+=g.hours,$.hours+=Math.floor($.minutes/60),$.minutes=$.minutes%60,formatTime($)},__default__$e={name:"ElTimeSelect"},_sfc_main$S=defineComponent({...__default__$e,props:timeSelectProps,emits:["change","blur","focus","update:modelValue"],setup(e,{expose:n}){const r=e;dayjs.extend(customParseFormat);const{Option:g}=ElSelect,$=useNamespace("input"),L=ref(),k=computed(()=>r.modelValue),oe=computed(()=>{const ze=parseTime(r.start);return ze?formatTime(ze):null}),re=computed(()=>{const ze=parseTime(r.end);return ze?formatTime(ze):null}),ae=computed(()=>{const ze=parseTime(r.step);return ze?formatTime(ze):null}),le=computed(()=>{const ze=parseTime(r.minTime||"");return ze?formatTime(ze):null}),ue=computed(()=>{const ze=parseTime(r.maxTime||"");return ze?formatTime(ze):null}),pe=computed(()=>{const ze=[];if(r.start&&r.end&&r.step){let Ce=oe.value,Ie;for(;Ce&&re.value&&compareTime(Ce,re.value)<=0;)Ie=dayjs(Ce,"HH:mm").format(r.format),ze.push({value:Ie,disabled:compareTime(Ce,le.value||"-1:-1")<=0||compareTime(Ce,ue.value||"100:100")>=0}),Ce=nextTime(Ce,ae.value)}return ze});return n({blur:()=>{var ze,Ce;(Ce=(ze=L.value)==null?void 0:ze.blur)==null||Ce.call(ze)},focus:()=>{var ze,Ce;(Ce=(ze=L.value)==null?void 0:ze.focus)==null||Ce.call(ze)}}),(ze,Ce)=>(openBlock(),createBlock(unref(ElSelect),{ref_key:"select",ref:L,"model-value":unref(k),disabled:ze.disabled,clearable:ze.clearable,"clear-icon":ze.clearIcon,size:ze.size,effect:ze.effect,placeholder:ze.placeholder,"default-first-option":"",filterable:ze.editable,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ie=>ze.$emit("update:modelValue",Ie)),onChange:Ce[1]||(Ce[1]=Ie=>ze.$emit("change",Ie)),onBlur:Ce[2]||(Ce[2]=Ie=>ze.$emit("blur",Ie)),onFocus:Ce[3]||(Ce[3]=Ie=>ze.$emit("focus",Ie))},{prefix:withCtx(()=>[ze.prefixIcon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref($).e("prefix-icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(ze.prefixIcon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)]),default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(pe),Ie=>(openBlock(),createBlock(unref(g),{key:Ie.value,label:Ie.value,value:Ie.value,disabled:Ie.disabled},null,8,["label","value","disabled"]))),128))]),_:1},8,["model-value","disabled","clearable","clear-icon","size","effect","placeholder","filterable"]))}});var TimeSelect=_export_sfc$2(_sfc_main$S,[["__file","/home/runner/work/element-plus/element-plus/packages/components/time-select/src/time-select.vue"]]);TimeSelect.install=e=>{e.component(TimeSelect.name,TimeSelect)};const _TimeSelect=TimeSelect,ElTimeSelect=_TimeSelect,Timeline=defineComponent({name:"ElTimeline",setup(e,{slots:n}){const r=useNamespace("timeline");return provide("timeline",n),()=>h$2("ul",{class:[r.b()]},[renderSlot(n,"default")])}}),timelineItemProps=buildProps({timestamp:{type:String,default:""},hideTimestamp:{type:Boolean,default:!1},center:{type:Boolean,default:!1},placement:{type:String,values:["top","bottom"],default:"bottom"},type:{type:String,values:["primary","success","warning","danger","info"],default:""},color:{type:String,default:""},size:{type:String,values:["normal","large"],default:"normal"},icon:{type:iconPropType,default:""},hollow:{type:Boolean,default:!1}}),__default__$d={name:"ElTimelineItem"},_sfc_main$R=defineComponent({...__default__$d,props:timelineItemProps,setup(e){const n=useNamespace("timeline-item");return(r,g)=>(openBlock(),createElementBlock("li",{class:normalizeClass([unref(n).b(),{[unref(n).e("center")]:r.center}])},[createBaseVNode("div",{class:normalizeClass(unref(n).e("tail"))},null,2),r.$slots.dot?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("div",{key:0,class:normalizeClass([unref(n).e("node"),unref(n).em("node",r.size||""),unref(n).em("node",r.type||""),unref(n).is("hollow",r.hollow)]),style:normalizeStyle({backgroundColor:r.color})},[r.icon?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass(unref(n).e("icon"))},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(r.icon)))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],6)),r.$slots.dot?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref(n).e("dot"))},[renderSlot(r.$slots,"dot")],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(n).e("wrapper"))},[!r.hideTimestamp&&r.placement==="top"?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass([unref(n).e("timestamp"),unref(n).is("top")])},toDisplayString(r.timestamp),3)):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(unref(n).e("content"))},[renderSlot(r.$slots,"default")],2),!r.hideTimestamp&&r.placement==="bottom"?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass([unref(n).e("timestamp"),unref(n).is("bottom")])},toDisplayString(r.timestamp),3)):createCommentVNode("v-if",!0)],2)],2))}});var TimelineItem=_export_sfc$2(_sfc_main$R,[["__file","/home/runner/work/element-plus/element-plus/packages/components/timeline/src/timeline-item.vue"]]);const ElTimeline=withInstall(Timeline,{TimelineItem}),ElTimelineItem=withNoopInstall(TimelineItem),tooltipV2CommonProps=buildProps({nowrap:Boolean});var TooltipV2Sides=(e=>(e.top="top",e.bottom="bottom",e.left="left",e.right="right",e))(TooltipV2Sides||{});const tooltipV2Sides=Object.values(TooltipV2Sides),tooltipV2ArrowProps=buildProps({width:{type:Number,default:10},height:{type:Number,default:10},style:{type:definePropType(Object),default:null}}),tooltipV2ArrowSpecialProps=buildProps({side:{type:definePropType(String),values:tooltipV2Sides,required:!0}}),tooltipV2Strategies=["absolute","fixed"],tooltipV2Placements=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],tooltipV2ContentProps=buildProps({ariaLabel:String,arrowPadding:{type:definePropType(Number),default:5},effect:{type:String,default:""},contentClass:String,placement:{type:definePropType(String),values:tooltipV2Placements,default:"bottom"},reference:{type:definePropType(Object),default:null},offset:{type:Number,default:8},strategy:{type:definePropType(String),values:tooltipV2Strategies,default:"absolute"},showArrow:{type:Boolean,default:!1}}),tooltipV2RootProps=buildProps({delayDuration:{type:Number,default:300},defaultOpen:Boolean,open:{type:Boolean,default:void 0},onOpenChange:{type:definePropType(Function)},"onUpdate:open":{type:definePropType(Function)}}),EventHandler={type:definePropType(Function)},tooltipV2TriggerProps=buildProps({onBlur:EventHandler,onClick:EventHandler,onFocus:EventHandler,onMouseDown:EventHandler,onMouseEnter:EventHandler,onMouseLeave:EventHandler}),tooltipV2Props=buildProps({...tooltipV2RootProps,...tooltipV2ArrowProps,...tooltipV2TriggerProps,...tooltipV2ContentProps,alwaysOn:Boolean,fullTransition:Boolean,transitionProps:{type:definePropType(Object),default:null},teleported:Boolean,to:{type:definePropType(String),default:"body"}}),__default__$c={name:"ElTooltipV2Root"},_sfc_main$Q=defineComponent({...__default__$c,props:tooltipV2RootProps,setup(e,{expose:n}){const r=e,g=ref(r.defaultOpen),$=ref(null),L=computed({get:()=>isPropAbsent(r.open)?g.value:r.open,set:Ce=>{var Ie;g.value=Ce,(Ie=r["onUpdate:open"])==null||Ie.call(r,Ce)}}),k=computed(()=>isNumber(r.delayDuration)&&r.delayDuration>0),{start:oe,stop:re}=useTimeoutFn(()=>{L.value=!0},computed(()=>r.delayDuration),{immediate:!1}),ae=useNamespace("tooltip-v2"),le=useId(),ue=()=>{re(),L.value=!0},pe=()=>{unref(k)?oe():ue()},de=ue,Fe=()=>{re(),L.value=!1};return watch(L,Ce=>{var Ie;Ce&&(document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN)),de()),(Ie=r.onOpenChange)==null||Ie.call(r,Ce)}),onMounted(()=>{document.addEventListener(TOOLTIP_V2_OPEN,Fe)}),onBeforeUnmount(()=>{re(),document.removeEventListener(TOOLTIP_V2_OPEN,Fe)}),provide(tooltipV2RootKey,{contentId:le,triggerRef:$,ns:ae,onClose:Fe,onDelayOpen:pe,onOpen:de}),n({onOpen:de,onClose:Fe}),(Ce,Ie)=>renderSlot(Ce.$slots,"default",{open:unref(L)})}});var TooltipV2Root=_export_sfc$2(_sfc_main$Q,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/root.vue"]]);const __default__$b={name:"ElTooltipV2Arrow"},_sfc_main$P=defineComponent({...__default__$b,props:{...tooltipV2ArrowProps,...tooltipV2ArrowSpecialProps},setup(e){const n=e,{ns:r}=inject(tooltipV2RootKey),{arrowRef:g}=inject(tooltipV2ContentKey),$=computed(()=>{const{style:L,width:k,height:oe}=n,re=r.namespace.value;return{[`--${re}-tooltip-v2-arrow-width`]:`${k}px`,[`--${re}-tooltip-v2-arrow-height`]:`${oe}px`,[`--${re}-tooltip-v2-arrow-border-width`]:`${k/2}px`,[`--${re}-tooltip-v2-arrow-cover-width`]:k/2-1,...L||{}}});return(L,k)=>(openBlock(),createElementBlock("span",{ref_key:"arrowRef",ref:g,style:normalizeStyle(unref($)),class:normalizeClass(unref(r).e("arrow"))},null,6))}});var TooltipV2Arrow=_export_sfc$2(_sfc_main$P,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/arrow.vue"]]);const visualHiddenProps=buildProps({style:{type:definePropType([String,Object,Array]),default:()=>({})}}),__default__$a={name:"ElVisuallyHidden"},_sfc_main$O=defineComponent({...__default__$a,props:visualHiddenProps,setup(e){const n=e,r=computed(()=>[n.style,{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}]);return(g,$)=>(openBlock(),createElementBlock("span",mergeProps(g.$attrs,{style:unref(r)}),[renderSlot(g.$slots,"default")],16))}});var ElVisuallyHidden=_export_sfc$2(_sfc_main$O,[["__file","/home/runner/work/element-plus/element-plus/packages/components/visual-hidden/src/visual-hidden.vue"]]);const _hoisted_1$F=["data-side"],__default__$9={name:"ElTooltipV2Content"},_sfc_main$N=defineComponent({...__default__$9,props:{...tooltipV2ContentProps,...tooltipV2CommonProps},setup(e){const n=e,{triggerRef:r,contentId:g}=inject(tooltipV2RootKey),$=ref(n.placement),L=ref(n.strategy),k=ref(null),{referenceRef:oe,contentRef:re,middlewareData:ae,x:le,y:ue,update:pe}=useFloating({placement:$,strategy:L,middleware:computed(()=>{const At=[offset(n.offset)];return n.showArrow&&At.push(arrowMiddleware({arrowRef:k})),At})}),de=useZIndex().nextZIndex(),Fe=useNamespace("tooltip-v2"),ze=computed(()=>$.value.split("-")[0]),Ce=computed(()=>({position:unref(L),top:`${unref(ue)||0}px`,left:`${unref(le)||0}px`,zIndex:de})),Ie=computed(()=>{if(!n.showArrow)return{};const{arrow:At}=unref(ae);return{[`--${Fe.namespace.value}-tooltip-v2-arrow-x`]:`${At?.x}px`||"",[`--${Fe.namespace.value}-tooltip-v2-arrow-y`]:`${At?.y}px`||""}}),_e=computed(()=>[Fe.e("content"),Fe.is("dark",n.effect==="dark"),Fe.is(unref(L)),n.contentClass]);return watch(k,()=>pe()),watch(()=>n.placement,At=>$.value=At),onMounted(()=>{watch(()=>n.reference||r.value,At=>{oe.value=At||void 0},{immediate:!0})}),provide(tooltipV2ContentKey,{arrowRef:k}),(At,qe)=>(openBlock(),createElementBlock("div",{ref_key:"contentRef",ref:re,style:normalizeStyle(unref(Ce)),"data-tooltip-v2-root":""},[At.nowrap?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("div",{key:0,"data-side":unref(ze),class:normalizeClass(unref(_e))},[renderSlot(At.$slots,"default",{contentStyle:unref(Ce),contentClass:unref(_e)}),createVNode(unref(ElVisuallyHidden),{id:unref(g),role:"tooltip"},{default:withCtx(()=>[At.ariaLabel?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(At.ariaLabel),1)],64)):renderSlot(At.$slots,"default",{key:1})]),_:3},8,["id"]),renderSlot(At.$slots,"arrow",{style:normalizeStyle(unref(Ie)),side:unref(ze)})],10,_hoisted_1$F))],4))}});var TooltipV2Content=_export_sfc$2(_sfc_main$N,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/content.vue"]]);const forwardRefProps=buildProps({setRef:{type:definePropType(Function),required:!0},onlyChild:Boolean});var ForwardRef=defineComponent({props:forwardRefProps,setup(e,{slots:n}){const r=ref(),g=composeRefs(r,$=>{$?e.setRef($.nextElementSibling):e.setRef(null)});return()=>{var $;const[L]=(($=n.default)==null?void 0:$.call(n))||[],k=e.onlyChild?ensureOnlyChild(L.children):L.children;return createVNode(Fragment,{ref:g},[k])}}});const __default__$8={name:"ElTooltipV2Trigger"},_sfc_main$M=defineComponent({...__default__$8,props:{...tooltipV2CommonProps,...tooltipV2TriggerProps},setup(e){const n=e,{onClose:r,onOpen:g,onDelayOpen:$,triggerRef:L,contentId:k}=inject(tooltipV2RootKey);let oe=!1;const re=_e=>{L.value=_e},ae=()=>{oe=!1},le=composeEventHandlers(n.onMouseEnter,$),ue=composeEventHandlers(n.onMouseLeave,r),pe=composeEventHandlers(n.onMouseDown,()=>{r(),oe=!0,document.addEventListener("mouseup",ae,{once:!0})}),de=composeEventHandlers(n.onFocus,()=>{oe||g()}),Fe=composeEventHandlers(n.onBlur,r),ze=composeEventHandlers(n.onClick,_e=>{_e.detail===0&&r()}),Ce={blur:Fe,click:ze,focus:de,mousedown:pe,mouseenter:le,mouseleave:ue},Ie=(_e,At,qe)=>{_e&&Object.entries(At).forEach(([xe,Ve])=>{_e[qe](xe,Ve)})};return watch(L,(_e,At)=>{Ie(_e,Ce,"addEventListener"),Ie(At,Ce,"removeEventListener"),_e&&_e.setAttribute("aria-describedby",k.value)}),onBeforeUnmount(()=>{Ie(L.value,Ce,"removeEventListener"),document.removeEventListener("mouseup",ae)}),(_e,At)=>_e.nowrap?(openBlock(),createBlock(unref(ForwardRef),{key:0,"set-ref":re,"only-child":""},{default:withCtx(()=>[renderSlot(_e.$slots,"default")]),_:3})):(openBlock(),createElementBlock("button",mergeProps({key:1,ref_key:"triggerRef",ref:L},_e.$attrs),[renderSlot(_e.$slots,"default")],16))}});var TooltipV2Trigger=_export_sfc$2(_sfc_main$M,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/trigger.vue"]]);const __default__$7={name:"ElTooltipV2"},_sfc_main$L=defineComponent({...__default__$7,props:tooltipV2Props,setup(e){const r=toRefs(e),g=reactive(pick$1(r,Object.keys(tooltipV2ArrowProps))),$=reactive(pick$1(r,Object.keys(tooltipV2ContentProps))),L=reactive(pick$1(r,Object.keys(tooltipV2RootProps))),k=reactive(pick$1(r,Object.keys(tooltipV2TriggerProps)));return(oe,re)=>(openBlock(),createBlock(TooltipV2Root,normalizeProps(guardReactiveProps(L)),{default:withCtx(({open:ae})=>[createVNode(TooltipV2Trigger,mergeProps(k,{nowrap:""}),{default:withCtx(()=>[renderSlot(oe.$slots,"trigger")]),_:3},16),(openBlock(),createBlock(Teleport,{to:oe.to,disabled:!oe.teleported},[oe.fullTransition?(openBlock(),createBlock(Transition,normalizeProps(mergeProps({key:0},oe.transitionProps)),{default:withCtx(()=>[oe.alwaysOn||ae?(openBlock(),createBlock(TooltipV2Content,normalizeProps(mergeProps({key:0},$)),{arrow:withCtx(({style:le,side:ue})=>[oe.showArrow?(openBlock(),createBlock(TooltipV2Arrow,mergeProps({key:0},g,{style:le,side:ue}),null,16,["style","side"])):createCommentVNode("v-if",!0)]),default:withCtx(()=>[renderSlot(oe.$slots,"default")]),_:3},16)):createCommentVNode("v-if",!0)]),_:2},1040)):(openBlock(),createElementBlock(Fragment,{key:1},[oe.alwaysOn||ae?(openBlock(),createBlock(TooltipV2Content,normalizeProps(mergeProps({key:0},$)),{arrow:withCtx(({style:le,side:ue})=>[oe.showArrow?(openBlock(),createBlock(TooltipV2Arrow,mergeProps({key:0},g,{style:le,side:ue}),null,16,["style","side"])):createCommentVNode("v-if",!0)]),default:withCtx(()=>[renderSlot(oe.$slots,"default")]),_:3},16)):createCommentVNode("v-if",!0)],64))],8,["to","disabled"]))]),_:3},16))}});var TooltipV2=_export_sfc$2(_sfc_main$L,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/tooltip.vue"]]);const ElTooltipV2=withInstall(TooltipV2),LEFT_CHECK_CHANGE_EVENT="left-check-change",RIGHT_CHECK_CHANGE_EVENT="right-check-change",transferProps=buildProps({data:{type:definePropType(Array),default:()=>[]},titles:{type:definePropType(Array),default:()=>[]},buttonTexts:{type:definePropType(Array),default:()=>[]},filterPlaceholder:String,filterMethod:{type:definePropType(Function)},leftDefaultChecked:{type:definePropType(Array),default:()=>[]},rightDefaultChecked:{type:definePropType(Array),default:()=>[]},renderContent:{type:definePropType(Function)},modelValue:{type:definePropType(Array),default:()=>[]},format:{type:definePropType(Object),default:()=>({})},filterable:Boolean,props:{type:definePropType(Object),default:()=>mutable({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},validateEvent:{type:Boolean,default:!0}}),transferCheckedChangeFn=(e,n)=>[e,n].every(isArray$4)||isArray$4(e)&&isNil(n),transferEmits={[CHANGE_EVENT]:(e,n,r)=>[e,r].every(isArray$4)&&["left","right"].includes(n),[UPDATE_MODEL_EVENT]:e=>isArray$4(e),[LEFT_CHECK_CHANGE_EVENT]:transferCheckedChangeFn,[RIGHT_CHECK_CHANGE_EVENT]:transferCheckedChangeFn},CHECKED_CHANGE_EVENT="checked-change",transferPanelProps=buildProps({data:transferProps.data,optionRender:{type:definePropType(Function)},placeholder:String,title:String,filterable:Boolean,format:transferProps.format,filterMethod:transferProps.filterMethod,defaultChecked:transferProps.leftDefaultChecked,props:transferProps.props}),transferPanelEmits={[CHECKED_CHANGE_EVENT]:transferCheckedChangeFn},usePropsAlias=e=>{const n={label:"label",key:"key",disabled:"disabled"};return computed(()=>({...n,...e.props}))},useCheck$1=(e,n,r)=>{const g=usePropsAlias(e),$=computed(()=>e.data.filter(le=>isFunction$1(e.filterMethod)?e.filterMethod(n.query,le):String(le[g.value.label]||le[g.value.key]).toLowerCase().includes(n.query.toLowerCase()))),L=computed(()=>$.value.filter(le=>!le[g.value.disabled])),k=computed(()=>{const le=n.checked.length,ue=e.data.length,{noChecked:pe,hasChecked:de}=e.format;return pe&&de?le>0?de.replace(/\${checked}/g,le.toString()).replace(/\${total}/g,ue.toString()):pe.replace(/\${total}/g,ue.toString()):`${le}/${ue}`}),oe=computed(()=>{const le=n.checked.length;return le>0&&le{const le=L.value.map(ue=>ue[g.value.key]);n.allChecked=le.length>0&&le.every(ue=>n.checked.includes(ue))},ae=le=>{n.checked=le?L.value.map(ue=>ue[g.value.key]):[]};return watch(()=>n.checked,(le,ue)=>{if(re(),n.checkChangeByUser){const pe=le.concat(ue).filter(de=>!le.includes(de)||!ue.includes(de));r(CHECKED_CHANGE_EVENT,le,pe)}else r(CHECKED_CHANGE_EVENT,le),n.checkChangeByUser=!0}),watch(L,()=>{re()}),watch(()=>e.data,()=>{const le=[],ue=$.value.map(pe=>pe[g.value.key]);n.checked.forEach(pe=>{ue.includes(pe)&&le.push(pe)}),n.checkChangeByUser=!1,n.checked=le}),watch(()=>e.defaultChecked,(le,ue)=>{if(ue&&le.length===ue.length&&le.every(Fe=>ue.includes(Fe)))return;const pe=[],de=L.value.map(Fe=>Fe[g.value.key]);le.forEach(Fe=>{de.includes(Fe)&&pe.push(Fe)}),n.checkChangeByUser=!1,n.checked=pe},{immediate:!0}),{filteredData:$,checkableData:L,checkedSummary:k,isIndeterminate:oe,updateAllChecked:re,handleAllCheckedChange:ae}},useCheckedChange=(e,n)=>({onSourceCheckedChange:($,L)=>{e.leftChecked=$,L&&n(LEFT_CHECK_CHANGE_EVENT,$,L)},onTargetCheckedChange:($,L)=>{e.rightChecked=$,L&&n(RIGHT_CHECK_CHANGE_EVENT,$,L)}}),useComputedData=e=>{const n=usePropsAlias(e),r=computed(()=>e.data.reduce((L,k)=>(L[k[n.value.key]]=k)&&L,{})),g=computed(()=>e.data.filter(L=>!e.modelValue.includes(L[n.value.key]))),$=computed(()=>e.targetOrder==="original"?e.data.filter(L=>e.modelValue.includes(L[n.value.key])):e.modelValue.reduce((L,k)=>{const oe=r.value[k];return oe&&L.push(oe),L},[]));return{sourceData:g,targetData:$}},useMove=(e,n,r)=>{const g=usePropsAlias(e),$=(oe,re,ae)=>{r(UPDATE_MODEL_EVENT,oe),r(CHANGE_EVENT,oe,re,ae)};return{addToLeft:()=>{const oe=e.modelValue.slice();n.rightChecked.forEach(re=>{const ae=oe.indexOf(re);ae>-1&&oe.splice(ae,1)}),$(oe,"left",n.rightChecked)},addToRight:()=>{let oe=e.modelValue.slice();const re=e.data.filter(ae=>{const le=ae[g.value.key];return n.leftChecked.includes(le)&&!e.modelValue.includes(le)}).map(ae=>ae[g.value.key]);oe=e.targetOrder==="unshift"?re.concat(oe):oe.concat(re),e.targetOrder==="original"&&(oe=e.data.filter(ae=>oe.includes(ae[g.value.key])).map(ae=>ae[g.value.key])),$(oe,"right",n.leftChecked)}}},__default__$6={name:"ElTransferPanel"},_sfc_main$K=defineComponent({...__default__$6,props:transferPanelProps,emits:transferPanelEmits,setup(e,{expose:n,emit:r}){const g=e,$=useSlots(),L=({option:qe})=>qe,{t:k}=useLocale(),oe=useNamespace("transfer"),re=reactive({checked:[],allChecked:!1,query:"",inputHover:!1,checkChangeByUser:!0}),ae=usePropsAlias(g),{filteredData:le,checkedSummary:ue,isIndeterminate:pe,handleAllCheckedChange:de}=useCheck$1(g,re,r),Fe=computed(()=>!isEmpty(re.query)&&isEmpty(le.value)),ze=computed(()=>!isEmpty($.default()[0].children)),{checked:Ce,allChecked:Ie,query:_e,inputHover:At}=toRefs(re);return n({query:_e}),(qe,xe)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(oe).b("panel"))},[createBaseVNode("p",{class:normalizeClass(unref(oe).be("panel","header"))},[createVNode(unref(ElCheckbox),{modelValue:unref(Ie),"onUpdate:modelValue":xe[0]||(xe[0]=Ve=>isRef(Ie)?Ie.value=Ve:null),indeterminate:unref(pe),onChange:unref(de)},{default:withCtx(()=>[createTextVNode(toDisplayString(qe.title)+" ",1),createBaseVNode("span",null,toDisplayString(unref(ue)),1)]),_:1},8,["modelValue","indeterminate","onChange"])],2),createBaseVNode("div",{class:normalizeClass([unref(oe).be("panel","body"),unref(oe).is("with-footer",unref(ze))])},[qe.filterable?(openBlock(),createBlock(unref(ElInput),{key:0,modelValue:unref(_e),"onUpdate:modelValue":xe[1]||(xe[1]=Ve=>isRef(_e)?_e.value=Ve:null),class:normalizeClass(unref(oe).be("panel","filter")),size:"default",placeholder:qe.placeholder,"prefix-icon":unref(search_default),clearable:"",onMouseenter:xe[2]||(xe[2]=Ve=>At.value=!0),onMouseleave:xe[3]||(xe[3]=Ve=>At.value=!1)},null,8,["modelValue","class","placeholder","prefix-icon"])):createCommentVNode("v-if",!0),withDirectives(createVNode(unref(ElCheckboxGroup$1),{modelValue:unref(Ce),"onUpdate:modelValue":xe[4]||(xe[4]=Ve=>isRef(Ce)?Ce.value=Ve:null),class:normalizeClass([unref(oe).is("filterable",qe.filterable),unref(oe).be("panel","list")])},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(le),Ve=>(openBlock(),createBlock(unref(ElCheckbox),{key:Ve[unref(ae).key],class:normalizeClass(unref(oe).be("panel","item")),label:Ve[unref(ae).key],disabled:Ve[unref(ae).disabled]},{default:withCtx(()=>{var he;return[createVNode(L,{option:(he=qe.optionRender)==null?void 0:he.call(qe,Ve)},null,8,["option"])]}),_:2},1032,["class","label","disabled"]))),128))]),_:1},8,["modelValue","class"]),[[vShow,!unref(Fe)&&!unref(isEmpty)(qe.data)]]),withDirectives(createBaseVNode("p",{class:normalizeClass(unref(oe).be("panel","empty"))},toDisplayString(unref(Fe)?unref(k)("el.transfer.noMatch"):unref(k)("el.transfer.noData")),3),[[vShow,unref(Fe)||unref(isEmpty)(qe.data)]])],2),unref(ze)?(openBlock(),createElementBlock("p",{key:0,class:normalizeClass(unref(oe).be("panel","footer"))},[renderSlot(qe.$slots,"default")],2)):createCommentVNode("v-if",!0)],2))}});var TransferPanel=_export_sfc$2(_sfc_main$K,[["__file","/home/runner/work/element-plus/element-plus/packages/components/transfer/src/transfer-panel.vue"]]);const _hoisted_1$E={key:0},_hoisted_2$w={key:0},__default__$5={name:"ElTransfer"},_sfc_main$J=defineComponent({...__default__$5,props:transferProps,emits:transferEmits,setup(e,{expose:n,emit:r}){const g=e,$=useSlots(),{t:L}=useLocale(),k=useNamespace("transfer"),{formItem:oe}=useFormItem(),re=reactive({leftChecked:[],rightChecked:[]}),ae=usePropsAlias(g),{sourceData:le,targetData:ue}=useComputedData(g),{onSourceCheckedChange:pe,onTargetCheckedChange:de}=useCheckedChange(re,r),{addToLeft:Fe,addToRight:ze}=useMove(g,re,r),Ce=ref(),Ie=ref(),_e=Oe=>{switch(Oe){case"left":Ce.value.query="";break;case"right":Ie.value.query="";break}},At=computed(()=>g.buttonTexts.length===2),qe=computed(()=>g.titles[0]||L("el.transfer.titles.0")),xe=computed(()=>g.titles[1]||L("el.transfer.titles.1")),Ve=computed(()=>g.filterPlaceholder||L("el.transfer.filterPlaceholder"));watch(()=>g.modelValue,()=>{var Oe;g.validateEvent&&((Oe=oe?.validate)==null||Oe.call(oe,"change").catch($e=>void 0))});const he=computed(()=>Oe=>g.renderContent?g.renderContent(h$2,Oe):$.default?$.default({option:Oe}):h$2("span",Oe[ae.value.label]||Oe[ae.value.key]));return n({clearQuery:_e,leftPanel:Ce,rightPanel:Ie}),(Oe,$e)=>(openBlock(),createElementBlock("div",{class:normalizeClass(unref(k).b())},[createVNode(TransferPanel,{ref_key:"leftPanel",ref:Ce,data:unref(le),"option-render":unref(he),placeholder:unref(Ve),title:unref(qe),filterable:Oe.filterable,format:Oe.format,"filter-method":Oe.filterMethod,"default-checked":Oe.leftDefaultChecked,props:g.props,onCheckedChange:unref(pe)},{default:withCtx(()=>[renderSlot(Oe.$slots,"left-footer")]),_:3},8,["data","option-render","placeholder","title","filterable","format","filter-method","default-checked","props","onCheckedChange"]),createBaseVNode("div",{class:normalizeClass(unref(k).e("buttons"))},[createVNode(unref(ElButton),{type:"primary",class:normalizeClass([unref(k).e("button"),unref(k).is("with-texts",unref(At))]),disabled:unref(isEmpty)(re.rightChecked),onClick:unref(Fe)},{default:withCtx(()=>[createVNode(unref(ElIcon),null,{default:withCtx(()=>[createVNode(unref(arrow_left_default))]),_:1}),unref(isUndefined)(Oe.buttonTexts[0])?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",_hoisted_1$E,toDisplayString(Oe.buttonTexts[0]),1))]),_:1},8,["class","disabled","onClick"]),createVNode(unref(ElButton),{type:"primary",class:normalizeClass([unref(k).e("button"),unref(k).is("with-texts",unref(At))]),disabled:unref(isEmpty)(re.leftChecked),onClick:unref(ze)},{default:withCtx(()=>[unref(isUndefined)(Oe.buttonTexts[1])?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",_hoisted_2$w,toDisplayString(Oe.buttonTexts[1]),1)),createVNode(unref(ElIcon),null,{default:withCtx(()=>[createVNode(unref(arrow_right_default))]),_:1})]),_:1},8,["class","disabled","onClick"])],2),createVNode(TransferPanel,{ref_key:"rightPanel",ref:Ie,data:unref(ue),"option-render":unref(he),placeholder:unref(Ve),filterable:Oe.filterable,format:Oe.format,"filter-method":Oe.filterMethod,title:unref(xe),"default-checked":Oe.rightDefaultChecked,props:g.props,onCheckedChange:unref(de)},{default:withCtx(()=>[renderSlot(Oe.$slots,"right-footer")]),_:3},8,["data","option-render","placeholder","filterable","format","filter-method","title","default-checked","props","onCheckedChange"])],2))}});var Transfer=_export_sfc$2(_sfc_main$J,[["__file","/home/runner/work/element-plus/element-plus/packages/components/transfer/src/transfer.vue"]]);const ElTransfer=withInstall(Transfer),NODE_KEY="$treeNodeId",markNodeData=function(e,n){!n||n[NODE_KEY]||Object.defineProperty(n,NODE_KEY,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=function(e,n){return e?n[e]:n[NODE_KEY]},getChildState=e=>{let n=!0,r=!0,g=!0;for(let $=0,L=e.length;$"u"){const L=g[n];return L===void 0?"":L}};let nodeIdSeed=0;class Node$1{constructor(n){this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in n)hasOwn(n,r)&&(this[r]=n[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const n=this.store;if(!n)throw new Error("[Node]store is required!");n.registerNode(this);const r=n.props;if(r&&typeof r.isLeaf<"u"){const L=getPropertyFromData(this,"isLeaf");typeof L=="boolean"&&(this.isLeafByUser=L)}if(n.lazy!==!0&&this.data?(this.setData(this.data),n.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||markNodeData(this,this.data),!this.data)return;const g=n.defaultExpandedKeys,$=n.key;$&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),$&&n.currentNodeKey!==void 0&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(n){Array.isArray(n)||markNodeData(this,n),this.data=n,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=getPropertyFromData(this,"children")||[];for(let g=0,$=r.length;g<$;g++)this.insertChild({data:r[g]})}get label(){return getPropertyFromData(this,"label")}get key(){const n=this.store.key;return this.data?this.data[n]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return n.childNodes[r+1]}return null}get previousSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return r>0?n.childNodes[r-1]:null}return null}contains(n,r=!0){return(this.childNodes||[]).some(g=>g===n||r&&g.contains(n))}remove(){const n=this.parent;n&&n.removeChild(this)}insertChild(n,r,g){if(!n)throw new Error("InsertChild error: child is required.");if(!(n instanceof Node$1)){if(!g){const $=this.getChildren(!0);$.includes(n.data)||(typeof r>"u"||r<0?$.push(n.data):$.splice(r,0,n.data))}Object.assign(n,{parent:this,store:this.store}),n=reactive(new Node$1(n)),n instanceof Node$1&&n.initialize()}n.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),this.updateLeafState()}insertBefore(n,r){let g;r&&(g=this.childNodes.indexOf(r)),this.insertChild(n,g)}insertAfter(n,r){let g;r&&(g=this.childNodes.indexOf(r),g!==-1&&(g+=1)),this.insertChild(n,g)}removeChild(n){const r=this.getChildren()||[],g=r.indexOf(n.data);g>-1&&r.splice(g,1);const $=this.childNodes.indexOf(n);$>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice($,1)),this.updateLeafState()}removeChildByData(n){let r=null;for(let g=0;g{if(r){let $=this.parent;for(;$.level>0;)$.expanded=!0,$=$.parent}this.expanded=!0,n&&n(),this.childNodes.forEach($=>{$.canFocus=!0})};this.shouldLoadData()?this.loadData($=>{Array.isArray($)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),g())}):g()}doCreateChildren(n,r={}){n.forEach(g=>{this.insertChild(Object.assign({data:g},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(n=>{n.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const n=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!n||n.length===0;return}this.isLeaf=!1}setChecked(n,r,g,$){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:k,allWithoutDisable:oe}=getChildState(this.childNodes);!this.isLeaf&&!k&&oe&&(this.checked=!1,n=!1);const re=()=>{if(r){const ae=this.childNodes;for(let pe=0,de=ae.length;pe{re(),reInitChecked(this)},{checked:n!==!1});return}else re()}const L=this.parent;!L||L.level===0||g||reInitChecked(L)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let $="children";return g&&($=g.children||"children"),r[$]===void 0&&(r[$]=null),n&&!r[$]&&(r[$]=[]),r[$]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(L=>L.data),g={},$=[];n.forEach((L,k)=>{const oe=L[NODE_KEY];!!oe&&r.findIndex(ae=>ae[NODE_KEY]===oe)>=0?g[oe]={index:k,data:L}:$.push({index:k,data:L})}),this.store.lazy||r.forEach(L=>{g[L[NODE_KEY]]||this.removeChildByData(L)}),$.forEach(({index:L,data:k})=>{this.insertChild({data:k},L)}),this.updateLeafState()}loadData(n,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const g=$=>{this.loaded=!0,this.loading=!1,this.childNodes=[],this.doCreateChildren($,r),this.updateLeafState(),n&&n.call(this,$)};this.store.load(this,g)}else n&&n.call(this)}}class TreeStore{constructor(n){this.currentNode=null,this.currentNodeKey=null;for(const r in n)hasOwn(n,r)&&(this[r]=n[r]);this.nodesMap={}}initialize(){if(this.root=new Node$1({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const n=this.load;n(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(n){const r=this.filterNodeMethod,g=this.lazy,$=function(L){const k=L.root?L.root.childNodes:L.childNodes;if(k.forEach(oe=>{oe.visible=r.call(oe,n,oe.data,oe),$(oe)}),!L.visible&&k.length){let oe=!0;oe=!k.some(re=>re.visible),L.root?L.root.visible=oe===!1:L.visible=oe===!1}!n||L.visible&&!L.isLeaf&&!g&&L.expand()};$(this)}setData(n){n!==this.root.data?(this.root.setData(n),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(n){if(n instanceof Node$1)return n;const r=typeof n!="object"?n:getNodeKey(this.key,n);return this.nodesMap[r]||null}insertBefore(n,r){const g=this.getNode(r);g.parent.insertBefore({data:n},g)}insertAfter(n,r){const g=this.getNode(r);g.parent.insertAfter({data:n},g)}remove(n){const r=this.getNode(n);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(n,r){const g=r?this.getNode(r):this.root;g&&g.insertChild({data:n})}_initDefaultCheckedNodes(){const n=this.defaultCheckedKeys||[],r=this.nodesMap;n.forEach(g=>{const $=r[g];$&&$.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(n){(this.defaultCheckedKeys||[]).includes(n.key)&&n.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(n){n!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=n,this._initDefaultCheckedNodes())}registerNode(n){const r=this.key;!n||!n.data||(r?n.key!==void 0&&(this.nodesMap[n.key]=n):this.nodesMap[n.id]=n)}deregisterNode(n){!this.key||!n||!n.data||(n.childNodes.forEach(g=>{this.deregisterNode(g)}),delete this.nodesMap[n.key])}getCheckedNodes(n=!1,r=!1){const g=[],$=function(L){(L.root?L.root.childNodes:L.childNodes).forEach(oe=>{(oe.checked||r&&oe.indeterminate)&&(!n||n&&oe.isLeaf)&&g.push(oe.data),$(oe)})};return $(this),g}getCheckedKeys(n=!1){return this.getCheckedNodes(n).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const n=[],r=function(g){(g.root?g.root.childNodes:g.childNodes).forEach(L=>{L.indeterminate&&n.push(L.data),r(L)})};return r(this),n}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(n=>(n||{})[this.key])}_getAllNodes(){const n=[],r=this.nodesMap;for(const g in r)hasOwn(r,g)&&n.push(r[g]);return n}updateChildren(n,r){const g=this.nodesMap[n];if(!g)return;const $=g.childNodes;for(let L=$.length-1;L>=0;L--){const k=$[L];this.remove(k.data)}for(let L=0,k=r.length;Lre.level-oe.level),L=Object.create(null),k=Object.keys(g);$.forEach(oe=>oe.setChecked(!1,!1));for(let oe=0,re=$.length;oe0;)L[pe.data[n]]=!0,pe=pe.parent;if(ae.isLeaf||this.checkStrictly){ae.setChecked(!0,!1);continue}if(ae.setChecked(!0,!0),r){ae.setChecked(!1,!1);const de=function(Fe){Fe.childNodes.forEach(Ce=>{Ce.isLeaf||Ce.setChecked(!1,!1),de(Ce)})};de(ae)}}}setCheckedNodes(n,r=!1){const g=this.key,$={};n.forEach(L=>{$[(L||{})[g]]=!0}),this._setCheckedKeys(g,r,$)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,$={};n.forEach(L=>{$[L]=!0}),this._setCheckedKeys(g,r,$)}setDefaultExpandedKeys(n){n=n||[],this.defaultExpandedKeys=n,n.forEach(r=>{const g=this.getNode(r);g&&g.expand(null,this.autoExpandParent)})}setChecked(n,r,g){const $=this.getNode(n);$&&$.setChecked(!!r,g)}getCurrentNode(){return this.currentNode}setCurrentNode(n){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=n,this.currentNode.isCurrent=!0}setUserCurrentNode(n,r=!0){const g=n[this.key],$=this.nodesMap[g];this.setCurrentNode($),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(n,r=!0){if(n==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const g=this.getNode(n);g&&(this.setCurrentNode(g),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const _sfc_main$I=defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const n=useNamespace("tree"),r=inject("NodeInstance"),g=inject("RootTree");return()=>{const $=e.node,{data:L,store:k}=$;return e.renderContent?e.renderContent(h$2,{_self:r,node:$,data:L,store:k}):g.ctx.slots.default?g.ctx.slots.default({node:$,data:L}):h$2("span",{class:n.be("node","label")},[$.label])}}});var NodeContent=_export_sfc$2(_sfc_main$I,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function useNodeExpandEventBroadcast(e){const n=inject("TreeNodeMap",null),r={treeNodeExpand:g=>{e.node!==g&&e.node.collapse()},children:[]};return n&&n.children.push(r),provide("TreeNodeMap",r),{broadcastExpanded:g=>{if(!!e.accordion)for(const $ of r.children)$.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:e,ctx:n,el$:r,dropIndicator$:g,store:$}){const L=useNamespace("tree"),k=ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return provide(dragEventsKey,{treeNodeDragStart:({event:le,treeNode:ue})=>{if(typeof e.allowDrag=="function"&&!e.allowDrag(ue.node))return le.preventDefault(),!1;le.dataTransfer.effectAllowed="move";try{le.dataTransfer.setData("text/plain","")}catch{}k.value.draggingNode=ue,n.emit("node-drag-start",ue.node,le)},treeNodeDragOver:({event:le,treeNode:ue})=>{const pe=ue,de=k.value.dropNode;de&&de!==pe&&removeClass(de.$el,L.is("drop-inner"));const Fe=k.value.draggingNode;if(!Fe||!pe)return;let ze=!0,Ce=!0,Ie=!0,_e=!0;typeof e.allowDrop=="function"&&(ze=e.allowDrop(Fe.node,pe.node,"prev"),_e=Ce=e.allowDrop(Fe.node,pe.node,"inner"),Ie=e.allowDrop(Fe.node,pe.node,"next")),le.dataTransfer.dropEffect=Ce||ze||Ie?"move":"none",(ze||Ce||Ie)&&de!==pe&&(de&&n.emit("node-drag-leave",Fe.node,de.node,le),n.emit("node-drag-enter",Fe.node,pe.node,le)),(ze||Ce||Ie)&&(k.value.dropNode=pe),pe.node.nextSibling===Fe.node&&(Ie=!1),pe.node.previousSibling===Fe.node&&(ze=!1),pe.node.contains(Fe.node,!1)&&(Ce=!1),(Fe.node===pe.node||Fe.node.contains(pe.node))&&(ze=!1,Ce=!1,Ie=!1);const At=pe.$el.getBoundingClientRect(),qe=r.value.getBoundingClientRect();let xe;const Ve=ze?Ce?.25:Ie?.45:1:-1,he=Ie?Ce?.75:ze?.55:0:1;let Oe=-9999;const $e=le.clientY-At.top;$eAt.height*he?xe="after":Ce?xe="inner":xe="none";const Ne=pe.$el.querySelector(`.${L.be("node","expand-icon")}`).getBoundingClientRect(),Ue=g.value;xe==="before"?Oe=Ne.top-qe.top:xe==="after"&&(Oe=Ne.bottom-qe.top),Ue.style.top=`${Oe}px`,Ue.style.left=`${Ne.right-qe.left}px`,xe==="inner"?addClass(pe.$el,L.is("drop-inner")):removeClass(pe.$el,L.is("drop-inner")),k.value.showDropIndicator=xe==="before"||xe==="after",k.value.allowDrop=k.value.showDropIndicator||_e,k.value.dropType=xe,n.emit("node-drag-over",Fe.node,pe.node,le)},treeNodeDragEnd:le=>{const{draggingNode:ue,dropType:pe,dropNode:de}=k.value;if(le.preventDefault(),le.dataTransfer.dropEffect="move",ue&&de){const Fe={data:ue.node.data};pe!=="none"&&ue.node.remove(),pe==="before"?de.node.parent.insertBefore(Fe,de.node):pe==="after"?de.node.parent.insertAfter(Fe,de.node):pe==="inner"&&de.node.insertChild(Fe),pe!=="none"&&$.value.registerNode(Fe),removeClass(de.$el,L.is("drop-inner")),n.emit("node-drag-end",ue.node,de.node,pe,le),pe!=="none"&&n.emit("node-drop",ue.node,de.node,pe,le)}ue&&!de&&n.emit("node-drag-end",ue.node,null,pe,le),k.value.showDropIndicator=!1,k.value.draggingNode=null,k.value.dropNode=null,k.value.allowDrop=!0}}),{dragState:k}}const _sfc_main$H=defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:_CollapseTransition,ElCheckbox,NodeContent,ElIcon,Loading:loading_default},props:{node:{type:Node$1,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,n){const r=useNamespace("tree"),{broadcastExpanded:g}=useNodeExpandEventBroadcast(e),$=inject("RootTree"),L=ref(!1),k=ref(!1),oe=ref(null),re=ref(null),ae=ref(null),le=inject(dragEventsKey),ue=getCurrentInstance();provide("NodeInstance",ue),e.node.expanded&&(L.value=!0,k.value=!0);const pe=$.props.children||"children";watch(()=>{const $e=e.node.data[pe];return $e&&[...$e]},()=>{e.node.updateChildren()}),watch(()=>e.node.indeterminate,$e=>{ze(e.node.checked,$e)}),watch(()=>e.node.checked,$e=>{ze($e,e.node.indeterminate)}),watch(()=>e.node.expanded,$e=>{nextTick(()=>L.value=$e),$e&&(k.value=!0)});const de=$e=>getNodeKey($.props.nodeKey,$e.data),Fe=$e=>{const Ne=e.props.class;if(!Ne)return{};let Ue;if(isFunction$1(Ne)){const{data:kt}=$e;Ue=Ne(kt,$e)}else Ue=Ne;return isString$2(Ue)?{[Ue]:!0}:Ue},ze=($e,Ne)=>{(oe.value!==$e||re.value!==Ne)&&$.ctx.emit("check-change",e.node.data,$e,Ne),oe.value=$e,re.value=Ne},Ce=$e=>{const Ne=$.store.value;Ne.setCurrentNode(e.node),$.ctx.emit("current-change",Ne.currentNode?Ne.currentNode.data:null,Ne.currentNode),$.currentNode.value=e.node,$.props.expandOnClickNode&&_e(),$.props.checkOnClickNode&&!e.node.disabled&&At(null,{target:{checked:!e.node.checked}}),$.ctx.emit("node-click",e.node.data,e.node,ue,$e)},Ie=$e=>{$.instance.vnode.props.onNodeContextmenu&&($e.stopPropagation(),$e.preventDefault()),$.ctx.emit("node-contextmenu",$e,e.node.data,e.node,ue)},_e=()=>{e.node.isLeaf||(L.value?($.ctx.emit("node-collapse",e.node.data,e.node,ue),e.node.collapse()):(e.node.expand(),n.emit("node-expand",e.node.data,e.node,ue)))},At=($e,Ne)=>{e.node.setChecked(Ne.target.checked,!$.props.checkStrictly),nextTick(()=>{const Ue=$.store.value;$.ctx.emit("check",e.node.data,{checkedNodes:Ue.getCheckedNodes(),checkedKeys:Ue.getCheckedKeys(),halfCheckedNodes:Ue.getHalfCheckedNodes(),halfCheckedKeys:Ue.getHalfCheckedKeys()})})};return{ns:r,node$:ae,tree:$,expanded:L,childNodeRendered:k,oldChecked:oe,oldIndeterminate:re,getNodeKey:de,getNodeClass:Fe,handleSelectChange:ze,handleClick:Ce,handleContextMenu:Ie,handleExpandIconClick:_e,handleCheckChange:At,handleChildNodeExpand:($e,Ne,Ue)=>{g(Ne),$.ctx.emit("node-expand",$e,Ne,Ue)},handleDragStart:$e=>{!$.props.draggable||le.treeNodeDragStart({event:$e,treeNode:e})},handleDragOver:$e=>{$e.preventDefault(),$.props.draggable&&le.treeNodeDragOver({event:$e,treeNode:{$el:ae.value,node:e.node}})},handleDrop:$e=>{$e.preventDefault()},handleDragEnd:$e=>{!$.props.draggable||le.treeNodeDragEnd($e)},CaretRight:caret_right_default}}}),_hoisted_1$D=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$v=["aria-expanded"];function _sfc_render$B(e,n,r,g,$,L){const k=resolveComponent("el-icon"),oe=resolveComponent("el-checkbox"),re=resolveComponent("loading"),ae=resolveComponent("node-content"),le=resolveComponent("el-tree-node"),ue=resolveComponent("el-collapse-transition");return withDirectives((openBlock(),createElementBlock("div",{ref:"node$",class:normalizeClass([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:n[1]||(n[1]=withModifiers((...pe)=>e.handleClick&&e.handleClick(...pe),["stop"])),onContextmenu:n[2]||(n[2]=(...pe)=>e.handleContextMenu&&e.handleContextMenu(...pe)),onDragstart:n[3]||(n[3]=withModifiers((...pe)=>e.handleDragStart&&e.handleDragStart(...pe),["stop"])),onDragover:n[4]||(n[4]=withModifiers((...pe)=>e.handleDragOver&&e.handleDragOver(...pe),["stop"])),onDragend:n[5]||(n[5]=withModifiers((...pe)=>e.handleDragEnd&&e.handleDragEnd(...pe),["stop"])),onDrop:n[6]||(n[6]=withModifiers((...pe)=>e.handleDrop&&e.handleDrop(...pe),["stop"]))},[createBaseVNode("div",{class:normalizeClass(e.ns.be("node","content")),style:normalizeStyle({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(openBlock(),createBlock(k,{key:0,class:normalizeClass([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:withModifiers(e.handleExpandIconClick,["stop"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0),e.showCheckbox?(openBlock(),createBlock(oe,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:n[0]||(n[0]=withModifiers(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):createCommentVNode("v-if",!0),e.node.loading?(openBlock(),createBlock(k,{key:2,class:normalizeClass([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:withCtx(()=>[createVNode(re)]),_:1},8,["class"])):createCommentVNode("v-if",!0),createVNode(ae,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),createVNode(ue,null,{default:withCtx(()=>[!e.renderAfterExpand||e.childNodeRendered?withDirectives((openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.node.childNodes,pe=>(openBlock(),createBlock(le,{key:e.getNodeKey(pe),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:pe,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$v)),[[vShow,e.expanded]]):createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$D)),[[vShow,e.node.visible]])}var ElTreeNode$1=_export_sfc$2(_sfc_main$H,[["render",_sfc_render$B],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);function useKeydown({el$:e},n){const r=useNamespace("tree"),g=shallowRef([]),$=shallowRef([]);onMounted(()=>{k()}),onUpdated(()=>{g.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),$.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))}),watch($,oe=>{oe.forEach(re=>{re.setAttribute("tabindex","-1")})}),useEventListener(e,"keydown",oe=>{const re=oe.target;if(!re.className.includes(r.b("node")))return;const ae=oe.code;g.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const le=g.value.indexOf(re);let ue;if([EVENT_CODE.up,EVENT_CODE.down].includes(ae)){if(oe.preventDefault(),ae===EVENT_CODE.up){ue=le===-1?0:le!==0?le-1:g.value.length-1;const de=ue;for(;!n.value.getNode(g.value[ue].dataset.key).canFocus;){if(ue--,ue===de){ue=-1;break}ue<0&&(ue=g.value.length-1)}}else{ue=le===-1?0:le=g.value.length&&(ue=0)}}ue!==-1&&g.value[ue].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(ae)&&(oe.preventDefault(),re.click());const pe=re.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(ae)&&pe&&(oe.preventDefault(),pe.click())});const k=()=>{var oe;g.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),$.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const re=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(re.length){re[0].setAttribute("tabindex","0");return}(oe=g.value[0])==null||oe.setAttribute("tabindex","0")}}const _sfc_main$G=defineComponent({name:"ElTree",components:{ElTreeNode:ElTreeNode$1},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:[String,Object]},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,n){const{t:r}=useLocale(),g=useNamespace("tree"),$=ref(new TreeStore({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));$.value.initialize();const L=ref($.value.root),k=ref(null),oe=ref(null),re=ref(null),{broadcastExpanded:ae}=useNodeExpandEventBroadcast(e),{dragState:le}=useDragNodeHandler({props:e,ctx:n,el$:oe,dropIndicator$:re,store:$});useKeydown({el$:oe},$);const ue=computed(()=>{const{childNodes:hn}=L.value;return!hn||hn.length===0||hn.every(({visible:Dt})=>!Dt)});watch(()=>e.defaultCheckedKeys,hn=>{$.value.setDefaultCheckedKey(hn)}),watch(()=>e.defaultExpandedKeys,hn=>{$.value.setDefaultExpandedKeys(hn)}),watch(()=>e.data,hn=>{$.value.setData(hn)},{deep:!0}),watch(()=>e.checkStrictly,hn=>{$.value.checkStrictly=hn});const pe=hn=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");$.value.filter(hn)},de=hn=>getNodeKey(e.nodeKey,hn.data),Fe=hn=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const Dt=$.value.getNode(hn);if(!Dt)return[];const jt=[Dt.data];let bn=Dt.parent;for(;bn&&bn!==L.value;)jt.push(bn.data),bn=bn.parent;return jt.reverse()},ze=(hn,Dt)=>$.value.getCheckedNodes(hn,Dt),Ce=hn=>$.value.getCheckedKeys(hn),Ie=()=>{const hn=$.value.getCurrentNode();return hn?hn.data:null},_e=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const hn=Ie();return hn?hn[e.nodeKey]:null},At=(hn,Dt)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");$.value.setCheckedNodes(hn,Dt)},qe=(hn,Dt)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");$.value.setCheckedKeys(hn,Dt)},xe=(hn,Dt,jt)=>{$.value.setChecked(hn,Dt,jt)},Ve=()=>$.value.getHalfCheckedNodes(),he=()=>$.value.getHalfCheckedKeys(),Oe=(hn,Dt=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");$.value.setUserCurrentNode(hn,Dt)},$e=(hn,Dt=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");$.value.setCurrentNodeKey(hn,Dt)},Ne=hn=>$.value.getNode(hn),Ue=hn=>{$.value.remove(hn)},kt=(hn,Dt)=>{$.value.append(hn,Dt)},Et=(hn,Dt)=>{$.value.insertBefore(hn,Dt)},Pt=(hn,Dt)=>{$.value.insertAfter(hn,Dt)},Lt=(hn,Dt,jt)=>{ae(Dt),n.emit("node-expand",hn,Dt,jt)},vn=(hn,Dt)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");$.value.updateChildren(hn,Dt)};return provide("RootTree",{ctx:n,props:e,store:$,root:L,currentNode:k,instance:getCurrentInstance()}),provide(formItemContextKey,void 0),{ns:g,store:$,root:L,currentNode:k,dragState:le,el$:oe,dropIndicator$:re,isEmpty:ue,filter:pe,getNodeKey:de,getNodePath:Fe,getCheckedNodes:ze,getCheckedKeys:Ce,getCurrentNode:Ie,getCurrentKey:_e,setCheckedNodes:At,setCheckedKeys:qe,setChecked:xe,getHalfCheckedNodes:Ve,getHalfCheckedKeys:he,setCurrentNode:Oe,setCurrentKey:$e,t:r,getNode:Ne,remove:Ue,append:kt,insertBefore:Et,insertAfter:Pt,handleNodeExpand:Lt,updateKeyChildren:vn}}});function _sfc_render$A(e,n,r,g,$,L){var k;const oe=resolveComponent("el-tree-node");return openBlock(),createElementBlock("div",{ref:"el$",class:normalizeClass([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.root.childNodes,re=>(openBlock(),createBlock(oe,{key:e.getNodeKey(re),node:re,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(e.ns.e("empty-block"))},[createBaseVNode("span",{class:normalizeClass(e.ns.e("empty-text"))},toDisplayString((k=e.emptyText)!=null?k:e.t("el.tree.emptyText")),3)],2)):createCommentVNode("v-if",!0),withDirectives(createBaseVNode("div",{ref:"dropIndicator$",class:normalizeClass(e.ns.e("drop-indicator"))},null,2),[[vShow,e.dragState.showDropIndicator]])],2)}var Tree$1=_export_sfc$2(_sfc_main$G,[["render",_sfc_render$A],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);Tree$1.install=e=>{e.component(Tree$1.name,Tree$1)};const _Tree=Tree$1,ElTree=_Tree,useSelect=(e,{attrs:n},{tree:r,key:g})=>{const $=useNamespace("tree-select"),L={...pick$1(toRefs(e),Object.keys(ElSelect.props)),...n,valueKey:g,popperClass:computed(()=>{const k=[$.e("popper")];return e.popperClass&&k.push(e.popperClass),k.join(" ")}),filterMethod:(k="")=>{e.filterMethod&&e.filterMethod(k),nextTick(()=>{var oe;(oe=r.value)==null||oe.filter(k)})},onVisibleChange:k=>{var oe;(oe=n.onVisibleChange)==null||oe.call(n,k),e.filterable&&k&&L.filterMethod()}};return L},component=defineComponent({extends:ElOption,setup(e,n){const r=ElOption.setup(e,n);delete r.selectOptionClick;const g=getCurrentInstance().proxy;return nextTick(()=>{r.select.cachedOptions.get(g.value)||r.select.onOptionCreate(g)}),r},methods:{selectOptionClick(){this.$el.parentElement.click()}}});function isValidValue(e){return e||e===0}function isValidArray(e){return Array.isArray(e)&&e.length}function toValidArray(e){return Array.isArray(e)?e:isValidValue(e)?[e]:[]}function treeFind(e,n,r,g,$){for(let L=0;L{watch(()=>e.modelValue,()=>{e.showCheckbox&&nextTick(()=>{const le=L.value;le&&!isEqual$1(le.getCheckedKeys(),toValidArray(e.modelValue))&&le.setCheckedKeys(toValidArray(e.modelValue))})},{immediate:!0,deep:!0});const oe=computed(()=>({value:k.value,...e.props})),re=(le,ue)=>{var pe;const de=oe.value[le];return isFunction$1(de)?de(ue,(pe=L.value)==null?void 0:pe.getNode(re("value",ue))):ue[de]},ae=toValidArray(e.modelValue).map(le=>treeFind(e.data||[],ue=>re("value",ue)===le,ue=>re("children",ue),(ue,pe,de,Fe)=>Fe&&re("value",Fe))).filter(le=>isValidValue(le));return{...pick$1(toRefs(e),Object.keys(_Tree.props)),...n,nodeKey:k,expandOnClickNode:computed(()=>!e.checkStrictly),defaultExpandedKeys:computed(()=>e.defaultExpandedKeys?e.defaultExpandedKeys.concat(ae):ae),renderContent:(le,{node:ue,data:pe,store:de})=>le(component,{value:re("value",pe),label:re("label",pe),disabled:re("disabled",pe)},e.renderContent?()=>e.renderContent(le,{node:ue,data:pe,store:de}):r.default?()=>r.default({node:ue,data:pe,store:de}):void 0),filterNodeMethod:(le,ue,pe)=>{var de;return e.filterNodeMethod?e.filterNodeMethod(le,ue,pe):le?(de=re("label",ue))==null?void 0:de.includes(le):!0},onNodeClick:(le,ue,pe)=>{var de,Fe,ze;if((de=n.onNodeClick)==null||de.call(n,le,ue,pe),!(e.showCheckbox&&e.checkOnClickNode))if(!e.showCheckbox&&(e.checkStrictly||ue.isLeaf)){if(!re("disabled",le)){const Ce=(Fe=$.value)==null?void 0:Fe.options.get(re("value",le));(ze=$.value)==null||ze.handleOptionSelect(Ce,!0)}}else pe.proxy.handleExpandIconClick()},onCheck:(le,ue)=>{var pe;(pe=n.onCheck)==null||pe.call(n,le,ue);const de=re("value",le);if(e.checkStrictly)g(UPDATE_MODEL_EVENT,e.multiple?ue.checkedKeys:ue.checkedKeys.includes(de)?de:void 0);else if(e.multiple)g(UPDATE_MODEL_EVENT,L.value.getCheckedKeys(!0));else{const Fe=treeFind([le],Ie=>!isValidArray(re("children",Ie))&&!re("disabled",Ie),Ie=>re("children",Ie)),ze=Fe?re("value",Fe):void 0,Ce=isValidValue(e.modelValue)&&!!treeFind([le],Ie=>re("value",Ie)===e.modelValue,Ie=>re("children",Ie));g(UPDATE_MODEL_EVENT,ze===e.modelValue||Ce?void 0:ze)}}}},_sfc_main$F=defineComponent({name:"ElTreeSelect",inheritAttrs:!1,props:{...ElSelect.props,..._Tree.props},setup(e,n){const{slots:r,expose:g}=n,$=ref(),L=ref(),k=computed(()=>e.nodeKey||e.valueKey||"value"),oe=useSelect(e,n,{select:$,tree:L,key:k}),re=useTree$1(e,n,{select:$,tree:L,key:k}),ae=reactive({});return g(ae),onMounted(()=>{Object.assign(ae,{...pick$1(L.value,["filter","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter"]),...pick$1($.value,["focus","blur"])})}),()=>h$2(ElSelect,reactive({...oe,ref:le=>$.value=le}),{...r,default:()=>h$2(_Tree,reactive({...re,ref:le=>L.value=le}))})}});var TreeSelect=_export_sfc$2(_sfc_main$F,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree-select/src/tree-select.vue"]]);TreeSelect.install=e=>{e.component(TreeSelect.name,TreeSelect)};const _TreeSelect=TreeSelect,ElTreeSelect=_TreeSelect,ROOT_TREE_INJECTION_KEY=Symbol(),EMPTY_NODE={key:-1,level:-1,data:{}};var TreeOptionsEnum=(e=>(e.KEY="id",e.LABEL="label",e.CHILDREN="children",e.DISABLED="disabled",e))(TreeOptionsEnum||{}),SetOperationEnum=(e=>(e.ADD="add",e.DELETE="delete",e))(SetOperationEnum||{});const treeProps=buildProps({data:{type:definePropType(Array),default:()=>mutable([])},emptyText:{type:String},height:{type:Number,default:200},props:{type:definePropType(Object),default:()=>mutable({children:"children",label:"label",disabled:"disabled",value:"id"})},highlightCurrent:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},defaultCheckedKeys:{type:definePropType(Array),default:()=>mutable([])},checkStrictly:{type:Boolean,default:!1},defaultExpandedKeys:{type:definePropType(Array),default:()=>mutable([])},indent:{type:Number,default:16},icon:{type:iconPropType},expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!1},currentNodeKey:{type:definePropType([String,Number])},accordion:{type:Boolean,default:!1},filterMethod:{type:definePropType(Function)},perfMode:{type:Boolean,default:!0}}),treeNodeProps=buildProps({node:{type:definePropType(Object),default:()=>mutable(EMPTY_NODE)},expanded:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},current:{type:Boolean,default:!1},hiddenExpandIcon:{type:Boolean,default:!1}}),treeNodeContentProps=buildProps({node:{type:definePropType(Object),required:!0}}),NODE_CLICK="node-click",NODE_EXPAND="node-expand",NODE_COLLAPSE="node-collapse",CURRENT_CHANGE="current-change",NODE_CHECK="check",NODE_CHECK_CHANGE="check-change",NODE_CONTEXTMENU="node-contextmenu",treeEmits={[NODE_CLICK]:(e,n,r)=>e&&n&&r,[NODE_EXPAND]:(e,n)=>e&&n,[NODE_COLLAPSE]:(e,n)=>e&&n,[CURRENT_CHANGE]:(e,n)=>e&&n,[NODE_CHECK]:(e,n)=>e&&n,[NODE_CHECK_CHANGE]:(e,n)=>e&&typeof n=="boolean",[NODE_CONTEXTMENU]:(e,n,r)=>e&&n&&r},treeNodeEmits={click:(e,n)=>!!(e&&n),toggle:e=>!!e,check:(e,n)=>e&&typeof n=="boolean"};function useCheck(e,n){const r=ref(new Set),g=ref(new Set),{emit:$}=getCurrentInstance();watch(()=>n.value,()=>nextTick(()=>{_e(e.defaultCheckedKeys)}),{immediate:!0});const L=()=>{if(!n.value||!e.showCheckbox||e.checkStrictly)return;const{levelTreeNodeMap:At,maxLevel:qe}=n.value,xe=r.value,Ve=new Set;for(let he=qe-1;he>=1;--he){const Oe=At.get(he);!Oe||Oe.forEach($e=>{const Ne=$e.children;if(Ne){let Ue=!0,kt=!1;for(const Et of Ne){const Pt=Et.key;if(xe.has(Pt))kt=!0;else if(Ve.has(Pt)){Ue=!1,kt=!0;break}else Ue=!1}Ue?xe.add($e.key):kt?(Ve.add($e.key),xe.delete($e.key)):(xe.delete($e.key),Ve.delete($e.key))}})}g.value=Ve},k=At=>r.value.has(At.key),oe=At=>g.value.has(At.key),re=(At,qe,xe=!0)=>{const Ve=r.value,he=(Oe,$e)=>{Ve[$e?SetOperationEnum.ADD:SetOperationEnum.DELETE](Oe.key);const Ne=Oe.children;!e.checkStrictly&&Ne&&Ne.forEach(Ue=>{Ue.disabled||he(Ue,$e)})};he(At,qe),L(),xe&&ae(At,qe)},ae=(At,qe)=>{const{checkedNodes:xe,checkedKeys:Ve}=Fe(),{halfCheckedNodes:he,halfCheckedKeys:Oe}=ze();$(NODE_CHECK,At.data,{checkedKeys:Ve,checkedNodes:xe,halfCheckedKeys:Oe,halfCheckedNodes:he}),$(NODE_CHECK_CHANGE,At.data,qe)};function le(At=!1){return Fe(At).checkedKeys}function ue(At=!1){return Fe(At).checkedNodes}function pe(){return ze().halfCheckedKeys}function de(){return ze().halfCheckedNodes}function Fe(At=!1){const qe=[],xe=[];if(n?.value&&e.showCheckbox){const{treeNodeMap:Ve}=n.value;r.value.forEach(he=>{const Oe=Ve.get(he);Oe&&(!At||At&&Oe.isLeaf)&&(xe.push(he),qe.push(Oe.data))})}return{checkedKeys:xe,checkedNodes:qe}}function ze(){const At=[],qe=[];if(n?.value&&e.showCheckbox){const{treeNodeMap:xe}=n.value;g.value.forEach(Ve=>{const he=xe.get(Ve);he&&(qe.push(Ve),At.push(he.data))})}return{halfCheckedNodes:At,halfCheckedKeys:qe}}function Ce(At){r.value.clear(),g.value.clear(),_e(At)}function Ie(At,qe){if(n?.value&&e.showCheckbox){const xe=n.value.treeNodeMap.get(At);xe&&re(xe,qe,!1)}}function _e(At){if(n?.value){const{treeNodeMap:qe}=n.value;if(e.showCheckbox&&qe&&At)for(const xe of At){const Ve=qe.get(xe);Ve&&!k(Ve)&&re(Ve,!0,!1)}}}return{updateCheckedKeys:L,toggleCheckbox:re,isChecked:k,isIndeterminate:oe,getCheckedKeys:le,getCheckedNodes:ue,getHalfCheckedKeys:pe,getHalfCheckedNodes:de,setChecked:Ie,setCheckedKeys:Ce}}function useFilter(e,n){const r=ref(new Set([])),g=ref(new Set([])),$=computed(()=>isFunction$1(e.filterMethod));function L(oe){var re;if(!$.value)return;const ae=new Set,le=g.value,ue=r.value,pe=[],de=((re=n.value)==null?void 0:re.treeNodes)||[],Fe=e.filterMethod;ue.clear();function ze(Ce){Ce.forEach(Ie=>{pe.push(Ie),Fe?.(oe,Ie.data)?pe.forEach(At=>{ae.add(At.key)}):Ie.isLeaf&&ue.add(Ie.key);const _e=Ie.children;if(_e&&ze(_e),!Ie.isLeaf){if(!ae.has(Ie.key))ue.add(Ie.key);else if(_e){let At=!0;for(const qe of _e)if(!ue.has(qe.key)){At=!1;break}At?le.add(Ie.key):le.delete(Ie.key)}}pe.pop()})}return ze(de),ae}function k(oe){return g.value.has(oe.key)}return{hiddenExpandIconKeySet:g,hiddenNodeKeySet:r,doFilter:L,isForceHiddenExpandIcon:k}}function useTree(e,n){const r=ref(new Set(e.defaultExpandedKeys)),g=ref(),$=shallowRef();watch(()=>e.currentNodeKey,In=>{g.value=In},{immediate:!0}),watch(()=>e.data,In=>{An(In)},{immediate:!0});const{isIndeterminate:L,isChecked:k,toggleCheckbox:oe,getCheckedKeys:re,getCheckedNodes:ae,getHalfCheckedKeys:le,getHalfCheckedNodes:ue,setChecked:pe,setCheckedKeys:de}=useCheck(e,$),{doFilter:Fe,hiddenNodeKeySet:ze,isForceHiddenExpandIcon:Ce}=useFilter(e,$),Ie=computed(()=>{var In;return((In=e.props)==null?void 0:In.value)||TreeOptionsEnum.KEY}),_e=computed(()=>{var In;return((In=e.props)==null?void 0:In.children)||TreeOptionsEnum.CHILDREN}),At=computed(()=>{var In;return((In=e.props)==null?void 0:In.disabled)||TreeOptionsEnum.DISABLED}),qe=computed(()=>{var In;return((In=e.props)==null?void 0:In.label)||TreeOptionsEnum.LABEL}),xe=computed(()=>{const In=r.value,$n=ze.value,Pn=[],Dn=$.value&&$.value.treeNodes||[];function Mn(){const Fn=[];for(let kn=Dn.length-1;kn>=0;--kn)Fn.push(Dn[kn]);for(;Fn.length;){const kn=Fn.pop();if(!!kn&&($n.has(kn.key)||Pn.push(kn),In.has(kn.key))){const Nn=kn.children;if(Nn){const Rn=Nn.length;for(let wn=Rn-1;wn>=0;--wn)Fn.push(Nn[wn])}}}}return Mn(),Pn}),Ve=computed(()=>xe.value.length>0);function he(In){const $n=new Map,Pn=new Map;let Dn=1;function Mn(kn,Nn=1,Rn=void 0){var wn;const Tn=[];for(const xn of kn){const Bn=Ne(xn),Ln={level:Nn,key:Bn,data:xn};Ln.label=kt(xn),Ln.parent=Rn;const Hn=$e(xn);Ln.disabled=Ue(xn),Ln.isLeaf=!Hn||Hn.length===0,Hn&&Hn.length&&(Ln.children=Mn(Hn,Nn+1,Ln)),Tn.push(Ln),$n.set(Bn,Ln),Pn.has(Nn)||Pn.set(Nn,[]),(wn=Pn.get(Nn))==null||wn.push(Ln)}return Nn>Dn&&(Dn=Nn),Tn}const Fn=Mn(In);return{treeNodeMap:$n,levelTreeNodeMap:Pn,maxLevel:Dn,treeNodes:Fn}}function Oe(In){const $n=Fe(In);$n&&(r.value=$n)}function $e(In){return In[_e.value]}function Ne(In){return In?In[Ie.value]:""}function Ue(In){return In[At.value]}function kt(In){return In[qe.value]}function Et(In){r.value.has(In.key)?Dt(In):hn(In)}function Pt(In,$n){n(NODE_CLICK,In.data,In,$n),Lt(In),e.expandOnClickNode&&Et(In),e.showCheckbox&&e.checkOnClickNode&&!In.disabled&&oe(In,!k(In),!0)}function Lt(In){Sn(In)||(g.value=In.key,n(CURRENT_CHANGE,In.data,In))}function vn(In,$n){oe(In,$n)}function hn(In){const $n=r.value;if($?.value&&e.accordion){const{treeNodeMap:Pn}=$.value;$n.forEach(Dn=>{const Mn=Pn.get(Dn);Mn&&Mn.level===Mn.level&&$n.delete(Dn)})}$n.add(In.key),n(NODE_EXPAND,In.data,In)}function Dt(In){r.value.delete(In.key),n(NODE_COLLAPSE,In.data,In)}function jt(In){return r.value.has(In.key)}function bn(In){return!!In.disabled}function Sn(In){const $n=g.value;return!!$n&&$n===In.key}function Cn(){var In,$n;if(!!g.value)return($n=(In=$?.value)==null?void 0:In.treeNodeMap.get(g.value))==null?void 0:$n.data}function On(){return g.value}function En(In){g.value=In}function An(In){nextTick(()=>$.value=he(In))}return{tree:$,flattenTree:xe,isNotEmpty:Ve,getKey:Ne,getChildren:$e,toggleExpand:Et,toggleCheckbox:oe,isExpanded:jt,isChecked:k,isIndeterminate:L,isDisabled:bn,isCurrent:Sn,isForceHiddenExpandIcon:Ce,handleNodeClick:Pt,handleNodeCheck:vn,getCurrentNode:Cn,getCurrentKey:On,setCurrentKey:En,getCheckedKeys:re,getCheckedNodes:ae,getHalfCheckedKeys:le,getHalfCheckedNodes:ue,setChecked:pe,setCheckedKeys:de,filter:Oe,setData:An}}var ElNodeContent=defineComponent({name:"ElTreeNodeContent",props:treeNodeContentProps,setup(e){const n=inject(ROOT_TREE_INJECTION_KEY),r=useNamespace("tree");return()=>{const g=e.node,{data:$}=g;return n?.ctx.slots.default?n.ctx.slots.default({node:g,data:$}):h$2("span",{class:r.be("node","label")},[g?.label])}}});const DEFAULT_ICON="caret-right",_sfc_main$E=defineComponent({name:"ElTreeNode",components:{ElIcon,CaretRight:caret_right_default,ElCheckbox,ElNodeContent},props:treeNodeProps,emits:treeNodeEmits,setup(e,{emit:n}){const r=inject(ROOT_TREE_INJECTION_KEY),g=useNamespace("tree"),$=computed(()=>{var le;return(le=r?.props.indent)!=null?le:16}),L=computed(()=>{var le;return(le=r?.props.icon)!=null?le:DEFAULT_ICON});return{ns:g,indent:$,icon:L,handleClick:le=>{n("click",e.node,le)},handleExpandIconClick:()=>{n("toggle",e.node)},handleCheckChange:le=>{n("check",e.node,le)},handleContextMenu:le=>{var ue,pe,de,Fe;(de=(pe=(ue=r?.instance)==null?void 0:ue.vnode)==null?void 0:pe.props)!=null&&de.onNodeContextmenu&&(le.stopPropagation(),le.preventDefault()),r?.ctx.emit(NODE_CONTEXTMENU,le,(Fe=e.node)==null?void 0:Fe.data,e.node)}}}}),_hoisted_1$C=["aria-expanded","aria-disabled","aria-checked","data-key"];function _sfc_render$z(e,n,r,g,$,L){var k,oe,re;const ae=resolveComponent("el-icon"),le=resolveComponent("el-checkbox"),ue=resolveComponent("el-node-content");return openBlock(),createElementBlock("div",{ref:"node$",class:normalizeClass([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.current),e.ns.is("focusable",!e.disabled),e.ns.is("checked",!e.disabled&&e.checked)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.disabled,"aria-checked":e.checked,"data-key":(k=e.node)==null?void 0:k.key,onClick:n[1]||(n[1]=withModifiers((...pe)=>e.handleClick&&e.handleClick(...pe),["stop"])),onContextmenu:n[2]||(n[2]=(...pe)=>e.handleContextMenu&&e.handleContextMenu(...pe))},[createBaseVNode("div",{class:normalizeClass(e.ns.be("node","content")),style:normalizeStyle({paddingLeft:`${(e.node.level-1)*e.indent}px`})},[e.icon?(openBlock(),createBlock(ae,{key:0,class:normalizeClass([e.ns.is("leaf",!!((oe=e.node)!=null&&oe.isLeaf)),e.ns.is("hidden",e.hiddenExpandIcon),{expanded:!((re=e.node)!=null&&re.isLeaf)&&e.expanded},e.ns.be("node","expand-icon")]),onClick:withModifiers(e.handleExpandIconClick,["stop"])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.icon)))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0),e.showCheckbox?(openBlock(),createBlock(le,{key:1,"model-value":e.checked,indeterminate:e.indeterminate,disabled:e.disabled,onChange:e.handleCheckChange,onClick:n[0]||(n[0]=withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate","disabled","onChange"])):createCommentVNode("v-if",!0),createVNode(ue,{node:e.node},null,8,["node"])],6)],42,_hoisted_1$C)}var ElTreeNode=_export_sfc$2(_sfc_main$E,[["render",_sfc_render$z],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree-v2/src/tree-node.vue"]]);const _sfc_main$D=defineComponent({name:"ElTreeV2",components:{ElTreeNode,FixedSizeList},props:treeProps,emits:treeEmits,setup(e,n){provide(ROOT_TREE_INJECTION_KEY,{ctx:n,props:e,instance:getCurrentInstance()}),provide(formItemContextKey,void 0);const{t:r}=useLocale(),g=useNamespace("tree"),{flattenTree:$,isNotEmpty:L,toggleExpand:k,isExpanded:oe,isIndeterminate:re,isChecked:ae,isDisabled:le,isCurrent:ue,isForceHiddenExpandIcon:pe,toggleCheckbox:de,handleNodeClick:Fe,handleNodeCheck:ze,getCurrentNode:Ce,getCurrentKey:Ie,setCurrentKey:_e,getCheckedKeys:At,getCheckedNodes:qe,getHalfCheckedKeys:xe,getHalfCheckedNodes:Ve,setChecked:he,setCheckedKeys:Oe,filter:$e,setData:Ne}=useTree(e,n.emit);return n.expose({getCurrentNode:Ce,getCurrentKey:Ie,setCurrentKey:_e,getCheckedKeys:At,getCheckedNodes:qe,getHalfCheckedKeys:xe,getHalfCheckedNodes:Ve,setChecked:he,setCheckedKeys:Oe,filter:$e,setData:Ne}),{t:r,ns:g,flattenTree:$,itemSize:26,isNotEmpty:L,toggleExpand:k,toggleCheckbox:de,isExpanded:oe,isIndeterminate:re,isChecked:ae,isDisabled:le,isCurrent:ue,isForceHiddenExpandIcon:pe,handleNodeClick:Fe,handleNodeCheck:ze}}});function _sfc_render$y(e,n,r,g,$,L){var k;const oe=resolveComponent("el-tree-node"),re=resolveComponent("fixed-size-list");return openBlock(),createElementBlock("div",{class:normalizeClass([e.ns.b(),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[e.isNotEmpty?(openBlock(),createBlock(re,{key:0,"class-name":e.ns.b("virtual-list"),data:e.flattenTree,total:e.flattenTree.length,height:e.height,"item-size":e.itemSize,"perf-mode":e.perfMode},{default:withCtx(({data:ae,index:le,style:ue})=>[(openBlock(),createBlock(oe,{key:ae[le].key,style:normalizeStyle(ue),node:ae[le],expanded:e.isExpanded(ae[le]),"show-checkbox":e.showCheckbox,checked:e.isChecked(ae[le]),indeterminate:e.isIndeterminate(ae[le]),disabled:e.isDisabled(ae[le]),current:e.isCurrent(ae[le]),"hidden-expand-icon":e.isForceHiddenExpandIcon(ae[le]),onClick:e.handleNodeClick,onToggle:e.toggleExpand,onCheck:e.handleNodeCheck},null,8,["style","node","expanded","show-checkbox","checked","indeterminate","disabled","current","hidden-expand-icon","onClick","onToggle","onCheck"]))]),_:1},8,["class-name","data","total","height","item-size","perf-mode"])):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.ns.e("empty-block"))},[createBaseVNode("span",{class:normalizeClass(e.ns.e("empty-text"))},toDisplayString((k=e.emptyText)!=null?k:e.t("el.tree.emptyText")),3)],2))],2)}var TreeV2=_export_sfc$2(_sfc_main$D,[["render",_sfc_render$y],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree-v2/src/tree.vue"]]);const ElTreeV2=withInstall(TreeV2),SCOPE$2="ElUpload";class UploadAjaxError extends Error{constructor(n,r,g,$){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=$}}function getError(e,n,r){let g;return r.response?g=`${r.response.error||r.response}`:r.responseText?g=`${r.responseText}`:g=`fail to ${n.method} ${e} ${r.status}`,new UploadAjaxError(g,r.status,n.method,e)}function getBody(e){const n=e.responseText||e.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}const ajaxUpload=e=>{typeof XMLHttpRequest>"u"&&throwError(SCOPE$2,"XMLHttpRequest is undefined");const n=new XMLHttpRequest,r=e.action;n.upload&&n.upload.addEventListener("progress",L=>{const k=L;k.percent=L.total>0?L.loaded/L.total*100:0,e.onProgress(k)});const g=new FormData;if(e.data)for(const[L,k]of Object.entries(e.data))Array.isArray(k)?g.append(L,...k):g.append(L,k);g.append(e.filename,e.file,e.file.name),n.addEventListener("error",()=>{e.onError(getError(r,e,n))}),n.addEventListener("load",()=>{if(n.status<200||n.status>=300)return e.onError(getError(r,e,n));e.onSuccess(getBody(n))}),n.open(e.method,r,!0),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);const $=e.headers||{};if($ instanceof Headers)$.forEach((L,k)=>n.setRequestHeader(k,L));else for(const[L,k]of Object.entries($))isNil(k)||n.setRequestHeader(L,String(k));return n.send(g),n},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>mutable({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:Boolean,limit:Number}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:!1},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"}}),uploadListEmits={remove:e=>!!e},_hoisted_1$B=["onKeydown"],_hoisted_2$u=["src"],_hoisted_3$g=["onClick"],_hoisted_4$e=["onClick"],_hoisted_5$a=["onClick"],__default__$4={name:"ElUploadList"},_sfc_main$C=defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(e,{emit:n}){const r=e,{t:g}=useLocale(),$=useNamespace("upload"),L=useNamespace("icon"),k=useNamespace("list"),oe=ref(!1),re=le=>{r.handlePreview(le)},ae=le=>{n("remove",le)};return(le,ue)=>(openBlock(),createBlock(TransitionGroup,{tag:"ul",class:normalizeClass([unref($).b("list"),unref($).bm("list",le.listType),unref($).is("disabled",le.disabled)]),name:unref(k).b()},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(le.files,pe=>(openBlock(),createElementBlock("li",{key:pe.uid||pe.name,class:normalizeClass([unref($).be("list","item"),unref($).is(pe.status),{focusing:oe.value}]),tabindex:"0",onKeydown:withKeys(de=>!le.disabled&&ae(pe),["delete"]),onFocus:ue[0]||(ue[0]=de=>oe.value=!0),onBlur:ue[1]||(ue[1]=de=>oe.value=!1),onClick:ue[2]||(ue[2]=de=>oe.value=!1)},[renderSlot(le.$slots,"default",{file:pe},()=>[le.listType==="picture"||pe.status!=="uploading"&&le.listType==="picture-card"?(openBlock(),createElementBlock("img",{key:0,class:normalizeClass(unref($).be("list","item-thumbnail")),src:pe.url,alt:""},null,10,_hoisted_2$u)):createCommentVNode("v-if",!0),le.listType!=="picture"&&(pe.status==="uploading"||le.listType!=="picture-card")?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(unref($).be("list","item-info"))},[createBaseVNode("a",{class:normalizeClass(unref($).be("list","item-name")),onClick:withModifiers(de=>re(pe),["prevent"])},[createVNode(unref(ElIcon),{class:normalizeClass(unref(L).m("document"))},{default:withCtx(()=>[createVNode(unref(document_default))]),_:1},8,["class"]),createBaseVNode("span",{class:normalizeClass(unref($).be("list","item-file-name"))},toDisplayString(pe.name),3)],10,_hoisted_3$g),pe.status==="uploading"?(openBlock(),createBlock(unref(ElProgress),{key:0,type:le.listType==="picture-card"?"circle":"line","stroke-width":le.listType==="picture-card"?6:2,percentage:Number(pe.percentage),style:normalizeStyle(le.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("label",{class:normalizeClass(unref($).be("list","item-status-label"))},[le.listType==="text"?(openBlock(),createBlock(unref(ElIcon),{key:0,class:normalizeClass([unref(L).m("upload-success"),unref(L).m("circle-check")])},{default:withCtx(()=>[createVNode(unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(le.listType)?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref(L).m("upload-success"),unref(L).m("check")])},{default:withCtx(()=>[createVNode(unref(check_default))]),_:1},8,["class"])):createCommentVNode("v-if",!0)],2),le.disabled?createCommentVNode("v-if",!0):(openBlock(),createBlock(unref(ElIcon),{key:2,class:normalizeClass(unref(L).m("close")),onClick:de=>ae(pe)},{default:withCtx(()=>[createVNode(unref(close_default))]),_:2},1032,["class","onClick"])),createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),createCommentVNode(" This is a bug which needs to be fixed "),createCommentVNode(" TODO: Fix the incorrect navigation interaction "),le.disabled?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("i",{key:3,class:normalizeClass(unref(L).m("close-tip"))},toDisplayString(unref(g)("el.upload.deleteTip")),3)),le.listType==="picture-card"?(openBlock(),createElementBlock("span",{key:4,class:normalizeClass(unref($).be("list","item-actions"))},[createBaseVNode("span",{class:normalizeClass(unref($).be("list","item-preview")),onClick:de=>le.handlePreview(pe)},[createVNode(unref(ElIcon),{class:normalizeClass(unref(L).m("zoom-in"))},{default:withCtx(()=>[createVNode(unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_4$e),le.disabled?createCommentVNode("v-if",!0):(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(unref($).be("list","item-delete")),onClick:de=>ae(pe)},[createVNode(unref(ElIcon),{class:normalizeClass(unref(L).m("delete"))},{default:withCtx(()=>[createVNode(unref(delete_default))]),_:1},8,["class"])],10,_hoisted_5$a))],2)):createCommentVNode("v-if",!0)])],42,_hoisted_1$B))),128)),renderSlot(le.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$2(_sfc_main$C,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const uploadDraggerProps=buildProps({disabled:{type:Boolean,default:!1}}),uploadDraggerEmits={file:e=>isArray$4(e)},_hoisted_1$A=["onDrop","onDragover"],__default__$3={name:"ElUploadDrag"},_sfc_main$B=defineComponent({...__default__$3,props:uploadDraggerProps,emits:uploadDraggerEmits,setup(e,{emit:n}){const r=e,g="ElUploadDrag",$=inject(uploadContextKey);$||throwError(g,"usage: ");const L=useNamespace("upload"),k=ref(!1),oe=ae=>{if(r.disabled)return;k.value=!1;const le=Array.from(ae.dataTransfer.files),ue=$.accept.value;if(!ue){n("file",le);return}const pe=le.filter(de=>{const{type:Fe,name:ze}=de,Ce=ze.includes(".")?`.${ze.split(".").pop()}`:"",Ie=Fe.replace(/\/.*$/,"");return ue.split(",").map(_e=>_e.trim()).filter(_e=>_e).some(_e=>_e.startsWith(".")?Ce===_e:/\/\*$/.test(_e)?Ie===_e.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(_e)?Fe===_e:!1)});n("file",pe)},re=()=>{r.disabled||(k.value=!0)};return(ae,le)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(L).b("dragger"),unref(L).is("dragover",k.value)]),onDrop:withModifiers(oe,["prevent"]),onDragover:withModifiers(re,["prevent"]),onDragleave:le[0]||(le[0]=withModifiers(ue=>k.value=!1,["prevent"]))},[renderSlot(ae.$slots,"default")],42,_hoisted_1$A))}});var UploadDragger=_export_sfc$2(_sfc_main$B,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),_hoisted_1$z=["onKeydown"],_hoisted_2$t=["name","multiple","accept"],__default__$2={name:"ElUploadContent",inheritAttrs:!1},_sfc_main$A=defineComponent({...__default__$2,props:uploadContentProps,setup(e,{expose:n}){const r=e,g=useNamespace("upload"),$=shallowRef({}),L=shallowRef(),k=de=>{if(de.length===0)return;const{autoUpload:Fe,limit:ze,fileList:Ce,multiple:Ie,onStart:_e,onExceed:At}=r;if(ze&&Ce.length+de.length>ze){At(de,Ce);return}Ie||(de=de.slice(0,1));for(const qe of de){const xe=qe;xe.uid=genFileId(),_e(xe),Fe&&oe(xe)}},oe=async de=>{if(L.value.value="",!r.beforeUpload)return re(de);let Fe;try{Fe=await r.beforeUpload(de)}catch{Fe=!1}if(Fe===!1){r.onRemove(de);return}let ze=de;Fe instanceof Blob&&(Fe instanceof File?ze=Fe:ze=new File([Fe],de.name,{type:de.type})),re(Object.assign(ze,{uid:de.uid}))},re=de=>{const{headers:Fe,data:ze,method:Ce,withCredentials:Ie,name:_e,action:At,onProgress:qe,onSuccess:xe,onError:Ve,httpRequest:he}=r,{uid:Oe}=de,$e={headers:Fe||{},withCredentials:Ie,file:de,data:ze,method:Ce,filename:_e,action:At,onProgress:Ue=>{qe(Ue,de)},onSuccess:Ue=>{xe(Ue,de),delete $.value[Oe]},onError:Ue=>{Ve(Ue,de),delete $.value[Oe]}},Ne=he($e);$.value[Oe]=Ne,Ne instanceof Promise&&Ne.then($e.onSuccess,$e.onError)},ae=de=>{const Fe=de.target.files;!Fe||k(Array.from(Fe))},le=()=>{r.disabled||(L.value.value="",L.value.click())},ue=()=>{le()};return n({abort:de=>{entriesOf($.value).filter(de?([ze])=>String(de.uid)===ze:()=>!0).forEach(([ze,Ce])=>{Ce instanceof XMLHttpRequest&&Ce.abort(),delete $.value[ze]})},upload:oe}),(de,Fe)=>(openBlock(),createElementBlock("div",{class:normalizeClass([unref(g).b(),unref(g).m(de.listType),unref(g).is("drag",de.drag)]),tabindex:"0",onClick:le,onKeydown:withKeys(withModifiers(ue,["self"]),["enter","space"])},[de.drag?(openBlock(),createBlock(UploadDragger,{key:0,disabled:de.disabled,onFile:k},{default:withCtx(()=>[renderSlot(de.$slots,"default")]),_:3},8,["disabled"])):renderSlot(de.$slots,"default",{key:1}),createBaseVNode("input",{ref_key:"inputRef",ref:L,class:normalizeClass(unref(g).e("input")),name:de.name,multiple:de.multiple,accept:de.accept,type:"file",onChange:ae,onClick:Fe[0]||(Fe[0]=withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$t)],42,_hoisted_1$z))}});var UploadContent=_export_sfc$2(_sfc_main$A,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const SCOPE$1="ElUpload",revokeObjectURL=e=>{var n;(n=e.url)!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(e.url)},useHandlers=(e,n)=>{const r=useVModel(e,"fileList",void 0,{passive:!0}),g=pe=>r.value.find(de=>de.uid===pe.uid);function $(pe){var de;(de=n.value)==null||de.abort(pe)}function L(pe=["ready","uploading","success","fail"]){r.value=r.value.filter(de=>!pe.includes(de.status))}const k=(pe,de)=>{const Fe=g(de);!Fe||(console.error(pe),Fe.status="fail",r.value.splice(r.value.indexOf(Fe),1),e.onError(pe,Fe,r.value),e.onChange(Fe,r.value))},oe=(pe,de)=>{const Fe=g(de);!Fe||(e.onProgress(pe,Fe,r.value),Fe.status="uploading",Fe.percentage=Math.round(pe.percent))},re=(pe,de)=>{const Fe=g(de);!Fe||(Fe.status="success",Fe.response=pe,e.onSuccess(pe,Fe,r.value),e.onChange(Fe,r.value))},ae=pe=>{const de={name:pe.name,percentage:0,status:"ready",size:pe.size,raw:pe,uid:pe.uid};if(e.listType==="picture-card"||e.listType==="picture")try{de.url=URL.createObjectURL(pe)}catch(Fe){Fe.message,e.onError(Fe,de,r.value)}r.value=[...r.value,de],e.onChange(de,r.value)},le=async pe=>{const de=pe instanceof File?g(pe):pe;de||throwError(SCOPE$1,"file to be removed not found");const Fe=ze=>{$(ze);const Ce=r.value;Ce.splice(Ce.indexOf(ze),1),e.onRemove(ze,Ce),revokeObjectURL(ze)};e.beforeRemove?await e.beforeRemove(de,r.value)!==!1&&Fe(de):Fe(de)};function ue(){r.value.filter(({status:pe})=>pe==="ready").forEach(({raw:pe})=>{var de;return pe&&((de=n.value)==null?void 0:de.upload(pe))})}return watch(()=>e.listType,pe=>{pe!=="picture-card"&&pe!=="picture"||(r.value=r.value.map(de=>{const{raw:Fe,url:ze}=de;if(!ze&&Fe)try{de.url=URL.createObjectURL(Fe)}catch(Ce){e.onError(Ce,de,r.value)}return de}))}),watch(r,pe=>{for(const de of pe)de.uid||(de.uid=genFileId()),de.status||(de.status="success")},{immediate:!0,deep:!0}),{uploadFiles:r,abort:$,clearFiles:L,handleError:k,handleProgress:oe,handleStart:ae,handleSuccess:re,handleRemove:le,submit:ue}},__default__$1={name:"ElUpload"},_sfc_main$z=defineComponent({...__default__$1,props:uploadProps,setup(e,{expose:n}){const r=e,g=useSlots(),$=useDisabled$1(),L=shallowRef(),{abort:k,submit:oe,clearFiles:re,uploadFiles:ae,handleStart:le,handleError:ue,handleRemove:pe,handleSuccess:de,handleProgress:Fe}=useHandlers(r,L),ze=computed(()=>r.listType==="picture-card"),Ce=computed(()=>({...r,onStart:le,onProgress:Fe,onSuccess:de,onError:ue,onRemove:pe}));return onBeforeUnmount(()=>{ae.value.forEach(({url:Ie})=>{Ie?.startsWith("blob:")&&URL.revokeObjectURL(Ie)})}),provide(uploadContextKey,{accept:toRef(r,"accept")}),n({abort:k,submit:oe,clearFiles:re,handleStart:le,handleRemove:pe}),(Ie,_e)=>(openBlock(),createElementBlock("div",null,[unref(ze)&&Ie.showFileList?(openBlock(),createBlock(UploadList,{key:0,disabled:unref($),"list-type":Ie.listType,files:unref(ae),"handle-preview":Ie.onPreview,onRemove:unref(pe)},createSlots({append:withCtx(()=>[Ie.listType==="picture-card"?(openBlock(),createBlock(UploadContent,mergeProps({key:0,ref_key:"uploadRef",ref:L},unref(Ce)),{default:withCtx(()=>[unref(g).trigger?renderSlot(Ie.$slots,"trigger",{key:0}):createCommentVNode("v-if",!0),!unref(g).trigger&&unref(g).default?renderSlot(Ie.$slots,"default",{key:1}):createCommentVNode("v-if",!0)]),_:3},16)):createCommentVNode("v-if",!0)]),_:2},[Ie.$slots.file?{name:"default",fn:withCtx(({file:At})=>[renderSlot(Ie.$slots,"file",{file:At})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):createCommentVNode("v-if",!0),Ie.listType!=="picture-card"?(openBlock(),createBlock(UploadContent,mergeProps({key:1,ref_key:"uploadRef",ref:L},unref(Ce)),{default:withCtx(()=>[unref(g).trigger?renderSlot(Ie.$slots,"trigger",{key:0}):createCommentVNode("v-if",!0),!unref(g).trigger&&unref(g).default?renderSlot(Ie.$slots,"default",{key:1}):createCommentVNode("v-if",!0)]),_:3},16)):createCommentVNode("v-if",!0),Ie.$slots.trigger?renderSlot(Ie.$slots,"default",{key:2}):createCommentVNode("v-if",!0),renderSlot(Ie.$slots,"tip"),!unref(ze)&&Ie.showFileList?(openBlock(),createBlock(UploadList,{key:3,disabled:unref($),"list-type":Ie.listType,files:unref(ae),"handle-preview":Ie.onPreview,onRemove:unref(pe)},createSlots({_:2},[Ie.$slots.file?{name:"default",fn:withCtx(({file:At})=>[renderSlot(Ie.$slots,"file",{file:At})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$2(_sfc_main$z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);const ElUpload=withInstall(Upload);var Components=[ElAffix,ElAlert,ElAutocomplete,ElAutoResizer,ElAvatar,ElBacktop,ElBadge,ElBreadcrumb,ElBreadcrumbItem,ElButton,ElButtonGroup$1,ElCalendar,ElCard,ElCarousel,ElCarouselItem,ElCascader,ElCascaderPanel,ElCheckTag,ElCheckbox,ElCheckboxButton,ElCheckboxGroup$1,ElCol,ElCollapse,ElCollapseItem,ElCollapseTransition,ElColorPicker,ElConfigProvider,ElContainer,ElAside,ElFooter,ElHeader,ElMain,ElDatePicker,ElDescriptions,ElDescriptionsItem,ElDialog,ElDivider,ElDrawer,ElDropdown,ElDropdownItem,ElDropdownMenu,ElEmpty,ElForm,ElFormItem,ElIcon,ElImage,ElImageViewer,ElInput,ElInputNumber,ElLink,ElMenu,ElMenuItem,ElMenuItemGroup,ElPageHeader,ElPagination,ElPopconfirm,ElPopover,ElPopper,ElProgress,ElRadio,ElRadioButton,ElRadioGroup,ElRate,ElResult,ElRow,ElScrollbar,ElSelect,ElOption,ElOptionGroup,ElSelectV2,ElSkeleton,ElSkeletonItem,ElSlider,ElSpace,ElSteps,ElStep,ElSwitch,ElTable,ElTableColumn,ElTableV2,ElTabs,ElTabPane,ElTag,ElTimePicker,ElTimeSelect,ElTimeline,ElTimelineItem,ElTooltip,ElTooltipV2,ElTransfer,ElTree,ElTreeSelect,ElTreeV2,ElUpload];const SCOPE="ElInfiniteScroll",CHECK_INTERVAL=50,DEFAULT_DELAY=200,DEFAULT_DISTANCE=0,attributes={delay:{type:Number,default:DEFAULT_DELAY},distance:{type:Number,default:DEFAULT_DISTANCE},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},getScrollOptions=(e,n)=>Object.entries(attributes).reduce((r,[g,$])=>{var L,k;const{type:oe,default:re}=$,ae=e.getAttribute(`infinite-scroll-${g}`);let le=(k=(L=n[ae])!=null?L:ae)!=null?k:re;return le=le==="false"?!1:le,le=oe(le),r[g]=Number.isNaN(le)?re:le,r},{}),destroyObserver=e=>{const{observer:n}=e[SCOPE];n&&(n.disconnect(),delete e[SCOPE].observer)},handleScroll=(e,n)=>{const{container:r,containerEl:g,instance:$,observer:L,lastScrollTop:k}=e[SCOPE],{disabled:oe,distance:re}=getScrollOptions(e,$),{clientHeight:ae,scrollHeight:le,scrollTop:ue}=g,pe=ue-k;if(e[SCOPE].lastScrollTop=ue,L||oe||pe<0)return;let de=!1;if(r===e)de=le-(ae+ue)<=re;else{const{clientTop:Fe,scrollHeight:ze}=e,Ce=getOffsetTopDistance(e,g);de=ue+ae>=Ce+Fe+ze-re}de&&n.call($)};function checkFull(e,n){const{containerEl:r,instance:g}=e[SCOPE],{disabled:$}=getScrollOptions(e,g);$||r.clientHeight===0||(r.scrollHeight<=r.clientHeight?n.call(g):destroyObserver(e))}const InfiniteScroll={async mounted(e,n){const{instance:r,value:g}=n;isFunction$1(g)||throwError(SCOPE,"'v-infinite-scroll' binding value must be a function"),await nextTick();const{delay:$,immediate:L}=getScrollOptions(e,r),k=getScrollContainer(e,!0),oe=k===window?document.documentElement:k,re=throttle$1(handleScroll.bind(null,e,g),$);if(!!k){if(e[SCOPE]={instance:r,container:k,containerEl:oe,delay:$,cb:g,onScroll:re,lastScrollTop:oe.scrollTop},L){const ae=new MutationObserver(throttle$1(checkFull.bind(null,e,g),CHECK_INTERVAL));e[SCOPE].observer=ae,ae.observe(e,{childList:!0,subtree:!0}),checkFull(e,g)}k.addEventListener("scroll",re)}},unmounted(e){const{container:n,onScroll:r}=e[SCOPE];n?.removeEventListener("scroll",r),destroyObserver(e)},async updated(e){e[SCOPE]||await nextTick();const{containerEl:n,cb:r,observer:g}=e[SCOPE];n.clientHeight&&g&&checkFull(e,r)}},_InfiniteScroll=InfiniteScroll;_InfiniteScroll.install=e=>{e.directive("InfiniteScroll",_InfiniteScroll)};const ElInfiniteScroll=_InfiniteScroll;function createLoadingComponent(e){let n;const r=useNamespace("loading"),g=ref(!1),$=reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function L(de){$.text=de}function k(){const de=$.parent;if(!de.vLoadingAddClassList){let Fe=de.getAttribute("loading-number");Fe=Number.parseInt(Fe)-1,Fe?de.setAttribute("loading-number",Fe.toString()):(removeClass(de,r.bm("parent","relative")),de.removeAttribute("loading-number")),removeClass(de,r.bm("parent","hidden"))}oe(),ue.unmount()}function oe(){var de,Fe;(Fe=(de=pe.$el)==null?void 0:de.parentNode)==null||Fe.removeChild(pe.$el)}function re(){var de;if(e.beforeClose&&!e.beforeClose())return;const Fe=$.parent;Fe.vLoadingAddClassList=void 0,g.value=!0,clearTimeout(n),n=window.setTimeout(()=>{g.value&&(g.value=!1,k())},400),$.visible=!1,(de=e.closed)==null||de.call(e)}function ae(){!g.value||(g.value=!1,k())}const ue=createApp({name:"ElLoading",setup(){return()=>{const de=$.spinner||$.svg,Fe=h$2("svg",{class:"circular",viewBox:$.svgViewBox?$.svgViewBox:"25 25 50 50",...de?{innerHTML:de}:{}},[h$2("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none"})]),ze=$.text?h$2("p",{class:r.b("text")},[$.text]):void 0;return h$2(Transition,{name:r.b("fade"),onAfterLeave:ae},{default:withCtx(()=>[withDirectives(createVNode("div",{style:{backgroundColor:$.background||""},class:[r.b("mask"),$.customClass,$.fullscreen?"is-fullscreen":""]},[h$2("div",{class:r.b("spinner")},[Fe,ze])]),[[vShow,$.visible]])])})}}}),pe=ue.mount(document.createElement("div"));return{...toRefs($),setText:L,removeElLoadingChild:oe,close:re,handleAfterLeave:ae,vm:pe,get $el(){return pe.$el}}}let fullscreenInstance;const Loading=function(e={}){if(!isClient)return;const n=resolveOptions(e);if(n.fullscreen&&fullscreenInstance)return fullscreenInstance;const r=createLoadingComponent({...n,closed:()=>{var $;($=n.closed)==null||$.call(n),n.fullscreen&&(fullscreenInstance=void 0)}});addStyle(n,n.parent,r),addClassList(n,n.parent,r),n.parent.vLoadingAddClassList=()=>addClassList(n,n.parent,r);let g=n.parent.getAttribute("loading-number");return g?g=`${Number.parseInt(g)+1}`:g="1",n.parent.setAttribute("loading-number",g),n.parent.appendChild(r.$el),nextTick(()=>r.visible.value=n.visible),n.fullscreen&&(fullscreenInstance=r),r},resolveOptions=e=>{var n,r,g,$;let L;return isString$2(e.target)?L=(n=document.querySelector(e.target))!=null?n:document.body:L=e.target||document.body,{parent:L===document.body||e.body?document.body:L,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:L===document.body&&((r=e.fullscreen)!=null?r:!0),lock:(g=e.lock)!=null?g:!1,customClass:e.customClass||"",visible:($=e.visible)!=null?$:!0,target:L}},addStyle=async(e,n,r)=>{const{nextZIndex:g}=useZIndex(),$={};if(e.fullscreen)r.originalPosition.value=getStyle(document.body,"position"),r.originalOverflow.value=getStyle(document.body,"overflow"),$.zIndex=g();else if(e.parent===document.body){r.originalPosition.value=getStyle(document.body,"position"),await nextTick();for(const L of["top","left"]){const k=L==="top"?"scrollTop":"scrollLeft";$[L]=`${e.target.getBoundingClientRect()[L]+document.body[k]+document.documentElement[k]-Number.parseInt(getStyle(document.body,`margin-${L}`),10)}px`}for(const L of["height","width"])$[L]=`${e.target.getBoundingClientRect()[L]}px`}else r.originalPosition.value=getStyle(n,"position");for(const[L,k]of Object.entries($))r.$el.style[L]=k},addClassList=(e,n,r)=>{const g=useNamespace("loading");r.originalPosition.value!=="absolute"&&r.originalPosition.value!=="fixed"?addClass(n,g.bm("parent","relative")):removeClass(n,g.bm("parent","relative")),e.fullscreen&&e.lock?addClass(n,g.bm("parent","hidden")):removeClass(n,g.bm("parent","hidden"))},INSTANCE_KEY=Symbol("ElLoading"),createInstance=(e,n)=>{var r,g,$,L;const k=n.instance,oe=pe=>isObject$4(n.value)?n.value[pe]:void 0,re=pe=>{const de=isString$2(pe)&&k?.[pe]||pe;return de&&ref(de)},ae=pe=>re(oe(pe)||e.getAttribute(`element-loading-${hyphenate(pe)}`)),le=(r=oe("fullscreen"))!=null?r:n.modifiers.fullscreen,ue={text:ae("text"),svg:ae("svg"),svgViewBox:ae("svgViewBox"),spinner:ae("spinner"),background:ae("background"),customClass:ae("customClass"),fullscreen:le,target:(g=oe("target"))!=null?g:le?void 0:e,body:($=oe("body"))!=null?$:n.modifiers.body,lock:(L=oe("lock"))!=null?L:n.modifiers.lock};e[INSTANCE_KEY]={options:ue,instance:Loading(ue)}},updateOptions=(e,n)=>{for(const r of Object.keys(n))isRef(n[r])&&(n[r].value=e[r])},vLoading={mounted(e,n){n.value&&createInstance(e,n)},updated(e,n){const r=e[INSTANCE_KEY];n.oldValue!==n.value&&(n.value&&!n.oldValue?createInstance(e,n):n.value&&n.oldValue?isObject$4(n.value)&&updateOptions(n.value,r.options):r?.instance.close())},unmounted(e){var n;(n=e[INSTANCE_KEY])==null||n.instance.close()}},ElLoading={install(e){e.directive("loading",vLoading),e.config.globalProperties.$loading=Loading},directive:vLoading,service:Loading},messageTypes=["success","info","warning","error"],messageDefaults=mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:"",id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},center:{type:Boolean,default:messageDefaults.center},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),required:!1},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},offset:{type:Number,default:messageDefaults.offset},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},instances=shallowReactive([]),getInstance=e=>{const n=instances.findIndex($=>$.id===e),r=instances[n];let g;return n>0&&(g=instances[n-1]),{current:r,prev:g}},getLastOffset=e=>{const{prev:n}=getInstance(e);return n?n.vm.exposeProxy.bottom:0},_hoisted_1$y=["id"],_hoisted_2$s=["innerHTML"],__default__={name:"ElMessage"},_sfc_main$y=defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(e,{expose:n}){const r=e,{Close:g}=TypeComponents,$=useNamespace("message"),L=ref(),k=ref(!1),oe=ref(0);let re;const ae=computed(()=>r.type?r.type==="error"?"danger":r.type:"info"),le=computed(()=>{const qe=r.type;return{[$.bm("icon",qe)]:qe&&TypeComponentsMap[qe]}}),ue=computed(()=>r.icon||TypeComponentsMap[r.type]||""),pe=computed(()=>getLastOffset(r.id)),de=computed(()=>r.offset+pe.value),Fe=computed(()=>oe.value+de.value),ze=computed(()=>({top:`${de.value}px`,zIndex:r.zIndex}));function Ce(){r.duration!==0&&({stop:re}=useTimeoutFn(()=>{_e()},r.duration))}function Ie(){re?.()}function _e(){k.value=!1}function At({code:qe}){qe===EVENT_CODE.esc&&_e()}return onMounted(()=>{Ce(),k.value=!0}),watch(()=>r.repeatNum,()=>{Ie(),Ce()}),useEventListener(document,"keydown",At),useResizeObserver(L,()=>{oe.value=L.value.getBoundingClientRect().height}),n({visible:k,bottom:Fe,close:_e}),(qe,xe)=>(openBlock(),createBlock(Transition,{name:unref($).b("fade"),onBeforeLeave:qe.onClose,onAfterLeave:xe[0]||(xe[0]=Ve=>qe.$emit("destroy")),persisted:""},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{id:qe.id,ref_key:"messageRef",ref:L,class:normalizeClass([unref($).b(),{[unref($).m(qe.type)]:qe.type&&!qe.icon},unref($).is("center",qe.center),unref($).is("closable",qe.showClose),qe.customClass]),style:normalizeStyle(unref(ze)),role:"alert",onMouseenter:Ie,onMouseleave:Ce},[qe.repeatNum>1?(openBlock(),createBlock(unref(ElBadge),{key:0,value:qe.repeatNum,type:unref(ae),class:normalizeClass(unref($).e("badge"))},null,8,["value","type","class"])):createCommentVNode("v-if",!0),unref(ue)?(openBlock(),createBlock(unref(ElIcon),{key:1,class:normalizeClass([unref($).e("icon"),unref(le)])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(ue))))]),_:1},8,["class"])):createCommentVNode("v-if",!0),renderSlot(qe.$slots,"default",{},()=>[qe.dangerouslyUseHTMLString?(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),createBaseVNode("p",{class:normalizeClass(unref($).e("content")),innerHTML:qe.message},null,10,_hoisted_2$s)],2112)):(openBlock(),createElementBlock("p",{key:0,class:normalizeClass(unref($).e("content"))},toDisplayString(qe.message),3))]),qe.showClose?(openBlock(),createBlock(unref(ElIcon),{key:2,class:normalizeClass(unref($).e("closeBtn")),onClick:withModifiers(_e,["stop"])},{default:withCtx(()=>[createVNode(unref(g))]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0)],46,_hoisted_1$y),[[vShow,k.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$2(_sfc_main$y,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let seed$1=1;const normalizeOptions=e=>{const n=!e||isString$2(e)||isVNode(e)||isFunction$1(e)?{message:e}:e,r={...messageDefaults,...n};if(!r.appendTo)r.appendTo=document.body;else if(isString$2(r.appendTo)){let g=document.querySelector(r.appendTo);isElement$1(g)||(g=document.body),r.appendTo=g}return r},closeMessage=e=>{const n=instances.indexOf(e);if(n===-1)return;instances.splice(n,1);const{handler:r}=e;r.close()},createMessage=({appendTo:e,...n},r)=>{const{nextZIndex:g}=useZIndex(),$=`message_${seed$1++}`,L=n.onClose,k=document.createElement("div"),oe={...n,zIndex:g()+n.zIndex,id:$,onClose:()=>{L?.(),closeMessage(ue)},onDestroy:()=>{render(null,k)}},re=createVNode(MessageConstructor,oe,isFunction$1(oe.message)||isVNode(oe.message)?{default:oe.message}:null);re.appContext=r||message._context,render(re,k),e.appendChild(k.firstElementChild);const ae=re.component,ue={id:$,vnode:re,vm:ae,handler:{close:()=>{ae.exposeProxy.visible=!1}},props:re.component.props};return ue},message=(e={},n)=>{if(!isClient)return{close:()=>{}};if(isNumber(messageConfig.max)&&instances.length>=messageConfig.max)return{close:()=>{}};const r=normalizeOptions(e);if(r.grouping&&instances.length){const $=instances.find(({vnode:L})=>{var k;return((k=L.props)==null?void 0:k.message)===r.message});if($)return $.props.repeatNum+=1,$.props.type=r.type,$.handler}const g=createMessage(r,n);return instances.push(g),g.handler};messageTypes.forEach(e=>{message[e]=(n={},r)=>{const g=normalizeOptions(n);return message({...g,type:e},r)}});function closeAll$1(e){for(const n of instances)(!e||e===n.props.type)&&n.handler.close()}message.closeAll=closeAll$1;message._context=null;const ElMessage=withInstallFunction(message,"$message"),_sfc_main$x=defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:n}){const{t:r}=useLocale(),g=useNamespace("message-box"),$=ref(!1),{nextZIndex:L}=useZIndex(),k=reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:L()}),oe=computed(()=>{const Et=k.type;return{[g.bm("icon",Et)]:Et&&TypeComponentsMap[Et]}}),re=useId(),ae=useId(),le=useSize(computed(()=>e.buttonSize),{prop:!0,form:!0,formItem:!0}),ue=computed(()=>k.icon||TypeComponentsMap[k.type]||""),pe=computed(()=>!!k.message),de=ref(),Fe=ref(),ze=ref(),Ce=ref(),Ie=ref(),_e=computed(()=>k.confirmButtonClass);watch(()=>k.inputValue,async Et=>{await nextTick(),e.boxType==="prompt"&&Et!==null&&$e()},{immediate:!0}),watch(()=>$.value,Et=>{var Pt,Lt;Et&&(e.boxType!=="prompt"&&(k.autofocus?ze.value=(Lt=(Pt=Ie.value)==null?void 0:Pt.$el)!=null?Lt:de.value:ze.value=de.value),k.zIndex=L()),e.boxType==="prompt"&&(Et?nextTick().then(()=>{var vn;Ce.value&&Ce.value.$el&&(k.autofocus?ze.value=(vn=Ne())!=null?vn:de.value:ze.value=de.value)}):(k.editorErrorMessage="",k.validateError=!1))});const At=computed(()=>e.draggable);useDraggable(de,Fe,At),onMounted(async()=>{await nextTick(),e.closeOnHashChange&&window.addEventListener("hashchange",qe)}),onBeforeUnmount(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",qe)});function qe(){!$.value||($.value=!1,nextTick(()=>{k.action&&n("action",k.action)}))}const xe=()=>{e.closeOnClickModal&&Oe(k.distinguishCancelAndClose?"close":"cancel")},Ve=useSameTarget(xe),he=Et=>{if(k.inputType!=="textarea")return Et.preventDefault(),Oe("confirm")},Oe=Et=>{var Pt;e.boxType==="prompt"&&Et==="confirm"&&!$e()||(k.action=Et,k.beforeClose?(Pt=k.beforeClose)==null||Pt.call(k,Et,k,qe):qe())},$e=()=>{if(e.boxType==="prompt"){const Et=k.inputPattern;if(Et&&!Et.test(k.inputValue||""))return k.editorErrorMessage=k.inputErrorMessage||r("el.messagebox.error"),k.validateError=!0,!1;const Pt=k.inputValidator;if(typeof Pt=="function"){const Lt=Pt(k.inputValue);if(Lt===!1)return k.editorErrorMessage=k.inputErrorMessage||r("el.messagebox.error"),k.validateError=!0,!1;if(typeof Lt=="string")return k.editorErrorMessage=Lt,k.validateError=!0,!1}}return k.editorErrorMessage="",k.validateError=!1,!0},Ne=()=>{const Et=Ce.value.$refs;return Et.input||Et.textarea},Ue=()=>{Oe("close")},kt=()=>{e.closeOnPressEscape&&Ue()};return e.lockScroll&&useLockscreen($),useRestoreActive($),{...toRefs(k),ns:g,overlayEvent:Ve,visible:$,hasMessage:pe,typeClass:oe,contentId:re,inputId:ae,btnSize:le,iconComponent:ue,confirmButtonClasses:_e,rootRef:de,focusStartRef:ze,headerRef:Fe,inputRef:Ce,confirmRef:Ie,doClose:qe,handleClose:Ue,onCloseRequested:kt,handleWrapperClick:xe,handleInputEnter:he,handleAction:Oe,t:r}}}),_hoisted_1$x=["aria-label","aria-describedby"],_hoisted_2$r=["aria-label"],_hoisted_3$f=["id"];function _sfc_render$x(e,n,r,g,$,L){const k=resolveComponent("el-icon"),oe=resolveComponent("close"),re=resolveComponent("el-input"),ae=resolveComponent("el-button"),le=resolveComponent("el-focus-trap"),ue=resolveComponent("el-overlay");return openBlock(),createBlock(Transition,{name:"fade-in-linear",onAfterLeave:n[11]||(n[11]=pe=>e.$emit("vanish")),persisted:""},{default:withCtx(()=>[withDirectives(createVNode(ue,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:withCtx(()=>[createBaseVNode("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:normalizeClass(`${e.ns.namespace.value}-overlay-message-box`),onClick:n[8]||(n[8]=(...pe)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...pe)),onMousedown:n[9]||(n[9]=(...pe)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...pe)),onMouseup:n[10]||(n[10]=(...pe)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...pe))},[createVNode(le,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:withCtx(()=>[createBaseVNode("div",{ref:"rootRef",class:normalizeClass([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:normalizeStyle(e.customStyle),tabindex:"-1",onClick:n[7]||(n[7]=withModifiers(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(openBlock(),createElementBlock("div",{key:0,ref:"headerRef",class:normalizeClass(e.ns.e("header"))},[createBaseVNode("div",{class:normalizeClass(e.ns.e("title"))},[e.iconComponent&&e.center?(openBlock(),createBlock(k,{key:0,class:normalizeClass([e.ns.e("status"),e.typeClass])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),createBaseVNode("span",null,toDisplayString(e.title),1)],2),e.showClose?(openBlock(),createElementBlock("button",{key:0,type:"button",class:normalizeClass(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:n[0]||(n[0]=pe=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:n[1]||(n[1]=withKeys(withModifiers(pe=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[createVNode(k,{class:normalizeClass(e.ns.e("close"))},{default:withCtx(()=>[createVNode(oe)]),_:1},8,["class"])],42,_hoisted_2$r)):createCommentVNode("v-if",!0)],2)):createCommentVNode("v-if",!0),createBaseVNode("div",{id:e.contentId,class:normalizeClass(e.ns.e("content"))},[createBaseVNode("div",{class:normalizeClass(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(openBlock(),createBlock(k,{key:0,class:normalizeClass([e.ns.e("status"),e.typeClass])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),e.hasMessage?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(e.ns.e("message"))},[renderSlot(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(openBlock(),createBlock(resolveDynamicComponent(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(openBlock(),createBlock(resolveDynamicComponent(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:withCtx(()=>[createTextVNode(toDisplayString(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):createCommentVNode("v-if",!0)],2),withDirectives(createBaseVNode("div",{class:normalizeClass(e.ns.e("input"))},[createVNode(re,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":n[2]||(n[2]=pe=>e.inputValue=pe),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:normalizeClass({invalid:e.validateError}),onKeydown:withKeys(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),createBaseVNode("div",{class:normalizeClass(e.ns.e("errormsg")),style:normalizeStyle({visibility:e.editorErrorMessage?"visible":"hidden"})},toDisplayString(e.editorErrorMessage),7)],2),[[vShow,e.showInput]])],10,_hoisted_3$f),createBaseVNode("div",{class:normalizeClass(e.ns.e("btns"))},[e.showCancelButton?(openBlock(),createBlock(ae,{key:0,loading:e.cancelButtonLoading,class:normalizeClass([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:n[3]||(n[3]=pe=>e.handleAction("cancel")),onKeydown:n[4]||(n[4]=withKeys(withModifiers(pe=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:withCtx(()=>[createTextVNode(toDisplayString(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):createCommentVNode("v-if",!0),withDirectives(createVNode(ae,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,class:normalizeClass([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:n[5]||(n[5]=pe=>e.handleAction("confirm")),onKeydown:n[6]||(n[6]=withKeys(withModifiers(pe=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:withCtx(()=>[createTextVNode(toDisplayString(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[vShow,e.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$x)]),_:3},8,["z-index","overlay-class","mask"]),[[vShow,e.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$2(_sfc_main$x,[["render",_sfc_render$x],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const messageInstance=new Map,initInstance=(e,n,r=null)=>{const g=h$2(MessageBoxConstructor,e);return g.appContext=r,render(g,n),document.body.appendChild(n.firstElementChild),g.component},genContainer=()=>document.createElement("div"),showMessage=(e,n)=>{const r=genContainer();e.onVanish=()=>{render(null,r),messageInstance.delete($)},e.onAction=L=>{const k=messageInstance.get($);let oe;e.showInput?oe={value:$.inputValue,action:L}:oe=L,e.callback?e.callback(oe,g.proxy):L==="cancel"||L==="close"?e.distinguishCancelAndClose&&L!=="cancel"?k.reject("close"):k.reject("cancel"):k.resolve(oe)};const g=initInstance(e,r,n),$=g.proxy;for(const L in e)hasOwn(e,L)&&!hasOwn($.$props,L)&&($[L]=e[L]);return watch(()=>$.message,(L,k)=>{isVNode(L)?g.slots.default=()=>[L]:isVNode(k)&&!isVNode(L)&&delete g.slots.default},{immediate:!0}),$.visible=!0,$};function MessageBox(e,n=null){if(!isClient)return Promise.reject();let r;return isString$2(e)||isVNode(e)?e={message:e}:r=e.callback,new Promise((g,$)=>{const L=showMessage(e,n??MessageBox._context);messageInstance.set(L,{options:e,callback:r,resolve:g,reject:$})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(e=>{MessageBox[e]=messageBoxFactory(e)});function messageBoxFactory(e){return(n,r,g,$)=>{let L;return isObject$4(r)?(g=r,L=""):isUndefined(r)?L="":L=r,MessageBox(Object.assign({title:L,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[e]},g,{boxType:e}),$)}}MessageBox.close=()=>{messageInstance.forEach((e,n)=>{n.doClose()}),messageInstance.clear()};MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=e=>{_MessageBox._context=e._context,e.config.globalProperties.$msgbox=_MessageBox,e.config.globalProperties.$messageBox=_MessageBox,e.config.globalProperties.$alert=_MessageBox.alert,e.config.globalProperties.$confirm=_MessageBox.confirm,e.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,notificationTypes=["success","info","warning","error"],notificationProps=buildProps({customClass:{type:String,default:""},dangerouslyUseHTMLString:{type:Boolean,default:!1},duration:{type:Number,default:4500},icon:{type:definePropType([String,Object]),default:""},id:{type:String,default:""},message:{type:definePropType([String,Object]),default:""},offset:{type:Number,default:0},onClick:{type:definePropType(Function),default:()=>{}},onClose:{type:definePropType(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...notificationTypes,""],default:""},zIndex:{type:Number,default:0}}),notificationEmits={destroy:()=>!0},_sfc_main$w=defineComponent({name:"ElNotification",components:{ElIcon,...TypeComponents},props:notificationProps,emits:notificationEmits,setup(e){const n=useNamespace("notification"),r=ref(!1);let g;const $=computed(()=>{const de=e.type;return de&&TypeComponentsMap[e.type]?n.m(de):""}),L=computed(()=>TypeComponentsMap[e.type]||e.icon||""),k=computed(()=>e.position.endsWith("right")?"right":"left"),oe=computed(()=>e.position.startsWith("top")?"top":"bottom"),re=computed(()=>({[oe.value]:`${e.offset}px`,zIndex:e.zIndex}));function ae(){e.duration>0&&({stop:g}=useTimeoutFn(()=>{r.value&&ue()},e.duration))}function le(){g?.()}function ue(){r.value=!1}function pe({code:de}){de===EVENT_CODE.delete||de===EVENT_CODE.backspace?le():de===EVENT_CODE.esc?r.value&&ue():ae()}return onMounted(()=>{ae(),r.value=!0}),useEventListener(document,"keydown",pe),{ns:n,horizontalClass:k,typeClass:$,iconComponent:L,positionStyle:re,visible:r,close:ue,clearTimer:le,startTimer:ae}}}),_hoisted_1$w=["id"],_hoisted_2$q=["textContent"],_hoisted_3$e={key:0},_hoisted_4$d=["innerHTML"];function _sfc_render$w(e,n,r,g,$,L){const k=resolveComponent("el-icon"),oe=resolveComponent("close");return openBlock(),createBlock(Transition,{name:e.ns.b("fade"),onBeforeLeave:e.onClose,onAfterLeave:n[3]||(n[3]=re=>e.$emit("destroy")),persisted:""},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{id:e.id,class:normalizeClass([e.ns.b(),e.customClass,e.horizontalClass]),style:normalizeStyle(e.positionStyle),role:"alert",onMouseenter:n[0]||(n[0]=(...re)=>e.clearTimer&&e.clearTimer(...re)),onMouseleave:n[1]||(n[1]=(...re)=>e.startTimer&&e.startTimer(...re)),onClick:n[2]||(n[2]=(...re)=>e.onClick&&e.onClick(...re))},[e.iconComponent?(openBlock(),createBlock(k,{key:0,class:normalizeClass([e.ns.e("icon"),e.typeClass])},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):createCommentVNode("v-if",!0),createBaseVNode("div",{class:normalizeClass(e.ns.e("group"))},[createBaseVNode("h2",{class:normalizeClass(e.ns.e("title")),textContent:toDisplayString(e.title)},null,10,_hoisted_2$q),withDirectives(createBaseVNode("div",{class:normalizeClass(e.ns.e("content")),style:normalizeStyle(e.title?void 0:{margin:0})},[renderSlot(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(openBlock(),createElementBlock(Fragment,{key:1},[createCommentVNode(" Caution here, message could've been compromized, nerver use user's input as message "),createCommentVNode(" eslint-disable-next-line "),createBaseVNode("p",{innerHTML:e.message},null,8,_hoisted_4$d)],2112)):(openBlock(),createElementBlock("p",_hoisted_3$e,toDisplayString(e.message),1))])],6),[[vShow,e.message]]),e.showClose?(openBlock(),createBlock(k,{key:0,class:normalizeClass(e.ns.e("closeBtn")),onClick:withModifiers(e.close,["stop"])},{default:withCtx(()=>[createVNode(oe)]),_:1},8,["class","onClick"])):createCommentVNode("v-if",!0)],2)],46,_hoisted_1$w),[[vShow,e.visible]])]),_:3},8,["name","onBeforeLeave"])}var NotificationConstructor=_export_sfc$2(_sfc_main$w,[["render",_sfc_render$w],["__file","/home/runner/work/element-plus/element-plus/packages/components/notification/src/notification.vue"]]);const notifications={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},GAP_SIZE=16;let seed=1;const notify=function(e={},n=null){if(!isClient)return{close:()=>{}};(typeof e=="string"||isVNode(e))&&(e={message:e});const r=e.position||"top-right";let g=e.offset||0;notifications[r].forEach(({vm:ue})=>{var pe;g+=(((pe=ue.el)==null?void 0:pe.offsetHeight)||0)+GAP_SIZE}),g+=GAP_SIZE;const{nextZIndex:$}=useZIndex(),L=`notification_${seed++}`,k=e.onClose,oe={...e,zIndex:$(),offset:g,id:L,onClose:()=>{close(L,r,k)}};let re=document.body;isElement$1(e.appendTo)?re=e.appendTo:isString$2(e.appendTo)&&(re=document.querySelector(e.appendTo)),isElement$1(re)||(re=document.body);const ae=document.createElement("div"),le=createVNode(NotificationConstructor,oe,isVNode(oe.message)?{default:()=>oe.message}:null);return le.appContext=n??notify._context,le.props.onDestroy=()=>{render(null,ae)},render(le,ae),notifications[r].push({vm:le}),re.appendChild(ae.firstElementChild),{close:()=>{le.component.proxy.visible=!1}}};notificationTypes.forEach(e=>{notify[e]=(n={})=>((typeof n=="string"||isVNode(n))&&(n={message:n}),notify({...n,type:e}))});function close(e,n,r){const g=notifications[n],$=g.findIndex(({vm:ae})=>{var le;return((le=ae.component)==null?void 0:le.props.id)===e});if($===-1)return;const{vm:L}=g[$];if(!L)return;r?.(L);const k=L.el.offsetHeight,oe=n.split("-")[0];g.splice($,1);const re=g.length;if(!(re<1))for(let ae=$;ae{n.component.proxy.visible=!1})}notify.closeAll=closeAll;notify._context=null;const ElNotification=withInstallFunction(notify,"$notify");var Plugins=[ElInfiniteScroll,ElLoading,ElMessage,ElMessageBox,ElNotification,ElPopoverDirective],installer=makeInstaller([...Components,...Plugins]);const index$1="";var zhCn={name:"zh-cn",el:{colorpicker:{confirm:"\u786E\u5B9A",clear:"\u6E05\u7A7A"},datepicker:{now:"\u6B64\u523B",today:"\u4ECA\u5929",cancel:"\u53D6\u6D88",clear:"\u6E05\u7A7A",confirm:"\u786E\u5B9A",selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startDate:"\u5F00\u59CB\u65E5\u671F",startTime:"\u5F00\u59CB\u65F6\u95F4",endDate:"\u7ED3\u675F\u65E5\u671F",endTime:"\u7ED3\u675F\u65F6\u95F4",prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",prevMonth:"\u4E0A\u4E2A\u6708",nextMonth:"\u4E0B\u4E2A\u6708",year:"\u5E74",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{jan:"\u4E00\u6708",feb:"\u4E8C\u6708",mar:"\u4E09\u6708",apr:"\u56DB\u6708",may:"\u4E94\u6708",jun:"\u516D\u6708",jul:"\u4E03\u6708",aug:"\u516B\u6708",sep:"\u4E5D\u6708",oct:"\u5341\u6708",nov:"\u5341\u4E00\u6708",dec:"\u5341\u4E8C\u6708"}},select:{loading:"\u52A0\u8F7D\u4E2D",noMatch:"\u65E0\u5339\u914D\u6570\u636E",noData:"\u65E0\u6570\u636E",placeholder:"\u8BF7\u9009\u62E9"},cascader:{noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D",placeholder:"\u8BF7\u9009\u62E9",noData:"\u6682\u65E0\u6570\u636E"},pagination:{goto:"\u524D\u5F80",pagesize:"\u6761/\u9875",total:"\u5171 {total} \u6761",pageClassifier:"\u9875",deprecationWarning:"\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"},messagebox:{title:"\u63D0\u793A",confirm:"\u786E\u5B9A",cancel:"\u53D6\u6D88",error:"\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"},upload:{deleteTip:"\u6309 delete \u952E\u53EF\u5220\u9664",delete:"\u5220\u9664",preview:"\u67E5\u770B\u56FE\u7247",continue:"\u7EE7\u7EED\u4E0A\u4F20"},table:{emptyText:"\u6682\u65E0\u6570\u636E",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"},transfer:{noMatch:"\u65E0\u5339\u914D\u6570\u636E",noData:"\u65E0\u6570\u636E",titles:["\u5217\u8868 1","\u5217\u8868 2"],filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",noCheckedFormat:"\u5171 {total} \u9879",hasCheckedFormat:"\u5DF2\u9009 {checked}/{total} \u9879"},image:{error:"\u52A0\u8F7D\u5931\u8D25"},pageHeader:{title:"\u8FD4\u56DE"},popconfirm:{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88"}}},OBJECT$1="object";function isObject$1(e){return e&&typeof e===OBJECT$1}function now(){return Date.now?Date.now():new Date().getTime()}function findIndex$1(e,n,r){r===void 0&&(r=-1);for(var g=e.length,$=0;$-1&&L.splice(k,1)}}return this},n.once=function(r,g){var $=this;return g&&this._addEvent(r,g,{once:!0}),new Promise(function(L){$._addEvent(r,L,{once:!0})})},n.emit=function(r,g){var $=this;g===void 0&&(g={});var L=this._events[r];if(!r||!L)return!0;var k=!1;return g.eventType=r,g.stop=function(){k=!0},g.currentTarget=this,__spreadArrays$1(L).forEach(function(oe){oe.listener(g),oe.once&&$.off(r,oe.listener)}),!k},n.trigger=function(r,g){return g===void 0&&(g={}),this.emit(r,g)},n._addEvent=function(r,g,$){var L=this._events;L[r]=L[r]||[];var k=L[r];k.push(__assign$2({listener:g},$))},e}();const EventEmitter$2=EventEmitter$1;/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */var extendStatics$1=function(e,n){return extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,g){r.__proto__=g}||function(r,g){for(var $ in g)g.hasOwnProperty($)&&(r[$]=g[$])},extendStatics$1(e,n)};function __extends$1(e,n){extendStatics$1(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}var __assign$1=function(){return __assign$1=Object.assign||function(n){for(var r,g=1,$=arguments.length;g<$;g++){r=arguments[g];for(var L in r)Object.prototype.hasOwnProperty.call(r,L)&&(n[L]=r[L])}return n},__assign$1.apply(this,arguments)};function getRad(e,n){var r=n[0]-e[0],g=n[1]-e[1],$=Math.atan2(g,r);return $>=0?$:$+Math.PI*2}function getRotatiion(e){return getRad([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function isMultiTouch(e){return e.touches&&e.touches.length>=2}function getEventClients(e){return e?e.touches?getClients(e.touches):[getClient(e)]:[]}function isMouseEvent(e){return e&&(e.type.indexOf("mouse")>-1||"button"in e||"which"in e)}function getPosition(e,n,r){var g=r.length,$=getAverageClient(e,g),L=$.clientX,k=$.clientY,oe=$.originalClientX,re=$.originalClientY,ae=getAverageClient(n,g),le=ae.clientX,ue=ae.clientY,pe=getAverageClient(r,g),de=pe.clientX,Fe=pe.clientY,ze=L-le,Ce=k-ue,Ie=L-de,_e=k-Fe;return{clientX:oe,clientY:re,deltaX:ze,deltaY:Ce,distX:Ie,distY:_e}}function getDist(e){return Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2))}function getClients(e){for(var n=Math.min(e.length,2),r=[],g=0;g-1,Pt=Ue.isContentEditable;if(Et||Pt){if(qe||Ne===Ue||Ne&&Pt&&Ne.isContentEditable&&Ne.contains(Ue))return!1}else if((At||pe.type==="touchstart")&&Ne){var Lt=Ne.tagName;(Ne.isContentEditable||INPUT_TAGNAMES.indexOf(Lt)>-1)&&Ne.blur()}(xe||Ve||he)&&addEvent$1(window,"click",L._onClick,!0),L.clientStores=[new ClientStore(getEventClients(pe))],L.flag=!0,L.isDrag=!1,L._dragFlag=!0,L.datas={},L.doubleFlag=now()-L.prevTime<200,L._isMouseEvent=isMouseEvent(pe);var vn=L.emit("dragStart",__assign$1(__assign$1({datas:L.datas,inputEvent:pe,isMouseEvent:L._isMouseEvent,isSecondaryButton:L._isSecondaryButton,isTrusted:de,isDouble:L.doubleFlag},L.getCurrentStore().getPosition()),{preventDefault:function(){pe.preventDefault()},preventDrag:function(){L._dragFlag=!1}}));vn===!1&&L.initDrag(),L.flag&&At&&pe.preventDefault()}if(!L.flag)return!1;var hn=0;if($e&&Oe&&Ce&&(hn=setTimeout(function(){addEvent$1(ze,"touchstart",L.onDragStart,{passive:!1})})),!$e&&Oe&&Ce&&removeEvent$1(ze,"touchstart",L.onDragStart),L.flag&&isMultiTouch(pe)){if(clearTimeout(hn),$e&&pe.touches.length!==pe.changedTouches.length)return;L.pinchFlag||L.onPinchStart(pe)}}},L.onDrag=function(pe,de){if(!!L.flag){var Fe=getEventClients(pe),ze=L.moveClients(Fe,pe,!1);if(L._dragFlag){if(L.pinchFlag||ze.deltaX||ze.deltaY){var Ce=L.emit("drag",__assign$1(__assign$1({},ze),{isScroll:!!de,inputEvent:pe}));if(Ce===!1){L.stop();return}}L.pinchFlag&&L.onPinch(pe,Fe)}L.getCurrentStore().getPosition(Fe,!0)}},L.onDragEnd=function(pe){if(!!L.flag){var de=L.options,Fe=de.pinchOutside,ze=de.container,Ce=de.preventClickEventOnDrag,Ie=de.preventClickEventOnDragStart,_e=de.preventClickEventByCondition,At=L.isDrag;(Ce||Ie||_e)&&requestAnimationFrame(function(){L._allowClickEvent()}),!_e&&!Ie&&Ce&&!At&&L._allowClickEvent(),L.isTouch&&Fe&&removeEvent$1(ze,"touchstart",L.onDragStart),L.pinchFlag&&L.onPinchEnd(pe);var qe=pe?.touches?getEventClients(pe):[],xe=qe.length;xe===0||!L.options.keepDragging?L.flag=!1:L._addStore(new ClientStore(qe));var Ve=L._getPosition(),he=now(),Oe=!At&&L.doubleFlag;L.prevTime=At||Oe?0:he,L.flag||(L.emit("dragEnd",__assign$1({datas:L.datas,isDouble:Oe,isDrag:At,isClick:!At,isMouseEvent:L._isMouseEvent,isSecondaryButton:L._isSecondaryButton,inputEvent:pe},Ve)),L.clientStores=[])}},L.onBlur=function(){L.onDragEnd()},L._allowClickEvent=function(){removeEvent$1(window,"click",L._onClick,!0)},L._onClick=function(pe){var de=L.options.preventClickEventByCondition;de?.(pe)||(pe.stopPropagation(),pe.preventDefault())},L._onContextMenu=function(pe){var de=L.options;de.preventRightClick?L.onDragEnd(pe):pe.preventDefault()};var k=[].concat(g);L.options=__assign$1({checkInput:!1,container:k.length>1?window:k[0],preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},$);var oe=L.options,re=oe.container,ae=oe.events,le=oe.checkWindowBlur;if(L.isTouch=ae.indexOf("touch")>-1,L.isMouse=ae.indexOf("mouse")>-1,L.targets=k,L.isMouse&&(k.forEach(function(pe){addEvent$1(pe,"mousedown",L.onDragStart)}),addEvent$1(re,"mousemove",L.onDrag),addEvent$1(re,"mouseup",L.onDragEnd),addEvent$1(re,"contextmenu",L._onContextMenu)),le&&addEvent$1(window,"blur",L.onBlur),L.isTouch){var ue={passive:!1};k.forEach(function(pe){addEvent$1(pe,"touchstart",L.onDragStart,ue)}),addEvent$1(re,"touchmove",L.onDrag,ue),addEvent$1(re,"touchend",L.onDragEnd,ue),addEvent$1(re,"touchcancel",L.onDragEnd,ue)}return L}var r=n.prototype;return r.stop=function(){this.isDrag=!1,this.flag=!1,this.clientStores=[],this.datas={}},r.getMovement=function(g){return this.getCurrentStore().getMovement(g)+this.clientStores.slice(1).reduce(function($,L){return $+L.movement},0)},r.isDragging=function(){return this.isDrag},r.isFlag=function(){return this.flag},r.isPinchFlag=function(){return this.pinchFlag},r.isDoubleFlag=function(){return this.doubleFlag},r.isPinching=function(){return this.isPinch},r.scrollBy=function(g,$,L,k){k===void 0&&(k=!0),this.flag&&(this.clientStores[0].move(g,$),k&&this.onDrag(L,!0))},r.move=function(g,$){var L=g[0],k=g[1],oe=this.getCurrentStore(),re=oe.prevClients;return this.moveClients(re.map(function(ae){var le=ae.clientX,ue=ae.clientY;return{clientX:le+L,clientY:ue+k,originalClientX:le,originalClientY:ue}}),$,!0)},r.triggerDragStart=function(g){this.onDragStart(g,!1)},r.setEventDatas=function(g){var $=this.datas;for(var L in g)$[L]=g[L];return this},r.getCurrentEvent=function(g){return __assign$1(__assign$1({datas:this.datas},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:g})},r.getEventDatas=function(){return this.datas},r.unset=function(){var g=this,$=this.targets,L=this.options.container;this.off(),removeEvent$1(window,"blur",this.onBlur),this.isMouse&&($.forEach(function(k){removeEvent$1(k,"mousedown",g.onDragStart)}),removeEvent$1(L,"mousemove",this.onDrag),removeEvent$1(L,"mouseup",this.onDragEnd),removeEvent$1(L,"contextmenu",this._onContextMenu)),this.isTouch&&($.forEach(function(k){removeEvent$1(k,"touchstart",g.onDragStart)}),removeEvent$1(L,"touchstart",this.onDragStart),removeEvent$1(L,"touchmove",this.onDrag),removeEvent$1(L,"touchend",this.onDragEnd),removeEvent$1(L,"touchcancel",this.onDragEnd))},r.onPinchStart=function(g){var $=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>$)){var L=new ClientStore(getEventClients(g));this.pinchFlag=!0,this._addStore(L);var k=this.emit("pinchStart",__assign$1(__assign$1({datas:this.datas,angle:L.getAngle(),touches:this.getCurrentStore().getPositions()},L.getPosition()),{inputEvent:g}));k===!1&&(this.pinchFlag=!1)}},r.onPinch=function(g,$){if(!(!this.flag||!this.pinchFlag||$.length<2)){var L=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",__assign$1(__assign$1({datas:this.datas,movement:this.getMovement($),angle:L.getAngle($),rotation:L.getRotation($),touches:L.getPositions($),scale:L.getScale($),distance:L.getDistance($)},L.getPosition($)),{inputEvent:g}))}},r.onPinchEnd=function(g){if(!!this.pinchFlag){var $=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var L=this.getCurrentStore();this.emit("pinchEnd",__assign$1(__assign$1({datas:this.datas,isPinch:$,touches:L.getPositions()},L.getPosition()),{inputEvent:g}))}},r.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._allowClickEvent()},r.getCurrentStore=function(){return this.clientStores[0]},r.moveClients=function(g,$,L){var k=this._getPosition(g,L);return(k.deltaX||k.deltaY)&&(this.isDrag=!0),__assign$1(__assign$1({datas:this.datas},k),{movement:this.getMovement(g),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:$})},r._addStore=function(g){this.clientStores.splice(0,0,g)},r._getPosition=function(g,$){var L=this.getCurrentStore(),k=L.getPosition(g,$),oe=this.clientStores.slice(1).reduce(function(le,ue){var pe=ue.getPosition();return le.distX+=pe.distX,le.distY+=pe.distY,le},k),re=oe.distX,ae=oe.distY;return __assign$1(__assign$1({},k),{distX:re,distY:ae})},n}(EventEmitter$2);const Gesto$1=Gesto,DefaultBufferLength=1024;let nextPropID=0;class Range$1{constructor(n,r){this.from=n,this.to=r}}class NodeProp{constructor(n={}){this.id=nextPropID++,this.perNode=!!n.perNode,this.deserialize=n.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(n){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof n!="function"&&(n=NodeType.match(n)),r=>{let g=n(r);return g===void 0?null:[this,g]}}}NodeProp.closedBy=new NodeProp({deserialize:e=>e.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:e=>e.split(" ")});NodeProp.group=new NodeProp({deserialize:e=>e.split(" ")});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});const noProps=Object.create(null);class NodeType{constructor(n,r,g,$=0){this.name=n,this.props=r,this.id=g,this.flags=$}static define(n){let r=n.props&&n.props.length?Object.create(null):noProps,g=(n.top?1:0)|(n.skipped?2:0)|(n.error?4:0)|(n.name==null?8:0),$=new NodeType(n.name||"",r,n.id,g);if(n.props){for(let L of n.props)if(Array.isArray(L)||(L=L($)),L){if(L[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[L[0].id]=L[1]}}return $}prop(n){return this.props[n.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(n){if(typeof n=="string"){if(this.name==n)return!0;let r=this.prop(NodeProp.group);return r?r.indexOf(n)>-1:!1}return this.id==n}static match(n){let r=Object.create(null);for(let g in n)for(let $ of g.split(" "))r[$]=n[g];return g=>{for(let $=g.prop(NodeProp.group),L=-1;L<($?$.length:0);L++){let k=r[L<0?g.name:$[L]];if(k)return k}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(n){this.types=n;for(let r=0;r=$&&(k.type.isAnonymous||r(k)!==!1)){if(k.firstChild())continue;oe=!0}for(;oe&&g&&!k.type.isAnonymous&&g(k),!k.nextSibling();){if(!k.parent())return;oe=!0}}}prop(n){return n.perNode?this.props?this.props[n.id]:void 0:this.type.prop(n)}get propValues(){let n=[];if(this.props)for(let r in this.props)n.push([+r,this.props[r]]);return n}balance(n={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(r,g,$)=>new Tree(this.type,r,g,$,this.propValues),n.makeTree||((r,g,$)=>new Tree(NodeType.none,r,g,$)))}static build(n){return buildTree(n)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(n,r){this.buffer=n,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(n,r,g){this.buffer=n,this.length=r,this.set=g}get type(){return NodeType.none}toString(){let n=[];for(let r=0;r0));re=k[re+3]);return oe}slice(n,r,g,$){let L=this.buffer,k=new Uint16Array(r-n);for(let oe=n,re=0;oe=n&&rn;case 1:return r<=n&&g>n;case 2:return g>n;case 4:return!0}}function enterUnfinishedNodesBefore(e,n){let r=e.childBefore(n);for(;r;){let g=r.lastChild;if(!g||g.to!=r.to)break;g.type.isError&&g.from==g.to?(e=r,r=g.prevSibling):r=g}return e}function resolveNode(e,n,r,g){for(var $;e.from==e.to||(r<1?e.from>=n:e.from>n)||(r>-1?e.to<=n:e.to0?oe.length:-1;n!=ae;n+=r){let le=oe[n],ue=re[n]+k.from;if(!!checkSide($,g,ue,ue+le.length)){if(le instanceof TreeBuffer){if(L&IterMode.ExcludeBuffers)continue;let pe=le.findChild(0,le.buffer.length,r,g-ue,$);if(pe>-1)return new BufferNode(new BufferContext(k,le,n,ue),null,pe)}else if(L&IterMode.IncludeAnonymous||!le.type.isAnonymous||hasChild(le)){let pe;if(!(L&IterMode.IgnoreMounts)&&le.props&&(pe=le.prop(NodeProp.mounted))&&!pe.overlay)return new TreeNode(pe.tree,ue,n,k);let de=new TreeNode(le,ue,n,k);return L&IterMode.IncludeAnonymous||!de.type.isAnonymous?de:de.nextChild(r<0?le.children.length-1:0,r,g,$)}}}if(L&IterMode.IncludeAnonymous||!k.type.isAnonymous||(k.index>=0?n=k.index+r:n=r<0?-1:k._parent._tree.children.length,k=k._parent,!k))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(n){return this.nextChild(0,1,n,2)}childBefore(n){return this.nextChild(this._tree.children.length-1,-1,n,-2)}enter(n,r,g=0){let $;if(!(g&IterMode.IgnoreOverlays)&&($=this._tree.prop(NodeProp.mounted))&&$.overlay){let L=n-this.from;for(let{from:k,to:oe}of $.overlay)if((r>0?k<=L:k=L:oe>L))return new TreeNode($.tree,$.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,n,r,g)}nextSignificantParent(){let n=this;for(;n.type.isAnonymous&&n._parent;)n=n._parent;return n}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(n=0){return new TreeCursor(this,n)}get tree(){return this._tree}toTree(){return this._tree}resolve(n,r=0){return resolveNode(this,n,r,!1)}resolveInner(n,r=0){return resolveNode(this,n,r,!0)}enterUnfinishedNodesBefore(n){return enterUnfinishedNodesBefore(this,n)}getChild(n,r=null,g=null){let $=getChildren(this,n,r,g);return $.length?$[0]:null}getChildren(n,r=null,g=null){return getChildren(this,n,r,g)}toString(){return this._tree.toString()}get node(){return this}matchContext(n){return matchNodeContext(this,n)}}function getChildren(e,n,r,g){let $=e.cursor(),L=[];if(!$.firstChild())return L;if(r!=null){for(;!$.type.is(r);)if(!$.nextSibling())return L}for(;;){if(g!=null&&$.type.is(g))return L;if($.type.is(n)&&L.push($.node),!$.nextSibling())return g==null?L:[]}}function matchNodeContext(e,n,r=n.length-1){for(let g=e.parent;r>=0;g=g.parent){if(!g)return!1;if(!g.type.isAnonymous){if(n[r]&&n[r]!=g.name)return!1;r--}}return!0}class BufferContext{constructor(n,r,g,$){this.parent=n,this.buffer=r,this.index=g,this.start=$}}class BufferNode{constructor(n,r,g){this.context=n,this._parent=r,this.index=g,this.type=n.buffer.set.types[n.buffer.buffer[g]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(n,r,g){let{buffer:$}=this.context,L=$.findChild(this.index+4,$.buffer[this.index+3],n,r-this.context.start,g);return L<0?null:new BufferNode(this.context,this,L)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(n){return this.child(1,n,2)}childBefore(n){return this.child(-1,n,-2)}enter(n,r,g=0){if(g&IterMode.ExcludeBuffers)return null;let{buffer:$}=this.context,L=$.findChild(this.index+4,$.buffer[this.index+3],r>0?1:-1,n-this.context.start,r);return L<0?null:new BufferNode(this.context,this,L)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(n){return this._parent?null:this.context.parent.nextChild(this.context.index+n,n,0,4)}get nextSibling(){let{buffer:n}=this.context,r=n.buffer[this.index+3];return r<(this._parent?n.buffer[this._parent.index+3]:n.buffer.length)?new BufferNode(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:n}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new BufferNode(this.context,this._parent,n.findChild(r,this.index,-1,0,4))}cursor(n=0){return new TreeCursor(this,n)}get tree(){return null}toTree(){let n=[],r=[],{buffer:g}=this.context,$=this.index+4,L=g.buffer[this.index+3];if(L>$){let k=g.buffer[this.index+1],oe=g.buffer[this.index+2];n.push(g.slice($,L,k,oe)),r.push(0)}return new Tree(this.type,n,r,this.to-this.from)}resolve(n,r=0){return resolveNode(this,n,r,!1)}resolveInner(n,r=0){return resolveNode(this,n,r,!0)}enterUnfinishedNodesBefore(n){return enterUnfinishedNodesBefore(this,n)}toString(){return this.context.buffer.childString(this.index)}getChild(n,r=null,g=null){let $=getChildren(this,n,r,g);return $.length?$[0]:null}getChildren(n,r=null,g=null){return getChildren(this,n,r,g)}get node(){return this}matchContext(n){return matchNodeContext(this,n)}}class TreeCursor{constructor(n,r=0){if(this.mode=r,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,n instanceof TreeNode)this.yieldNode(n);else{this._tree=n.context.parent,this.buffer=n.context;for(let g=n._parent;g;g=g._parent)this.stack.unshift(g.index);this.bufferNode=n,this.yieldBuf(n.index)}}get name(){return this.type.name}yieldNode(n){return n?(this._tree=n,this.type=n.type,this.from=n.from,this.to=n.to,!0):!1}yieldBuf(n,r){this.index=n;let{start:g,buffer:$}=this.buffer;return this.type=r||$.set.types[$.buffer[n]],this.from=g+$.buffer[n+1],this.to=g+$.buffer[n+2],!0}yield(n){return n?n instanceof TreeNode?(this.buffer=null,this.yieldNode(n)):(this.buffer=n.context,this.yieldBuf(n.index,n.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(n,r,g){if(!this.buffer)return this.yield(this._tree.nextChild(n<0?this._tree._tree.children.length-1:0,n,r,g,this.mode));let{buffer:$}=this.buffer,L=$.findChild(this.index+4,$.buffer[this.index+3],n,r-this.buffer.start,g);return L<0?!1:(this.stack.push(this.index),this.yieldBuf(L))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(n){return this.enterChild(1,n,2)}childBefore(n){return this.enterChild(-1,n,-2)}enter(n,r,g=this.mode){return this.buffer?g&IterMode.ExcludeBuffers?!1:this.enterChild(1,n,r):this.yield(this._tree.enter(n,r,g))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let n=this.mode&IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(n)}sibling(n){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+n,n,0,4,this.mode)):!1;let{buffer:r}=this.buffer,g=this.stack.length-1;if(n<0){let $=g<0?0:this.stack[g]+4;if(this.index!=$)return this.yieldBuf(r.findChild($,this.index,-1,0,4))}else{let $=r.buffer[this.index+3];if($<(g<0?r.buffer.length:r.buffer[this.stack[g]+3]))return this.yieldBuf($)}return g<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+n,n,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(n){let r,g,{buffer:$}=this;if($){if(n>0){if(this.index<$.buffer.buffer.length)return!1}else for(let L=0;L-1)for(let L=r+n,k=n<0?-1:g._tree.children.length;L!=k;L+=n){let oe=g._tree.children[L];if(this.mode&IterMode.IncludeAnonymous||oe instanceof TreeBuffer||!oe.type.isAnonymous||hasChild(oe))return!1}return!0}move(n,r){if(r&&this.enterChild(n,0,4))return!0;for(;;){if(this.sibling(n))return!0;if(this.atLastNode(n)||!this.parent())return!1}}next(n=!0){return this.move(1,n)}prev(n=!0){return this.move(-1,n)}moveTo(n,r=0){for(;(this.from==this.to||(r<1?this.from>=n:this.from>n)||(r>-1?this.to<=n:this.to=0;){for(let k=n;k;k=k._parent)if(k.index==$){if($==this.index)return k;r=k,g=L+1;break e}$=this.stack[--L]}}for(let $=g;$=0;L--){if(L<0)return matchNodeContext(this.node,n,$);let k=g[r.buffer[this.stack[L]]];if(!k.isAnonymous){if(n[$]&&n[$]!=k.name)return!1;$--}}return!0}}function hasChild(e){return e.children.some(n=>n instanceof TreeBuffer||!n.type.isAnonymous||hasChild(n))}function buildTree(e){var n;let{buffer:r,nodeSet:g,maxBufferLength:$=DefaultBufferLength,reused:L=[],minRepeatType:k=g.types.length}=e,oe=Array.isArray(r)?new FlatBufferCursor(r,r.length):r,re=g.types,ae=0,le=0;function ue(qe,xe,Ve,he,Oe){let{id:$e,start:Ne,end:Ue,size:kt}=oe,Et=le;for(;kt<0;)if(oe.next(),kt==-1){let Dt=L[$e];Ve.push(Dt),he.push(Ne-qe);return}else if(kt==-3){ae=$e;return}else if(kt==-4){le=$e;return}else throw new RangeError(`Unrecognized record size: ${kt}`);let Pt=re[$e],Lt,vn,hn=Ne-qe;if(Ue-Ne<=$&&(vn=ze(oe.pos-xe,Oe))){let Dt=new Uint16Array(vn.size-vn.skip),jt=oe.pos-vn.size,bn=Dt.length;for(;oe.pos>jt;)bn=Ce(vn.start,Dt,bn);Lt=new TreeBuffer(Dt,Ue-vn.start,g),hn=vn.start-qe}else{let Dt=oe.pos-kt;oe.next();let jt=[],bn=[],Sn=$e>=k?$e:-1,Cn=0,On=Ue;for(;oe.pos>Dt;)Sn>=0&&oe.id==Sn&&oe.size>=0?(oe.end<=On-$&&(de(jt,bn,Ne,Cn,oe.end,On,Sn,Et),Cn=jt.length,On=oe.end),oe.next()):ue(Ne,Dt,jt,bn,Sn);if(Sn>=0&&Cn>0&&Cn-1&&Cn>0){let En=pe(Pt);Lt=balanceRange(Pt,jt,bn,0,jt.length,0,Ue-Ne,En,En)}else Lt=Fe(Pt,jt,bn,Ue-Ne,Et-Ue)}Ve.push(Lt),he.push(hn)}function pe(qe){return(xe,Ve,he)=>{let Oe=0,$e=xe.length-1,Ne,Ue;if($e>=0&&(Ne=xe[$e])instanceof Tree){if(!$e&&Ne.type==qe&&Ne.length==he)return Ne;(Ue=Ne.prop(NodeProp.lookAhead))&&(Oe=Ve[$e]+Ne.length+Ue)}return Fe(qe,xe,Ve,he,Oe)}}function de(qe,xe,Ve,he,Oe,$e,Ne,Ue){let kt=[],Et=[];for(;qe.length>he;)kt.push(qe.pop()),Et.push(xe.pop()+Ve-Oe);qe.push(Fe(g.types[Ne],kt,Et,$e-Oe,Ue-$e)),xe.push(Oe-Ve)}function Fe(qe,xe,Ve,he,Oe=0,$e){if(ae){let Ne=[NodeProp.contextHash,ae];$e=$e?[Ne].concat($e):[Ne]}if(Oe>25){let Ne=[NodeProp.lookAhead,Oe];$e=$e?[Ne].concat($e):[Ne]}return new Tree(qe,xe,Ve,he,$e)}function ze(qe,xe){let Ve=oe.fork(),he=0,Oe=0,$e=0,Ne=Ve.end-$,Ue={size:0,start:0,skip:0};e:for(let kt=Ve.pos-qe;Ve.pos>kt;){let Et=Ve.size;if(Ve.id==xe&&Et>=0){Ue.size=he,Ue.start=Oe,Ue.skip=$e,$e+=4,he+=4,Ve.next();continue}let Pt=Ve.pos-Et;if(Et<0||Pt=k?4:0,vn=Ve.start;for(Ve.next();Ve.pos>Pt;){if(Ve.size<0)if(Ve.size==-3)Lt+=4;else break e;else Ve.id>=k&&(Lt+=4);Ve.next()}Oe=vn,he+=Et,$e+=Lt}return(xe<0||he==qe)&&(Ue.size=he,Ue.start=Oe,Ue.skip=$e),Ue.size>4?Ue:void 0}function Ce(qe,xe,Ve){let{id:he,start:Oe,end:$e,size:Ne}=oe;if(oe.next(),Ne>=0&&he4){let kt=oe.pos-(Ne-4);for(;oe.pos>kt;)Ve=Ce(qe,xe,Ve)}xe[--Ve]=Ue,xe[--Ve]=$e-qe,xe[--Ve]=Oe-qe,xe[--Ve]=he}else Ne==-3?ae=he:Ne==-4&&(le=he);return Ve}let Ie=[],_e=[];for(;oe.pos>0;)ue(e.start||0,e.bufferStart||0,Ie,_e,-1);let At=(n=e.length)!==null&&n!==void 0?n:Ie.length?_e[0]+Ie[0].length:0;return new Tree(re[e.topID],Ie.reverse(),_e.reverse(),At)}const nodeSizeCache=new WeakMap;function nodeSize(e,n){if(!e.isAnonymous||n instanceof TreeBuffer||n.type!=e)return 1;let r=nodeSizeCache.get(n);if(r==null){r=1;for(let g of n.children){if(g.type!=e||!(g instanceof Tree)){r=1;break}r+=nodeSize(e,g)}nodeSizeCache.set(n,r)}return r}function balanceRange(e,n,r,g,$,L,k,oe,re){let ae=0;for(let Fe=g;Fe<$;Fe++)ae+=nodeSize(e,n[Fe]);let le=Math.ceil(ae*1.5/8),ue=[],pe=[];function de(Fe,ze,Ce,Ie,_e){for(let At=Ce;At=le)break;Ve+=he}if(At==qe+1){if(Ve>le){let he=Fe[qe];de(he.children,he.positions,0,he.children.length,ze[qe]+_e);continue}ue.push(Fe[qe])}else{let he=ze[At-1]+Fe[At-1].length-xe;ue.push(balanceRange(e,Fe,ze,qe,At,xe,he,null,re))}pe.push(xe+_e-L)}}return de(n,r,g,$,0),(oe||re)(ue,pe,k)}class NodeWeakMap{constructor(){this.map=new WeakMap}setBuffer(n,r,g){let $=this.map.get(n);$||this.map.set(n,$=new Map),$.set(r,g)}getBuffer(n,r){let g=this.map.get(n);return g&&g.get(r)}set(n,r){n instanceof BufferNode?this.setBuffer(n.context.buffer,n.index,r):n instanceof TreeNode&&this.map.set(n.tree,r)}get(n){return n instanceof BufferNode?this.getBuffer(n.context.buffer,n.index):n instanceof TreeNode?this.map.get(n.tree):void 0}cursorSet(n,r){n.buffer?this.setBuffer(n.buffer.buffer,n.index,r):this.map.set(n.tree,r)}cursorGet(n){return n.buffer?this.getBuffer(n.buffer.buffer,n.index):this.map.get(n.tree)}}class TreeFragment{constructor(n,r,g,$,L=!1,k=!1){this.from=n,this.to=r,this.tree=g,this.offset=$,this.open=(L?1:0)|(k?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(n,r=[],g=!1){let $=[new TreeFragment(0,n.length,n,0,!1,g)];for(let L of r)L.to>n.length&&$.push(L);return $}static applyChanges(n,r,g=128){if(!r.length)return n;let $=[],L=1,k=n.length?n[0]:null;for(let oe=0,re=0,ae=0;;oe++){let le=oe=g)for(;k&&k.from=pe.from||ue<=pe.to||ae){let de=Math.max(pe.from,re)-ae,Fe=Math.min(pe.to,ue)-ae;pe=de>=Fe?null:new TreeFragment(de,Fe,pe.tree,pe.offset+ae,oe>0,!!le)}if(pe&&$.push(pe),k.to>ue)break;k=Lnew Range$1($.from,$.to)):[new Range$1(0,0)]:[new Range$1(0,n.length)],this.createParse(n,r||[],g)}parse(n,r,g){let $=this.startParse(n,r,g);for(;;){let L=$.advance();if(L)return L}}}class StringInput{constructor(n){this.string=n}get length(){return this.string.length}chunk(n){return this.string.slice(n)}get lineChunks(){return!1}read(n,r){return this.string.slice(n,r)}}new NodeProp({perNode:!0});class Stack{constructor(n,r,g,$,L,k,oe,re,ae,le=0,ue){this.p=n,this.stack=r,this.state=g,this.reducePos=$,this.pos=L,this.score=k,this.buffer=oe,this.bufferBase=re,this.curContext=ae,this.lookAhead=le,this.parent=ue}toString(){return`[${this.stack.filter((n,r)=>r%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(n,r,g=0){let $=n.parser.context;return new Stack(n,[],r,g,g,0,[],0,$?new StackContext($,$.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(n,r){this.stack.push(this.state,r,this.bufferBase+this.buffer.length),this.state=n}reduce(n){let r=n>>19,g=n&65535,{parser:$}=this.p,L=$.dynamicPrecedence(g);if(L&&(this.score+=L),r==0){this.pushState($.getGoto(this.state,g,!0),this.reducePos),g<$.minRepeatTerm&&this.storeNode(g,this.reducePos,this.reducePos,4,!0),this.reduceContext(g,this.reducePos);return}let k=this.stack.length-(r-1)*3-(n&262144?6:0),oe=this.stack[k-2],re=this.stack[k-1],ae=this.bufferBase+this.buffer.length-re;if(g<$.minRepeatTerm||n&131072){let le=$.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(g,oe,le,ae+4,!0)}if(n&262144)this.state=this.stack[k];else{let le=this.stack[k-3];this.state=$.getGoto(le,g,!0)}for(;this.stack.length>k;)this.stack.pop();this.reduceContext(g,oe)}storeNode(n,r,g,$=4,L=!1){if(n==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&k.buffer[oe-4]==0&&k.buffer[oe-1]>-1){if(r==g)return;if(k.buffer[oe-2]>=r){k.buffer[oe-2]=g;return}}}if(!L||this.pos==g)this.buffer.push(n,r,g,$);else{let k=this.buffer.length;if(k>0&&this.buffer[k-4]!=0)for(;k>0&&this.buffer[k-2]>g;)this.buffer[k]=this.buffer[k-4],this.buffer[k+1]=this.buffer[k-3],this.buffer[k+2]=this.buffer[k-2],this.buffer[k+3]=this.buffer[k-1],k-=4,$>4&&($-=4);this.buffer[k]=n,this.buffer[k+1]=r,this.buffer[k+2]=g,this.buffer[k+3]=$}}shift(n,r,g){let $=this.pos;if(n&131072)this.pushState(n&65535,this.pos);else if((n&262144)==0){let L=n,{parser:k}=this.p;(g>this.pos||r<=k.maxNode)&&(this.pos=g,k.stateFlag(L,1)||(this.reducePos=g)),this.pushState(L,$),this.shiftContext(r,$),r<=k.maxNode&&this.buffer.push(r,$,g,4)}else this.pos=g,this.shiftContext(r,$),r<=this.p.parser.maxNode&&this.buffer.push(r,$,g,4)}apply(n,r,g){n&65536?this.reduce(n):this.shift(n,r,g)}useNode(n,r){let g=this.p.reused.length-1;(g<0||this.p.reused[g]!=n)&&(this.p.reused.push(n),g++);let $=this.pos;this.reducePos=this.pos=$+n.length,this.pushState(r,$),this.buffer.push(g,$,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,n,this,this.p.stream.reset(this.pos-n.length)))}split(){let n=this,r=n.buffer.length;for(;r>0&&n.buffer[r-2]>n.reducePos;)r-=4;let g=n.buffer.slice(r),$=n.bufferBase+r;for(;n&&$==n.bufferBase;)n=n.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,g,$,this.curContext,this.lookAhead,n)}recoverByDelete(n,r){let g=n<=this.p.parser.maxNode;g&&this.storeNode(n,this.pos,r,4),this.storeNode(0,this.pos,r,g?8:4),this.pos=this.reducePos=r,this.score-=190}canShift(n){for(let r=new SimulatedStack(this);;){let g=this.p.parser.stateSlot(r.state,4)||this.p.parser.hasAction(r.state,n);if((g&65536)==0)return!0;if(g==0)return!1;r.reduce(g)}}recoverByInsert(n){if(this.stack.length>=300)return[];let r=this.p.parser.nextStates(this.state);if(r.length>4<<1||this.stack.length>=120){let $=[];for(let L=0,k;Lre&1&&oe==k)||$.push(r[L],k)}r=$}let g=[];for(let $=0;$>19,$=n&65535,L=this.stack.length-g*3;if(L<0||r.getGoto(this.stack[L],$,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:n}=this.p;return n.data[n.stateSlot(this.state,1)]==65535&&!n.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(n){if(this.state!=n.state||this.stack.length!=n.stack.length)return!1;for(let r=0;rthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=n)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class StackContext{constructor(n,r){this.tracker=n,this.context=r,this.hash=n.strict?n.hash(r):0}}var Recover;(function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"})(Recover||(Recover={}));class SimulatedStack{constructor(n){this.start=n,this.state=n.state,this.stack=n.stack,this.base=this.stack.length}reduce(n){let r=n&65535,g=n>>19;g==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(g-1)*3;let $=this.start.p.parser.getGoto(this.stack[this.base-3],r,!0);this.state=$}}class StackBufferCursor{constructor(n,r,g){this.stack=n,this.pos=r,this.index=g,this.buffer=n.buffer,this.index==0&&this.maybeNext()}static create(n,r=n.bufferBase+n.buffer.length){return new StackBufferCursor(n,r,r-n.bufferBase)}maybeNext(){let n=this.stack.parent;n!=null&&(this.index=this.stack.bufferBase-n.bufferBase,this.stack=n,this.buffer=n.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(n,r){this.input=n,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=r[0].from,this.range=r[0],this.end=r[r.length-1].to,this.readNext()}resolveOffset(n,r){let g=this.range,$=this.rangeIndex,L=this.pos+n;for(;Lg.to:L>=g.to;){if($==this.ranges.length-1)return null;let k=this.ranges[++$];L+=k.from-g.to,g=k}return L}peek(n){let r=this.chunkOff+n,g,$;if(r>=0&&r=this.chunk2Pos&&goe.to&&(this.chunk2=this.chunk2.slice(0,oe.to-g)),$=this.chunk2.charCodeAt(0)}}return g>=this.token.lookAhead&&(this.token.lookAhead=g+1),$}acceptToken(n,r=0){let g=r?this.resolveOffset(r,-1):this.pos;if(g==null||g=this.chunk2Pos&&this.posthis.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(n=1){for(this.chunkOff+=n;this.pos+n>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();n-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=n,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(n,r){if(r?(this.token=r,r.start=n,r.lookAhead=n+1,r.value=r.extended=-1):this.token=nullToken,this.pos!=n){if(this.pos=n,n==this.end)return this.setDone(),this;for(;n=this.range.to;)this.range=this.ranges[++this.rangeIndex];n>=this.chunkPos&&n=this.chunkPos&&r<=this.chunkPos+this.chunk.length)return this.chunk.slice(n-this.chunkPos,r-this.chunkPos);if(n>=this.chunk2Pos&&r<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(n-this.chunk2Pos,r-this.chunk2Pos);if(n>=this.range.from&&r<=this.range.to)return this.input.read(n,r);let g="";for(let $ of this.ranges){if($.from>=r)break;$.to>n&&(g+=this.input.read(Math.max($.from,n),Math.min($.to,r)))}return g}}class TokenGroup{constructor(n,r){this.data=n,this.id=r}token(n,r){readToken(this.data,n,r,this.id)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(n,r={}){this.token=n,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function readToken(e,n,r,g){let $=0,L=1<0){let de=e[pe];if(oe.allows(de)&&(n.token.value==-1||n.token.value==de||k.overrides(de,n.token.value))){n.acceptToken(de);break}}let ae=n.next,le=0,ue=e[$+2];if(n.next<0&&ue>le&&e[re+ue*3-3]==65535){$=e[re+ue*3-1];continue e}for(;le>1,de=re+pe+(pe<<1),Fe=e[de],ze=e[de+1];if(ae=ze)le=pe+1;else{$=e[de+2],n.advance();continue e}}break}}function decodeArray(e,n=Uint16Array){if(typeof e!="string")return e;let r=null;for(let g=0,$=0;g=92&&k--,k>=34&&k--;let re=k-32;if(re>=46&&(re-=46,oe=!0),L+=re,oe)break;L*=46}r?r[$++]=L:r=new n(L)}return r}const verbose=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let stackIDs=null;var Safety;(function(e){e[e.Margin=25]="Margin"})(Safety||(Safety={}));function cutAt(e,n,r){let g=e.cursor(IterMode.IncludeAnonymous);for(g.moveTo(n);;)if(!(r<0?g.childBefore(n):g.childAfter(n)))for(;;){if((r<0?g.ton)&&!g.type.isError)return r<0?Math.max(0,Math.min(g.to-1,n-25)):Math.min(e.length,Math.max(g.from+1,n+25));if(r<0?g.prevSibling():g.nextSibling())break;if(!g.parent())return r<0?0:e.length}}class FragmentCursor{constructor(n,r){this.fragments=n,this.nodeSet=r,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let n=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(n){for(this.safeFrom=n.openStart?cutAt(n.tree,n.from+n.offset,1)-n.offset:n.from,this.safeTo=n.openEnd?cutAt(n.tree,n.to+n.offset,-1)-n.offset:n.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(n.tree),this.start.push(-n.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(n){if(nn)return this.nextStart=k,null;if(L instanceof Tree){if(k==n){if(k=Math.max(this.safeFrom,n)&&(this.trees.push(L),this.start.push(k),this.index.push(0))}else this.index[r]++,this.nextStart=k+L.length}}}class TokenCache{constructor(n,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=n.tokenizers.map(g=>new CachedToken)}getActions(n){let r=0,g=null,{parser:$}=n.p,{tokenizers:L}=$,k=$.stateSlot(n.state,3),oe=n.curContext?n.curContext.hash:0,re=0;for(let ae=0;aeue.end+25&&(re=Math.max(ue.lookAhead,re)),ue.value!=0)){let pe=r;if(ue.extended>-1&&(r=this.addActions(n,ue.extended,ue.end,r)),r=this.addActions(n,ue.value,ue.end,r),!le.extend&&(g=ue,r>pe))break}}for(;this.actions.length>r;)this.actions.pop();return re&&n.setLookAhead(re),!g&&n.pos==this.stream.end&&(g=new CachedToken,g.value=n.p.parser.eofTerm,g.start=g.end=n.pos,r=this.addActions(n,g.value,g.end,r)),this.mainToken=g,this.actions}getMainToken(n){if(this.mainToken)return this.mainToken;let r=new CachedToken,{pos:g,p:$}=n;return r.start=g,r.end=Math.min(g+1,$.stream.end),r.value=g==$.stream.end?$.parser.eofTerm:0,r}updateCachedToken(n,r,g){if(r.token(this.stream.reset(g.pos,n),g),n.value>-1){let{parser:$}=g.p;for(let L=0;L<$.specialized.length;L++)if($.specialized[L]==n.value){let k=$.specializers[L](this.stream.read(n.start,n.end),g);if(k>=0&&g.p.parser.dialect.allows(k>>1)){(k&1)==0?n.value=k>>1:n.extended=k>>1;break}}}else n.value=0,n.end=Math.min(g.p.stream.end,g.pos+1)}putAction(n,r,g,$){for(let L=0;L<$;L+=3)if(this.actions[L]==n)return $;return this.actions[$++]=n,this.actions[$++]=r,this.actions[$++]=g,$}addActions(n,r,g,$){let{state:L}=n,{parser:k}=n.p,{data:oe}=k;for(let re=0;re<2;re++)for(let ae=k.stateSlot(L,re?2:1);;ae+=3){if(oe[ae]==65535)if(oe[ae+1]==1)ae=pair(oe,ae+2);else{$==0&&oe[ae+1]==2&&($=this.putAction(pair(oe,ae+2),r,g,$));break}oe[ae]==r&&($=this.putAction(pair(oe,ae+1),r,g,$))}return $}}var Rec;(function(e){e[e.Distance=5]="Distance",e[e.MaxRemainingPerStep=3]="MaxRemainingPerStep",e[e.MinBufferLengthPrune=500]="MinBufferLengthPrune",e[e.ForceReduceLimit=10]="ForceReduceLimit",e[e.CutDepth=15e3]="CutDepth",e[e.CutTo=9e3]="CutTo"})(Rec||(Rec={}));class Parse{constructor(n,r,g,$){this.parser=n,this.input=r,this.ranges=$,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.stream=new InputStream(r,$),this.tokens=new TokenCache(n,this.stream),this.topTerm=n.top[1];let{from:L}=$[0];this.stacks=[Stack.start(this,n.top[0],L)],this.fragments=g.length&&this.stream.end-L>n.bufferLength*4?new FragmentCursor(g,n.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let n=this.stacks,r=this.minStackPos,g=this.stacks=[],$,L;for(let k=0;kr)g.push(oe);else{if(this.advanceStack(oe,g,n))continue;{$||($=[],L=[]),$.push(oe);let re=this.tokens.getMainToken(oe);L.push(re.value,re.end)}}break}}if(!g.length){let k=$&&findFinished($);if(k)return this.stackToTree(k);if(this.parser.strict)throw verbose&&$&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&$){let k=this.stoppedAt!=null&&$[0].pos>this.stoppedAt?$[0]:this.runRecovery($,L,g);if(k)return this.stackToTree(k.forceAll())}if(this.recovering){let k=this.recovering==1?1:this.recovering*3;if(g.length>k)for(g.sort((oe,re)=>re.score-oe.score);g.length>k;)g.pop();g.some(oe=>oe.reducePos>r)&&this.recovering--}else if(g.length>1){e:for(let k=0;k500&&ae.buffer.length>500)if((oe.score-ae.score||oe.buffer.length-ae.buffer.length)>0)g.splice(re--,1);else{g.splice(k--,1);continue e}}}}this.minStackPos=g[0].pos;for(let k=1;k ":"";if(this.stoppedAt!=null&&$>this.stoppedAt)return n.forceReduce()?n:null;if(this.fragments){let ae=n.curContext&&n.curContext.tracker.strict,le=ae?n.curContext.hash:0;for(let ue=this.fragments.nodeAt($);ue;){let pe=this.parser.nodeSet.types[ue.type.id]==ue.type?L.getGoto(n.state,ue.type.id):-1;if(pe>-1&&ue.length&&(!ae||(ue.prop(NodeProp.contextHash)||0)==le))return n.useNode(ue,pe),verbose&&console.log(k+this.stackID(n)+` (via reuse of ${L.getName(ue.type.id)})`),!0;if(!(ue instanceof Tree)||ue.children.length==0||ue.positions[0]>0)break;let de=ue.children[0];if(de instanceof Tree&&ue.positions[0]==0)ue=de;else break}}let oe=L.stateSlot(n.state,4);if(oe>0)return n.reduce(oe),verbose&&console.log(k+this.stackID(n)+` (via always-reduce ${L.getName(oe&65535)})`),!0;if(n.stack.length>=15e3)for(;n.stack.length>9e3&&n.forceReduce(););let re=this.tokens.getActions(n);for(let ae=0;ae$?r.push(Fe):g.push(Fe)}return!1}advanceFully(n,r){let g=n.pos;for(;;){if(!this.advanceStack(n,null,null))return!1;if(n.pos>g)return pushStackDedup(n,r),!0}}runRecovery(n,r,g){let $=null,L=!1;for(let k=0;k ":"";if(oe.deadEnd&&(L||(L=!0,oe.restart(),verbose&&console.log(le+this.stackID(oe)+" (restarted)"),this.advanceFully(oe,g))))continue;let ue=oe.split(),pe=le;for(let de=0;ue.forceReduce()&&de<10&&(verbose&&console.log(pe+this.stackID(ue)+" (via force-reduce)"),!this.advanceFully(ue,g));de++)verbose&&(pe=this.stackID(ue)+" -> ");for(let de of oe.recoverByInsert(re))verbose&&console.log(le+this.stackID(de)+" (via recover-insert)"),this.advanceFully(de,g);this.stream.end>oe.pos?(ae==oe.pos&&(ae++,re=0),oe.recoverByDelete(re,ae),verbose&&console.log(le+this.stackID(oe)+` (via recover-delete ${this.parser.getName(re)})`),pushStackDedup(oe,g)):(!$||$.scoree;class ContextTracker{constructor(n){this.start=n.start,this.shift=n.shift||id,this.reduce=n.reduce||id,this.reuse=n.reuse||id,this.hash=n.hash||(()=>0),this.strict=n.strict!==!1}}class LRParser extends Parser{constructor(n){if(super(),this.wrappers=[],n.version!=14)throw new RangeError(`Parser version (${n.version}) doesn't match runtime version (${14})`);let r=n.nodeNames.split(" ");this.minRepeatTerm=r.length;for(let oe=0;oen.topRules[oe][1]),$=[];for(let oe=0;oe=0)L(le,re,oe[ae++]);else{let ue=oe[ae+-le];for(let pe=-le;pe>0;pe--)L(oe[ae++],re,ue);ae++}}}this.nodeSet=new NodeSet(r.map((oe,re)=>NodeType.define({name:re>=this.minRepeatTerm?void 0:oe,id:re,props:$[re],top:g.indexOf(re)>-1,error:re==0,skipped:n.skippedNodes&&n.skippedNodes.indexOf(re)>-1}))),n.propSources&&(this.nodeSet=this.nodeSet.extend(...n.propSources)),this.strict=!1,this.bufferLength=DefaultBufferLength;let k=decodeArray(n.tokenData);this.context=n.context,this.specializerSpecs=n.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let oe=0;oetypeof oe=="number"?new TokenGroup(k,oe):oe),this.topRules=n.topRules,this.dialects=n.dialects||{},this.dynamicPrecedences=n.dynamicPrecedences||null,this.tokenPrecTable=n.tokenPrec,this.termNames=n.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(n,r,g){let $=new Parse(this,n,r,g);for(let L of this.wrappers)$=L($,n,r,g);return $}getGoto(n,r,g=!1){let $=this.goto;if(r>=$[0])return-1;for(let L=$[r+1];;){let k=$[L++],oe=k&1,re=$[L++];if(oe&&g)return re;for(let ae=L+(k>>1);L0}validAction(n,r){if(r==this.stateSlot(n,4))return!0;for(let g=this.stateSlot(n,1);;g+=3){if(this.data[g]==65535)if(this.data[g+1]==1)g=pair(this.data,g+2);else return!1;if(r==pair(this.data,g+1))return!0}}nextStates(n){let r=[];for(let g=this.stateSlot(n,1);;g+=3){if(this.data[g]==65535)if(this.data[g+1]==1)g=pair(this.data,g+2);else break;if((this.data[g+2]&1)==0){let $=this.data[g+1];r.some((L,k)=>k&1&&L==$)||r.push(this.data[g],$)}}return r}overrides(n,r){let g=findOffset(this.data,this.tokenPrecTable,r);return g<0||findOffset(this.data,this.tokenPrecTable,n){let $=n.tokenizers.find(L=>L.from==g);return $?$.to:g})),n.specializers&&(r.specializers=this.specializers.slice(),r.specializerSpecs=this.specializerSpecs.map((g,$)=>{let L=n.specializers.find(oe=>oe.from==g.external);if(!L)return g;let k=Object.assign(Object.assign({},g),{external:L.to});return r.specializers[$]=getSpecializer(k),k})),n.contextTracker&&(r.context=n.contextTracker),n.dialect&&(r.dialect=this.parseDialect(n.dialect)),n.strict!=null&&(r.strict=n.strict),n.wrap&&(r.wrappers=r.wrappers.concat(n.wrap)),n.bufferLength!=null&&(r.bufferLength=n.bufferLength),r}hasWrappers(){return this.wrappers.length>0}getName(n){return this.termNames?this.termNames[n]:String(n<=this.maxNode&&this.nodeSet.types[n].name||n)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(n){let r=this.dynamicPrecedences;return r==null?0:r[n]||0}parseDialect(n){let r=Object.keys(this.dialects),g=r.map(()=>!1);if(n)for(let L of n.split(" ")){let k=r.indexOf(L);k>=0&&(g[k]=!0)}let $=null;for(let L=0;Lg)&&r.p.parser.stateFlag(r.state,2)&&(!n||n.scoree.external(r,g)<<1|n}return e.get}let nextTagID=0;class Tag{constructor(n,r,g){this.set=n,this.base=r,this.modified=g,this.id=nextTagID++}static define(n){if(n?.base)throw new Error("Can not derive from a modified tag");let r=new Tag([],null,[]);if(r.set.push(r),n)for(let g of n.set)r.set.push(g);return r}static defineModifier(){let n=new Modifier;return r=>r.modified.indexOf(n)>-1?r:Modifier.get(r.base||r,r.modified.concat(n).sort((g,$)=>g.id-$.id))}}let nextModifierID=0;class Modifier{constructor(){this.instances=[],this.id=nextModifierID++}static get(n,r){if(!r.length)return n;let g=r[0].instances.find(oe=>oe.base==n&&sameArray$1(r,oe.modified));if(g)return g;let $=[],L=new Tag($,n,r);for(let oe of r)oe.instances.push(L);let k=permute(r);for(let oe of n.set)for(let re of k)$.push(Modifier.get(oe,re));return L}}function sameArray$1(e,n){return e.length==n.length&&e.every((r,g)=>r==n[g])}function permute(e){let n=[e];for(let r=0;r0&&ue+3==$.length){k=1;break}let pe=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(oe);if(!pe)throw new RangeError("Invalid path: "+$);if(L.push(pe[0]=="*"?"":pe[0][0]=='"'?JSON.parse(pe[0]):pe[0]),ue+=pe[0].length,ue==$.length)break;let de=$[ue++];if(ue==$.length&&de=="!"){k=0;break}if(de!="/")throw new RangeError("Invalid path: "+$);oe=$.slice(ue)}let re=L.length-1,ae=L[re];if(!ae)throw new RangeError("Invalid path: "+$);let le=new Rule$1(g,k,re>0?L.slice(0,re):null);n[ae]=le.sort(n[ae])}}return ruleNodeProp.add(n)}const ruleNodeProp=new NodeProp;class Rule$1{constructor(n,r,g,$){this.tags=n,this.mode=r,this.context=g,this.next=$}sort(n){return!n||n.depth{let k=$;for(let oe of L)for(let re of oe.set){let ae=r[re.id];if(ae){k=k?k+" "+ae:ae;break}}return k},scope:g}}function highlightTags(e,n){let r=null;for(let g of e){let $=g.style(n);$&&(r=r?r+" "+$:$)}return r}function highlightTree(e,n,r,g=0,$=e.length){let L=new HighlightBuilder(g,Array.isArray(n)?n:[n],r);L.highlightRange(e.cursor(),g,$,"",L.highlighters),L.flush($)}class HighlightBuilder{constructor(n,r,g){this.at=n,this.highlighters=r,this.span=g,this.class=""}startSpan(n,r){r!=this.class&&(this.flush(n),n>this.at&&(this.at=n),this.class=r)}flush(n){n>this.at&&this.class&&this.span(this.at,n,this.class)}highlightRange(n,r,g,$,L){let{type:k,from:oe,to:re}=n;if(oe>=g||re<=r)return;k.isTop&&(L=this.highlighters.filter(de=>!de.scope||de.scope(k)));let ae=$,le=k.prop(ruleNodeProp),ue=!1;for(;le;){if(!le.context||n.matchContext(le.context)){let de=highlightTags(L,le.tags);de&&(ae&&(ae+=" "),ae+=de,le.mode==1?$+=($?" ":"")+de:le.mode==0&&(ue=!0));break}le=le.next}if(this.startSpan(n.from,ae),ue)return;let pe=n.tree&&n.tree.prop(NodeProp.mounted);if(pe&&pe.overlay){let de=n.node.enter(pe.overlay[0].from+oe,1),Fe=this.highlighters.filter(Ce=>!Ce.scope||Ce.scope(pe.tree.type)),ze=n.firstChild();for(let Ce=0,Ie=oe;;Ce++){let _e=Ce=At||!n.nextSibling())););if(!_e||At>g)break;Ie=_e.to+oe,Ie>r&&(this.highlightRange(de.cursor(),Math.max(r,_e.from+oe),Math.min(g,Ie),$,Fe),this.startSpan(Ie,ae))}ze&&n.parent()}else if(n.firstChild()){do if(!(n.to<=r)){if(n.from>=g)break;this.highlightRange(n,r,g,$,L),this.startSpan(Math.min(g,n.to),ae)}while(n.nextSibling());n.parent()}}}const t=Tag.define,comment=t(),name=t(),typeName=t(name),propertyName=t(name),literal=t(),string=t(literal),number=t(literal),content=t(),heading=t(content),keyword=t(),operator=t(),punctuation=t(),bracket=t(punctuation),meta=t(),tags$1={comment,lineComment:t(comment),blockComment:t(comment),docComment:t(comment),name,variableName:t(name),typeName,tagName:t(typeName),propertyName,attributeName:t(propertyName),className:t(name),labelName:t(name),namespace:t(name),macroName:t(name),literal,string,docString:t(string),character:t(string),attributeValue:t(string),number,integer:t(number),float:t(number),bool:t(literal),regexp:t(literal),escape:t(literal),color:t(literal),url:t(literal),keyword,self:t(keyword),null:t(keyword),atom:t(keyword),unit:t(keyword),modifier:t(keyword),operatorKeyword:t(keyword),controlKeyword:t(keyword),definitionKeyword:t(keyword),moduleKeyword:t(keyword),operator,derefOperator:t(operator),arithmeticOperator:t(operator),logicOperator:t(operator),bitwiseOperator:t(operator),compareOperator:t(operator),updateOperator:t(operator),definitionOperator:t(operator),typeOperator:t(operator),controlOperator:t(operator),punctuation,separator:t(punctuation),bracket,angleBracket:t(bracket),squareBracket:t(bracket),paren:t(bracket),brace:t(bracket),content,heading,heading1:t(heading),heading2:t(heading),heading3:t(heading),heading4:t(heading),heading5:t(heading),heading6:t(heading),contentSeparator:t(content),list:t(content),quote:t(content),emphasis:t(content),strong:t(content),link:t(content),monospace:t(content),strikethrough:t(content),inserted:t(),deleted:t(),changed:t(),invalid:t(),meta,documentMeta:t(meta),annotation:t(meta),processingInstruction:t(meta),definition:Tag.defineModifier(),constant:Tag.defineModifier(),function:Tag.defineModifier(),standard:Tag.defineModifier(),local:Tag.defineModifier(),special:Tag.defineModifier()};tagHighlighter([{tag:tags$1.link,class:"tok-link"},{tag:tags$1.heading,class:"tok-heading"},{tag:tags$1.emphasis,class:"tok-emphasis"},{tag:tags$1.strong,class:"tok-strong"},{tag:tags$1.keyword,class:"tok-keyword"},{tag:tags$1.atom,class:"tok-atom"},{tag:tags$1.bool,class:"tok-bool"},{tag:tags$1.url,class:"tok-url"},{tag:tags$1.labelName,class:"tok-labelName"},{tag:tags$1.inserted,class:"tok-inserted"},{tag:tags$1.deleted,class:"tok-deleted"},{tag:tags$1.literal,class:"tok-literal"},{tag:tags$1.string,class:"tok-string"},{tag:tags$1.number,class:"tok-number"},{tag:[tags$1.regexp,tags$1.escape,tags$1.special(tags$1.string)],class:"tok-string2"},{tag:tags$1.variableName,class:"tok-variableName"},{tag:tags$1.local(tags$1.variableName),class:"tok-variableName tok-local"},{tag:tags$1.definition(tags$1.variableName),class:"tok-variableName tok-definition"},{tag:tags$1.special(tags$1.variableName),class:"tok-variableName2"},{tag:tags$1.definition(tags$1.propertyName),class:"tok-propertyName tok-definition"},{tag:tags$1.typeName,class:"tok-typeName"},{tag:tags$1.namespace,class:"tok-namespace"},{tag:tags$1.className,class:"tok-className"},{tag:tags$1.macroName,class:"tok-macroName"},{tag:tags$1.propertyName,class:"tok-propertyName"},{tag:tags$1.operator,class:"tok-operator"},{tag:tags$1.comment,class:"tok-comment"},{tag:tags$1.meta,class:"tok-meta"},{tag:tags$1.invalid,class:"tok-invalid"},{tag:tags$1.punctuation,class:"tok-punctuation"}]);const jsonHighlighting=styleTags({String:tags$1.string,Number:tags$1.number,"True False":tags$1.bool,PropertyName:tags$1.propertyName,Null:tags$1.null,",":tags$1.separator,"[ ]":tags$1.squareBracket,"{ }":tags$1.brace}),parser$2=LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[jsonHighlighting],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});class Text$1{constructor(){}lineAt(n){if(n<0||n>this.length)throw new RangeError(`Invalid position ${n} in document of length ${this.length}`);return this.lineInner(n,!1,1,0)}line(n){if(n<1||n>this.lines)throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);return this.lineInner(n,!0,1,0)}replace(n,r,g){let $=[];return this.decompose(0,n,$,2),g.length&&g.decompose(0,g.length,$,3),this.decompose(r,this.length,$,1),TextNode.from($,this.length-(r-n)+g.length)}append(n){return this.replace(this.length,this.length,n)}slice(n,r=this.length){let g=[];return this.decompose(n,r,g,0),TextNode.from(g,r-n)}eq(n){if(n==this)return!0;if(n.length!=this.length||n.lines!=this.lines)return!1;let r=this.scanIdentical(n,1),g=this.length-this.scanIdentical(n,-1),$=new RawTextCursor(this),L=new RawTextCursor(n);for(let k=r,oe=r;;){if($.next(k),L.next(k),k=0,$.lineBreak!=L.lineBreak||$.done!=L.done||$.value!=L.value)return!1;if(oe+=$.value.length,$.done||oe>=g)return!0}}iter(n=1){return new RawTextCursor(this,n)}iterRange(n,r=this.length){return new PartialTextCursor(this,n,r)}iterLines(n,r){let g;if(n==null)g=this.iter();else{r==null&&(r=this.lines+1);let $=this.line(n).from;g=this.iterRange($,Math.max($,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new LineCursor(g)}toString(){return this.sliceString(0)}toJSON(){let n=[];return this.flatten(n),n}static of(n){if(n.length==0)throw new RangeError("A document must have at least one line");return n.length==1&&!n[0]?Text$1.empty:n.length<=32?new TextLeaf(n):TextNode.from(TextLeaf.split(n,[]))}}class TextLeaf extends Text$1{constructor(n,r=textLength(n)){super(),this.text=n,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(n,r,g,$){for(let L=0;;L++){let k=this.text[L],oe=$+k.length;if((r?g:oe)>=n)return new Line($,oe,g,k);$=oe+1,g++}}decompose(n,r,g,$){let L=n<=0&&r>=this.length?this:new TextLeaf(sliceText(this.text,n,r),Math.min(r,this.length)-Math.max(0,n));if($&1){let k=g.pop(),oe=appendText(L.text,k.text.slice(),0,L.length);if(oe.length<=32)g.push(new TextLeaf(oe,k.length+L.length));else{let re=oe.length>>1;g.push(new TextLeaf(oe.slice(0,re)),new TextLeaf(oe.slice(re)))}}else g.push(L)}replace(n,r,g){if(!(g instanceof TextLeaf))return super.replace(n,r,g);let $=appendText(this.text,appendText(g.text,sliceText(this.text,0,n)),r),L=this.length+g.length-(r-n);return $.length<=32?new TextLeaf($,L):TextNode.from(TextLeaf.split($,[]),L)}sliceString(n,r=this.length,g=`
+`){let $="";for(let L=0,k=0;L<=r&&kn&&k&&($+=g),nL&&($+=oe.slice(Math.max(0,n-L),r-L)),L=re+1}return $}flatten(n){for(let r of this.text)n.push(r)}scanIdentical(){return 0}static split(n,r){let g=[],$=-1;for(let L of n)g.push(L),$+=L.length+1,g.length==32&&(r.push(new TextLeaf(g,$)),g=[],$=-1);return $>-1&&r.push(new TextLeaf(g,$)),r}}class TextNode extends Text$1{constructor(n,r){super(),this.children=n,this.length=r,this.lines=0;for(let g of n)this.lines+=g.lines}lineInner(n,r,g,$){for(let L=0;;L++){let k=this.children[L],oe=$+k.length,re=g+k.lines-1;if((r?re:oe)>=n)return k.lineInner(n,r,g,$);$=oe+1,g=re+1}}decompose(n,r,g,$){for(let L=0,k=0;k<=r&&L=k){let ae=$&((k<=n?1:0)|(re>=r?2:0));k>=n&&re<=r&&!ae?g.push(oe):oe.decompose(n-k,r-k,g,ae)}k=re+1}}replace(n,r,g){if(g.lines=L&&r<=oe){let re=k.replace(n-L,r-L,g),ae=this.lines-k.lines+re.lines;if(re.lines>5-1&&re.lines>ae>>5+1){let le=this.children.slice();return le[$]=re,new TextNode(le,this.length-(r-n)+g.length)}return super.replace(L,oe,re)}L=oe+1}return super.replace(n,r,g)}sliceString(n,r=this.length,g=`
+`){let $="";for(let L=0,k=0;Ln&&L&&($+=g),nk&&($+=oe.sliceString(n-k,r-k,g)),k=re+1}return $}flatten(n){for(let r of this.children)r.flatten(n)}scanIdentical(n,r){if(!(n instanceof TextNode))return 0;let g=0,[$,L,k,oe]=r>0?[0,0,this.children.length,n.children.length]:[this.children.length-1,n.children.length-1,-1,-1];for(;;$+=r,L+=r){if($==k||L==oe)return g;let re=this.children[$],ae=n.children[L];if(re!=ae)return g+re.scanIdentical(ae,r);g+=re.length+1}}static from(n,r=n.reduce((g,$)=>g+$.length+1,-1)){let g=0;for(let de of n)g+=de.lines;if(g<32){let de=[];for(let Fe of n)Fe.flatten(de);return new TextLeaf(de,r)}let $=Math.max(32,g>>5),L=$<<1,k=$>>1,oe=[],re=0,ae=-1,le=[];function ue(de){let Fe;if(de.lines>L&&de instanceof TextNode)for(let ze of de.children)ue(ze);else de.lines>k&&(re>k||!re)?(pe(),oe.push(de)):de instanceof TextLeaf&&re&&(Fe=le[le.length-1])instanceof TextLeaf&&de.lines+Fe.lines<=32?(re+=de.lines,ae+=de.length+1,le[le.length-1]=new TextLeaf(Fe.text.concat(de.text),Fe.length+1+de.length)):(re+de.lines>$&&pe(),re+=de.lines,ae+=de.length+1,le.push(de))}function pe(){re!=0&&(oe.push(le.length==1?le[0]:TextNode.from(le,ae)),ae=-1,re=le.length=0)}for(let de of n)ue(de);return pe(),oe.length==1?oe[0]:new TextNode(oe,r)}}Text$1.empty=new TextLeaf([""],0);function textLength(e){let n=-1;for(let r of e)n+=r.length+1;return n}function appendText(e,n,r=0,g=1e9){for(let $=0,L=0,k=!0;L=r&&(re>g&&(oe=oe.slice(0,g-$)),$0?1:(n instanceof TextLeaf?n.text.length:n.children.length)<<1]}nextInner(n,r){for(this.done=this.lineBreak=!1;;){let g=this.nodes.length-1,$=this.nodes[g],L=this.offsets[g],k=L>>1,oe=$ instanceof TextLeaf?$.text.length:$.children.length;if(k==(r>0?oe:0)){if(g==0)return this.done=!0,this.value="",this;r>0&&this.offsets[g-1]++,this.nodes.pop(),this.offsets.pop()}else if((L&1)==(r>0?0:1)){if(this.offsets[g]+=r,n==0)return this.lineBreak=!0,this.value=`
+`,this;n--}else if($ instanceof TextLeaf){let re=$.text[k+(r<0?-1:0)];if(this.offsets[g]+=r,re.length>Math.max(0,n))return this.value=n==0?re:r>0?re.slice(n):re.slice(0,re.length-n),this;n-=re.length}else{let re=$.children[k+(r<0?-1:0)];n>re.length?(n-=re.length,this.offsets[g]+=r):(r<0&&this.offsets[g]--,this.nodes.push(re),this.offsets.push(r>0?1:(re instanceof TextLeaf?re.text.length:re.children.length)<<1))}}}next(n=0){return n<0&&(this.nextInner(-n,-this.dir),n=this.value.length),this.nextInner(n,this.dir)}}class PartialTextCursor{constructor(n,r,g){this.value="",this.done=!1,this.cursor=new RawTextCursor(n,r>g?-1:1),this.pos=r>g?n.length:0,this.from=Math.min(r,g),this.to=Math.max(r,g)}nextInner(n,r){if(r<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;n+=Math.max(0,r<0?this.pos-this.to:this.from-this.pos);let g=r<0?this.pos-this.from:this.to-this.pos;n>g&&(n=g),g-=n;let{value:$}=this.cursor.next(n);return this.pos+=($.length+n)*r,this.value=$.length<=g?$:r<0?$.slice($.length-g):$.slice(0,g),this.done=!this.value,this}next(n=0){return n<0?n=Math.max(n,this.from-this.pos):n>0&&(n=Math.min(n,this.to-this.pos)),this.nextInner(n,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LineCursor{constructor(n){this.inner=n,this.afterBreak=!0,this.value="",this.done=!1}next(n=0){let{done:r,lineBreak:g,value:$}=this.inner.next(n);return r?(this.done=!0,this.value=""):g?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=$,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Text$1.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});class Line{constructor(n,r,g,$){this.from=n,this.to=r,this.number=g,this.text=$}get length(){return this.to-this.from}}let extend$1="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=1;ee)return extend$1[n-1]<=e;return!1}function isRegionalIndicator(e){return e>=127462&&e<=127487}const ZWJ=8205;function findClusterBreak(e,n,r=!0,g=!0){return(r?nextClusterBreak:prevClusterBreak)(e,n,g)}function nextClusterBreak(e,n,r){if(n==e.length)return n;n&&surrogateLow(e.charCodeAt(n))&&surrogateHigh(e.charCodeAt(n-1))&&n--;let g=codePointAt(e,n);for(n+=codePointSize(g);n=0&&isRegionalIndicator(codePointAt(e,k));)L++,k-=2;if(L%2==0)break;n+=2}else break}return n}function prevClusterBreak(e,n,r){for(;n>0;){let g=nextClusterBreak(e,n-2,r);if(g=56320&&e<57344}function surrogateHigh(e){return e>=55296&&e<56320}function codePointAt(e,n){let r=e.charCodeAt(n);if(!surrogateHigh(r)||n+1==e.length)return r;let g=e.charCodeAt(n+1);return surrogateLow(g)?(r-55296<<10)+(g-56320)+65536:r}function fromCodePoint(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function codePointSize(e){return e<65536?1:2}const DefaultSplit=/\r\n?|\n/;var MapMode=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(MapMode||(MapMode={}));class ChangeDesc{constructor(n){this.sections=n}get length(){let n=0;for(let r=0;rn)return L+(n-$);L+=oe}else{if(g!=MapMode.Simple&&ae>=n&&(g==MapMode.TrackDel&&$n||g==MapMode.TrackBefore&&$n))return null;if(ae>n||ae==n&&r<0&&!oe)return n==$||r<0?L:L+re;L+=re}$=ae}if(n>$)throw new RangeError(`Position ${n} is out of range for changeset of length ${$}`);return L}touchesRange(n,r=n){for(let g=0,$=0;g=0&&$<=r&&oe>=n)return $r?"cover":!0;$=oe}return!1}toString(){let n="";for(let r=0;r=0?":"+$:"")}return n}toJSON(){return this.sections}static fromJSON(n){if(!Array.isArray(n)||n.length%2||n.some(r=>typeof r!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(n)}static create(n){return new ChangeDesc(n)}}class ChangeSet extends ChangeDesc{constructor(n,r){super(n),this.inserted=r}apply(n){if(this.length!=n.length)throw new RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(r,g,$,L,k)=>n=n.replace($,$+(g-r),k),!1),n}mapDesc(n,r=!1){return mapSet(this,n,r,!0)}invert(n){let r=this.sections.slice(),g=[];for(let $=0,L=0;$=0){r[$]=oe,r[$+1]=k;let re=$>>1;for(;g.length0&&addInsert(g,r,L.text),L.forward(le),oe+=le}let ae=n[k++];for(;oe>1].toJSON()))}return n}static of(n,r,g){let $=[],L=[],k=0,oe=null;function re(le=!1){if(!le&&!$.length)return;kpe||ue<0||pe>r)throw new RangeError(`Invalid change range ${ue} to ${pe} (in doc of length ${r})`);let Fe=de?typeof de=="string"?Text$1.of(de.split(g||DefaultSplit)):de:Text$1.empty,ze=Fe.length;if(ue==pe&&ze==0)return;uek&&addSection($,ue-k,-1),addSection($,pe-ue,ze),addInsert(L,$,Fe),k=pe}}return ae(n),re(!oe),oe}static empty(n){return new ChangeSet(n?[n,-1]:[],[])}static fromJSON(n){if(!Array.isArray(n))throw new RangeError("Invalid JSON representation of ChangeSet");let r=[],g=[];for(let $=0;$oe&&typeof k!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(L.length==1)r.push(L[0],0);else{for(;g.length<$;)g.push(Text$1.empty);g[$]=Text$1.of(L.slice(1)),r.push(L[0],g[$].length)}}}return new ChangeSet(r,g)}static createSet(n,r){return new ChangeSet(n,r)}}function addSection(e,n,r,g=!1){if(n==0&&r<=0)return;let $=e.length-2;$>=0&&r<=0&&r==e[$+1]?e[$]+=n:n==0&&e[$]==0?e[$+1]+=r:g?(e[$]+=n,e[$+1]+=r):e.push(n,r)}function addInsert(e,n,r){if(r.length==0)return;let g=n.length-2>>1;if(g>1])),!(r||k==e.sections.length||e.sections[k+1]<0);)oe=e.sections[k++],re=e.sections[k++];n($,ae,L,le,ue),$=ae,L=le}}}function mapSet(e,n,r,g=!1){let $=[],L=g?[]:null,k=new SectionIter(e),oe=new SectionIter(n);for(let re=-1;;)if(k.ins==-1&&oe.ins==-1){let ae=Math.min(k.len,oe.len);addSection($,ae,-1),k.forward(ae),oe.forward(ae)}else if(oe.ins>=0&&(k.ins<0||re==k.i||k.off==0&&(oe.len=0&&re=0){let ae=0,le=k.len;for(;le;)if(oe.ins==-1){let ue=Math.min(le,oe.len);ae+=ue,le-=ue,oe.forward(ue)}else if(oe.ins==0&&oe.lenre||k.ins>=0&&k.len>re)&&(oe||g.length>ae),L.forward2(re),k.forward(re)}}}}class SectionIter{constructor(n){this.set=n,this.i=0,this.next()}next(){let{sections:n}=this.set;this.i>1;return r>=n.length?Text$1.empty:n[r]}textBit(n){let{inserted:r}=this.set,g=this.i-2>>1;return g>=r.length&&!n?Text$1.empty:r[g].slice(this.off,n==null?void 0:this.off+n)}forward(n){n==this.len?this.next():(this.len-=n,this.off+=n)}forward2(n){this.ins==-1?this.forward(n):n==this.ins?this.next():(this.ins-=n,this.off+=n)}}class SelectionRange{constructor(n,r,g){this.from=n,this.to=r,this.flags=g}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let n=this.flags&3;return n==3?null:n}get goalColumn(){let n=this.flags>>5;return n==33554431?void 0:n}map(n,r=-1){let g,$;return this.empty?g=$=n.mapPos(this.from,r):(g=n.mapPos(this.from,1),$=n.mapPos(this.to,-1)),g==this.from&&$==this.to?this:new SelectionRange(g,$,this.flags)}extend(n,r=n){if(n<=this.anchor&&r>=this.anchor)return EditorSelection.range(n,r);let g=Math.abs(n-this.anchor)>Math.abs(r-this.anchor)?n:r;return EditorSelection.range(this.anchor,g)}eq(n){return this.anchor==n.anchor&&this.head==n.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(n){if(!n||typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(n.anchor,n.head)}static create(n,r,g){return new SelectionRange(n,r,g)}}class EditorSelection{constructor(n,r){this.ranges=n,this.mainIndex=r}map(n,r=-1){return n.empty?this:EditorSelection.create(this.ranges.map(g=>g.map(n,r)),this.mainIndex)}eq(n){if(this.ranges.length!=n.ranges.length||this.mainIndex!=n.mainIndex)return!1;for(let r=0;rn.toJSON()),main:this.mainIndex}}static fromJSON(n){if(!n||!Array.isArray(n.ranges)||typeof n.main!="number"||n.main>=n.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(n.ranges.map(r=>SelectionRange.fromJSON(r)),n.main)}static single(n,r=n){return new EditorSelection([EditorSelection.range(n,r)],0)}static create(n,r=0){if(n.length==0)throw new RangeError("A selection needs at least one range");for(let g=0,$=0;$n?4:0))}static normalized(n,r=0){let g=n[r];n.sort(($,L)=>$.from-L.from),r=n.indexOf(g);for(let $=1;$L.head?EditorSelection.range(re,oe):EditorSelection.range(oe,re))}}return new EditorSelection(n,r)}}function checkSelection(e,n){for(let r of e.ranges)if(r.to>n)throw new RangeError("Selection points outside of document")}let nextID=0;class Facet{constructor(n,r,g,$,L){this.combine=n,this.compareInput=r,this.compare=g,this.isStatic=$,this.id=nextID++,this.default=n([]),this.extensions=typeof L=="function"?L(this):L}static define(n={}){return new Facet(n.combine||(r=>r),n.compareInput||((r,g)=>r===g),n.compare||(n.combine?(r,g)=>r===g:sameArray),!!n.static,n.enables)}of(n){return new FacetProvider([],this,0,n)}compute(n,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(n,this,1,r)}computeN(n,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(n,this,2,r)}from(n,r){return r||(r=g=>g),this.compute([n],g=>r(g.field(n)))}}function sameArray(e,n){return e==n||e.length==n.length&&e.every((r,g)=>r===n[g])}class FacetProvider{constructor(n,r,g,$){this.dependencies=n,this.facet=r,this.type=g,this.value=$,this.id=nextID++}dynamicSlot(n){var r;let g=this.value,$=this.facet.compareInput,L=this.id,k=n[L]>>1,oe=this.type==2,re=!1,ae=!1,le=[];for(let ue of this.dependencies)ue=="doc"?re=!0:ue=="selection"?ae=!0:(((r=n[ue.id])!==null&&r!==void 0?r:1)&1)==0&&le.push(n[ue.id]);return{create(ue){return ue.values[k]=g(ue),1},update(ue,pe){if(re&&pe.docChanged||ae&&(pe.docChanged||pe.selection)||ensureAll(ue,le)){let de=g(ue);if(oe?!compareArray(de,ue.values[k],$):!$(de,ue.values[k]))return ue.values[k]=de,1}return 0},reconfigure:(ue,pe)=>{let de=g(ue),Fe=pe.config.address[L];if(Fe!=null){let ze=getAddr(pe,Fe);if(this.dependencies.every(Ce=>Ce instanceof Facet?pe.facet(Ce)===ue.facet(Ce):Ce instanceof StateField?pe.field(Ce,!1)==ue.field(Ce,!1):!0)||(oe?compareArray(de,ze,$):$(de,ze)))return ue.values[k]=ze,0}return ue.values[k]=de,1}}}}function compareArray(e,n,r){if(e.length!=n.length)return!1;for(let g=0;ge[re.id]),$=r.map(re=>re.type),L=g.filter(re=>!(re&1)),k=e[n.id]>>1;function oe(re){let ae=[];for(let le=0;leg===$),n);return n.provide&&(r.provides=n.provide(r)),r}create(n){let r=n.facet(initField).find(g=>g.field==this);return(r?.create||this.createF)(n)}slot(n){let r=n[this.id]>>1;return{create:g=>(g.values[r]=this.create(g),1),update:(g,$)=>{let L=g.values[r],k=this.updateF(L,$);return this.compareF(L,k)?0:(g.values[r]=k,1)},reconfigure:(g,$)=>$.config.address[this.id]!=null?(g.values[r]=$.field(this),0):(g.values[r]=this.create(g),1)}}init(n){return[this,initField.of({field:this,create:n})]}get extension(){return this}}const Prec_={lowest:4,low:3,default:2,high:1,highest:0};function prec(e){return n=>new PrecExtension(n,e)}const Prec={highest:prec(Prec_.highest),high:prec(Prec_.high),default:prec(Prec_.default),low:prec(Prec_.low),lowest:prec(Prec_.lowest)};class PrecExtension{constructor(n,r){this.inner=n,this.prec=r}}class Compartment{of(n){return new CompartmentInstance(this,n)}reconfigure(n){return Compartment.reconfigure.of({compartment:this,extension:n})}get(n){return n.config.compartments.get(this)}}class CompartmentInstance{constructor(n,r){this.compartment=n,this.inner=r}}class Configuration{constructor(n,r,g,$,L,k){for(this.base=n,this.compartments=r,this.dynamicSlots=g,this.address=$,this.staticValues=L,this.facets=k,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(n,r,g){let $=[],L=Object.create(null),k=new Map;for(let pe of flatten(n,r,k))pe instanceof StateField?$.push(pe):(L[pe.facet.id]||(L[pe.facet.id]=[])).push(pe);let oe=Object.create(null),re=[],ae=[];for(let pe of $)oe[pe.id]=ae.length<<1,ae.push(de=>pe.slot(de));let le=g?.config.facets;for(let pe in L){let de=L[pe],Fe=de[0].facet,ze=le&&le[pe]||[];if(de.every(Ce=>Ce.type==0))if(oe[Fe.id]=re.length<<1|1,sameArray(ze,de))re.push(g.facet(Fe));else{let Ce=Fe.combine(de.map(Ie=>Ie.value));re.push(g&&Fe.compare(Ce,g.facet(Fe))?g.facet(Fe):Ce)}else{for(let Ce of de)Ce.type==0?(oe[Ce.id]=re.length<<1|1,re.push(Ce.value)):(oe[Ce.id]=ae.length<<1,ae.push(Ie=>Ce.dynamicSlot(Ie)));oe[Fe.id]=ae.length<<1,ae.push(Ce=>dynamicFacetSlot(Ce,Fe,de))}}let ue=ae.map(pe=>pe(oe));return new Configuration(n,k,ue,oe,re,L)}}function flatten(e,n,r){let g=[[],[],[],[],[]],$=new Map;function L(k,oe){let re=$.get(k);if(re!=null){if(re<=oe)return;let ae=g[re].indexOf(k);ae>-1&&g[re].splice(ae,1),k instanceof CompartmentInstance&&r.delete(k.compartment)}if($.set(k,oe),Array.isArray(k))for(let ae of k)L(ae,oe);else if(k instanceof CompartmentInstance){if(r.has(k.compartment))throw new RangeError("Duplicate use of compartment in extensions");let ae=n.get(k.compartment)||k.inner;r.set(k.compartment,ae),L(ae,oe)}else if(k instanceof PrecExtension)L(k.inner,k.prec);else if(k instanceof StateField)g[oe].push(k),k.provides&&L(k.provides,oe);else if(k instanceof FacetProvider)g[oe].push(k),k.facet.extensions&&L(k.facet.extensions,Prec_.default);else{let ae=k.extension;if(!ae)throw new Error(`Unrecognized extension value in extension set (${k}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);L(ae,oe)}}return L(e,Prec_.default),g.reduce((k,oe)=>k.concat(oe))}function ensureAddr(e,n){if(n&1)return 2;let r=n>>1,g=e.status[r];if(g==4)throw new Error("Cyclic dependency between fields and/or facets");if(g&2)return g;e.status[r]=4;let $=e.computeSlot(e,e.config.dynamicSlots[r]);return e.status[r]=2|$}function getAddr(e,n){return n&1?e.config.staticValues[n>>1]:e.values[n>>1]}const languageData=Facet.define(),allowMultipleSelections=Facet.define({combine:e=>e.some(n=>n),static:!0}),lineSeparator=Facet.define({combine:e=>e.length?e[0]:void 0,static:!0}),changeFilter=Facet.define(),transactionFilter=Facet.define(),transactionExtender=Facet.define(),readOnly=Facet.define({combine:e=>e.length?e[0]:!1});class Annotation{constructor(n,r){this.type=n,this.value=r}static define(){return new AnnotationType}}class AnnotationType{of(n){return new Annotation(this,n)}}class StateEffectType{constructor(n){this.map=n}of(n){return new StateEffect(this,n)}}class StateEffect{constructor(n,r){this.type=n,this.value=r}map(n){let r=this.type.map(this.value,n);return r===void 0?void 0:r==this.value?this:new StateEffect(this.type,r)}is(n){return this.type==n}static define(n={}){return new StateEffectType(n.map||(r=>r))}static mapEffects(n,r){if(!n.length)return n;let g=[];for(let $ of n){let L=$.map(r);L&&g.push(L)}return g}}StateEffect.reconfigure=StateEffect.define();StateEffect.appendConfig=StateEffect.define();class Transaction{constructor(n,r,g,$,L,k){this.startState=n,this.changes=r,this.selection=g,this.effects=$,this.annotations=L,this.scrollIntoView=k,this._doc=null,this._state=null,g&&checkSelection(g,r.newLength),L.some(oe=>oe.type==Transaction.time)||(this.annotations=L.concat(Transaction.time.of(Date.now())))}static create(n,r,g,$,L,k){return new Transaction(n,r,g,$,L,k)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(n){for(let r of this.annotations)if(r.type==n)return r.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(n){let r=this.annotation(Transaction.userEvent);return!!(r&&(r==n||r.length>n.length&&r.slice(0,n.length)==n&&r[n.length]=="."))}}Transaction.time=Annotation.define();Transaction.userEvent=Annotation.define();Transaction.addToHistory=Annotation.define();Transaction.remote=Annotation.define();function joinRanges(e,n){let r=[];for(let g=0,$=0;;){let L,k;if(g=e[g]))L=e[g++],k=e[g++];else if($=0;$--){let L=g[$](e);L instanceof Transaction?e=L:Array.isArray(L)&&L.length==1&&L[0]instanceof Transaction?e=L[0]:e=resolveTransaction(n,asArray$1(L),!1)}return e}function extendTransaction(e){let n=e.startState,r=n.facet(transactionExtender),g=e;for(let $=r.length-1;$>=0;$--){let L=r[$](e);L&&Object.keys(L).length&&(g=mergeTransaction(e,resolveTransactionInner(n,L,e.changes.newLength),!0))}return g==e?e:Transaction.create(n,e.changes,e.selection,g.effects,g.annotations,g.scrollIntoView)}const none$2=[];function asArray$1(e){return e==null?none$2:Array.isArray(e)?e:[e]}var CharCategory=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(CharCategory||(CharCategory={}));const nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function hasWordChar(e){if(wordChar)return wordChar.test(e);for(let n=0;n"\x80"&&(r.toUpperCase()!=r.toLowerCase()||nonASCIISingleCaseWordChar.test(r)))return!0}return!1}function makeCategorizer(e){return n=>{if(!/\S/.test(n))return CharCategory.Space;if(hasWordChar(n))return CharCategory.Word;for(let r=0;r-1)return CharCategory.Word;return CharCategory.Other}}class EditorState{constructor(n,r,g,$,L,k){this.config=n,this.doc=r,this.selection=g,this.values=$,this.status=n.statusTemplate.slice(),this.computeSlot=L,k&&(k._state=this);for(let oe=0;oe$.set(re,oe)),r=null),$.set(k.value.compartment,k.value.extension)):k.is(StateEffect.reconfigure)?(r=null,g=k.value):k.is(StateEffect.appendConfig)&&(r=null,g=asArray$1(g).concat(k.value));let L;r?L=n.startState.values.slice():(r=Configuration.resolve(g,$,this),L=new EditorState(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(oe,re)=>re.reconfigure(oe,this),null).values),new EditorState(r,n.newDoc,n.newSelection,L,(k,oe)=>oe.update(k,n),n)}replaceSelection(n){return typeof n=="string"&&(n=this.toText(n)),this.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:n},range:EditorSelection.cursor(r.from+n.length)}))}changeByRange(n){let r=this.selection,g=n(r.ranges[0]),$=this.changes(g.changes),L=[g.range],k=asArray$1(g.effects);for(let oe=1;oek.spec.fromJSON(oe,re)))}}return EditorState.create({doc:n.doc,selection:EditorSelection.fromJSON(n.selection),extensions:r.extensions?$.concat([r.extensions]):$})}static create(n={}){let r=Configuration.resolve(n.extensions||[],new Map),g=n.doc instanceof Text$1?n.doc:Text$1.of((n.doc||"").split(r.staticFacet(EditorState.lineSeparator)||DefaultSplit)),$=n.selection?n.selection instanceof EditorSelection?n.selection:EditorSelection.single(n.selection.anchor,n.selection.head):EditorSelection.single(0);return checkSelection($,g.length),r.staticFacet(allowMultipleSelections)||($=$.asSingle()),new EditorState(r,g,$,r.dynamicSlots.map(()=>null),(L,k)=>k.create(L),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||`
+`}get readOnly(){return this.facet(readOnly)}phrase(n,...r){for(let g of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(g,n)){n=g[n];break}return r.length&&(n=n.replace(/\$(\$|\d*)/g,(g,$)=>{if($=="$")return"$";let L=+($||1);return!L||L>r.length?g:r[L-1]})),n}languageDataAt(n,r,g=-1){let $=[];for(let L of this.facet(languageData))for(let k of L(this,r,g))Object.prototype.hasOwnProperty.call(k,n)&&$.push(k[n]);return $}charCategorizer(n){return makeCategorizer(this.languageDataAt("wordChars",n).join(""))}wordAt(n){let{text:r,from:g,length:$}=this.doc.lineAt(n),L=this.charCategorizer(n),k=n-g,oe=n-g;for(;k>0;){let re=findClusterBreak(r,k,!1);if(L(r.slice(re,k))!=CharCategory.Word)break;k=re}for(;oe<$;){let re=findClusterBreak(r,oe);if(L(r.slice(oe,re))!=CharCategory.Word)break;oe=re}return k==oe?null:EditorSelection.range(k+g,oe+g)}}EditorState.allowMultipleSelections=allowMultipleSelections;EditorState.tabSize=Facet.define({combine:e=>e.length?e[0]:4});EditorState.lineSeparator=lineSeparator;EditorState.readOnly=readOnly;EditorState.phrases=Facet.define({compare(e,n){let r=Object.keys(e),g=Object.keys(n);return r.length==g.length&&r.every($=>e[$]==n[$])}});EditorState.languageData=languageData;EditorState.changeFilter=changeFilter;EditorState.transactionFilter=transactionFilter;EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();function combineConfig(e,n,r={}){let g={};for(let $ of e)for(let L of Object.keys($)){let k=$[L],oe=g[L];if(oe===void 0)g[L]=k;else if(!(oe===k||k===void 0))if(Object.hasOwnProperty.call(r,L))g[L]=r[L](oe,k);else throw new Error("Config merge conflict for field "+L)}for(let $ in n)g[$]===void 0&&(g[$]=n[$]);return g}class RangeValue{eq(n){return this==n}range(n,r=n){return Range.create(n,r,this)}}RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=!1;RangeValue.prototype.mapMode=MapMode.TrackDel;class Range{constructor(n,r,g){this.from=n,this.to=r,this.value=g}static create(n,r,g){return new Range(n,r,g)}}function cmpRange(e,n){return e.from-n.from||e.value.startSide-n.value.startSide}class Chunk{constructor(n,r,g,$){this.from=n,this.to=r,this.value=g,this.maxPoint=$}get length(){return this.to[this.to.length-1]}findIndex(n,r,g,$=0){let L=g?this.to:this.from;for(let k=$,oe=L.length;;){if(k==oe)return k;let re=k+oe>>1,ae=L[re]-n||(g?this.value[re].endSide:this.value[re].startSide)-r;if(re==k)return ae>=0?k:oe;ae>=0?oe=re:k=re+1}}between(n,r,g,$){for(let L=this.findIndex(r,-1e9,!0),k=this.findIndex(g,1e9,!1,L);Lde||pe==de&&ae.startSide>0&&ae.endSide<=0)continue;(de-pe||ae.endSide-ae.startSide)<0||(k<0&&(k=pe),ae.point&&(oe=Math.max(oe,de-pe)),g.push(ae),$.push(pe-k),L.push(de-k))}return{mapped:g.length?new Chunk($,L,g,oe):null,pos:k}}}class RangeSet{constructor(n,r,g,$){this.chunkPos=n,this.chunk=r,this.nextLayer=g,this.maxPoint=$}static create(n,r,g,$){return new RangeSet(n,r,g,$)}get length(){let n=this.chunk.length-1;return n<0?0:Math.max(this.chunkEnd(n),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let n=this.nextLayer.size;for(let r of this.chunk)n+=r.value.length;return n}chunkEnd(n){return this.chunkPos[n]+this.chunk[n].length}update(n){let{add:r=[],sort:g=!1,filterFrom:$=0,filterTo:L=this.length}=n,k=n.filter;if(r.length==0&&!k)return this;if(g&&(r=r.slice().sort(cmpRange)),this.isEmpty)return r.length?RangeSet.of(r):this;let oe=new LayerCursor(this,null,-1).goto(0),re=0,ae=[],le=new RangeSetBuilder;for(;oe.value||re=0){let ue=r[re++];le.addInner(ue.from,ue.to,ue.value)||ae.push(ue)}else oe.rangeIndex==1&&oe.chunkIndexthis.chunkEnd(oe.chunkIndex)||Loe.to||L=L&&n<=L+k.length&&k.between(L,n-L,r-L,g)===!1)return}this.nextLayer.between(n,r,g)}}iter(n=0){return HeapCursor.from([this]).goto(n)}get isEmpty(){return this.nextLayer==this}static iter(n,r=0){return HeapCursor.from(n).goto(r)}static compare(n,r,g,$,L=-1){let k=n.filter(ue=>ue.maxPoint>0||!ue.isEmpty&&ue.maxPoint>=L),oe=r.filter(ue=>ue.maxPoint>0||!ue.isEmpty&&ue.maxPoint>=L),re=findSharedChunks(k,oe,g),ae=new SpanCursor(k,re,L),le=new SpanCursor(oe,re,L);g.iterGaps((ue,pe,de)=>compare(ae,ue,le,pe,de,$)),g.empty&&g.length==0&&compare(ae,0,le,0,0,$)}static eq(n,r,g=0,$){$==null&&($=1e9);let L=n.filter(le=>!le.isEmpty&&r.indexOf(le)<0),k=r.filter(le=>!le.isEmpty&&n.indexOf(le)<0);if(L.length!=k.length)return!1;if(!L.length)return!0;let oe=findSharedChunks(L,k),re=new SpanCursor(L,oe,0).goto(g),ae=new SpanCursor(k,oe,0).goto(g);for(;;){if(re.to!=ae.to||!sameValues(re.active,ae.active)||re.point&&(!ae.point||!re.point.eq(ae.point)))return!1;if(re.to>$)return!0;re.next(),ae.next()}}static spans(n,r,g,$,L=-1){let k=new SpanCursor(n,null,L).goto(r),oe=r,re=k.openStart;for(;;){let ae=Math.min(k.to,g);if(k.point?($.point(oe,ae,k.point,k.activeForPoint(k.to),re,k.pointRank),re=k.openEnd(ae)+(k.to>ae?1:0)):ae>oe&&($.span(oe,ae,k.active,re),re=k.openEnd(ae)),k.to>g)break;oe=k.to,k.next()}return re}static of(n,r=!1){let g=new RangeSetBuilder;for(let $ of n instanceof Range?[n]:r?lazySort(n):n)g.add($.from,$.to,$.value);return g.finish()}}RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(e){if(e.length>1)for(let n=e[0],r=1;r0)return e.slice().sort(cmpRange);n=g}return e}RangeSet.empty.nextLayer=RangeSet.empty;class RangeSetBuilder{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(n){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,n&&(this.from=[],this.to=[],this.value=[])}add(n,r,g){this.addInner(n,r,g)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(n,r,g)}addInner(n,r,g){let $=n-this.lastTo||g.startSide-this.last.endSide;if($<=0&&(n-this.lastFrom||g.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return $<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=n),this.from.push(n-this.chunkStart),this.to.push(r-this.chunkStart),this.last=g,this.lastFrom=n,this.lastTo=r,this.value.push(g),g.point&&(this.maxPoint=Math.max(this.maxPoint,r-n)),!0)}addChunk(n,r){if((n-this.lastTo||r.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,r.maxPoint),this.chunks.push(r),this.chunkPos.push(n);let g=r.value.length-1;return this.last=r.value[g],this.lastFrom=r.from[g]+n,this.lastTo=r.to[g]+n,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(n){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return n;let r=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(n):n,this.setMaxPoint);return this.from=null,r}}function findSharedChunks(e,n,r){let g=new Map;for(let L of e)for(let k=0;k=this.minPoint)break}}setRangeIndex(n){if(n==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=g&&$.push(new LayerCursor(k,r,g,L));return $.length==1?$[0]:new HeapCursor($)}get startSide(){return this.value?this.value.startSide:0}goto(n,r=-1e9){for(let g of this.heap)g.goto(n,r);for(let g=this.heap.length>>1;g>=0;g--)heapBubble(this.heap,g);return this.next(),this}forward(n,r){for(let g of this.heap)g.forward(n,r);for(let g=this.heap.length>>1;g>=0;g--)heapBubble(this.heap,g);(this.to-n||this.value.endSide-r)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let n=this.heap[0];this.from=n.from,this.to=n.to,this.value=n.value,this.rank=n.rank,n.value&&n.next(),heapBubble(this.heap,0)}}}function heapBubble(e,n){for(let r=e[n];;){let g=(n<<1)+1;if(g>=e.length)break;let $=e[g];if(g+1=0&&($=e[g+1],g++),r.compare($)<0)break;e[g]=r,e[n]=$,n=g}}class SpanCursor{constructor(n,r,g){this.minPoint=g,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(n,r,g)}goto(n,r=-1e9){return this.cursor.goto(n,r),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=n,this.endSide=r,this.openStart=-1,this.next(),this}forward(n,r){for(;this.minActive>-1&&(this.activeTo[this.minActive]-n||this.active[this.minActive].endSide-r)<0;)this.removeActive(this.minActive);this.cursor.forward(n,r)}removeActive(n){remove(this.active,n),remove(this.activeTo,n),remove(this.activeRank,n),this.minActive=findMinIndex(this.active,this.activeTo)}addActive(n){let r=0,{value:g,to:$,rank:L}=this.cursor;for(;r-1&&(this.activeTo[L]-this.cursor.from||this.active[L].endSide-this.cursor.startSide)<0){if(this.activeTo[L]>n){this.to=this.activeTo[L],this.endSide=this.active[L].endSide;break}this.removeActive(L),g&&remove(g,L)}else if(this.cursor.value)if(this.cursor.from>n){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let k=this.cursor.value;if(!k.point)this.addActive(g),this.cursor.fromn&&$++,this.cursor.next();else if(r&&this.cursor.to==this.to&&this.cursor.from=0&&!(this.activeRank[g]n||this.activeTo[g]==n&&this.active[g].endSide>=this.point.endSide)&&r.push(this.active[g]);return r.reverse()}openEnd(n){let r=0;for(let g=this.activeTo.length-1;g>=0&&this.activeTo[g]>n;g--)r++;return r}}function compare(e,n,r,g,$,L){e.goto(n),r.goto(g);let k=g+$,oe=g,re=g-n;for(;;){let ae=e.to+re-r.to||e.endSide-r.endSide,le=ae<0?e.to+re:r.to,ue=Math.min(le,k);if(e.point||r.point?e.point&&r.point&&(e.point==r.point||e.point.eq(r.point))&&sameValues(e.activeForPoint(e.to+re),r.activeForPoint(r.to))||L.comparePoint(oe,ue,e.point,r.point):ue>oe&&!sameValues(e.active,r.active)&&L.compareRange(oe,ue,e.active,r.active),le>k)break;oe=le,ae<=0&&e.next(),ae>=0&&r.next()}}function sameValues(e,n){if(e.length!=n.length)return!1;for(let r=0;r