bkui-vue 0.0.2-beta.10 → 0.0.2-beta.11
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 +1 -1
- package/dist/index.umd.js +1 -1
- package/lib/steps/index.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -63,7 +63,7 @@ ${po(n)}`),i}})}function I2(e){const t=Object.keys(e),n=t.filter(s=>{var o;retur
|
|
63
63
|
* @return {boolean} True if the event is supported.
|
64
64
|
* @internal
|
65
65
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
66
|
-
*/function gb(e,t){if(!G9.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i=typeof s[n]=="function"}return!i&&Z9&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var mb=gb,pb=db,yb=mb,Y9=10,U9=40,K9=800;function X9(e){var t=0,n=0,i=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*Y9,s=n*Y9,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=U9,s*=U9):(i*=K9,s*=K9)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}X9.getEventType=function(){return pb.firefox()?"DOMMouseScroll":yb("wheel")?"wheel":"mousewheel"};var Cb=X9,bb=Cb;const vb=Ur(bb),wb=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Nb=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(wb?"DOMMouseScroll":"mousewheel",function(n){const i=vb(n);t==null||t.apply(this,[n,i])})},Mb={beforeMount(e,t){console.error(e,t),Nb(e,t.value)}},qi=new Map,Ir={beforeMount(e,t){const n=q9(t),{trigger:i}=n,s=Lb(n);let o=null;if(i==="hover"){let c=null;e.addEventListener("mouseenter",()=>{o=setTimeout(()=>{dd(e),clearTimeout(c),clearTimeout(o)},n.delay)}),s.addEventListener("mouseenter",()=>{clearTimeout(c)}),e.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ls(e)},100)}),e.addEventListener("click",()=>{Ls(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ls(e)},100)})}else i==="click"&&document.body.addEventListener("click",c=>{e.contains(c.target)&&!s.hasAttribute("data-show")?o=setTimeout(()=>{dd(e),clearTimeout(o)},n.delay):s.hasAttribute("data-show")&&Ls(e)});qi.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){qi.get(e).opts=q9(t)},unmounted(e){Ls(e),qi.delete(e)}};function Ib(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function q9(e){const t=Ib();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function Lb(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=ni.getPopperIndex(),u=document.createElement("div");if(u.className=`${$t("popper")} ${o?"light":"dark"} ${s}`,u.innerText=t,u.style.zIndex=String(c),n){const f=e3();u.appendChild(f)}return u}function e3(){const e=document.createElement("div");return e.className=$t("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function Tb(e,t){const{opts:n}=qi.get(e),{placement:i,distance:s,showOnInit:o}=n,c=f0(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&dd(e),c}function dd(e){const{popper:t,opts:n}=qi.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=e3();t.appendChild(f)}document.body.appendChild(t);const u=Tb(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),qi.get(e).popperInstance=u}function Ls(e){if(!qi.get(e))return;const{popper:t,popperInstance:n,opts:i}=qi.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const t3=(e,t)=>{const n={content:"",target:e};return typeof t=="object"?Object.assign(n,t):n.content=t,n},fd=(e,t)=>{let n=null,i=null,s=null;const o=t3(e,t),{disabled:c}=o;if(c||n)return;const u=()=>{s&&clearTimeout(s),s=null},f=()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},d=()=>{i&&clearTimeout(i),i=setTimeout(()=>{const y=t3(e,t);y.isShow=!0,y.content=y.content||e.innerHTML,y.allowHtml=!0,Object.assign(y,{onContentMouseenter:u,onContentMouseleave:f}),n=td(y)},100)},h=()=>{s=setTimeout(()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},120)};return e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",h),{destroyInstance:y=>{var C,b;h(),(C=y??e)==null||C.removeEventListener("mouseenter",d),(b=y??e)==null||b.removeEventListener("mouseleave",h)},instance:n}},Sb={mounted(e,t){fd(e,t)}},kb={onContentScroll:Function},xb={list:p.array.def([]),enabled:p.bool.def(!0),scrollEvent:p.bool.def(!1),lineHeight:p.oneOfType([p.number,p.func]).def(30),minHeight:p.number.def(30),height:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),width:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),className:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentClassName:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentStyle:p.object.def({}),scrollXName:p.string.def($t("F-scroll-x")),scrollYName:p.string.def($t("F-scroll-y")),groupItemCount:p.number.def(1),preloadItemCount:p.number.def(1),renderAs:p.string.def("div"),contentAs:p.string.def("div"),scrollOffsetTop:p.number.def(0),scrollPosition:p.string.def("content"),abosuteHeight:p.oneOfType([p.string.def("auto"),p.number]).def("auto"),throttleDelay:p.number.def(60),rowKey:p.string.def(void 0),keepAlive:p.bool.def(!1),...kb},Db=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,y,C,b,v)=>{t.emit("content-scroll",[d,{translateY:C,translateX:b,pos:v}])},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,y,C,b,v,T;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},[((y=(m=t.slots).default)==null?void 0:y.call(m,{data:e.list}))??""]),[[o,c]]),((b=(C=t.slots).afterContent)==null?void 0:b.call(C))??"",((T=(v=t.slots).afterSection)==null?void 0:T.call(v))??""])}}};function n3(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 i3(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:y}=n,{offsetHeight:C}=i;let b=0,v=0,T=0;if(typeof e=="number"&&(b=Math.floor(o/e),v=Math.ceil(C/e)+b,T=o%e),typeof e=="function"){const N=n3(f,o,d,e);b=N.startIndex>0?N.startIndex:0,T=N.diffHeight,v=n3(f,C,d,e).startIndex+b+1}if(o!==u||b!==h||v!==m||y!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,b,v,o,T,c,{bottom:N>=0?N:0})}}function jb(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const C=t.scrollTop,b=t.scrollLeft,v=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,C,C,b,{bottom:v>=0?v:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:y}=o;i3(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:y},t,e)}const a3=(e=60)=>st.throttle((t,n,i)=>jb(t,n,i),e),Ob=(e,t,n,i=60)=>{Reflect.apply(a3(i),void 0,[e,t,n])},Eb={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{Ob(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",a3)}}},Lr=Ze(a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:Eb},props:xb,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=D=>typeof D=="string"?[D]:typeof D=="object"&&!Array.isArray(D)?[D]:D;if(!e.enabled){const{rendAsTag:D}=Db(e,t);return D}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=(D,A,V,E,R,J,G)=>{c.startIndex=A,c.endIndex=V,c.scrollTop=E,c.translateY=R,c.translateX=J,c.scrollLeft=J,c.pos=G,t.emit("content-scroll",[D,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),y()})}),a.watch(()=>e.list,()=>{let D={left:0,top:0};D={left:c.scrollLeft,top:c.scrollTop},f(),y(),e.keepAlive&&x(D)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),y()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=D=>{if(d.value=Math.ceil((D||[]).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 V=0;for(let E=0;E<d.value;E++){const R=e.lineHeight.call(this,E,D.slice(E*e.groupItemCount,e.groupItemCount));V+=typeof R=="number"?R:0}h.value=V}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},y=(D={left:0,top:0})=>{var V;const A=(V=o.value)==null?void 0:V.parentNode;i3(e.lineHeight,u,c,A,null),D&&o.value&&x(D)},C=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,A)=>({...D,$index:A}))),b=a.computed(()=>C.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),v=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),T=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"?v.value:{}})),N=a.computed(()=>{const D=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:D?"none":"block"}}),{resolveClassName:k}=Ce(),w=a.computed(()=>[k("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?k("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?k("virtual-content"):"",...s(e.contentClassName)]),S=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},Q=()=>{f(),y()},x=(D={left:0,top:0})=>{const{left:A,top:V}=D;o.value.scrollTo(A,V)};return t.expose({reset:Q,scrollTo:x}),()=>{var D,A,V,E,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((A=(D=t.slots).beforeContent)==null?void 0:A.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...v.value,...e.contentStyle}},[((E=(V=t.slots).default)==null?void 0:E.call(V,{data:b.value}))??""]),[[S,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[k("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}));var r3=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(r3||{});const Ab=a.defineComponent({name:"Tag",props:{theme:vo(),closable:p.bool.def(!1),type:De("tagStorkeType",{}).def(r3.UNKNOWN),checkable:p.bool.def(!1),checked:p.bool.def(!1),radius:p.string.def("2px"),extCls:p.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.computed(()=>Ve({[`${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(sn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Tr=Ze(Ab),Pb=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:vo(),placeholder:p.string.def(""),filterable:p.bool.def(!1),allowCreate:p.bool.def(!1),disabled:p.bool.def(!1),modelValue:p.any,collapseTags:p.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),{proxy:i}=a.getCurrentInstance(),s=a.inject(cl,null),{modelValue:o,collapseTags:c,selected:u}=a.toRefs(e),f=a.ref(o.value),d=a.ref(),h=a.ref(null);a.watch(o,()=>{f.value=o.value}),a.watch([u,c],()=>{T()},{flush:"post"});const m=N=>{t("remove",N)},y=()=>{var N;(N=d.value)==null||N.focus()},C=N=>{t("update:modelValue",N.target.value)},b=N=>{switch(N.code){case"Enter":{t("enter",N.target.value,N);break}}t("keydown",N.target.value,N)},v=N=>{const k=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?k[N]:k},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=v(),k=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=k>0?k:null}))};return{select:s,overflowTagIndex:h,value:f,inputRef:d,handleRemoveTag:m,focus:y,handleInput:C,handleKeydown:b,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=Ve({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Ve({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("span",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((y,C)=>a.createVNode(Tr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&C>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(y.value)},{default:()=>{var b;return[(b=this.select)==null?void 0:b.handleGetLabelByValue(y.value)]}})),!!this.overflowTagIndex&&this.collapseTags&&a.createVNode(Tr,{class:this.resolveClassName("select-overflow-tag")},{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)])}}),zb=a.defineComponent({name:"Select",directives:{clickoutside:oi},props:{modelValue:p.any,multiple:p.bool.def(!1),disabled:p.bool.def(!1),size:p.size().def(ru.DEFAULT),clearable:p.bool.def(!0),loading:p.bool.def(!1),filterable:p.bool.def(!1),remoteMethod:p.func,scrollHeight:p.number.def(200),showSelectAll:p.bool.def(!1),popoverMinWidth:p.number.def(0),showOnInit:p.bool.def(!1),multipleMode:p.oneOf(["default","tag"]).def("default"),tagTheme:vo(),behavior:j0(),collapseTags:p.bool.def(!1),autoHeight:p.bool.def(!0),noDataText:p.string,noMatchText:p.string,loadingText:p.string,placeholder:p.string,searchPlaceholder:p.string,selectAllText:p.string,scrollLoading:p.bool.def(!1),allowCreate:p.bool.def(!1),popoverOptions:Object,customContent:p.bool.def(!1),list:p.array.def([]),idKey:p.string.def("value"),displayKey:p.string.def("label"),withValidate:p.bool.def(!0),showSelectedIcon:p.bool.def(!0),inputSearch:p.bool.def(!0),enableVirtualRender:p.bool.def(!1),allowEmptyValues:p.array.def([]),autoFocus:p.bool.def(!1),keepSearchValue:p.bool.def(!1),prefix:p.string,selectedStyle:j2()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ut("select"),{resolveClassName:i}=Ce(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:y,allowCreate:C,customContent:b,showSelectedIcon:v,inputSearch:T,enableVirtualRender:N,showSelectAll:k,scrollHeight:w,list:I,displayKey:S,idKey:L,collapseTags:Q,autoHeight:x,popoverOptions:D,allowEmptyValues:A,autoFocus:V,keepSearchValue:E,selectedStyle:R}=a.toRefs(e),J=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),G=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),me=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),ue=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),ae=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),ge=Fn(),B=a.ref(),Z=a.ref(),H=a.ref(),z=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),q=a.ref(new Map),oe=a.computed(()=>[...q.value.values()]),W=a.ref(new Map),_=a.ref([]),$=a.computed(()=>_.value.reduce((Ne,Ee)=>(Ne[Ee.value]=Ee.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,Ee)=>(Ne[Ee[L.value]]=Ee[S.value],Ne),{}));a.watch(s,()=>{var Ne;Xl(),e.withValidate&&((Ne=ge==null?void 0:ge.validate)==null||Ne.call(ge,"change"))},{deep:!0}),a.watch(_,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,lt.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var Ee;return(Ee=Mr(String(Ne[S.value])))==null?void 0:Ee.includes(Mr(bi.value))})),de=a.computed(()=>o.value||d.value),ve=a.computed(()=>_.value.map(Ne=>{var Ee,Be;return((Be=(Ee=q.value)==null?void 0:Ee.get(Ne.value))==null?void 0:Be.optionName)||fe.value[Ne.value]||Ne.label})),Le=a.computed(()=>{const Ne=oe.value.reduce((Ee,Be)=>(Be.disabled||Ee.push(Be.optionID),Ee),[]);return Ne.length<=_.value.length&&Ne.every(Ee=>_.value.some(Be=>Be.value===Ee))}),je=a.computed(()=>!!W.value.size),Je=a.computed(()=>!oe.value.length),Re=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),be=a.computed(()=>!(Hs.value||Je.value||Re.value)||b.value),Te=a.computed(()=>u.value&&k.value&&(!bi.value||!c.value)),_e=a.computed(()=>w.value-12-(Te.value?32:0)),at=a.computed(()=>Hs.value?ie.value:Je.value?J.value:Re.value?G.value:""),nt=a.computed(()=>x.value?Q.value&&!Ci.value:Q.value),lt=a.computed(()=>st.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:Ul.value,arrow:!1,placement:"bottom-start",isShow:Ci.value,reference:Y.value,offset:6,popoverDelay:0,renderType:bo.AUTO},D.value)),{register:Lt,unregister:gt}=nd(q),{register:bt,unregister:Ye}=nd(W),{isHover:Pe,setHover:Ue,cancelHover:ze}=R9(),ft=a.ref(!1),Wt=()=>{ft.value||(ft.value=!0,t("focus"))},Qa=()=>{ft.value&&(ft.value=!1,t("blur"))},{popperWidth:Ul,isPopoverShow:Ci,hidePopover:oa,showPopover:Ws,togglePopover:df}=ab({popoverMinWidth:h.value},Z);a.watch(Ci,()=>{t("toggle",Ci.value)});const ff=a.computed(()=>(c.value&&T.value||C.value)&&Ci.value);a.watch(Ci,Ne=>{Ne?setTimeout(()=>{Ha(),Kl()},10):E.value||(bi.value="")});const Kl=()=>{var Be;const Ne=_.value[0],Ee=q.value.get(Ne==null?void 0:Ne.value);Ee&&!Ee.disabled&&Ee.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(Be=oe.value.find(Mn=>!Mn.disabled&&Mn.visible))==null?void 0:Be.optionID},hf=Ne=>{c.value&&oe.value.forEach(Ee=>{var Be;Ee.visible=(Be=Mr(String(Ee.optionName)))==null?void 0:Be.includes(Mr(Ne))})},{searchKey:bi,searchLoading:Hs}=rb(ce.value?f.value:hf,Kl),vi=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},gf=()=>{de.value||(Wt(),df())},Bs=Ne=>{c.value&&(bi.value=Ne)},mf=(Ne,Ee)=>{const Be=String(Ne);!C.value||!Be||c.value&&oe.value.find(fn=>Mr(String(fn.optionName))===Mr(Be))||q.value.get(Be)||(Ee.stopPropagation(),u.value?(_.value.push({value:Be,label:Be}),vi(_.value.map(fn=>fn.value))):(_.value=[{value:Be,label:Be}],vi(Be),oa()),bi.value="")},Wa=Ne=>{if(!(de.value||!Ne)){if(u.value){const Ee=_.value.findIndex(Be=>Be.value===Ne.optionID);Ee>-1?_.value.splice(Ee,1):_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),vi(_.value.map(Be=>Be.value))}else _.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],vi(Ne.optionID),oa();Ha()}},Ha=()=>{setTimeout(()=>{var Ne,Ee,Be;!T.value&&!C.value?(Ne=z.value)==null||Ne.focus():y.value==="tag"?(Ee=Y.value)==null||Ee.focus():(Be=B.value)==null||Be.focus()},0)},pf=Ne=>{Ne.stopPropagation(),_.value=[],vi(u.value?[]:""),t("clear",u.value?[]:""),oa()},yf=()=>{ee.value=""},Cf=()=>{Le.value?_.value=[]:oe.value.forEach(Ne=>{Ne.disabled||_.value.find(Ee=>Ee.value===Ne.optionID)||_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),vi(_.value.map(Ne=>Ne.value)),Ha()},bf=Ne=>{const{scrollTop:Ee,clientHeight:Be,scrollHeight:Mn}=Ne.target;Ee+Be===Mn&&t("scroll-end")},vf=Ne=>{if(de.value)return;const Ee=_.value.findIndex(Be=>Be.value===Ne);Ee>-1&&(_.value.splice(Ee,1),vi(_.value.map(Be=>Be.value)))},Fs=Ne=>{var Be,Mn;let Ee=Ne;if(typeof Ee=="object"){for(const fn of q.value.keys())if(st.isEqual(fn,Ee)){Ee=fn;break}}return((Mn=(Be=q.value)==null?void 0:Be.get(Ee))==null?void 0:Mn.optionName)||fe.value[Ee]||$.value[Ee]||Ee},Xl=()=>{Array.isArray(s.value)?_.value=[...s.value.map(Ne=>({value:Ne,label:Fs(Ne)}))]:s.value!==void 0||A.value.includes(s.value)?_.value=[{value:s.value,label:Fs(s.value)}]:_.value=[]},ql=Ne=>{var Mn,fn;if(!Ci.value)return;const Ee=oe.value.filter(hn=>!hn.disabled&&hn.visible),Be=Ee.findIndex(hn=>hn.optionID===ee.value);if(!(!Ee.length||Be===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const hn=Be>=Ee.length-1?0:Be+1;ee.value=(Mn=Ee[hn])==null?void 0:Mn.optionID;break}case"ArrowUp":{Ne.preventDefault();const hn=Be===0?Ee.length-1:Be-1;ee.value=(fn=Ee[hn])==null?void 0:fn.optionID;break}case"Backspace":{if(!u.value||!_.value.length||bi.value.length||Ne.target===z.value)return;_.value.pop(),vi(_.value.map(hn=>hn.value));break}case"Enter":{const hn=q.value.get(ee.value);Wa(hn);break}}},wf=({event:Ne})=>{var Be;const{target:Ee}=Ne;(Be=Z.value)!=null&&Be.contains(Ee)||Z.value===Ee||(oa(),Qa())},Nf=()=>{setTimeout(()=>{var Ne,Ee;N.value&&((Ee=(Ne=X.value)==null?void 0:Ne.reset)==null||Ee.call(Ne))})};return a.provide(cl,a.reactive({multiple:u,selected:_,activeOptionValue:ee,showSelectedIcon:v,selectedStyle:R,register:Lt,unregister:gt,registerGroup:bt,unregisterGroup:Ye,handleOptionSelected:Wa,handleGetLabelByValue:Fs})),a.onMounted(()=>{Xl(),setTimeout(()=>{m.value&&Ws(),V.value&&Ha()})}),{selected:_,isInput:ff,options:oe,isDisabled:de,selectedLabel:ve,isPopoverShow:Ci,isHover:Pe,popperWidth:Ul,inputRef:B,triggerRef:Z,contentRef:H,searchRef:z,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Hs,isOptionsEmpty:Je,isSearchEmpty:Re,isFocus:ft,isShowSelectContent:be,curContentText:at,isGroup:je,searchKey:bi,isShowSelectAll:Te,virtualHeight:_e,virtualList:K,isCollapseTags:nt,popoverConfig:lt,focusInput:Ha,setHover:Ue,cancelHover:ze,handleFocus:Wt,handleBlur:Qa,handleTogglePopover:gf,handleClear:pf,hidePopover:oa,showPopover:Ws,handleToggleAll:Cf,handleOptionSelected:Wa,handleClickOutside:wf,handleScroll:bf,handleDeleteTag:vf,handleInputChange:Bs,handleInputEnter:mf,handleKeydown:ql,handleSelectedAllOptionMouseEnter:yf,handlePopoverShow:Nf,localLoadingText:ie,localPlaceholder:me,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=Ve({[`${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($i,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(rn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ma,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(Pb,{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(Ta,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(Ia,{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($i,{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(Lr,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(ul,{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(ul,{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($i,{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(Gt,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),hd=Ft(zb,{Option:ul,Group:sb});function Vb(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:Rb}=Sa,gd=Object.assign({},Rb);gd.width.default="400",gd.height.default="100%";const Jb=a.defineComponent({name:"Sideslider",components:{BkModal:Sa,BkButton:At},props:{...gd,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()=>{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(Sa,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),Vb(u)?u:{default:()=>[u]})}}}),s3=Ze(Jb);var o3=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(o3||{});const l3={theme:p.theme().def(Co.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:k0(),status:De("status",{}).def(o3.UNKNOWN),lineType:x0(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},c3=Ze(a.defineComponent({name:"Steps",props:l3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ut("steps"),i=ut("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(y=>{typeof y=="string"?m.push(y):m.push({title:y.title,icon:y.icon,description:y.description,status:y.status,border:y.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{l3.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,y)=>{const C=await e.beforeChange(h);C?m(C):y(C)}),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=Ve({[`${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:y}=m;return y?Object.prototype.toString.call(y)==="[object Object]":typeof m=="string"},u=(m,y)=>(y.icon||(y.icon=m),!isNaN(y.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,y)=>o(m)&&this.status==="loading"||f(y)?a.createVNode(cs,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(y)?a.createVNode(sn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(Fi,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,y)?m+1:a.createVNode(y.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,y)=>{var C,b;return a.createVNode("div",{class:[this.resolveClassName("steps"),m.title?"":this.resolveClassName("step-no-content"),s(y)?"done":"",o(y)?"current":"",o(y)&&this.status==="error"?"isError":"",m.status&&o(y)?[`${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(y+1)}},[((b=(C=this.$slots)[y+1])==null?void 0:b.call(C))??h(y,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(y+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}})),_b=a.defineComponent({name:"Switcher",props:{theme:p.theme(),size:p.size(),disabled:p.bool,showText:p.bool,isOutline:p.bool,onText:p.string.def("ON"),offText:p.string.def("OFF"),isSquare:p.bool,extCls:p.string,beforeChange:p.func.def(void 0),trueValue:p.oneOfType([p.string,p.number,p.bool]).def(!0),falseValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),value:p.oneOfType([p.string,p.number,p.bool]).def(!1),modelValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),withValidate:p.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=Fn(),{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 y=`${i(`bswitcher-${e.size}`)}`;m[y]=!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 y=o.value?e.falseValue:e.trueValue,C=!o.value,b=()=>{t("update:modelValue",y),t("change",C)};let v=!0;if(typeof e.beforeChange=="function"&&(v=e.beforeChange(y),typeof v.then=="function"))return s.value=!0,v.then(()=>{b()}).finally(()=>{s.value=!1});v&&b()},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(Ho,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),u3=Ze(_b);var ml=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(ml||{}),d3=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(d3||{});const Qb=["auto","highlight"],Wb=["none","row","col","outer","horizontal"],Fe={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"},Zn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},Sr=6,Da=42;var f3=(e=>(e.DEF1="def1",e.DEF2="def2",e))(f3||{});const pl={large:78,medium:60,small:42},Hb=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:pl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:pl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:pl.large}],h3="InitColumns",g3="BKTableCahce",Bb="Bk_COlumn_Update_Define",Fb=60;var Vt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Vt||{});const $b=["asc","desc","null","custom"],ja=80;var m3=(e=>(e.CURRENT="current",e.ALL="all",e))(m3||{});De("showOverflowTooltipMode",{default:"auto"});const Gb=De("columnType",{default:"none"}),md=De("columnType",{default:""});De("full",{default:"full"}),De("columnSize",{default:"small"});const Zb=an(),pd=De("IOverflowTooltipPropType",{}).def(!1);De("IOverflowTooltipType",{}).def({content:"",disabled:!1,watchCellResize:!0,mode:"auto"});const Yb=De("ISortPropShape",{}).def(!1),Ub=De("IFilterPropShape",{}).def(!1);var p3=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(p3||{});const yl=De("IColumnType",{}),y3=De("ITableSettingPropType",{}).def(!1);De("IColumnPropType",{}).def({label:void 0,minWidth:ja});const Kb={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(yl).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:De("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),stripe:p.bool.def(!1),minHeight:p.oneOfType([p.number,p.string]).def(Da*2),maxHeight:p.oneOfType([p.number,p.string]).def("auto"),rowHeight:p.oneOfType([p.number,p.func]).def(Da),headHeight:p.number.def(Da),showHead:p.bool.def(!0),thead:De("ITheadType",{}).def({color:f3.DEF1,height:Da,isShow:!0}),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(De("boderType",{})),p.string]).def([ml.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(Fb),remotePagination:p.bool.def(!1),emptyText:p.string,settings:y3,rowClass:p.oneOfType([p.string,p.object,p.func]).def({}),rowStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellClass:p.oneOfType([p.string,p.object,p.func]).def({}),scrollLoading:p.oneOfType([p.object,p.bool]).def(void 0),reserveExpand:p.bool.def(!1),selectionKey:p.string.def(""),isSelectedFn:p.func.def(void 0),rowKey:p.oneOfType([p.string,p.func]).def(Fe.ROW_INDEX),showOverflowTooltip:pd,asyncData:p.bool.def(!1),rowHover:p.oneOf(Qb).def(d3.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:De("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:md,headerAlign:md,prependStyle:p.style().def({})},Xb={label:p.oneOfType([p.func.def(()=>""),p.string.def("")]),field:p.oneOfType([p.func.def(()=>""),p.string.def("")]),render:p.oneOfType([p.func.def(()=>""),p.string.def("")]),width:p.oneOfType([p.number.def(void 0),p.string.def("auto")]),minWidth:p.oneOfType([p.number.def(void 0),p.string.def("auto")]).def(30),columnKey:p.string.def(""),showOverflowTooltip:pd,type:Gb,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,Zb]).def(!1),sort:Yb,filter:Ub,colspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),rowspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),align:md,className:p.oneOfType([p.string,p.func]),prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},qb=a.defineComponent({name:"TableColumn",props:Xb,setup(e){const t=a.inject(h3,(s,o=!1)=>{},!1),n=a.inject(g3,{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(Bb,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 ev{constructor(){xe(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 Pn=(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))(Pn||{}),jt=(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))(jt||{});const tv=e=>!0,nv=e=>!0,iv=e=>!0,av=e=>!0,Cl=(e,t,n,i,s)=>!0,rv=e=>!0,sv=e=>!0,ov=e=>!0,lv=e=>!0,C3=e=>!0,cv=e=>!0,b3=e=>!0,uv={columnPick:tv,columnFilter:nv,columnSort:av,colFilterSave:iv,rowClick:Cl,rowDblclick:Cl,rowExpand:rv,select:sv,selectAll:ov,selectionChange:lv,pageLimitChange:C3,pageValueChange:C3,settingChange:cv,scrollBottom:e=>!0,cellClick:b3,cellDblclick:b3,rowMouseEnter:Cl,rowMouseLeave:Cl},v3=(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{}},dv=(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=v3(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=(C,b,v)=>{typeof b=="function"&&C.sort((T,N)=>b(T,N,v[Zn.SORT_TYPE]))},d=(C,b)=>{if(typeof b=="function"){const v=C.filter((T,N)=>b(T,N,t));C.length=0,C.push(...v)}},h=(C,b,v)=>{const T=t.slice(),{sortScope:N}=(v==null?void 0:v.sort)??{};N===m3.ALL&&f(T,b,v),u.length=0,u.push(...T.slice(n.value,i.value)),d(u,C),f(u,b,v)},m=(C,b,v)=>{s=v3(e.pagination,s),y(),c(),h(C,b,v)},y=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},fv=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:La.Normal,mode:Wu.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:y,indicator:C}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode($i,{loading:f,size:d,mode:h,title:m,inline:y,indicator:C},null)}}}};function hv(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const gv=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(hd,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},hv(f=t.limitList.map((d,h)=>a.createVNode(ul,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Oa=5,mv=()=>{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 b=[];if(e.totalPageNum<=Oa+2){for(let N=2;N<=e.totalPageNum-1;N++)b.push(N);return b}const v=Math.floor(Oa/2);e.totalPageNum>Oa&&(s.value=t.value-v>2,o.value=t.value+v<e.totalPageNum-1);const T=Math.min(e.totalPageNum-Oa,Math.max(2,t.value-v));for(let N=T;N<T+Oa;N++)b.push(N);return b});a.watch(()=>e.modelValue,b=>{a.nextTick(()=>{b>=1&&b<=e.totalPageNum?t.value=b:b<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,b=>{t.value>b&&(t.value=b)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=b=>{b!==t.value&&(t.value=b)},h=()=>{t.value=Math.max(1,t.value-Oa)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Oa)},{resolveClassName:y}=Ce();return{current:t,render:({isFirst:b,isLast:v})=>a.createVNode("div",{class:{[`${y("pagination-list")}`]:!0,"is-first":b,"is-last":v}},[a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(si,null,null)]),a.createVNode("div",{class:{[`${y("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:`${y("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(hs,null,null)]),c.value.map(T=>a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===T},key:T,onClick:()=>d(T)},[T])),o.value&&a.createVNode("div",{key:"next-batch",class:`${y("pagination-list-next-batch")}`,onClick:m},[a.createVNode(hs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(En,null,null)])])}},pv=()=>{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 k=1;k<=e.totalPageNum;k++)N.push(k);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)},y=N=>{const k=N.target,w=Number(k.textContent);!w||w<1||w>e.totalPageNum||w===i.value||(c=w)},C=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},b=N=>{c=N,m()},{resolveClassName:v}=Ce();return{current:i,render:()=>a.createVNode("div",{class:`${v("pagination-small-list")}`},[a.createVNode("div",{class:{[`${v("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(si,null,null)]),a.createVNode(Gt,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${v("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${v("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:y,onKeydown:C},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${v("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${v("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>b(N)},[N]))])}),a.createVNode("div",{class:{[`${v("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(En,null,null)])])}},yv=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])},Cv={modelValue:p.number.def(1),count:p.number.def(0).isRequired,limit:p.number.def(10),limitList:p.arrayOf(Number).def([10,20,50,100]),showLimit:p.bool.def(!0),type:p.oneOf(["default","compact"]).def("default"),location:p.oneOf(["left","right"]).def("right"),align:p.oneOf(["left","center","right"]).def("left"),size:p.size(),small:p.bool.def(!1),showTotalCount:p.bool.def(!0),prevText:p.string,nextText:p.string,disabled:p.bool.def(!1),beforeChange:p.func,layout:p.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},yd=Ze(a.defineComponent({name:"Pagination",props:Cv,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ut("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=yv(n),{current:u,render:f}=mv(),{current:d,render:h}=pv(),{limit:m,render:y}=gv(n);a.watch([s,m,o],([b,v])=>{const T=Math.ceil(b/v);i.value=T<1?1:T},{immediate:!0}),a.watch(u,b=>{t.emit("update:modelValue",b),t.emit("change",b)}),a.watch(d,b=>{e.small&&(t.emit("update:modelValue",b),t.emit("change",b))}),a.watch(m,b=>{t.emit("limitChange",b)});const{resolveClassName:C}=Ce();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:y,renderSmallList:h,resolveClassName:C}},render(){const e=Ve({[`${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}))])}}));var w3=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}()}(),Cd=typeof window<"u"&&typeof document<"u"&&window.document===document,bl=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")()}(),bv=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(bl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),vv=2;function wv(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){bv(o)}function u(){var f=Date.now();if(n){if(f-s<vv)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var Nv=20,Mv=["top","right","bottom","left","width","height","size","weight"],Iv=typeof MutationObserver<"u",Lv=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=wv(this.refresh.bind(this),Nv)}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(){!Cd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Iv?(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(){!Cd||!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=Mv.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}(),N3=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},kr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||bl},M3=wl(0,0,0,0);function vl(e){return parseFloat(e)||0}function I3(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 Tv(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 Sv(e){var t=e.getBBox();return wl(0,0,t.width,t.height)}function kv(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return M3;var i=kr(e).getComputedStyle(e),s=Tv(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-=I3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=I3(i,"top","bottom")+c)),!Dv(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 wl(s.left,s.top,u,f)}var xv=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof kr(e).SVGGraphicsElement}:function(e){return e instanceof kr(e).SVGElement&&typeof e.getBBox=="function"}}();function Dv(e){return e===kr(e).document.documentElement}function jv(e){return Cd?xv(e)?Sv(e):kv(e):M3}function Ov(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 N3(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function wl(e,t,n,i){return{x:e,y:t,width:n,height:i}}var Ev=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=wl(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=jv(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}(),Av=function(){function e(t,n){var i=Ov(n);N3(this,{target:t,contentRect:i})}return e}(),Pv=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new w3,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 kr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ev(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 kr(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 Av(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}(),L3=typeof WeakMap<"u"?new WeakMap:new w3,T3=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=Lv.getInstance(),i=new Pv(t,n,this);L3.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){T3.prototype[e]=function(){var t;return(t=L3.get(this))[e].apply(t,arguments)}});var zv=function(){return typeof bl.ResizeObserver<"u"?bl.ResizeObserver:T3}();const Rt=(e,t,n)=>{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=>Rt(e,i,n)).filter(i=>i!==void 0).at(0)},bd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],Vv=e=>S3(e,"auto"),S3=(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},Rv=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>Wb.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Ts=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],vd=(e,t,n=ja,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:y=void 0}=h;if(y===void 0)return m<ja?ja:m;let C=m;return/^\d+\.?\d*$/.test(`${y}`)&&(C=Number(y)),/^\d+\.?\d*%$/.test(`${y}`)&&(C=Number(y)*o/100),/^\d+\.?\d*px$/i.test(`${y}`)&&(C=Number(`${y}`.replace(/px/i,""))),C},d=(h,m,y=!0)=>{const C=f(h,m),b=m<C?C:m;Object.assign(h,{calcWidth:b}),y&&(c=c-b,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const C=String(Ts(h,["resizeWidth","width"]));let b=!0;if(/^\d+\.?\d*(px)?$/.test(C)){const v=Number(C.replace("px",""));d(h,v),b=!1}if(/^\d+\.?\d*%$/.test(C)){let v=n;if(c>0){const T=Number(C.replace("%",""));v=c*T/100}d(h,v),b=!1}b&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,y)=>{h=c/(u.length-y),d(t[m],h,!1);const{calcWidth:C}=t[m];c=c-C}):u.forEach(m=>{const y=f(t[m],ja);Object.assign(t[m],{calcWidth:y})})}},k3=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?st.debounce(o,n):st.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new zv(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},wd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},Nl=(e,t,n)=>n.type==="index"?e[Fe.ROW_INDEX]+1:st.get(e,t),Ss=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Ss(Reflect.apply(e,globalThis,t),t):[],x3=(e,t,n)=>{const i=D3(e,t,n);return i!==null?i:Ii.v4()},D3=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Fe.ROW_INDEX?`__ROW_INDEX_${n}`:st.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,Jv=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},j3=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),O3=(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,E3=(e,t,n,i)=>{const s=O3(e,t,n,i,"colspan"),o=O3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},A3=(e,t)=>{var c,u;const n=e.field,i=f=>Nl(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===Vt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Vt.DESC?-1:1)},P3=e=>{const t={[Vt.NULL]:0,[Vt.ASC]:1,[Vt.DESC]:2};return e===void 0?Vt.NULL:Object.keys(t)[(t[e]+1)%3]},z3=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Vt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},Ml=(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,_v=(e,t,n)=>{if(e[Fe.ROW_UID]!==void 0)return e[Fe.ROW_UID];const i=x3(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},ks=e=>a.unref(e[Fe.ROW_SOURCE_DATA]||e),V3=e=>a.unref(e[Zn.COL_SOURCE_DATA]||e),R3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:pd,title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:De("ResizerWay",{default:p3.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=()=>{let h=!0,{resizerWay:m}=e,y=n.value.innerText,C="auto",b=!0;return typeof c=="boolean"&&(h=!c),typeof c=="object"&&(h=c.disabled,m=c.resizerWay||"debounce",y=c.content||n.value.innerText,typeof c.content=="function"&&(y=c.content(e.column,e.row)),b=c.watchCellResize,C=c.mode||"auto"),typeof h=="function"&&(h=Reflect.apply(h,this,[e.column,e.row])),{disabled:h,content:y,mode:C,resizerWay:m,watchCellResize:b}},d=()=>{if(!n.value||!ya(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=_4(n.value)),h==="static"&&(i.value=!0),i.value){const y=a.ref(f());u===null&&(u=fd(n.value,{disabled:y.value.disabled,content:y.value.content,mode:y.value.mode}))}else u==null||u.destroyInstance(n.value),u=null};return a.onMounted(()=>{const{disabled:h,resizerWay:m,watchCellResize:y}=f();if(!h&&(d(),y!==!1&&e.observerResize)){let C=k3(n.value,()=>{d()},60,!0,m);C.start(),a.onBeforeUnmount(()=>{C.disconnect(),C=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)}),()=>{var h;return a.createVNode("div",{class:["cell",e.column.type],style:s.value,ref:n,title:e.title},[(h=t.default)==null?void 0:h.call(t)])}}}),Nd=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 Qv{constructor(t,n){xe(this,"props",null);xe(this,"ctx",null);this.props=t,this.ctx=n}}const Wv=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ut("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(qo,{scene:"part",type:i.value,description:n.value},null)}}),Hv=a.defineComponent({name:"HeadFilter",props:{column:yl,height:p.number.def(Da)},emits:["change","filterSave"],setup(e,{emit:t}){var V;const{resolveClassName:n}=Ce(),i=ut("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((V=o.value)==null?void 0:V.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>Ve({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Ve({[n("table-head-filter")]:!0}),h=a.ref(null),m=E=>{u.isOpen=E,E&&setTimeout(()=>{h.value.reset()})},y=`light ${n("table-head-filter")}`,C=a.computed(()=>{const{list:E=[]}=o.value;return E}),b=(E,R="ig")=>new RegExp(`${E}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),v=(E,R)=>{const{match:J}=o.value,G=Nl(R,Rt(s,"field",[s,R]),s);return J==="full"&&E.includes(G),E.some(ie=>b(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(E,R,J,G)=>o.value.filterFn(E,R,e.column,J,G):(E,R)=>E.length?v(E,R):!0,N=()=>{k(!0),t("filterSave",[...u.checked]),u.isOpen=!1},k=(E=!1)=>{const{disabled:R}=I(S,i.value.confirm);if(R||E){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],T)}},w=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,T)))},I=(E,R)=>({disabled:E==="disabled"||E===!1,text:typeof E=="string"?E:R}),{btnSave:S,btnReset:L}=o.value,Q=()=>{const{disabled:E,text:R}=I(S,i.value.confirm);return E?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},x=()=>{const{disabled:E,text:R}=I(L,i.value.reset);return E?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(E,R)=>{const J=new Set(u.checked);E?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),k()},A=E=>E.data.length?E.data.map(R=>a.createVNode("div",{class:"list-item"},[a.createVNode($n,{label:R.value,key:R.$index,immediateEmitChange:!1,checked:u.checked.includes(R.value),modelValue:u.checked.includes(R.value),onChange:J=>D(J,R)},{default:()=>[`${R.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Gt,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:bo.SHOWN,arrow:!1,offset:0},{theme:y},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(Jo,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(Xo,{class:"content-list"},{default:()=>[a.createVNode(Lr,{lineHeight:32,list:C.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:A})]}),a.createVNode("div",{class:"content-footer"},[Q(),a.createVNode("span",{class:"btn-filter-split"},null),x()])])})}}),Bv=a.defineComponent({name:"HeadSort",props:{column:yl,defaultSort:p.oneOf($b).def(Vt.NULL),active:p.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||Vt.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===Vt.NULL&&(h=P3(d)),s.value===d&&(h=Vt.NULL);const m=A3(e.column,h),y=z3(e.column.sort);if((y==null?void 0:y.value)==="custom"){t("change",(y==null?void 0:y.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort"),onClick:f=>o(f,Vt.NULL)},[a.createVNode(Lo,{class:["sort-action","sort-asc",e.active&&s.value===Vt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Vt.ASC)},null),a.createVNode(ls,{class:["sort-action","sort-desc",e.active&&s.value===Vt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Vt.DESC)},null)])}});function J3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const Fv=a.defineComponent({name:"Settings",props:{settings:y3,columns:p.arrayOf(yl).def([]),rowHeight:p.number.def(Da)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ut("table"),s=Hb(i),o=(J,G)=>Rt(J,["id","field","type"],[J,G]),c=a.ref(!1),u=a.ref(!1),f=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(J=>({...J,field:J.field||J.type})),checked:[],limit:0,size:"small",sizeList:s,showLineHeight:!0}:e.settings),d=a.ref(f.value.size||"small"),h=a.ref(e.rowHeight),m=a.ref(f.value.checked||[]),C=`light ${n("table-settings")}`,b=a.computed(()=>f.value.fields||e.columns||[]),v={checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:f.value.checked||[]},T=()=>{Object.assign(v,{checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:m.value}),t("change",{checked:m.value,size:d.value,height:h.value,fields:a.unref(b)}),u.value=!1},N=()=>{c.value=v.checkAll,d.value=v.activeSize,h.value=v.activeHeight,m.value=v.checkedFields,u.value=!1},k=()=>{u.value=!0},w=J=>{J.stopImmediatePropagation(),J.stopPropagation(),J.preventDefault(),c.value=!c.value;const G=f.value.fields||e.columns||[],ie=G.filter((me,ue)=>me.disabled&&m.value.includes(o(me,ue))).map((me,ue)=>o(me,ue));if(c.value){const me=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...me,...ie)}else m.value.splice(0,m.value.length,...ie)},I=a.computed(()=>(f.value.limit??0)>0),S=f.value.sizeList||s,L=a.computed(()=>I.value&&(f.value.limit?f.value.limit:0)<=m.value.length),Q=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),x=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),A={marginRight:"12px"},V=()=>S.map(J=>a.createVNode("span",{class:D(J),onClick:()=>x(J)},[J.label])),E=a.computed(()=>m.value.length>0&&!b.value.every((J,G)=>m.value.includes(Rt(J,"field",[J,G])))),R=a.computed(()=>typeof f.value.showLineHeight=="boolean"?f.value.showLineHeight:!0);return a.watch(()=>[m.value],()=>{m.value.length||(c.value=!1),m.value.length&&b.value.every((J,G)=>m.value.includes(o(J,G)))&&(c.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{m.value.splice(0,m.value.length,...f.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Gt,a.mergeProps({trigger:"manual",isShow:u.value,placement:"bottom-end",arrow:!0},{theme:C}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:k},[a.createVNode(Do,{style:"color: #c4c6cc;"},null)]),content:()=>{let J;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[i.value.setting.title]),a.createVNode(us,{class:"icon-close-action",onClick:N},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"},[i.value.setting.fields.title]),I.value?a.createVNode("span",{class:"limit"},[i.value.setting.fields.subtitle(f.value.limit)]):""]),I.value?"":a.createVNode("span",{class:"check-all",onClick:w},[a.createVNode($n,{label:i.value.setting.fields.selectAll,indeterminate:!!E.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(Xo,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},J3(J=b.value.map((G,ie)=>{let me;return a.createVNode("div",{class:"field-item"},[a.createVNode($n,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:Q(G,ie)},J3(me=Rt(G,["name","label"],[G,ie]))?me:{default:()=>[me]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),V()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(At,{theme:"primary",style:A,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(At,{style:A,onClick:N},{default:()=>[i.value.setting.options.cancel]})])])}}):""}}),Md=(e,t,n)=>{const i=(y,C,b)=>({column_fixed:!!y.fixed,column_fixed_left:y.fixed!=="right",column_fixed_right:y.fixed==="right",shadow:y.fixed==="right"?b-C>2:C>0}),s=y=>y.fixed==="right"?"right":"left",o={left:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed&&C.fixed!=="right").reduce((C,b,v)=>y&&v===0?C:C+Ts(b),0),right:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed==="right").reduce((C,b,v)=>y&&v===0?C:C+Ts(b),n?Sr:0)},c=(y,C,b=0)=>{const v=C[Zn.COL_UID],T=y==="right"?-1:1,N=t.filter(S=>!S.isHidden),{length:k}=N;let w=y==="right"?k*T:1,I=0;for(w;;){w=w+-1*T;const S=Math.abs(w),L=N[S],Q=s(L),x=L[Zn.COL_UID];if(Q===y&&v!==x){const D=Ts(L);I=I+D}if(v===x)break}return I+b},u=(y,C=!1)=>{if(!y.fixed||y.isHidden)return{};const b={left:0,right:C?Sr:0},v=s(y);return b[v]=c(v,y,b[v]),{[v]:`${b[v]}px`}},f=y=>({width:`${o[y](!1)}px`,backgroundColor:e.thead.color,bottom:"0px"}),d=a.computed(()=>{const y={left:!1,right:!1};return t.filter(C=>!C.isHidden&&C.fixed).map(C=>{const b=s(C),v=y[b];return y[b]=!0,{isExist:v,colPos:b,column:C}})}),{resolveClassName:h}=Ce();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function _3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class $v{constructor(t,n,i,s,o,c){xe(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Rt(this.setting,"height",["tbody",t,n,i]):Rt(this.props,"rowHeight",["tbody",t,n])});xe(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]);xe(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 Qv(t,n),this.uuid=Ii.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}=wd(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=j3(u,d,s)}),this.emitEvent(Pn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(Fv,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},null):"",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(Wv,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(yd,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(jt.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(jt.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(jt.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=P3(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=A3(n,s);this.activeSortIndex.value=t,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Rt(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i];return a.createVNode(Bv,{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(Pn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(jt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(Hv,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=wd(this.props),{cellFn:n}=t,i={"--row-height":`${Rt(t,"height",["thead"])}px`,backgroundColor:this.props.thead.color},s=(d,h)=>typeof n=="function"?n(d,h):Rt(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const v=this.reactiveProp.rowActions.get(Fe.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Fe.ROW_SELECTION]:!!v},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const y=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[y]));const C=typeof y=="string"?y:void 0,b={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(R3,{class:b,title:C,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},_3(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const y=m.split("_").slice(-1)[0];return Object.assign(h,{[y]:C=>{d.listeners.get(m).forEach(b=>Reflect.apply(b,this,[C,d,this]))}})},{}),{resolveFixedColumnStyle:u}=Md(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${Sr+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(Nd,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>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:u(d,this.styleRef.value.hasScrollY),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}=Md(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...Ss(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...Ss(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`,o%2===1&&this.props.stripe?"stripe-row":""];return[a.createVNode(Nd,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:D3(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 k;const h=[n(f),...Ss(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:y,rowspan:C}=E3(f,d,s,o),b=Fe.ROW_SKIP_CFG,v=f[Zn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((k=s[b])==null?void 0:k[v])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...Ss(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[Fe.ROW_EXPAND],"is-last":o+C>=i}],S=(L,Q)=>{const x={event:L,row:ks(s),column:V3(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(Q,x)};return a.createVNode("td",{class:I,style:h,colspan:y,rowspan:C,onClick:L=>S(L,jt.CELL_CLICK),onDblclick:L=>S(L,jt.CELL_DBL_CLICK)},[a.createVNode(R3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},_3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[Fe.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${_v(t,i,this.props)}_expand`;return a.createVNode(Nd,{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(jt.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(jt.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(jt.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(jt.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[Fe.ROW_EXPAND]?a.createVNode(ds,null,null):a.createVNode(ys,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Pn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=Nl(t,Rt(n,"field",[n,t]),n),c=t[Fe.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(Pn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get(Fe.ROW_SELECTION_INDETERMINATE),c=Ml(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode($n,{onChange:s,disabled:!c,modelValue:t[Fe.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=Nl(t,Rt(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=Ve({active:this.isColActive(n)}),s=`${Vv(Ts(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 Il=(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:[]}}),Q3=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:bd(e.activeColumn):Array.isArray(e.activeColumn)?bd(e.activeColumn[0]):bd(e.activeColumn):[],Gv=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Il(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(Q3(e)),o=()=>i().map((c,u)=>({index:u,_column:c,active:s.some(f=>f===u)}));return a.watchEffect(()=>{n=o();const c=Q3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},Zv=(e,t=!0)=>{const n="HeadColumnResize";let i=function(w){return w.MOUSE_MOVE="onMousemove",w.MOUSE_OUT="onMouseout",w.MOUSE_DOWN="onMousedown",w}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=w=>{o=!1,c=!1;const I=document.body.style;I.cursor="";const S=w.clientX-u,L=(f.resizeWidth??f.calcWidth)+S,Q=Number(f.minWidth);f.resizeWidth=L>Q?L:Q,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",C),u=0,h.value=-1e3,f=null,w.target.closest("table").querySelectorAll("th").forEach(D=>D.style.setProperty("user-select","inherit"))},y=w=>st.throttle(()=>{const I=w.clientX-u,S=(f.resizeWidth??f.calcWidth)+I;Number(f.minWidth)<S&&(h.value=w.clientX-u+d)},60),C=w=>{document.body.style.setProperty("cursor",""),y(w)()},b={[i.MOUSE_DOWN]:(w,I)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=I,u=w.clientX;const L=w.target.closest("table");d=u-L.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",C)},[i.MOUSE_MOVE]:(w,I)=>{o&&!c&&(c=!0);const S=w.target.closest("th");if(c&&S.style.setProperty("user-select","none"),!c){if(!S)return;const L=S.getBoundingClientRect();L.width>12&&L.right-w.pageX<8?(s=!0,S.style.setProperty("cursor","col-resize")):(S.style.setProperty("cursor",""),s=!1)}},[i.MOUSE_OUT]:(w,I)=>{const S=w.target;c||S.style.setProperty("cursor","")}},v=w=>`${n}_${w}`,T=()=>{e.forEach(w=>{w.resizable!==!1&&Object.keys(b).forEach(I=>{const S=v(I);w.listeners.has(S)||w.listeners.set(S,[]),w.listeners.get(S).push(b[I])})})},N=()=>{e.forEach(w=>{Object.keys(b).forEach(I=>{const S=v(I);if(w.listeners.has(S)){const L=w.listeners.get(S);L.length=0}})})};t&&T();const k=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:k}},Yv=(e,t,n,i,s)=>{const{getColumns:o}=Il(e,t),c=a.ref(200),u=a.ref(!1),f=a.computed(()=>e.pagination&&e.data.length),d=a.computed(()=>u.value),h=a.computed(()=>Ve({[$t("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},Rv(e.border))),m=Ve({[$t("table-head")]:!0,"has-settings":!!e.settings}),y=a.computed(()=>o()),C=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":`${i.scrollTranslateY}px`})),b=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":"0px",right:d.value?`${Sr-2}px`:"0px"})),v=wd(e),T=a.computed(()=>({"--row-height":`${Rt(v,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),N={[$t("table-body")]:!0},k=a.computed(()=>Ve({[$t("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),w=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",I=()=>{if(y.value.every(R=>/^\d+\.?\d*(px)?$/ig.test(`${R.width}`))){const R=y.value.reduce((G,ie)=>G+Number(`${ie.width}`.replace(/px/ig,"")),0),J=u.value?Sr:0;return`${R+J}px`}return"100%"},S=a.computed(()=>({minHeight:S3(e.minHeight,"auto"),width:I(),maxWidth:"100%",height:w()})),L=(R,J)=>{const G=String(R);if(/^\d+\.?\d*$/.test(G))return Number(G);if(/^\d+\.?\d*px$/ig.test(G))return Number(G.replace("px",""));if(/^\d+\.?\d*%$/ig.test(G)&&typeof J=="number"){const ie=Number(G.replace("%",""));return J*ie/100}return J},Q=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),x=()=>e.showHead?L(e.headHeight,Da):0,D=()=>{const R=L(e.height,c.value),J=x(),G=L(e.minHeight,c.value),ie=e.pagination&&e.data.length?e.paginationHeight:0,me=R-J-ie,ue=e.height!=="auto"?`${me}px`:!1,ae=G-J-ie,ge=L(e.maxHeight,void 0),B=typeof ge=="number"?`${ge-J-ie}px`:!1;Object.assign(Q,{display:s!=null&&s.length?"block":!1,"min-height":`${ae}px`,height:ue,maxHeight:B})};a.onMounted(()=>{A(n==null?void 0:n.value)});const A=R=>{if(R){const{height:J}=R.parentElement.getBoundingClientRect();c.value=J,D(),V(R)}},V=R=>{if(!R)return;const J=e.virtualEnabled?`.${$t("virtual-section")}`:`.${$t("table-body-content")}`,G=R.querySelector(`.${$t("table-body")}`);u.value=Jv(G,J,0)};return{tableClass:h,headClass:m,contentClass:N,footerClass:k,wrapperStyle:S,contentStyle:Q,headStyle:T,offsetXVarStyle:C,headOffsetXVarStyle:b,resetTableHeight:A,updateBorderClass:V,getColumnsWidthOffsetWidth:()=>{let R=0;return u.value&&(R=R+Sr),e.border.includes(ml.OUTER)&&!e.border.includes(ml.NONE)&&(R=R+2),R},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},Uv=(e,t)=>{var q,oe;const n=a.reactive([]),{getColumns:i}=Il(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let _=ja;return W.sort&&(_=_+18),W.filter&&(_=_+28),_},o=a.computed(()=>i()),c=W=>{var ee,fe;const _=(W==null?void 0:W.checked)||((ee=e.settings)==null?void 0:ee.checked)||[],$=(W==null?void 0:W.fields)||((fe=e.settings)==null?void 0:fe.fields)||[];n.length=0,n.push(...o.value.map(K=>({...K,calcWidth:null,resizeWidth:null,minWidth:s(K),listeners:new Map,isHidden:j3($,K,_),[Zn.COL_UID]:Ii.v4(),[Zn.COL_SOURCE_DATA]:K})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=Zv(n,!0),{activeColumns:m}=Gv(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const y=st.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{y()},{immediate:!0,deep:!0});const C=e.columns.reduce((W,_,$)=>{const ee=Rt(_,["field","type"],[_,$]),fe=z3(_.sort);return fe?{...W||{},[ee]:fe==null?void 0:fe.value}:W},null),b=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(q=e.settings)==null?void 0:q.size,height:pl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:C||e.defaultSort}),v=W=>{var _;return b.rowActions.has(W)?(_=b.rowActions.get(W))==null?void 0:_.isExpand:!1},T=()=>{Array.isArray(b.defaultSort)&&b.defaultSort.splice(0),b.defaultSort=C||e.defaultSort},N=(W,_=void 0)=>{const $=W[Fe.ROW_UID],ee=typeof _=="boolean"?_:!v($);b.rowActions.set($,Object.assign({},b.rowActions.get($)??{},{isExpand:ee})),ae()},k=()=>b.rowActions.has(Fe.ROW_SELECTION_ALL)?b.rowActions.get(Fe.ROW_SELECTION_ALL):e.selectionKey?E.every(W=>A(W)):!1,w=W=>{const _=W[Fe.ROW_UID],{isSelected:$=!1}=b.rowActions.get(_)||{};return $},I=(W=w)=>{let _=!1,$=!1;E.forEach(ee=>{const fe=W(ee);!_&&!fe&&(_=!0),!$&&fe&&($=!0)}),b.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,$&&_),b.rowActions.set(Fe.ROW_SELECTION_ALL,$&&!_)},S=()=>e.columns.some(W=>W.type==="selection"),L=()=>{S()&&I(W=>A(W))},Q=(W=void 0)=>{const _=typeof W=="boolean"?W:!k();b.rowActions.set(Fe.ROW_SELECTION_ALL,_),b.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,!1),E.forEach(($,ee)=>{if(Ml(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[Fe.ROW_UID],K=Object.assign({},b.rowActions.get(fe)??{},{isSelected:_});b.rowActions.set(fe,K)}}),I(),ae(_),Z(null,W,!0)},x=()=>{Q(!1)},D=(W,_)=>{const $=W[Fe.ROW_UID];if($){const ee=typeof _=="boolean"?_:!V(W,$),fe=Object.assign({},b.rowActions.get($)??{},{isSelected:ee});b.rowActions.set($,fe),_||b.rowActions.set(Fe.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,_,!1)}},A=(W,_=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?st.get(W,e.selectionKey):_(W),V=(W,_,$)=>A(W,()=>{var fe;const ee=_===void 0?W[Fe.ROW_UID]:_;return Ml(e,{row:W,index:$,isCheckAll:!1})&&k()?!0:b.rowActions.has(ee)?(fe=b.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),E=a.reactive([]),R=a.computed(()=>n.some(W=>typeof W.rowspan=="function"||/^\d$/.test(`${W.rowspan}`)||typeof W.colspan=="function"||/^\d$/.test(`${W.colspan}`))),J=a.computed(()=>n.some(W=>W.type==="selection")),G=a.computed(()=>n.some(W=>W.type==="expand")),ie=a.computed(()=>n.some(W=>W.type==="index")),me=(W=!1)=>{let _=null;const $={},ee=e.data.map(fe=>({[Fe.ROW_UID]:Ii.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const ve=x3(K,e,de);_=ve;const Le={...K,[Fe.ROW_UID]:K[Fe.ROW_UID]||ve,[Fe.ROW_SOURCE_DATA]:{...K}};if(R.value){const je=ge(K,ve,de,$,_);Object.assign(Le,{[Fe.ROW_SKIP_CFG]:je})}return J.value&&Object.assign(Le,{[Fe.ROW_SELECTION]:V(K,ve,de)}),ie.value&&Object.assign(Le,{[Fe.ROW_INDEX]:de}),G.value&&Object.assign(Le,{[Fe.ROW_EXPAND]:W?v(ve):!1}),Le});E.length=0,E.push(...fe),J.value&&L();return}E.length=0,E.push(...ee)},ue=(W,_,$,ee)=>{const fe=V($,$[Fe.ROW_UID],ee);return W&&typeof _=="boolean"?_:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let _=null;const $={};E.forEach((ee,fe)=>{const K=ee[Fe.ROW_UID];if(G.value&&Object.assign(ee,{[Fe.ROW_EXPAND]:v(ee[Fe.ROW_UID])}),R.value){const de=ge(ee,K,fe,$,_);_=ee[Fe.ROW_UID],Object.assign(ee,{[Fe.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[Fe.ROW_INDEX]:fe}),J.value){const de=Ml(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[Fe.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},ge=(W,_,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[_]||(ee[_]={}),n.forEach((ve,Le)=>{var Te;const{colspan:je,rowspan:Je}=E3(ve,Le,W,$),Re=ve[Zn.COL_UID],ce=((Te=de[Re])==null?void 0:Te.skipRowLen)??0,be={[Re]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(be[Re].skipColLen=K,be[Re].skipCol=!0,K=K-1),ce>1?(be[Re].skipRowLen=ce-1,be[Re].skipRow=!0):Je>1&&(be[Re].skipRowLen=Je,be[Re].skipRow=!1),je>1&&(be[Re].skipColLen=je,K=je-1),Object.assign(ee[_],{...be})}),ee[_]},B=st.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,_,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{st.has(ee,e.selectionKey)&&st.set(ee,e.selectionKey,!!_)});else if(st.has(W,e.selectionKey)){const ee=e.data.find(fe=>st.get(fe,e.rowKey)===st.get(W,e.rowKey));st.set(ee,e.selectionKey,!!_)}}},{fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,fixedWrapperClass:X}=Md(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:b,indexData:E,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,initIndexData:me,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:x,toggleAllSelection:Q,toggleRowSelection:D,getSelection:()=>E.filter(W=>V(W)),clearSort:T}},W3=Ft(a.defineComponent({name:"Table",props:Kb,emits:uv,setup(e,t){const n=ut("table");let i=null,s=null,o=null;const c=new ev,u=a.reactive([]),{initColumns:f}=Il(e,u);a.provide(h3,f),a.provide(g3,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:y,dragOffsetXStyle:C,dragOffsetX:b,reactiveSchema:v,indexData:T,fixedColumns:N,resolveColumnStyle:k,resolveColumnClass:w,setRowExpand:I,initIndexData:S,fixedWrapperClass:L,clearSelection:Q,toggleAllSelection:x,toggleRowSelection:D,getSelection:A,clearSort:V,updateColGroups:E}=Uv(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=dv(e,T),{tableClass:me,headClass:ue,contentClass:ae,footerClass:ge,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:z,offsetXVarStyle:Y,headOffsetXVarStyle:X,updateBorderClass:re,resetTableHeight:q,getColumnsWidthOffsetWidth:oe,hasFooter:W}=Yv(e,u,d,v,R),{resolveClassName:_}=Ce(),$=a.computed(()=>({hasScrollY:z.value})),ee=new $v(e,t,v,y,$,n),fe=()=>{const Ye=d.value.querySelector(`.${_("table-body-content")}`),Pe=Ye.querySelector("table");if(Pe){const Ue=Pe.scrollWidth,ze=Ye.clientWidth;m.value=Ue-ze}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{S(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{q(d.value),re(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Ye=oe();vd(d.value,y,20,Ye),fe()}}),ee.on(Pn.ON_SORT_BY_CLICK,Ye=>{const{sortFn:Pe,column:Ue,index:ze,type:ft}=Ye;typeof Pe=="function"&&(i=Pe,s=Ue,Object.assign(s,{[Zn.SORT_TYPE]:ft}),G(o,i,s)),t.emit(jt.COLUMN_SORT,{column:a.unref(Ue[Zn.COL_SOURCE_DATA]),index:ze,type:ft})}).on(Pn.ON_FILTER_CLICK,Ye=>{const{filterFn:Pe,checked:Ue,column:ze,index:ft}=Ye;typeof Pe=="function"&&(o=Pe,G(o,i,s)),t.emit(jt.COLUMN_FILTER,{checked:Ue,column:a.unref(ze[Zn.COL_SOURCE_DATA]),index:ft})}).on(Pn.ON_SETTING_CHANGE,Ye=>{const{checked:Pe=[],size:Ue,height:ze,fields:ft}=Ye;a.nextTick(()=>{E({checked:Pe,fields:ft}),re(d.value);const Wt=oe();Pe.length&&vd(d.value,y,ja,Wt),t.emit(jt.SETTING_CHANGE,{checked:Pe,size:Ue,height:ze,fields:ft})})}).on(Pn.ON_ROW_EXPAND_CLICK,Ye=>{const{row:Pe,column:Ue,index:ze,rows:ft,e:Wt}=Ye;t.emit(jt.ROW_EXPAND_CLICK,{row:ks(Pe),column:V3(Ue),index:ze,rows:ft,e:Wt}),I(Pe,!Pe[Fe.ROW_EXPAND])}).on(Pn.ON_ROW_CHECK,({row:Ye,isAll:Pe,index:Ue,value:ze})=>{Pe?(x(ze),t.emit(jt.ROW_SELECT_ALL,{checked:ze,data:e.data})):(D(Ye,ze),t.emit(jt.ROW_SELECT,{row:ks(Ye),index:Ue,checked:ze,data:e.data})),t.emit(jt.ROW_SELECT_CHANGE,{row:ks(Ye),isAll:Pe,index:Ue,checked:ze,data:e.data})});const K=Ye=>{const Pe=v.pos.bottom??0,Ue=Ye[1],{translateX:ze,translateY:ft,pos:Wt={}}=Ue;v.scrollTranslateY=ft,v.scrollTranslateX=ze,v.pos=Wt;const{bottom:Qa}=Wt;Qa<=2&&Pe>Qa&&ss(60,()=>{t.emit(jt.SCROLL_BOTTOM,{...Wt,translateX:ze,translateY:ft})},!0)(),fe()},de=(Ye={left:0,top:0})=>{var Pe,Ue;(Ue=(Pe=h.value)==null?void 0:Pe.scrollTo)==null||Ue.call(Pe,Ye)};a.onMounted(()=>{if(e.observerResize){let Ye=k3(d.value,()=>{if(!d.value)return;e.height==="100%"||e.height,re(d.value);const Pe=oe();vd(d.value,y,20,Pe)},180,!0,e.resizerWay);Ye.start(),a.onBeforeUnmount(()=>{Ye.disconnect(),Ye=null})}}),a.onBeforeUnmount(()=>{ee.destroy()});const ve=()=>d.value;t.expose({setRowExpand:I,clearSelection:Q,toggleAllSelection:x,toggleRowSelection:D,getSelection:A,clearSort:V,scrollTo:de,getRoot:ve});const Le=a.computed(()=>({...ae,"__is-empty":!R.length})),je=a.computed(()=>({[_("table-body-content")]:!0,[_("stripe")]:e.stripe,"with-virtual-render":e.virtualEnabled})),Je={column_drag_line:!0,"offset-x":!0},Re=a.computed(()=>({...C.value,left:`${b.value-v.scrollTranslateX}px`})),ce={"scroll-loading":!0,_bottom:!0},be=a.computed(()=>({[_("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),Te={zIndex:-1,width:0,height:0,display:"none"},_e=a.computed(()=>({"--footer-height":W.value?`${e.paginationHeight}px`:"0"})),{renderScrollLoading:at}=fv(e,t),nt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),lt=a.computed(()=>({"--prepend-left":`${v.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),Lt=()=>N.value.map(({isExist:Ye,colPos:Pe,column:Ue})=>Ye?"":a.createVNode("div",{class:w(Ue,v.scrollTranslateX,m.value),style:k(Pe)},null)),gt=()=>a.createVNode(a.Fragment,null,[a.createVNode("div",{class:be.value},null),a.createVNode("div",{class:L,style:Y.value},[Lt(),a.createVNode("div",{class:Je,style:Re.value},null),a.createVNode("div",{class:ce},[at()])])]),bt=()=>t.slots.prepend?a.createVNode("div",{style:lt.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Ye,Pe;return a.createVNode("div",{class:me.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[[ee.renderTableHeadSchema(),a.createVNode("div",{class:L,style:X.value},[Lt()])]]),a.createVNode(Lr,a.mergeProps({ref:h,lineHeight:ee.getRowHeight,class:Le.value,style:Z,list:R},nt.value,{contentClassName:je.value,onContentScroll:K,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>bt(),default:Ue=>ee.renderTableBodySchema(Ue.data||R),afterSection:()=>gt()}),a.createVNode("div",{class:ge.value,style:_e.value},[W.value&&ee.renderTableFooter(J.value)]),a.createVNode("div",{style:Te},[(Pe=(Ye=t.slots).default)==null?void 0:Pe.call(Ye)])])}}}),{Column:qb}),xr=12;function Kv(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 Xv(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 H3=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},B3=(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}},F3=a.defineComponent({name:"ListTagRender",props:{node:p.object,searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]),displayKey:p.string,searchKeyword:p.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])])}}),qv=()=>({modelValue:p.arrayOf(p.string).def([]),placeholder:p.string.def(""),list:p.arrayOf(p.object).def([]),disabled:p.bool.def(!1),tooltipKey:p.string.def(""),saveKey:p.string.def("id"),displayKey:p.string.def("name"),hasDeleteIcon:p.bool.def(!1),clearable:p.bool.def(!0),trigger:De("treeTriggerType",{}).def("search"),searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]).def("name"),useGroup:p.bool.def(!1),allowCreate:p.bool.def(!1),maxData:p.number.def(-1),maxResult:p.number.def(10),contentMaxHeight:p.number.def(300),contentWidth:p.number.def(190),separator:p.string.def(""),allowNextFocus:p.bool.def(!0),allowAutoMatch:p.bool.def(!1),showClearOnlyHover:p.bool.def(!1),isAsyncList:p.bool.def(!1),leftSpace:p.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:()=>({})}}),e8=a.defineComponent({name:"TagRender",directives:{bkTooltips:Ir},props:{node:p.object,displayKey:p.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=B4(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]])}}),t8=a.defineComponent({name:"TagInput",directives:{bkTooltips:Ir},props:qv(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=Fn(),i=ut("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}=Kv(u),m=a.ref(""),y=a.ref(null),C=a.ref(null),b=a.ref(null),v=a.ref(null),T=a.ref(null),N=a.ref(null),k=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>x.selectedTagList.length===0&&m.value===""&&!s.isEdit),S=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&x.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),Q=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),x=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>x.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:A,saveKeyMap:V}=Xv(e),E=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((be,Te)=>{be.__index__=Te,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([()=>A.value],()=>{a.nextTick(()=>{me()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var be;ge(D.value,ce)||(a.nextTick(()=>{me()}),e.withValidate&&((be=n==null?void 0:n.validate)==null||be.call(n,"change")))}),a.watch(m,st.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=>{R(),ce&&T.value&&(a.nextTick(()=>{T.value.scrollTop=0}),T.value.removeEventListener("scroll",J),T.value.addEventListener("scroll",J))}),a.onMounted(()=>{me()});const R=()=>{var ce;o.offset.crossAxis=w.value?0:(ce=v.value)==null?void 0:ce.offsetLeft},J=()=>{if(f.isPageLoading||T.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:be,scrollHeight:Te}=T.value;if(ce+be>=Te){const _e=f.curPage+1;_e<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(_e)},500))}},G=()=>{var be;return Array.from(((be=b.value)==null?void 0:be.childNodes)||[]).filter(Te=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Te.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)&&b.value.appendChild(v.value)}clearTimeout(N.value),w.value&&D.value.length&&(x.tagListCache=[...D.value],x.selectedTagListCache=[...x.selectedTagList],m.value=x.selectedTagListCache[0][e.saveKey],je(x.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var be;(be=y.value)==null||be.focus(),e.trigger==="focus"&&x.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},me=()=>{const{saveKey:ce,modelValue:be,displayKey:Te,allowCreate:_e,trigger:at,isAsyncList:nt}=e;if(x.selectedTagList=[],x.localList=A.value,be.length){const lt={};x.selectedTagList=be.map(Lt=>{const gt=V.value[Lt];return lt[Lt]=1,!gt&&_e?{[ce]:Lt,[Te]:Lt}:gt}).filter(Lt=>Lt),w.value||(x.localList=x.localList.filter(Lt=>!lt[Lt[ce]]))}if(nt&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}at==="focus"&&ue()},ue=(ce="")=>{const{searchKey:be,filterCallback:Te}=e,_e=ce.toLowerCase().trim();if(_e===""){d(x.localList);return}let at=[];typeof Te=="function"?at=Te(_e,be,x.localList)||[]:Array.isArray(be)?at=x.localList.filter(nt=>be.some(lt=>nt[lt].toLowerCase().indexOf(_e)>-1)):at=x.localList.filter(nt=>nt[be].toLowerCase().indexOf(_e)>-1),d(at)},ae=(ce,be)=>{const Te={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:D.value.includes(ce[e.saveKey])};return e.useGroup?Te[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Te[`${c("selector-actived")}`]=be===s.focusItemIndex,Te};function ge(ce,be){return ce.length!==be.length?!1:be.every((Te,_e)=>ce[_e]===Te)}const B=()=>{x.tagListCache=[],x.selectedTagListCache=[],x.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const be=G().findIndex(({id:Te})=>Te==="tagInputItem");return be>=0?be:0},z=(ce,be,Te=!1)=>{if(!be||!ce)return;let _e=be;Te&&(_e=be.nextElementSibling||null),be.parentNode.insertBefore(ce,_e)},Y=ce=>{const{maxData:be,trigger:Te,allowCreate:_e}=e;if(be===-1||be>D.value.length){const{value:at}=ce!=null&&ce.target?ce.target:m,nt=H3(at);nt?(ue(at),y.value.style.width=`${nt*xr}px`):Te==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=_e?-1:0,t("input",m.value)},X=()=>{var ce;o.width=w.value?(ce=C.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},re=()=>{N.value=setTimeout(()=>{var be;const ce=m.value;if(Z(),s.isEdit=!1,w.value){const[Te]=x.tagListCache;ce&&ce===Te&&x.selectedTagListCache.length?Le(x.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Te=f.curPageList.find(_e=>Array.isArray(e.searchKey)?e.searchKey.map(nt=>_e[nt]).includes(ce):_e[e.searchKey]===ce);Te?q(Te,"select"):e.allowCreate&&q(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(be=n==null?void 0:n.validate)==null||be.call(n,"blur")},200)},q=(ce,be,Te)=>{Te==null||Te.stopPropagation(),!(!ce||ce.disabled)&&(w.value&&B(),Le(ce,be),W("select"),Z(),o.isShow=!1)},oe=(ce,be,Te)=>{Te==null||Te.stopPropagation(),je(ce,be),Z(),W("remove",ce),y.value.style.width=`${xr}px`},W=(ce,be)=>{t(ce,be),t("update:modelValue",D.value),t("change",D.value)},_=ce=>{ce.stopPropagation();const be=x.selectedTagList;x.selectedTagList=[];const Te=be.filter(_e=>V.value[_e[e.saveKey]]);(e.allowCreate&&Te.length!==0||!e.allowCreate)&&!w.value&&x.localList.push(...Te),W("removeAll")},$=()=>{const ce={height:T.value.clientHeight,yAxis:T.value.getBoundingClientRect().y};a.nextTick(()=>{const be=T.value.querySelector(`.${c("selector-actived")}`);if(!be)return;const Te={height:be.clientHeight,yAxis:be.getBoundingClientRect().y};Te.yAxis<ce.yAxis&&(T.value.scrollTop=T.value.scrollTop-(ce.yAxis-Te.yAxis));const _e=Te.yAxis+Te.height-ce.yAxis;_e>ce.height&&(T.value.scrollTop=T.value.scrollTop+_e-ce.height)})},ee=(ce,be)=>{const Te=G();z(v.value,Te[ce-1]),x.selectedTagList.splice(ce-1,1),ie();const _e=V.value[be[e.saveKey]];(e.allowCreate&&_e||!e.allowCreate)&&!w.value&&x.localList.push(be),y.value=`${xr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let be;const Te=ce.target.value,_e=H3(Te),at=H(),nt=G();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),$();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),$();break;case"ArrowLeft":if(s.isEdit=!0,!_e){if(at<1)return;z(v.value,nt[at-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!_e){if(at===nt.length-1)return;z(nt[at+1],v.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?q(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&q(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":at!==0&&!m.value&&(be=x.selectedTagList[at-1],ee(at,be));break}},K=ce=>{const be=[],Te=ce.split(";"),_e=/^[a-zA-Z][a-zA-Z_]*/g;return Te.forEach(at=>{const nt=at.match(_e);if(nt){const lt=nt.join("");be.push({[e.saveKey]:lt,[e.displayKey]:lt})}}),be},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:be,saveKey:Te,displayKey:_e,pasteFn:at,allowCreate:nt}=e,lt=ce.clipboardData.getData("text");let gt=(at?at(lt):K(lt)).map(bt=>bt[Te]);if(gt.length){const bt=G(),Ye=H(),Pe=x.localList.map(ze=>ze[Te]);if(gt=gt.filter(ze=>{const ft=(ze==null?void 0:ze.trim())&&!D.value.includes(ze);return nt?ft:ft&&Pe.includes(ze)}),be!==-1){const ze=x.selectedTagList.length;if(ze<be){const ft=be-ze;gt.length>ft&&(gt=[...gt.slice(0,ft)])}else gt=[]}const Ue=nt?gt.map(ze=>x.localList.find(Wt=>Wt[Te]===ze)??{[Te]:ze,[_e]:ze}):x.localList.filter(ze=>gt.includes(ze[Te]));gt.length&&(x.selectedTagList.splice(Ye,0,...Ue),z(v.value,bt[Ye]),y.value.style.width=`${xr}px`,x.localList=x.localList.filter(ze=>!gt.includes(ze[Te])),W("select"),ie())}},ve=ce=>{e.disabled||(z(v.value,ce.currentTarget,!0),y.value.style.width=`${xr}px`,o.isShow&&R())},Le=(ce,be)=>{if(x.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Te,saveKey:_e,displayKey:at,createTagValidator:nt}=e,lt=H();let Lt=1,gt=!1,bt;const Ye=Pe=>typeof nt=="function"?nt(Pe):!0;if(be==="custom")if(Te){let Pe=ce.split(Te);Pe=Pe.filter(ze=>(ze==null?void 0:ze.trim())&&!D.value.includes(ze)&&Ye(ze));const Ue=Pe.map(ze=>V.value[ze]||{[_e]:ze,[at]:ze});Pe.length&&(x.selectedTagList.splice(lt,0,...Ue),Lt=Ue.length,gt=!0)}else{const Pe=typeof ce=="object";if(bt=Pe?ce[_e]:ce.trim(),bt=bt.replace(/\s+/g,""),bt!==void 0&&!D.value.includes(bt)&&Ye(bt)){const Ue=V.value[bt]||(Pe?ce:{[_e]:bt,[at]:bt});x.selectedTagList.splice(lt,0,Ue),gt=!0}}else ce&&(bt=ce[_e],bt!==void 0&&!D.value.includes(bt)&&(x.selectedTagList.splice(lt,0,ce),gt=!0));gt&&a.nextTick(()=>{for(let Pe=1;Pe<=Lt;Pe++){const ze=G()[lt+Pe];z(ze,v.value)}if(y.value.style.width=`${xr}px`,!w.value){e.allowNextFocus&&ie();const Pe=D.value.reduce((Ue,ze)=>(Ue[ze]=1,Ue),{});x.localList=x.localList.filter(Ue=>!Pe[Ue[_e]])}})},je=(ce,be)=>{x.selectedTagList.splice(be,1);const Te=V.value[ce[e.saveKey]];(e.allowCreate&&Te||!e.allowCreate)&&!w.value&&x.localList.push(ce)},Je=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Re}=B3(C,Je,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(x),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:S,curInputValue:m,renderList:E,showTagClose:k,tagInputRef:y,bkTagSelectorRef:C,tagListRef:b,tagInputItemRef:v,selectorListRef:T,triggerClass:Q,overflowTagIndex:Re,localCollapseTags:Je,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:q,handleTagRemove:oe,handleClear:_,tagFocus:ve,handleKeydown:fe,handlePaste:de,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(Gt,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(e8,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(sn,{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(rn,{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(F3,{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(F3,{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($i,{theme:"primary",size:La.Small},null)]):null])])})])}}),$3=Ze(t8),n8={direction:k0(),align:ou().def(yo.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:x0()},G3=Ze(a.defineComponent({name:"Divider",props:n8,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])}}));var Ll=(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))(Ll||{}),xs=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(xs||{});const Z3=De("position",{}).def("top");var Y3=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(Y3||{});const U3=De("sortType",{}).def("replace"),i8={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},a8={name:p.oneOfType([p.number,p.string]).def(""),label:p.string||p.func,tips:p.string,closable:p.bool,visible:p.bool.def(!0),disabled:p.bool,sortable:p.bool,renderDirective:su(),panel:p.string||p.func},r8={active:p.oneOfType([p.number,p.string]).def(""),type:De("type",{}).def("border-card"),tabPosition:Z3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:U3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),extCls:p.string.def(""),validateActive:p.bool.def(!0),showHeader:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),activeBarSize:p.number.def(2),activeBarColor:p.string.def("#3a84ff")},s8={active:p.oneOfType([p.number,p.string]).def(""),type:De("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:Z3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:U3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),validateActive:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),...i8},K3=a.defineComponent({name:"TabNav",directives:{bkTooltips:Ir},props:s8,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([xs.LEFT,xs.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:y}=t.value,C={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${y}px`,background:e.activeBarColor};return e.tabPosition===xs.LEFT?C.right=0:C.left=0,C}if(e.type===Ll.UNBORDER_CARD){const{clientWidth:m,offsetLeft:y}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${y}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((y,C)=>{if(!y.props)return null;const{name:b,label:v,closable:T,visible:N,disabled:k,sortable:w,tips:I}=y.props;if(!N)return!1;e.active===b&&(m=!0);const S=L=>y.slots.label?a.h(y.slots.label):[void 0,""].includes(L)?`选项卡${C+1}`:typeof L=="string"?L:typeof L=="function"?a.h(L):L;return h.push({name:b,closable:T,visible:N,disabled:k,sortable:w,tips:I,tabLabel:S(v)}),!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((v,T)=>{if(!v)return null;const{name:N,disabled:k,tabLabel:w}=v,I=()=>{const L=[this.resolveClassName("tab-header-item")];return k&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},S=(L,Q)=>!k&&(L||Q);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!k&&this.handleTabChange(N),draggable:S(v.sortable,i),onDragstart:L=>c(T,L),ref:e===N?"activeRef":"",onDragenter:L=>{L.preventDefault(),u(T)},onDragleave:L=>{L.preventDefault()},onDragover:L=>{L.preventDefault()},onDragend:L=>{L.preventDefault(),f()},onDrop:L=>{L.preventDefault(),d(T,s)},class:I()},[a.createVNode("div",null,[w]),S(v.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(T,v)},[a.createVNode(rn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:v.tips,disabled:!v.tips}]])}),m=()=>{var T,N;const v=[];return typeof this.$slots.add=="function"?v.push((N=(T=this.$slots).add)==null?void 0:N.call(T,a.h)):n&&v.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(ps,{style:"display:flex;",width:26,height:26},null)])),v.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[v.map((k,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[k]))]):null},y=()=>this.type===Ll.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",C=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,b=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),b||C?"tab-header-auto":""]},[y(),h()]),b,C])}}),X3=Ft(a.defineComponent({name:"Tab",components:{TabNav:K3},props:r8,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:y}=h;return(y||[]).forEach(C=>{let{type:b}=C;b=b.name||b,b==="TabPanel"&&C.component?m.push(C.component):(b===a.Fragment||b==="template")&&c(C,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],y=c(m);y.length!==s.value.length&&(s.value=y)}};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,y){const C=s.value;if(y===Y3.INSERT)if(h<m)C.splice(m+1,0,s[h]),C.splice(h,1);else if(h>m)C.splice(m,0,s[h]),C.splice(h+1,1);else return!1;else{const b=C[m];C[m]=C[h],C[h]=b}s.value=[...C],n("sort",h,m,y),n("sort-change",h,m,y)},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===xs.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Ll.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:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:S,tabSort:L,tabDrag:Q}=this,x={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:S,tabSort:L,tabDrag:Q};return!s||!Array.isArray(s)?null:a.createVNode(K3,x,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)])])}}),{TabPanel:a.defineComponent({name:"TabPanel",props:a8,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]])}})}),ea={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let q3=1;const e6=(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;ea[i].forEach(y=>{c+=(y.el.offsetHeight||0)+u}),q3+=1;const f=`message_${q3}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=y=>{o8(y,i,u,s),a.render(null,d)},a.render(h,d),ea[i].push(h);let m;h.props.getContainer&&ya(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function o8(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;ea[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=ea[t][o].el.offsetHeight,f=ea[t].length;for(let d=o;d<f;d++){const h=parseInt(ea[t][d].el.style[s],10)-u-n;ea[t][d].component.props.offsetY=h}ea[t].splice(o,1)}var t6={exports:{}};/*!
|
66
|
+
*/function gb(e,t){if(!G9.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i=typeof s[n]=="function"}return!i&&Z9&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var mb=gb,pb=db,yb=mb,Y9=10,U9=40,K9=800;function X9(e){var t=0,n=0,i=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*Y9,s=n*Y9,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=U9,s*=U9):(i*=K9,s*=K9)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}X9.getEventType=function(){return pb.firefox()?"DOMMouseScroll":yb("wheel")?"wheel":"mousewheel"};var Cb=X9,bb=Cb;const vb=Ur(bb),wb=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Nb=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(wb?"DOMMouseScroll":"mousewheel",function(n){const i=vb(n);t==null||t.apply(this,[n,i])})},Mb={beforeMount(e,t){console.error(e,t),Nb(e,t.value)}},qi=new Map,Ir={beforeMount(e,t){const n=q9(t),{trigger:i}=n,s=Lb(n);let o=null;if(i==="hover"){let c=null;e.addEventListener("mouseenter",()=>{o=setTimeout(()=>{dd(e),clearTimeout(c),clearTimeout(o)},n.delay)}),s.addEventListener("mouseenter",()=>{clearTimeout(c)}),e.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ls(e)},100)}),e.addEventListener("click",()=>{Ls(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{Ls(e)},100)})}else i==="click"&&document.body.addEventListener("click",c=>{e.contains(c.target)&&!s.hasAttribute("data-show")?o=setTimeout(()=>{dd(e),clearTimeout(o)},n.delay):s.hasAttribute("data-show")&&Ls(e)});qi.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){qi.get(e).opts=q9(t)},unmounted(e){Ls(e),qi.delete(e)}};function Ib(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function q9(e){const t=Ib();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function Lb(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=ni.getPopperIndex(),u=document.createElement("div");if(u.className=`${$t("popper")} ${o?"light":"dark"} ${s}`,u.innerText=t,u.style.zIndex=String(c),n){const f=e3();u.appendChild(f)}return u}function e3(){const e=document.createElement("div");return e.className=$t("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function Tb(e,t){const{opts:n}=qi.get(e),{placement:i,distance:s,showOnInit:o}=n,c=f0(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&dd(e),c}function dd(e){const{popper:t,opts:n}=qi.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=e3();t.appendChild(f)}document.body.appendChild(t);const u=Tb(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),qi.get(e).popperInstance=u}function Ls(e){if(!qi.get(e))return;const{popper:t,popperInstance:n,opts:i}=qi.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const t3=(e,t)=>{const n={content:"",target:e};return typeof t=="object"?Object.assign(n,t):n.content=t,n},fd=(e,t)=>{let n=null,i=null,s=null;const o=t3(e,t),{disabled:c}=o;if(c||n)return;const u=()=>{s&&clearTimeout(s),s=null},f=()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},d=()=>{i&&clearTimeout(i),i=setTimeout(()=>{const y=t3(e,t);y.isShow=!0,y.content=y.content||e.innerHTML,y.allowHtml=!0,Object.assign(y,{onContentMouseenter:u,onContentMouseleave:f}),n=td(y)},100)},h=()=>{s=setTimeout(()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},120)};return e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",h),{destroyInstance:y=>{var C,b;h(),(C=y??e)==null||C.removeEventListener("mouseenter",d),(b=y??e)==null||b.removeEventListener("mouseleave",h)},instance:n}},Sb={mounted(e,t){fd(e,t)}},kb={onContentScroll:Function},xb={list:p.array.def([]),enabled:p.bool.def(!0),scrollEvent:p.bool.def(!1),lineHeight:p.oneOfType([p.number,p.func]).def(30),minHeight:p.number.def(30),height:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),width:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),className:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentClassName:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentStyle:p.object.def({}),scrollXName:p.string.def($t("F-scroll-x")),scrollYName:p.string.def($t("F-scroll-y")),groupItemCount:p.number.def(1),preloadItemCount:p.number.def(1),renderAs:p.string.def("div"),contentAs:p.string.def("div"),scrollOffsetTop:p.number.def(0),scrollPosition:p.string.def("content"),abosuteHeight:p.oneOfType([p.string.def("auto"),p.number]).def("auto"),throttleDelay:p.number.def(60),rowKey:p.string.def(void 0),keepAlive:p.bool.def(!1),...kb},Db=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,y,C,b,v)=>{t.emit("content-scroll",[d,{translateY:C,translateX:b,pos:v}])},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,y,C,b,v,T;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},[((y=(m=t.slots).default)==null?void 0:y.call(m,{data:e.list}))??""]),[[o,c]]),((b=(C=t.slots).afterContent)==null?void 0:b.call(C))??"",((T=(v=t.slots).afterSection)==null?void 0:T.call(v))??""])}}};function n3(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 i3(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:y}=n,{offsetHeight:C}=i;let b=0,v=0,T=0;if(typeof e=="number"&&(b=Math.floor(o/e),v=Math.ceil(C/e)+b,T=o%e),typeof e=="function"){const N=n3(f,o,d,e);b=N.startIndex>0?N.startIndex:0,T=N.diffHeight,v=n3(f,C,d,e).startIndex+b+1}if(o!==u||b!==h||v!==m||y!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,b,v,o,T,c,{bottom:N>=0?N:0})}}function jb(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const C=t.scrollTop,b=t.scrollLeft,v=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,C,C,b,{bottom:v>=0?v:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:y}=o;i3(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:y},t,e)}const a3=(e=60)=>st.throttle((t,n,i)=>jb(t,n,i),e),Ob=(e,t,n,i=60)=>{Reflect.apply(a3(i),void 0,[e,t,n])},Eb={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{Ob(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",a3)}}},Lr=Ze(a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:Eb},props:xb,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=D=>typeof D=="string"?[D]:typeof D=="object"&&!Array.isArray(D)?[D]:D;if(!e.enabled){const{rendAsTag:D}=Db(e,t);return D}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=(D,A,V,E,R,J,G)=>{c.startIndex=A,c.endIndex=V,c.scrollTop=E,c.translateY=R,c.translateX=J,c.scrollLeft=J,c.pos=G,t.emit("content-scroll",[D,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),y()})}),a.watch(()=>e.list,()=>{let D={left:0,top:0};D={left:c.scrollLeft,top:c.scrollTop},f(),y(),e.keepAlive&&x(D)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),y()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=D=>{if(d.value=Math.ceil((D||[]).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 V=0;for(let E=0;E<d.value;E++){const R=e.lineHeight.call(this,E,D.slice(E*e.groupItemCount,e.groupItemCount));V+=typeof R=="number"?R:0}h.value=V}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},y=(D={left:0,top:0})=>{var V;const A=(V=o.value)==null?void 0:V.parentNode;i3(e.lineHeight,u,c,A,null),D&&o.value&&x(D)},C=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,A)=>({...D,$index:A}))),b=a.computed(()=>C.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),v=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),T=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"?v.value:{}})),N=a.computed(()=>{const D=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:D?"none":"block"}}),{resolveClassName:k}=Ce(),w=a.computed(()=>[k("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?k("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?k("virtual-content"):"",...s(e.contentClassName)]),S=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},Q=()=>{f(),y()},x=(D={left:0,top:0})=>{const{left:A,top:V}=D;o.value.scrollTo(A,V)};return t.expose({reset:Q,scrollTo:x}),()=>{var D,A,V,E,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((A=(D=t.slots).beforeContent)==null?void 0:A.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...v.value,...e.contentStyle}},[((E=(V=t.slots).default)==null?void 0:E.call(V,{data:b.value}))??""]),[[S,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[k("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}));var r3=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(r3||{});const Ab=a.defineComponent({name:"Tag",props:{theme:vo(),closable:p.bool.def(!1),type:De("tagStorkeType",{}).def(r3.UNKNOWN),checkable:p.bool.def(!1),checked:p.bool.def(!1),radius:p.string.def("2px"),extCls:p.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=a.computed(()=>Ve({[`${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(sn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Tr=Ze(Ab),Pb=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:vo(),placeholder:p.string.def(""),filterable:p.bool.def(!1),allowCreate:p.bool.def(!1),disabled:p.bool.def(!1),modelValue:p.any,collapseTags:p.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),{proxy:i}=a.getCurrentInstance(),s=a.inject(cl,null),{modelValue:o,collapseTags:c,selected:u}=a.toRefs(e),f=a.ref(o.value),d=a.ref(),h=a.ref(null);a.watch(o,()=>{f.value=o.value}),a.watch([u,c],()=>{T()},{flush:"post"});const m=N=>{t("remove",N)},y=()=>{var N;(N=d.value)==null||N.focus()},C=N=>{t("update:modelValue",N.target.value)},b=N=>{switch(N.code){case"Enter":{t("enter",N.target.value,N);break}}t("keydown",N.target.value,N)},v=N=>{const k=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?k[N]:k},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=v(),k=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=k>0?k:null}))};return{select:s,overflowTagIndex:h,value:f,inputRef:d,handleRemoveTag:m,focus:y,handleInput:C,handleKeydown:b,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=Ve({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Ve({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("span",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((y,C)=>a.createVNode(Tr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&C>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(y.value)},{default:()=>{var b;return[(b=this.select)==null?void 0:b.handleGetLabelByValue(y.value)]}})),!!this.overflowTagIndex&&this.collapseTags&&a.createVNode(Tr,{class:this.resolveClassName("select-overflow-tag")},{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)])}}),zb=a.defineComponent({name:"Select",directives:{clickoutside:oi},props:{modelValue:p.any,multiple:p.bool.def(!1),disabled:p.bool.def(!1),size:p.size().def(ru.DEFAULT),clearable:p.bool.def(!0),loading:p.bool.def(!1),filterable:p.bool.def(!1),remoteMethod:p.func,scrollHeight:p.number.def(200),showSelectAll:p.bool.def(!1),popoverMinWidth:p.number.def(0),showOnInit:p.bool.def(!1),multipleMode:p.oneOf(["default","tag"]).def("default"),tagTheme:vo(),behavior:j0(),collapseTags:p.bool.def(!1),autoHeight:p.bool.def(!0),noDataText:p.string,noMatchText:p.string,loadingText:p.string,placeholder:p.string,searchPlaceholder:p.string,selectAllText:p.string,scrollLoading:p.bool.def(!1),allowCreate:p.bool.def(!1),popoverOptions:Object,customContent:p.bool.def(!1),list:p.array.def([]),idKey:p.string.def("value"),displayKey:p.string.def("label"),withValidate:p.bool.def(!0),showSelectedIcon:p.bool.def(!0),inputSearch:p.bool.def(!0),enableVirtualRender:p.bool.def(!1),allowEmptyValues:p.array.def([]),autoFocus:p.bool.def(!1),keepSearchValue:p.bool.def(!1),prefix:p.string,selectedStyle:j2()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ut("select"),{resolveClassName:i}=Ce(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:y,allowCreate:C,customContent:b,showSelectedIcon:v,inputSearch:T,enableVirtualRender:N,showSelectAll:k,scrollHeight:w,list:I,displayKey:S,idKey:L,collapseTags:Q,autoHeight:x,popoverOptions:D,allowEmptyValues:A,autoFocus:V,keepSearchValue:E,selectedStyle:R}=a.toRefs(e),J=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),G=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),me=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),ue=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),ae=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),ge=Fn(),B=a.ref(),Z=a.ref(),H=a.ref(),z=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),q=a.ref(new Map),oe=a.computed(()=>[...q.value.values()]),W=a.ref(new Map),_=a.ref([]),$=a.computed(()=>_.value.reduce((Ne,Ee)=>(Ne[Ee.value]=Ee.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,Ee)=>(Ne[Ee[L.value]]=Ee[S.value],Ne),{}));a.watch(s,()=>{var Ne;Xl(),e.withValidate&&((Ne=ge==null?void 0:ge.validate)==null||Ne.call(ge,"change"))},{deep:!0}),a.watch(_,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,lt.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var Ee;return(Ee=Mr(String(Ne[S.value])))==null?void 0:Ee.includes(Mr(bi.value))})),de=a.computed(()=>o.value||d.value),ve=a.computed(()=>_.value.map(Ne=>{var Ee,Be;return((Be=(Ee=q.value)==null?void 0:Ee.get(Ne.value))==null?void 0:Be.optionName)||fe.value[Ne.value]||Ne.label})),Le=a.computed(()=>{const Ne=oe.value.reduce((Ee,Be)=>(Be.disabled||Ee.push(Be.optionID),Ee),[]);return Ne.length<=_.value.length&&Ne.every(Ee=>_.value.some(Be=>Be.value===Ee))}),je=a.computed(()=>!!W.value.size),Je=a.computed(()=>!oe.value.length),Re=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),be=a.computed(()=>!(Hs.value||Je.value||Re.value)||b.value),Te=a.computed(()=>u.value&&k.value&&(!bi.value||!c.value)),_e=a.computed(()=>w.value-12-(Te.value?32:0)),at=a.computed(()=>Hs.value?ie.value:Je.value?J.value:Re.value?G.value:""),nt=a.computed(()=>x.value?Q.value&&!Ci.value:Q.value),lt=a.computed(()=>st.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:Ul.value,arrow:!1,placement:"bottom-start",isShow:Ci.value,reference:Y.value,offset:6,popoverDelay:0,renderType:bo.AUTO},D.value)),{register:Lt,unregister:gt}=nd(q),{register:bt,unregister:Ye}=nd(W),{isHover:Pe,setHover:Ue,cancelHover:ze}=R9(),ft=a.ref(!1),Wt=()=>{ft.value||(ft.value=!0,t("focus"))},Qa=()=>{ft.value&&(ft.value=!1,t("blur"))},{popperWidth:Ul,isPopoverShow:Ci,hidePopover:oa,showPopover:Ws,togglePopover:df}=ab({popoverMinWidth:h.value},Z);a.watch(Ci,()=>{t("toggle",Ci.value)});const ff=a.computed(()=>(c.value&&T.value||C.value)&&Ci.value);a.watch(Ci,Ne=>{Ne?setTimeout(()=>{Ha(),Kl()},10):E.value||(bi.value="")});const Kl=()=>{var Be;const Ne=_.value[0],Ee=q.value.get(Ne==null?void 0:Ne.value);Ee&&!Ee.disabled&&Ee.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(Be=oe.value.find(Mn=>!Mn.disabled&&Mn.visible))==null?void 0:Be.optionID},hf=Ne=>{c.value&&oe.value.forEach(Ee=>{var Be;Ee.visible=(Be=Mr(String(Ee.optionName)))==null?void 0:Be.includes(Mr(Ne))})},{searchKey:bi,searchLoading:Hs}=rb(ce.value?f.value:hf,Kl),vi=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},gf=()=>{de.value||(Wt(),df())},Bs=Ne=>{c.value&&(bi.value=Ne)},mf=(Ne,Ee)=>{const Be=String(Ne);!C.value||!Be||c.value&&oe.value.find(fn=>Mr(String(fn.optionName))===Mr(Be))||q.value.get(Be)||(Ee.stopPropagation(),u.value?(_.value.push({value:Be,label:Be}),vi(_.value.map(fn=>fn.value))):(_.value=[{value:Be,label:Be}],vi(Be),oa()),bi.value="")},Wa=Ne=>{if(!(de.value||!Ne)){if(u.value){const Ee=_.value.findIndex(Be=>Be.value===Ne.optionID);Ee>-1?_.value.splice(Ee,1):_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),vi(_.value.map(Be=>Be.value))}else _.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],vi(Ne.optionID),oa();Ha()}},Ha=()=>{setTimeout(()=>{var Ne,Ee,Be;!T.value&&!C.value?(Ne=z.value)==null||Ne.focus():y.value==="tag"?(Ee=Y.value)==null||Ee.focus():(Be=B.value)==null||Be.focus()},0)},pf=Ne=>{Ne.stopPropagation(),_.value=[],vi(u.value?[]:""),t("clear",u.value?[]:""),oa()},yf=()=>{ee.value=""},Cf=()=>{Le.value?_.value=[]:oe.value.forEach(Ne=>{Ne.disabled||_.value.find(Ee=>Ee.value===Ne.optionID)||_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),vi(_.value.map(Ne=>Ne.value)),Ha()},bf=Ne=>{const{scrollTop:Ee,clientHeight:Be,scrollHeight:Mn}=Ne.target;Ee+Be===Mn&&t("scroll-end")},vf=Ne=>{if(de.value)return;const Ee=_.value.findIndex(Be=>Be.value===Ne);Ee>-1&&(_.value.splice(Ee,1),vi(_.value.map(Be=>Be.value)))},Fs=Ne=>{var Be,Mn;let Ee=Ne;if(typeof Ee=="object"){for(const fn of q.value.keys())if(st.isEqual(fn,Ee)){Ee=fn;break}}return((Mn=(Be=q.value)==null?void 0:Be.get(Ee))==null?void 0:Mn.optionName)||fe.value[Ee]||$.value[Ee]||Ee},Xl=()=>{Array.isArray(s.value)?_.value=[...s.value.map(Ne=>({value:Ne,label:Fs(Ne)}))]:s.value!==void 0||A.value.includes(s.value)?_.value=[{value:s.value,label:Fs(s.value)}]:_.value=[]},ql=Ne=>{var Mn,fn;if(!Ci.value)return;const Ee=oe.value.filter(hn=>!hn.disabled&&hn.visible),Be=Ee.findIndex(hn=>hn.optionID===ee.value);if(!(!Ee.length||Be===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const hn=Be>=Ee.length-1?0:Be+1;ee.value=(Mn=Ee[hn])==null?void 0:Mn.optionID;break}case"ArrowUp":{Ne.preventDefault();const hn=Be===0?Ee.length-1:Be-1;ee.value=(fn=Ee[hn])==null?void 0:fn.optionID;break}case"Backspace":{if(!u.value||!_.value.length||bi.value.length||Ne.target===z.value)return;_.value.pop(),vi(_.value.map(hn=>hn.value));break}case"Enter":{const hn=q.value.get(ee.value);Wa(hn);break}}},wf=({event:Ne})=>{var Be;const{target:Ee}=Ne;(Be=Z.value)!=null&&Be.contains(Ee)||Z.value===Ee||(oa(),Qa())},Nf=()=>{setTimeout(()=>{var Ne,Ee;N.value&&((Ee=(Ne=X.value)==null?void 0:Ne.reset)==null||Ee.call(Ne))})};return a.provide(cl,a.reactive({multiple:u,selected:_,activeOptionValue:ee,showSelectedIcon:v,selectedStyle:R,register:Lt,unregister:gt,registerGroup:bt,unregisterGroup:Ye,handleOptionSelected:Wa,handleGetLabelByValue:Fs})),a.onMounted(()=>{Xl(),setTimeout(()=>{m.value&&Ws(),V.value&&Ha()})}),{selected:_,isInput:ff,options:oe,isDisabled:de,selectedLabel:ve,isPopoverShow:Ci,isHover:Pe,popperWidth:Ul,inputRef:B,triggerRef:Z,contentRef:H,searchRef:z,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Hs,isOptionsEmpty:Je,isSearchEmpty:Re,isFocus:ft,isShowSelectContent:be,curContentText:at,isGroup:je,searchKey:bi,isShowSelectAll:Te,virtualHeight:_e,virtualList:K,isCollapseTags:nt,popoverConfig:lt,focusInput:Ha,setHover:Ue,cancelHover:ze,handleFocus:Wt,handleBlur:Qa,handleTogglePopover:gf,handleClear:pf,hidePopover:oa,showPopover:Ws,handleToggleAll:Cf,handleOptionSelected:Wa,handleClickOutside:wf,handleScroll:bf,handleDeleteTag:vf,handleInputChange:Bs,handleInputEnter:mf,handleKeydown:ql,handleSelectedAllOptionMouseEnter:yf,handlePopoverShow:Nf,localLoadingText:ie,localPlaceholder:me,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=Ve({[`${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($i,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(rn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ma,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(Pb,{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(Ta,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(Ia,{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($i,{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(Lr,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(ul,{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(ul,{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($i,{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(Gt,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),hd=Ft(zb,{Option:ul,Group:sb});function Vb(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:Rb}=Sa,gd=Object.assign({},Rb);gd.width.default="400",gd.height.default="100%";const Jb=a.defineComponent({name:"Sideslider",components:{BkModal:Sa,BkButton:At},props:{...gd,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()=>{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(Sa,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),Vb(u)?u:{default:()=>[u]})}}}),s3=Ze(Jb);var o3=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(o3||{});const l3={theme:p.theme().def(Co.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:k0(),status:De("status",{}).def(o3.UNKNOWN),lineType:x0(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},c3=Ze(a.defineComponent({name:"Steps",props:l3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ut("steps"),i=ut("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(y=>{typeof y=="string"?m.push(y):m.push({title:y.title,icon:y.icon,description:y.description,status:y.status,border:y.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{l3.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,y)=>{const C=await e.beforeChange(h);C?m(C):y(C)}),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=Ve({[`${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:y}=m;return y?Object.prototype.toString.call(y)==="[object Object]":typeof m=="string"},u=(m,y)=>(y.icon||(y.icon=m),!isNaN(y.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,y)=>o(m)&&this.status==="loading"||f(y)?a.createVNode(cs,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(y)?a.createVNode(sn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(Fi,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,y)?m+1:a.createVNode(y.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,y)=>{var C,b;return a.createVNode("div",{class:[this.resolveClassName("step"),m.title?"":this.resolveClassName("step-no-content"),s(y)?"done":"",o(y)?"current":"",o(y)&&this.status==="error"?"isError":"",m.status&&o(y)?[`${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(y+1)}},[((b=(C=this.$slots)[y+1])==null?void 0:b.call(C))??h(y,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(y+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}})),_b=a.defineComponent({name:"Switcher",props:{theme:p.theme(),size:p.size(),disabled:p.bool,showText:p.bool,isOutline:p.bool,onText:p.string.def("ON"),offText:p.string.def("OFF"),isSquare:p.bool,extCls:p.string,beforeChange:p.func.def(void 0),trueValue:p.oneOfType([p.string,p.number,p.bool]).def(!0),falseValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),value:p.oneOfType([p.string,p.number,p.bool]).def(!1),modelValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),withValidate:p.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=Fn(),{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 y=`${i(`bswitcher-${e.size}`)}`;m[y]=!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 y=o.value?e.falseValue:e.trueValue,C=!o.value,b=()=>{t("update:modelValue",y),t("change",C)};let v=!0;if(typeof e.beforeChange=="function"&&(v=e.beforeChange(y),typeof v.then=="function"))return s.value=!0,v.then(()=>{b()}).finally(()=>{s.value=!1});v&&b()},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(Ho,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),u3=Ze(_b);var ml=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(ml||{}),d3=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(d3||{});const Qb=["auto","highlight"],Wb=["none","row","col","outer","horizontal"],Fe={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"},Zn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},Sr=6,Da=42;var f3=(e=>(e.DEF1="def1",e.DEF2="def2",e))(f3||{});const pl={large:78,medium:60,small:42},Hb=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:pl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:pl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:pl.large}],h3="InitColumns",g3="BKTableCahce",Bb="Bk_COlumn_Update_Define",Fb=60;var Vt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Vt||{});const $b=["asc","desc","null","custom"],ja=80;var m3=(e=>(e.CURRENT="current",e.ALL="all",e))(m3||{});De("showOverflowTooltipMode",{default:"auto"});const Gb=De("columnType",{default:"none"}),md=De("columnType",{default:""});De("full",{default:"full"}),De("columnSize",{default:"small"});const Zb=an(),pd=De("IOverflowTooltipPropType",{}).def(!1);De("IOverflowTooltipType",{}).def({content:"",disabled:!1,watchCellResize:!0,mode:"auto"});const Yb=De("ISortPropShape",{}).def(!1),Ub=De("IFilterPropShape",{}).def(!1);var p3=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(p3||{});const yl=De("IColumnType",{}),y3=De("ITableSettingPropType",{}).def(!1);De("IColumnPropType",{}).def({label:void 0,minWidth:ja});const Kb={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(yl).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:De("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),stripe:p.bool.def(!1),minHeight:p.oneOfType([p.number,p.string]).def(Da*2),maxHeight:p.oneOfType([p.number,p.string]).def("auto"),rowHeight:p.oneOfType([p.number,p.func]).def(Da),headHeight:p.number.def(Da),showHead:p.bool.def(!0),thead:De("ITheadType",{}).def({color:f3.DEF1,height:Da,isShow:!0}),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(De("boderType",{})),p.string]).def([ml.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(Fb),remotePagination:p.bool.def(!1),emptyText:p.string,settings:y3,rowClass:p.oneOfType([p.string,p.object,p.func]).def({}),rowStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellClass:p.oneOfType([p.string,p.object,p.func]).def({}),scrollLoading:p.oneOfType([p.object,p.bool]).def(void 0),reserveExpand:p.bool.def(!1),selectionKey:p.string.def(""),isSelectedFn:p.func.def(void 0),rowKey:p.oneOfType([p.string,p.func]).def(Fe.ROW_INDEX),showOverflowTooltip:pd,asyncData:p.bool.def(!1),rowHover:p.oneOf(Qb).def(d3.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:De("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:md,headerAlign:md,prependStyle:p.style().def({})},Xb={label:p.oneOfType([p.func.def(()=>""),p.string.def("")]),field:p.oneOfType([p.func.def(()=>""),p.string.def("")]),render:p.oneOfType([p.func.def(()=>""),p.string.def("")]),width:p.oneOfType([p.number.def(void 0),p.string.def("auto")]),minWidth:p.oneOfType([p.number.def(void 0),p.string.def("auto")]).def(30),columnKey:p.string.def(""),showOverflowTooltip:pd,type:Gb,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,Zb]).def(!1),sort:Yb,filter:Ub,colspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),rowspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),align:md,className:p.oneOfType([p.string,p.func]),prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},qb=a.defineComponent({name:"TableColumn",props:Xb,setup(e){const t=a.inject(h3,(s,o=!1)=>{},!1),n=a.inject(g3,{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(Bb,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 ev{constructor(){xe(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 Pn=(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))(Pn||{}),jt=(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))(jt||{});const tv=e=>!0,nv=e=>!0,iv=e=>!0,av=e=>!0,Cl=(e,t,n,i,s)=>!0,rv=e=>!0,sv=e=>!0,ov=e=>!0,lv=e=>!0,C3=e=>!0,cv=e=>!0,b3=e=>!0,uv={columnPick:tv,columnFilter:nv,columnSort:av,colFilterSave:iv,rowClick:Cl,rowDblclick:Cl,rowExpand:rv,select:sv,selectAll:ov,selectionChange:lv,pageLimitChange:C3,pageValueChange:C3,settingChange:cv,scrollBottom:e=>!0,cellClick:b3,cellDblclick:b3,rowMouseEnter:Cl,rowMouseLeave:Cl},v3=(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{}},dv=(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=v3(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=(C,b,v)=>{typeof b=="function"&&C.sort((T,N)=>b(T,N,v[Zn.SORT_TYPE]))},d=(C,b)=>{if(typeof b=="function"){const v=C.filter((T,N)=>b(T,N,t));C.length=0,C.push(...v)}},h=(C,b,v)=>{const T=t.slice(),{sortScope:N}=(v==null?void 0:v.sort)??{};N===m3.ALL&&f(T,b,v),u.length=0,u.push(...T.slice(n.value,i.value)),d(u,C),f(u,b,v)},m=(C,b,v)=>{s=v3(e.pagination,s),y(),c(),h(C,b,v)},y=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},fv=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:La.Normal,mode:Wu.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:y,indicator:C}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode($i,{loading:f,size:d,mode:h,title:m,inline:y,indicator:C},null)}}}};function hv(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const gv=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(hd,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},hv(f=t.limitList.map((d,h)=>a.createVNode(ul,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Oa=5,mv=()=>{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 b=[];if(e.totalPageNum<=Oa+2){for(let N=2;N<=e.totalPageNum-1;N++)b.push(N);return b}const v=Math.floor(Oa/2);e.totalPageNum>Oa&&(s.value=t.value-v>2,o.value=t.value+v<e.totalPageNum-1);const T=Math.min(e.totalPageNum-Oa,Math.max(2,t.value-v));for(let N=T;N<T+Oa;N++)b.push(N);return b});a.watch(()=>e.modelValue,b=>{a.nextTick(()=>{b>=1&&b<=e.totalPageNum?t.value=b:b<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,b=>{t.value>b&&(t.value=b)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=b=>{b!==t.value&&(t.value=b)},h=()=>{t.value=Math.max(1,t.value-Oa)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Oa)},{resolveClassName:y}=Ce();return{current:t,render:({isFirst:b,isLast:v})=>a.createVNode("div",{class:{[`${y("pagination-list")}`]:!0,"is-first":b,"is-last":v}},[a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(si,null,null)]),a.createVNode("div",{class:{[`${y("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:`${y("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(hs,null,null)]),c.value.map(T=>a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===T},key:T,onClick:()=>d(T)},[T])),o.value&&a.createVNode("div",{key:"next-batch",class:`${y("pagination-list-next-batch")}`,onClick:m},[a.createVNode(hs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${y("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${y("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(En,null,null)])])}},pv=()=>{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 k=1;k<=e.totalPageNum;k++)N.push(k);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)},y=N=>{const k=N.target,w=Number(k.textContent);!w||w<1||w>e.totalPageNum||w===i.value||(c=w)},C=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},b=N=>{c=N,m()},{resolveClassName:v}=Ce();return{current:i,render:()=>a.createVNode("div",{class:`${v("pagination-small-list")}`},[a.createVNode("div",{class:{[`${v("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(si,null,null)]),a.createVNode(Gt,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${v("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${v("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:y,onKeydown:C},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${v("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${v("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>b(N)},[N]))])}),a.createVNode("div",{class:{[`${v("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(En,null,null)])])}},yv=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])},Cv={modelValue:p.number.def(1),count:p.number.def(0).isRequired,limit:p.number.def(10),limitList:p.arrayOf(Number).def([10,20,50,100]),showLimit:p.bool.def(!0),type:p.oneOf(["default","compact"]).def("default"),location:p.oneOf(["left","right"]).def("right"),align:p.oneOf(["left","center","right"]).def("left"),size:p.size(),small:p.bool.def(!1),showTotalCount:p.bool.def(!0),prevText:p.string,nextText:p.string,disabled:p.bool.def(!1),beforeChange:p.func,layout:p.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},yd=Ze(a.defineComponent({name:"Pagination",props:Cv,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ut("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=yv(n),{current:u,render:f}=mv(),{current:d,render:h}=pv(),{limit:m,render:y}=gv(n);a.watch([s,m,o],([b,v])=>{const T=Math.ceil(b/v);i.value=T<1?1:T},{immediate:!0}),a.watch(u,b=>{t.emit("update:modelValue",b),t.emit("change",b)}),a.watch(d,b=>{e.small&&(t.emit("update:modelValue",b),t.emit("change",b))}),a.watch(m,b=>{t.emit("limitChange",b)});const{resolveClassName:C}=Ce();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:y,renderSmallList:h,resolveClassName:C}},render(){const e=Ve({[`${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}))])}}));var w3=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}()}(),Cd=typeof window<"u"&&typeof document<"u"&&window.document===document,bl=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")()}(),bv=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(bl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),vv=2;function wv(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){bv(o)}function u(){var f=Date.now();if(n){if(f-s<vv)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var Nv=20,Mv=["top","right","bottom","left","width","height","size","weight"],Iv=typeof MutationObserver<"u",Lv=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=wv(this.refresh.bind(this),Nv)}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(){!Cd||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Iv?(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(){!Cd||!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=Mv.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}(),N3=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},kr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||bl},M3=wl(0,0,0,0);function vl(e){return parseFloat(e)||0}function I3(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 Tv(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 Sv(e){var t=e.getBBox();return wl(0,0,t.width,t.height)}function kv(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return M3;var i=kr(e).getComputedStyle(e),s=Tv(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-=I3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=I3(i,"top","bottom")+c)),!Dv(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 wl(s.left,s.top,u,f)}var xv=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof kr(e).SVGGraphicsElement}:function(e){return e instanceof kr(e).SVGElement&&typeof e.getBBox=="function"}}();function Dv(e){return e===kr(e).document.documentElement}function jv(e){return Cd?xv(e)?Sv(e):kv(e):M3}function Ov(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 N3(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function wl(e,t,n,i){return{x:e,y:t,width:n,height:i}}var Ev=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=wl(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=jv(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}(),Av=function(){function e(t,n){var i=Ov(n);N3(this,{target:t,contentRect:i})}return e}(),Pv=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new w3,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 kr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Ev(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 kr(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 Av(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}(),L3=typeof WeakMap<"u"?new WeakMap:new w3,T3=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=Lv.getInstance(),i=new Pv(t,n,this);L3.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){T3.prototype[e]=function(){var t;return(t=L3.get(this))[e].apply(t,arguments)}});var zv=function(){return typeof bl.ResizeObserver<"u"?bl.ResizeObserver:T3}();const Rt=(e,t,n)=>{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=>Rt(e,i,n)).filter(i=>i!==void 0).at(0)},bd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],Vv=e=>S3(e,"auto"),S3=(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},Rv=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>Wb.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Ts=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],vd=(e,t,n=ja,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:y=void 0}=h;if(y===void 0)return m<ja?ja:m;let C=m;return/^\d+\.?\d*$/.test(`${y}`)&&(C=Number(y)),/^\d+\.?\d*%$/.test(`${y}`)&&(C=Number(y)*o/100),/^\d+\.?\d*px$/i.test(`${y}`)&&(C=Number(`${y}`.replace(/px/i,""))),C},d=(h,m,y=!0)=>{const C=f(h,m),b=m<C?C:m;Object.assign(h,{calcWidth:b}),y&&(c=c-b,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const C=String(Ts(h,["resizeWidth","width"]));let b=!0;if(/^\d+\.?\d*(px)?$/.test(C)){const v=Number(C.replace("px",""));d(h,v),b=!1}if(/^\d+\.?\d*%$/.test(C)){let v=n;if(c>0){const T=Number(C.replace("%",""));v=c*T/100}d(h,v),b=!1}b&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,y)=>{h=c/(u.length-y),d(t[m],h,!1);const{calcWidth:C}=t[m];c=c-C}):u.forEach(m=>{const y=f(t[m],ja);Object.assign(t[m],{calcWidth:y})})}},k3=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?st.debounce(o,n):st.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new zv(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},wd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},Nl=(e,t,n)=>n.type==="index"?e[Fe.ROW_INDEX]+1:st.get(e,t),Ss=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Ss(Reflect.apply(e,globalThis,t),t):[],x3=(e,t,n)=>{const i=D3(e,t,n);return i!==null?i:Ii.v4()},D3=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Fe.ROW_INDEX?`__ROW_INDEX_${n}`:st.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,Jv=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},j3=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),O3=(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,E3=(e,t,n,i)=>{const s=O3(e,t,n,i,"colspan"),o=O3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},A3=(e,t)=>{var c,u;const n=e.field,i=f=>Nl(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===Vt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Vt.DESC?-1:1)},P3=e=>{const t={[Vt.NULL]:0,[Vt.ASC]:1,[Vt.DESC]:2};return e===void 0?Vt.NULL:Object.keys(t)[(t[e]+1)%3]},z3=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Vt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},Ml=(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,_v=(e,t,n)=>{if(e[Fe.ROW_UID]!==void 0)return e[Fe.ROW_UID];const i=x3(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},ks=e=>a.unref(e[Fe.ROW_SOURCE_DATA]||e),V3=e=>a.unref(e[Zn.COL_SOURCE_DATA]||e),R3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:pd,title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:De("ResizerWay",{default:p3.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=()=>{let h=!0,{resizerWay:m}=e,y=n.value.innerText,C="auto",b=!0;return typeof c=="boolean"&&(h=!c),typeof c=="object"&&(h=c.disabled,m=c.resizerWay||"debounce",y=c.content||n.value.innerText,typeof c.content=="function"&&(y=c.content(e.column,e.row)),b=c.watchCellResize,C=c.mode||"auto"),typeof h=="function"&&(h=Reflect.apply(h,this,[e.column,e.row])),{disabled:h,content:y,mode:C,resizerWay:m,watchCellResize:b}},d=()=>{if(!n.value||!ya(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=_4(n.value)),h==="static"&&(i.value=!0),i.value){const y=a.ref(f());u===null&&(u=fd(n.value,{disabled:y.value.disabled,content:y.value.content,mode:y.value.mode}))}else u==null||u.destroyInstance(n.value),u=null};return a.onMounted(()=>{const{disabled:h,resizerWay:m,watchCellResize:y}=f();if(!h&&(d(),y!==!1&&e.observerResize)){let C=k3(n.value,()=>{d()},60,!0,m);C.start(),a.onBeforeUnmount(()=>{C.disconnect(),C=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)}),()=>{var h;return a.createVNode("div",{class:["cell",e.column.type],style:s.value,ref:n,title:e.title},[(h=t.default)==null?void 0:h.call(t)])}}}),Nd=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 Qv{constructor(t,n){xe(this,"props",null);xe(this,"ctx",null);this.props=t,this.ctx=n}}const Wv=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ut("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(qo,{scene:"part",type:i.value,description:n.value},null)}}),Hv=a.defineComponent({name:"HeadFilter",props:{column:yl,height:p.number.def(Da)},emits:["change","filterSave"],setup(e,{emit:t}){var V;const{resolveClassName:n}=Ce(),i=ut("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((V=o.value)==null?void 0:V.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>Ve({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Ve({[n("table-head-filter")]:!0}),h=a.ref(null),m=E=>{u.isOpen=E,E&&setTimeout(()=>{h.value.reset()})},y=`light ${n("table-head-filter")}`,C=a.computed(()=>{const{list:E=[]}=o.value;return E}),b=(E,R="ig")=>new RegExp(`${E}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),v=(E,R)=>{const{match:J}=o.value,G=Nl(R,Rt(s,"field",[s,R]),s);return J==="full"&&E.includes(G),E.some(ie=>b(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(E,R,J,G)=>o.value.filterFn(E,R,e.column,J,G):(E,R)=>E.length?v(E,R):!0,N=()=>{k(!0),t("filterSave",[...u.checked]),u.isOpen=!1},k=(E=!1)=>{const{disabled:R}=I(S,i.value.confirm);if(R||E){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],T)}},w=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,T)))},I=(E,R)=>({disabled:E==="disabled"||E===!1,text:typeof E=="string"?E:R}),{btnSave:S,btnReset:L}=o.value,Q=()=>{const{disabled:E,text:R}=I(S,i.value.confirm);return E?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},x=()=>{const{disabled:E,text:R}=I(L,i.value.reset);return E?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(E,R)=>{const J=new Set(u.checked);E?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),k()},A=E=>E.data.length?E.data.map(R=>a.createVNode("div",{class:"list-item"},[a.createVNode($n,{label:R.value,key:R.$index,immediateEmitChange:!1,checked:u.checked.includes(R.value),modelValue:u.checked.includes(R.value),onChange:J=>D(J,R)},{default:()=>[`${R.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Gt,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:bo.SHOWN,arrow:!1,offset:0},{theme:y},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(Jo,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(Xo,{class:"content-list"},{default:()=>[a.createVNode(Lr,{lineHeight:32,list:C.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:A})]}),a.createVNode("div",{class:"content-footer"},[Q(),a.createVNode("span",{class:"btn-filter-split"},null),x()])])})}}),Bv=a.defineComponent({name:"HeadSort",props:{column:yl,defaultSort:p.oneOf($b).def(Vt.NULL),active:p.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||Vt.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===Vt.NULL&&(h=P3(d)),s.value===d&&(h=Vt.NULL);const m=A3(e.column,h),y=z3(e.column.sort);if((y==null?void 0:y.value)==="custom"){t("change",(y==null?void 0:y.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort"),onClick:f=>o(f,Vt.NULL)},[a.createVNode(Lo,{class:["sort-action","sort-asc",e.active&&s.value===Vt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Vt.ASC)},null),a.createVNode(ls,{class:["sort-action","sort-desc",e.active&&s.value===Vt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Vt.DESC)},null)])}});function J3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const Fv=a.defineComponent({name:"Settings",props:{settings:y3,columns:p.arrayOf(yl).def([]),rowHeight:p.number.def(Da)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=Ce(),i=ut("table"),s=Hb(i),o=(J,G)=>Rt(J,["id","field","type"],[J,G]),c=a.ref(!1),u=a.ref(!1),f=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(J=>({...J,field:J.field||J.type})),checked:[],limit:0,size:"small",sizeList:s,showLineHeight:!0}:e.settings),d=a.ref(f.value.size||"small"),h=a.ref(e.rowHeight),m=a.ref(f.value.checked||[]),C=`light ${n("table-settings")}`,b=a.computed(()=>f.value.fields||e.columns||[]),v={checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:f.value.checked||[]},T=()=>{Object.assign(v,{checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:m.value}),t("change",{checked:m.value,size:d.value,height:h.value,fields:a.unref(b)}),u.value=!1},N=()=>{c.value=v.checkAll,d.value=v.activeSize,h.value=v.activeHeight,m.value=v.checkedFields,u.value=!1},k=()=>{u.value=!0},w=J=>{J.stopImmediatePropagation(),J.stopPropagation(),J.preventDefault(),c.value=!c.value;const G=f.value.fields||e.columns||[],ie=G.filter((me,ue)=>me.disabled&&m.value.includes(o(me,ue))).map((me,ue)=>o(me,ue));if(c.value){const me=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...me,...ie)}else m.value.splice(0,m.value.length,...ie)},I=a.computed(()=>(f.value.limit??0)>0),S=f.value.sizeList||s,L=a.computed(()=>I.value&&(f.value.limit?f.value.limit:0)<=m.value.length),Q=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),x=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),A={marginRight:"12px"},V=()=>S.map(J=>a.createVNode("span",{class:D(J),onClick:()=>x(J)},[J.label])),E=a.computed(()=>m.value.length>0&&!b.value.every((J,G)=>m.value.includes(Rt(J,"field",[J,G])))),R=a.computed(()=>typeof f.value.showLineHeight=="boolean"?f.value.showLineHeight:!0);return a.watch(()=>[m.value],()=>{m.value.length||(c.value=!1),m.value.length&&b.value.every((J,G)=>m.value.includes(o(J,G)))&&(c.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{m.value.splice(0,m.value.length,...f.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Gt,a.mergeProps({trigger:"manual",isShow:u.value,placement:"bottom-end",arrow:!0},{theme:C}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:k},[a.createVNode(Do,{style:"color: #c4c6cc;"},null)]),content:()=>{let J;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[i.value.setting.title]),a.createVNode(us,{class:"icon-close-action",onClick:N},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"},[i.value.setting.fields.title]),I.value?a.createVNode("span",{class:"limit"},[i.value.setting.fields.subtitle(f.value.limit)]):""]),I.value?"":a.createVNode("span",{class:"check-all",onClick:w},[a.createVNode($n,{label:i.value.setting.fields.selectAll,indeterminate:!!E.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(Xo,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},J3(J=b.value.map((G,ie)=>{let me;return a.createVNode("div",{class:"field-item"},[a.createVNode($n,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:Q(G,ie)},J3(me=Rt(G,["name","label"],[G,ie]))?me:{default:()=>[me]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),V()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(At,{theme:"primary",style:A,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(At,{style:A,onClick:N},{default:()=>[i.value.setting.options.cancel]})])])}}):""}}),Md=(e,t,n)=>{const i=(y,C,b)=>({column_fixed:!!y.fixed,column_fixed_left:y.fixed!=="right",column_fixed_right:y.fixed==="right",shadow:y.fixed==="right"?b-C>2:C>0}),s=y=>y.fixed==="right"?"right":"left",o={left:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed&&C.fixed!=="right").reduce((C,b,v)=>y&&v===0?C:C+Ts(b),0),right:(y=!0)=>t.filter(C=>!C.isHidden&&C.fixed==="right").reduce((C,b,v)=>y&&v===0?C:C+Ts(b),n?Sr:0)},c=(y,C,b=0)=>{const v=C[Zn.COL_UID],T=y==="right"?-1:1,N=t.filter(S=>!S.isHidden),{length:k}=N;let w=y==="right"?k*T:1,I=0;for(w;;){w=w+-1*T;const S=Math.abs(w),L=N[S],Q=s(L),x=L[Zn.COL_UID];if(Q===y&&v!==x){const D=Ts(L);I=I+D}if(v===x)break}return I+b},u=(y,C=!1)=>{if(!y.fixed||y.isHidden)return{};const b={left:0,right:C?Sr:0},v=s(y);return b[v]=c(v,y,b[v]),{[v]:`${b[v]}px`}},f=y=>({width:`${o[y](!1)}px`,backgroundColor:e.thead.color,bottom:"0px"}),d=a.computed(()=>{const y={left:!1,right:!1};return t.filter(C=>!C.isHidden&&C.fixed).map(C=>{const b=s(C),v=y[b];return y[b]=!0,{isExist:v,colPos:b,column:C}})}),{resolveClassName:h}=Ce();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function _3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class $v{constructor(t,n,i,s,o,c){xe(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Rt(this.setting,"height",["tbody",t,n,i]):Rt(this.props,"rowHeight",["tbody",t,n])});xe(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]);xe(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 Qv(t,n),this.uuid=Ii.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}=wd(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=j3(u,d,s)}),this.emitEvent(Pn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(Fv,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},null):"",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(Wv,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(yd,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(jt.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(jt.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(jt.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=P3(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=A3(n,s);this.activeSortIndex.value=t,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Rt(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Pn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i];return a.createVNode(Bv,{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(Pn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(jt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(Hv,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=wd(this.props),{cellFn:n}=t,i={"--row-height":`${Rt(t,"height",["thead"])}px`,backgroundColor:this.props.thead.color},s=(d,h)=>typeof n=="function"?n(d,h):Rt(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const v=this.reactiveProp.rowActions.get(Fe.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Fe.ROW_SELECTION]:!!v},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const y=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[y]));const C=typeof y=="string"?y:void 0,b={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(R3,{class:b,title:C,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},_3(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const y=m.split("_").slice(-1)[0];return Object.assign(h,{[y]:C=>{d.listeners.get(m).forEach(b=>Reflect.apply(b,this,[C,d,this]))}})},{}),{resolveFixedColumnStyle:u}=Md(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${Sr+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(Nd,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>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:u(d,this.styleRef.value.hasScrollY),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}=Md(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...Ss(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...Ss(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`,o%2===1&&this.props.stripe?"stripe-row":""];return[a.createVNode(Nd,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:D3(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 k;const h=[n(f),...Ss(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:y,rowspan:C}=E3(f,d,s,o),b=Fe.ROW_SKIP_CFG,v=f[Zn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((k=s[b])==null?void 0:k[v])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...Ss(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[Fe.ROW_EXPAND],"is-last":o+C>=i}],S=(L,Q)=>{const x={event:L,row:ks(s),column:V3(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(Q,x)};return a.createVNode("td",{class:I,style:h,colspan:y,rowspan:C,onClick:L=>S(L,jt.CELL_CLICK),onDblclick:L=>S(L,jt.CELL_DBL_CLICK)},[a.createVNode(R3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},_3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[Fe.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${_v(t,i,this.props)}_expand`;return a.createVNode(Nd,{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(jt.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(jt.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(jt.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(jt.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[Fe.ROW_EXPAND]?a.createVNode(ds,null,null):a.createVNode(ys,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Pn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=Nl(t,Rt(n,"field",[n,t]),n),c=t[Fe.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(Pn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get(Fe.ROW_SELECTION_INDETERMINATE),c=Ml(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode($n,{onChange:s,disabled:!c,modelValue:t[Fe.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=Nl(t,Rt(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=Ve({active:this.isColActive(n)}),s=`${Vv(Ts(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 Il=(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:[]}}),Q3=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:bd(e.activeColumn):Array.isArray(e.activeColumn)?bd(e.activeColumn[0]):bd(e.activeColumn):[],Gv=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Il(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(Q3(e)),o=()=>i().map((c,u)=>({index:u,_column:c,active:s.some(f=>f===u)}));return a.watchEffect(()=>{n=o();const c=Q3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},Zv=(e,t=!0)=>{const n="HeadColumnResize";let i=function(w){return w.MOUSE_MOVE="onMousemove",w.MOUSE_OUT="onMouseout",w.MOUSE_DOWN="onMousedown",w}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=w=>{o=!1,c=!1;const I=document.body.style;I.cursor="";const S=w.clientX-u,L=(f.resizeWidth??f.calcWidth)+S,Q=Number(f.minWidth);f.resizeWidth=L>Q?L:Q,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",C),u=0,h.value=-1e3,f=null,w.target.closest("table").querySelectorAll("th").forEach(D=>D.style.setProperty("user-select","inherit"))},y=w=>st.throttle(()=>{const I=w.clientX-u,S=(f.resizeWidth??f.calcWidth)+I;Number(f.minWidth)<S&&(h.value=w.clientX-u+d)},60),C=w=>{document.body.style.setProperty("cursor",""),y(w)()},b={[i.MOUSE_DOWN]:(w,I)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=I,u=w.clientX;const L=w.target.closest("table");d=u-L.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",C)},[i.MOUSE_MOVE]:(w,I)=>{o&&!c&&(c=!0);const S=w.target.closest("th");if(c&&S.style.setProperty("user-select","none"),!c){if(!S)return;const L=S.getBoundingClientRect();L.width>12&&L.right-w.pageX<8?(s=!0,S.style.setProperty("cursor","col-resize")):(S.style.setProperty("cursor",""),s=!1)}},[i.MOUSE_OUT]:(w,I)=>{const S=w.target;c||S.style.setProperty("cursor","")}},v=w=>`${n}_${w}`,T=()=>{e.forEach(w=>{w.resizable!==!1&&Object.keys(b).forEach(I=>{const S=v(I);w.listeners.has(S)||w.listeners.set(S,[]),w.listeners.get(S).push(b[I])})})},N=()=>{e.forEach(w=>{Object.keys(b).forEach(I=>{const S=v(I);if(w.listeners.has(S)){const L=w.listeners.get(S);L.length=0}})})};t&&T();const k=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:k}},Yv=(e,t,n,i,s)=>{const{getColumns:o}=Il(e,t),c=a.ref(200),u=a.ref(!1),f=a.computed(()=>e.pagination&&e.data.length),d=a.computed(()=>u.value),h=a.computed(()=>Ve({[$t("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},Rv(e.border))),m=Ve({[$t("table-head")]:!0,"has-settings":!!e.settings}),y=a.computed(()=>o()),C=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":`${i.scrollTranslateY}px`})),b=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":"0px",right:d.value?`${Sr-2}px`:"0px"})),v=wd(e),T=a.computed(()=>({"--row-height":`${Rt(v,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),N={[$t("table-body")]:!0},k=a.computed(()=>Ve({[$t("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),w=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",I=()=>{if(y.value.every(R=>/^\d+\.?\d*(px)?$/ig.test(`${R.width}`))){const R=y.value.reduce((G,ie)=>G+Number(`${ie.width}`.replace(/px/ig,"")),0),J=u.value?Sr:0;return`${R+J}px`}return"100%"},S=a.computed(()=>({minHeight:S3(e.minHeight,"auto"),width:I(),maxWidth:"100%",height:w()})),L=(R,J)=>{const G=String(R);if(/^\d+\.?\d*$/.test(G))return Number(G);if(/^\d+\.?\d*px$/ig.test(G))return Number(G.replace("px",""));if(/^\d+\.?\d*%$/ig.test(G)&&typeof J=="number"){const ie=Number(G.replace("%",""));return J*ie/100}return J},Q=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),x=()=>e.showHead?L(e.headHeight,Da):0,D=()=>{const R=L(e.height,c.value),J=x(),G=L(e.minHeight,c.value),ie=e.pagination&&e.data.length?e.paginationHeight:0,me=R-J-ie,ue=e.height!=="auto"?`${me}px`:!1,ae=G-J-ie,ge=L(e.maxHeight,void 0),B=typeof ge=="number"?`${ge-J-ie}px`:!1;Object.assign(Q,{display:s!=null&&s.length?"block":!1,"min-height":`${ae}px`,height:ue,maxHeight:B})};a.onMounted(()=>{A(n==null?void 0:n.value)});const A=R=>{if(R){const{height:J}=R.parentElement.getBoundingClientRect();c.value=J,D(),V(R)}},V=R=>{if(!R)return;const J=e.virtualEnabled?`.${$t("virtual-section")}`:`.${$t("table-body-content")}`,G=R.querySelector(`.${$t("table-body")}`);u.value=Jv(G,J,0)};return{tableClass:h,headClass:m,contentClass:N,footerClass:k,wrapperStyle:S,contentStyle:Q,headStyle:T,offsetXVarStyle:C,headOffsetXVarStyle:b,resetTableHeight:A,updateBorderClass:V,getColumnsWidthOffsetWidth:()=>{let R=0;return u.value&&(R=R+Sr),e.border.includes(ml.OUTER)&&!e.border.includes(ml.NONE)&&(R=R+2),R},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},Uv=(e,t)=>{var q,oe;const n=a.reactive([]),{getColumns:i}=Il(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let _=ja;return W.sort&&(_=_+18),W.filter&&(_=_+28),_},o=a.computed(()=>i()),c=W=>{var ee,fe;const _=(W==null?void 0:W.checked)||((ee=e.settings)==null?void 0:ee.checked)||[],$=(W==null?void 0:W.fields)||((fe=e.settings)==null?void 0:fe.fields)||[];n.length=0,n.push(...o.value.map(K=>({...K,calcWidth:null,resizeWidth:null,minWidth:s(K),listeners:new Map,isHidden:j3($,K,_),[Zn.COL_UID]:Ii.v4(),[Zn.COL_SOURCE_DATA]:K})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=Zv(n,!0),{activeColumns:m}=Gv(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const y=st.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{y()},{immediate:!0,deep:!0});const C=e.columns.reduce((W,_,$)=>{const ee=Rt(_,["field","type"],[_,$]),fe=z3(_.sort);return fe?{...W||{},[ee]:fe==null?void 0:fe.value}:W},null),b=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(q=e.settings)==null?void 0:q.size,height:pl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:C||e.defaultSort}),v=W=>{var _;return b.rowActions.has(W)?(_=b.rowActions.get(W))==null?void 0:_.isExpand:!1},T=()=>{Array.isArray(b.defaultSort)&&b.defaultSort.splice(0),b.defaultSort=C||e.defaultSort},N=(W,_=void 0)=>{const $=W[Fe.ROW_UID],ee=typeof _=="boolean"?_:!v($);b.rowActions.set($,Object.assign({},b.rowActions.get($)??{},{isExpand:ee})),ae()},k=()=>b.rowActions.has(Fe.ROW_SELECTION_ALL)?b.rowActions.get(Fe.ROW_SELECTION_ALL):e.selectionKey?E.every(W=>A(W)):!1,w=W=>{const _=W[Fe.ROW_UID],{isSelected:$=!1}=b.rowActions.get(_)||{};return $},I=(W=w)=>{let _=!1,$=!1;E.forEach(ee=>{const fe=W(ee);!_&&!fe&&(_=!0),!$&&fe&&($=!0)}),b.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,$&&_),b.rowActions.set(Fe.ROW_SELECTION_ALL,$&&!_)},S=()=>e.columns.some(W=>W.type==="selection"),L=()=>{S()&&I(W=>A(W))},Q=(W=void 0)=>{const _=typeof W=="boolean"?W:!k();b.rowActions.set(Fe.ROW_SELECTION_ALL,_),b.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,!1),E.forEach(($,ee)=>{if(Ml(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[Fe.ROW_UID],K=Object.assign({},b.rowActions.get(fe)??{},{isSelected:_});b.rowActions.set(fe,K)}}),I(),ae(_),Z(null,W,!0)},x=()=>{Q(!1)},D=(W,_)=>{const $=W[Fe.ROW_UID];if($){const ee=typeof _=="boolean"?_:!V(W,$),fe=Object.assign({},b.rowActions.get($)??{},{isSelected:ee});b.rowActions.set($,fe),_||b.rowActions.set(Fe.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,_,!1)}},A=(W,_=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?st.get(W,e.selectionKey):_(W),V=(W,_,$)=>A(W,()=>{var fe;const ee=_===void 0?W[Fe.ROW_UID]:_;return Ml(e,{row:W,index:$,isCheckAll:!1})&&k()?!0:b.rowActions.has(ee)?(fe=b.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),E=a.reactive([]),R=a.computed(()=>n.some(W=>typeof W.rowspan=="function"||/^\d$/.test(`${W.rowspan}`)||typeof W.colspan=="function"||/^\d$/.test(`${W.colspan}`))),J=a.computed(()=>n.some(W=>W.type==="selection")),G=a.computed(()=>n.some(W=>W.type==="expand")),ie=a.computed(()=>n.some(W=>W.type==="index")),me=(W=!1)=>{let _=null;const $={},ee=e.data.map(fe=>({[Fe.ROW_UID]:Ii.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const ve=x3(K,e,de);_=ve;const Le={...K,[Fe.ROW_UID]:K[Fe.ROW_UID]||ve,[Fe.ROW_SOURCE_DATA]:{...K}};if(R.value){const je=ge(K,ve,de,$,_);Object.assign(Le,{[Fe.ROW_SKIP_CFG]:je})}return J.value&&Object.assign(Le,{[Fe.ROW_SELECTION]:V(K,ve,de)}),ie.value&&Object.assign(Le,{[Fe.ROW_INDEX]:de}),G.value&&Object.assign(Le,{[Fe.ROW_EXPAND]:W?v(ve):!1}),Le});E.length=0,E.push(...fe),J.value&&L();return}E.length=0,E.push(...ee)},ue=(W,_,$,ee)=>{const fe=V($,$[Fe.ROW_UID],ee);return W&&typeof _=="boolean"?_:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let _=null;const $={};E.forEach((ee,fe)=>{const K=ee[Fe.ROW_UID];if(G.value&&Object.assign(ee,{[Fe.ROW_EXPAND]:v(ee[Fe.ROW_UID])}),R.value){const de=ge(ee,K,fe,$,_);_=ee[Fe.ROW_UID],Object.assign(ee,{[Fe.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[Fe.ROW_INDEX]:fe}),J.value){const de=Ml(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[Fe.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},ge=(W,_,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[_]||(ee[_]={}),n.forEach((ve,Le)=>{var Te;const{colspan:je,rowspan:Je}=E3(ve,Le,W,$),Re=ve[Zn.COL_UID],ce=((Te=de[Re])==null?void 0:Te.skipRowLen)??0,be={[Re]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(be[Re].skipColLen=K,be[Re].skipCol=!0,K=K-1),ce>1?(be[Re].skipRowLen=ce-1,be[Re].skipRow=!0):Je>1&&(be[Re].skipRowLen=Je,be[Re].skipRow=!1),je>1&&(be[Re].skipColLen=je,K=je-1),Object.assign(ee[_],{...be})}),ee[_]},B=st.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,_,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{st.has(ee,e.selectionKey)&&st.set(ee,e.selectionKey,!!_)});else if(st.has(W,e.selectionKey)){const ee=e.data.find(fe=>st.get(fe,e.rowKey)===st.get(W,e.rowKey));st.set(ee,e.selectionKey,!!_)}}},{fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,fixedWrapperClass:X}=Md(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:b,indexData:E,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,initIndexData:me,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:x,toggleAllSelection:Q,toggleRowSelection:D,getSelection:()=>E.filter(W=>V(W)),clearSort:T}},W3=Ft(a.defineComponent({name:"Table",props:Kb,emits:uv,setup(e,t){const n=ut("table");let i=null,s=null,o=null;const c=new ev,u=a.reactive([]),{initColumns:f}=Il(e,u);a.provide(h3,f),a.provide(g3,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:y,dragOffsetXStyle:C,dragOffsetX:b,reactiveSchema:v,indexData:T,fixedColumns:N,resolveColumnStyle:k,resolveColumnClass:w,setRowExpand:I,initIndexData:S,fixedWrapperClass:L,clearSelection:Q,toggleAllSelection:x,toggleRowSelection:D,getSelection:A,clearSort:V,updateColGroups:E}=Uv(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=dv(e,T),{tableClass:me,headClass:ue,contentClass:ae,footerClass:ge,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:z,offsetXVarStyle:Y,headOffsetXVarStyle:X,updateBorderClass:re,resetTableHeight:q,getColumnsWidthOffsetWidth:oe,hasFooter:W}=Yv(e,u,d,v,R),{resolveClassName:_}=Ce(),$=a.computed(()=>({hasScrollY:z.value})),ee=new $v(e,t,v,y,$,n),fe=()=>{const Ye=d.value.querySelector(`.${_("table-body-content")}`),Pe=Ye.querySelector("table");if(Pe){const Ue=Pe.scrollWidth,ze=Ye.clientWidth;m.value=Ue-ze}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{S(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{q(d.value),re(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Ye=oe();vd(d.value,y,20,Ye),fe()}}),ee.on(Pn.ON_SORT_BY_CLICK,Ye=>{const{sortFn:Pe,column:Ue,index:ze,type:ft}=Ye;typeof Pe=="function"&&(i=Pe,s=Ue,Object.assign(s,{[Zn.SORT_TYPE]:ft}),G(o,i,s)),t.emit(jt.COLUMN_SORT,{column:a.unref(Ue[Zn.COL_SOURCE_DATA]),index:ze,type:ft})}).on(Pn.ON_FILTER_CLICK,Ye=>{const{filterFn:Pe,checked:Ue,column:ze,index:ft}=Ye;typeof Pe=="function"&&(o=Pe,G(o,i,s)),t.emit(jt.COLUMN_FILTER,{checked:Ue,column:a.unref(ze[Zn.COL_SOURCE_DATA]),index:ft})}).on(Pn.ON_SETTING_CHANGE,Ye=>{const{checked:Pe=[],size:Ue,height:ze,fields:ft}=Ye;a.nextTick(()=>{E({checked:Pe,fields:ft}),re(d.value);const Wt=oe();Pe.length&&vd(d.value,y,ja,Wt),t.emit(jt.SETTING_CHANGE,{checked:Pe,size:Ue,height:ze,fields:ft})})}).on(Pn.ON_ROW_EXPAND_CLICK,Ye=>{const{row:Pe,column:Ue,index:ze,rows:ft,e:Wt}=Ye;t.emit(jt.ROW_EXPAND_CLICK,{row:ks(Pe),column:V3(Ue),index:ze,rows:ft,e:Wt}),I(Pe,!Pe[Fe.ROW_EXPAND])}).on(Pn.ON_ROW_CHECK,({row:Ye,isAll:Pe,index:Ue,value:ze})=>{Pe?(x(ze),t.emit(jt.ROW_SELECT_ALL,{checked:ze,data:e.data})):(D(Ye,ze),t.emit(jt.ROW_SELECT,{row:ks(Ye),index:Ue,checked:ze,data:e.data})),t.emit(jt.ROW_SELECT_CHANGE,{row:ks(Ye),isAll:Pe,index:Ue,checked:ze,data:e.data})});const K=Ye=>{const Pe=v.pos.bottom??0,Ue=Ye[1],{translateX:ze,translateY:ft,pos:Wt={}}=Ue;v.scrollTranslateY=ft,v.scrollTranslateX=ze,v.pos=Wt;const{bottom:Qa}=Wt;Qa<=2&&Pe>Qa&&ss(60,()=>{t.emit(jt.SCROLL_BOTTOM,{...Wt,translateX:ze,translateY:ft})},!0)(),fe()},de=(Ye={left:0,top:0})=>{var Pe,Ue;(Ue=(Pe=h.value)==null?void 0:Pe.scrollTo)==null||Ue.call(Pe,Ye)};a.onMounted(()=>{if(e.observerResize){let Ye=k3(d.value,()=>{if(!d.value)return;e.height==="100%"||e.height,re(d.value);const Pe=oe();vd(d.value,y,20,Pe)},180,!0,e.resizerWay);Ye.start(),a.onBeforeUnmount(()=>{Ye.disconnect(),Ye=null})}}),a.onBeforeUnmount(()=>{ee.destroy()});const ve=()=>d.value;t.expose({setRowExpand:I,clearSelection:Q,toggleAllSelection:x,toggleRowSelection:D,getSelection:A,clearSort:V,scrollTo:de,getRoot:ve});const Le=a.computed(()=>({...ae,"__is-empty":!R.length})),je=a.computed(()=>({[_("table-body-content")]:!0,[_("stripe")]:e.stripe,"with-virtual-render":e.virtualEnabled})),Je={column_drag_line:!0,"offset-x":!0},Re=a.computed(()=>({...C.value,left:`${b.value-v.scrollTranslateX}px`})),ce={"scroll-loading":!0,_bottom:!0},be=a.computed(()=>({[_("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),Te={zIndex:-1,width:0,height:0,display:"none"},_e=a.computed(()=>({"--footer-height":W.value?`${e.paginationHeight}px`:"0"})),{renderScrollLoading:at}=fv(e,t),nt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),lt=a.computed(()=>({"--prepend-left":`${v.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),Lt=()=>N.value.map(({isExist:Ye,colPos:Pe,column:Ue})=>Ye?"":a.createVNode("div",{class:w(Ue,v.scrollTranslateX,m.value),style:k(Pe)},null)),gt=()=>a.createVNode(a.Fragment,null,[a.createVNode("div",{class:be.value},null),a.createVNode("div",{class:L,style:Y.value},[Lt(),a.createVNode("div",{class:Je,style:Re.value},null),a.createVNode("div",{class:ce},[at()])])]),bt=()=>t.slots.prepend?a.createVNode("div",{style:lt.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Ye,Pe;return a.createVNode("div",{class:me.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[[ee.renderTableHeadSchema(),a.createVNode("div",{class:L,style:X.value},[Lt()])]]),a.createVNode(Lr,a.mergeProps({ref:h,lineHeight:ee.getRowHeight,class:Le.value,style:Z,list:R},nt.value,{contentClassName:je.value,onContentScroll:K,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>bt(),default:Ue=>ee.renderTableBodySchema(Ue.data||R),afterSection:()=>gt()}),a.createVNode("div",{class:ge.value,style:_e.value},[W.value&&ee.renderTableFooter(J.value)]),a.createVNode("div",{style:Te},[(Pe=(Ye=t.slots).default)==null?void 0:Pe.call(Ye)])])}}}),{Column:qb}),xr=12;function Kv(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 Xv(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 H3=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},B3=(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}},F3=a.defineComponent({name:"ListTagRender",props:{node:p.object,searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]),displayKey:p.string,searchKeyword:p.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])])}}),qv=()=>({modelValue:p.arrayOf(p.string).def([]),placeholder:p.string.def(""),list:p.arrayOf(p.object).def([]),disabled:p.bool.def(!1),tooltipKey:p.string.def(""),saveKey:p.string.def("id"),displayKey:p.string.def("name"),hasDeleteIcon:p.bool.def(!1),clearable:p.bool.def(!0),trigger:De("treeTriggerType",{}).def("search"),searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]).def("name"),useGroup:p.bool.def(!1),allowCreate:p.bool.def(!1),maxData:p.number.def(-1),maxResult:p.number.def(10),contentMaxHeight:p.number.def(300),contentWidth:p.number.def(190),separator:p.string.def(""),allowNextFocus:p.bool.def(!0),allowAutoMatch:p.bool.def(!1),showClearOnlyHover:p.bool.def(!1),isAsyncList:p.bool.def(!1),leftSpace:p.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:()=>({})}}),e8=a.defineComponent({name:"TagRender",directives:{bkTooltips:Ir},props:{node:p.object,displayKey:p.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=B4(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]])}}),t8=a.defineComponent({name:"TagInput",directives:{bkTooltips:Ir},props:qv(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=Fn(),i=ut("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}=Kv(u),m=a.ref(""),y=a.ref(null),C=a.ref(null),b=a.ref(null),v=a.ref(null),T=a.ref(null),N=a.ref(null),k=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>x.selectedTagList.length===0&&m.value===""&&!s.isEdit),S=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&x.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),Q=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),x=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>x.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:A,saveKeyMap:V}=Xv(e),E=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((be,Te)=>{be.__index__=Te,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([()=>A.value],()=>{a.nextTick(()=>{me()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var be;ge(D.value,ce)||(a.nextTick(()=>{me()}),e.withValidate&&((be=n==null?void 0:n.validate)==null||be.call(n,"change")))}),a.watch(m,st.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=>{R(),ce&&T.value&&(a.nextTick(()=>{T.value.scrollTop=0}),T.value.removeEventListener("scroll",J),T.value.addEventListener("scroll",J))}),a.onMounted(()=>{me()});const R=()=>{var ce;o.offset.crossAxis=w.value?0:(ce=v.value)==null?void 0:ce.offsetLeft},J=()=>{if(f.isPageLoading||T.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:be,scrollHeight:Te}=T.value;if(ce+be>=Te){const _e=f.curPage+1;_e<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(_e)},500))}},G=()=>{var be;return Array.from(((be=b.value)==null?void 0:be.childNodes)||[]).filter(Te=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Te.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)&&b.value.appendChild(v.value)}clearTimeout(N.value),w.value&&D.value.length&&(x.tagListCache=[...D.value],x.selectedTagListCache=[...x.selectedTagList],m.value=x.selectedTagListCache[0][e.saveKey],je(x.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var be;(be=y.value)==null||be.focus(),e.trigger==="focus"&&x.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},me=()=>{const{saveKey:ce,modelValue:be,displayKey:Te,allowCreate:_e,trigger:at,isAsyncList:nt}=e;if(x.selectedTagList=[],x.localList=A.value,be.length){const lt={};x.selectedTagList=be.map(Lt=>{const gt=V.value[Lt];return lt[Lt]=1,!gt&&_e?{[ce]:Lt,[Te]:Lt}:gt}).filter(Lt=>Lt),w.value||(x.localList=x.localList.filter(Lt=>!lt[Lt[ce]]))}if(nt&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}at==="focus"&&ue()},ue=(ce="")=>{const{searchKey:be,filterCallback:Te}=e,_e=ce.toLowerCase().trim();if(_e===""){d(x.localList);return}let at=[];typeof Te=="function"?at=Te(_e,be,x.localList)||[]:Array.isArray(be)?at=x.localList.filter(nt=>be.some(lt=>nt[lt].toLowerCase().indexOf(_e)>-1)):at=x.localList.filter(nt=>nt[be].toLowerCase().indexOf(_e)>-1),d(at)},ae=(ce,be)=>{const Te={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:D.value.includes(ce[e.saveKey])};return e.useGroup?Te[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Te[`${c("selector-actived")}`]=be===s.focusItemIndex,Te};function ge(ce,be){return ce.length!==be.length?!1:be.every((Te,_e)=>ce[_e]===Te)}const B=()=>{x.tagListCache=[],x.selectedTagListCache=[],x.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const be=G().findIndex(({id:Te})=>Te==="tagInputItem");return be>=0?be:0},z=(ce,be,Te=!1)=>{if(!be||!ce)return;let _e=be;Te&&(_e=be.nextElementSibling||null),be.parentNode.insertBefore(ce,_e)},Y=ce=>{const{maxData:be,trigger:Te,allowCreate:_e}=e;if(be===-1||be>D.value.length){const{value:at}=ce!=null&&ce.target?ce.target:m,nt=H3(at);nt?(ue(at),y.value.style.width=`${nt*xr}px`):Te==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=_e?-1:0,t("input",m.value)},X=()=>{var ce;o.width=w.value?(ce=C.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},re=()=>{N.value=setTimeout(()=>{var be;const ce=m.value;if(Z(),s.isEdit=!1,w.value){const[Te]=x.tagListCache;ce&&ce===Te&&x.selectedTagListCache.length?Le(x.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Te=f.curPageList.find(_e=>Array.isArray(e.searchKey)?e.searchKey.map(nt=>_e[nt]).includes(ce):_e[e.searchKey]===ce);Te?q(Te,"select"):e.allowCreate&&q(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(be=n==null?void 0:n.validate)==null||be.call(n,"blur")},200)},q=(ce,be,Te)=>{Te==null||Te.stopPropagation(),!(!ce||ce.disabled)&&(w.value&&B(),Le(ce,be),W("select"),Z(),o.isShow=!1)},oe=(ce,be,Te)=>{Te==null||Te.stopPropagation(),je(ce,be),Z(),W("remove",ce),y.value.style.width=`${xr}px`},W=(ce,be)=>{t(ce,be),t("update:modelValue",D.value),t("change",D.value)},_=ce=>{ce.stopPropagation();const be=x.selectedTagList;x.selectedTagList=[];const Te=be.filter(_e=>V.value[_e[e.saveKey]]);(e.allowCreate&&Te.length!==0||!e.allowCreate)&&!w.value&&x.localList.push(...Te),W("removeAll")},$=()=>{const ce={height:T.value.clientHeight,yAxis:T.value.getBoundingClientRect().y};a.nextTick(()=>{const be=T.value.querySelector(`.${c("selector-actived")}`);if(!be)return;const Te={height:be.clientHeight,yAxis:be.getBoundingClientRect().y};Te.yAxis<ce.yAxis&&(T.value.scrollTop=T.value.scrollTop-(ce.yAxis-Te.yAxis));const _e=Te.yAxis+Te.height-ce.yAxis;_e>ce.height&&(T.value.scrollTop=T.value.scrollTop+_e-ce.height)})},ee=(ce,be)=>{const Te=G();z(v.value,Te[ce-1]),x.selectedTagList.splice(ce-1,1),ie();const _e=V.value[be[e.saveKey]];(e.allowCreate&&_e||!e.allowCreate)&&!w.value&&x.localList.push(be),y.value=`${xr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let be;const Te=ce.target.value,_e=H3(Te),at=H(),nt=G();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),$();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),$();break;case"ArrowLeft":if(s.isEdit=!0,!_e){if(at<1)return;z(v.value,nt[at-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!_e){if(at===nt.length-1)return;z(nt[at+1],v.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?q(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&q(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":at!==0&&!m.value&&(be=x.selectedTagList[at-1],ee(at,be));break}},K=ce=>{const be=[],Te=ce.split(";"),_e=/^[a-zA-Z][a-zA-Z_]*/g;return Te.forEach(at=>{const nt=at.match(_e);if(nt){const lt=nt.join("");be.push({[e.saveKey]:lt,[e.displayKey]:lt})}}),be},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:be,saveKey:Te,displayKey:_e,pasteFn:at,allowCreate:nt}=e,lt=ce.clipboardData.getData("text");let gt=(at?at(lt):K(lt)).map(bt=>bt[Te]);if(gt.length){const bt=G(),Ye=H(),Pe=x.localList.map(ze=>ze[Te]);if(gt=gt.filter(ze=>{const ft=(ze==null?void 0:ze.trim())&&!D.value.includes(ze);return nt?ft:ft&&Pe.includes(ze)}),be!==-1){const ze=x.selectedTagList.length;if(ze<be){const ft=be-ze;gt.length>ft&&(gt=[...gt.slice(0,ft)])}else gt=[]}const Ue=nt?gt.map(ze=>x.localList.find(Wt=>Wt[Te]===ze)??{[Te]:ze,[_e]:ze}):x.localList.filter(ze=>gt.includes(ze[Te]));gt.length&&(x.selectedTagList.splice(Ye,0,...Ue),z(v.value,bt[Ye]),y.value.style.width=`${xr}px`,x.localList=x.localList.filter(ze=>!gt.includes(ze[Te])),W("select"),ie())}},ve=ce=>{e.disabled||(z(v.value,ce.currentTarget,!0),y.value.style.width=`${xr}px`,o.isShow&&R())},Le=(ce,be)=>{if(x.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Te,saveKey:_e,displayKey:at,createTagValidator:nt}=e,lt=H();let Lt=1,gt=!1,bt;const Ye=Pe=>typeof nt=="function"?nt(Pe):!0;if(be==="custom")if(Te){let Pe=ce.split(Te);Pe=Pe.filter(ze=>(ze==null?void 0:ze.trim())&&!D.value.includes(ze)&&Ye(ze));const Ue=Pe.map(ze=>V.value[ze]||{[_e]:ze,[at]:ze});Pe.length&&(x.selectedTagList.splice(lt,0,...Ue),Lt=Ue.length,gt=!0)}else{const Pe=typeof ce=="object";if(bt=Pe?ce[_e]:ce.trim(),bt=bt.replace(/\s+/g,""),bt!==void 0&&!D.value.includes(bt)&&Ye(bt)){const Ue=V.value[bt]||(Pe?ce:{[_e]:bt,[at]:bt});x.selectedTagList.splice(lt,0,Ue),gt=!0}}else ce&&(bt=ce[_e],bt!==void 0&&!D.value.includes(bt)&&(x.selectedTagList.splice(lt,0,ce),gt=!0));gt&&a.nextTick(()=>{for(let Pe=1;Pe<=Lt;Pe++){const ze=G()[lt+Pe];z(ze,v.value)}if(y.value.style.width=`${xr}px`,!w.value){e.allowNextFocus&&ie();const Pe=D.value.reduce((Ue,ze)=>(Ue[ze]=1,Ue),{});x.localList=x.localList.filter(Ue=>!Pe[Ue[_e]])}})},je=(ce,be)=>{x.selectedTagList.splice(be,1);const Te=V.value[ce[e.saveKey]];(e.allowCreate&&Te||!e.allowCreate)&&!w.value&&x.localList.push(ce)},Je=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Re}=B3(C,Je,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(x),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:S,curInputValue:m,renderList:E,showTagClose:k,tagInputRef:y,bkTagSelectorRef:C,tagListRef:b,tagInputItemRef:v,selectorListRef:T,triggerClass:Q,overflowTagIndex:Re,localCollapseTags:Je,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:q,handleTagRemove:oe,handleClear:_,tagFocus:ve,handleKeydown:fe,handlePaste:de,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(Gt,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(e8,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(sn,{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(rn,{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(F3,{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(F3,{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($i,{theme:"primary",size:La.Small},null)]):null])])})])}}),$3=Ze(t8),n8={direction:k0(),align:ou().def(yo.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:x0()},G3=Ze(a.defineComponent({name:"Divider",props:n8,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])}}));var Ll=(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))(Ll||{}),xs=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(xs||{});const Z3=De("position",{}).def("top");var Y3=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(Y3||{});const U3=De("sortType",{}).def("replace"),i8={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},a8={name:p.oneOfType([p.number,p.string]).def(""),label:p.string||p.func,tips:p.string,closable:p.bool,visible:p.bool.def(!0),disabled:p.bool,sortable:p.bool,renderDirective:su(),panel:p.string||p.func},r8={active:p.oneOfType([p.number,p.string]).def(""),type:De("type",{}).def("border-card"),tabPosition:Z3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:U3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),extCls:p.string.def(""),validateActive:p.bool.def(!0),showHeader:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),activeBarSize:p.number.def(2),activeBarColor:p.string.def("#3a84ff")},s8={active:p.oneOfType([p.number,p.string]).def(""),type:De("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:Z3,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:U3,labelHeight:p.number.def(50),scrollStep:p.number.def(200),validateActive:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),...i8},K3=a.defineComponent({name:"TabNav",directives:{bkTooltips:Ir},props:s8,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([xs.LEFT,xs.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:y}=t.value,C={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${y}px`,background:e.activeBarColor};return e.tabPosition===xs.LEFT?C.right=0:C.left=0,C}if(e.type===Ll.UNBORDER_CARD){const{clientWidth:m,offsetLeft:y}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${y}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((y,C)=>{if(!y.props)return null;const{name:b,label:v,closable:T,visible:N,disabled:k,sortable:w,tips:I}=y.props;if(!N)return!1;e.active===b&&(m=!0);const S=L=>y.slots.label?a.h(y.slots.label):[void 0,""].includes(L)?`选项卡${C+1}`:typeof L=="string"?L:typeof L=="function"?a.h(L):L;return h.push({name:b,closable:T,visible:N,disabled:k,sortable:w,tips:I,tabLabel:S(v)}),!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((v,T)=>{if(!v)return null;const{name:N,disabled:k,tabLabel:w}=v,I=()=>{const L=[this.resolveClassName("tab-header-item")];return k&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},S=(L,Q)=>!k&&(L||Q);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!k&&this.handleTabChange(N),draggable:S(v.sortable,i),onDragstart:L=>c(T,L),ref:e===N?"activeRef":"",onDragenter:L=>{L.preventDefault(),u(T)},onDragleave:L=>{L.preventDefault()},onDragover:L=>{L.preventDefault()},onDragend:L=>{L.preventDefault(),f()},onDrop:L=>{L.preventDefault(),d(T,s)},class:I()},[a.createVNode("div",null,[w]),S(v.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(T,v)},[a.createVNode(rn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:v.tips,disabled:!v.tips}]])}),m=()=>{var T,N;const v=[];return typeof this.$slots.add=="function"?v.push((N=(T=this.$slots).add)==null?void 0:N.call(T,a.h)):n&&v.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(ps,{style:"display:flex;",width:26,height:26},null)])),v.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[v.map((k,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[k]))]):null},y=()=>this.type===Ll.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",C=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,b=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),b||C?"tab-header-auto":""]},[y(),h()]),b,C])}}),X3=Ft(a.defineComponent({name:"Tab",components:{TabNav:K3},props:r8,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:y}=h;return(y||[]).forEach(C=>{let{type:b}=C;b=b.name||b,b==="TabPanel"&&C.component?m.push(C.component):(b===a.Fragment||b==="template")&&c(C,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],y=c(m);y.length!==s.value.length&&(s.value=y)}};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,y){const C=s.value;if(y===Y3.INSERT)if(h<m)C.splice(m+1,0,s[h]),C.splice(h,1);else if(h>m)C.splice(m,0,s[h]),C.splice(h+1,1);else return!1;else{const b=C[m];C[m]=C[h],C[h]=b}s.value=[...C],n("sort",h,m,y),n("sort-change",h,m,y)},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===xs.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Ll.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:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:S,tabSort:L,tabDrag:Q}=this,x={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:y,validateActive:C,changeOnHover:b,changeOnHoverDelay:v,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:S,tabSort:L,tabDrag:Q};return!s||!Array.isArray(s)?null:a.createVNode(K3,x,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)])])}}),{TabPanel:a.defineComponent({name:"TabPanel",props:a8,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]])}})}),ea={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let q3=1;const e6=(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;ea[i].forEach(y=>{c+=(y.el.offsetHeight||0)+u}),q3+=1;const f=`message_${q3}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=y=>{o8(y,i,u,s),a.render(null,d)},a.render(h,d),ea[i].push(h);let m;h.props.getContainer&&ya(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function o8(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;ea[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=ea[t][o].el.offsetHeight,f=ea[t].length;for(let d=o;d<f;d++){const h=parseInt(ea[t][d].el.style[s],10)-u-n;ea[t][d].component.props.offsetY=h}ea[t].splice(o,1)}var t6={exports:{}};/*!
|
67
67
|
* clipboard.js v2.0.11
|
68
68
|
* https://clipboardjs.com/
|
69
69
|
*
|