bkui-vue 0.0.2-beta.28 → 0.0.2-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +3 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/table/index.js +1 -1
- package/lib/table/table.css +3 -1
- package/lib/table/table.less +3 -1
- package/lib/table/table.variable.css +3 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -63,7 +63,7 @@ ${Kl(n)}`),i}})}function Fw(e){const t=Object.keys(e),n=t.filter(s=>{var o;retur
|
|
63
63
|
m 0 ${N?"":"-"}${x}
|
64
64
|
a ${x} ${x} 0 1 1 0 ${N?"-":""}${x*2}
|
65
65
|
a ${x} ${x} 0 1 1 0 ${N?"":"-"}${x*2}
|
66
|
-
`,E={d:k,stroke:m||"#f5f5f5","stroke-linecap":f,"stroke-width":y,"fill-opacity":"0",class:"process-circle-trail",style:T},O={d:k,stroke:u||"#13ce66","stroke-linecap":f,"stroke-width":o>0&&y||0,"fill-opacity":"0",class:`process-circle-path ${i(`${d}-circle-trail`)}`,style:V};return a.createVNode("div",{class:"progress-outer-circle",style:b},[a.createVNode("svg",{viewBox:"0 0 100 100"},[a.createVNode("path",E,null),a.createVNode("path",O,null)]),a.createVNode("span",{class:"progress-circle-text",style:p},[n==null?void 0:n.default()])])},WI=(e,{attrs:t,slots:n})=>{const{resolveClassName:i}=Ce(),{percent:s,strokeWidth:o,size:c,color:u,titleStyle:f,showText:d,textInside:h,theme:m}=t,p={height:`${o}px`,lineHeight:`${o}px`},y={width:`${s}%`,background:u,animationDuration:"3s"},C=(b=!0)=>(d||n.default)&&(b&&h||!b&&!h)?n==null?void 0:n.default():null;return a.createVNode("div",{class:"progress-outer"},[a.createVNode("div",{class:`${i(`progress-${c||"normal"}`)} progress-bar`,style:p},[a.createVNode("div",{style:y,class:{"progress-inner":!0,[`${i(`${m}`)}`]:!0}},[a.createVNode("div",{class:"inner-text",style:f},[C()])])]),C(!1)])};function $3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const HI={extCls:v.string,type:Uw(),percent:v.number.def(0),theme:v.theme().def(Xl.PRIMARY),size:v.size(),width:v.number.def(126),strokeWidth:v.number,strokeLinecap:Yw(),textInside:v.bool.def(!1),showText:v.bool.def(!0),color:v.string,bgColor:v.string,fixed:v.number.validate(e=>e>=0&&e<=20).def(0),format:v.func.def(e=>`${e}%`),titleStyle:v.object.def({fontSize:"16px",verticalAlign:"middle"})},FI=a.defineComponent({name:"Progress",props:HI,setup(){const{resolveClassName:e}=Ce();return{resolveClassName:e}},methods:{validPercent(e){return!e||e<0?0:e>100?100:e},renderProcessInfo(){var u;const{showText:e,format:t,percent:n,textInside:i,titleStyle:s,fixed:o}=this.$props,c=t((u=this.validPercent(n))==null?void 0:u.toFixed(o));return(e||this.$slots.default)&&i?this.$slots.default?this.$slots.default():a.createVNode("span",null,[c]):!e||i?null:a.createVNode("span",{class:"progress-text",style:typeof c=="string"?s:void 0},[this.$slots.default?this.$slots.default():c])}},render(){const e=this.renderProcessInfo(),t={...this.$props,percent:this.validPercent(this.percent)};let n=a.createVNode(WI,t,$3(e)?e:{default:()=>[e]});(this.type==="circle"||this.type==="dashboard")&&(n=a.createVNode(QI,t,$3(e)?e:{default:()=>[e]}));const i={class:Pe({extCls:!!this.extCls},`${this.resolveClassName("progress")} ${this.resolveClassName(`progress-${this.type}`)}`)};return a.createVNode("div",i,[n])}}),Js=Ue(FI),zm=Symbol("RadioGroup");function Vm(){const e=a.ref(!1);return[e,{blur:()=>{e.value=!1},focus:()=>{e.value=!0}}]}const Rm=()=>{const e=a.getCurrentInstance(),{props:t,emit:n}=e,i=a.inject(zm,_g),s=!Qg(i),o=a.ref(!1),c=a.computed(()=>s&&i.props.disabled?!0:t.disabled);s?a.watch(()=>i.props.modelValue,d=>{o.value=d===t.label},{immediate:!0}):a.watch(()=>t.modelValue,d=>{d!==""&&(o.value=d===t.label)},{immediate:!0});const u=(d=!0)=>{o.value=d},f=d=>{if(c.value)return;const h=d.target;o.value=h.checked;const m=o.value?t.label:"";n("update:modelValue",m),n("change",m),s&&i.handleChange(e.proxy),a.nextTick(()=>{h.checked!==o.value&&(h.checked=o.value)})};return a.onMounted(()=>{s&&i.register(e.proxy)}),a.onBeforeUnmount(()=>{s&&i.unregister(e.proxy)}),{isChecked:o,isDisabled:c,setChecked:u,handleChange:f}},BI={name:v.string.def(""),label:v.oneOfType([String,Number,Boolean]).isRequired,modelValue:v.oneOfType([String,Number,Boolean]).def(""),checked:v.bool.def(!1),disabled:v.bool.def(!1)},$I=a.defineComponent({name:"Radio",props:BI,emits:{"update:modelValue":e=>e!==void 0,change:e=>e!==void 0},setup(){const[e,{blur:t,focus:n}]=Vm(),{isChecked:i,isDisabled:s,setChecked:o,handleChange:c}=Rm(),{resolveClassName:u}=Ce();return{isFocused:e,isChecked:i,isDisabled:s,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c,resolveClassName:u}},render(){const e=Pe({[`${this.resolveClassName("radio")}`]:!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked}),t=()=>!this.label&&!this.$slots.default?null:a.createVNode("span",{class:`${this.resolveClassName("radio-label")}`},[this.$slots.default?this.$slots.default():this.label]);return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:`${this.resolveClassName("radio-input")}`,type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),t()])}}),GI={name:v.string.def(""),label:v.oneOfType([String,Number,Boolean]).isRequired,modelValue:v.oneOfType([String,Number,Boolean]).def(""),checked:v.bool.def(!1),disabled:v.bool.def(!1),size:v.size()},ZI=a.defineComponent({name:"RadioButton",props:GI,emits:{"update:modelValue":e=>e!==void 0,change:e=>e!==void 0},setup(){const[e,{blur:t,focus:n}]=Vm(),{isChecked:i,isDisabled:s,setChecked:o,handleChange:c}=Rm(),{resolveClassName:u}=Ce();return{isFocused:e,isChecked:i,isDisabled:s,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c,resolveClassName:u}},render(){const e=Pe({[`${this.resolveClassName("radio-button")}`]:!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked}),t=()=>!this.label&&!this.$slots.default?null:a.createVNode("div",{class:`${this.resolveClassName("radio-button-label")}`},[this.$slots.default?this.$slots.default():this.label]);return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:`${this.resolveClassName("radio-button-input")}`,type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),t()])}}),YI={name:v.string.def(""),modelValue:v.oneOfType([String,Number,Boolean]),disabled:v.bool,withValidate:v.bool.def(!0),type:v.oneOf(["tab","capsule","card"]).def("tab")},UI=a.defineComponent({name:"RadioGroup",props:YI,emits:{"update:modelValue":e=>e!==void 0,change:e=>e!==void 0},setup(e,t){const n=ei(),i=[],s=f=>{i.push(f)},o=f=>{const d=i.indexOf(f);d>-1&&i.splice(d,1)},c=f=>{const d=f.label;i.forEach(h=>{h!==f&&h.setChecked(!1)}),t.emit("update:modelValue",d),t.emit("change",d)};a.provide(zm,{props:e,register:s,unregister:o,handleChange:c}),a.watch(()=>e.modelValue,()=>{var f;e.withValidate&&((f=n==null?void 0:n.validate)==null||f.call(n,"change"))}),a.onMounted(()=>{e.modelValue!==""&&i.forEach(f=>{f.setChecked(f.label===e.modelValue)})});const{resolveClassName:u}=Ce();return{resolveClassName:u}},render(){var e;return a.createVNode("div",{class:[`${this.resolveClassName("radio-group")}`,`${this.resolveClassName(`radio-${this.type}`)}`]},[(e=this.$slots)==null?void 0:e.default()])}}),Jm=Kt($I,{Group:UI,Button:ZI}),rl=a.defineComponent({name:"Star",props:{rate:v.number.def(0),width:v.number.def(15),height:v.number.def(16),editable:v.bool.def(!0),hoverRate:v.number.def(0),max:v.number.def(5)},emits:["chooseRate","changeHover"],setup(e,{emit:t}){const n=f=>{if(!e.editable)return;const d=f+1;t("chooseRate",d)},i=f=>{if(!e.editable)return;const d=f+1;t("changeHover",d)},{resolveClassName:s}=Ce(),o=f=>Pe({[`${s("is-select")}`]:f<Math.floor(c.value),[`${s("is-edit")}`]:e.editable,[`${s("rate-star")}`]:!0}),c=a.computed(()=>e.hoverRate||e.rate),u={width:`${e.width}px`,height:`${e.height}px`,minWidth:`${e.width}px`};return()=>a.createVNode("p",{class:`${s("rate-stars")}`},[Array(e.max).fill(1).map((f,d)=>a.createVNode("svg",{class:o(d),style:u,x:"0px",y:"0px",viewBox:"0 0 64 64",onClick:()=>n(d),onMouseenter:()=>i(d)},[a.createVNode("g",{transform:"translate(-143.000000, -635.000000)"},[a.createVNode("g",{transform:"translate(83.000000, 114.000000)"},[a.createVNode("g",{transform:"translate(15.000000, 384.000000)"},[a.createVNode("g",{transform:"translate(29.000000, 137.000000)"},[a.createVNode("polygon",{class:"st1",points:"48,53 28.2,63.9 32,40.8 16,24.4 38.1,21 48,-0.1 57.8,21 79.9,24.4 63.9,40.8 67.7,63.9"},null)])])])])]))])}}),KI=a.defineComponent({name:"Rate",components:{star:rl},props:{modelValue:v.number.def(0),size:v.size(),editable:v.bool.def(!0),withValidate:v.bool.def(!0)},emits:["change","hover-change","update:modelValue"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ei(),s=a.ref(0),o=p=>{e.editable&&(t("update:modelValue",p),t("change",p))},c=p=>{s.value=p,t("hover-change",p)},u=Pe({[`${n("rate")}`]:!0}),d={small:{width:12,height:12},large:{width:18,height:18}}[e.size]||{width:15,height:16},h=a.computed(()=>{const p=Math.floor(e.modelValue),y=(d.width+3)*p,C=d.width*(e.modelValue-p);return{width:`${y+C}px`}}),m={width:d.width,height:d.height};return a.watch(()=>e.modelValue,()=>{var p;e.withValidate&&((p=i==null?void 0:i.validate)==null||p.call(i,"change"))}),()=>a.createVNode("p",{class:u},[e.editable?a.createVNode(rl,a.mergeProps({rate:e.modelValue,"hover-rate":s.value,onChooseRate:o,onChangeHover:c,onMouseleave:()=>c(0)},m),null):[a.createVNode(rl,a.mergeProps({rate:5,style:h.value,class:`${n("score-real")}`,editable:!1},m),null),a.createVNode(rl,a.mergeProps({rate:0,editable:!1},m),null)]])}}),_m=Ue(KI),XI=a.defineComponent({name:"Swiper",props:{isLoop:v.bool.def(!0),loopTime:v.number.def(8e3),pics:v.array.def([]),list:v.array.def([]),height:v.number,width:v.number},emits:["index-change"],setup(e,{emit:t,slots:n}){const{isLoop:i,loopTime:s,pics:o,list:c,height:u,width:f}=a.toRefs(e),d=a.ref(),h=a.ref(0),m=a.ref(0),p=a.ref(0),y=a.ref(0);let C;const{resolveClassName:b}=Ce(),x=a.computed(()=>{var W;return((W=c.value)==null?void 0:W.length)>0?c.value:o.value}),N=a.computed(()=>({width:`${m.value*x.value.length}px`,transform:`translateX(-${m.value*h.value}px)`})),S=a.computed(()=>({width:`${m.value}px`,height:`${p.value}px`})),M=W=>{let H=W;W>=x.value.length&&(H=0),W<0&&(H=x.value.length-1),h.value=H,t("index-change",H)},I=W=>{W&&window.open(W,"_blank")},L=W=>[`${b("swiper-img")}`,{[`${b("swiper-link")}`]:W.link},W.class],T=W=>({"background-image":`url(${W.url})`,"background-color":W.color}),V=W=>({[`${b("current-index")}`]:h.value===W}),k=()=>{i.value&&(y.value=window.setTimeout(()=>{M(h.value+1),k()},s.value))},E=()=>{window.clearTimeout(y.value)},O=()=>{var H;const W=(H=d.value)==null?void 0:H.parentElement;!W||!window.ResizeObserver||(C=new ResizeObserver(()=>{_()}),C.observe(W))},P=()=>{var W;(W=C.disconnect)==null||W.call(C)},A=W=>{if(W===void 0)return{height:0,width:0};const H=getComputedStyle(W),ie=W.clientWidth-parseFloat(H.paddingTop)-parseFloat(H.paddingBottom);return{height:W.clientHeight-parseFloat(H.paddingLeft)-parseFloat(H.paddingRight),width:ie}},_=()=>{var H;const W=A((H=d.value)==null?void 0:H.parentElement);m.value=+f.value>0?f.value:W.width,p.value=+u.value>0?u.value:W.height};return a.watch([u,f],_),a.onMounted(()=>{_(),k(),O()}),a.onBeforeUnmount(()=>{E(),P()}),()=>a.createVNode("section",{class:`${b("swiper-home")}`,ref:d,style:S.value},[a.createVNode("hgroup",{style:N.value,class:`${b("transition")} ${b("swiper-main")}`},[x.value.map(W=>{var H;return a.createVNode("h3",{class:`${b("swiper-card")}`,style:S.value},[((H=n.default)==null?void 0:H.call(n,W))??a.createVNode("span",{class:L(W),style:T(W),onClick:()=>I(W.link)},null)])})]),a.createVNode("ul",{class:`${b("swiper-index")}`},[x.value.map((W,H)=>a.createVNode("li",{class:V(H),onMouseover:()=>M(H)},null))]),a.createVNode("span",{class:`${b("swiper-nav")} ${b("nav-prev")}`,onClick:()=>M(h.value-1)},[a.createVNode("i",{class:`${b("swiper-nav-icon")}`},null)]),a.createVNode("span",{class:`${b("swiper-nav")} ${b("nav-next")}}`,onClick:()=>M(h.value+1)},[a.createVNode("i",{class:`${b("swiper-nav-icon")}`},null)])])}}),Qm=Ue(XI),Ec=Symbol("BkSelect"),Wm=Symbol("BkOptionGroup");function Hm(){const e=a.ref(!1);return{isHover:e,setHover:()=>{e.value=!0},cancelHover:()=>{e.value=!1}}}function Ud(e){return{register:(i,s)=>{if(s){if(e.value.has(i)){console.warn(`repeat ${i}`,s);return}return e.value.set(i,s)}},unregister:i=>{e.value.delete(i)}}}function qI(e,t=200){let n,i=e;return a.customRef((s,o)=>({get(){return s(),i},set(c){clearTimeout(n),c===void 0||c===""?(i=c,o()):n=setTimeout(()=>{i=c,o()},t)}}))}function eL(e,t){const{popoverMinWidth:n}=e;let i=null;const s=a.ref("auto"),o=a.ref(!1),c=()=>{o.value=!o.value},u=()=>{o.value=!1},f=()=>{o.value=!0},d=()=>{var h;s.value=Math.max((h=t.value)==null?void 0:h.offsetWidth,n)};return a.onMounted(()=>{t.value&&(i=o8(t.value,d,60,!0),i.start())}),a.onBeforeUnmount(()=>{i==null||i.stop(),i=null}),{isPopoverShow:o,popperWidth:s,togglePopover:c,hidePopover:u,showPopover:f}}function tL(e,t){const n=qI(""),i=a.ref(!1);return a.watch(n,async()=>{try{i.value=!0,await e(n.value),i.value=!1}catch(s){console.error(s)}finally{t==null||t()}}),{searchKey:n,searchLoading:i}}function hr(e=""){return e&&String(e).trim().toLowerCase()}const Al=a.defineComponent({name:"Option",props:{id:{type:[String,Number,Object],require:!0},name:v.oneOfType([v.number,v.string]),disabled:v.bool.def(!1)},setup(e,{attrs:t}){const{proxy:n}=a.getCurrentInstance(),i=a.reactive({visible:!0}),{disabled:s,id:o,name:c}=a.toRefs(e),u=a.computed(()=>c.value!==void 0?c.value:t.label),f=a.computed(()=>o.value!==void 0?o.value:t.value),d=a.inject(Ec,null),h=a.inject(Wm,null),m=a.computed(()=>{var M;return(M=d==null?void 0:d.selected)==null?void 0:M.some(I=>at.isEqual(I.value,f.value))}),p=a.computed(()=>d==null?void 0:d.multiple),y=a.computed(()=>(d==null?void 0:d.activeOptionValue)===f.value),C=a.computed(()=>(d==null?void 0:d.showSelectedIcon)&&p.value),b=a.computed(()=>d==null?void 0:d.selectedStyle),x=()=>{s.value||d==null||d.handleOptionSelected(n)},N=()=>{d.activeOptionValue=f.value};a.onBeforeMount(()=>{d==null||d.register(f.value,n),h==null||h.register(f.value,n)}),a.onBeforeUnmount(()=>{d==null||d.unregister(f.value),h==null||h.unregister(f.value)});const{resolveClassName:S}=Ce();return{...a.toRefs(i),selected:m,multiple:p,isHover:y,showSelectedIcon:C,selectedStyle:b,optionName:u,optionID:f,handleOptionClick:x,handleMouseEnter:N,resolveClassName:S}},render(){var t,n;const e=Pe({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"is-checkbox":this.selectedStyle===fl.CHECKBOX,[this.resolveClassName("select-option")]:!0});return a.withDirectives(a.createVNode("li",{class:e,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[this.showSelectedIcon&&this.selectedStyle===fl.CHECKBOX&&a.createVNode(qn,{disabled:this.disabled,class:this.resolveClassName("select-checkbox"),modelValue:this.selected},null),((n=(t=this.$slots).default)==null?void 0:n.call(t))??a.createVNode("span",{class:this.resolveClassName("select-option-item"),title:String(this.optionName)},[this.optionName]),this.showSelectedIcon&&this.selected&&this.selectedStyle===fl.CHECK&&a.createVNode(ma,{class:this.resolveClassName("select-selected-icon"),width:22,height:22},null)]),[[a.vShow,this.visible]])}}),nL=a.defineComponent({name:"OptionGroup",props:{label:v.string.def(""),disabled:v.bool.def(!1),collapsible:v.bool.def(!1),collapse:v.bool.def(!1)},setup(e,{emit:t}){const n=a.getCurrentInstance(),{proxy:i}=n,s=a.inject(Ec,null),o=a.reactive({groupCollapse:e.collapse,visible:!0}),c=a.ref(new Map),{register:u,unregister:f}=Ud(c),d=a.computed(()=>`${e.label} (${[...c.value.values()].filter(p=>p.visible).length})`),h=()=>{!e.collapsible||e.disabled||(o.groupCollapse=!o.groupCollapse,t("update:collapse",o.groupCollapse))};a.provide(Wm,a.reactive({...a.toRefs(e),register:u,unregister:f,groupCollapse:a.toRef(o,"groupCollapse")})),a.onBeforeMount(()=>{s==null||s.registerGroup(n.uid,i)}),a.onBeforeUnmount(()=>{s==null||s.unregisterGroup(n.uid)});const{resolveClassName:m}=Ce();return{...a.toRefs(o),groupLabel:d,handleToggleCollapse:h,resolveClassName:m}},render(){var i,s;const e=Pe({[this.resolveClassName("option-group")]:!0,collapsible:this.collapsible,disabled:this.disabled}),t=Pe({[this.resolveClassName("option-group-label")]:!0,collapsible:this.collapsible}),n=Pe({"default-group-label-icon":!0,collapse:this.groupCollapse});return a.withDirectives(a.createVNode("ul",{class:e},[a.createVNode("li",{class:t,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():a.createVNode("span",{class:"default-group-label"},[this.collapsible&&a.createVNode(Gs,{class:n},null),a.createVNode("span",{class:"default-group-label-title"},[this.groupLabel])])]),a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("option-group-content")},[(s=(i=this.$slots).default)==null?void 0:s.call(i)]),[[a.vShow,!this.groupCollapse]])]),[[a.vShow,this.visible]])}}),iL={onContentScroll:Function},aL={list:v.array.def([]),enabled:v.bool.def(!0),scrollEvent:v.bool.def(!1),lineHeight:v.oneOfType([v.number,v.func]).def(30),minHeight:v.number.def(30),height:v.oneOfType([v.string.def("100%"),v.number]).def("100%"),width:v.oneOfType([v.string.def("100%"),v.number]).def("100%"),className:v.oneOfType([v.arrayOf(v.string),v.object,v.arrayOf(v.object),v.string]).def(""),contentClassName:v.oneOfType([v.arrayOf(v.string),v.object,v.arrayOf(v.object),v.string]).def(""),contentStyle:v.object.def({}),scrollXName:v.string.def($t("F-scroll-x")),scrollYName:v.string.def($t("F-scroll-y")),groupItemCount:v.number.def(1),preloadItemCount:v.number.def(1),renderAs:v.string.def("div"),contentAs:v.string.def("div"),scrollOffsetTop:v.number.def(0),scrollPosition:v.string.def("content"),abosuteHeight:v.oneOfType([v.string.def("auto"),v.number]).def("auto"),throttleDelay:v.number.def(60),rowKey:v.string.def(void 0),keepAlive:v.bool.def(!1),autoReset:v.bool.def(!0),...iL},rL=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,p,y,C,b)=>{t.emit("content-scroll",[d,{translateY:y,translateX:C,pos:b}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:s,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},u=a.ref(null),f=({left:d=0,top:h=0})=>{u.value.scrollTo(d,h)};return t.expose({scrollTo:f}),{rendAsTag:()=>{var d,h,m,p,y,C,b,x;return a.h(n,{class:e.className,ref:u},[((h=(d=t.slots).beforeContent)==null?void 0:h.call(d))??"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[((p=(m=t.slots).default)==null?void 0:p.call(m,{data:e.list}))??""]),[[o,c]]),((C=(y=t.slots).afterContent)==null?void 0:C.call(y))??"",((x=(b=t.slots).afterSection)==null?void 0:x.call(b))??""])}}};function G3(e,t,n,i){let s=0,o=0,c=0,u=0;for(;s<e;s++){if(u=i(s,[s*n,(s+1)*n,"virtual"]),o+u>t){c=t-o;break}o+=u}return{startIndex:s,height:o,diffHeight:c}}function Fm(e,t,n,i,s){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:u,count:f,groupItemCount:d,startIndex:h,endIndex:m,scrollLeft:p}=n,{offsetHeight:y}=i;let C=0,b=0,x=0;if(typeof e=="number"&&(C=Math.floor(o/e),b=Math.ceil(y/e)+C,x=o%e),typeof e=="function"){const N=G3(f,o,d,e);C=N.startIndex>0?N.startIndex:0,x=N.diffHeight,b=G3(f,y,d,e).startIndex+C+1}if(o!==u||C!==h||b!==m||p!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,C,b,o,x,c,{bottom:N>=0?N:0})}}function sL(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const y=t.scrollTop,C=t.scrollLeft,b=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,y,y,C,{bottom:b>=0?b:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:p}=o;Fm(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:p},t,e)}const Bm=(e=60)=>at.throttle((t,n,i)=>sL(t,n,i),e),oL=(e,t,n,i=60)=>{Reflect.apply(Bm(i),void 0,[e,t,n])},lL={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{oL(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",Bm)}}},cL=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:lL},props:aL,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=E=>typeof E=="string"?[E]:typeof E=="object"&&!Array.isArray(E)?[E]:E;if(!e.enabled){const{rendAsTag:E}=rL(e,t);return E}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),u=(E,O,P,A,_,W,H)=>{c.startIndex=O,c.endIndex=P,c.scrollTop=A,c.translateY=_,c.translateX=W,c.scrollLeft=W,c.pos=H,t.emit("content-scroll",[E,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),p()})}),a.watch(()=>e.list,()=>{let E={left:0,top:0};E={left:c.scrollLeft,top:c.scrollTop},f(),p(),e.keepAlive&&k(E)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),p()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=E=>{if(d.value=Math.ceil((E||[]).length/e.groupItemCount),c.count=d.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,typeof e.abosuteHeight=="string"&&e.abosuteHeight==="auto")if(typeof e.lineHeight=="function"){h.value=0;let P=0;for(let A=0;A<d.value;A++){const _=e.lineHeight.call(this,A,E.slice(A*e.groupItemCount,e.groupItemCount));P+=typeof _=="number"?_:0}h.value=P}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},p=(E={left:0,top:0})=>{var P;const O=(P=o.value)==null?void 0:P.parentNode;Fm(e.lineHeight,u,c,O,null),E&&o.value&&e.autoReset&&k(E)},y=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((E,O)=>({...E,$index:O}))),C=a.computed(()=>y.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),b=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),x=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width,display:"inline-block",...e.scrollPosition==="container"?b.value:{}})),N=a.computed(()=>{const E=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:E?"none":"block"}}),{resolveClassName:S}=Ce(),M=a.computed(()=>[S("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?S("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?S("virtual-content"):"",...s(e.contentClassName)]),L=a.resolveDirective("bkVirtualRender"),T={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},V=()=>{f(),p()},k=(E={left:0,top:0})=>{const{left:O,top:P}=E;o.value.scrollTo(O,P)};return t.expose({reset:V,scrollTo:k}),()=>{var E,O,P,A,_,W,H,ie;return a.h(n||"div",{ref:o,class:M.value,style:x.value},[((O=(E=t.slots).beforeContent)==null?void 0:O.call(E))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...b.value,...e.contentStyle}},[((A=(P=t.slots).default)==null?void 0:A.call(P,{data:C.value}))??""]),[[L,T]]),((W=(_=t.slots).afterContent)==null?void 0:W.call(_))??"",a.h("div",{class:[S("virtual-section")],style:N.value}),((ie=(H=t.slots).afterSection)==null?void 0:ie.call(H))??""])}}}),Br=Ue(cL);var $m=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}($m||{});const uL=a.defineComponent({name:"Tag",props:{theme:ec(),closable:v.bool.def(!1),type:Se("tagStorkeType",{}).def($m.UNKNOWN),checkable:v.bool.def(!1),checked:v.bool.def(!1),radius:v.string.def("2px"),extCls:v.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.computed(()=>Pe({[`${n("tag-closable")}`]:e.closable,[`${n("tag-checkable")}`]:e.checkable,[`${n("tag-check")}`]:e.checked,[`${n(`tag-${e.type}`)}`]:e.type,[`${n(`tag-${e.theme}`)}`]:e.theme,[e.extCls]:!!e.extCls},n("tag"))),s=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:i,wrapperStyle:s,handleClose:u=>{u.preventDefault(),u.stopPropagation(),t("close",u)},handleClick:u=>{u.preventDefault(),u.stopPropagation(),e.checkable&&t("change",!e.checked)},resolveClassName:n}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:`${this.resolveClassName("tag-icon")}`},[this.$slots.icon()]):"",a.createVNode("span",{class:`${this.resolveClassName("tag-text")}`},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(gn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Jr=Ue(uL),dL=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:ec(),placeholder:v.string.def(""),filterable:v.bool.def(!1),allowCreate:v.bool.def(!1),disabled:v.bool.def(!1),modelValue:v.any,collapseTags:v.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.inject(Ec,null),{modelValue:s,collapseTags:o,selected:c}=a.toRefs(e),u=a.ref(s.value),f=a.ref(),d=a.ref(null);a.watch(s,()=>{u.value=s.value}),a.watch([c,o],()=>{N()},{flush:"post"});const h=L=>{t("remove",L)},m=()=>{var L;(L=f.value)==null||L.focus()},p=L=>{t("update:modelValue",L.target.value)},y=L=>{switch(L.code){case"Enter":{t("enter",L.target.value,L);break}}t("keydown",L.target.value,L)},C=a.ref([]),b=a.ref(),x=L=>{const T=C.value.map(V=>V==null?void 0:V.$el).filter(V=>!!V);return typeof L=="number"?T[L]:T},N=()=>{o.value&&(d.value=null,setTimeout(()=>{var V,k;const L=x(),T=L.findIndex((E,O)=>O?L[O-1].offsetTop!==E.offsetTop:!1);d.value=T>0?T:null,((V=L[d.value])==null?void 0:V.offsetTop)!==((k=b.value)==null?void 0:k.offsetTop)&&d.value>1&&(d.value-=1)}))},S=at.debounce(N,150),M=a.ref(),I=new ResizeObserver(()=>{S()});return a.onMounted(()=>{M.value&&I.observe(M.value)}),a.onBeforeUnmount(()=>{M.value&&I.unobserve(M.value)}),{collapseTagRef:b,tagWrapperRef:M,tagsRefs:C,select:i,overflowTagIndex:d,value:u,inputRef:f,handleRemoveTag:h,focus:m,handleInput:p,handleKeydown:y,resolveClassName:n}},render(){var s,o,c,u,f,d,h,m;const e=(o=(s=this.$slots)==null?void 0:s.prefix)==null?void 0:o.call(s),t=Pe({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Pe({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t,ref:"tagWrapperRef"},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("div",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((p,y)=>a.createVNode(Jr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&y>=this.overflowTagIndex?"none":""},ref:C=>this.tagsRefs[y]=C,onClose:()=>this.handleRemoveTag(p.value)},{default:()=>{var C;return[(C=this.select)==null?void 0:C.handleGetLabelByValue(p.value)]}})),a.createVNode(Jr,{class:this.resolveClassName("select-overflow-tag"),style:{display:this.overflowTagIndex&&this.collapseTags?"":"none"},ref:"collapseTagRef"},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]}),a.createVNode("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:i,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),(m=(h=this.$slots)==null?void 0:h.suffix)==null?void 0:m.call(h)])}}),fL=a.defineComponent({name:"Select",directives:{clickoutside:wi},props:{modelValue:v.any,multiple:v.bool.def(!1),disabled:v.bool.def(!1),size:v.size().def(xf.DEFAULT),clearable:v.bool.def(!0),loading:v.bool.def(!1),filterable:v.bool.def(!1),remoteMethod:v.func,scrollHeight:v.number.def(200),showSelectAll:v.bool.def(!1),popoverMinWidth:v.number.def(0),showOnInit:v.bool.def(!1),multipleMode:v.oneOf(["default","tag"]).def("default"),tagTheme:ec(),behavior:Jg(),collapseTags:v.bool.def(!1),autoHeight:v.bool.def(!0),noDataText:v.string,noMatchText:v.string,loadingText:v.string,placeholder:v.string,searchPlaceholder:v.string,selectAllText:v.string,scrollLoading:v.bool.def(!1),allowCreate:v.bool.def(!1),popoverOptions:Object,customContent:v.bool.def(!1),list:v.arrayOf(v.any).def([]),idKey:v.string.def("value"),displayKey:v.string.def("label"),withValidate:v.bool.def(!0),showSelectedIcon:v.bool.def(!0),inputSearch:v.bool.def(!0),enableVirtualRender:v.bool.def(!1),allowEmptyValues:v.array.def([]),autoFocus:v.bool.def(!1),keepSearchValue:v.bool.def(!1),prefix:v.string,selectedStyle:Kw()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ft("select"),{resolveClassName:i}=Ce(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:p,allowCreate:y,customContent:C,showSelectedIcon:b,inputSearch:x,enableVirtualRender:N,showSelectAll:S,scrollHeight:M,list:I,displayKey:L,idKey:T,collapseTags:V,autoHeight:k,popoverOptions:E,allowEmptyValues:O,autoFocus:P,keepSearchValue:A,selectedStyle:_}=a.toRefs(e),W=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),H=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),fe=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),de=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),re=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),ve=ei(),G=a.ref(),K=a.ref(),F=a.ref(),Q=a.ref(),Y=a.ref(),ne=a.ref(),oe=a.ref(),ge=a.ref(new Map),ee=a.computed(()=>[...ge.value.values()]),$=a.ref(new Map),j=a.ref([]),J=a.computed(()=>j.value.reduce((Le,xe)=>(Le[xe.value]=xe.label,Le),{})),X=a.ref(),ae=a.computed(()=>I.value.reduce((Le,xe)=>(Le[xe[T.value]]=xe[L.value],Le),{}));a.watch(s,()=>{var Le;oo(),e.withValidate&&((Le=ve==null?void 0:ve.validate)==null||Le.call(ve,"change"))},{deep:!0}),a.watch(j,()=>{var Le;(Le=oe.value)==null||Le.updatePopover(null,lt.value)});const Z=a.computed(()=>ce.value?I.value:I.value.filter(Le=>{var xe;return(xe=hr(String(Le[L.value])))==null?void 0:xe.includes(hr(ni.value))})),se=a.computed(()=>o.value||d.value),ye=a.computed(()=>j.value.map(Le=>{var xe,We;return((We=(xe=ge.value)==null?void 0:xe.get(Le.value))==null?void 0:We.optionName)||ae.value[Le.value]||Le.label})),Me=a.computed(()=>{const Le=ee.value.reduce((xe,We)=>(We.disabled||xe.push(We.optionID),xe),[]);return Le.length<=j.value.length&&Le.every(xe=>j.value.some(We=>We.value===xe))}),je=a.computed(()=>!!$.value.size),Ae=a.computed(()=>!ee.value.length),He=a.computed(()=>ee.value.length&&ee.value.every(Le=>!Le.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),be=a.computed(()=>!(Gr.value||Ae.value||He.value)||C.value),Ie=a.computed(()=>u.value&&S.value&&(!ni.value||!c.value)),ze=a.computed(()=>M.value-12-(Ie.value?32:0)),rt=a.computed(()=>Gr.value?ie.value:Ae.value?W.value:He.value?H.value:""),nt=a.computed(()=>k.value?V.value&&!ti.value:V.value),lt=a.computed(()=>at.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:ro.value,arrow:!1,placement:"bottom-start",isShow:ti.value,reference:Y.value,offset:6,popoverDelay:0,renderType:ql.AUTO},E.value)),{register:Tt,unregister:ht}=Ud(ge),{register:Je,unregister:Ge}=Ud($),{isHover:Fe,setHover:Xe,cancelHover:Ve}=Hm(),vt=a.ref(!1),Hn=()=>{vt.value||(vt.value=!0,t("focus"))},ao=()=>{vt.value&&(vt.value=!1,t("blur"))},{popperWidth:ro,isPopoverShow:ti,hidePopover:Fi,showPopover:$r,togglePopover:Hc}=eL({popoverMinWidth:h.value},K);a.watch(ti,()=>{t("toggle",ti.value)});const Fc=a.computed(()=>(c.value&&x.value||y.value)&&ti.value);a.watch(ti,Le=>{Le?setTimeout(()=>{Ca(),so()},10):A.value||(ni.value="")});const so=()=>{var We;const Le=j.value[0],xe=ge.value.get(Le==null?void 0:Le.value);xe&&!xe.disabled&&xe.visible?X.value=Le==null?void 0:Le.value:X.value=(We=ee.value.find(pn=>!pn.disabled&&pn.visible))==null?void 0:We.optionID},Bc=Le=>{c.value&&ee.value.forEach(xe=>{var We;xe.visible=(We=hr(String(xe.optionName)))==null?void 0:We.includes(hr(Le))})},{searchKey:ni,searchLoading:Gr}=tL(ce.value?f.value:Bc,so),ii=Le=>{Le!==s.value&&(t("update:modelValue",Le,s.value),t("change",Le,s.value))},$c=()=>{se.value||(Hn(),Hc())},Zr=Le=>{c.value&&(ni.value=Le)},Gc=(Le,xe)=>{const We=String(Le);!y.value||!We||c.value&&ee.value.find(qt=>hr(String(qt.optionName))===hr(We))||ge.value.get(We)||(xe.stopPropagation(),u.value?(j.value.push({value:We,label:We}),ii(j.value.map(qt=>qt.value))):(j.value=[{value:We,label:We}],ii(We),Fi()),ni.value="")},ya=Le=>{if(!(se.value||!Le)){if(u.value){const xe=j.value.findIndex(We=>We.value===Le.optionID);xe>-1?j.value.splice(xe,1):j.value.push({value:Le.optionID,label:Le.optionName||Le.optionID}),ii(j.value.map(We=>We.value))}else j.value=[{label:Le.optionName||Le.optionID,value:Le.optionID}],ii(Le.optionID),Fi();Ca()}},Ca=()=>{setTimeout(()=>{var Le,xe,We;!x.value&&!y.value?(Le=Q.value)==null||Le.focus():p.value==="tag"?(xe=Y.value)==null||xe.focus():(We=G.value)==null||We.focus()},0)},Zc=Le=>{Le.stopPropagation(),j.value=[],ii(u.value?[]:""),t("clear",u.value?[]:""),Fi()},Yc=()=>{X.value=""},Uc=()=>{var Le;Me.value?j.value=[]:(ee.value.forEach(xe=>{xe.disabled||xe.optionID in J.value||j.value.push({value:xe.optionID,label:xe.optionName||xe.optionID})}),(Le=I.value)==null||Le.forEach(xe=>{xe.disabled||xe[T.value]in J.value||j.value.push({value:xe[T.value],label:xe[L.value]})})),ii(j.value.map(xe=>xe.value)),Ca()},Kc=Le=>{const{scrollTop:xe,clientHeight:We,scrollHeight:pn}=Le.target;xe+We===pn&&t("scroll-end")},Xc=Le=>{if(se.value)return;const xe=j.value.findIndex(We=>We.value===Le);xe>-1&&(j.value.splice(xe,1),ii(j.value.map(We=>We.value)))},Yr=Le=>{var We,pn;let xe=Le;if(typeof xe=="object"){for(const qt of ge.value.keys())if(at.isEqual(qt,xe)){xe=qt;break}}return((pn=(We=ge.value)==null?void 0:We.get(xe))==null?void 0:pn.optionName)||ae.value[xe]||J.value[xe]||xe},oo=()=>{Array.isArray(s.value)?j.value=[...s.value.map(Le=>({value:Le,label:Yr(Le)}))]:s.value!==void 0||O.value.includes(s.value)?j.value=[{value:s.value,label:Yr(s.value)}]:j.value=[]},lo=Le=>{var pn,qt;if(!ti.value)return;const xe=ee.value.filter(en=>!en.disabled&&en.visible),We=xe.findIndex(en=>en.optionID===X.value);if(!(!xe.length||We===-1))switch(Le.code){case"ArrowDown":{Le.preventDefault();const en=We>=xe.length-1?0:We+1;X.value=(pn=xe[en])==null?void 0:pn.optionID;break}case"ArrowUp":{Le.preventDefault();const en=We===0?xe.length-1:We-1;X.value=(qt=xe[en])==null?void 0:qt.optionID;break}case"Backspace":{if(!u.value||!j.value.length||ni.value.length||Le.target===Q.value)return;j.value.pop(),ii(j.value.map(en=>en.value));break}case"Enter":{const en=ge.value.get(X.value);ya(en);break}}},qc=({event:Le})=>{var We;const{target:xe}=Le;(We=K.value)!=null&&We.contains(xe)||K.value===xe||(Fi(),ao())},eu=()=>{setTimeout(()=>{var Le,xe;N.value&&((xe=(Le=ne.value)==null?void 0:Le.reset)==null||xe.call(Le))})};return a.provide(Ec,a.reactive({multiple:u,selected:j,activeOptionValue:X,showSelectedIcon:b,selectedStyle:_,register:Tt,unregister:ht,registerGroup:Je,unregisterGroup:Ge,handleOptionSelected:ya,handleGetLabelByValue:Yr})),a.onMounted(()=>{oo(),setTimeout(()=>{m.value&&$r(),P.value&&Ca()})}),{selected:j,isInput:Fc,options:ee,isDisabled:se,selectedLabel:ye,isPopoverShow:ti,isHover:Fe,popperWidth:ro,inputRef:G,triggerRef:K,contentRef:F,searchRef:Q,selectTagInputRef:Y,virtualRenderRef:ne,popoverRef:oe,searchLoading:Gr,isOptionsEmpty:Ae,isSearchEmpty:He,isFocus:vt,isShowSelectContent:be,curContentText:rt,isGroup:je,searchKey:ni,isShowSelectAll:Ie,virtualHeight:ze,virtualList:Z,isCollapseTags:nt,popoverConfig:lt,focusInput:Ca,setHover:Xe,cancelHover:Ve,handleFocus:Hn,handleBlur:ao,handleTogglePopover:$c,handleClear:Zc,hidePopover:Fi,showPopover:$r,handleToggleAll:Uc,handleOptionSelected:ya,handleClickOutside:qc,handleScroll:Kc,handleDeleteTag:Xc,handleInputChange:Zr,handleInputEnter:Gc,handleKeydown:lo,handleSelectedAllOptionMouseEnter:Yc,handlePopoverShow:eu,localLoadingText:ie,localPlaceholder:fe,localSearchPlaceholder:de,localSelectAllText:re,resolveClassName:i}},render(){const e=Pe({[`${this.resolveClassName("select")}`]:!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable,[this.size]:!0,[this.behavior]:!0}),t=()=>this.loading?a.createVNode(ua,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(mn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ya,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(dL,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":u=>this.searchKey=u,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.localPlaceholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},{prefix:this.prefix?a.createVNode("div",{class:`${this.resolveClassName("select--prefix-area")}`},[a.createVNode("span",null,[this.prefix])]):(c=(o=this.$slots).prefix)==null?void 0:c.call(o),default:this.$slots.tag&&(()=>this.$slots.tag({selected:this.selected})),suffix:()=>t()}):a.createVNode(Ba,a.mergeProps({ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.localPlaceholder:this.localPlaceholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,withValidate:!1,onInput:this.handleInputChange,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},this.prefix?{prefix:this.prefix}:null),{...typeof this.$slots.prefix=="function"?{prefix:()=>{var u,f;return(f=(u=this.$slots).prefix)==null?void 0:f.call(u)}}:null,suffix:()=>t()})},i=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-trigger"),style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[((c=(o=this.$slots).trigger)==null?void 0:c.call(o,{selected:this.selected}))||n()])},s=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-content-wrapper"),ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:this.resolveClassName("select-search-wrapper")},[a.createVNode(Ua,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:this.resolveClassName("select-search-input"),placeholder:this.localSearchPlaceholder,"onUpdate:modelValue":u=>this.searchKey=u},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:this.resolveClassName("select-empty")},[this.searchLoading&&a.createVNode(ua,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:this.resolveClassName("select-content")},[a.createVNode("div",{class:this.resolveClassName("select-dropdown"),style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("select-options")},[this.isShowSelectAll&&a.createVNode("li",{class:this.resolveClassName("select-option"),onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.localSelectAllText]),this.enableVirtualRender?a.createVNode(Br,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(Al,{key:f[this.idKey],id:f[this.idKey],name:f[this.displayKey]},{default:(h=(d=this.$slots).virtualScrollRender)==null?void 0:h.call(d,{item:f})})})}):this.list.map(u=>a.createVNode(Al,{id:u[this.idKey],name:u[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:this.resolveClassName("select-options-loading")},[a.createVNode(ua,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.localLoadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:this.resolveClassName("select-extension")},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(Ut,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),yh=Kt(fL,{Option:Al,Group:nL});function hL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:gL}=$a,Ch=Object.assign({},gL);Ch.width.default="400";Ch.height.default="100%";const mL=a.defineComponent({name:"Sideslider",components:{BkModal:$a,BkButton:Pt},props:{...Ch,direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',【${t.join(" | ")}】`),!1):!0}}},emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{console.log("slider handleClose");let u=!0;typeof e.beforeClose=="function"&&(u=await e.beforeClose()),u&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},s=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)},{resolveClassName:c}=Ce();return()=>{const u={header:()=>{var h;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${c("sideslider-header")}`},[a.createVNode("div",{class:`${c("sideslider-close")} ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`${c("sideslider-title")} ${e.direction}`},[((h=t.header)==null?void 0:h.call(t))??e.title])])])},default:()=>{var h;return((h=t.default)==null?void 0:h.call(t))??"Content"},footer:()=>t.footer?a.createVNode("div",{class:`${c("sideslider-footer")}`},[t.footer()]):null},f=`${c("sideslider-wrapper")} ${e.scrollable?"scroll-able":""} ${e.extCls}`,d=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode($a,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),hL(u)?u:{default:()=>[u]})}}}),Gm=Ue(mL);var Zm=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(Zm||{});const Z3={theme:v.theme().def(Xl.PRIMARY),size:v.size(),curStep:v.number.def(1),controllable:v.bool.def(!1),direction:zg(),status:Se("status",{}).def(Zm.UNKNOWN),lineType:Vg(),text:v.bool,extCls:v.string,steps:v.array.def([]),beforeChange:v.func},pL=a.defineComponent({name:"Steps",props:Z3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ft("steps"),i=ft("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(p=>{typeof p=="string"?m.push(p):m.push({title:p.title,icon:p.icon,description:p.description,status:p.status,border:p.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{Z3.curStep=h},u=()=>{var h;s.value.splice(0,s.value.length,{title:n.value.step1,icon:1},{title:n.value.step2,icon:2},{title:n.value.step3,icon:3}),(h=e.steps)!=null&&h.length&&o(e.steps)};a.watch(()=>i.value,()=>{u()});const f=async h=>{try{e.controllable&&h!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(m,p)=>{const y=await e.beforeChange(h);y?m(y):p(y)}),t("update:curStep",h),t("click",h))}catch(m){console.warn(m)}};a.onMounted(u),a.watch(()=>e.steps,()=>{o(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{c(e.curStep)},{deep:!0});const{resolveClassName:d}=Ce();return{defaultSteps:s,jumpTo:f,resolveClassName:d}},render(){const e=this.resolveClassName("steps"),t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Pe({[`${this.extCls}`]:!!this.extCls,[`${this.resolveClassName(`steps-${this.direction}`)}`]:this.direction,[`${this.resolveClassName(`steps-${this.lineType}`)}`]:this.lineType},`${t} ${e} ${n}`),s=m=>this.curStep>m+1||this.defaultSteps[m].status==="done",o=m=>this.curStep===m+1,c=m=>{const{icon:p}=m;return p?Object.prototype.toString.call(p)==="[object Object]":typeof m=="string"},u=(m,p)=>(p.icon||(p.icon=m),!isNaN(p.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,p)=>o(m)&&this.status==="loading"||f(p)?a.createVNode(Zs,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(p)?a.createVNode(gn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(ma,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,p)?m+1:a.createVNode(p.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,p)=>{var y,C;return a.createVNode("div",{class:[this.resolveClassName("step"),m.title?"":this.resolveClassName("step-no-content"),s(p)?"done":"",o(p)?"current":"",o(p)&&this.status==="error"?"isError":"",m.status&&o(p)?[`${this.resolveClassName(`step-${m.status}`)}`]:""]},[a.createVNode("span",{class:[`${this.resolveClassName("step-indicator")}`,`${this.resolveClassName(`step-${c(m)?"icon":"number"}`)}`,`${this.resolveClassName(`step-icon${m.status}`)}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(p+1)}},[((C=(y=this.$slots)[p+1])==null?void 0:C.call(y))??h(p,m)]),m.title?a.createVNode("div",{class:`${this.resolveClassName("step-content")}`},[a.createVNode("div",{class:`${this.resolveClassName("step-title")}`,style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(p+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}}),Ym=Ue(pL),vL=a.defineComponent({name:"Switcher",props:{theme:v.theme(),size:v.size(),disabled:v.bool,showText:v.bool,isOutline:v.bool,onText:v.string.def("ON"),offText:v.string.def("OFF"),isSquare:v.bool,extCls:v.string,beforeChange:v.func.def(void 0),trueValue:v.oneOfType([v.string,v.number,v.bool]).def(!0),falseValue:v.oneOfType([v.string,v.number,v.bool]).def(!1),value:v.oneOfType([v.string,v.number,v.bool]).def(!1),modelValue:v.oneOfType([v.string,v.number,v.bool]).def(!1),withValidate:v.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=ei(),{resolveClassName:i}=Ce(),s=a.ref(!1),o=a.computed(()=>e.trueValue===u.value),c=a.ref(e.modelValue!==!1),u=a.computed(()=>c.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,[`${i("switcher")}`]:!0,[`${i("switcher-outline")}`]:e.isOutline,[`${i("switcher-square")}`]:e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":o.value,"is-unchecked":!o.value,"is-loading":s.value,[`${i("primary")}`]:e.theme==="primary"};if(e.size&&!e.showText){const p=`${i(`switcher-${e.size}`)}`;m[p]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;c.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{c.value=!1});const d=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||s.value)return;const p=o.value?e.falseValue:e.trueValue,y=!o.value,C=()=>{t("update:modelValue",p),t("change",y)};let b=!0;if(typeof e.beforeChange=="function"&&(b=e.beforeChange(p),typeof b.then=="function"))return s.value=!0,b.then(()=>{C()}).finally(()=>{s.value=!1});b&&C()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&d(m)};return()=>a.createVNode("div",{class:f.value,onClick:d,tabindex:"0",onKeydown:h},[s.value?a.createVNode(Mc,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),Um=Ue(vL);var Pl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(Pl||{}),Km=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(Km||{});const yL=["auto","highlight"],CL=["none","row","col","outer","horizontal"],Be={ROW_INDEX:"__$table_row_index",ROW_UID:"__$uuid",ROW_EXPAND:"__row_expand",ROW_SELECTION:"__row_selection",ROW_SELECTION_ALL:"__row_selection_all",ROW_SELECTION_INDETERMINATE:"__row_selection_indeterminate",ROW_SOURCE_DATA:"__row_source_data",ROW_SKIP_CFG:"__row_skip_config"},Kn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},_r=6,sa=42;var bh=(e=>(e.DEF1="def1",e.DEF2="def2",e))(bh||{});const bL={def1:"#FAFBFD",def2:"#F0F1F5"},vl={large:78,medium:60,small:42},wL=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:vl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:vl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:vl.large}],Xm="InitColumns",qm="BKTableCahce",NL="Bk_COlumn_Update_Define",ML=60;var Rt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Rt||{});const IL=["asc","desc","null","custom"],oa=80;var e1=(e=>(e.CURRENT="current",e.ALL="all",e))(e1||{});Se("showOverflowTooltipMode",{default:"auto"});const LL=Se("columnType",{default:"none"}),Kd=Se("columnType",{default:""});Se("full",{default:"full"});Se("columnSize",{default:"small"});const TL=dn(),wh=Se("IOverflowTooltipPropType",{}).def(!1);Se("IOverflowTooltipType",{}).def({content:"",disabled:!1,watchCellResize:!0,mode:"auto"});const xL=Se("ISortPropShape",{}).def(!1),SL=Se("IFilterPropShape",{}).def(!1);var t1=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(t1||{});const io=Se("IColumnType",{}).def({width:"100%",label:()=>""}),n1=Se("ITableSettingPropType",{}).def(!1),vd=Se("LabelFunctionStringType",{}),kL=Se("RenderFunctionStringType",{}),Y3=Se("SpanFunctionStringType",{}),DL=Se("RowClassFunctionStringType",{}),i1=Se("RowHeightFunctionNumberType",{});Se("FunctionNumberType",{});const yl=e=>Se("StringNumberType",{}).def(e);Se("IColumnPropType",{}).def({label:void 0,minWidth:oa});const jL={data:v.arrayOf(v.any).def([]),columns:v.arrayOf(io).def([]),activeColumn:v.oneOfType([v.number.def(-1),v.arrayOf(v.number.def(-1))]),columnPick:Se("columnPick",{}).def("disabled"),height:yl("auto"),stripe:v.bool.def(!1),minHeight:yl(sa*2),maxHeight:yl("auto"),rowHeight:i1.def(sa),headHeight:v.number.def(sa),showHead:v.bool.def(!0),thead:Se("ITheadType",{}).def({color:bh.DEF1,height:sa,isShow:!0}),virtualEnabled:v.bool.def(!1),border:v.oneOfType([v.arrayOf(Se("boderType",{})),v.string]).def([Pl.ROW]),pagination:v.oneOfType([v.bool.def(!1),v.object.def({})]).def(!1),paginationHeight:v.number.def(ML),remotePagination:v.bool.def(!1),emptyText:v.string,settings:n1,rowClass:v.oneOfType([v.string,v.object,v.func]).def({}),rowStyle:v.oneOfType([v.string,v.object,v.func]).def({}),cellStyle:v.oneOfType([v.string,v.object,v.func]).def({}),cellClass:v.oneOfType([v.string,v.object,v.func]).def({}),scrollLoading:v.oneOfType([v.object,v.bool]).def(void 0),reserveExpand:v.bool.def(!1),selectionKey:v.string.def(""),isSelectedFn:v.func.def(void 0),rowKey:v.oneOfType([v.string,v.func]).def(Be.ROW_INDEX),showOverflowTooltip:wh,asyncData:v.bool.def(!1),rowHover:v.oneOf(yL).def(Km.HIGHLIGHT),defaultSort:v.shape({}).def({}),isRowSelectEnable:v.oneOfType([v.func.def(()=>!0),v.bool.def(!0)]).def(!0),resizerWay:Se("ResizerWay",{default:"debounce"}),observerResize:v.bool.def(!0),align:Kd,headerAlign:Kd,prependStyle:v.style().def({})},OL={label:vd,field:vd,render:kL,width:v.oneOfType([v.number,v.string]),minWidth:yl(oa),columnKey:v.string.def(""),showOverflowTooltip:wh,type:LL,resizable:v.bool.def(!0),fixed:v.oneOfType([v.bool,TL]).def(!1),sort:xL,filter:SL,colspan:Y3.def(1),rowspan:Y3.def(1),align:Kd,className:DL,prop:vd,index:v.number.def(void 0)},EL=a.defineComponent({name:"TableColumn",props:OL,setup(e){const t=a.inject(Xm,(s,o=!1)=>{},!1),n=a.inject(qm,{queueStack:(s,o)=>o==null?void 0:o()}),i=a.reactive({...e,field:e.prop||e.field});return{initColumns:t,bkTableCache:n,column:i}},unmounted(){this.updateColumnDefine(!0)},mounted(){this.updateColumnDefine()},methods:{updateColumnDefine(e=!1){if(this.$props.index!==void 0&&typeof this.$props.index=="number"){this.updateColumnDefineByIndex(e);return}this.updateColumnDefineByParent()},updateColumnDefineByParent(){const e=()=>{const n=this._.parent.vnode.children.default()||[],i=[],s=o=>{Array.isArray(o)&&o.forEach(c=>{var f,d,h;if(Array.isArray(c)){s(c);return}let u=!0;if(((f=c.type)==null?void 0:f.name)==="TableColumn"){u=Object.hasOwnProperty.call(c.props||{},"key");const m={...c.props,field:c.props.prop||c.props.field,render:(d=c.children)==null?void 0:d.default};i.push(a.unref(m))}(h=c.children)!=null&&h.length&&u&&s(c.children)})};s(n),this.initColumns(i)};typeof this.bkTableCache.queueStack=="function"&&this.bkTableCache.queueStack(NL,e)},updateColumnDefineByIndex(e=!1){const t={...this.$props,field:this.$props.prop||this.$props.field,render:this.$slots.default};this.initColumns(a.unref(t),e)}},render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{}})])}});class AL{constructor(){De(this,"storage");this.storage={}}queueStack(t,n=()=>{}){this.storage[t]&&clearTimeout(this.storage[t]),this.storage[t]=setTimeout(()=>n())}clearQueueStack(t){this.storage[t]&&clearTimeout(this.storage[t])}}var Vn=(e=>(e.ON_SORT_BY_CLICK="onSortByClick",e.ON_FILTER_CLICK="onFilterClick",e.ON_SETTING_CHANGE="onSettingChange",e.ON_ROW_EXPAND_CLICK="onRowExpandClick",e.ON_ROW_CHECK="onRowCheck",e))(Vn||{}),Ot=(e=>(e.COLUMN_PICK="columnPick",e.COLUMN_SORT="columnSort",e.COLUMN_FILTER="columnFilter",e.COLUMN_FILTER_SAVE="colFilterSave",e.ROW_CLICK="rowClick",e.ROW_DBL_CLICK="rowDblclick",e.ROW_EXPAND_CLICK="rowExpand",e.ROW_MOUSE_ENTER="rowMouseEnter",e.ROW_MOUSE_LEAVE="rowMouseLeave",e.PAGE_LIMIT_CHANGE="pageLimitChange",e.PAGE_VALUE_CHANGE="pageValueChange",e.SETTING_CHANGE="settingChange",e.SCROLL_BOTTOM="scrollBottom",e.ROW_SELECT="select",e.ROW_SELECT_ALL="selectAll",e.ROW_SELECT_CHANGE="selectionChange",e.CELL_CLICK="cellClick",e.CELL_DBL_CLICK="cellDblclick",e.NATIVE_CLICK="click",e.NATIVE_DBL_CLICK="dblclick",e))(Ot||{});const PL=e=>!0,zL=e=>!0,VL=e=>!0,RL=e=>!0,sl=(e,t,n,i,s)=>!0,JL=e=>!0,_L=e=>!0,QL=e=>!0,WL=e=>!0,U3=e=>!0,HL=e=>!0,K3=e=>!0,FL=e=>!0,BL={columnPick:PL,columnFilter:zL,columnSort:RL,colFilterSave:VL,rowClick:sl,rowDblclick:sl,rowExpand:JL,select:_L,selectAll:QL,selectionChange:WL,pageLimitChange:U3,pageValueChange:U3,settingChange:HL,scrollBottom:FL,cellClick:K3,cellDblclick:K3,rowMouseEnter:sl,rowMouseLeave:sl},X3=(e,t)=>{if(e){if(typeof e=="object"){let n=Object.prototype.hasOwnProperty.call(e,"current")?e.current:e.value;return/\d+/.test(n)||(n=1),{...t,...e,current:n}}return t}return{}},$L=(e,t)=>{const n=a.ref(0),i=a.ref(0);let s=a.reactive({count:0,limit:10,current:1,align:"right",layout:["total","limit","list"]});s=X3(e.pagination,s);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=t.length;return}n.value=(s.current-1)*s.limit,i.value=s.current*s.limit},u=a.reactive([]),f=(y,C,b)=>{typeof C=="function"&&y.sort((x,N)=>C(x,N,b[Kn.SORT_TYPE]))},d=(y,C)=>{if(typeof C=="function"){const b=y.filter((x,N)=>C(x,N,t));y.length=0,y.push(...b)}},h=(y,C,b)=>{const x=t.slice(),{sortScope:N}=(b==null?void 0:b.sort)??{};N===e1.ALL&&f(x,C,b),u.length=0,u.push(...x.slice(n.value,i.value)),d(u,y),f(u,C,b)},m=(y,C,b)=>{s=X3(e.pagination,s),p(),c(),h(y,C,b)},p=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},GL=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:_a.Normal,mode:lh.Default,indicator:null}:n.value,s=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,u;if(s.value){const{loading:f,size:d,mode:h,title:m,inline:p,indicator:y}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode(ua,{loading:f,size:d,mode:h,title:m,inline:p,indicator:y},null)}}}};function ZL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const YL=e=>{const{proxy:t}=a.getCurrentInstance(),n=a.ref(t.limit);a.watch(()=>t.limit,c=>{n.value=c}),a.watch(()=>t.limitList,c=>{a.nextTick(()=>{c.includes(n.value)||([n.value]=c)})},{immediate:!0});const i=c=>{n.value=c},{resolveClassName:s}=Ce();return{limit:n,render:({isFirst:c,isLast:u})=>{let f;return t.showLimit?a.createVNode("div",a.mergeProps({class:{[s("pagination-limit")]:!0,"is-first":c,"is-last":u}},{disabled:t.disabled}),[a.createVNode("div",null,[e.value.eachPage]),a.createVNode(yh,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},ZL(f=t.limitList.map((d,h)=>a.createVNode(Al,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Da=5,UL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),s=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{s.value=!1,o.value=!1;const C=[];if(e.totalPageNum<=Da+2){for(let N=2;N<=e.totalPageNum-1;N++)C.push(N);return C}const b=Math.floor(Da/2);e.totalPageNum>Da&&(s.value=t.value-b>2,o.value=t.value+b<e.totalPageNum-1);const x=Math.min(e.totalPageNum-Da,Math.max(2,t.value-b));for(let N=x;N<x+Da;N++)C.push(N);return C});a.watch(()=>e.modelValue,C=>{a.nextTick(()=>{C>=1&&C<=e.totalPageNum?t.value=C:C<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,C=>{t.value>C&&(t.value=C)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=C=>{C!==t.value&&(t.value=C)},h=()=>{t.value=Math.max(1,t.value-Da)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Da)},{resolveClassName:p}=Ce();return{current:t,render:({isFirst:C,isLast:b})=>a.createVNode("div",{class:{[`${p("pagination-list")}`]:!0,"is-first":C,"is-last":b}},[a.createVNode("div",{class:{[`${p("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(bi,null,null)]),a.createVNode("div",{class:{[`${p("pagination-list-item")}`]:!0,"is-active":t.value===1},key:"1",onClick:()=>d(1)},[a.createTextVNode("1")]),s.value&&a.createVNode("div",{key:"pre-batch",class:`${p("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(zs,null,null)]),c.value.map(x=>a.createVNode("div",{class:{[`${p("pagination-list-item")}`]:!0,"is-active":t.value===x},key:x,onClick:()=>d(x)},[x])),o.value&&a.createVNode("div",{key:"next-batch",class:`${p("pagination-list-next-batch")}`,onClick:m},[a.createVNode(zs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${p("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${p("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(Qn,null,null)])])}},KL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),s=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const u=a.computed(()=>{const N=[];for(let S=1;S<=e.totalPageNum;S++)N.push(S);return N});a.watch(()=>e.modelValue,N=>{a.nextTick(()=>{N>=1&&N<=e.totalPageNum?i.value=N:N<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,N=>{i.value>N&&(i.value=N)})});const f=()=>{s.value||(i.value=i.value-1)},d=()=>{o.value||(i.value=i.value+1)},h=()=>{n.value=!0},m=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},p=N=>{const S=N.target,M=Number(S.textContent);!M||M<1||M>e.totalPageNum||M===i.value||(c=M)},y=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},C=N=>{c=N,m()},{resolveClassName:b}=Ce();return{current:i,render:()=>a.createVNode("div",{class:`${b("pagination-small-list")}`},[a.createVNode("div",{class:{[`${b("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(bi,null,null)]),a.createVNode(Ut,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${b("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${b("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:p,onKeydown:y},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${b("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${b("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>C(N)},[N]))])}),a.createVNode("div",{class:{[`${b("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(Qn,null,null)])])}},XL=e=>({isFirst:t,isLast:n})=>{const{props:i}=a.getCurrentInstance();if(!i.showTotalCount)return null;const{resolveClassName:s}=Ce();return a.createVNode("div",a.mergeProps({class:{[`${s("pagination-total")}`]:!0,"is-first":t,"is-last":n}},{disabled:i.disabled}),[e.value.total,a.createVNode("div",{class:`${s("pagination-total-num")}`},[i.count]),e.value.strip])},qL={modelValue:v.number.def(1),count:v.number.def(0).isRequired,limit:v.number.def(10),limitList:v.arrayOf(Number).def([10,20,50,100]),showLimit:v.bool.def(!0),type:v.oneOf(["default","compact"]).def("default"),location:v.oneOf(["left","right"]).def("right"),align:v.oneOf(["left","center","right"]).def("left"),size:v.size(),small:v.bool.def(!1),showTotalCount:v.bool.def(!0),prevText:v.string,nextText:v.string,disabled:v.bool.def(!1),beforeChange:v.func,layout:v.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},eT=a.defineComponent({name:"Pagination",props:qL,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ft("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=XL(n),{current:u,render:f}=UL(),{current:d,render:h}=KL(),{limit:m,render:p}=YL(n);a.watch([s,m,o],([C,b])=>{const x=Math.ceil(C/b);i.value=x<1?1:x},{immediate:!0}),a.watch(u,C=>{t.emit("update:modelValue",C),t.emit("change",C)}),a.watch(d,C=>{e.small&&(t.emit("update:modelValue",C),t.emit("change",C))}),a.watch(m,C=>{t.emit("limitChange",C)});const{resolveClassName:y}=Ce();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:p,renderSmallList:h,resolveClassName:y}},render(){const e=Pe({[`${this.resolveClassName("pagination")}`]:!0,[`${this.resolveClassName(`pagination--${this.size}`)}`]:!0,[`is-align-${this.align}`]:!0}),t={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return a.createVNode("div",{class:e},[this.layout.map((n,i)=>t[n]({isFirst:i===0,isLast:i===this.layout.length-1}))])}}),Nh=Ue(eT);var a1=function(){if(typeof Map<"u")return Map;function e(t,n){var i=-1;return t.some(function(s,o){return s[0]===n?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var i=e(this.__entries__,n),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(n,i){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=i:this.__entries__.push([n,i])},t.prototype.delete=function(n){var i=this.__entries__,s=e(i,n);~s&&i.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(i,c[1],c[0])}},t}()}(),Xd=typeof window<"u"&&typeof document<"u"&&window.document===document,zl=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),tT=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(zl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),nT=2;function iT(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){tT(o)}function u(){var f=Date.now();if(n){if(f-s<nT)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var aT=20,rT=["top","right","bottom","left","width","height","size","weight"],sT=typeof MutationObserver<"u",oT=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=iT(this.refresh.bind(this),aT)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,i=n.indexOf(t);~i&&n.splice(i,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Xd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sT?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Xd||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=n===void 0?"":n,s=rT.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),r1=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},Qr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||zl},s1=Ac(0,0,0,0);function Vl(e){return parseFloat(e)||0}function q3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(i,s){var o=e["border-"+s+"-width"];return i+Vl(o)},0)}function lT(e){for(var t=["top","right","bottom","left"],n={},i=0,s=t;i<s.length;i++){var o=s[i],c=e["padding-"+o];n[o]=Vl(c)}return n}function cT(e){var t=e.getBBox();return Ac(0,0,t.width,t.height)}function uT(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return s1;var i=Qr(e).getComputedStyle(e),s=lT(i),o=s.left+s.right,c=s.top+s.bottom,u=Vl(i.width),f=Vl(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=q3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=q3(i,"top","bottom")+c)),!fT(e)){var d=Math.round(u+o)-t,h=Math.round(f+c)-n;Math.abs(d)!==1&&(u-=d),Math.abs(h)!==1&&(f-=h)}return Ac(s.left,s.top,u,f)}var dT=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Qr(e).SVGGraphicsElement}:function(e){return e instanceof Qr(e).SVGElement&&typeof e.getBBox=="function"}}();function fT(e){return e===Qr(e).document.documentElement}function hT(e){return Xd?dT(e)?cT(e):uT(e):s1}function gT(e){var t=e.x,n=e.y,i=e.width,s=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return r1(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function Ac(e,t,n,i){return{x:e,y:t,width:n,height:i}}var mT=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ac(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=hT(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),pT=function(){function e(t,n){var i=gT(n);r1(this,{target:t,contentRect:i})}return e}(),vT=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new a1,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=i}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Qr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new mT(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Qr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(i){return new pT(i.target,i.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),o1=typeof WeakMap<"u"?new WeakMap:new a1,l1=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=oT.getInstance(),i=new vT(t,n,this);o1.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){l1.prototype[e]=function(){var t;return(t=o1.get(this))[e].apply(t,arguments)}});var yT=function(){return typeof zl.ResizeObserver<"u"?zl.ResizeObserver:l1}();const Et=(e,t,n)=>{if(e!=null){if(typeof t=="string")return Object.prototype.hasOwnProperty.call(e,t)?typeof e[t]=="function"?e[t].call(globalThis,...n):e[t]:void 0;if(Array.isArray(t))return t.map(i=>Et(e,i,n)).filter(i=>i!==void 0).at(0)}},yd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],CT=e=>c1(e,"auto"),c1=(e,t="100%",n=null)=>{let i="";return/^auto|null|undefined$/ig.test(`${e}`)?i=t:i=/^\d+\.?\d+$/.test(`${e}`)?`${e}px`:e,n&&(i=`calc(${i} - ${n})`),i},bT=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>CL.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Ss=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],Cd=(e,t,n=oa,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:p=void 0}=h;if(p===void 0)return m<oa?oa:m;let y=m;return/^\d+\.?\d*$/.test(`${p}`)&&(y=Number(p)),/^\d+\.?\d*%$/.test(`${p}`)&&(y=Number(p)*o/100),/^\d+\.?\d*px$/i.test(`${p}`)&&(y=Number(`${p}`.replace(/px/i,""))),y},d=(h,m,p=!0)=>{const y=f(h,m),C=m<y?y:m;Object.assign(h,{calcWidth:C}),p&&(c=c-C,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const y=String(Ss(h,["resizeWidth","width"]));let C=!0;if(/^\d+\.?\d*(px)?$/.test(y)){const b=Number(y.replace("px",""));d(h,b),C=!1}if(/^\d+\.?\d*%$/.test(y)){let b=n;if(c>0){const x=Number(y.replace("%",""));b=c*x/100}d(h,b),C=!1}C&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,p)=>{h=c/(u.length-p),d(t[m],h,!1);const{calcWidth:y}=t[m];c=c-y}):u.forEach(m=>{const p=f(t[m],oa);Object.assign(t[m],{calcWidth:p})})}},u1=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?at.debounce(o,n):at.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new yT(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},qd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},Rl=(e,t,n)=>n.type==="index"?e[Be.ROW_INDEX]+1:at.get(e,t),bs=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?bs(Reflect.apply(e,globalThis,t),t):[],d1=(e,t,n)=>{const i=f1(e,t,n);return i!==null?i:Ri.v4()},f1=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Be.ROW_INDEX?`__ROW_INDEX_${n}`:at.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,wT=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},h1=(e,t,n)=>(s=>e.some(o=>o.field===Et(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Et(t,["field","type"],[t])),e6=(e,t,n,i,s)=>typeof e[s]=="function"?Reflect.apply(e[s],globalThis,[{column:e,colIndex:t,row:n,rowIndex:i}]):typeof e[s]=="number"?e[s]:1,g1=(e,t,n,i)=>{const s=e6(e,t,n,i,"colspan"),o=e6(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},m1=(e,t)=>{var c,u;const n=e.field,i=f=>Rl(f,n,e),s=(f,d)=>{const h=i(f)||"",m=i(d)||"";return typeof h=="number"&&typeof m=="number"?h-m:String.prototype.localeCompare.call(h,m)},o=typeof((c=e.sort)==null?void 0:c.sortFn)=="function"?(u=e.sort)==null?void 0:u.sortFn:s;return t===Rt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Rt.DESC?-1:1)},p1=e=>{const t={[Rt.NULL]:0,[Rt.ASC]:1,[Rt.DESC]:2};return t[e]===void 0?Rt.NULL:Object.keys(t)[(t[e]+1)%3]},v1=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Rt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},Cl=(e,{row:t,index:n,isCheckAll:i})=>typeof e.isRowSelectEnable=="boolean"?e.isRowSelectEnable!==!1:typeof e.isRowSelectEnable=="function"?e.isRowSelectEnable({row:t,index:n,isCheckAll:i}):!0,NT=(e,t,n)=>{if(e[Be.ROW_UID]!==void 0)return e[Be.ROW_UID];const i=d1(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},ks=e=>a.unref(e[Be.ROW_SOURCE_DATA]||e),y1=e=>a.unref(e[Kn.COL_SOURCE_DATA]||e),t6=a.defineComponent({name:"TableCell",props:{column:io,row:v.any.def({}),parentSetting:wh,title:v.string.def(void 0),observerResize:v.bool.def(!0),isHead:v.bool.def(!1),headExplain:v.string,resizerWay:Se("ResizerWay",{default:t1.DEBOUNCE})},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),s=a.computed(()=>({textAlign:e.column.textAlign})),o=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:c=!1}=o();let u=null;const f=()=>{var N;let p=!0,{resizerWay:y}=e,C=n.value.innerText,b="auto",x=!0;return typeof c=="boolean"&&(p=!c),typeof c=="object"&&(p=c.disabled,y=c.resizerWay||"debounce",C=c.content||n.value.innerText,typeof c.content=="function"&&(C=c.content(e.column,e.row)),x=c.watchCellResize,b=c.mode||"auto"),typeof p=="function"&&(p=Reflect.apply(p,this,[e.column,e.row])),e.isHead&&(p=!1,b="auto",C=(N=d())==null?void 0:N.innerHTML,e.headExplain&&(b="static",C=e.headExplain)),e.column.explain&&(p=!1,b="static",typeof e.column.explain=="object"&&(C=Et(e.column.explain,"content",[e.column,e.row]))),{disabled:p,content:C,mode:b,resizerWay:y,watchCellResize:x}},d=()=>{var p,y;return e.isHead?(y=(p=n.value)==null?void 0:p.querySelector)==null?void 0:y.call(p,".head-text"):n.value},h=()=>{const p=d();if(!p||!Ra(p))return;const{mode:y,disabled:C}=f();if(i.value=!C,y==="auto"&&(i.value=a8(p)),y==="static"&&(i.value=!0),i.value){const b=a.ref(f());u===null&&(u=ph(p,{disabled:b.value.disabled,content:b.value.content,mode:b.value.mode}))}else u==null||u.destroyInstance(p),u=null};a.onMounted(()=>{const{disabled:p,resizerWay:y,watchCellResize:C}=f();if(!p&&(h(),C!==!1&&e.observerResize)){let b=u1(n.value,()=>{h()},60,!0,y);b.start(),a.onBeforeUnmount(()=>{b.disconnect(),b=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)});const m=e.headExplain||e.column.explain;return()=>{var p;return a.createVNode("div",{class:["cell",e.column.type,m?"explain":""],style:s.value,ref:n,title:e.title},[(p=t.default)==null?void 0:p.call(t)])}}}),bd=a.defineComponent({name:"TableRow",render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});class MT{constructor(t,n){De(this,"props",null);De(this,"ctx",null);this.props=t,this.ctx=n}}const IT=a.defineComponent({name:"BodyEmpty",props:{list:v.array.def([]),filterList:v.array.def([]),emptyText:v.string},emits:["change"],setup(e){const t=ft("table"),n=a.computed(()=>e.emptyText===void 0?t.value.emptyText:e.emptyText),i=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(Oc,{scene:"part",type:i.value,description:n.value},null)}}),LT=a.defineComponent({name:"HeadFilter",props:{column:io,height:v.number.def(sa)},emits:["change","filterSave"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ft("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.computed(()=>{var P;return((P=o.value)==null?void 0:P.checked)??[]}),u=a.reactive({isOpen:!1,checked:c.value});a.watch(()=>o.value,()=>{u.checked=c.value},{immediate:!0,deep:!0});const f=a.computed(()=>Pe({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Pe({[n("table-head-filter")]:!0}),h=a.ref(null),m=P=>{u.isOpen=P,P&&setTimeout(()=>{h.value.reset()})},p=`light ${n("table-head-filter")}`,y=a.computed(()=>{const{list:P=[]}=o.value;return P}),C=(P,A="ig")=>new RegExp(`${P}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),A),b=(P,A)=>{const{match:_}=o.value,W=Rl(A,Et(s,"field",[s,A]),s);return _==="full"&&P.includes(W),P.some(H=>C(H,"img").test(W))},x=typeof o.value.filterFn=="function"?(P,A,_,W)=>o.value.filterFn(P,A,e.column,_,W):(P,A)=>P.length?b(P,A):!0,N=()=>{S(!0),t("filterSave",[...u.checked]),u.isOpen=!1},S=(P=!1)=>{const{disabled:A}=I(L,i.value.confirm);if(A||P){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],x)}},M=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,x)))},I=(P,A)=>({disabled:P==="disabled"||P===!1,text:typeof P=="string"?P:A}),{btnSave:L,btnReset:T}=o.value,V=()=>{const{disabled:P,text:A}=I(L,i.value.confirm);return P?a.createVNode("span",{class:"btn-filter-save disabled"},[A]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[A])},k=()=>{const{disabled:P,text:A}=I(T,i.value.reset);return P?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:M},[A])},E=(P,A)=>{const _=new Set(u.checked);P?_.add(A.value):_.delete(A.value),u.checked.length=0,u.checked.push(...Array.from(_)),S()},O=P=>P.data.length?P.data.map(A=>a.createVNode("div",{class:"list-item"},[a.createVNode(qn,{label:A.value,key:A.$index,immediateEmitChange:!1,checked:u.checked.includes(A.value),modelValue:u.checked.includes(A.value),onChange:_=>E(_,A)},{default:()=>[`${A.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Ut,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:ql.SHOWN,arrow:!1,offset:0},{theme:p},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(Cc,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(jc,{class:"content-list"},{default:()=>[a.createVNode(Br,{lineHeight:32,list:y.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:O})]}),a.createVNode("div",{class:"content-footer"},[V(),a.createVNode("span",{class:"btn-filter-split"},null),k()])])})}}),TT=a.defineComponent({name:"HeadSort",props:{column:io,defaultSort:v.oneOf(IL).def(Rt.NULL),active:v.bool},emits:["change"],setup(e,{emit:t}){var c,u;const{resolveClassName:n}=Ce(),i=((u=(c=e.column)==null?void 0:c.sort)==null?void 0:u.value)||e.defaultSort||Rt.NULL,s=a.ref(i);a.watch(()=>[e.defaultSort],([f])=>{s.value=f});const o=(f,d)=>{f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault();let h=d;d===Rt.NULL&&(h=p1(d)),s.value===d&&(h=Rt.NULL);const m=m1(e.column,h),p=v1(e.column.sort);if((p==null?void 0:p.value)==="custom"){t("change",(p==null?void 0:p.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort")},[a.createVNode(ac,{class:["sort-action","sort-asc",s.value===Rt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Rt.ASC)},null),a.createVNode(Gs,{class:["sort-action","sort-desc",s.value===Rt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Rt.DESC)},null)])}});function n6(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const xT=a.defineComponent({name:"Settings",props:{settings:n1,columns:v.arrayOf(io).def([]),rowHeight:i1.def(sa)},emits:["change"],setup(e,{emit:t,slots:n}){const{resolveClassName:i}=Ce(),s=ft("table"),o=wL(s),c=(H,ie)=>Et(H,["id","field","type"],[H,ie]),u=a.ref(!1),f=a.ref(!1),d=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(H=>({...H,field:H.field||H.type})),checked:[],limit:0,size:"small",sizeList:o,showLineHeight:!0}:e.settings),h=a.ref(d.value.size||"small"),m=a.ref(e.rowHeight),p=a.ref(d.value.checked||[]),C=`light ${i("table-settings")}`,b=a.computed(()=>d.value.fields||e.columns||[]),x={checkAll:u.value,activeSize:h.value,activeHeight:m.value,checkedFields:d.value.checked||[]},N=()=>{Object.assign(x,{checkAll:u.value,activeSize:h.value,activeHeight:m.value,checkedFields:p.value}),t("change",{checked:p.value,size:h.value,height:m.value,fields:a.unref(b)}),f.value=!1},S=()=>{u.value=x.checkAll,h.value=x.activeSize,m.value=x.activeHeight,p.value=x.checkedFields,f.value=!1},M=()=>{f.value=!0},I=H=>{H.stopImmediatePropagation(),H.stopPropagation(),H.preventDefault(),u.value=!u.value;const ie=d.value.fields||e.columns||[],fe=ie.filter((de,re)=>de.disabled&&p.value.includes(c(de,re))).map((de,re)=>c(de,re));if(u.value){const de=ie.filter(re=>!re.disabled).map((re,ve)=>c(re,ve));p.value.splice(0,p.value.length,...de,...fe)}else p.value.splice(0,p.value.length,...fe)},L=a.computed(()=>(d.value.limit??0)>0),T=d.value.sizeList||o,V=a.computed(()=>L.value&&(d.value.limit?d.value.limit:0)<=p.value.length),k=(H,ie)=>H.disabled||V.value&&!p.value.includes(c(H,ie)),E=H=>{h.value=H.value,m.value=H.height},O=H=>({"line-size":!0,"is-medium":h.value==="medium",active:H.value===h.value}),P={marginRight:"12px"},A=()=>T.map(H=>a.createVNode("span",{class:O(H),onClick:()=>E(H)},[H.label])),_=a.computed(()=>p.value.length>0&&!b.value.every((H,ie)=>p.value.includes(Et(H,"field",[H,ie])))),W=a.computed(()=>typeof d.value.showLineHeight=="boolean"?d.value.showLineHeight:!0);return a.watch(()=>[p.value],()=>{p.value.length||(u.value=!1),p.value.length&&b.value.every((H,ie)=>p.value.includes(c(H,ie)))&&(u.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{p.value.splice(0,p.value.length,...d.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Ut,a.mergeProps({trigger:"manual",isShow:f.value,placement:"bottom-end",arrow:!0},{theme:C}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:M},[a.createVNode(uc,{style:"color: #c4c6cc;"},null)]),content:()=>{var ie;let H;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[s.value.setting.title]),a.createVNode(Ys,{class:"icon-close-action",onClick:S},null)]),a.createVNode("div",{class:"setting-body"},[a.createVNode("div",{class:"setting-body-title"},[a.createVNode("div",null,[a.createVNode("span",{class:"field-setting-label"},[s.value.setting.fields.title]),L.value?a.createVNode("span",{class:"limit"},[s.value.setting.fields.subtitle(d.value.limit)]):""]),L.value?"":a.createVNode("span",{class:"check-all",onClick:I},[a.createVNode(qn,{label:s.value.setting.fields.selectAll,indeterminate:!!_.value,modelValue:p.value.length>0},{default:()=>[s.value.setting.fields.selectAll]})])]),a.createVNode(jc,{class:"setting-body-fields",modelValue:p.value,"onUpdate:modelValue":fe=>p.value=fe},n6(H=b.value.map((fe,de)=>{let re;return a.createVNode("div",{class:"field-item"},[a.createVNode(qn,{checked:p.value.includes(c(fe,de)),label:c(fe,de),disabled:k(fe,de)},n6(re=Et(fe,["name","label"],[fe,de]))?re:{default:()=>[re]})])}))?H:{default:()=>[H]}),(ie=n.default)==null?void 0:ie.call(n),W.value?a.createVNode("div",{class:"setting-body-line-height"},[s.value.setting.lineHeight.title,a.createTextVNode(":"),A()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(Pt,{theme:"primary",style:P,onClick:N},{default:()=>[s.value.setting.options.ok]}),a.createVNode(Pt,{style:P,onClick:S},{default:()=>[s.value.setting.options.cancel]})])])}}):""}}),ef=(e,t,n)=>{const i=(p,y,C)=>({column_fixed:!!p.fixed,column_fixed_left:p.fixed!=="right",column_fixed_right:p.fixed==="right",shadow:p.fixed==="right"?C-y>2:y>0}),s=p=>p.fixed==="right"?"right":"left",o={left:(p=!0)=>t.filter(y=>!y.isHidden&&y.fixed&&y.fixed!=="right").reduce((y,C,b)=>p&&b===0?y:y+Ss(C),0),right:(p=!0)=>t.filter(y=>!y.isHidden&&y.fixed==="right").reduce((y,C,b)=>p&&b===0?y:y+Ss(C),n?_r:0)},c=(p,y,C=0)=>{const b=y[Kn.COL_UID],x=p==="right"?-1:1,N=t.filter(L=>!L.isHidden),{length:S}=N;let M=p==="right"?S*x:1,I=0;for(M;;){M=M+-1*x;const L=Math.abs(M),T=N[L],V=s(T),k=T[Kn.COL_UID];if(V===p&&b!==k){const E=Ss(T);I=I+E}if(b===k)break}return I+C},u=(p,y=!1)=>{if(!p.fixed||p.isHidden)return{};const C={left:0,right:y?_r:-1},b=s(p);return C[b]=c(b,p,C[b]),{[b]:`${C[b]}px`}},f=p=>({width:`${o[p](!1)}px`,backgroundColor:e.thead.color,bottom:"0px"}),d=a.computed(()=>{const p={left:!1,right:!1};return t.filter(y=>!y.isHidden&&y.fixed).map(y=>{const C=s(y),b=p[C];return p[C]=!0,{isExist:b,colPos:C,column:y}})}),{resolveClassName:h}=Ce();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function i6(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class ST{constructor(t,n,i,s,o,c){De(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Et(this.setting,"height",["tbody",t,n,i]):Et(this.props,"rowHeight",["tbody",t,n])});De(this,"getColumnClass",(t,n)=>({[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right",[`${t.className}`]:!0}));De(this,"getHeadColumnClass",(t,n)=>({...this.getColumnClass(t,n),active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=s,this.plugins=new MT(t,n),this.uuid=Ri.v4(),this.events=new Map,this.styleRef=o,this.t=c,this.activeSortIndex=a.ref(-1)}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=qd(this.props);if(!t)return null;const n=i=>{var f;const{checked:s=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c;const u=((f=this.props.settings)==null?void 0:f.fields)||[];s.length&&this.colgroups.forEach(d=>{d.isHidden=h1(u,d,s)}),this.emitEvent(Vn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(xT,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},{default:()=>{var i,s;return[(s=(i=this.context.slots).setting)==null?void 0:s.call(i)]}}):"",a.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])]}renderTableBodySchema(t){var i,s;const n=a.computed(()=>this.props.emptyText===void 0?this.t.value.emptyText:this.props.emptyText);return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):((s=(i=this.context.slots).empty)==null?void 0:s.call(i))??a.createVNode(IT,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(Nh,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.handlePageChange(n)}),null)}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),this}destroy(){this.events.clear(),this.events=null}emitEvent(t,n){this.events.has(t)&&this.events.get(t).forEach(i=>{typeof i=="function"&&Reflect.apply(i,this,n)})}handlePageLimitChange(t){Object.assign(this.props.pagination,{limit:t}),this.context.emit(Ot.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Ot.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(s=>s.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(s=>s.index!==t&&s.active).forEach(s=>{Object.assign(s,{active:!1})})}handleColumnHeadClick(t,n){if(this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(Ot.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Et(n,["field","type"],[n,t]),s=p1(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=m1(n,s);this.activeSortIndex.value=t,this.emitEvent(Vn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Et(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Vn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i]||t.sort.value||Rt.NULL;return a.createVNode(TT,{column:t,defaultSort:o,active:this.activeSortIndex.value===n,onChange:s},null)}getFilterCell(t,n){const i=(o,c)=>{const u=(f,d)=>c(o,f,d);this.emitEvent(Vn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(Ot.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(LT,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=qd(this.props),{cellFn:n}=t,i={"--row-height":`${Et(t,"height",["thead"])}px`,backgroundColor:this.props.thead.color},s=(d,h)=>typeof n=="function"?n(d,h):typeof d.renderHead=="function"?d.renderHead(d,h):Et(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const b=this.reactiveProp.rowActions.get(Be.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Be.ROW_SELECTION]:!!b},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const p=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[p]));const y=typeof p=="string"?p:void 0,C={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(t6,{class:C,title:y,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay,isHead:!0,headExplain:Et(d.explain,"head",[d])},i6(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const p=m.split("_").slice(-1)[0];return Object.assign(h,{[p]:y=>{d.listeners.get(m).forEach(C=>Reflect.apply(C,this,[y,d,this]))}})},{}),{resolveFixedColumnStyle:u}=ef(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${_r+2}px`,right:"-1px"};return a.createVNode("th",{style:d,class:"column_fixed"},null)}};return a.createVNode(a.Fragment,null,[a.createVNode("thead",{style:i},[a.createVNode(bd,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>{var p;const m=Object.assign({},u(d,this.styleRef.value.hasScrollY),{backgroundColor:bL[((p=this.props.thead)==null?void 0:p.color)??bh.DEF1]});return a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:[this.getHeadColumnClass(d,h),this.getColumnCustomClass(d),d.align||this.props.headerAlign||this.props.align],style:m,onClick:()=>this.handleColumnHeadClick(h,d)},c(d)),[o(d,h)])}),f()])]})])])}getColumnCustomClass(t,n){const i=t.className;if(i){if(typeof i=="function")return i(n);if(typeof i=="string")return i}return""}renderTBody(t){const{resolveFixedColumnStyle:n}=ef(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...bs(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...bs(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`,o%2===1&&this.props.stripe?"stripe-row":""];return[a.createVNode(bd,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:f1(s,this.props,o),onClick:f=>this.handleRowClick(f,s,o,t),onDblclick:f=>this.handleRowDblClick(f,s,o,t),onMouseenter:f=>this.handleRowEnter(f,s,o,t),onMouseleave:f=>this.handleRowLeave(f,s,o,t)},[this.filterColGroups.map((f,d)=>{var S;const h=[n(f),...bs(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:p,rowspan:y}=g1(f,d,s,o),C=Be.ROW_SKIP_CFG,b=f[Kn.COL_UID],{skipRow:x=!1,skipCol:N=!1}=((S=s[C])==null?void 0:S[b])??{};if(!x&&!N){let M;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...bs(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[Be.ROW_EXPAND],"is-last":o+y>=i}],L=(T,V)=>{const k={event:T,row:ks(s),column:y1(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(V,k)};return a.createVNode("td",{class:I,style:h,colspan:p,rowspan:y,onClick:T=>L(T,Ot.CELL_CLICK),onDblclick:T=>L(T,Ot.CELL_DBL_CLICK)},[a.createVNode(t6,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},i6(M=this.renderCell(s,f,o,t))?M:{default:()=>[M]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[Be.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${NT(t,i,this.props)}_expand`;return a.createVNode(bd,{key:u},{default:()=>{var f,d;return[a.createVNode("tr",{class:o},[a.createVNode("td",{colspan:this.filterColGroups.length,rowspan:1},[((d=(f=this.context.slots).expandRow)==null?void 0:d.call(f,ks(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(Ot.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(Ot.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[Be.ROW_EXPAND]?a.createVNode(Us,null,null):a.createVNode(eo,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Vn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=Rl(t,Et(n,"field",[n,t]),n),c=t[Be.ROW_INDEX],u=typeof c=="number"?c:i,f=this.props.data[u];return n.render({cell:o,data:f,row:t,column:n,index:i,rows:s})}renderCheckboxColumn(t,n,i=!1){const s=u=>{this.emitEvent(Vn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get(Be.ROW_SELECTION_INDETERMINATE),c=Cl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode(qn,{onChange:s,disabled:!c,modelValue:t[Be.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,s){const o=()=>{var c,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):((u=(c=this.context.slots).expandCell)==null?void 0:u.call(c,{row:t,column:n,index:i,rows:s}))??this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,s,c)},[o()])}renderCell(t,n,i,s){var u;const o=()=>{const f=Rl(t,Et(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):typeof f=="object"?JSON.stringify(a.unref(f)):f},c={expand:(f,d,h,m)=>this.renderExpandColumn(f,d,h,m),selection:(f,d,h,m)=>this.renderCheckboxColumn(f,h)};return((u=c[n.type])==null?void 0:u.call(c,t,n,i,s))??o()}isColActive(t){return this.props.columnPick!=="disabled"&&this.propActiveCols.some(n=>n.index===t&&n.active)}renderColGroup(){return a.createVNode("colgroup",null,[(this.filterColGroups||[]).map((t,n)=>{const i=Pe({active:this.isColActive(n)}),s=`${CT(Ss(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:s},null)})])}get filterColGroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}const Pc=(e,t)=>({initColumns:(s,o=!1)=>{let c=[];if(Array.isArray(s)?c=s:c=[s],o)c.forEach(u=>{const f=t.findIndex(d=>d.label===u.label&&d.field===u.field);if(o){f>=0&&t.splice(f,1);return}});else{let u=!1;c.forEach(f=>{if(f.index!==void 0&&f.index>=0){u=!0;const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0&&t.splice(d,1),t.push(f)}else{const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0?t.splice(d,1,f):t.push(f)}}),u&&t.sort((f,d)=>f.index-d.index)}},getColumns:()=>{var s;return t!=null&&t.length?t:(s=e.columns)!=null&&s.length?e.columns:[]}}),a6=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:yd(e.activeColumn):Array.isArray(e.activeColumn)?yd(e.activeColumn[0]):yd(e.activeColumn):[],kT=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Pc(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(a6(e)),o=()=>i().map((c,u)=>({index:u,_column:c,active:s.some(f=>f===u)}));return a.watchEffect(()=>{n=o();const c=a6(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},DT=(e,t=!0)=>{const n="HeadColumnResize";let i=function(I){return I.MOUSE_MOVE="onMousemove",I.MOUSE_OUT="onMouseout",I.MOUSE_DOWN="onMousedown",I}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=I=>{o=!1,c=!1;const L=document.body.style;L.cursor="";const T=I.clientX-u,V=(f.resizeWidth??f.calcWidth)+T,k=Number(f.minWidth);f.resizeWidth=V>k?V:k,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",y),u=0,h.value=-1e3,f=null,I.target.closest("table").querySelectorAll("th").forEach(O=>O.style.setProperty("user-select","inherit"))},p=I=>at.throttle(()=>{const L=I.clientX-u,T=(f.resizeWidth??f.calcWidth)+L;Number(f.minWidth)<T&&(h.value=I.clientX-u+d)},60),y=I=>{document.body.style.setProperty("cursor",""),p(I)()},C=(I,L)=>{var T,V;at.isElement(I)&&((T=I.style)==null||T.setProperty("cursor",L),((V=I.childNodes)==null?void 0:V.length)>0&&I.childNodes.forEach(k=>C(k,L)))},b={[i.MOUSE_DOWN]:(I,L)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=L,u=I.clientX;const V=I.target.closest("table");d=u-V.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",y)},[i.MOUSE_MOVE]:(I,L)=>{o&&!c&&(c=!0);const T=I.target.closest("th");if(c&&T.style.setProperty("user-select","none"),!c){if(!T)return;const V=T.getBoundingClientRect();V.width>12&&V.right-I.pageX<8?(s=!0,C(T,"col-resize")):(C(T,""),s=!1)}},[i.MOUSE_OUT]:(I,L)=>{const T=I.target;c||C(T,"")}},x=I=>`${n}_${I}`,N=()=>{e.forEach(I=>{I.resizable!==!1&&Object.keys(b).forEach(L=>{const T=x(L);I.listeners.has(T)||I.listeners.set(T,[]),I.listeners.get(T).push(b[L])})})},S=()=>{e.forEach(I=>{Object.keys(b).forEach(L=>{const T=x(L);if(I.listeners.has(T)){const V=I.listeners.get(T);V.length=0}})})};t&&N();const M=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:N,resetResizeEvents:S,dragOffsetX:h,dragOffsetXStyle:M}},jT=(e,t,n,i,s)=>{const{getColumns:o}=Pc(e,t),c=a.ref(200),u=a.ref(200),f=a.ref(sa),d=a.ref(!1),h=a.computed(()=>e.pagination&&e.data.length),m=a.computed(()=>d.value),p=a.computed(()=>Pe({[$t("table")]:!0,"has-footer":h.value,"has-scroll-y":d.value||e.virtualEnabled},bT(e.border))),y=Pe({[$t("table-head")]:!0,"has-settings":!!e.settings}),C=a.computed(()=>o()),b=qd(e),x=a.computed(()=>({"--row-height":`${Et(b,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),N={[$t("table-body")]:!0},S=a.computed(()=>Pe({[$t("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),M=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",I=()=>{if(C.value.every(_=>/^\d+\.?\d*(px)?$/ig.test(`${_.width}`))){const _=C.value.reduce((H,ie)=>H+Number(`${ie.width}`.replace(/px/ig,"")),0),W=d.value?_r:0;return`${_+W}px`}return"100%"},L=a.computed(()=>({minHeight:c1(e.minHeight,"auto"),width:I(),maxWidth:"100%",height:M()})),T=(_,W)=>{const H=String(_);if(/^\d+\.?\d*$/.test(H))return Number(H);if(/^\d+\.?\d*px$/ig.test(H))return Number(H.replace("px",""));if(/^\d+\.?\d*%$/ig.test(H)&&typeof W=="number"){const ie=Number(H.replace("%",""));return W*ie/100}return W},V=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),k=()=>e.showHead?T(e.headHeight,sa):0,E=()=>{const _=T(e.height,c.value);f.value=k();const W=T(e.minHeight,c.value),H=e.pagination&&e.data.length?e.paginationHeight:0,ie=_-f.value-H,fe=e.height!=="auto"?`${ie}px`:!1,de=W-f.value-H,re=T(e.maxHeight,void 0),ve=typeof re=="number"?`${re-f.value-H}px`:!1;Object.assign(V,{display:s!=null&&s.length?"block":!1,"min-height":`${de}px`,height:fe,maxHeight:ve})};a.onMounted(()=>{O(n==null?void 0:n.value)});const O=_=>{if(_){const{height:W}=_.parentElement.getBoundingClientRect();c.value=W;const H=_.querySelector(".bk-table-body-content > table");E(),u.value=((H==null?void 0:H.offsetHeight)??W)+f.value,P(_)}},P=_=>{if(!_)return;const W=e.virtualEnabled?`.${$t("virtual-section")}`:`.${$t("table-body-content")}`,H=_.querySelector(`.${$t("table-body")}`);d.value=wT(H,W,0)};return{tableClass:p,headClass:y,contentClass:N,footerClass:S,wrapperStyle:L,contentStyle:V,headStyle:x,fixHeight:u,resetTableHeight:O,updateBorderClass:P,getColumnsWidthOffsetWidth:()=>{let _=0;return d.value&&(_=_+_r),e.border.includes(Pl.OUTER)&&!e.border.includes(Pl.NONE)&&(_=_+2),_},hasFooter:h,hasScrollY:d,hasScrollYRef:m}},OT=(e,t)=>{var ee,$;const n=a.reactive([]),{getColumns:i}=Pc(e,t),s=j=>{if(/^\d+/.test(`${j.minWidth}`))return j.minWidth;let J=oa;return j.sort&&(J=J+18),j.filter&&(J=J+28),J},o=a.computed(()=>i()),c=j=>{var ae,Z;const J=(j==null?void 0:j.checked)||((ae=e.settings)==null?void 0:ae.checked)||[],X=(j==null?void 0:j.fields)||((Z=e.settings)==null?void 0:Z.fields)||[];n.length=0,n.push(...o.value.map(se=>({...se,calcWidth:null,resizeWidth:null,minWidth:s(se),listeners:new Map,isHidden:h1(X,se,J),[Kn.COL_UID]:Ri.v4(),[Kn.COL_SOURCE_DATA]:se})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=DT(n,!0),{activeColumns:m}=kT(e,t);a.watch(()=>[e.settings],()=>{var j;(((j=e.settings)==null?void 0:j.checked)||[]).length&&c()});const p=at.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{p()},{immediate:!0,deep:!0});const y=e.columns.reduce((j,J,X)=>{const ae=Et(J,["field","type"],[J,X]),Z=v1(J.sort);return Z?{...j||{},[ae]:Z==null?void 0:Z.value}:j},null),C=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(ee=e.settings)==null?void 0:ee.size,height:vl[($=e.settings)==null?void 0:$.size]},defaultSort:y||e.defaultSort}),b=j=>{var J;return C.rowActions.has(j)?(J=C.rowActions.get(j))==null?void 0:J.isExpand:!1},x=()=>{Array.isArray(C.defaultSort)&&C.defaultSort.splice(0),C.defaultSort=y||e.defaultSort},N=(j,J=void 0)=>{const X=j[Be.ROW_UID],ae=typeof J=="boolean"?J:!b(X);C.rowActions.set(X,Object.assign({},C.rowActions.get(X)??{},{isExpand:ae})),ve()},S=(j=void 0)=>{_.forEach(J=>{const X=J[Be.ROW_UID],ae=typeof j=="boolean"?j:!b(X);C.rowActions.set(X,Object.assign({},C.rowActions.get(X)??{},{isExpand:ae}))}),ve()},M=()=>C.rowActions.has(Be.ROW_SELECTION_ALL)?C.rowActions.get(Be.ROW_SELECTION_ALL):e.selectionKey?_.every(j=>P(j)):!1,I=j=>{const J=j[Be.ROW_UID],{isSelected:X=!1}=C.rowActions.get(J)||{};return X},L=(j=I)=>{let J=!1,X=!1;_.forEach(ae=>{const Z=j(ae);!J&&!Z&&(J=!0),!X&&Z&&(X=!0)}),C.rowActions.set(Be.ROW_SELECTION_INDETERMINATE,X&&J),C.rowActions.set(Be.ROW_SELECTION_ALL,X&&!J)},T=()=>e.columns.some(j=>j.type==="selection"),V=()=>{T()&&L(j=>P(j))},k=(j=void 0)=>{const J=typeof j=="boolean"?j:!M();C.rowActions.set(Be.ROW_SELECTION_ALL,J),C.rowActions.set(Be.ROW_SELECTION_INDETERMINATE,!1),_.forEach((X,ae)=>{if(Cl(e,{row:X,index:ae,isCheckAll:!1})){const Z=X[Be.ROW_UID],se=Object.assign({},C.rowActions.get(Z)??{},{isSelected:J});C.rowActions.set(Z,se)}}),L(),ve(J),F(null,j,!0)},E=()=>{k(!1)},O=(j,J)=>{const X=j[Be.ROW_UID];if(X){const ae=typeof J=="boolean"?J:!A(j,X),Z=Object.assign({},C.rowActions.get(X)??{},{isSelected:ae});C.rowActions.set(X,Z),J||C.rowActions.set(Be.ROW_SELECTION_ALL,!1),L(),ve(),F(j,J,!1)}},P=(j,J=X=>I(X))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:j,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?at.get(j,e.selectionKey):J(j),A=(j,J,X)=>P(j,()=>{var Z;const ae=J===void 0?j[Be.ROW_UID]:J;return Cl(e,{row:j,index:X,isCheckAll:!1})&&M()?!0:C.rowActions.has(ae)?(Z=C.rowActions.get(ae))==null?void 0:Z.isSelected:!1}),_=a.reactive([]),W=a.computed(()=>n.some(j=>typeof j.rowspan=="function"||/^\d$/.test(`${j.rowspan}`)||typeof j.colspan=="function"||/^\d$/.test(`${j.colspan}`))),H=a.computed(()=>n.some(j=>j.type==="selection")),ie=a.computed(()=>n.some(j=>j.type==="expand")),fe=a.computed(()=>n.some(j=>j.type==="index")),de=(j=!1)=>{let J=null;const X={},ae=e.data.map(Z=>({[Be.ROW_UID]:Ri.v4(),...Z}));if(W.value||H.value||ie.value||fe.value){const Z=ae.map((se,ye)=>{const Me=d1(se,e,ye);J=Me;const je={...se,[Be.ROW_UID]:se[Be.ROW_UID]||Me,[Be.ROW_SOURCE_DATA]:{...se}};if(W.value){const Ae=G(se,Me,ye,X,J);Object.assign(je,{[Be.ROW_SKIP_CFG]:Ae})}return H.value&&Object.assign(je,{[Be.ROW_SELECTION]:A(se,Me,ye)}),fe.value&&Object.assign(je,{[Be.ROW_INDEX]:ye}),ie.value&&Object.assign(je,{[Be.ROW_EXPAND]:j?b(Me):!1}),je});_.length=0,_.push(...Z),H.value&&V();return}_.length=0,_.push(...ae)},re=(j,J,X,ae)=>{const Z=A(X,X[Be.ROW_UID],ae);return j&&typeof J=="boolean"?J:Z},ve=j=>{if(W.value||H.value||ie.value||fe.value){let J=null;const X={};_.forEach((ae,Z)=>{const se=ae[Be.ROW_UID];if(ie.value&&Object.assign(ae,{[Be.ROW_EXPAND]:b(ae[Be.ROW_UID])}),W.value){const ye=G(ae,se,Z,X,J);J=ae[Be.ROW_UID],Object.assign(ae,{[Be.ROW_SKIP_CFG]:ye})}if(fe.value&&Object.assign(ae,{[Be.ROW_INDEX]:Z}),H.value){const ye=Cl(e,{row:ae,index:Z,isCheckAll:!1});Object.assign(ae,{[Be.ROW_SELECTION]:re(ye,j,ae,Z)})}}),H.value&&typeof j!="boolean"&&V();return}},G=(j,J,X,ae,Z)=>{let se=0;const ye=ae[Z]??{};return ae[J]||(ae[J]={}),n.forEach((Me,je)=>{var ze;const{colspan:Ae,rowspan:He}=g1(Me,je,j,X),ce=Me[Kn.COL_UID],be=((ze=ye[ce])==null?void 0:ze.skipRowLen)??0,Ie={[ce]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};se>0&&(Ie[ce].skipColLen=se,Ie[ce].skipCol=!0,se=se-1),be>1?(Ie[ce].skipRowLen=be-1,Ie[ce].skipRow=!0):He>1&&(Ie[ce].skipRowLen=He,Ie[ce].skipRow=!1),Ae>1&&(Ie[ce].skipColLen=Ae,se=Ae-1),Object.assign(ae[J],{...Ie})}),ae[J]},K=at.debounce(ve,120);a.watch([W,H,ie,fe],()=>{K()});const F=(j,J,X=!1)=>{if(e.asyncData&&e.rowKey){if(X)e.data.forEach(ae=>{at.has(ae,e.selectionKey)&&at.set(ae,e.selectionKey,!!J)});else if(at.has(j,e.selectionKey)){const ae=e.data.find(Z=>at.get(Z,e.rowKey)===at.get(j,e.rowKey));at.set(ae,e.selectionKey,!!J)}}},{fixedColumns:Q,resolveColumnStyle:Y,resolveColumnClass:ne,fixedWrapperClass:oe}=ef(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:C,indexData:_,fixedWrapperClass:oe,fixedColumns:Q,resolveColumnStyle:Y,resolveColumnClass:ne,initIndexData:de,updateIndexData:ve,setRowExpand:N,setAllRowExpand:S,updateColGroups:c,clearSelection:E,toggleAllSelection:k,toggleRowSelection:O,getSelection:()=>_.filter(j=>A(j)),clearSort:x}},ET=a.defineComponent({name:"Table",props:jL,emits:BL,setup(e,t){const n=ft("table");let i=null,s=null,o=null;const c=new AL,u=a.reactive([]),{initColumns:f}=Pc(e,u);a.provide(Xm,f),a.provide(qm,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:p,dragOffsetXStyle:y,dragOffsetX:C,reactiveSchema:b,indexData:x,fixedColumns:N,resolveColumnStyle:S,resolveColumnClass:M,setRowExpand:I,setAllRowExpand:L,initIndexData:T,fixedWrapperClass:V,clearSelection:k,toggleAllSelection:E,toggleRowSelection:O,getSelection:P,clearSort:A,updateColGroups:_}=OT(e,u),{pageData:W,localPagination:H,resolvePageData:ie,watchEffectFn:fe}=$L(e,x),{tableClass:de,headClass:re,contentClass:ve,footerClass:G,wrapperStyle:K,contentStyle:F,headStyle:Q,hasScrollYRef:Y,fixHeight:ne,updateBorderClass:oe,resetTableHeight:ge,getColumnsWidthOffsetWidth:ee,hasFooter:$}=jT(e,u,d,b,W),{resolveClassName:j}=Ce(),J=a.computed(()=>({hasScrollY:Y.value})),X=new ST(e,t,b,p,J,n),ae=()=>{const Je=d.value.querySelector(`.${j("table-body-content")}`),Ge=Je.querySelector("table");if(Ge){const Fe=Ge.scrollWidth,Xe=Je.clientWidth;m.value=Fe-Xe}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{T(e.reserveExpand),fe(o,i,s),a.nextTick(()=>{ge(d.value),oe(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Je=ee();Cd(d.value,p,20,Je),ae()}}),X.on(Vn.ON_SORT_BY_CLICK,Je=>{const{sortFn:Ge,column:Fe,index:Xe,type:Ve}=Je;typeof Ge=="function"&&(i=Ge,s=Fe,Object.assign(s,{[Kn.SORT_TYPE]:Ve}),ie(o,i,s)),t.emit(Ot.COLUMN_SORT,{column:a.unref(Fe[Kn.COL_SOURCE_DATA]),index:Xe,type:Ve})}).on(Vn.ON_FILTER_CLICK,Je=>{const{filterFn:Ge,checked:Fe,column:Xe,index:Ve}=Je;typeof Ge=="function"&&(o=Ge,ie(o,i,s)),t.emit(Ot.COLUMN_FILTER,{checked:Fe,column:a.unref(Xe[Kn.COL_SOURCE_DATA]),index:Ve})}).on(Vn.ON_SETTING_CHANGE,Je=>{const{checked:Ge=[],size:Fe,height:Xe,fields:Ve}=Je;a.nextTick(()=>{_({checked:Ge,fields:Ve}),oe(d.value);const vt=ee();Ge.length&&Cd(d.value,p,oa,vt),t.emit(Ot.SETTING_CHANGE,{checked:Ge,size:Fe,height:Xe,fields:Ve})})}).on(Vn.ON_ROW_EXPAND_CLICK,Je=>{const{row:Ge,column:Fe,index:Xe,rows:Ve,e:vt}=Je;t.emit(Ot.ROW_EXPAND_CLICK,{row:ks(Ge),column:y1(Fe),index:Xe,rows:Ve,e:vt}),I(Ge,!Ge[Be.ROW_EXPAND])}).on(Vn.ON_ROW_CHECK,({row:Je,isAll:Ge,index:Fe,value:Xe})=>{Ge?(E(Xe),t.emit(Ot.ROW_SELECT_ALL,{checked:Xe,data:e.data})):(O(Je,Xe),t.emit(Ot.ROW_SELECT,{row:ks(Je),index:Fe,checked:Xe,data:e.data})),t.emit(Ot.ROW_SELECT_CHANGE,{row:ks(Je),isAll:Ge,index:Fe,checked:Xe,data:e.data})});const Z=Je=>{const Ge=b.pos.bottom??0,Fe=Je[1],{translateX:Xe,translateY:Ve,pos:vt={}}=Fe;b.scrollTranslateY=Ve,b.scrollTranslateX=Xe,b.pos=vt;const{bottom:Hn}=vt;Hn<=2&&Ge>Hn&&Bs(60,()=>{t.emit(Ot.SCROLL_BOTTOM,{...vt,translateX:Xe,translateY:Ve})},!0)(),ae()},se=(Je={left:0,top:0})=>{var Ge,Fe;(Fe=(Ge=h.value)==null?void 0:Ge.scrollTo)==null||Fe.call(Ge,Je)};a.onMounted(()=>{if(e.observerResize){let Je=u1(d.value,()=>{if(!d.value)return;(e.height==="100%"||e.height==="auto")&&ge(d.value),oe(d.value);const Ge=ee();Cd(d.value,p,20,Ge)},180,!0,e.resizerWay);Je.start(),a.onBeforeUnmount(()=>{Je.disconnect(),Je=null})}}),a.onBeforeUnmount(()=>{X.destroy()});const ye=()=>d.value;t.expose({setRowExpand:I,setAllRowExpand:L,clearSelection:k,toggleAllSelection:E,toggleRowSelection:O,getSelection:P,clearSort:A,scrollTo:se,getRoot:ye});const Me=a.computed(()=>({...ve,"__is-empty":!W.length})),je=a.computed(()=>({[j("table-body-content")]:!0,[j("stripe")]:e.stripe,"with-virtual-render":e.virtualEnabled})),Ae={column_drag_line:!0,"offset-x":!0},He=a.computed(()=>({...y.value,left:`${C.value-b.scrollTranslateX}px`})),ce={"scroll-loading":!0,_bottom:!0},be=a.computed(()=>({[j("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),Ie={zIndex:-1,width:0,height:0,display:"none"},ze=a.computed(()=>({"--footer-height":$.value?`${e.paginationHeight}px`:"0"})),rt=a.computed(()=>({right:Y.value?`${_r}px`:0,"--fix-height":`${ne.value}px`,...ze.value})),{renderScrollLoading:nt}=GL(e,t),lt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),Tt=a.computed(()=>({"--prepend-left":`${b.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),ht=()=>t.slots.prepend?a.createVNode("div",{style:Tt.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Je,Ge;return a.createVNode("div",{class:de.value,style:K.value,ref:d},[a.createVNode("div",{class:re,style:Q.value},[X.renderTableHeadSchema()]),a.createVNode(Br,a.mergeProps({ref:h,lineHeight:X.getRowHeight,class:Me.value,style:F,list:W},lt.value,{contentClassName:je.value,onContentScroll:Z,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>ht(),default:Fe=>X.renderTableBodySchema(Fe.data||W),afterSection:()=>a.createVNode("div",{class:be.value},null)}),a.createVNode("div",{class:V,style:rt.value},[N.value.map(({isExist:Fe,colPos:Xe,column:Ve})=>Fe?"":a.createVNode("div",{class:M(Ve,b.scrollTranslateX,m.value),style:S(Xe)},null)),a.createVNode("div",{class:Ae,style:He.value},null),a.createVNode("div",{class:ce},[nt()])]),a.createVNode("div",{class:G.value,style:ze.value},[$.value&&X.renderTableFooter(H.value)]),a.createVNode("div",{style:Ie},[(Ge=(Je=t.slots).default)==null?void 0:Ge.call(Je)])])}}}),C1=Kt(ET,{Column:EL}),gr=12;function AT(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(s=[])=>{t.curPage=1,t.totalSize=s.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;const o=[];if(t.pageSize>0)for(let c=0;c<t.totalSize;c+=t.pageSize)o.push(s.slice(c,c+t.pageSize));t.renderListPaged.splice(0,t.renderListPaged.length,...o),t.curPageList.splice(0,t.curPageList.length,...t.renderListPaged[t.curPage-1]||[])},pageChange:s=>{t.curPage=s,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function PT(e){const{useGroup:t,saveKey:n,displayKey:i,list:s}=a.toRefs(e),o=a.ref([]),c=a.ref({});return a.watch([t,n,i,s],()=>{o.value=[];let u=a.markRaw(s.value);t.value&&(u=u.reduce((f,d)=>{let h=[];return d.children&&(h=d.children.map(m=>({group:{groupId:d[n.value],groupName:d[i.value]},...m}))),f.concat(h)},[])),o.value=u,c.value=u.reduce((f,d)=>(f[d[n.value]]=d,f),{})},{immediate:!0,deep:!0}),{flatList:o,saveKeyMap:c}}const r6=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)e.charCodeAt(i)&65280&&(n+=1),n+=1;return n},b1=(e,t,n)=>{a.watch([n,t],()=>{s()},{flush:"post"});const i=a.ref(null),s=()=>{t.value&&(i.value=null,setTimeout(()=>{const o=Array.from(e.value.querySelectorAll(".tag-item")),c=o.findIndex((u,f)=>f?o[f-1].offsetTop!==u.offsetTop:!1);i.value=c>0?c-1:null}))};return{overflowTagIndex:i}},s6=a.defineComponent({name:"ListTagRender",props:{node:v.object,searchKey:v.oneOfType([v.string,v.arrayOf(v.string)]),displayKey:v.string,searchKeyword:v.string,tpl:{type:Function}},render(){const{resolveClassName:e}=Ce(),t=i=>{if(this.searchKeyword){const s=new RegExp(`(${this.searchKeyword})`,"i");return i.replace(s,'<strong class="highlight-text">$1</strong>')}return i};if(this.tpl)return this.tpl(this.node,t,a.h,this);const n=this.node[this.displayKey];return a.createVNode("div",{class:`${e("selector-node")}`},[a.createVNode("span",{class:"text",innerHTML:t(n)},[n])])}}),zT=()=>({modelValue:v.arrayOf(v.string).def([]),placeholder:v.string.def(""),list:v.arrayOf(v.object).def([]),disabled:v.bool.def(!1),tooltipKey:v.string.def(""),saveKey:v.string.def("id"),displayKey:v.string.def("name"),hasDeleteIcon:v.bool.def(!1),clearable:v.bool.def(!0),trigger:Se("treeTriggerType",{}).def("search"),searchKey:v.oneOfType([v.string,v.arrayOf(v.string)]).def("name"),useGroup:v.bool.def(!1),allowCreate:v.bool.def(!1),maxData:v.number.def(-1),maxResult:v.number.def(10),contentMaxHeight:v.number.def(300),contentWidth:v.number.def(190),separator:v.string.def(""),allowNextFocus:v.bool.def(!0),allowAutoMatch:v.bool.def(!1),showClearOnlyHover:v.bool.def(!1),isAsyncList:v.bool.def(!1),leftSpace:v.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}}),VT=a.defineComponent({name:"TagRender",directives:{bkTooltips:Ka},props:{node:v.object,displayKey:v.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}},setup(e){const t=a.ref(),n=a.ref(!1),i=a.computed(()=>({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!n.value,...e.tagOverflowTips}));return a.onMounted(()=>{n.value=l8(t.value)}),{overflowTips:i,tagRef:t}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.withDirectives(a.createVNode("div",{class:"tag",ref:"tagRef"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])]),[[a.resolveDirective("bk-tooltips"),this.overflowTips]])}}),RT=a.defineComponent({name:"TagInput",directives:{bkTooltips:Ka},props:zT(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=ei(),i=ft("tagInput"),s=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),o=a.reactive({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0},...e.popoverProps}),{resolveClassName:c}=Ce(),{maxResult:u}=a.toRefs(e),{pageState:f,initPage:d,pageChange:h}=AT(u),m=a.ref(""),p=a.ref(null),y=a.ref(null),C=a.ref(null),b=a.ref(null),x=a.ref(null),N=a.ref(null),S=a.computed(()=>!e.disabled&&e.hasDeleteIcon),M=a.computed(()=>e.maxData===1),I=a.computed(()=>k.selectedTagList.length===0&&m.value===""&&!s.isEdit),L=a.computed(()=>e.placeholder||i.value.placeholder),T=a.computed(()=>e.clearable&&!e.disabled&&k.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),V=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),k=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),E=a.computed(()=>k.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:O,saveKeyMap:P}=PT(e),A=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((be,Ie)=>{be.__index__=Ie,ce[be.group.groupId]||(ce[be.group.groupId]={id:be.group.groupId,name:be.group.groupName,children:[]}),ce[be.group.groupId].children.push(be)}),Object.keys(ce).map(be=>ce[be])}return f.curPageList});a.watch([()=>O.value],()=>{a.nextTick(()=>{fe()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var be;ve(E.value,ce)||(a.nextTick(()=>{fe()}),e.withValidate&&((be=n==null?void 0:n.validate)==null||be.call(n,"change")))}),a.watch(m,at.debounce(()=>{const ce=f.curPageList.length!==0,{value:be}=m;be!==""&&ce||be===""&&e.trigger==="focus"&&ce?o.isShow=!0:(e.trigger!=="focus"||!ce)&&(o.isShow=!1)},150)),a.watch(()=>o.isShow,ce=>{_(),ce&&x.value&&(a.nextTick(()=>{x.value.scrollTop=0}),x.value.removeEventListener("scroll",W),x.value.addEventListener("scroll",W))}),a.onMounted(()=>{fe()});const _=()=>{var ce;o.offset.crossAxis=M.value?0:(ce=b.value)==null?void 0:ce.offsetLeft},W=()=>{if(f.isPageLoading||x.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:be,scrollHeight:Ie}=x.value;if(ce+be>=Ie){const ze=f.curPage+1;ze<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(ze)},500))}},H=()=>{var be;return Array.from(((be=C.value)==null?void 0:be.childNodes)||[]).filter(Ie=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Ie.nodeType))},ie=ce=>{if(!e.disabled){if(ce!=null&&ce.target){const{className:be}=ce.target;(be.indexOf(`${c("tag-input-trigger")}`)>-1||be.indexOf("tag-list")>-1)&&C.value.appendChild(b.value)}clearTimeout(N.value),M.value&&E.value.length&&(k.tagListCache=[...E.value],k.selectedTagListCache=[...k.selectedTagList],m.value=k.selectedTagListCache[0][e.saveKey],je(k.selectedTagList[0],0),Y()),s.isEdit=!0,setTimeout(()=>{var be;(be=p.value)==null||be.focus(),e.trigger==="focus"&&k.localList.length!==0&&(de(),o.isShow?_():o.isShow=!0)},200)}},fe=()=>{const{saveKey:ce,modelValue:be,displayKey:Ie,allowCreate:ze,trigger:rt,isAsyncList:nt}=e;if(k.selectedTagList=[],k.localList=O.value,be.length){const lt={};k.selectedTagList=be.map(Tt=>{const ht=P.value[Tt];return lt[Tt]=1,!ht&&ze?{[ce]:Tt,[Ie]:Tt}:ht}).filter(Tt=>Tt),M.value||(k.localList=k.localList.filter(Tt=>!lt[Tt[ce]]))}if(nt&&m.value){de(m.value),f.curPageList.length&&(o.isShow=!0);return}rt==="focus"&&de()},de=(ce="")=>{const{searchKey:be,filterCallback:Ie}=e,ze=ce.toLowerCase().trim();if(ze===""){d(k.localList);return}let rt=[];typeof Ie=="function"?rt=Ie(ze,be,k.localList)||[]:Array.isArray(be)?rt=k.localList.filter(nt=>be.some(lt=>nt[lt].toLowerCase().indexOf(ze)>-1)):rt=k.localList.filter(nt=>nt[be].toLowerCase().indexOf(ze)>-1),d(rt)},re=(ce,be)=>{const Ie={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:E.value.includes(ce[e.saveKey])};return e.useGroup?Ie[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Ie[`${c("selector-actived")}`]=be===s.focusItemIndex,Ie};function ve(ce,be){return ce.length!==be.length?!1:be.every((Ie,ze)=>ce[ze]===Ie)}const G=()=>{k.tagListCache=[],k.selectedTagListCache=[],k.selectedTagList=[]},K=()=>{m.value=""},F=()=>{if(M.value)return 0;const be=H().findIndex(({id:Ie})=>Ie==="tagInputItem");return be>=0?be:0},Q=(ce,be,Ie=!1)=>{if(!be||!ce)return;let ze=be;Ie&&(ze=be.nextElementSibling||null),be.parentNode.insertBefore(ce,ze)},Y=ce=>{const{maxData:be,trigger:Ie,allowCreate:ze}=e;if(be===-1||be>E.value.length){const{value:rt}=ce!=null&&ce.target?ce.target:m,nt=r6(rt);nt?(de(rt),p.value.style.width=`${nt*gr}px`):Ie==="focus"&&de()}else oe(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=ze?-1:0,t("input",m.value)},ne=()=>{var ce;o.width=M.value?(ce=y.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},oe=()=>{N.value=setTimeout(()=>{var be;const ce=m.value;if(K(),s.isEdit=!1,M.value){const[Ie]=k.tagListCache;ce&&ce===Ie&&k.selectedTagListCache.length?Me(k.selectedTagListCache[0],"select"):$("remove")}else if(e.allowAutoMatch&&ce){const Ie=f.curPageList.find(ze=>Array.isArray(e.searchKey)?e.searchKey.map(nt=>ze[nt]).includes(ce):ze[e.searchKey]===ce);Ie?ge(Ie,"select"):e.allowCreate&&ge(ce,"custom")}o.isShow=!1,t("blur",ce,E.value),(be=n==null?void 0:n.validate)==null||be.call(n,"blur")},200)},ge=(ce,be,Ie)=>{Ie==null||Ie.stopPropagation(),!(!ce||ce.disabled)&&(M.value&&G(),Me(ce,be),$("select"),K(),o.isShow=!1)},ee=(ce,be,Ie)=>{Ie==null||Ie.stopPropagation(),je(ce,be),K(),$("remove",ce),p.value.style.width=`${gr}px`},$=(ce,be)=>{t(ce,be),t("update:modelValue",E.value),t("change",E.value)},j=ce=>{ce.stopPropagation();const be=k.selectedTagList;k.selectedTagList=[];const Ie=be.filter(ze=>P.value[ze[e.saveKey]]);(e.allowCreate&&Ie.length!==0||!e.allowCreate)&&!M.value&&k.localList.push(...Ie),$("removeAll")},J=()=>{const ce={height:x.value.clientHeight,yAxis:x.value.getBoundingClientRect().y};a.nextTick(()=>{const be=x.value.querySelector(`.${c("selector-actived")}`);if(!be)return;const Ie={height:be.clientHeight,yAxis:be.getBoundingClientRect().y};Ie.yAxis<ce.yAxis&&(x.value.scrollTop=x.value.scrollTop-(ce.yAxis-Ie.yAxis));const ze=Ie.yAxis+Ie.height-ce.yAxis;ze>ce.height&&(x.value.scrollTop=x.value.scrollTop+ze-ce.height)})},X=(ce,be)=>{const Ie=H();Q(b.value,Ie[ce-1]),k.selectedTagList.splice(ce-1,1),ie();const ze=P.value[be[e.saveKey]];(e.allowCreate&&ze||!e.allowCreate)&&!M.value&&k.localList.push(be),p.value=`${gr}px`,$("remove")},ae=ce=>{if(f.isPageLoading)return;let be;const Ie=ce.target.value,ze=r6(Ie),rt=F(),nt=H();switch(ce.code){case"ArrowUp":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex-1,s.focusItemIndex=s.focusItemIndex<0?-1:s.focusItemIndex,s.focusItemIndex===-1&&(s.focusItemIndex=f.curPageList.length-1),J();break;case"ArrowDown":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex+1,s.focusItemIndex=s.focusItemIndex>f.curPageList.length-1?f.curPageList.length:s.focusItemIndex,s.focusItemIndex===f.curPageList.length&&(s.focusItemIndex=0),J();break;case"ArrowLeft":if(s.isEdit=!0,!ze){if(rt<1)return;Q(b.value,nt[rt-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!ze){if(rt===nt.length-1)return;Q(nt[rt+1],b.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?ge(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&ge(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":rt!==0&&!m.value&&(be=k.selectedTagList[rt-1],X(rt,be));break}},Z=ce=>{const be=[],Ie=ce.split(";"),ze=/^[a-zA-Z][a-zA-Z_]*/g;return Ie.forEach(rt=>{const nt=rt.match(ze);if(nt){const lt=nt.join("");be.push({[e.saveKey]:lt,[e.displayKey]:lt})}}),be},se=ce=>{if(ce.preventDefault(),M.value)return!1;const{maxData:be,saveKey:Ie,displayKey:ze,pasteFn:rt,allowCreate:nt}=e,lt=ce.clipboardData.getData("text");let ht=(rt?rt(lt):Z(lt)).map(Je=>Je[Ie]);if(ht.length){const Je=H(),Ge=F(),Fe=k.localList.map(Ve=>Ve[Ie]);if(ht=ht.filter(Ve=>{const vt=(Ve==null?void 0:Ve.trim())&&!E.value.includes(Ve);return nt?vt:vt&&Fe.includes(Ve)}),be!==-1){const Ve=k.selectedTagList.length;if(Ve<be){const vt=be-Ve;ht.length>vt&&(ht=[...ht.slice(0,vt)])}else ht=[]}const Xe=nt?ht.map(Ve=>k.localList.find(Hn=>Hn[Ie]===Ve)??{[Ie]:Ve,[ze]:Ve}):k.localList.filter(Ve=>ht.includes(Ve[Ie]));ht.length&&(k.selectedTagList.splice(Ge,0,...Xe),Q(b.value,Je[Ge]),p.value.style.width=`${gr}px`,k.localList=k.localList.filter(Ve=>!ht.includes(Ve[Ie])),$("select"),ie())}},ye=ce=>{e.disabled||(Q(b.value,ce.currentTarget,!0),p.value.style.width=`${gr}px`,o.isShow&&_())},Me=(ce,be)=>{if(k.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Ie,saveKey:ze,displayKey:rt,createTagValidator:nt}=e,lt=F();let Tt=1,ht=!1,Je;const Ge=Fe=>typeof nt=="function"?nt(Fe):!0;if(be==="custom")if(Ie){let Fe=ce.split(Ie);Fe=Fe.filter(Ve=>(Ve==null?void 0:Ve.trim())&&!E.value.includes(Ve)&&Ge(Ve));const Xe=Fe.map(Ve=>P.value[Ve]||{[ze]:Ve,[rt]:Ve});Fe.length&&(k.selectedTagList.splice(lt,0,...Xe),Tt=Xe.length,ht=!0)}else{const Fe=typeof ce=="object";if(Je=Fe?ce[ze]:ce.trim(),Je=Je.replace(/\s+/g,""),Je!==void 0&&!E.value.includes(Je)&&Ge(Je)){const Xe=P.value[Je]||(Fe?ce:{[ze]:Je,[rt]:Je});k.selectedTagList.splice(lt,0,Xe),ht=!0}}else ce&&(Je=ce[ze],Je!==void 0&&!E.value.includes(Je)&&(k.selectedTagList.splice(lt,0,ce),ht=!0));ht&&a.nextTick(()=>{for(let Fe=1;Fe<=Tt;Fe++){const Ve=H()[lt+Fe];Q(Ve,b.value)}if(p.value.style.width=`${gr}px`,!M.value){e.allowNextFocus&&ie();const Fe=E.value.reduce((Xe,Ve)=>(Xe[Ve]=1,Xe),{});k.localList=k.localList.filter(Xe=>!Fe[Xe[ze]])}})},je=(ce,be)=>{k.selectedTagList.splice(be,1);const Ie=P.value[ce[e.saveKey]];(e.allowCreate&&Ie||!e.allowCreate)&&!M.value&&k.localList.push(ce)},Ae=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:He}=b1(y,Ae,E);return{popoverProps:o,...a.toRefs(s),...a.toRefs(k),...a.toRefs(f),isShowPlaceholder:I,isShowClear:T,placeholderText:L,curInputValue:m,renderList:A,showTagClose:S,tagInputRef:p,bkTagSelectorRef:y,tagListRef:C,tagInputItemRef:b,selectorListRef:x,triggerClass:V,overflowTagIndex:He,localCollapseTags:Ae,focusInputTrigger:ie,activeClass:re,handleInput:Y,handleFocus:ne,handleBlur:oe,handleTagSelected:ge,handleTagRemove:ee,handleClear:j,tagFocus:ye,handleKeydown:ae,handlePaste:se,resolveClassName:c}},render(){return a.createVNode("div",{class:`${this.resolveClassName("tag-input")}`,ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Ut,a.mergeProps({theme:`light ${this.resolveClassName("tag-input-popover-content")}`,trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:()=>{var e,t;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((n,i)=>{const s={boundary:"window",theme:"light",distance:12,content:n[this.tooltipKey],disabled:!this.tooltipKey},o=this.localCollapseTags&&this.overflowTagIndex&&i>=this.overflowTagIndex;return a.withDirectives(a.createVNode("li",{class:"tag-item",style:{display:o?"none":""},onClick:this.tagFocus},[a.createVNode(VT,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(gn,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,n,i)},null):null]),[[a.resolveDirective("bk-tooltips"),s]])}),a.withDirectives(a.createVNode("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[a.withDirectives(a.createVNode("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":n=>this.curInputValue=n,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]]),!!this.overflowTagIndex&&this.localCollapseTags&&a.createVNode("li",{class:"tag-item"},[a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[a.createTextVNode("+"),this.selectedTagList.length-this.overflowTagIndex])])])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholderText]),[[a.vShow,this.isShowPlaceholder]]),((t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))??(this.isShowClear&&a.createVNode(mn,{class:"clear-icon",onClick:this.handleClear},null))])},content:()=>a.createVNode("div",{class:`${this.resolveClassName("selector-list")}`},[a.createVNode("ul",{ref:"selectorListRef",style:{"max-height":`${this.contentMaxHeight}px`},class:"outside-ul"},[this.renderList.map((e,t)=>this.useGroup?a.createVNode("li",{class:`${this.resolveClassName("selector-group-item")}`},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:`${this.resolveClassName("selector-group-list-item")}`},[e.children.map((n,i)=>a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(s6,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(s6,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:`${this.resolveClassName("selector-list-item")} loading`},[a.createVNode(ua,{theme:"primary",size:_a.Small},null)]):null])])})])}}),w1=Ue(RT),JT={direction:zg(),align:zd().def(Sl.CENTER),color:v.string.def("#dde4eb"),width:v.number.def(1),type:Vg()},_T=a.defineComponent({name:"Divider",props:JT,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`},{resolveClassName:t}=Ce();let n;return this.$slots.default&&(n=a.createVNode("div",{class:[t("divider-info"),t(`divider-info-${this.align}`)]},[this.$slots.default()])),a.createVNode("div",{class:[t("divider"),t(`divider-${this.direction}`)],style:e()},[n])}}),N1=Ue(_T);var Jl=(e=>(e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab",e.CARD_GRID="card-grid",e))(Jl||{}),Ds=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(Ds||{});const M1=Se("position",{}).def("top");var I1=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(I1||{});const L1=Se("sortType",{}).def("replace"),QT={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},WT={name:v.oneOfType([v.number,v.string]).def(""),label:v.string||v.func,tips:v.string,closable:v.bool,visible:v.bool.def(!0),disabled:v.bool,sortable:v.bool,renderDirective:Sf(),panel:v.string||v.func},HT={active:v.oneOfType([v.number,v.string]).def(""),type:Se("type",{}).def("border-card"),tabPosition:M1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:L1,labelHeight:v.number.def(50),scrollStep:v.number.def(200),extCls:v.string.def(""),validateActive:v.bool.def(!0),showHeader:v.bool.def(!0),changeOnHover:v.bool.def(!1),changeOnHoverDelay:v.number.def(1e3),activeBarSize:v.number.def(2),activeBarColor:v.string.def("#3a84ff")},FT={active:v.oneOfType([v.number,v.string]).def(""),type:Se("type",{}).def("border-card"),activeBarColor:v.string.def("#3a84ff"),activeBarSize:v.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:M1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:L1,labelHeight:v.number.def(50),scrollStep:v.number.def(200),validateActive:v.bool.def(!0),changeOnHover:v.bool.def(!1),changeOnHoverDelay:v.number.def(1e3),...QT},o6=a.defineComponent({name:"TabNav",directives:{bkTooltips:Ka},props:FT,setup(e){const t=a.ref(null),n=a.computed(()=>{const h={width:0,height:0,bottom:0,left:0};if(!t.value)return h;if([Ds.LEFT,Ds.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:p}=t.value,y={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${p}px`,background:e.activeBarColor};return e.tabPosition===Ds.LEFT?y.right=0:y.left=0,y}if(e.type===Jl.UNBORDER_CARD){const{clientWidth:m,offsetLeft:p}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${p}px`,bottom:0,background:e.activeBarColor}}return h}),i=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const h=[];let m=!1;return e.panels.filter((p,y)=>{if(!p.props)return null;const{name:C,label:b,closable:x,visible:N,disabled:S,sortable:M,tips:I}=p.props;if(!N)return!1;e.active===C&&(m=!0);const L=T=>p.slots.label?a.h(p.slots.label):[void 0,""].includes(T)?`选项卡${y+1}`:typeof T=="string"?T:typeof T=="function"?a.h(T):T;return h.push({name:C,closable:x,visible:N,disabled:S,sortable:M,tips:I,tabLabel:L(b)}),!0}),!m&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),h}),s=a.ref(-1),o=a.ref(-1),c=a.ref(""),u=(h,m)=>h===m,f={handleTabAdd(h){e.tabAdd(h)},dragstart(h,m){o.value=h,c.value=e.guid,Object.assign(m.dataTransfer,{effectAllowed:"move"}),e.tabDrag(h,m)},dragenter(h){u(c.value,e.guid)&&(s.value=h)},dragend(){s.value=-1,o.value=-1,c.value=null},drop(h,m){if(!u(c.value,e.guid))return!1;e.tabSort(o.value,h,m)},handleTabChange(h){e.tabChange(h)},handleTabRemove(h,m){e.tabRemove(h,m)}},{resolveClassName:d}=Ce();return{...f,activeRef:t,activeBarStyle:n,navs:i,dragenterIndex:s,dragStartIndex:o,draggingEle:c,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4),resolveClassName:d}},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:s,labelHeight:o,dragstart:c,dragenter:u,dragend:f,drop:d}=this,h=()=>this.navs.map((b,x)=>{if(!b)return null;const{name:N,disabled:S,tabLabel:M}=b,I=()=>{const T=[this.resolveClassName("tab-header-item")];return S&&T.push(this.resolveClassName("tab-header--disabled")),e===N&&T.push(this.resolveClassName("tab-header--active")),T.join(" ")},L=(T,V)=>!S&&(T||V);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!S&&this.handleTabChange(N),draggable:L(b.sortable,i),onDragstart:T=>c(x,T),ref:e===N?"activeRef":"",onDragenter:T=>{T.preventDefault(),u(x)},onDragleave:T=>{T.preventDefault()},onDragover:T=>{T.preventDefault()},onDragend:T=>{T.preventDefault(),f()},onDrop:T=>{T.preventDefault(),d(x,s)},class:I()},[a.createVNode("div",null,[M]),L(b.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(x,b)},[a.createVNode(mn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:b.tips,disabled:!b.tips}]])}),m=()=>{var x,N;const b=[];return typeof this.$slots.add=="function"?b.push((N=(x=this.$slots).add)==null?void 0:N.call(x,a.h)):n&&b.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(qs,{style:"display:flex;",width:26,height:26},null)])),b.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[b.map((S,M)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:M},[S]))]):null},p=()=>this.type===Jl.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",y=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,C=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),C||y?"tab-header-auto":""]},[p(),h()]),C,y])}}),BT=a.defineComponent({name:"Tab",components:{TabNav:o6},props:HT,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup(e,{slots:t,emit:n}){const i=a.ref(!1),s=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:p}=h;return(p||[]).forEach(y=>{let{type:C}=y;C=C.name||C,C==="TabPanel"&&y.component?m.push(y.component):(C===a.Fragment||C==="template")&&c(y,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],p=c(m);p.length!==s.value.length&&(s.value=p)}};a.onMounted(()=>{u(),i.value=!0,a.onUpdated(()=>{u()})});const f={tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,p){const y=s.value;if(p===I1.INSERT)if(h<m)y.splice(m+1,0,s[h]),y.splice(h,1);else if(h>m)y.splice(m,0,s[h]),y.splice(h+1,1);else return!1;else{const C=y[m];y[m]=y[h],y[h]=C}s.value=[...y],n("sort",h,m,p),n("sort-change",h,m,p)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}},{resolveClassName:d}=Ce();return{...f,isMounted:i,panels:s,resolveClassName:d}},render(){var n,i;const e=()=>{const s=[this.resolveClassName("tab"),this.extCls];return this.tabPosition===Ds.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Jl.CARD_TAB&&s.push(this.resolveClassName("tab--vertical-tab"))),s},t=()=>{const{panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:p,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:x,activeBarSize:N,activeBarColor:S,tabAdd:M,tabChange:I,tabRemove:L,tabSort:T,tabDrag:V}=this,k={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:p,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:x,activeBarSize:N,activeBarColor:S,tabAdd:M,tabChange:I,tabRemove:L,tabSort:T,tabDrag:V};return!s||!Array.isArray(s)?null:a.createVNode(o6,k,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:this.resolveClassName("tab-content")},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),$T=a.defineComponent({name:"TabPanel",props:WT,render(){const e=this.name===this.$parent.active,t=()=>!this.visible||this.renderDirective==="if"&&!e?null:typeof this.panel=="function"?this.panel(a.h):typeof this.$slots.default=="function"?this.$slots.default(null):typeof this.$slots.panel=="function"?this.$slots.panel(null):null,{resolveClassName:n}=Ce();return a.withDirectives(a.createVNode("div",{ref:"content",class:n("tab-panel")},[t()]),[[a.vShow,e]])}}),T1=Kt(BT,{TabPanel:$T}),Ei={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let l6=1;const x1=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const s=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:u=10}=n;Ei[i].forEach(p=>{c+=(p.el.offsetHeight||0)+u}),l6+=1;const f=`message_${l6}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=p=>{GT(p,i,u,s),a.render(null,d)},h.props.onDetail=(p,y)=>{Ei[i].forEach(C=>{var b,x;C.props.id!==y&&((x=(b=C.component)==null?void 0:b.exposed)==null||x.setDetailsShow(null,!1))})},a.render(h,d),Ei[i].push(h);let m;h.props.getContainer&&Ra(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function GT(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;Ei[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=Ei[t][o].el.offsetHeight,f=Ei[t].length;for(let d=o;d<f;d++){const h=parseInt(Ei[t][d].el.style[s],10)-u-n;Ei[t][d].component.props.offsetY=h}Ei[t].splice(o,1)}var S1={exports:{}};/*!
|
66
|
+
`,E={d:k,stroke:m||"#f5f5f5","stroke-linecap":f,"stroke-width":y,"fill-opacity":"0",class:"process-circle-trail",style:T},O={d:k,stroke:u||"#13ce66","stroke-linecap":f,"stroke-width":o>0&&y||0,"fill-opacity":"0",class:`process-circle-path ${i(`${d}-circle-trail`)}`,style:V};return a.createVNode("div",{class:"progress-outer-circle",style:b},[a.createVNode("svg",{viewBox:"0 0 100 100"},[a.createVNode("path",E,null),a.createVNode("path",O,null)]),a.createVNode("span",{class:"progress-circle-text",style:p},[n==null?void 0:n.default()])])},WI=(e,{attrs:t,slots:n})=>{const{resolveClassName:i}=Ce(),{percent:s,strokeWidth:o,size:c,color:u,titleStyle:f,showText:d,textInside:h,theme:m}=t,p={height:`${o}px`,lineHeight:`${o}px`},y={width:`${s}%`,background:u,animationDuration:"3s"},C=(b=!0)=>(d||n.default)&&(b&&h||!b&&!h)?n==null?void 0:n.default():null;return a.createVNode("div",{class:"progress-outer"},[a.createVNode("div",{class:`${i(`progress-${c||"normal"}`)} progress-bar`,style:p},[a.createVNode("div",{style:y,class:{"progress-inner":!0,[`${i(`${m}`)}`]:!0}},[a.createVNode("div",{class:"inner-text",style:f},[C()])])]),C(!1)])};function $3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const HI={extCls:v.string,type:Uw(),percent:v.number.def(0),theme:v.theme().def(Xl.PRIMARY),size:v.size(),width:v.number.def(126),strokeWidth:v.number,strokeLinecap:Yw(),textInside:v.bool.def(!1),showText:v.bool.def(!0),color:v.string,bgColor:v.string,fixed:v.number.validate(e=>e>=0&&e<=20).def(0),format:v.func.def(e=>`${e}%`),titleStyle:v.object.def({fontSize:"16px",verticalAlign:"middle"})},FI=a.defineComponent({name:"Progress",props:HI,setup(){const{resolveClassName:e}=Ce();return{resolveClassName:e}},methods:{validPercent(e){return!e||e<0?0:e>100?100:e},renderProcessInfo(){var u;const{showText:e,format:t,percent:n,textInside:i,titleStyle:s,fixed:o}=this.$props,c=t((u=this.validPercent(n))==null?void 0:u.toFixed(o));return(e||this.$slots.default)&&i?this.$slots.default?this.$slots.default():a.createVNode("span",null,[c]):!e||i?null:a.createVNode("span",{class:"progress-text",style:typeof c=="string"?s:void 0},[this.$slots.default?this.$slots.default():c])}},render(){const e=this.renderProcessInfo(),t={...this.$props,percent:this.validPercent(this.percent)};let n=a.createVNode(WI,t,$3(e)?e:{default:()=>[e]});(this.type==="circle"||this.type==="dashboard")&&(n=a.createVNode(QI,t,$3(e)?e:{default:()=>[e]}));const i={class:Pe({extCls:!!this.extCls},`${this.resolveClassName("progress")} ${this.resolveClassName(`progress-${this.type}`)}`)};return a.createVNode("div",i,[n])}}),Js=Ue(FI),zm=Symbol("RadioGroup");function Vm(){const e=a.ref(!1);return[e,{blur:()=>{e.value=!1},focus:()=>{e.value=!0}}]}const Rm=()=>{const e=a.getCurrentInstance(),{props:t,emit:n}=e,i=a.inject(zm,_g),s=!Qg(i),o=a.ref(!1),c=a.computed(()=>s&&i.props.disabled?!0:t.disabled);s?a.watch(()=>i.props.modelValue,d=>{o.value=d===t.label},{immediate:!0}):a.watch(()=>t.modelValue,d=>{d!==""&&(o.value=d===t.label)},{immediate:!0});const u=(d=!0)=>{o.value=d},f=d=>{if(c.value)return;const h=d.target;o.value=h.checked;const m=o.value?t.label:"";n("update:modelValue",m),n("change",m),s&&i.handleChange(e.proxy),a.nextTick(()=>{h.checked!==o.value&&(h.checked=o.value)})};return a.onMounted(()=>{s&&i.register(e.proxy)}),a.onBeforeUnmount(()=>{s&&i.unregister(e.proxy)}),{isChecked:o,isDisabled:c,setChecked:u,handleChange:f}},BI={name:v.string.def(""),label:v.oneOfType([String,Number,Boolean]).isRequired,modelValue:v.oneOfType([String,Number,Boolean]).def(""),checked:v.bool.def(!1),disabled:v.bool.def(!1)},$I=a.defineComponent({name:"Radio",props:BI,emits:{"update:modelValue":e=>e!==void 0,change:e=>e!==void 0},setup(){const[e,{blur:t,focus:n}]=Vm(),{isChecked:i,isDisabled:s,setChecked:o,handleChange:c}=Rm(),{resolveClassName:u}=Ce();return{isFocused:e,isChecked:i,isDisabled:s,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c,resolveClassName:u}},render(){const e=Pe({[`${this.resolveClassName("radio")}`]:!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked}),t=()=>!this.label&&!this.$slots.default?null:a.createVNode("span",{class:`${this.resolveClassName("radio-label")}`},[this.$slots.default?this.$slots.default():this.label]);return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:`${this.resolveClassName("radio-input")}`,type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),t()])}}),GI={name:v.string.def(""),label:v.oneOfType([String,Number,Boolean]).isRequired,modelValue:v.oneOfType([String,Number,Boolean]).def(""),checked:v.bool.def(!1),disabled:v.bool.def(!1),size:v.size()},ZI=a.defineComponent({name:"RadioButton",props:GI,emits:{"update:modelValue":e=>e!==void 0,change:e=>e!==void 0},setup(){const[e,{blur:t,focus:n}]=Vm(),{isChecked:i,isDisabled:s,setChecked:o,handleChange:c}=Rm(),{resolveClassName:u}=Ce();return{isFocused:e,isChecked:i,isDisabled:s,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c,resolveClassName:u}},render(){const e=Pe({[`${this.resolveClassName("radio-button")}`]:!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked}),t=()=>!this.label&&!this.$slots.default?null:a.createVNode("div",{class:`${this.resolveClassName("radio-button-label")}`},[this.$slots.default?this.$slots.default():this.label]);return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:`${this.resolveClassName("radio-button-input")}`,type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),t()])}}),YI={name:v.string.def(""),modelValue:v.oneOfType([String,Number,Boolean]),disabled:v.bool,withValidate:v.bool.def(!0),type:v.oneOf(["tab","capsule","card"]).def("tab")},UI=a.defineComponent({name:"RadioGroup",props:YI,emits:{"update:modelValue":e=>e!==void 0,change:e=>e!==void 0},setup(e,t){const n=ei(),i=[],s=f=>{i.push(f)},o=f=>{const d=i.indexOf(f);d>-1&&i.splice(d,1)},c=f=>{const d=f.label;i.forEach(h=>{h!==f&&h.setChecked(!1)}),t.emit("update:modelValue",d),t.emit("change",d)};a.provide(zm,{props:e,register:s,unregister:o,handleChange:c}),a.watch(()=>e.modelValue,()=>{var f;e.withValidate&&((f=n==null?void 0:n.validate)==null||f.call(n,"change"))}),a.onMounted(()=>{e.modelValue!==""&&i.forEach(f=>{f.setChecked(f.label===e.modelValue)})});const{resolveClassName:u}=Ce();return{resolveClassName:u}},render(){var e;return a.createVNode("div",{class:[`${this.resolveClassName("radio-group")}`,`${this.resolveClassName(`radio-${this.type}`)}`]},[(e=this.$slots)==null?void 0:e.default()])}}),Jm=Kt($I,{Group:UI,Button:ZI}),rl=a.defineComponent({name:"Star",props:{rate:v.number.def(0),width:v.number.def(15),height:v.number.def(16),editable:v.bool.def(!0),hoverRate:v.number.def(0),max:v.number.def(5)},emits:["chooseRate","changeHover"],setup(e,{emit:t}){const n=f=>{if(!e.editable)return;const d=f+1;t("chooseRate",d)},i=f=>{if(!e.editable)return;const d=f+1;t("changeHover",d)},{resolveClassName:s}=Ce(),o=f=>Pe({[`${s("is-select")}`]:f<Math.floor(c.value),[`${s("is-edit")}`]:e.editable,[`${s("rate-star")}`]:!0}),c=a.computed(()=>e.hoverRate||e.rate),u={width:`${e.width}px`,height:`${e.height}px`,minWidth:`${e.width}px`};return()=>a.createVNode("p",{class:`${s("rate-stars")}`},[Array(e.max).fill(1).map((f,d)=>a.createVNode("svg",{class:o(d),style:u,x:"0px",y:"0px",viewBox:"0 0 64 64",onClick:()=>n(d),onMouseenter:()=>i(d)},[a.createVNode("g",{transform:"translate(-143.000000, -635.000000)"},[a.createVNode("g",{transform:"translate(83.000000, 114.000000)"},[a.createVNode("g",{transform:"translate(15.000000, 384.000000)"},[a.createVNode("g",{transform:"translate(29.000000, 137.000000)"},[a.createVNode("polygon",{class:"st1",points:"48,53 28.2,63.9 32,40.8 16,24.4 38.1,21 48,-0.1 57.8,21 79.9,24.4 63.9,40.8 67.7,63.9"},null)])])])])]))])}}),KI=a.defineComponent({name:"Rate",components:{star:rl},props:{modelValue:v.number.def(0),size:v.size(),editable:v.bool.def(!0),withValidate:v.bool.def(!0)},emits:["change","hover-change","update:modelValue"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ei(),s=a.ref(0),o=p=>{e.editable&&(t("update:modelValue",p),t("change",p))},c=p=>{s.value=p,t("hover-change",p)},u=Pe({[`${n("rate")}`]:!0}),d={small:{width:12,height:12},large:{width:18,height:18}}[e.size]||{width:15,height:16},h=a.computed(()=>{const p=Math.floor(e.modelValue),y=(d.width+3)*p,C=d.width*(e.modelValue-p);return{width:`${y+C}px`}}),m={width:d.width,height:d.height};return a.watch(()=>e.modelValue,()=>{var p;e.withValidate&&((p=i==null?void 0:i.validate)==null||p.call(i,"change"))}),()=>a.createVNode("p",{class:u},[e.editable?a.createVNode(rl,a.mergeProps({rate:e.modelValue,"hover-rate":s.value,onChooseRate:o,onChangeHover:c,onMouseleave:()=>c(0)},m),null):[a.createVNode(rl,a.mergeProps({rate:5,style:h.value,class:`${n("score-real")}`,editable:!1},m),null),a.createVNode(rl,a.mergeProps({rate:0,editable:!1},m),null)]])}}),_m=Ue(KI),XI=a.defineComponent({name:"Swiper",props:{isLoop:v.bool.def(!0),loopTime:v.number.def(8e3),pics:v.array.def([]),list:v.array.def([]),height:v.number,width:v.number},emits:["index-change"],setup(e,{emit:t,slots:n}){const{isLoop:i,loopTime:s,pics:o,list:c,height:u,width:f}=a.toRefs(e),d=a.ref(),h=a.ref(0),m=a.ref(0),p=a.ref(0),y=a.ref(0);let C;const{resolveClassName:b}=Ce(),x=a.computed(()=>{var W;return((W=c.value)==null?void 0:W.length)>0?c.value:o.value}),N=a.computed(()=>({width:`${m.value*x.value.length}px`,transform:`translateX(-${m.value*h.value}px)`})),S=a.computed(()=>({width:`${m.value}px`,height:`${p.value}px`})),M=W=>{let H=W;W>=x.value.length&&(H=0),W<0&&(H=x.value.length-1),h.value=H,t("index-change",H)},I=W=>{W&&window.open(W,"_blank")},L=W=>[`${b("swiper-img")}`,{[`${b("swiper-link")}`]:W.link},W.class],T=W=>({"background-image":`url(${W.url})`,"background-color":W.color}),V=W=>({[`${b("current-index")}`]:h.value===W}),k=()=>{i.value&&(y.value=window.setTimeout(()=>{M(h.value+1),k()},s.value))},E=()=>{window.clearTimeout(y.value)},O=()=>{var H;const W=(H=d.value)==null?void 0:H.parentElement;!W||!window.ResizeObserver||(C=new ResizeObserver(()=>{_()}),C.observe(W))},P=()=>{var W;(W=C.disconnect)==null||W.call(C)},A=W=>{if(W===void 0)return{height:0,width:0};const H=getComputedStyle(W),ie=W.clientWidth-parseFloat(H.paddingTop)-parseFloat(H.paddingBottom);return{height:W.clientHeight-parseFloat(H.paddingLeft)-parseFloat(H.paddingRight),width:ie}},_=()=>{var H;const W=A((H=d.value)==null?void 0:H.parentElement);m.value=+f.value>0?f.value:W.width,p.value=+u.value>0?u.value:W.height};return a.watch([u,f],_),a.onMounted(()=>{_(),k(),O()}),a.onBeforeUnmount(()=>{E(),P()}),()=>a.createVNode("section",{class:`${b("swiper-home")}`,ref:d,style:S.value},[a.createVNode("hgroup",{style:N.value,class:`${b("transition")} ${b("swiper-main")}`},[x.value.map(W=>{var H;return a.createVNode("h3",{class:`${b("swiper-card")}`,style:S.value},[((H=n.default)==null?void 0:H.call(n,W))??a.createVNode("span",{class:L(W),style:T(W),onClick:()=>I(W.link)},null)])})]),a.createVNode("ul",{class:`${b("swiper-index")}`},[x.value.map((W,H)=>a.createVNode("li",{class:V(H),onMouseover:()=>M(H)},null))]),a.createVNode("span",{class:`${b("swiper-nav")} ${b("nav-prev")}`,onClick:()=>M(h.value-1)},[a.createVNode("i",{class:`${b("swiper-nav-icon")}`},null)]),a.createVNode("span",{class:`${b("swiper-nav")} ${b("nav-next")}}`,onClick:()=>M(h.value+1)},[a.createVNode("i",{class:`${b("swiper-nav-icon")}`},null)])])}}),Qm=Ue(XI),Ec=Symbol("BkSelect"),Wm=Symbol("BkOptionGroup");function Hm(){const e=a.ref(!1);return{isHover:e,setHover:()=>{e.value=!0},cancelHover:()=>{e.value=!1}}}function Ud(e){return{register:(i,s)=>{if(s){if(e.value.has(i)){console.warn(`repeat ${i}`,s);return}return e.value.set(i,s)}},unregister:i=>{e.value.delete(i)}}}function qI(e,t=200){let n,i=e;return a.customRef((s,o)=>({get(){return s(),i},set(c){clearTimeout(n),c===void 0||c===""?(i=c,o()):n=setTimeout(()=>{i=c,o()},t)}}))}function eL(e,t){const{popoverMinWidth:n}=e;let i=null;const s=a.ref("auto"),o=a.ref(!1),c=()=>{o.value=!o.value},u=()=>{o.value=!1},f=()=>{o.value=!0},d=()=>{var h;s.value=Math.max((h=t.value)==null?void 0:h.offsetWidth,n)};return a.onMounted(()=>{t.value&&(i=o8(t.value,d,60,!0),i.start())}),a.onBeforeUnmount(()=>{i==null||i.stop(),i=null}),{isPopoverShow:o,popperWidth:s,togglePopover:c,hidePopover:u,showPopover:f}}function tL(e,t){const n=qI(""),i=a.ref(!1);return a.watch(n,async()=>{try{i.value=!0,await e(n.value),i.value=!1}catch(s){console.error(s)}finally{t==null||t()}}),{searchKey:n,searchLoading:i}}function hr(e=""){return e&&String(e).trim().toLowerCase()}const Al=a.defineComponent({name:"Option",props:{id:{type:[String,Number,Object],require:!0},name:v.oneOfType([v.number,v.string]),disabled:v.bool.def(!1)},setup(e,{attrs:t}){const{proxy:n}=a.getCurrentInstance(),i=a.reactive({visible:!0}),{disabled:s,id:o,name:c}=a.toRefs(e),u=a.computed(()=>c.value!==void 0?c.value:t.label),f=a.computed(()=>o.value!==void 0?o.value:t.value),d=a.inject(Ec,null),h=a.inject(Wm,null),m=a.computed(()=>{var M;return(M=d==null?void 0:d.selected)==null?void 0:M.some(I=>at.isEqual(I.value,f.value))}),p=a.computed(()=>d==null?void 0:d.multiple),y=a.computed(()=>(d==null?void 0:d.activeOptionValue)===f.value),C=a.computed(()=>(d==null?void 0:d.showSelectedIcon)&&p.value),b=a.computed(()=>d==null?void 0:d.selectedStyle),x=()=>{s.value||d==null||d.handleOptionSelected(n)},N=()=>{d.activeOptionValue=f.value};a.onBeforeMount(()=>{d==null||d.register(f.value,n),h==null||h.register(f.value,n)}),a.onBeforeUnmount(()=>{d==null||d.unregister(f.value),h==null||h.unregister(f.value)});const{resolveClassName:S}=Ce();return{...a.toRefs(i),selected:m,multiple:p,isHover:y,showSelectedIcon:C,selectedStyle:b,optionName:u,optionID:f,handleOptionClick:x,handleMouseEnter:N,resolveClassName:S}},render(){var t,n;const e=Pe({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"is-checkbox":this.selectedStyle===fl.CHECKBOX,[this.resolveClassName("select-option")]:!0});return a.withDirectives(a.createVNode("li",{class:e,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[this.showSelectedIcon&&this.selectedStyle===fl.CHECKBOX&&a.createVNode(qn,{disabled:this.disabled,class:this.resolveClassName("select-checkbox"),modelValue:this.selected},null),((n=(t=this.$slots).default)==null?void 0:n.call(t))??a.createVNode("span",{class:this.resolveClassName("select-option-item"),title:String(this.optionName)},[this.optionName]),this.showSelectedIcon&&this.selected&&this.selectedStyle===fl.CHECK&&a.createVNode(ma,{class:this.resolveClassName("select-selected-icon"),width:22,height:22},null)]),[[a.vShow,this.visible]])}}),nL=a.defineComponent({name:"OptionGroup",props:{label:v.string.def(""),disabled:v.bool.def(!1),collapsible:v.bool.def(!1),collapse:v.bool.def(!1)},setup(e,{emit:t}){const n=a.getCurrentInstance(),{proxy:i}=n,s=a.inject(Ec,null),o=a.reactive({groupCollapse:e.collapse,visible:!0}),c=a.ref(new Map),{register:u,unregister:f}=Ud(c),d=a.computed(()=>`${e.label} (${[...c.value.values()].filter(p=>p.visible).length})`),h=()=>{!e.collapsible||e.disabled||(o.groupCollapse=!o.groupCollapse,t("update:collapse",o.groupCollapse))};a.provide(Wm,a.reactive({...a.toRefs(e),register:u,unregister:f,groupCollapse:a.toRef(o,"groupCollapse")})),a.onBeforeMount(()=>{s==null||s.registerGroup(n.uid,i)}),a.onBeforeUnmount(()=>{s==null||s.unregisterGroup(n.uid)});const{resolveClassName:m}=Ce();return{...a.toRefs(o),groupLabel:d,handleToggleCollapse:h,resolveClassName:m}},render(){var i,s;const e=Pe({[this.resolveClassName("option-group")]:!0,collapsible:this.collapsible,disabled:this.disabled}),t=Pe({[this.resolveClassName("option-group-label")]:!0,collapsible:this.collapsible}),n=Pe({"default-group-label-icon":!0,collapse:this.groupCollapse});return a.withDirectives(a.createVNode("ul",{class:e},[a.createVNode("li",{class:t,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():a.createVNode("span",{class:"default-group-label"},[this.collapsible&&a.createVNode(Gs,{class:n},null),a.createVNode("span",{class:"default-group-label-title"},[this.groupLabel])])]),a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("option-group-content")},[(s=(i=this.$slots).default)==null?void 0:s.call(i)]),[[a.vShow,!this.groupCollapse]])]),[[a.vShow,this.visible]])}}),iL={onContentScroll:Function},aL={list:v.array.def([]),enabled:v.bool.def(!0),scrollEvent:v.bool.def(!1),lineHeight:v.oneOfType([v.number,v.func]).def(30),minHeight:v.number.def(30),height:v.oneOfType([v.string.def("100%"),v.number]).def("100%"),width:v.oneOfType([v.string.def("100%"),v.number]).def("100%"),className:v.oneOfType([v.arrayOf(v.string),v.object,v.arrayOf(v.object),v.string]).def(""),contentClassName:v.oneOfType([v.arrayOf(v.string),v.object,v.arrayOf(v.object),v.string]).def(""),contentStyle:v.object.def({}),scrollXName:v.string.def($t("F-scroll-x")),scrollYName:v.string.def($t("F-scroll-y")),groupItemCount:v.number.def(1),preloadItemCount:v.number.def(1),renderAs:v.string.def("div"),contentAs:v.string.def("div"),scrollOffsetTop:v.number.def(0),scrollPosition:v.string.def("content"),abosuteHeight:v.oneOfType([v.string.def("auto"),v.number]).def("auto"),throttleDelay:v.number.def(60),rowKey:v.string.def(void 0),keepAlive:v.bool.def(!1),autoReset:v.bool.def(!0),...iL},rL=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,p,y,C,b)=>{t.emit("content-scroll",[d,{translateY:y,translateX:C,pos:b}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:s,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},u=a.ref(null),f=({left:d=0,top:h=0})=>{u.value.scrollTo(d,h)};return t.expose({scrollTo:f}),{rendAsTag:()=>{var d,h,m,p,y,C,b,x;return a.h(n,{class:e.className,ref:u},[((h=(d=t.slots).beforeContent)==null?void 0:h.call(d))??"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[((p=(m=t.slots).default)==null?void 0:p.call(m,{data:e.list}))??""]),[[o,c]]),((C=(y=t.slots).afterContent)==null?void 0:C.call(y))??"",((x=(b=t.slots).afterSection)==null?void 0:x.call(b))??""])}}};function G3(e,t,n,i){let s=0,o=0,c=0,u=0;for(;s<e;s++){if(u=i(s,[s*n,(s+1)*n,"virtual"]),o+u>t){c=t-o;break}o+=u}return{startIndex:s,height:o,diffHeight:c}}function Fm(e,t,n,i,s){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:u,count:f,groupItemCount:d,startIndex:h,endIndex:m,scrollLeft:p}=n,{offsetHeight:y}=i;let C=0,b=0,x=0;if(typeof e=="number"&&(C=Math.floor(o/e),b=Math.ceil(y/e)+C,x=o%e),typeof e=="function"){const N=G3(f,o,d,e);C=N.startIndex>0?N.startIndex:0,x=N.diffHeight,b=G3(f,y,d,e).startIndex+C+1}if(o!==u||C!==h||b!==m||p!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,C,b,o,x,c,{bottom:N>=0?N:0})}}function sL(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const y=t.scrollTop,C=t.scrollLeft,b=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,y,y,C,{bottom:b>=0?b:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:p}=o;Fm(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:p},t,e)}const Bm=(e=60)=>at.throttle((t,n,i)=>sL(t,n,i),e),oL=(e,t,n,i=60)=>{Reflect.apply(Bm(i),void 0,[e,t,n])},lL={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{oL(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",Bm)}}},cL=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:lL},props:aL,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=E=>typeof E=="string"?[E]:typeof E=="object"&&!Array.isArray(E)?[E]:E;if(!e.enabled){const{rendAsTag:E}=rL(e,t);return E}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),u=(E,O,P,A,_,W,H)=>{c.startIndex=O,c.endIndex=P,c.scrollTop=A,c.translateY=_,c.translateX=W,c.scrollLeft=W,c.pos=H,t.emit("content-scroll",[E,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),p()})}),a.watch(()=>e.list,()=>{let E={left:0,top:0};E={left:c.scrollLeft,top:c.scrollTop},f(),p(),e.keepAlive&&k(E)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),p()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=E=>{if(d.value=Math.ceil((E||[]).length/e.groupItemCount),c.count=d.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,typeof e.abosuteHeight=="string"&&e.abosuteHeight==="auto")if(typeof e.lineHeight=="function"){h.value=0;let P=0;for(let A=0;A<d.value;A++){const _=e.lineHeight.call(this,A,E.slice(A*e.groupItemCount,e.groupItemCount));P+=typeof _=="number"?_:0}h.value=P}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},p=(E={left:0,top:0})=>{var P;const O=(P=o.value)==null?void 0:P.parentNode;Fm(e.lineHeight,u,c,O,null),E&&o.value&&e.autoReset&&k(E)},y=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((E,O)=>({...E,$index:O}))),C=a.computed(()=>y.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),b=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),x=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width,display:"inline-block",...e.scrollPosition==="container"?b.value:{}})),N=a.computed(()=>{const E=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:E?"none":"block"}}),{resolveClassName:S}=Ce(),M=a.computed(()=>[S("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?S("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?S("virtual-content"):"",...s(e.contentClassName)]),L=a.resolveDirective("bkVirtualRender"),T={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},V=()=>{f(),p()},k=(E={left:0,top:0})=>{const{left:O,top:P}=E;o.value.scrollTo(O,P)};return t.expose({reset:V,scrollTo:k}),()=>{var E,O,P,A,_,W,H,ie;return a.h(n||"div",{ref:o,class:M.value,style:x.value},[((O=(E=t.slots).beforeContent)==null?void 0:O.call(E))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...b.value,...e.contentStyle}},[((A=(P=t.slots).default)==null?void 0:A.call(P,{data:C.value}))??""]),[[L,T]]),((W=(_=t.slots).afterContent)==null?void 0:W.call(_))??"",a.h("div",{class:[S("virtual-section")],style:N.value}),((ie=(H=t.slots).afterSection)==null?void 0:ie.call(H))??""])}}}),Br=Ue(cL);var $m=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}($m||{});const uL=a.defineComponent({name:"Tag",props:{theme:ec(),closable:v.bool.def(!1),type:Se("tagStorkeType",{}).def($m.UNKNOWN),checkable:v.bool.def(!1),checked:v.bool.def(!1),radius:v.string.def("2px"),extCls:v.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.computed(()=>Pe({[`${n("tag-closable")}`]:e.closable,[`${n("tag-checkable")}`]:e.checkable,[`${n("tag-check")}`]:e.checked,[`${n(`tag-${e.type}`)}`]:e.type,[`${n(`tag-${e.theme}`)}`]:e.theme,[e.extCls]:!!e.extCls},n("tag"))),s=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:i,wrapperStyle:s,handleClose:u=>{u.preventDefault(),u.stopPropagation(),t("close",u)},handleClick:u=>{u.preventDefault(),u.stopPropagation(),e.checkable&&t("change",!e.checked)},resolveClassName:n}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:`${this.resolveClassName("tag-icon")}`},[this.$slots.icon()]):"",a.createVNode("span",{class:`${this.resolveClassName("tag-text")}`},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(gn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Jr=Ue(uL),dL=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:ec(),placeholder:v.string.def(""),filterable:v.bool.def(!1),allowCreate:v.bool.def(!1),disabled:v.bool.def(!1),modelValue:v.any,collapseTags:v.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.inject(Ec,null),{modelValue:s,collapseTags:o,selected:c}=a.toRefs(e),u=a.ref(s.value),f=a.ref(),d=a.ref(null);a.watch(s,()=>{u.value=s.value}),a.watch([c,o],()=>{N()},{flush:"post"});const h=L=>{t("remove",L)},m=()=>{var L;(L=f.value)==null||L.focus()},p=L=>{t("update:modelValue",L.target.value)},y=L=>{switch(L.code){case"Enter":{t("enter",L.target.value,L);break}}t("keydown",L.target.value,L)},C=a.ref([]),b=a.ref(),x=L=>{const T=C.value.map(V=>V==null?void 0:V.$el).filter(V=>!!V);return typeof L=="number"?T[L]:T},N=()=>{o.value&&(d.value=null,setTimeout(()=>{var V,k;const L=x(),T=L.findIndex((E,O)=>O?L[O-1].offsetTop!==E.offsetTop:!1);d.value=T>0?T:null,((V=L[d.value])==null?void 0:V.offsetTop)!==((k=b.value)==null?void 0:k.offsetTop)&&d.value>1&&(d.value-=1)}))},S=at.debounce(N,150),M=a.ref(),I=new ResizeObserver(()=>{S()});return a.onMounted(()=>{M.value&&I.observe(M.value)}),a.onBeforeUnmount(()=>{M.value&&I.unobserve(M.value)}),{collapseTagRef:b,tagWrapperRef:M,tagsRefs:C,select:i,overflowTagIndex:d,value:u,inputRef:f,handleRemoveTag:h,focus:m,handleInput:p,handleKeydown:y,resolveClassName:n}},render(){var s,o,c,u,f,d,h,m;const e=(o=(s=this.$slots)==null?void 0:s.prefix)==null?void 0:o.call(s),t=Pe({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Pe({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t,ref:"tagWrapperRef"},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("div",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((p,y)=>a.createVNode(Jr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&y>=this.overflowTagIndex?"none":""},ref:C=>this.tagsRefs[y]=C,onClose:()=>this.handleRemoveTag(p.value)},{default:()=>{var C;return[(C=this.select)==null?void 0:C.handleGetLabelByValue(p.value)]}})),a.createVNode(Jr,{class:this.resolveClassName("select-overflow-tag"),style:{display:this.overflowTagIndex&&this.collapseTags?"":"none"},ref:"collapseTagRef"},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]}),a.createVNode("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:i,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),(m=(h=this.$slots)==null?void 0:h.suffix)==null?void 0:m.call(h)])}}),fL=a.defineComponent({name:"Select",directives:{clickoutside:wi},props:{modelValue:v.any,multiple:v.bool.def(!1),disabled:v.bool.def(!1),size:v.size().def(xf.DEFAULT),clearable:v.bool.def(!0),loading:v.bool.def(!1),filterable:v.bool.def(!1),remoteMethod:v.func,scrollHeight:v.number.def(200),showSelectAll:v.bool.def(!1),popoverMinWidth:v.number.def(0),showOnInit:v.bool.def(!1),multipleMode:v.oneOf(["default","tag"]).def("default"),tagTheme:ec(),behavior:Jg(),collapseTags:v.bool.def(!1),autoHeight:v.bool.def(!0),noDataText:v.string,noMatchText:v.string,loadingText:v.string,placeholder:v.string,searchPlaceholder:v.string,selectAllText:v.string,scrollLoading:v.bool.def(!1),allowCreate:v.bool.def(!1),popoverOptions:Object,customContent:v.bool.def(!1),list:v.arrayOf(v.any).def([]),idKey:v.string.def("value"),displayKey:v.string.def("label"),withValidate:v.bool.def(!0),showSelectedIcon:v.bool.def(!0),inputSearch:v.bool.def(!0),enableVirtualRender:v.bool.def(!1),allowEmptyValues:v.array.def([]),autoFocus:v.bool.def(!1),keepSearchValue:v.bool.def(!1),prefix:v.string,selectedStyle:Kw()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ft("select"),{resolveClassName:i}=Ce(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:p,allowCreate:y,customContent:C,showSelectedIcon:b,inputSearch:x,enableVirtualRender:N,showSelectAll:S,scrollHeight:M,list:I,displayKey:L,idKey:T,collapseTags:V,autoHeight:k,popoverOptions:E,allowEmptyValues:O,autoFocus:P,keepSearchValue:A,selectedStyle:_}=a.toRefs(e),W=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),H=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),fe=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),de=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),re=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),ve=ei(),G=a.ref(),K=a.ref(),F=a.ref(),Q=a.ref(),Y=a.ref(),ne=a.ref(),oe=a.ref(),ge=a.ref(new Map),ee=a.computed(()=>[...ge.value.values()]),$=a.ref(new Map),j=a.ref([]),J=a.computed(()=>j.value.reduce((Le,xe)=>(Le[xe.value]=xe.label,Le),{})),X=a.ref(),ae=a.computed(()=>I.value.reduce((Le,xe)=>(Le[xe[T.value]]=xe[L.value],Le),{}));a.watch(s,()=>{var Le;oo(),e.withValidate&&((Le=ve==null?void 0:ve.validate)==null||Le.call(ve,"change"))},{deep:!0}),a.watch(j,()=>{var Le;(Le=oe.value)==null||Le.updatePopover(null,lt.value)});const Z=a.computed(()=>ce.value?I.value:I.value.filter(Le=>{var xe;return(xe=hr(String(Le[L.value])))==null?void 0:xe.includes(hr(ni.value))})),se=a.computed(()=>o.value||d.value),ye=a.computed(()=>j.value.map(Le=>{var xe,We;return((We=(xe=ge.value)==null?void 0:xe.get(Le.value))==null?void 0:We.optionName)||ae.value[Le.value]||Le.label})),Me=a.computed(()=>{const Le=ee.value.reduce((xe,We)=>(We.disabled||xe.push(We.optionID),xe),[]);return Le.length<=j.value.length&&Le.every(xe=>j.value.some(We=>We.value===xe))}),je=a.computed(()=>!!$.value.size),Ae=a.computed(()=>!ee.value.length),He=a.computed(()=>ee.value.length&&ee.value.every(Le=>!Le.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),be=a.computed(()=>!(Gr.value||Ae.value||He.value)||C.value),Ie=a.computed(()=>u.value&&S.value&&(!ni.value||!c.value)),ze=a.computed(()=>M.value-12-(Ie.value?32:0)),rt=a.computed(()=>Gr.value?ie.value:Ae.value?W.value:He.value?H.value:""),nt=a.computed(()=>k.value?V.value&&!ti.value:V.value),lt=a.computed(()=>at.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:ro.value,arrow:!1,placement:"bottom-start",isShow:ti.value,reference:Y.value,offset:6,popoverDelay:0,renderType:ql.AUTO},E.value)),{register:Tt,unregister:ht}=Ud(ge),{register:Je,unregister:Ge}=Ud($),{isHover:Fe,setHover:Xe,cancelHover:Ve}=Hm(),vt=a.ref(!1),Hn=()=>{vt.value||(vt.value=!0,t("focus"))},ao=()=>{vt.value&&(vt.value=!1,t("blur"))},{popperWidth:ro,isPopoverShow:ti,hidePopover:Fi,showPopover:$r,togglePopover:Hc}=eL({popoverMinWidth:h.value},K);a.watch(ti,()=>{t("toggle",ti.value)});const Fc=a.computed(()=>(c.value&&x.value||y.value)&&ti.value);a.watch(ti,Le=>{Le?setTimeout(()=>{Ca(),so()},10):A.value||(ni.value="")});const so=()=>{var We;const Le=j.value[0],xe=ge.value.get(Le==null?void 0:Le.value);xe&&!xe.disabled&&xe.visible?X.value=Le==null?void 0:Le.value:X.value=(We=ee.value.find(pn=>!pn.disabled&&pn.visible))==null?void 0:We.optionID},Bc=Le=>{c.value&&ee.value.forEach(xe=>{var We;xe.visible=(We=hr(String(xe.optionName)))==null?void 0:We.includes(hr(Le))})},{searchKey:ni,searchLoading:Gr}=tL(ce.value?f.value:Bc,so),ii=Le=>{Le!==s.value&&(t("update:modelValue",Le,s.value),t("change",Le,s.value))},$c=()=>{se.value||(Hn(),Hc())},Zr=Le=>{c.value&&(ni.value=Le)},Gc=(Le,xe)=>{const We=String(Le);!y.value||!We||c.value&&ee.value.find(qt=>hr(String(qt.optionName))===hr(We))||ge.value.get(We)||(xe.stopPropagation(),u.value?(j.value.push({value:We,label:We}),ii(j.value.map(qt=>qt.value))):(j.value=[{value:We,label:We}],ii(We),Fi()),ni.value="")},ya=Le=>{if(!(se.value||!Le)){if(u.value){const xe=j.value.findIndex(We=>We.value===Le.optionID);xe>-1?j.value.splice(xe,1):j.value.push({value:Le.optionID,label:Le.optionName||Le.optionID}),ii(j.value.map(We=>We.value))}else j.value=[{label:Le.optionName||Le.optionID,value:Le.optionID}],ii(Le.optionID),Fi();Ca()}},Ca=()=>{setTimeout(()=>{var Le,xe,We;!x.value&&!y.value?(Le=Q.value)==null||Le.focus():p.value==="tag"?(xe=Y.value)==null||xe.focus():(We=G.value)==null||We.focus()},0)},Zc=Le=>{Le.stopPropagation(),j.value=[],ii(u.value?[]:""),t("clear",u.value?[]:""),Fi()},Yc=()=>{X.value=""},Uc=()=>{var Le;Me.value?j.value=[]:(ee.value.forEach(xe=>{xe.disabled||xe.optionID in J.value||j.value.push({value:xe.optionID,label:xe.optionName||xe.optionID})}),(Le=I.value)==null||Le.forEach(xe=>{xe.disabled||xe[T.value]in J.value||j.value.push({value:xe[T.value],label:xe[L.value]})})),ii(j.value.map(xe=>xe.value)),Ca()},Kc=Le=>{const{scrollTop:xe,clientHeight:We,scrollHeight:pn}=Le.target;xe+We===pn&&t("scroll-end")},Xc=Le=>{if(se.value)return;const xe=j.value.findIndex(We=>We.value===Le);xe>-1&&(j.value.splice(xe,1),ii(j.value.map(We=>We.value)))},Yr=Le=>{var We,pn;let xe=Le;if(typeof xe=="object"){for(const qt of ge.value.keys())if(at.isEqual(qt,xe)){xe=qt;break}}return((pn=(We=ge.value)==null?void 0:We.get(xe))==null?void 0:pn.optionName)||ae.value[xe]||J.value[xe]||xe},oo=()=>{Array.isArray(s.value)?j.value=[...s.value.map(Le=>({value:Le,label:Yr(Le)}))]:s.value!==void 0||O.value.includes(s.value)?j.value=[{value:s.value,label:Yr(s.value)}]:j.value=[]},lo=Le=>{var pn,qt;if(!ti.value)return;const xe=ee.value.filter(en=>!en.disabled&&en.visible),We=xe.findIndex(en=>en.optionID===X.value);if(!(!xe.length||We===-1))switch(Le.code){case"ArrowDown":{Le.preventDefault();const en=We>=xe.length-1?0:We+1;X.value=(pn=xe[en])==null?void 0:pn.optionID;break}case"ArrowUp":{Le.preventDefault();const en=We===0?xe.length-1:We-1;X.value=(qt=xe[en])==null?void 0:qt.optionID;break}case"Backspace":{if(!u.value||!j.value.length||ni.value.length||Le.target===Q.value)return;j.value.pop(),ii(j.value.map(en=>en.value));break}case"Enter":{const en=ge.value.get(X.value);ya(en);break}}},qc=({event:Le})=>{var We;const{target:xe}=Le;(We=K.value)!=null&&We.contains(xe)||K.value===xe||(Fi(),ao())},eu=()=>{setTimeout(()=>{var Le,xe;N.value&&((xe=(Le=ne.value)==null?void 0:Le.reset)==null||xe.call(Le))})};return a.provide(Ec,a.reactive({multiple:u,selected:j,activeOptionValue:X,showSelectedIcon:b,selectedStyle:_,register:Tt,unregister:ht,registerGroup:Je,unregisterGroup:Ge,handleOptionSelected:ya,handleGetLabelByValue:Yr})),a.onMounted(()=>{oo(),setTimeout(()=>{m.value&&$r(),P.value&&Ca()})}),{selected:j,isInput:Fc,options:ee,isDisabled:se,selectedLabel:ye,isPopoverShow:ti,isHover:Fe,popperWidth:ro,inputRef:G,triggerRef:K,contentRef:F,searchRef:Q,selectTagInputRef:Y,virtualRenderRef:ne,popoverRef:oe,searchLoading:Gr,isOptionsEmpty:Ae,isSearchEmpty:He,isFocus:vt,isShowSelectContent:be,curContentText:rt,isGroup:je,searchKey:ni,isShowSelectAll:Ie,virtualHeight:ze,virtualList:Z,isCollapseTags:nt,popoverConfig:lt,focusInput:Ca,setHover:Xe,cancelHover:Ve,handleFocus:Hn,handleBlur:ao,handleTogglePopover:$c,handleClear:Zc,hidePopover:Fi,showPopover:$r,handleToggleAll:Uc,handleOptionSelected:ya,handleClickOutside:qc,handleScroll:Kc,handleDeleteTag:Xc,handleInputChange:Zr,handleInputEnter:Gc,handleKeydown:lo,handleSelectedAllOptionMouseEnter:Yc,handlePopoverShow:eu,localLoadingText:ie,localPlaceholder:fe,localSearchPlaceholder:de,localSelectAllText:re,resolveClassName:i}},render(){const e=Pe({[`${this.resolveClassName("select")}`]:!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable,[this.size]:!0,[this.behavior]:!0}),t=()=>this.loading?a.createVNode(ua,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(mn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ya,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(dL,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":u=>this.searchKey=u,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.localPlaceholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},{prefix:this.prefix?a.createVNode("div",{class:`${this.resolveClassName("select--prefix-area")}`},[a.createVNode("span",null,[this.prefix])]):(c=(o=this.$slots).prefix)==null?void 0:c.call(o),default:this.$slots.tag&&(()=>this.$slots.tag({selected:this.selected})),suffix:()=>t()}):a.createVNode(Ba,a.mergeProps({ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.localPlaceholder:this.localPlaceholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,withValidate:!1,onInput:this.handleInputChange,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},this.prefix?{prefix:this.prefix}:null),{...typeof this.$slots.prefix=="function"?{prefix:()=>{var u,f;return(f=(u=this.$slots).prefix)==null?void 0:f.call(u)}}:null,suffix:()=>t()})},i=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-trigger"),style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[((c=(o=this.$slots).trigger)==null?void 0:c.call(o,{selected:this.selected}))||n()])},s=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-content-wrapper"),ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:this.resolveClassName("select-search-wrapper")},[a.createVNode(Ua,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:this.resolveClassName("select-search-input"),placeholder:this.localSearchPlaceholder,"onUpdate:modelValue":u=>this.searchKey=u},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:this.resolveClassName("select-empty")},[this.searchLoading&&a.createVNode(ua,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:this.resolveClassName("select-content")},[a.createVNode("div",{class:this.resolveClassName("select-dropdown"),style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("select-options")},[this.isShowSelectAll&&a.createVNode("li",{class:this.resolveClassName("select-option"),onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.localSelectAllText]),this.enableVirtualRender?a.createVNode(Br,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(Al,{key:f[this.idKey],id:f[this.idKey],name:f[this.displayKey]},{default:(h=(d=this.$slots).virtualScrollRender)==null?void 0:h.call(d,{item:f})})})}):this.list.map(u=>a.createVNode(Al,{id:u[this.idKey],name:u[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:this.resolveClassName("select-options-loading")},[a.createVNode(ua,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.localLoadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:this.resolveClassName("select-extension")},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(Ut,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),yh=Kt(fL,{Option:Al,Group:nL});function hL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:gL}=$a,Ch=Object.assign({},gL);Ch.width.default="400";Ch.height.default="100%";const mL=a.defineComponent({name:"Sideslider",components:{BkModal:$a,BkButton:Pt},props:{...Ch,direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',【${t.join(" | ")}】`),!1):!0}}},emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{console.log("slider handleClose");let u=!0;typeof e.beforeClose=="function"&&(u=await e.beforeClose()),u&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},s=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)},{resolveClassName:c}=Ce();return()=>{const u={header:()=>{var h;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${c("sideslider-header")}`},[a.createVNode("div",{class:`${c("sideslider-close")} ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`${c("sideslider-title")} ${e.direction}`},[((h=t.header)==null?void 0:h.call(t))??e.title])])])},default:()=>{var h;return((h=t.default)==null?void 0:h.call(t))??"Content"},footer:()=>t.footer?a.createVNode("div",{class:`${c("sideslider-footer")}`},[t.footer()]):null},f=`${c("sideslider-wrapper")} ${e.scrollable?"scroll-able":""} ${e.extCls}`,d=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode($a,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),hL(u)?u:{default:()=>[u]})}}}),Gm=Ue(mL);var Zm=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(Zm||{});const Z3={theme:v.theme().def(Xl.PRIMARY),size:v.size(),curStep:v.number.def(1),controllable:v.bool.def(!1),direction:zg(),status:Se("status",{}).def(Zm.UNKNOWN),lineType:Vg(),text:v.bool,extCls:v.string,steps:v.array.def([]),beforeChange:v.func},pL=a.defineComponent({name:"Steps",props:Z3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ft("steps"),i=ft("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(p=>{typeof p=="string"?m.push(p):m.push({title:p.title,icon:p.icon,description:p.description,status:p.status,border:p.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{Z3.curStep=h},u=()=>{var h;s.value.splice(0,s.value.length,{title:n.value.step1,icon:1},{title:n.value.step2,icon:2},{title:n.value.step3,icon:3}),(h=e.steps)!=null&&h.length&&o(e.steps)};a.watch(()=>i.value,()=>{u()});const f=async h=>{try{e.controllable&&h!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(m,p)=>{const y=await e.beforeChange(h);y?m(y):p(y)}),t("update:curStep",h),t("click",h))}catch(m){console.warn(m)}};a.onMounted(u),a.watch(()=>e.steps,()=>{o(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{c(e.curStep)},{deep:!0});const{resolveClassName:d}=Ce();return{defaultSteps:s,jumpTo:f,resolveClassName:d}},render(){const e=this.resolveClassName("steps"),t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Pe({[`${this.extCls}`]:!!this.extCls,[`${this.resolveClassName(`steps-${this.direction}`)}`]:this.direction,[`${this.resolveClassName(`steps-${this.lineType}`)}`]:this.lineType},`${t} ${e} ${n}`),s=m=>this.curStep>m+1||this.defaultSteps[m].status==="done",o=m=>this.curStep===m+1,c=m=>{const{icon:p}=m;return p?Object.prototype.toString.call(p)==="[object Object]":typeof m=="string"},u=(m,p)=>(p.icon||(p.icon=m),!isNaN(p.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,p)=>o(m)&&this.status==="loading"||f(p)?a.createVNode(Zs,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(p)?a.createVNode(gn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(ma,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,p)?m+1:a.createVNode(p.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,p)=>{var y,C;return a.createVNode("div",{class:[this.resolveClassName("step"),m.title?"":this.resolveClassName("step-no-content"),s(p)?"done":"",o(p)?"current":"",o(p)&&this.status==="error"?"isError":"",m.status&&o(p)?[`${this.resolveClassName(`step-${m.status}`)}`]:""]},[a.createVNode("span",{class:[`${this.resolveClassName("step-indicator")}`,`${this.resolveClassName(`step-${c(m)?"icon":"number"}`)}`,`${this.resolveClassName(`step-icon${m.status}`)}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(p+1)}},[((C=(y=this.$slots)[p+1])==null?void 0:C.call(y))??h(p,m)]),m.title?a.createVNode("div",{class:`${this.resolveClassName("step-content")}`},[a.createVNode("div",{class:`${this.resolveClassName("step-title")}`,style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(p+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}}),Ym=Ue(pL),vL=a.defineComponent({name:"Switcher",props:{theme:v.theme(),size:v.size(),disabled:v.bool,showText:v.bool,isOutline:v.bool,onText:v.string.def("ON"),offText:v.string.def("OFF"),isSquare:v.bool,extCls:v.string,beforeChange:v.func.def(void 0),trueValue:v.oneOfType([v.string,v.number,v.bool]).def(!0),falseValue:v.oneOfType([v.string,v.number,v.bool]).def(!1),value:v.oneOfType([v.string,v.number,v.bool]).def(!1),modelValue:v.oneOfType([v.string,v.number,v.bool]).def(!1),withValidate:v.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=ei(),{resolveClassName:i}=Ce(),s=a.ref(!1),o=a.computed(()=>e.trueValue===u.value),c=a.ref(e.modelValue!==!1),u=a.computed(()=>c.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,[`${i("switcher")}`]:!0,[`${i("switcher-outline")}`]:e.isOutline,[`${i("switcher-square")}`]:e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":o.value,"is-unchecked":!o.value,"is-loading":s.value,[`${i("primary")}`]:e.theme==="primary"};if(e.size&&!e.showText){const p=`${i(`switcher-${e.size}`)}`;m[p]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;c.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{c.value=!1});const d=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||s.value)return;const p=o.value?e.falseValue:e.trueValue,y=!o.value,C=()=>{t("update:modelValue",p),t("change",y)};let b=!0;if(typeof e.beforeChange=="function"&&(b=e.beforeChange(p),typeof b.then=="function"))return s.value=!0,b.then(()=>{C()}).finally(()=>{s.value=!1});b&&C()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&d(m)};return()=>a.createVNode("div",{class:f.value,onClick:d,tabindex:"0",onKeydown:h},[s.value?a.createVNode(Mc,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),Um=Ue(vL);var Pl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(Pl||{}),Km=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(Km||{});const yL=["auto","highlight"],CL=["none","row","col","outer","horizontal"],Be={ROW_INDEX:"__$table_row_index",ROW_UID:"__$uuid",ROW_EXPAND:"__row_expand",ROW_SELECTION:"__row_selection",ROW_SELECTION_ALL:"__row_selection_all",ROW_SELECTION_INDETERMINATE:"__row_selection_indeterminate",ROW_SOURCE_DATA:"__row_source_data",ROW_SKIP_CFG:"__row_skip_config"},Kn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},_r=6,sa=42;var bh=(e=>(e.DEF1="def1",e.DEF2="def2",e))(bh||{});const bL={def1:"#FAFBFD",def2:"#F0F1F5"},vl={large:78,medium:60,small:42},wL=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:vl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:vl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:vl.large}],Xm="InitColumns",qm="BKTableCahce",NL="Bk_COlumn_Update_Define",ML=60;var Rt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Rt||{});const IL=["asc","desc","null","custom"],oa=80;var e1=(e=>(e.CURRENT="current",e.ALL="all",e))(e1||{});Se("showOverflowTooltipMode",{default:"auto"});const LL=Se("columnType",{default:"none"}),Kd=Se("columnType",{default:""});Se("full",{default:"full"});Se("columnSize",{default:"small"});const TL=dn(),wh=Se("IOverflowTooltipPropType",{}).def(!1);Se("IOverflowTooltipType",{}).def({content:"",disabled:!1,watchCellResize:!0,mode:"auto"});const xL=Se("ISortPropShape",{}).def(!1),SL=Se("IFilterPropShape",{}).def(!1);var t1=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(t1||{});const io=Se("IColumnType",{}).def({width:"100%",label:()=>""}),n1=Se("ITableSettingPropType",{}).def(!1),vd=Se("LabelFunctionStringType",{}),kL=Se("RenderFunctionStringType",{}),Y3=Se("SpanFunctionStringType",{}),DL=Se("RowClassFunctionStringType",{}),i1=Se("RowHeightFunctionNumberType",{});Se("FunctionNumberType",{});const yl=e=>Se("StringNumberType",{}).def(e);Se("IColumnPropType",{}).def({label:void 0,minWidth:oa});const jL={data:v.arrayOf(v.any).def([]),columns:v.arrayOf(io).def([]),activeColumn:v.oneOfType([v.number.def(-1),v.arrayOf(v.number.def(-1))]),columnPick:Se("columnPick",{}).def("disabled"),height:yl("auto"),stripe:v.bool.def(!1),minHeight:yl(sa*2),maxHeight:yl("auto"),rowHeight:i1.def(sa),headHeight:v.number.def(sa),showHead:v.bool.def(!0),thead:Se("ITheadType",{}).def({color:bh.DEF1,height:sa,isShow:!0}),virtualEnabled:v.bool.def(!1),border:v.oneOfType([v.arrayOf(Se("boderType",{})),v.string]).def([Pl.ROW]),pagination:v.oneOfType([v.bool.def(!1),v.object.def({})]).def(!1),paginationHeight:v.number.def(ML),remotePagination:v.bool.def(!1),emptyText:v.string,settings:n1,rowClass:v.oneOfType([v.string,v.object,v.func]).def({}),rowStyle:v.oneOfType([v.string,v.object,v.func]).def({}),cellStyle:v.oneOfType([v.string,v.object,v.func]).def({}),cellClass:v.oneOfType([v.string,v.object,v.func]).def({}),scrollLoading:v.oneOfType([v.object,v.bool]).def(void 0),reserveExpand:v.bool.def(!1),selectionKey:v.string.def(""),isSelectedFn:v.func.def(void 0),rowKey:v.oneOfType([v.string,v.func]).def(Be.ROW_INDEX),showOverflowTooltip:wh,asyncData:v.bool.def(!1),rowHover:v.oneOf(yL).def(Km.HIGHLIGHT),defaultSort:v.shape({}).def({}),isRowSelectEnable:v.oneOfType([v.func.def(()=>!0),v.bool.def(!0)]).def(!0),resizerWay:Se("ResizerWay",{default:"debounce"}),observerResize:v.bool.def(!0),align:Kd,headerAlign:Kd,prependStyle:v.style().def({})},OL={label:vd,field:vd,render:kL,width:v.oneOfType([v.number,v.string]),minWidth:yl(oa),columnKey:v.string.def(""),showOverflowTooltip:wh,type:LL,resizable:v.bool.def(!0),fixed:v.oneOfType([v.bool,TL]).def(!1),sort:xL,filter:SL,colspan:Y3.def(1),rowspan:Y3.def(1),align:Kd,className:DL,prop:vd,index:v.number.def(void 0)},EL=a.defineComponent({name:"TableColumn",props:OL,setup(e){const t=a.inject(Xm,(s,o=!1)=>{},!1),n=a.inject(qm,{queueStack:(s,o)=>o==null?void 0:o()}),i=a.reactive({...e,field:e.prop||e.field});return{initColumns:t,bkTableCache:n,column:i}},unmounted(){this.updateColumnDefine(!0)},mounted(){this.updateColumnDefine()},methods:{updateColumnDefine(e=!1){if(this.$props.index!==void 0&&typeof this.$props.index=="number"){this.updateColumnDefineByIndex(e);return}this.updateColumnDefineByParent()},updateColumnDefineByParent(){const e=()=>{const n=this._.parent.vnode.children.default()||[],i=[],s=o=>{Array.isArray(o)&&o.forEach(c=>{var f,d,h;if(Array.isArray(c)){s(c);return}let u=!0;if(((f=c.type)==null?void 0:f.name)==="TableColumn"){u=Object.hasOwnProperty.call(c.props||{},"key");const m={...c.props,field:c.props.prop||c.props.field,render:(d=c.children)==null?void 0:d.default};i.push(a.unref(m))}(h=c.children)!=null&&h.length&&u&&s(c.children)})};s(n),this.initColumns(i)};typeof this.bkTableCache.queueStack=="function"&&this.bkTableCache.queueStack(NL,e)},updateColumnDefineByIndex(e=!1){const t={...this.$props,field:this.$props.prop||this.$props.field,render:this.$slots.default};this.initColumns(a.unref(t),e)}},render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{}})])}});class AL{constructor(){De(this,"storage");this.storage={}}queueStack(t,n=()=>{}){this.storage[t]&&clearTimeout(this.storage[t]),this.storage[t]=setTimeout(()=>n())}clearQueueStack(t){this.storage[t]&&clearTimeout(this.storage[t])}}var Vn=(e=>(e.ON_SORT_BY_CLICK="onSortByClick",e.ON_FILTER_CLICK="onFilterClick",e.ON_SETTING_CHANGE="onSettingChange",e.ON_ROW_EXPAND_CLICK="onRowExpandClick",e.ON_ROW_CHECK="onRowCheck",e))(Vn||{}),Ot=(e=>(e.COLUMN_PICK="columnPick",e.COLUMN_SORT="columnSort",e.COLUMN_FILTER="columnFilter",e.COLUMN_FILTER_SAVE="colFilterSave",e.ROW_CLICK="rowClick",e.ROW_DBL_CLICK="rowDblclick",e.ROW_EXPAND_CLICK="rowExpand",e.ROW_MOUSE_ENTER="rowMouseEnter",e.ROW_MOUSE_LEAVE="rowMouseLeave",e.PAGE_LIMIT_CHANGE="pageLimitChange",e.PAGE_VALUE_CHANGE="pageValueChange",e.SETTING_CHANGE="settingChange",e.SCROLL_BOTTOM="scrollBottom",e.ROW_SELECT="select",e.ROW_SELECT_ALL="selectAll",e.ROW_SELECT_CHANGE="selectionChange",e.CELL_CLICK="cellClick",e.CELL_DBL_CLICK="cellDblclick",e.NATIVE_CLICK="click",e.NATIVE_DBL_CLICK="dblclick",e))(Ot||{});const PL=e=>!0,zL=e=>!0,VL=e=>!0,RL=e=>!0,sl=(e,t,n,i,s)=>!0,JL=e=>!0,_L=e=>!0,QL=e=>!0,WL=e=>!0,U3=e=>!0,HL=e=>!0,K3=e=>!0,FL=e=>!0,BL={columnPick:PL,columnFilter:zL,columnSort:RL,colFilterSave:VL,rowClick:sl,rowDblclick:sl,rowExpand:JL,select:_L,selectAll:QL,selectionChange:WL,pageLimitChange:U3,pageValueChange:U3,settingChange:HL,scrollBottom:FL,cellClick:K3,cellDblclick:K3,rowMouseEnter:sl,rowMouseLeave:sl},X3=(e,t)=>{if(e){if(typeof e=="object"){let n=Object.prototype.hasOwnProperty.call(e,"current")?e.current:e.value;return/\d+/.test(n)||(n=1),{...t,...e,current:n}}return t}return{}},$L=(e,t)=>{const n=a.ref(0),i=a.ref(0);let s=a.reactive({count:0,limit:10,current:1,align:"right",layout:["total","limit","list"]});s=X3(e.pagination,s);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=t.length;return}n.value=(s.current-1)*s.limit,i.value=s.current*s.limit},u=a.reactive([]),f=(y,C,b)=>{typeof C=="function"&&y.sort((x,N)=>C(x,N,b[Kn.SORT_TYPE]))},d=(y,C)=>{if(typeof C=="function"){const b=y.filter((x,N)=>C(x,N,t));y.length=0,y.push(...b)}},h=(y,C,b)=>{const x=t.slice(),{sortScope:N}=(b==null?void 0:b.sort)??{};N===e1.ALL&&f(x,C,b),u.length=0,u.push(...x.slice(n.value,i.value)),d(u,y),f(u,C,b)},m=(y,C,b)=>{s=X3(e.pagination,s),p(),c(),h(y,C,b)},p=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},GL=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:_a.Normal,mode:lh.Default,indicator:null}:n.value,s=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,u;if(s.value){const{loading:f,size:d,mode:h,title:m,inline:p,indicator:y}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode(ua,{loading:f,size:d,mode:h,title:m,inline:p,indicator:y},null)}}}};function ZL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const YL=e=>{const{proxy:t}=a.getCurrentInstance(),n=a.ref(t.limit);a.watch(()=>t.limit,c=>{n.value=c}),a.watch(()=>t.limitList,c=>{a.nextTick(()=>{c.includes(n.value)||([n.value]=c)})},{immediate:!0});const i=c=>{n.value=c},{resolveClassName:s}=Ce();return{limit:n,render:({isFirst:c,isLast:u})=>{let f;return t.showLimit?a.createVNode("div",a.mergeProps({class:{[s("pagination-limit")]:!0,"is-first":c,"is-last":u}},{disabled:t.disabled}),[a.createVNode("div",null,[e.value.eachPage]),a.createVNode(yh,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},ZL(f=t.limitList.map((d,h)=>a.createVNode(Al,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Da=5,UL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),s=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{s.value=!1,o.value=!1;const C=[];if(e.totalPageNum<=Da+2){for(let N=2;N<=e.totalPageNum-1;N++)C.push(N);return C}const b=Math.floor(Da/2);e.totalPageNum>Da&&(s.value=t.value-b>2,o.value=t.value+b<e.totalPageNum-1);const x=Math.min(e.totalPageNum-Da,Math.max(2,t.value-b));for(let N=x;N<x+Da;N++)C.push(N);return C});a.watch(()=>e.modelValue,C=>{a.nextTick(()=>{C>=1&&C<=e.totalPageNum?t.value=C:C<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,C=>{t.value>C&&(t.value=C)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=C=>{C!==t.value&&(t.value=C)},h=()=>{t.value=Math.max(1,t.value-Da)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Da)},{resolveClassName:p}=Ce();return{current:t,render:({isFirst:C,isLast:b})=>a.createVNode("div",{class:{[`${p("pagination-list")}`]:!0,"is-first":C,"is-last":b}},[a.createVNode("div",{class:{[`${p("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(bi,null,null)]),a.createVNode("div",{class:{[`${p("pagination-list-item")}`]:!0,"is-active":t.value===1},key:"1",onClick:()=>d(1)},[a.createTextVNode("1")]),s.value&&a.createVNode("div",{key:"pre-batch",class:`${p("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(zs,null,null)]),c.value.map(x=>a.createVNode("div",{class:{[`${p("pagination-list-item")}`]:!0,"is-active":t.value===x},key:x,onClick:()=>d(x)},[x])),o.value&&a.createVNode("div",{key:"next-batch",class:`${p("pagination-list-next-batch")}`,onClick:m},[a.createVNode(zs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${p("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${p("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(Qn,null,null)])])}},KL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),s=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const u=a.computed(()=>{const N=[];for(let S=1;S<=e.totalPageNum;S++)N.push(S);return N});a.watch(()=>e.modelValue,N=>{a.nextTick(()=>{N>=1&&N<=e.totalPageNum?i.value=N:N<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,N=>{i.value>N&&(i.value=N)})});const f=()=>{s.value||(i.value=i.value-1)},d=()=>{o.value||(i.value=i.value+1)},h=()=>{n.value=!0},m=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},p=N=>{const S=N.target,M=Number(S.textContent);!M||M<1||M>e.totalPageNum||M===i.value||(c=M)},y=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},C=N=>{c=N,m()},{resolveClassName:b}=Ce();return{current:i,render:()=>a.createVNode("div",{class:`${b("pagination-small-list")}`},[a.createVNode("div",{class:{[`${b("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(bi,null,null)]),a.createVNode(Ut,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${b("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${b("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:p,onKeydown:y},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${b("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${b("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>C(N)},[N]))])}),a.createVNode("div",{class:{[`${b("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(Qn,null,null)])])}},XL=e=>({isFirst:t,isLast:n})=>{const{props:i}=a.getCurrentInstance();if(!i.showTotalCount)return null;const{resolveClassName:s}=Ce();return a.createVNode("div",a.mergeProps({class:{[`${s("pagination-total")}`]:!0,"is-first":t,"is-last":n}},{disabled:i.disabled}),[e.value.total,a.createVNode("div",{class:`${s("pagination-total-num")}`},[i.count]),e.value.strip])},qL={modelValue:v.number.def(1),count:v.number.def(0).isRequired,limit:v.number.def(10),limitList:v.arrayOf(Number).def([10,20,50,100]),showLimit:v.bool.def(!0),type:v.oneOf(["default","compact"]).def("default"),location:v.oneOf(["left","right"]).def("right"),align:v.oneOf(["left","center","right"]).def("left"),size:v.size(),small:v.bool.def(!1),showTotalCount:v.bool.def(!0),prevText:v.string,nextText:v.string,disabled:v.bool.def(!1),beforeChange:v.func,layout:v.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},eT=a.defineComponent({name:"Pagination",props:qL,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ft("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=XL(n),{current:u,render:f}=UL(),{current:d,render:h}=KL(),{limit:m,render:p}=YL(n);a.watch([s,m,o],([C,b])=>{const x=Math.ceil(C/b);i.value=x<1?1:x},{immediate:!0}),a.watch(u,C=>{t.emit("update:modelValue",C),t.emit("change",C)}),a.watch(d,C=>{e.small&&(t.emit("update:modelValue",C),t.emit("change",C))}),a.watch(m,C=>{t.emit("limitChange",C)});const{resolveClassName:y}=Ce();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:p,renderSmallList:h,resolveClassName:y}},render(){const e=Pe({[`${this.resolveClassName("pagination")}`]:!0,[`${this.resolveClassName(`pagination--${this.size}`)}`]:!0,[`is-align-${this.align}`]:!0}),t={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return a.createVNode("div",{class:e},[this.layout.map((n,i)=>t[n]({isFirst:i===0,isLast:i===this.layout.length-1}))])}}),Nh=Ue(eT);var a1=function(){if(typeof Map<"u")return Map;function e(t,n){var i=-1;return t.some(function(s,o){return s[0]===n?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var i=e(this.__entries__,n),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(n,i){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=i:this.__entries__.push([n,i])},t.prototype.delete=function(n){var i=this.__entries__,s=e(i,n);~s&&i.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(i,c[1],c[0])}},t}()}(),Xd=typeof window<"u"&&typeof document<"u"&&window.document===document,zl=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),tT=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(zl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),nT=2;function iT(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){tT(o)}function u(){var f=Date.now();if(n){if(f-s<nT)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var aT=20,rT=["top","right","bottom","left","width","height","size","weight"],sT=typeof MutationObserver<"u",oT=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=iT(this.refresh.bind(this),aT)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,i=n.indexOf(t);~i&&n.splice(i,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!Xd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sT?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Xd||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=n===void 0?"":n,s=rT.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),r1=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},Qr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||zl},s1=Ac(0,0,0,0);function Vl(e){return parseFloat(e)||0}function q3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(i,s){var o=e["border-"+s+"-width"];return i+Vl(o)},0)}function lT(e){for(var t=["top","right","bottom","left"],n={},i=0,s=t;i<s.length;i++){var o=s[i],c=e["padding-"+o];n[o]=Vl(c)}return n}function cT(e){var t=e.getBBox();return Ac(0,0,t.width,t.height)}function uT(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return s1;var i=Qr(e).getComputedStyle(e),s=lT(i),o=s.left+s.right,c=s.top+s.bottom,u=Vl(i.width),f=Vl(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=q3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=q3(i,"top","bottom")+c)),!fT(e)){var d=Math.round(u+o)-t,h=Math.round(f+c)-n;Math.abs(d)!==1&&(u-=d),Math.abs(h)!==1&&(f-=h)}return Ac(s.left,s.top,u,f)}var dT=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Qr(e).SVGGraphicsElement}:function(e){return e instanceof Qr(e).SVGElement&&typeof e.getBBox=="function"}}();function fT(e){return e===Qr(e).document.documentElement}function hT(e){return Xd?dT(e)?cT(e):uT(e):s1}function gT(e){var t=e.x,n=e.y,i=e.width,s=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return r1(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function Ac(e,t,n,i){return{x:e,y:t,width:n,height:i}}var mT=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ac(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=hT(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),pT=function(){function e(t,n){var i=gT(n);r1(this,{target:t,contentRect:i})}return e}(),vT=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new a1,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=i}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Qr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new mT(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Qr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(i){return new pT(i.target,i.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),o1=typeof WeakMap<"u"?new WeakMap:new a1,l1=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=oT.getInstance(),i=new vT(t,n,this);o1.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){l1.prototype[e]=function(){var t;return(t=o1.get(this))[e].apply(t,arguments)}});var yT=function(){return typeof zl.ResizeObserver<"u"?zl.ResizeObserver:l1}();const Et=(e,t,n)=>{if(e!=null){if(typeof t=="string")return Object.prototype.hasOwnProperty.call(e,t)?typeof e[t]=="function"?e[t].call(globalThis,...n):e[t]:void 0;if(Array.isArray(t))return t.map(i=>Et(e,i,n)).filter(i=>i!==void 0).at(0)}},yd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],CT=e=>c1(e,"auto"),c1=(e,t="100%",n=null)=>{let i="";return/^auto|null|undefined$/ig.test(`${e}`)?i=t:i=/^\d+\.?\d+$/.test(`${e}`)?`${e}px`:e,n&&(i=`calc(${i} - ${n})`),i},bT=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>CL.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Ss=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],Cd=(e,t,n=oa,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:p=void 0}=h;if(p===void 0)return m<oa?oa:m;let y=m;return/^\d+\.?\d*$/.test(`${p}`)&&(y=Number(p)),/^\d+\.?\d*%$/.test(`${p}`)&&(y=Number(p)*o/100),/^\d+\.?\d*px$/i.test(`${p}`)&&(y=Number(`${p}`.replace(/px/i,""))),y},d=(h,m,p=!0)=>{const y=f(h,m),C=m<y?y:m;Object.assign(h,{calcWidth:C}),p&&(c=c-C,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const y=String(Ss(h,["resizeWidth","width"]));let C=!0;if(/^\d+\.?\d*(px)?$/.test(y)){const b=Number(y.replace("px",""));d(h,b),C=!1}if(/^\d+\.?\d*%$/.test(y)){let b=n;if(c>0){const x=Number(y.replace("%",""));b=c*x/100}d(h,b),C=!1}C&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,p)=>{h=c/(u.length-p),d(t[m],h,!1);const{calcWidth:y}=t[m];c=c-y}):u.forEach(m=>{const p=f(t[m],oa);Object.assign(t[m],{calcWidth:p})})}},u1=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?at.debounce(o,n):at.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new yT(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},qd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},Rl=(e,t,n)=>n.type==="index"?e[Be.ROW_INDEX]+1:at.get(e,t),bs=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?bs(Reflect.apply(e,globalThis,t),t):[],d1=(e,t,n)=>{const i=f1(e,t,n);return i!==null?i:Ri.v4()},f1=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Be.ROW_INDEX?`__ROW_INDEX_${n}`:at.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,wT=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},h1=(e,t,n)=>(s=>e.some(o=>o.field===Et(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Et(t,["field","type"],[t])),e6=(e,t,n,i,s)=>typeof e[s]=="function"?Reflect.apply(e[s],globalThis,[{column:e,colIndex:t,row:n,rowIndex:i}]):typeof e[s]=="number"?e[s]:1,g1=(e,t,n,i)=>{const s=e6(e,t,n,i,"colspan"),o=e6(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},m1=(e,t)=>{var c,u;const n=e.field,i=f=>Rl(f,n,e),s=(f,d)=>{const h=i(f)||"",m=i(d)||"";return typeof h=="number"&&typeof m=="number"?h-m:String.prototype.localeCompare.call(h,m)},o=typeof((c=e.sort)==null?void 0:c.sortFn)=="function"?(u=e.sort)==null?void 0:u.sortFn:s;return t===Rt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Rt.DESC?-1:1)},p1=e=>{const t={[Rt.NULL]:0,[Rt.ASC]:1,[Rt.DESC]:2};return t[e]===void 0?Rt.NULL:Object.keys(t)[(t[e]+1)%3]},v1=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Rt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},Cl=(e,{row:t,index:n,isCheckAll:i})=>typeof e.isRowSelectEnable=="boolean"?e.isRowSelectEnable!==!1:typeof e.isRowSelectEnable=="function"?e.isRowSelectEnable({row:t,index:n,isCheckAll:i}):!0,NT=(e,t,n)=>{if(e[Be.ROW_UID]!==void 0)return e[Be.ROW_UID];const i=d1(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},ks=e=>a.unref(e[Be.ROW_SOURCE_DATA]||e),y1=e=>a.unref(e[Kn.COL_SOURCE_DATA]||e),t6=a.defineComponent({name:"TableCell",props:{column:io,row:v.any.def({}),parentSetting:wh,title:v.string.def(void 0),observerResize:v.bool.def(!0),isHead:v.bool.def(!1),headExplain:v.string,resizerWay:Se("ResizerWay",{default:t1.DEBOUNCE})},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),s=a.computed(()=>({textAlign:e.column.textAlign})),o=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:c=!1}=o();let u=null;const f=()=>{var N;let p=!0,{resizerWay:y}=e,C=n.value.innerText,b="auto",x=!0;return typeof c=="boolean"&&(p=!c),typeof c=="object"&&(p=c.disabled,y=c.resizerWay||"debounce",C=c.content||n.value.innerText,typeof c.content=="function"&&(C=c.content(e.column,e.row)),x=c.watchCellResize,b=c.mode||"auto"),typeof p=="function"&&(p=Reflect.apply(p,this,[e.column,e.row])),e.isHead&&(p=!1,b="auto",C=(N=d())==null?void 0:N.innerHTML,e.headExplain&&(b="static",C=e.headExplain)),e.column.explain&&(p=!1,b="static",typeof e.column.explain=="object"&&(C=Et(e.column.explain,"content",[e.column,e.row]))),{disabled:p,content:C,mode:b,resizerWay:y,watchCellResize:x}},d=()=>{var p,y;return e.isHead?(y=(p=n.value)==null?void 0:p.querySelector)==null?void 0:y.call(p,".head-text"):n.value},h=()=>{const p=d();if(!p||!Ra(p))return;const{mode:y,disabled:C}=f();if(i.value=!C,y==="auto"&&(i.value=a8(p)),y==="static"&&(i.value=!0),i.value){const b=a.ref(f());u===null&&(u=ph(p,{disabled:b.value.disabled,content:b.value.content,mode:b.value.mode}))}else u==null||u.destroyInstance(p),u=null};a.onMounted(()=>{const{disabled:p,resizerWay:y,watchCellResize:C}=f();if(!p&&(h(),C!==!1&&e.observerResize)){let b=u1(n.value,()=>{h()},60,!0,y);b.start(),a.onBeforeUnmount(()=>{b.disconnect(),b=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)});const m=e.headExplain||e.column.explain;return()=>{var p;return a.createVNode("div",{class:["cell",e.column.type,m?"explain":""],style:s.value,ref:n,title:e.title},[(p=t.default)==null?void 0:p.call(t)])}}}),bd=a.defineComponent({name:"TableRow",render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});class MT{constructor(t,n){De(this,"props",null);De(this,"ctx",null);this.props=t,this.ctx=n}}const IT=a.defineComponent({name:"BodyEmpty",props:{list:v.array.def([]),filterList:v.array.def([]),emptyText:v.string},emits:["change"],setup(e){const t=ft("table"),n=a.computed(()=>e.emptyText===void 0?t.value.emptyText:e.emptyText),i=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(Oc,{scene:"part",type:i.value,description:n.value},null)}}),LT=a.defineComponent({name:"HeadFilter",props:{column:io,height:v.number.def(sa)},emits:["change","filterSave"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ft("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.computed(()=>{var P;return((P=o.value)==null?void 0:P.checked)??[]}),u=a.reactive({isOpen:!1,checked:c.value});a.watch(()=>o.value,()=>{u.checked=c.value},{immediate:!0,deep:!0});const f=a.computed(()=>Pe({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Pe({[n("table-head-filter")]:!0}),h=a.ref(null),m=P=>{u.isOpen=P,P&&setTimeout(()=>{h.value.reset()})},p=`light ${n("table-head-filter")}`,y=a.computed(()=>{const{list:P=[]}=o.value;return P}),C=(P,A="ig")=>new RegExp(`${P}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),A),b=(P,A)=>{const{match:_}=o.value,W=Rl(A,Et(s,"field",[s,A]),s);return _==="full"&&P.includes(W),P.some(H=>C(H,"img").test(W))},x=typeof o.value.filterFn=="function"?(P,A,_,W)=>o.value.filterFn(P,A,e.column,_,W):(P,A)=>P.length?b(P,A):!0,N=()=>{S(!0),t("filterSave",[...u.checked]),u.isOpen=!1},S=(P=!1)=>{const{disabled:A}=I(L,i.value.confirm);if(A||P){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],x)}},M=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,x)))},I=(P,A)=>({disabled:P==="disabled"||P===!1,text:typeof P=="string"?P:A}),{btnSave:L,btnReset:T}=o.value,V=()=>{const{disabled:P,text:A}=I(L,i.value.confirm);return P?a.createVNode("span",{class:"btn-filter-save disabled"},[A]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[A])},k=()=>{const{disabled:P,text:A}=I(T,i.value.reset);return P?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:M},[A])},E=(P,A)=>{const _=new Set(u.checked);P?_.add(A.value):_.delete(A.value),u.checked.length=0,u.checked.push(...Array.from(_)),S()},O=P=>P.data.length?P.data.map(A=>a.createVNode("div",{class:"list-item"},[a.createVNode(qn,{label:A.value,key:A.$index,immediateEmitChange:!1,checked:u.checked.includes(A.value),modelValue:u.checked.includes(A.value),onChange:_=>E(_,A)},{default:()=>[`${A.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Ut,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:ql.SHOWN,arrow:!1,offset:0},{theme:p},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(Cc,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(jc,{class:"content-list"},{default:()=>[a.createVNode(Br,{lineHeight:32,list:y.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:O})]}),a.createVNode("div",{class:"content-footer"},[V(),a.createVNode("span",{class:"btn-filter-split"},null),k()])])})}}),TT=a.defineComponent({name:"HeadSort",props:{column:io,defaultSort:v.oneOf(IL).def(Rt.NULL),active:v.bool},emits:["change"],setup(e,{emit:t}){var c,u;const{resolveClassName:n}=Ce(),i=((u=(c=e.column)==null?void 0:c.sort)==null?void 0:u.value)||e.defaultSort||Rt.NULL,s=a.ref(i);a.watch(()=>[e.defaultSort],([f])=>{s.value=f});const o=(f,d)=>{f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault();let h=d;d===Rt.NULL&&(h=p1(d)),s.value===d&&(h=Rt.NULL);const m=m1(e.column,h),p=v1(e.column.sort);if((p==null?void 0:p.value)==="custom"){t("change",(p==null?void 0:p.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort")},[a.createVNode(ac,{class:["sort-action","sort-asc",s.value===Rt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Rt.ASC)},null),a.createVNode(Gs,{class:["sort-action","sort-desc",s.value===Rt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Rt.DESC)},null)])}});function n6(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const xT=a.defineComponent({name:"Settings",props:{settings:n1,columns:v.arrayOf(io).def([]),rowHeight:i1.def(sa)},emits:["change"],setup(e,{emit:t,slots:n}){const{resolveClassName:i}=Ce(),s=ft("table"),o=wL(s),c=(H,ie)=>Et(H,["id","field","type"],[H,ie]),u=a.ref(!1),f=a.ref(!1),d=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(H=>({...H,field:H.field||H.type})),checked:[],limit:0,size:"small",sizeList:o,showLineHeight:!0}:e.settings),h=a.ref(d.value.size||"small"),m=a.ref(e.rowHeight),p=a.ref(d.value.checked||[]),C=`light ${i("table-settings")}`,b=a.computed(()=>d.value.fields||e.columns||[]),x={checkAll:u.value,activeSize:h.value,activeHeight:m.value,checkedFields:d.value.checked||[]},N=()=>{Object.assign(x,{checkAll:u.value,activeSize:h.value,activeHeight:m.value,checkedFields:p.value}),t("change",{checked:p.value,size:h.value,height:m.value,fields:a.unref(b)}),f.value=!1},S=()=>{u.value=x.checkAll,h.value=x.activeSize,m.value=x.activeHeight,p.value=x.checkedFields,f.value=!1},M=()=>{f.value=!0},I=H=>{H.stopImmediatePropagation(),H.stopPropagation(),H.preventDefault(),u.value=!u.value;const ie=d.value.fields||e.columns||[],fe=ie.filter((de,re)=>de.disabled&&p.value.includes(c(de,re))).map((de,re)=>c(de,re));if(u.value){const de=ie.filter(re=>!re.disabled).map((re,ve)=>c(re,ve));p.value.splice(0,p.value.length,...de,...fe)}else p.value.splice(0,p.value.length,...fe)},L=a.computed(()=>(d.value.limit??0)>0),T=d.value.sizeList||o,V=a.computed(()=>L.value&&(d.value.limit?d.value.limit:0)<=p.value.length),k=(H,ie)=>H.disabled||V.value&&!p.value.includes(c(H,ie)),E=H=>{h.value=H.value,m.value=H.height},O=H=>({"line-size":!0,"is-medium":h.value==="medium",active:H.value===h.value}),P={marginRight:"12px"},A=()=>T.map(H=>a.createVNode("span",{class:O(H),onClick:()=>E(H)},[H.label])),_=a.computed(()=>p.value.length>0&&!b.value.every((H,ie)=>p.value.includes(Et(H,"field",[H,ie])))),W=a.computed(()=>typeof d.value.showLineHeight=="boolean"?d.value.showLineHeight:!0);return a.watch(()=>[p.value],()=>{p.value.length||(u.value=!1),p.value.length&&b.value.every((H,ie)=>p.value.includes(c(H,ie)))&&(u.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{p.value.splice(0,p.value.length,...d.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Ut,a.mergeProps({trigger:"manual",isShow:f.value,placement:"bottom-end",arrow:!0},{theme:C}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:M},[a.createVNode(uc,{style:"color: #c4c6cc;"},null)]),content:()=>{var ie;let H;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[s.value.setting.title]),a.createVNode(Ys,{class:"icon-close-action",onClick:S},null)]),a.createVNode("div",{class:"setting-body"},[a.createVNode("div",{class:"setting-body-title"},[a.createVNode("div",null,[a.createVNode("span",{class:"field-setting-label"},[s.value.setting.fields.title]),L.value?a.createVNode("span",{class:"limit"},[s.value.setting.fields.subtitle(d.value.limit)]):""]),L.value?"":a.createVNode("span",{class:"check-all",onClick:I},[a.createVNode(qn,{label:s.value.setting.fields.selectAll,indeterminate:!!_.value,modelValue:p.value.length>0},{default:()=>[s.value.setting.fields.selectAll]})])]),a.createVNode(jc,{class:"setting-body-fields",modelValue:p.value,"onUpdate:modelValue":fe=>p.value=fe},n6(H=b.value.map((fe,de)=>{let re;return a.createVNode("div",{class:"field-item"},[a.createVNode(qn,{checked:p.value.includes(c(fe,de)),label:c(fe,de),disabled:k(fe,de)},n6(re=Et(fe,["name","label"],[fe,de]))?re:{default:()=>[re]})])}))?H:{default:()=>[H]}),(ie=n.default)==null?void 0:ie.call(n),W.value?a.createVNode("div",{class:"setting-body-line-height"},[s.value.setting.lineHeight.title,a.createTextVNode(":"),A()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(Pt,{theme:"primary",style:P,onClick:N},{default:()=>[s.value.setting.options.ok]}),a.createVNode(Pt,{style:P,onClick:S},{default:()=>[s.value.setting.options.cancel]})])])}}):""}}),ef=(e,t,n)=>{const i=(p,y,C)=>({column_fixed:!!p.fixed,column_fixed_left:p.fixed!=="right",column_fixed_right:p.fixed==="right",shadow:p.fixed==="right"?C-y>2:y>0}),s=p=>p.fixed==="right"?"right":"left",o={left:(p=!0)=>t.filter(y=>!y.isHidden&&y.fixed&&y.fixed!=="right").reduce((y,C,b)=>p&&b===0?y:y+Ss(C),0),right:(p=!0)=>t.filter(y=>!y.isHidden&&y.fixed==="right").reduce((y,C,b)=>p&&b===0?y:y+Ss(C),n?_r:0)},c=(p,y,C=0)=>{const b=y[Kn.COL_UID],x=p==="right"?-1:1,N=t.filter(L=>!L.isHidden),{length:S}=N;let M=p==="right"?S*x:1,I=0;for(M;;){M=M+-1*x;const L=Math.abs(M),T=N[L],V=s(T),k=T[Kn.COL_UID];if(V===p&&b!==k){const E=Ss(T);I=I+E}if(b===k)break}return I+C},u=(p,y=!1)=>{if(!p.fixed||p.isHidden)return{};const C={left:0,right:y?_r:-1},b=s(p);return C[b]=c(b,p,C[b]),{[b]:`${C[b]}px`}},f=p=>({width:`${o[p](!1)}px`,backgroundColor:e.thead.color,bottom:"0px"}),d=a.computed(()=>{const p={left:!1,right:!1};return t.filter(y=>!y.isHidden&&y.fixed).map(y=>{const C=s(y),b=p[C];return p[C]=!0,{isExist:b,colPos:C,column:y}})}),{resolveClassName:h}=Ce();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function i6(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class ST{constructor(t,n,i,s,o,c){De(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Et(this.setting,"height",["tbody",t,n,i]):Et(this.props,"rowHeight",["tbody",t,n])});De(this,"getColumnClass",(t,n)=>({[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right",[`${t.className}`]:!0}));De(this,"getHeadColumnClass",(t,n)=>({...this.getColumnClass(t,n),active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=s,this.plugins=new MT(t,n),this.uuid=Ri.v4(),this.events=new Map,this.styleRef=o,this.t=c,this.activeSortIndex=a.ref(-1)}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=qd(this.props);if(!t)return null;const n=i=>{var f;const{checked:s=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c;const u=((f=this.props.settings)==null?void 0:f.fields)||[];s.length&&this.colgroups.forEach(d=>{d.isHidden=h1(u,d,s)}),this.emitEvent(Vn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(xT,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},{default:()=>{var i,s;return[(s=(i=this.context.slots).setting)==null?void 0:s.call(i)]}}):"",a.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])]}renderTableBodySchema(t){var i,s;const n=a.computed(()=>this.props.emptyText===void 0?this.t.value.emptyText:this.props.emptyText);return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):((s=(i=this.context.slots).empty)==null?void 0:s.call(i))??a.createVNode(IT,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(Nh,a.mergeProps({style:"width: 100%;"},t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.handlePageChange(n)}),null)}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),this}destroy(){this.events.clear(),this.events=null}emitEvent(t,n){this.events.has(t)&&this.events.get(t).forEach(i=>{typeof i=="function"&&Reflect.apply(i,this,n)})}handlePageLimitChange(t){Object.assign(this.props.pagination,{limit:t}),this.context.emit(Ot.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Ot.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(s=>s.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(s=>s.index!==t&&s.active).forEach(s=>{Object.assign(s,{active:!1})})}handleColumnHeadClick(t,n){if(this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(Ot.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Et(n,["field","type"],[n,t]),s=p1(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=m1(n,s);this.activeSortIndex.value=t,this.emitEvent(Vn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Et(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Vn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i]||t.sort.value||Rt.NULL;return a.createVNode(TT,{column:t,defaultSort:o,active:this.activeSortIndex.value===n,onChange:s},null)}getFilterCell(t,n){const i=(o,c)=>{const u=(f,d)=>c(o,f,d);this.emitEvent(Vn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(Ot.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(LT,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=qd(this.props),{cellFn:n}=t,i={"--row-height":`${Et(t,"height",["thead"])}px`,backgroundColor:this.props.thead.color},s=(d,h)=>typeof n=="function"?n(d,h):typeof d.renderHead=="function"?d.renderHead(d,h):Et(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const b=this.reactiveProp.rowActions.get(Be.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Be.ROW_SELECTION]:!!b},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const p=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[p]));const y=typeof p=="string"?p:void 0,C={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(t6,{class:C,title:y,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay,isHead:!0,headExplain:Et(d.explain,"head",[d])},i6(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const p=m.split("_").slice(-1)[0];return Object.assign(h,{[p]:y=>{d.listeners.get(m).forEach(C=>Reflect.apply(C,this,[y,d,this]))}})},{}),{resolveFixedColumnStyle:u}=ef(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${_r+2}px`,right:"-1px"};return a.createVNode("th",{style:d,class:"column_fixed"},null)}};return a.createVNode(a.Fragment,null,[a.createVNode("thead",{style:i},[a.createVNode(bd,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>{var p;const m=Object.assign({},u(d,this.styleRef.value.hasScrollY),{backgroundColor:bL[((p=this.props.thead)==null?void 0:p.color)??bh.DEF1]});return a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:[this.getHeadColumnClass(d,h),this.getColumnCustomClass(d),d.align||this.props.headerAlign||this.props.align],style:m,onClick:()=>this.handleColumnHeadClick(h,d)},c(d)),[o(d,h)])}),f()])]})])])}getColumnCustomClass(t,n){const i=t.className;if(i){if(typeof i=="function")return i(n);if(typeof i=="string")return i}return""}renderTBody(t){const{resolveFixedColumnStyle:n}=ef(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...bs(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...bs(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`,o%2===1&&this.props.stripe?"stripe-row":""];return[a.createVNode(bd,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:f1(s,this.props,o),onClick:f=>this.handleRowClick(f,s,o,t),onDblclick:f=>this.handleRowDblClick(f,s,o,t),onMouseenter:f=>this.handleRowEnter(f,s,o,t),onMouseleave:f=>this.handleRowLeave(f,s,o,t)},[this.filterColGroups.map((f,d)=>{var S;const h=[n(f),...bs(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:p,rowspan:y}=g1(f,d,s,o),C=Be.ROW_SKIP_CFG,b=f[Kn.COL_UID],{skipRow:x=!1,skipCol:N=!1}=((S=s[C])==null?void 0:S[b])??{};if(!x&&!N){let M;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...bs(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[Be.ROW_EXPAND],"is-last":o+y>=i}],L=(T,V)=>{const k={event:T,row:ks(s),column:y1(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(V,k)};return a.createVNode("td",{class:I,style:h,colspan:p,rowspan:y,onClick:T=>L(T,Ot.CELL_CLICK),onDblclick:T=>L(T,Ot.CELL_DBL_CLICK)},[a.createVNode(t6,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},i6(M=this.renderCell(s,f,o,t))?M:{default:()=>[M]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[Be.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${NT(t,i,this.props)}_expand`;return a.createVNode(bd,{key:u},{default:()=>{var f,d;return[a.createVNode("tr",{class:o},[a.createVNode("td",{colspan:this.filterColGroups.length,rowspan:1},[((d=(f=this.context.slots).expandRow)==null?void 0:d.call(f,ks(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(Ot.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(Ot.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[Be.ROW_EXPAND]?a.createVNode(Us,null,null):a.createVNode(eo,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Vn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=Rl(t,Et(n,"field",[n,t]),n),c=t[Be.ROW_INDEX],u=typeof c=="number"?c:i,f=this.props.data[u];return n.render({cell:o,data:f,row:t,column:n,index:i,rows:s})}renderCheckboxColumn(t,n,i=!1){const s=u=>{this.emitEvent(Vn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get(Be.ROW_SELECTION_INDETERMINATE),c=Cl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode(qn,{onChange:s,disabled:!c,modelValue:t[Be.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,s){const o=()=>{var c,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):((u=(c=this.context.slots).expandCell)==null?void 0:u.call(c,{row:t,column:n,index:i,rows:s}))??this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,s,c)},[o()])}renderCell(t,n,i,s){var u;const o=()=>{const f=Rl(t,Et(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):typeof f=="object"?JSON.stringify(a.unref(f)):f},c={expand:(f,d,h,m)=>this.renderExpandColumn(f,d,h,m),selection:(f,d,h,m)=>this.renderCheckboxColumn(f,h)};return((u=c[n.type])==null?void 0:u.call(c,t,n,i,s))??o()}isColActive(t){return this.props.columnPick!=="disabled"&&this.propActiveCols.some(n=>n.index===t&&n.active)}renderColGroup(){return a.createVNode("colgroup",null,[(this.filterColGroups||[]).map((t,n)=>{const i=Pe({active:this.isColActive(n)}),s=`${CT(Ss(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:s},null)})])}get filterColGroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}const Pc=(e,t)=>({initColumns:(s,o=!1)=>{let c=[];if(Array.isArray(s)?c=s:c=[s],o)c.forEach(u=>{const f=t.findIndex(d=>d.label===u.label&&d.field===u.field);if(o){f>=0&&t.splice(f,1);return}});else{let u=!1;c.forEach(f=>{if(f.index!==void 0&&f.index>=0){u=!0;const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0&&t.splice(d,1),t.push(f)}else{const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0?t.splice(d,1,f):t.push(f)}}),u&&t.sort((f,d)=>f.index-d.index)}},getColumns:()=>{var s;return t!=null&&t.length?t:(s=e.columns)!=null&&s.length?e.columns:[]}}),a6=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:yd(e.activeColumn):Array.isArray(e.activeColumn)?yd(e.activeColumn[0]):yd(e.activeColumn):[],kT=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Pc(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(a6(e)),o=()=>i().map((c,u)=>({index:u,_column:c,active:s.some(f=>f===u)}));return a.watchEffect(()=>{n=o();const c=a6(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},DT=(e,t=!0)=>{const n="HeadColumnResize";let i=function(I){return I.MOUSE_MOVE="onMousemove",I.MOUSE_OUT="onMouseout",I.MOUSE_DOWN="onMousedown",I}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=I=>{o=!1,c=!1;const L=document.body.style;L.cursor="";const T=I.clientX-u,V=(f.resizeWidth??f.calcWidth)+T,k=Number(f.minWidth);f.resizeWidth=V>k?V:k,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",y),u=0,h.value=-1e3,f=null,I.target.closest("table").querySelectorAll("th").forEach(O=>O.style.setProperty("user-select","inherit"))},p=I=>at.throttle(()=>{const L=I.clientX-u,T=(f.resizeWidth??f.calcWidth)+L;Number(f.minWidth)<T&&(h.value=I.clientX-u+d)},60),y=I=>{document.body.style.setProperty("cursor",""),p(I)()},C=(I,L)=>{var T,V;at.isElement(I)&&((T=I.style)==null||T.setProperty("cursor",L),((V=I.childNodes)==null?void 0:V.length)>0&&I.childNodes.forEach(k=>C(k,L)))},b={[i.MOUSE_DOWN]:(I,L)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=L,u=I.clientX;const V=I.target.closest("table");d=u-V.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",y)},[i.MOUSE_MOVE]:(I,L)=>{o&&!c&&(c=!0);const T=I.target.closest("th");if(c&&T.style.setProperty("user-select","none"),!c){if(!T)return;const V=T.getBoundingClientRect();V.width>12&&V.right-I.pageX<8?(s=!0,C(T,"col-resize")):(C(T,""),s=!1)}},[i.MOUSE_OUT]:(I,L)=>{const T=I.target;c||C(T,"")}},x=I=>`${n}_${I}`,N=()=>{e.forEach(I=>{I.resizable!==!1&&Object.keys(b).forEach(L=>{const T=x(L);I.listeners.has(T)||I.listeners.set(T,[]),I.listeners.get(T).push(b[L])})})},S=()=>{e.forEach(I=>{Object.keys(b).forEach(L=>{const T=x(L);if(I.listeners.has(T)){const V=I.listeners.get(T);V.length=0}})})};t&&N();const M=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:N,resetResizeEvents:S,dragOffsetX:h,dragOffsetXStyle:M}},jT=(e,t,n,i,s)=>{const{getColumns:o}=Pc(e,t),c=a.ref(200),u=a.ref(200),f=a.ref(sa),d=a.ref(!1),h=a.computed(()=>e.pagination&&e.data.length),m=a.computed(()=>d.value),p=a.computed(()=>Pe({[$t("table")]:!0,"has-footer":h.value,"has-scroll-y":d.value||e.virtualEnabled},bT(e.border))),y=Pe({[$t("table-head")]:!0,"has-settings":!!e.settings}),C=a.computed(()=>o()),b=qd(e),x=a.computed(()=>({"--row-height":`${Et(b,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),N={[$t("table-body")]:!0},S=a.computed(()=>Pe({[$t("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),M=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",I=()=>{if(C.value.every(_=>/^\d+\.?\d*(px)?$/ig.test(`${_.width}`))){const _=C.value.reduce((H,ie)=>H+Number(`${ie.width}`.replace(/px/ig,"")),0),W=d.value?_r:0;return`${_+W}px`}return"100%"},L=a.computed(()=>({minHeight:c1(e.minHeight,"auto"),width:I(),maxWidth:"100%",height:M()})),T=(_,W)=>{const H=String(_);if(/^\d+\.?\d*$/.test(H))return Number(H);if(/^\d+\.?\d*px$/ig.test(H))return Number(H.replace("px",""));if(/^\d+\.?\d*%$/ig.test(H)&&typeof W=="number"){const ie=Number(H.replace("%",""));return W*ie/100}return W},V=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),k=()=>e.showHead?T(e.headHeight,sa):0,E=()=>{const _=T(e.height,c.value);f.value=k();const W=T(e.minHeight,c.value),H=e.pagination&&e.data.length?e.paginationHeight:0,ie=_-f.value-H,fe=e.height!=="auto"?`${ie}px`:!1,de=W-f.value-H,re=T(e.maxHeight,void 0),ve=typeof re=="number"?`${re-f.value-H}px`:!1;Object.assign(V,{display:s!=null&&s.length?"block":!1,"min-height":`${de}px`,height:fe,maxHeight:ve})};a.onMounted(()=>{O(n==null?void 0:n.value)});const O=_=>{if(_){const{height:W}=_.parentElement.getBoundingClientRect();c.value=W;const H=_.querySelector(".bk-table-body-content > table");E(),u.value=((H==null?void 0:H.offsetHeight)??W)+f.value,P(_)}},P=_=>{if(!_)return;const W=e.virtualEnabled?`.${$t("virtual-section")}`:`.${$t("table-body-content")}`,H=_.querySelector(`.${$t("table-body")}`);d.value=wT(H,W,0)};return{tableClass:p,headClass:y,contentClass:N,footerClass:S,wrapperStyle:L,contentStyle:V,headStyle:x,fixHeight:u,resetTableHeight:O,updateBorderClass:P,getColumnsWidthOffsetWidth:()=>{let _=0;return d.value&&(_=_+_r),e.border.includes(Pl.OUTER)&&!e.border.includes(Pl.NONE)&&(_=_+2),_},hasFooter:h,hasScrollY:d,hasScrollYRef:m}},OT=(e,t)=>{var ee,$;const n=a.reactive([]),{getColumns:i}=Pc(e,t),s=j=>{if(/^\d+/.test(`${j.minWidth}`))return j.minWidth;let J=oa;return j.sort&&(J=J+18),j.filter&&(J=J+28),J},o=a.computed(()=>i()),c=j=>{var ae,Z;const J=(j==null?void 0:j.checked)||((ae=e.settings)==null?void 0:ae.checked)||[],X=(j==null?void 0:j.fields)||((Z=e.settings)==null?void 0:Z.fields)||[];n.length=0,n.push(...o.value.map(se=>({...se,calcWidth:null,resizeWidth:null,minWidth:s(se),listeners:new Map,isHidden:h1(X,se,J),[Kn.COL_UID]:Ri.v4(),[Kn.COL_SOURCE_DATA]:se})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=DT(n,!0),{activeColumns:m}=kT(e,t);a.watch(()=>[e.settings],()=>{var j;(((j=e.settings)==null?void 0:j.checked)||[]).length&&c()});const p=at.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{p()},{immediate:!0,deep:!0});const y=e.columns.reduce((j,J,X)=>{const ae=Et(J,["field","type"],[J,X]),Z=v1(J.sort);return Z?{...j||{},[ae]:Z==null?void 0:Z.value}:j},null),C=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(ee=e.settings)==null?void 0:ee.size,height:vl[($=e.settings)==null?void 0:$.size]},defaultSort:y||e.defaultSort}),b=j=>{var J;return C.rowActions.has(j)?(J=C.rowActions.get(j))==null?void 0:J.isExpand:!1},x=()=>{Array.isArray(C.defaultSort)&&C.defaultSort.splice(0),C.defaultSort=y||e.defaultSort},N=(j,J=void 0)=>{const X=j[Be.ROW_UID],ae=typeof J=="boolean"?J:!b(X);C.rowActions.set(X,Object.assign({},C.rowActions.get(X)??{},{isExpand:ae})),ve()},S=(j=void 0)=>{_.forEach(J=>{const X=J[Be.ROW_UID],ae=typeof j=="boolean"?j:!b(X);C.rowActions.set(X,Object.assign({},C.rowActions.get(X)??{},{isExpand:ae}))}),ve()},M=()=>C.rowActions.has(Be.ROW_SELECTION_ALL)?C.rowActions.get(Be.ROW_SELECTION_ALL):e.selectionKey?_.every(j=>P(j)):!1,I=j=>{const J=j[Be.ROW_UID],{isSelected:X=!1}=C.rowActions.get(J)||{};return X},L=(j=I)=>{let J=!1,X=!1;_.forEach(ae=>{const Z=j(ae);!J&&!Z&&(J=!0),!X&&Z&&(X=!0)}),C.rowActions.set(Be.ROW_SELECTION_INDETERMINATE,X&&J),C.rowActions.set(Be.ROW_SELECTION_ALL,X&&!J)},T=()=>e.columns.some(j=>j.type==="selection"),V=()=>{T()&&L(j=>P(j))},k=(j=void 0)=>{const J=typeof j=="boolean"?j:!M();C.rowActions.set(Be.ROW_SELECTION_ALL,J),C.rowActions.set(Be.ROW_SELECTION_INDETERMINATE,!1),_.forEach((X,ae)=>{if(Cl(e,{row:X,index:ae,isCheckAll:!1})){const Z=X[Be.ROW_UID],se=Object.assign({},C.rowActions.get(Z)??{},{isSelected:J});C.rowActions.set(Z,se)}}),L(),ve(J),F(null,j,!0)},E=()=>{k(!1)},O=(j,J)=>{const X=j[Be.ROW_UID];if(X){const ae=typeof J=="boolean"?J:!A(j,X),Z=Object.assign({},C.rowActions.get(X)??{},{isSelected:ae});C.rowActions.set(X,Z),J||C.rowActions.set(Be.ROW_SELECTION_ALL,!1),L(),ve(),F(j,J,!1)}},P=(j,J=X=>I(X))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:j,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?at.get(j,e.selectionKey):J(j),A=(j,J,X)=>P(j,()=>{var Z;const ae=J===void 0?j[Be.ROW_UID]:J;return Cl(e,{row:j,index:X,isCheckAll:!1})&&M()?!0:C.rowActions.has(ae)?(Z=C.rowActions.get(ae))==null?void 0:Z.isSelected:!1}),_=a.reactive([]),W=a.computed(()=>n.some(j=>typeof j.rowspan=="function"||/^\d$/.test(`${j.rowspan}`)||typeof j.colspan=="function"||/^\d$/.test(`${j.colspan}`))),H=a.computed(()=>n.some(j=>j.type==="selection")),ie=a.computed(()=>n.some(j=>j.type==="expand")),fe=a.computed(()=>n.some(j=>j.type==="index")),de=(j=!1)=>{let J=null;const X={},ae=e.data.map(Z=>({[Be.ROW_UID]:Ri.v4(),...Z}));if(W.value||H.value||ie.value||fe.value){const Z=ae.map((se,ye)=>{const Me=d1(se,e,ye);J=Me;const je={...se,[Be.ROW_UID]:se[Be.ROW_UID]||Me,[Be.ROW_SOURCE_DATA]:{...se}};if(W.value){const Ae=G(se,Me,ye,X,J);Object.assign(je,{[Be.ROW_SKIP_CFG]:Ae})}return H.value&&Object.assign(je,{[Be.ROW_SELECTION]:A(se,Me,ye)}),fe.value&&Object.assign(je,{[Be.ROW_INDEX]:ye}),ie.value&&Object.assign(je,{[Be.ROW_EXPAND]:j?b(Me):!1}),je});_.length=0,_.push(...Z),H.value&&V();return}_.length=0,_.push(...ae)},re=(j,J,X,ae)=>{const Z=A(X,X[Be.ROW_UID],ae);return j&&typeof J=="boolean"?J:Z},ve=j=>{if(W.value||H.value||ie.value||fe.value){let J=null;const X={};_.forEach((ae,Z)=>{const se=ae[Be.ROW_UID];if(ie.value&&Object.assign(ae,{[Be.ROW_EXPAND]:b(ae[Be.ROW_UID])}),W.value){const ye=G(ae,se,Z,X,J);J=ae[Be.ROW_UID],Object.assign(ae,{[Be.ROW_SKIP_CFG]:ye})}if(fe.value&&Object.assign(ae,{[Be.ROW_INDEX]:Z}),H.value){const ye=Cl(e,{row:ae,index:Z,isCheckAll:!1});Object.assign(ae,{[Be.ROW_SELECTION]:re(ye,j,ae,Z)})}}),H.value&&typeof j!="boolean"&&V();return}},G=(j,J,X,ae,Z)=>{let se=0;const ye=ae[Z]??{};return ae[J]||(ae[J]={}),n.forEach((Me,je)=>{var ze;const{colspan:Ae,rowspan:He}=g1(Me,je,j,X),ce=Me[Kn.COL_UID],be=((ze=ye[ce])==null?void 0:ze.skipRowLen)??0,Ie={[ce]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};se>0&&(Ie[ce].skipColLen=se,Ie[ce].skipCol=!0,se=se-1),be>1?(Ie[ce].skipRowLen=be-1,Ie[ce].skipRow=!0):He>1&&(Ie[ce].skipRowLen=He,Ie[ce].skipRow=!1),Ae>1&&(Ie[ce].skipColLen=Ae,se=Ae-1),Object.assign(ae[J],{...Ie})}),ae[J]},K=at.debounce(ve,120);a.watch([W,H,ie,fe],()=>{K()});const F=(j,J,X=!1)=>{if(e.asyncData&&e.rowKey){if(X)e.data.forEach(ae=>{at.has(ae,e.selectionKey)&&at.set(ae,e.selectionKey,!!J)});else if(at.has(j,e.selectionKey)){const ae=e.data.find(Z=>at.get(Z,e.rowKey)===at.get(j,e.rowKey));at.set(ae,e.selectionKey,!!J)}}},{fixedColumns:Q,resolveColumnStyle:Y,resolveColumnClass:ne,fixedWrapperClass:oe}=ef(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:C,indexData:_,fixedWrapperClass:oe,fixedColumns:Q,resolveColumnStyle:Y,resolveColumnClass:ne,initIndexData:de,updateIndexData:ve,setRowExpand:N,setAllRowExpand:S,updateColGroups:c,clearSelection:E,toggleAllSelection:k,toggleRowSelection:O,getSelection:()=>_.filter(j=>A(j)),clearSort:x}},ET=a.defineComponent({name:"Table",props:jL,emits:BL,setup(e,t){const n=ft("table");let i=null,s=null,o=null;const c=new AL,u=a.reactive([]),{initColumns:f}=Pc(e,u);a.provide(Xm,f),a.provide(qm,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:p,dragOffsetXStyle:y,dragOffsetX:C,reactiveSchema:b,indexData:x,fixedColumns:N,resolveColumnStyle:S,resolveColumnClass:M,setRowExpand:I,setAllRowExpand:L,initIndexData:T,fixedWrapperClass:V,clearSelection:k,toggleAllSelection:E,toggleRowSelection:O,getSelection:P,clearSort:A,updateColGroups:_}=OT(e,u),{pageData:W,localPagination:H,resolvePageData:ie,watchEffectFn:fe}=$L(e,x),{tableClass:de,headClass:re,contentClass:ve,footerClass:G,wrapperStyle:K,contentStyle:F,headStyle:Q,hasScrollYRef:Y,fixHeight:ne,updateBorderClass:oe,resetTableHeight:ge,getColumnsWidthOffsetWidth:ee,hasFooter:$}=jT(e,u,d,b,W),{resolveClassName:j}=Ce(),J=a.computed(()=>({hasScrollY:Y.value})),X=new ST(e,t,b,p,J,n),ae=()=>{const Je=d.value.querySelector(`.${j("table-body-content")}`),Ge=Je.querySelector("table");if(Ge){const Fe=Ge.scrollWidth,Xe=Je.clientWidth;m.value=Fe-Xe}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{T(e.reserveExpand),fe(o,i,s),a.nextTick(()=>{ge(d.value),oe(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Je=ee();Cd(d.value,p,20,Je),ae()}}),X.on(Vn.ON_SORT_BY_CLICK,Je=>{const{sortFn:Ge,column:Fe,index:Xe,type:Ve}=Je;typeof Ge=="function"&&(i=Ge,s=Fe,Object.assign(s,{[Kn.SORT_TYPE]:Ve}),ie(o,i,s)),t.emit(Ot.COLUMN_SORT,{column:a.unref(Fe[Kn.COL_SOURCE_DATA]),index:Xe,type:Ve})}).on(Vn.ON_FILTER_CLICK,Je=>{const{filterFn:Ge,checked:Fe,column:Xe,index:Ve}=Je;typeof Ge=="function"&&(o=Ge,ie(o,i,s)),t.emit(Ot.COLUMN_FILTER,{checked:Fe,column:a.unref(Xe[Kn.COL_SOURCE_DATA]),index:Ve})}).on(Vn.ON_SETTING_CHANGE,Je=>{const{checked:Ge=[],size:Fe,height:Xe,fields:Ve}=Je;a.nextTick(()=>{_({checked:Ge,fields:Ve}),oe(d.value);const vt=ee();Ge.length&&Cd(d.value,p,oa,vt),t.emit(Ot.SETTING_CHANGE,{checked:Ge,size:Fe,height:Xe,fields:Ve})})}).on(Vn.ON_ROW_EXPAND_CLICK,Je=>{const{row:Ge,column:Fe,index:Xe,rows:Ve,e:vt}=Je;t.emit(Ot.ROW_EXPAND_CLICK,{row:ks(Ge),column:y1(Fe),index:Xe,rows:Ve,e:vt}),I(Ge,!Ge[Be.ROW_EXPAND])}).on(Vn.ON_ROW_CHECK,({row:Je,isAll:Ge,index:Fe,value:Xe})=>{Ge?(E(Xe),t.emit(Ot.ROW_SELECT_ALL,{checked:Xe,data:e.data})):(O(Je,Xe),t.emit(Ot.ROW_SELECT,{row:ks(Je),index:Fe,checked:Xe,data:e.data})),t.emit(Ot.ROW_SELECT_CHANGE,{row:ks(Je),isAll:Ge,index:Fe,checked:Xe,data:e.data})});const Z=Je=>{const Ge=b.pos.bottom??0,Fe=Je[1],{translateX:Xe,translateY:Ve,pos:vt={}}=Fe;b.scrollTranslateY=Ve,b.scrollTranslateX=Xe,b.pos=vt;const{bottom:Hn}=vt;Hn<=2&&Ge>Hn&&Bs(60,()=>{t.emit(Ot.SCROLL_BOTTOM,{...vt,translateX:Xe,translateY:Ve})},!0)(),ae()},se=(Je={left:0,top:0})=>{var Ge,Fe;(Fe=(Ge=h.value)==null?void 0:Ge.scrollTo)==null||Fe.call(Ge,Je)};a.onMounted(()=>{if(e.observerResize){let Je=u1(d.value,()=>{if(!d.value)return;(e.height==="100%"||e.height==="auto")&&ge(d.value),oe(d.value);const Ge=ee();Cd(d.value,p,20,Ge)},180,!0,e.resizerWay);Je.start(),a.onBeforeUnmount(()=>{Je.disconnect(),Je=null})}}),a.onBeforeUnmount(()=>{X.destroy()});const ye=()=>d.value;t.expose({setRowExpand:I,setAllRowExpand:L,clearSelection:k,toggleAllSelection:E,toggleRowSelection:O,getSelection:P,clearSort:A,scrollTo:se,getRoot:ye});const Me=a.computed(()=>({...ve,"__is-empty":!W.length})),je=a.computed(()=>({[j("table-body-content")]:!0,[j("stripe")]:e.stripe,"with-virtual-render":e.virtualEnabled})),Ae={column_drag_line:!0,"offset-x":!0},He=a.computed(()=>({...y.value,left:`${C.value-b.scrollTranslateX}px`})),ce={"scroll-loading":!0,_bottom:!0},be=a.computed(()=>({[j("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),Ie={zIndex:-1,width:0,height:0,display:"none"},ze=a.computed(()=>({"--footer-height":$.value?`${e.paginationHeight}px`:"0"})),rt=a.computed(()=>({right:Y.value?`${_r}px`:0,"--fix-height":`${ne.value}px`,...ze.value})),{renderScrollLoading:nt}=GL(e,t),lt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),Tt=a.computed(()=>({"--prepend-left":`${b.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),ht=()=>t.slots.prepend?a.createVNode("div",{style:Tt.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Je,Ge;return a.createVNode("div",{class:de.value,style:K.value,ref:d},[a.createVNode("div",{class:re,style:Q.value},[X.renderTableHeadSchema()]),a.createVNode(Br,a.mergeProps({ref:h,lineHeight:X.getRowHeight,class:Me.value,style:F,list:W},lt.value,{contentClassName:je.value,onContentScroll:Z,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>ht(),default:Fe=>X.renderTableBodySchema(Fe.data||W),afterSection:()=>a.createVNode("div",{class:be.value},null)}),a.createVNode("div",{class:V,style:rt.value},[N.value.map(({isExist:Fe,colPos:Xe,column:Ve})=>Fe?"":a.createVNode("div",{class:M(Ve,b.scrollTranslateX,m.value),style:S(Xe)},null)),a.createVNode("div",{class:Ae,style:He.value},null),a.createVNode("div",{class:ce},[nt()])]),a.createVNode("div",{class:G.value,style:ze.value},[$.value&&X.renderTableFooter(H.value)]),a.createVNode("div",{style:Ie},[(Ge=(Je=t.slots).default)==null?void 0:Ge.call(Je)])])}}}),C1=Kt(ET,{Column:EL}),gr=12;function AT(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(s=[])=>{t.curPage=1,t.totalSize=s.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;const o=[];if(t.pageSize>0)for(let c=0;c<t.totalSize;c+=t.pageSize)o.push(s.slice(c,c+t.pageSize));t.renderListPaged.splice(0,t.renderListPaged.length,...o),t.curPageList.splice(0,t.curPageList.length,...t.renderListPaged[t.curPage-1]||[])},pageChange:s=>{t.curPage=s,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function PT(e){const{useGroup:t,saveKey:n,displayKey:i,list:s}=a.toRefs(e),o=a.ref([]),c=a.ref({});return a.watch([t,n,i,s],()=>{o.value=[];let u=a.markRaw(s.value);t.value&&(u=u.reduce((f,d)=>{let h=[];return d.children&&(h=d.children.map(m=>({group:{groupId:d[n.value],groupName:d[i.value]},...m}))),f.concat(h)},[])),o.value=u,c.value=u.reduce((f,d)=>(f[d[n.value]]=d,f),{})},{immediate:!0,deep:!0}),{flatList:o,saveKeyMap:c}}const r6=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)e.charCodeAt(i)&65280&&(n+=1),n+=1;return n},b1=(e,t,n)=>{a.watch([n,t],()=>{s()},{flush:"post"});const i=a.ref(null),s=()=>{t.value&&(i.value=null,setTimeout(()=>{const o=Array.from(e.value.querySelectorAll(".tag-item")),c=o.findIndex((u,f)=>f?o[f-1].offsetTop!==u.offsetTop:!1);i.value=c>0?c-1:null}))};return{overflowTagIndex:i}},s6=a.defineComponent({name:"ListTagRender",props:{node:v.object,searchKey:v.oneOfType([v.string,v.arrayOf(v.string)]),displayKey:v.string,searchKeyword:v.string,tpl:{type:Function}},render(){const{resolveClassName:e}=Ce(),t=i=>{if(this.searchKeyword){const s=new RegExp(`(${this.searchKeyword})`,"i");return i.replace(s,'<strong class="highlight-text">$1</strong>')}return i};if(this.tpl)return this.tpl(this.node,t,a.h,this);const n=this.node[this.displayKey];return a.createVNode("div",{class:`${e("selector-node")}`},[a.createVNode("span",{class:"text",innerHTML:t(n)},[n])])}}),zT=()=>({modelValue:v.arrayOf(v.string).def([]),placeholder:v.string.def(""),list:v.arrayOf(v.object).def([]),disabled:v.bool.def(!1),tooltipKey:v.string.def(""),saveKey:v.string.def("id"),displayKey:v.string.def("name"),hasDeleteIcon:v.bool.def(!1),clearable:v.bool.def(!0),trigger:Se("treeTriggerType",{}).def("search"),searchKey:v.oneOfType([v.string,v.arrayOf(v.string)]).def("name"),useGroup:v.bool.def(!1),allowCreate:v.bool.def(!1),maxData:v.number.def(-1),maxResult:v.number.def(10),contentMaxHeight:v.number.def(300),contentWidth:v.number.def(190),separator:v.string.def(""),allowNextFocus:v.bool.def(!0),allowAutoMatch:v.bool.def(!1),showClearOnlyHover:v.bool.def(!1),isAsyncList:v.bool.def(!1),leftSpace:v.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}}),VT=a.defineComponent({name:"TagRender",directives:{bkTooltips:Ka},props:{node:v.object,displayKey:v.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}},setup(e){const t=a.ref(),n=a.ref(!1),i=a.computed(()=>({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!n.value,...e.tagOverflowTips}));return a.onMounted(()=>{n.value=l8(t.value)}),{overflowTips:i,tagRef:t}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.withDirectives(a.createVNode("div",{class:"tag",ref:"tagRef"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])]),[[a.resolveDirective("bk-tooltips"),this.overflowTips]])}}),RT=a.defineComponent({name:"TagInput",directives:{bkTooltips:Ka},props:zT(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=ei(),i=ft("tagInput"),s=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),o=a.reactive({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0},...e.popoverProps}),{resolveClassName:c}=Ce(),{maxResult:u}=a.toRefs(e),{pageState:f,initPage:d,pageChange:h}=AT(u),m=a.ref(""),p=a.ref(null),y=a.ref(null),C=a.ref(null),b=a.ref(null),x=a.ref(null),N=a.ref(null),S=a.computed(()=>!e.disabled&&e.hasDeleteIcon),M=a.computed(()=>e.maxData===1),I=a.computed(()=>k.selectedTagList.length===0&&m.value===""&&!s.isEdit),L=a.computed(()=>e.placeholder||i.value.placeholder),T=a.computed(()=>e.clearable&&!e.disabled&&k.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),V=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),k=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),E=a.computed(()=>k.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:O,saveKeyMap:P}=PT(e),A=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((be,Ie)=>{be.__index__=Ie,ce[be.group.groupId]||(ce[be.group.groupId]={id:be.group.groupId,name:be.group.groupName,children:[]}),ce[be.group.groupId].children.push(be)}),Object.keys(ce).map(be=>ce[be])}return f.curPageList});a.watch([()=>O.value],()=>{a.nextTick(()=>{fe()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var be;ve(E.value,ce)||(a.nextTick(()=>{fe()}),e.withValidate&&((be=n==null?void 0:n.validate)==null||be.call(n,"change")))}),a.watch(m,at.debounce(()=>{const ce=f.curPageList.length!==0,{value:be}=m;be!==""&&ce||be===""&&e.trigger==="focus"&&ce?o.isShow=!0:(e.trigger!=="focus"||!ce)&&(o.isShow=!1)},150)),a.watch(()=>o.isShow,ce=>{_(),ce&&x.value&&(a.nextTick(()=>{x.value.scrollTop=0}),x.value.removeEventListener("scroll",W),x.value.addEventListener("scroll",W))}),a.onMounted(()=>{fe()});const _=()=>{var ce;o.offset.crossAxis=M.value?0:(ce=b.value)==null?void 0:ce.offsetLeft},W=()=>{if(f.isPageLoading||x.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:be,scrollHeight:Ie}=x.value;if(ce+be>=Ie){const ze=f.curPage+1;ze<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(ze)},500))}},H=()=>{var be;return Array.from(((be=C.value)==null?void 0:be.childNodes)||[]).filter(Ie=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Ie.nodeType))},ie=ce=>{if(!e.disabled){if(ce!=null&&ce.target){const{className:be}=ce.target;(be.indexOf(`${c("tag-input-trigger")}`)>-1||be.indexOf("tag-list")>-1)&&C.value.appendChild(b.value)}clearTimeout(N.value),M.value&&E.value.length&&(k.tagListCache=[...E.value],k.selectedTagListCache=[...k.selectedTagList],m.value=k.selectedTagListCache[0][e.saveKey],je(k.selectedTagList[0],0),Y()),s.isEdit=!0,setTimeout(()=>{var be;(be=p.value)==null||be.focus(),e.trigger==="focus"&&k.localList.length!==0&&(de(),o.isShow?_():o.isShow=!0)},200)}},fe=()=>{const{saveKey:ce,modelValue:be,displayKey:Ie,allowCreate:ze,trigger:rt,isAsyncList:nt}=e;if(k.selectedTagList=[],k.localList=O.value,be.length){const lt={};k.selectedTagList=be.map(Tt=>{const ht=P.value[Tt];return lt[Tt]=1,!ht&&ze?{[ce]:Tt,[Ie]:Tt}:ht}).filter(Tt=>Tt),M.value||(k.localList=k.localList.filter(Tt=>!lt[Tt[ce]]))}if(nt&&m.value){de(m.value),f.curPageList.length&&(o.isShow=!0);return}rt==="focus"&&de()},de=(ce="")=>{const{searchKey:be,filterCallback:Ie}=e,ze=ce.toLowerCase().trim();if(ze===""){d(k.localList);return}let rt=[];typeof Ie=="function"?rt=Ie(ze,be,k.localList)||[]:Array.isArray(be)?rt=k.localList.filter(nt=>be.some(lt=>nt[lt].toLowerCase().indexOf(ze)>-1)):rt=k.localList.filter(nt=>nt[be].toLowerCase().indexOf(ze)>-1),d(rt)},re=(ce,be)=>{const Ie={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:E.value.includes(ce[e.saveKey])};return e.useGroup?Ie[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Ie[`${c("selector-actived")}`]=be===s.focusItemIndex,Ie};function ve(ce,be){return ce.length!==be.length?!1:be.every((Ie,ze)=>ce[ze]===Ie)}const G=()=>{k.tagListCache=[],k.selectedTagListCache=[],k.selectedTagList=[]},K=()=>{m.value=""},F=()=>{if(M.value)return 0;const be=H().findIndex(({id:Ie})=>Ie==="tagInputItem");return be>=0?be:0},Q=(ce,be,Ie=!1)=>{if(!be||!ce)return;let ze=be;Ie&&(ze=be.nextElementSibling||null),be.parentNode.insertBefore(ce,ze)},Y=ce=>{const{maxData:be,trigger:Ie,allowCreate:ze}=e;if(be===-1||be>E.value.length){const{value:rt}=ce!=null&&ce.target?ce.target:m,nt=r6(rt);nt?(de(rt),p.value.style.width=`${nt*gr}px`):Ie==="focus"&&de()}else oe(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=ze?-1:0,t("input",m.value)},ne=()=>{var ce;o.width=M.value?(ce=y.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},oe=()=>{N.value=setTimeout(()=>{var be;const ce=m.value;if(K(),s.isEdit=!1,M.value){const[Ie]=k.tagListCache;ce&&ce===Ie&&k.selectedTagListCache.length?Me(k.selectedTagListCache[0],"select"):$("remove")}else if(e.allowAutoMatch&&ce){const Ie=f.curPageList.find(ze=>Array.isArray(e.searchKey)?e.searchKey.map(nt=>ze[nt]).includes(ce):ze[e.searchKey]===ce);Ie?ge(Ie,"select"):e.allowCreate&&ge(ce,"custom")}o.isShow=!1,t("blur",ce,E.value),(be=n==null?void 0:n.validate)==null||be.call(n,"blur")},200)},ge=(ce,be,Ie)=>{Ie==null||Ie.stopPropagation(),!(!ce||ce.disabled)&&(M.value&&G(),Me(ce,be),$("select"),K(),o.isShow=!1)},ee=(ce,be,Ie)=>{Ie==null||Ie.stopPropagation(),je(ce,be),K(),$("remove",ce),p.value.style.width=`${gr}px`},$=(ce,be)=>{t(ce,be),t("update:modelValue",E.value),t("change",E.value)},j=ce=>{ce.stopPropagation();const be=k.selectedTagList;k.selectedTagList=[];const Ie=be.filter(ze=>P.value[ze[e.saveKey]]);(e.allowCreate&&Ie.length!==0||!e.allowCreate)&&!M.value&&k.localList.push(...Ie),$("removeAll")},J=()=>{const ce={height:x.value.clientHeight,yAxis:x.value.getBoundingClientRect().y};a.nextTick(()=>{const be=x.value.querySelector(`.${c("selector-actived")}`);if(!be)return;const Ie={height:be.clientHeight,yAxis:be.getBoundingClientRect().y};Ie.yAxis<ce.yAxis&&(x.value.scrollTop=x.value.scrollTop-(ce.yAxis-Ie.yAxis));const ze=Ie.yAxis+Ie.height-ce.yAxis;ze>ce.height&&(x.value.scrollTop=x.value.scrollTop+ze-ce.height)})},X=(ce,be)=>{const Ie=H();Q(b.value,Ie[ce-1]),k.selectedTagList.splice(ce-1,1),ie();const ze=P.value[be[e.saveKey]];(e.allowCreate&&ze||!e.allowCreate)&&!M.value&&k.localList.push(be),p.value=`${gr}px`,$("remove")},ae=ce=>{if(f.isPageLoading)return;let be;const Ie=ce.target.value,ze=r6(Ie),rt=F(),nt=H();switch(ce.code){case"ArrowUp":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex-1,s.focusItemIndex=s.focusItemIndex<0?-1:s.focusItemIndex,s.focusItemIndex===-1&&(s.focusItemIndex=f.curPageList.length-1),J();break;case"ArrowDown":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex+1,s.focusItemIndex=s.focusItemIndex>f.curPageList.length-1?f.curPageList.length:s.focusItemIndex,s.focusItemIndex===f.curPageList.length&&(s.focusItemIndex=0),J();break;case"ArrowLeft":if(s.isEdit=!0,!ze){if(rt<1)return;Q(b.value,nt[rt-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!ze){if(rt===nt.length-1)return;Q(nt[rt+1],b.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?ge(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&ge(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":rt!==0&&!m.value&&(be=k.selectedTagList[rt-1],X(rt,be));break}},Z=ce=>{const be=[],Ie=ce.split(";"),ze=/^[a-zA-Z][a-zA-Z_]*/g;return Ie.forEach(rt=>{const nt=rt.match(ze);if(nt){const lt=nt.join("");be.push({[e.saveKey]:lt,[e.displayKey]:lt})}}),be},se=ce=>{if(ce.preventDefault(),M.value)return!1;const{maxData:be,saveKey:Ie,displayKey:ze,pasteFn:rt,allowCreate:nt}=e,lt=ce.clipboardData.getData("text");let ht=(rt?rt(lt):Z(lt)).map(Je=>Je[Ie]);if(ht.length){const Je=H(),Ge=F(),Fe=k.localList.map(Ve=>Ve[Ie]);if(ht=ht.filter(Ve=>{const vt=(Ve==null?void 0:Ve.trim())&&!E.value.includes(Ve);return nt?vt:vt&&Fe.includes(Ve)}),be!==-1){const Ve=k.selectedTagList.length;if(Ve<be){const vt=be-Ve;ht.length>vt&&(ht=[...ht.slice(0,vt)])}else ht=[]}const Xe=nt?ht.map(Ve=>k.localList.find(Hn=>Hn[Ie]===Ve)??{[Ie]:Ve,[ze]:Ve}):k.localList.filter(Ve=>ht.includes(Ve[Ie]));ht.length&&(k.selectedTagList.splice(Ge,0,...Xe),Q(b.value,Je[Ge]),p.value.style.width=`${gr}px`,k.localList=k.localList.filter(Ve=>!ht.includes(Ve[Ie])),$("select"),ie())}},ye=ce=>{e.disabled||(Q(b.value,ce.currentTarget,!0),p.value.style.width=`${gr}px`,o.isShow&&_())},Me=(ce,be)=>{if(k.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Ie,saveKey:ze,displayKey:rt,createTagValidator:nt}=e,lt=F();let Tt=1,ht=!1,Je;const Ge=Fe=>typeof nt=="function"?nt(Fe):!0;if(be==="custom")if(Ie){let Fe=ce.split(Ie);Fe=Fe.filter(Ve=>(Ve==null?void 0:Ve.trim())&&!E.value.includes(Ve)&&Ge(Ve));const Xe=Fe.map(Ve=>P.value[Ve]||{[ze]:Ve,[rt]:Ve});Fe.length&&(k.selectedTagList.splice(lt,0,...Xe),Tt=Xe.length,ht=!0)}else{const Fe=typeof ce=="object";if(Je=Fe?ce[ze]:ce.trim(),Je=Je.replace(/\s+/g,""),Je!==void 0&&!E.value.includes(Je)&&Ge(Je)){const Xe=P.value[Je]||(Fe?ce:{[ze]:Je,[rt]:Je});k.selectedTagList.splice(lt,0,Xe),ht=!0}}else ce&&(Je=ce[ze],Je!==void 0&&!E.value.includes(Je)&&(k.selectedTagList.splice(lt,0,ce),ht=!0));ht&&a.nextTick(()=>{for(let Fe=1;Fe<=Tt;Fe++){const Ve=H()[lt+Fe];Q(Ve,b.value)}if(p.value.style.width=`${gr}px`,!M.value){e.allowNextFocus&&ie();const Fe=E.value.reduce((Xe,Ve)=>(Xe[Ve]=1,Xe),{});k.localList=k.localList.filter(Xe=>!Fe[Xe[ze]])}})},je=(ce,be)=>{k.selectedTagList.splice(be,1);const Ie=P.value[ce[e.saveKey]];(e.allowCreate&&Ie||!e.allowCreate)&&!M.value&&k.localList.push(ce)},Ae=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:He}=b1(y,Ae,E);return{popoverProps:o,...a.toRefs(s),...a.toRefs(k),...a.toRefs(f),isShowPlaceholder:I,isShowClear:T,placeholderText:L,curInputValue:m,renderList:A,showTagClose:S,tagInputRef:p,bkTagSelectorRef:y,tagListRef:C,tagInputItemRef:b,selectorListRef:x,triggerClass:V,overflowTagIndex:He,localCollapseTags:Ae,focusInputTrigger:ie,activeClass:re,handleInput:Y,handleFocus:ne,handleBlur:oe,handleTagSelected:ge,handleTagRemove:ee,handleClear:j,tagFocus:ye,handleKeydown:ae,handlePaste:se,resolveClassName:c}},render(){return a.createVNode("div",{class:`${this.resolveClassName("tag-input")}`,ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Ut,a.mergeProps({theme:`light ${this.resolveClassName("tag-input-popover-content")}`,trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:()=>{var e,t;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((n,i)=>{const s={boundary:"window",theme:"light",distance:12,content:n[this.tooltipKey],disabled:!this.tooltipKey},o=this.localCollapseTags&&this.overflowTagIndex&&i>=this.overflowTagIndex;return a.withDirectives(a.createVNode("li",{class:"tag-item",style:{display:o?"none":""},onClick:this.tagFocus},[a.createVNode(VT,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(gn,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,n,i)},null):null]),[[a.resolveDirective("bk-tooltips"),s]])}),a.withDirectives(a.createVNode("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[a.withDirectives(a.createVNode("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":n=>this.curInputValue=n,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]]),!!this.overflowTagIndex&&this.localCollapseTags&&a.createVNode("li",{class:"tag-item"},[a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[a.createTextVNode("+"),this.selectedTagList.length-this.overflowTagIndex])])])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholderText]),[[a.vShow,this.isShowPlaceholder]]),((t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))??(this.isShowClear&&a.createVNode(mn,{class:"clear-icon",onClick:this.handleClear},null))])},content:()=>a.createVNode("div",{class:`${this.resolveClassName("selector-list")}`},[a.createVNode("ul",{ref:"selectorListRef",style:{"max-height":`${this.contentMaxHeight}px`},class:"outside-ul"},[this.renderList.map((e,t)=>this.useGroup?a.createVNode("li",{class:`${this.resolveClassName("selector-group-item")}`},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:`${this.resolveClassName("selector-group-list-item")}`},[e.children.map((n,i)=>a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(s6,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(s6,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:`${this.resolveClassName("selector-list-item")} loading`},[a.createVNode(ua,{theme:"primary",size:_a.Small},null)]):null])])})])}}),w1=Ue(RT),JT={direction:zg(),align:zd().def(Sl.CENTER),color:v.string.def("#dde4eb"),width:v.number.def(1),type:Vg()},_T=a.defineComponent({name:"Divider",props:JT,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`},{resolveClassName:t}=Ce();let n;return this.$slots.default&&(n=a.createVNode("div",{class:[t("divider-info"),t(`divider-info-${this.align}`)]},[this.$slots.default()])),a.createVNode("div",{class:[t("divider"),t(`divider-${this.direction}`)],style:e()},[n])}}),N1=Ue(_T);var Jl=(e=>(e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab",e.CARD_GRID="card-grid",e))(Jl||{}),Ds=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(Ds||{});const M1=Se("position",{}).def("top");var I1=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(I1||{});const L1=Se("sortType",{}).def("replace"),QT={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},WT={name:v.oneOfType([v.number,v.string]).def(""),label:v.string||v.func,tips:v.string,closable:v.bool,visible:v.bool.def(!0),disabled:v.bool,sortable:v.bool,renderDirective:Sf(),panel:v.string||v.func},HT={active:v.oneOfType([v.number,v.string]).def(""),type:Se("type",{}).def("border-card"),tabPosition:M1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:L1,labelHeight:v.number.def(50),scrollStep:v.number.def(200),extCls:v.string.def(""),validateActive:v.bool.def(!0),showHeader:v.bool.def(!0),changeOnHover:v.bool.def(!1),changeOnHoverDelay:v.number.def(1e3),activeBarSize:v.number.def(2),activeBarColor:v.string.def("#3a84ff")},FT={active:v.oneOfType([v.number,v.string]).def(""),type:Se("type",{}).def("border-card"),activeBarColor:v.string.def("#3a84ff"),activeBarSize:v.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:M1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:L1,labelHeight:v.number.def(50),scrollStep:v.number.def(200),validateActive:v.bool.def(!0),changeOnHover:v.bool.def(!1),changeOnHoverDelay:v.number.def(1e3),...QT},o6=a.defineComponent({name:"TabNav",directives:{bkTooltips:Ka},props:FT,setup(e){const t=a.ref(null),n=a.computed(()=>{const h={width:0,height:0,bottom:0,left:0};if(!t.value)return h;if([Ds.LEFT,Ds.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:p}=t.value,y={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${p}px`,background:e.activeBarColor};return e.tabPosition===Ds.LEFT?y.right=0:y.left=0,y}if(e.type===Jl.UNBORDER_CARD){const{clientWidth:m,offsetLeft:p}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${p}px`,bottom:0,background:e.activeBarColor}}return h}),i=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const h=[];let m=!1;return e.panels.filter((p,y)=>{if(!p.props)return null;const{name:C,label:b,closable:x,visible:N,disabled:S,sortable:M,tips:I}=p.props;if(!N)return!1;e.active===C&&(m=!0);const L=T=>p.slots.label?a.h(p.slots.label):[void 0,""].includes(T)?`选项卡${y+1}`:typeof T=="string"?T:typeof T=="function"?a.h(T):T;return h.push({name:C,closable:x,visible:N,disabled:S,sortable:M,tips:I,tabLabel:L(b)}),!0}),!m&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),h}),s=a.ref(-1),o=a.ref(-1),c=a.ref(""),u=(h,m)=>h===m,f={handleTabAdd(h){e.tabAdd(h)},dragstart(h,m){o.value=h,c.value=e.guid,Object.assign(m.dataTransfer,{effectAllowed:"move"}),e.tabDrag(h,m)},dragenter(h){u(c.value,e.guid)&&(s.value=h)},dragend(){s.value=-1,o.value=-1,c.value=null},drop(h,m){if(!u(c.value,e.guid))return!1;e.tabSort(o.value,h,m)},handleTabChange(h){e.tabChange(h)},handleTabRemove(h,m){e.tabRemove(h,m)}},{resolveClassName:d}=Ce();return{...f,activeRef:t,activeBarStyle:n,navs:i,dragenterIndex:s,dragStartIndex:o,draggingEle:c,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4),resolveClassName:d}},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:s,labelHeight:o,dragstart:c,dragenter:u,dragend:f,drop:d}=this,h=()=>this.navs.map((b,x)=>{if(!b)return null;const{name:N,disabled:S,tabLabel:M}=b,I=()=>{const T=[this.resolveClassName("tab-header-item")];return S&&T.push(this.resolveClassName("tab-header--disabled")),e===N&&T.push(this.resolveClassName("tab-header--active")),T.join(" ")},L=(T,V)=>!S&&(T||V);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!S&&this.handleTabChange(N),draggable:L(b.sortable,i),onDragstart:T=>c(x,T),ref:e===N?"activeRef":"",onDragenter:T=>{T.preventDefault(),u(x)},onDragleave:T=>{T.preventDefault()},onDragover:T=>{T.preventDefault()},onDragend:T=>{T.preventDefault(),f()},onDrop:T=>{T.preventDefault(),d(x,s)},class:I()},[a.createVNode("div",null,[M]),L(b.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(x,b)},[a.createVNode(mn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:b.tips,disabled:!b.tips}]])}),m=()=>{var x,N;const b=[];return typeof this.$slots.add=="function"?b.push((N=(x=this.$slots).add)==null?void 0:N.call(x,a.h)):n&&b.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(qs,{style:"display:flex;",width:26,height:26},null)])),b.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[b.map((S,M)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:M},[S]))]):null},p=()=>this.type===Jl.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",y=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,C=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),C||y?"tab-header-auto":""]},[p(),h()]),C,y])}}),BT=a.defineComponent({name:"Tab",components:{TabNav:o6},props:HT,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup(e,{slots:t,emit:n}){const i=a.ref(!1),s=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:p}=h;return(p||[]).forEach(y=>{let{type:C}=y;C=C.name||C,C==="TabPanel"&&y.component?m.push(y.component):(C===a.Fragment||C==="template")&&c(y,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],p=c(m);p.length!==s.value.length&&(s.value=p)}};a.onMounted(()=>{u(),i.value=!0,a.onUpdated(()=>{u()})});const f={tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,p){const y=s.value;if(p===I1.INSERT)if(h<m)y.splice(m+1,0,s[h]),y.splice(h,1);else if(h>m)y.splice(m,0,s[h]),y.splice(h+1,1);else return!1;else{const C=y[m];y[m]=y[h],y[h]=C}s.value=[...y],n("sort",h,m,p),n("sort-change",h,m,p)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}},{resolveClassName:d}=Ce();return{...f,isMounted:i,panels:s,resolveClassName:d}},render(){var n,i;const e=()=>{const s=[this.resolveClassName("tab"),this.extCls];return this.tabPosition===Ds.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Jl.CARD_TAB&&s.push(this.resolveClassName("tab--vertical-tab"))),s},t=()=>{const{panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:p,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:x,activeBarSize:N,activeBarColor:S,tabAdd:M,tabChange:I,tabRemove:L,tabSort:T,tabDrag:V}=this,k={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:p,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:x,activeBarSize:N,activeBarColor:S,tabAdd:M,tabChange:I,tabRemove:L,tabSort:T,tabDrag:V};return!s||!Array.isArray(s)?null:a.createVNode(o6,k,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:this.resolveClassName("tab-content")},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),$T=a.defineComponent({name:"TabPanel",props:WT,render(){const e=this.name===this.$parent.active,t=()=>!this.visible||this.renderDirective==="if"&&!e?null:typeof this.panel=="function"?this.panel(a.h):typeof this.$slots.default=="function"?this.$slots.default(null):typeof this.$slots.panel=="function"?this.$slots.panel(null):null,{resolveClassName:n}=Ce();return a.withDirectives(a.createVNode("div",{ref:"content",class:n("tab-panel")},[t()]),[[a.vShow,e]])}}),T1=Kt(BT,{TabPanel:$T}),Ei={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let l6=1;const x1=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const s=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:u=10}=n;Ei[i].forEach(p=>{c+=(p.el.offsetHeight||0)+u}),l6+=1;const f=`message_${l6}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=p=>{GT(p,i,u,s),a.render(null,d)},h.props.onDetail=(p,y)=>{Ei[i].forEach(C=>{var b,x;C.props.id!==y&&((x=(b=C.component)==null?void 0:b.exposed)==null||x.setDetailsShow(null,!1))})},a.render(h,d),Ei[i].push(h);let m;h.props.getContainer&&Ra(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function GT(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;Ei[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=Ei[t][o].el.offsetHeight,f=Ei[t].length;for(let d=o;d<f;d++){const h=parseInt(Ei[t][d].el.style[s],10)-u-n;Ei[t][d].component.props.offsetY=h}Ei[t].splice(o,1)}var S1={exports:{}};/*!
|
67
67
|
* clipboard.js v2.0.11
|
68
68
|
* https://clipboardjs.com/
|
69
69
|
*
|