bkui-vue 0.0.1-beta.195 → 0.0.1-beta.196

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.umd.js CHANGED
@@ -54,7 +54,7 @@ ${Cs(n)}`),i}})}function n4(e){const t=Object.keys(e),n=t.filter(l=>{var o;retur
54
54
  m 0 ${x?"":"-"}${L}
55
55
  a ${L} ${L} 0 1 1 0 ${x?"-":""}${L*2}
56
56
  a ${L} ${L} 0 1 1 0 ${x?"":"-"}${L*2}
57
- `,P={d:A,stroke:m||"#f5f5f5","stroke-linecap":f,"stroke-width":w,"fill-opacity":"0",class:"process-circle-trail",style:N},J={d:A,stroke:c||"#13ce66","stroke-linecap":f,"stroke-width":l>0&&w||0,"fill-opacity":"0",class:`process-circle-path bk-${u}-circle-trail`,style:T};return a.createVNode("div",{class:"progress-outer-circle",style:v},[a.createVNode("svg",{viewBox:"0 0 100 100"},[a.createVNode("path",P,null),a.createVNode("path",J,null)]),a.createVNode("span",{class:"progress-circle-text",style:p},[n==null?void 0:n.default()])])},$m=(e,{attrs:t,slots:n})=>{const{percent:i,strokeWidth:l,size:o,color:c,titleStyle:f,showText:u,textInside:h,theme:m}=t,p={height:`${l}px`,lineHeight:`${l}px`},w={width:`${i}%`,background:c,animationDuration:"3s"},y=(v=!0)=>(u||n.default)&&(v&&h||!v&&!h)?n==null?void 0:n.default():null;return a.createVNode("div",{class:"progress-outer"},[a.createVNode("div",{class:`bk-progress-${o||"normal"} progress-bar`,style:p},[a.createVNode("div",{style:w,class:{"progress-inner":!0,[`bk-${m}`]:!0}},[a.createVNode("div",{class:"inner-text",style:f},[y()])])]),y(!1)])};function I0(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var Xm=a.defineComponent({name:"Progress",props:{extCls:g.string,type:g.string.validate(e=>["line","circle","dashboard"].includes(e)).def("line"),percent:g.number.def(0),theme:g.theme().def("primary"),size:g.size(),width:g.number.def(126),strokeWidth:g.number,strokeLinecap:g.string.def("round"),textInside:g.bool.def(!1),showText:g.bool.def(!0),color:g.string,bgColor:g.string,fixed:g.number.validate(e=>e>=0&&e<=20).def(0),format:g.func.def(e=>`${e}%`),titleStyle:g.object.def({fontSize:"16px",verticalAlign:"middle"})},setup(){return{}},methods:{validPercent(e){return!e||e<0?0:e>100?100:e},renderProcessInfo(){var f;const{showText:e,format:t,percent:n,textInside:i,titleStyle:l,fixed:o}=this.$props,c=t((f=this.validPercent(n))==null?void 0:f.toFixed(o));return(e||this.$slots.default)&&i?this.$slots.default?this.$slots.default():a.createVNode("span",null,[c]):!e||i?null:a.createVNode("span",{class:"progress-text",style:typeof c=="string"?l:void 0},[this.$slots.default?this.$slots.default():c])}},render(){const e=this.renderProcessInfo(),t=Te(U({},this.$props),{percent:this.validPercent(this.percent)});let n=a.createVNode($m,t,I0(e)?e:{default:()=>[e]});(this.type==="circle"||this.type==="dashboard")&&(n=a.createVNode(Um,t,I0(e)?e:{default:()=>[e]}));const i={class:Se({extCls:!!this.extCls},`bk-progress bk-progress-${this.type}`)};return a.createVNode("div",i,[n])}});const kr=He(Xm),N0=Symbol("RadioGroup");function L0(){const e=a.ref(!1);return[e,{blur:()=>{e.value=!1},focus:()=>{e.value=!0}}]}const k0=()=>{const e=a.getCurrentInstance(),{props:t,emit:n}=e,i=a.inject(N0,So),l=!Cf(i),o=a.ref(!1),c=a.computed(()=>l&&i.props.disabled?!0:t.disabled);l?a.watch(()=>i.props.modelValue,h=>{o.value=h===t.label},{immediate:!0}):a.watch(()=>t.modelValue,h=>{h!==""&&(o.value=h===t.label)},{immediate:!0});const f=(h=!0)=>{o.value=h},u=h=>{if(c.value)return;const m=h.target;o.value=m.checked;const p=o.value?t.label:"";n("change",p),n("update:modelValue",p),l&&i.handleChange(e.proxy),a.nextTick(()=>{m.checked!==o.value&&(m.checked=o.value)})};return a.onMounted(()=>{l&&i.register(e.proxy)}),a.onBeforeUnmount(()=>{l&&i.unregister(e.proxy)}),{isChecked:o,isDisabled:c,setChecked:f,handleChange:u}},Km={name:g.string.def(""),label:g.oneOfType([String,Number,Boolean]).isRequired,modelValue:g.oneOfType([String,Number,Boolean]).def(""),checked:g.bool.def(!1),disabled:g.bool.def(!1)};var qm=a.defineComponent({name:"Radio",props:Km,emits:["change","update:modelValue"],setup(){const[e,{blur:t,focus:n}]=L0(),{isChecked:i,isDisabled:l,setChecked:o,handleChange:c}=k0();return{isFocused:e,isChecked:i,isDisabled:l,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c}},render(){const e=Se({"bk-radio":!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked});return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:"bk-radio-input",type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),a.createVNode("span",{class:"bk-radio-text"},[this.$slots.default?this.$slots.default():this.label])])}});const ep={name:g.string.def(""),label:g.oneOfType([String,Number,Boolean]).isRequired,modelValue:g.oneOfType([String,Number,Boolean]).def(""),checked:g.bool.def(!1),disabled:g.bool.def(!1),size:g.size()};var tp=a.defineComponent({name:"RadioButton",props:ep,emits:["change","update:modelValue"],setup(){const[e,{blur:t,focus:n}]=L0(),{isChecked:i,isDisabled:l,setChecked:o,handleChange:c}=k0();return{isFocused:e,isChecked:i,isDisabled:l,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c}},render(){const e=Se({"bk-radio-button":!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked});return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:"bk-radio-button-input",type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),a.createVNode("div",{class:"bk-radio-button-text"},[this.$slots.default?this.$slots.default():this.label])])}});const np={name:g.string.def(""),modelValue:g.oneOfType([String,Number,Boolean]),disabled:g.bool,withValidate:g.bool.def(!0)};var ip=a.defineComponent({name:"RadioGroup",props:np,emits:["change","update:modelValue"],setup(e,t){const n=En(),i=[],l=f=>{i.push(f)},o=f=>{const u=i.indexOf(f);u>-1&&i.splice(u,1)},c=f=>{const u=f.label;i.forEach(h=>{h!==f&&h.setChecked(!1)}),t.emit("update:modelValue",u),t.emit("change",u)};return a.provide(N0,{props:e,register:l,unregister:o,handleChange:c}),a.watch(()=>e.modelValue,()=>{var f;e.withValidate&&((f=n==null?void 0:n.validate)==null||f.call(n,"change"))}),a.onMounted(()=>{e.modelValue!==""&&i.forEach(f=>{f.setChecked(f.label===e.modelValue)})}),{}},render(){var e;return a.createVNode("div",{class:"bk-radio-group"},[(e=this.$slots)==null?void 0:e.default()])}});const T0=Bt(qm,{Group:ip,Button:tp});var Zs=a.defineComponent({name:"Star",props:{rate:g.number.def(0),width:g.number.def(15),height:g.number.def(16),editable:g.bool.def(!0),hoverRate:g.number.def(0),max:g.number.def(5)},emits:["chooseRate","changeHover"],setup(e,{emit:t}){const n=f=>{if(!e.editable)return;const u=f+1;t("chooseRate",u)},i=f=>{if(!e.editable)return;const u=f+1;t("changeHover",u)},l=f=>Se({"bk-is-select":f<Math.floor(o.value),"bk-is-edit":e.editable,"bk-rate-star":!0}),o=a.computed(()=>e.hoverRate||e.rate),c={width:`${e.width}px`,height:`${e.height}px`,minWidth:`${e.width}px`};return()=>a.createVNode("p",{class:"bk-rate-stars"},[Array(e.max).fill(1).map((f,u)=>a.createVNode("svg",{class:l(u),style:c,x:"0px",y:"0px",viewBox:"0 0 64 64",onClick:()=>n(u),onMouseenter:()=>i(u)},[a.createVNode("g",{transform:"translate(-143.000000, -635.000000)"},[a.createVNode("g",{transform:"translate(83.000000, 114.000000)"},[a.createVNode("g",{transform:"translate(15.000000, 384.000000)"},[a.createVNode("g",{transform:"translate(29.000000, 137.000000)"},[a.createVNode("polygon",{class:"st1",points:"48,53 28.2,63.9 32,40.8 16,24.4 38.1,21 48,-0.1 57.8,21 79.9,24.4 63.9,40.8 67.7,63.9"},null)])])])])]))])}}),ap=a.defineComponent({name:"Rate",components:{star:Zs},props:{modelValue:g.number.def(0),size:g.size(),editable:g.bool.def(!0),withValidate:g.bool.def(!0)},emits:["change","update:modelValue"],setup(e,{emit:t}){const n=En(),i=a.ref(0),l=p=>{!e.editable||(t("update:modelValue",p),t("change",p))},o=p=>{i.value=p},c=Se({"bk-rate":!0}),u={small:{width:12,height:12},large:{width:18,height:18}}[e.size]||{width:15,height:16},h=a.computed(()=>{const p=Math.floor(e.modelValue),w=(u.width+3)*p,y=u.width*(e.modelValue-p);return{width:`${w+y}px`}}),m={width:u.width,height:u.height};return a.watch(()=>e.modelValue,()=>{var p;e.withValidate&&((p=n==null?void 0:n.validate)==null||p.call(n,"change"))}),()=>a.createVNode("p",{class:c},[e.editable?a.createVNode(Zs,a.mergeProps({rate:e.modelValue,"hover-rate":i.value,onChooseRate:l,onChangeHover:o,onMouseleave:()=>o(0)},m),null):[a.createVNode(Zs,a.mergeProps({rate:5,style:h.value,class:"bk-score-real",editable:!1},m),null),a.createVNode(Zs,a.mergeProps({rate:0,editable:!1},m),null)]])}});const x0=He(ap);var rp=a.defineComponent({name:"Swiper",props:{isLoop:g.bool.def(!0),loopTime:g.number.def(8e3),pics:g.array.def([]),list:g.array.def([]),height:g.number,width:g.number},emits:["index-change"],setup(e,{emit:t,slots:n}){const{isLoop:i,loopTime:l,pics:o,list:c,height:f,width:u}=a.toRefs(e),h=a.ref(),m=a.ref(0),p=a.ref(0),w=a.ref(0),y=a.ref(0);let v;const L=a.computed(()=>{var _;return((_=c.value)==null?void 0:_.length)>0?c.value:o.value}),x=a.computed(()=>({width:`${p.value*L.value.length}px`,transform:`translateX(-${p.value*m.value}px)`})),k=a.computed(()=>({width:`${p.value}px`,height:`${w.value}px`})),C=_=>{let ce=_;_>=L.value.length&&(ce=0),_<0&&(ce=L.value.length-1),m.value=ce,t("index-change",ce)},b=_=>{!_||window.open(_,"_blank")},I=_=>["bk-swiper-img",{"bk-swiper-link":_.link},_.class],N=_=>({"background-image":`url(${_.url})`,"background-color":_.color}),T=_=>({"bk-current-index":m.value===_}),A=()=>{i.value&&(y.value=window.setTimeout(()=>{C(m.value+1),A()},l.value))},P=()=>{window.clearTimeout(y.value)},J=()=>{var ce;const _=(ce=h.value)==null?void 0:ce.parentElement;!_||!window.ResizeObserver||(v=new ResizeObserver(()=>{ne()}),v.observe(_))},z=()=>{var _;(_=v.disconnect)==null||_.call(v)},E=_=>{if(_===void 0)return{height:0,width:0};const ce=getComputedStyle(_),re=_.clientWidth-parseFloat(ce.paddingTop)-parseFloat(ce.paddingBottom);return{height:_.clientHeight-parseFloat(ce.paddingLeft)-parseFloat(ce.paddingRight),width:re}},ne=()=>{var ce;const _=E((ce=h.value)==null?void 0:ce.parentElement);p.value=+u.value>0?u.value:_.width,w.value=+f.value>0?f.value:_.height};return a.watch([f,u],ne),a.onMounted(()=>{ne(),A(),J()}),a.onBeforeUnmount(()=>{P(),z()}),()=>a.createVNode("section",{class:"bk-swiper-home",ref:h,style:k.value},[a.createVNode("hgroup",{style:x.value,class:"bk-transition bk-swiper-main"},[L.value.map(_=>{var ce,re;return a.createVNode("h3",{class:"bk-swiper-card",style:k.value},[(re=(ce=n.default)==null?void 0:ce.call(n,_))!=null?re:a.createVNode("span",{class:I(_),style:N(_),onClick:()=>b(_.link)},null)])})]),a.createVNode("ul",{class:"bk-swiper-index"},[L.value.map((_,ce)=>a.createVNode("li",{class:T(ce),onMouseover:()=>C(ce)},null))]),a.createVNode("span",{class:"bk-swiper-nav bk-nav-prev",onClick:()=>C(m.value-1)},[a.createVNode("i",{class:"bk-swiper-nav-icon"},null)]),a.createVNode("span",{class:"bk-swiper-nav bk-nav-next",onClick:()=>C(m.value+1)},[a.createVNode("i",{class:"bk-swiper-nav-icon"},null)])])}});const S0=He(rp),Ic=Symbol("BkSelect"),D0=Symbol("BkOptionGroup");function j0(){const e=a.ref(!1);return{isHover:e,setHover:()=>{e.value=!0},cancelHover:()=>{e.value=!1}}}function Nc(e){return{register:(i,l)=>{if(!!l){if(e.value.has(i)){console.warn(`repeat ${i}`,l);return}return e.value.set(i,l)}},unregister:i=>{e.value.delete(i)}}}function sp(e,t=200){let n,i=e;return a.customRef((l,o)=>({get(){return l(),i},set(c){clearTimeout(n),c===void 0||c===""?(i=c,o()):n=setTimeout(()=>{i=c,o()},t)}}))}function lp(e,t){const{popoverMinWidth:n}=e;let i=null;const l=a.ref("auto"),o=a.ref(!1),c=()=>{o.value=!o.value},f=()=>{o.value=!1},u=()=>{o.value=!0},h=()=>{var m;l.value=Math.max((m=t.value)==null?void 0:m.offsetWidth,n)};return a.onMounted(()=>{!t.value||(i=V1(t.value,h,60,!0),i.start())}),a.onBeforeUnmount(()=>{i==null||i.stop(),i=null}),{isPopoverShow:o,popperWidth:l,togglePopover:c,hidePopover:f,showPopover:u}}function op(e,t){const n=sp(""),i=a.ref(!1);return a.watch(n,async()=>{try{i.value=!0,await e(n.value),i.value=!1}catch(l){console.error(l)}finally{t==null||t()}}),{searchKey:n,searchLoading:i}}function Tr(e=""){return e&&String(e).trim().toLowerCase()}var Gs=a.defineComponent({name:"Option",props:{value:g.any,label:g.string.def(""),disabled:g.bool.def(!1)},setup(e){const{proxy:t}=a.getCurrentInstance(),n=a.reactive({visible:!0}),{disabled:i,value:l}=a.toRefs(e),o=a.inject(Ic,null),c=a.inject(D0,null),f=a.computed(()=>{var y;return(y=o==null?void 0:o.selected)==null?void 0:y.some(v=>v.value===l.value)}),u=a.computed(()=>o==null?void 0:o.multiple),h=a.computed(()=>(o==null?void 0:o.activeOptionValue)===l.value),m=a.computed(()=>o==null?void 0:o.showSelectedIcon),p=()=>{i.value||o==null||o.handleOptionSelected(t)},w=()=>{o.activeOptionValue=l.value};return a.onBeforeMount(()=>{o==null||o.register(l.value,t),c==null||c.register(l.value,t)}),a.onBeforeUnmount(()=>{o==null||o.unregister(l.value),c==null||c.unregister(l.value)}),Te(U({},a.toRefs(n)),{selected:f,multiple:u,isHover:h,showSelectedIcon:m,handleOptionClick:p,handleMouseEnter:w})},render(){var t,n,i;const e=Se({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"bk-select-option":!0});return a.withDirectives(a.createVNode("li",{class:e,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[(i=(n=(t=this.$slots).default)==null?void 0:n.call(t))!=null?i:a.createVNode("span",{class:"bk-select-option-item",title:this.label},[this.label]),this.multiple&&this.selected&&this.showSelectedIcon&&a.createVNode(xa,{class:"bk-select-selected-icon",width:22,height:22},null)]),[[a.vShow,this.visible]])}}),cp=a.defineComponent({name:"Group",props:{label:g.string.def(""),disabled:g.bool.def(!1),collapsible:g.bool.def(!1),collapse:g.bool.def(!1)},setup(e,{emit:t}){const n=a.getCurrentInstance(),{proxy:i}=n,l=a.inject(Ic,null),o=a.reactive({groupCollapse:e.collapse,visible:!0}),c=a.ref(new Map),{register:f,unregister:u}=Nc(c),h=a.computed(()=>`${e.label} (${[...c.value.values()].filter(p=>p.visible).length})`),m=()=>{!e.collapsible||e.disabled||(o.groupCollapse=!o.groupCollapse,t("update:collapse",o.groupCollapse))};return a.provide(D0,a.reactive(Te(U({},a.toRefs(e)),{register:f,unregister:u,groupCollapse:a.toRef(o,"groupCollapse")}))),a.onBeforeMount(()=>{l==null||l.registerGroup(n.uid,i)}),a.onBeforeUnmount(()=>{l==null||l.unregisterGroup(n.uid)}),Te(U({},a.toRefs(o)),{groupLabel:h,handleToggleCollapse:m})},render(){var i,l;const e=Se({"bk-option-group":!0,collapsible:this.collapsible,disabled:this.disabled}),t=Se({"bk-option-group-label":!0,collapsible:this.collapsible}),n=Se({"default-group-label-icon":!0,collapse:this.groupCollapse});return a.withDirectives(a.createVNode("ul",{class:e},[a.createVNode("li",{class:t,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():a.createVNode("span",{class:"default-group-label"},[this.collapsible&&a.createVNode(ws,{class:n},null),a.createVNode("span",{class:"default-group-label-title"},[this.groupLabel])])]),a.withDirectives(a.createVNode("ul",{class:"bk-option-group-content"},[(l=(i=this.$slots).default)==null?void 0:l.call(i)]),[[a.vShow,!this.groupCollapse]])]),[[a.vShow,this.visible]])}});const up={onContentScroll:Function},dp=U({list:g.array.def([]),enabled:g.bool.def(!0),scrollEvent:g.bool.def(!1),lineHeight:g.oneOfType([g.number,g.func]).def(30),minHeight:g.number.def(30),height:g.oneOfType([g.string.def("100%"),g.number]).def("100%"),width:g.oneOfType([g.string.def("100%"),g.number]).def("100%"),className:g.oneOfType([g.arrayOf(g.string),g.object,g.arrayOf(g.object),g.string]).def(""),contentClassName:g.oneOfType([g.arrayOf(g.string),g.object,g.arrayOf(g.object),g.string]).def(""),contentStyle:g.object.def({}),scrollXName:g.string.def(_e("F-scroll-x")),scrollYName:g.string.def(_e("F-scroll-y")),groupItemCount:g.number.def(1),preloadItemCount:g.number.def(1),renderAs:g.string.def("div"),contentAs:g.string.def("div"),scrollOffsetTop:g.number.def(0),scrollPosition:g.string.def("content"),abosuteHeight:g.oneOfType([g.string.def("auto"),g.number]).def("auto"),throttleDelay:g.number.def(60)},up);var fp=(e,t)=>{const{renderAs:n,contentAs:i}=e,l=(f,u,h,m,p,w,y)=>{t.emit("content-scroll",[f,{translateY:p,translateX:w,pos:y}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:l,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent};return{rendAsTag:()=>{var f,u,h,m,p,w,y,v,L,x,k,C;return a.h(n,{class:e.className},[(h=(u=(f=t.slots).beforeContent)==null?void 0:u.call(f))!=null?h:"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[(w=(p=(m=t.slots).default)==null?void 0:p.call(m,{data:e.list}))!=null?w:""]),[[o,c]]),(L=(v=(y=t.slots).afterContent)==null?void 0:v.call(y))!=null?L:"",(C=(k=(x=t.slots).afterSection)==null?void 0:k.call(x))!=null?C:""])}}};function z0(e,t,n,i){let l=0,o=0,c=0,f=0;for(;l<e;l++){if(f=i(l,[l*n,(l+1)*n,"virtual"]),o+f>t){c=t-o;break}o+=f}return{startIndex:l,height:o,diffHeight:c}}function P0(e,t,n,i,l){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:f,count:u,groupItemCount:h,startIndex:m,endIndex:p}=n,{offsetHeight:w}=i;let y=0,v=0,L=0;if(typeof e=="number"&&(y=Math.floor(o/e),v=Math.ceil(w/e)+y,L=o%e),typeof e=="function"){const x=z0(u,o,h,e);y=x.startIndex>0?x.startIndex:0,L=x.diffHeight,v=z0(u,w,h,e).startIndex+y+1}if(o!==f||y!==m||v!==p){const x=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(l,y,v,o,L,c,{bottom:x>=0?x:0})}}function hp(e,t,n){const{lineHeight:i=30,handleScrollCallback:l,pagination:o={},onlyScroll:c}=n.value;if(c){const w=t.scrollTop,y=t.scrollLeft,v=t.scrollHeight-t.offsetHeight-t.scrollTop;l(e,null,null,w,w,y,{bottom:v>=0?v:0});return}const{startIndex:f,endIndex:u,groupItemCount:h,count:m,scrollTop:p}=o;P0(i,l,{scrollTop:p,startIndex:f,endIndex:u,groupItemCount:h,count:m},t,e)}const O0=(e=60)=>ct.exports.throttle((t,n,i)=>hp(t,n,i),e),gp=(e,t,n,i=60)=>{Reflect.apply(O0(i),globalThis,[e,t,n])};var mp={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",l=>{gp(l,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",O0)}}},pp=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:mp},props:dp,emits:["content-scroll"],setup(e,t){const{renderAs:n,contentAs:i}=e,l=A=>typeof A=="string"?[A]:typeof A=="object"&&!Array.isArray(A)?[A]:A;if(!e.enabled){const{rendAsTag:A}=fp(e,t);return A}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),f=(A,P,J,z,E,ne,_)=>{c.startIndex=P,c.endIndex=J,c.scrollTop=z,c.translateY=E,c.translateX=ne,c.pos=_,t.emit("content-scroll",[A,c])};a.onMounted(()=>{a.nextTick(()=>{p(e.list),w()})}),a.watch(()=>e.list,()=>{u(),w()},{deep:!0}),a.watch(()=>e.lineHeight,()=>{u(),w()});const u=()=>{p(e.list)},h=a.ref(0),m=a.ref(0),p=A=>{if(h.value=Math.ceil((A||[]).length/e.groupItemCount),c.count=h.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"){m.value=0;let J=0;for(let z=0;z<h.value;z++){const E=e.lineHeight.call(this,z,A.slice(z*e.groupItemCount,e.groupItemCount));J+=typeof E=="number"?E:0}m.value=J}else m.value=e.lineHeight*h.value;else m.value=e.abosuteHeight},w=(A=!0)=>{var J;const P=(J=o.value)==null?void 0:J.parentNode;P0(e.lineHeight,f,c,P,null),A&&o.value&&o.value.scrollTo(0,0)},y=a.computed(()=>(e.list||[]).map((A,P)=>Te(U({},A),{$index:P}))),v=a.computed(()=>y.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),L=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),x=a.computed(()=>U({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"?L.value:{})),k=a.computed(()=>{const A=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${m.value<e.minHeight?e.minHeight:m.value}px`,display:A?"none":"block"}}),C=a.computed(()=>[_e("virtual-render"),e.scrollXName,e.scrollYName,...l(e.className),e.scrollPosition==="container"?_e("virtual-content"):""]),b=a.computed(()=>[e.scrollPosition==="content"?_e("virtual-content"):"",...l(e.contentClassName)]),I=a.resolveDirective("bkVirtualRender"),N={lineHeight:e.lineHeight,handleScrollCallback:f,pagination:c,throttleDelay:e.throttleDelay},T=()=>{u(),w()};return t.expose({reset:T}),()=>{var A,P,J,z,E,ne,_,ce,re,ae,ue,ie;return a.h(n||"div",{ref:o,class:C.value,style:x.value},[(J=(P=(A=t.slots).beforeContent)==null?void 0:P.call(A))!=null?J:"",a.withDirectives(a.h(i||"div",{class:b.value,style:U(U({},L.value),e.contentStyle)},[(ne=(E=(z=t.slots).default)==null?void 0:E.call(z,{data:v.value}))!=null?ne:""]),[[I,N]]),(re=(ce=(_=t.slots).afterContent)==null?void 0:ce.call(_))!=null?re:"",a.h("div",{class:[_e("virtual-section")],style:k.value}),(ie=(ue=(ae=t.slots).afterSection)==null?void 0:ue.call(ae))!=null?ie:""])}}});const xr=He(pp);var bp=a.defineComponent({name:"Tag",props:{theme:g.theme(["success","info","warning","danger"]).def(""),closable:g.bool.def(!1),type:g.commonType(["","filled","stroke"]).def(""),checkable:g.bool.def(!1),checked:g.bool.def(!1),radius:g.string.def("2px"),extCls:g.string.def("")},emits:["change","close"],slots:["icon"],setup(e,{emit:t}){const n=a.computed(()=>Se({"bk-tag-closable":e.closable,"bk-tag-checkable":e.checkable,"bk-tag-check":e.checked,[`bk-tag-${e.type}`]:e.type,[`bk-tag-${e.theme}`]:e.theme,[e.extCls]:!!e.extCls},"bk-tag")),i=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:n,wrapperStyle:i,handleClose:c=>{c.preventDefault(),c.stopPropagation(),t("close",c)},handleClick:c=>{c.preventDefault(),c.stopPropagation(),e.checkable&&t("change",!e.checked)}}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:"bk-tag-icon"},[this.$slots.icon()]):"",a.createVNode("span",{class:"bk-tag-text"},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(An,{class:"bk-tag-close",onClick:this.handleClose},null):""])}});const Fs=He(bp);var yp=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:g.theme(["success","info","warning","danger"]).def(""),placeholder:g.string.def(""),filterable:g.bool.def(!1),allowCreate:g.bool.def(!1),disabled:g.bool.def(!1),modelValue:g.any,collapseTags:g.bool.def(!1)},emits:["update:modelValue","remove","enter"],setup(e,{emit:t}){const{proxy:n}=a.getCurrentInstance(),{modelValue:i,collapseTags:l,selected:o}=a.toRefs(e),c=a.ref(i.value),f=a.ref(),u=a.ref(null);a.watch(i,()=>{c.value=i.value}),a.watch([o,l],()=>{v()},{flush:"post"});const h=L=>{t("remove",L)},m=()=>{var L;(L=f.value)==null||L.focus()},p=L=>{t("update:modelValue",L.target.value)},w=L=>{switch(L.code){case"Enter":{t("enter",L.target.value,L);break}}},y=L=>{const x=[...n.$el.querySelectorAll(".bk-tag")];return typeof L=="number"?x[L]:x},v=()=>{!l.value||(u.value=null,setTimeout(()=>{const L=y(),x=L.findIndex((k,C)=>C?L[C-1].offsetTop!==k.offsetTop:!1);x-1>-1?u.value=x-1:u.value=null}))};return{overflowTagIndex:u,value:c,inputRef:f,handleRemoveTag:h,focus:m,handleInput:p,handleKeydown:w}},render(){var i,l,o,c,f,u,h;const e=Se({"bk-select-tag":!0,"bk-select-tag--default":!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags}),t=Se({"bk-select-tag-wrapper":!0}),n={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:e},[(l=(i=this.$slots)==null?void 0:i.prefix)==null?void 0:l.call(i),a.createVNode("span",{class:t},[(f=(c=(o=this.$slots).default)==null?void 0:c.call(o))!=null?f:this.selected.map((m,p)=>a.createVNode(Fs,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&p>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(m.value)},{default:()=>[m.label]})),this.overflowTagIndex&&this.collapseTags&&a.createVNode(Fs,{class:"bk-select-overflow-tag"},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]})]),a.createVNode("input",{class:"bk-select-tag-input",ref:"inputRef",type:"text",style:n,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null),(h=(u=this.$slots)==null?void 0:u.suffix)==null?void 0:h.call(u)])}}),Cp=a.defineComponent({name:"Select",directives:{clickoutside:Xn},props:{modelValue:g.any,multiple:g.bool.def(!1),disabled:g.bool.def(!1),size:g.size().def("default"),clearable:g.bool.def(!0),loading:g.bool.def(!1),filterable:g.bool.def(!1),remoteMethod:g.func,scrollHeight:g.number.def(200),showSelectAll:g.bool.def(!1),popoverMinWidth:g.number.def(0),showOnInit:g.bool.def(!1),multipleMode:g.oneOf(["default","tag"]).def("default"),tagTheme:g.theme(["success","info","warning","danger"]).def(""),behavior:g.oneOf(["normal","simplicity"]).def("normal"),collapseTags:g.bool.def(!1),autoHeight:g.bool.def(!0),noDataText:g.string.def("\u65E0\u6570\u636E"),noMatchText:g.string.def("\u65E0\u5339\u914D\u6570\u636E"),loadingText:g.string.def("\u52A0\u8F7D\u4E2D..."),placeholder:g.string.def("\u8BF7\u9009\u62E9"),searchPlaceholder:g.string.def("\u8BF7\u8F93\u5165\u5173\u952E\u5B57"),selectAllText:g.string.def("\u5168\u90E8"),scrollLoading:g.bool.def(!1),allowCreate:g.bool.def(!1),popoverOptions:g.object.def({}),customContent:g.bool.def(!1),list:g.array.def([]),idKey:g.string.def("value"),displayKey:g.string.def("label"),withValidate:g.bool.def(!0),showSelectedIcon:g.bool.def(!0),inputSearch:g.bool.def(!0),enableVirtualRender:g.bool.def(!1),allowEmptyValues:g.array.def([])},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const{modelValue:n,disabled:i,filterable:l,multiple:o,remoteMethod:c,loading:f,loadingText:u,noDataText:h,noMatchText:m,popoverMinWidth:p,showOnInit:w,multipleMode:y,allowCreate:v,customContent:L,showSelectedIcon:x,inputSearch:k,enableVirtualRender:C,showSelectAll:b,scrollHeight:I,list:N,displayKey:T,collapseTags:A,autoHeight:P,popoverOptions:J,allowEmptyValues:z}=a.toRefs(e),E=En(),ne=a.ref(),_=a.ref(),ce=a.ref(),re=a.ref(),ae=a.ref(),ue=a.ref(),ie=a.ref(),Y=a.ref(new Map),W=a.computed(()=>[...Y.value.values()]),Q=a.ref(new Map),F=a.ref([]),K=a.computed(()=>F.value.reduce((Ie,De)=>(Ie[De.value]=De.label,Ie),{})),fe=a.ref();a.watch(n,()=>{var Ie;bl(),e.withValidate&&((Ie=E==null?void 0:E.validate)==null||Ie.call(E,"change"))},{deep:!0}),a.watch(F,()=>{var Ie;(Ie=ie.value)==null||Ie.updatePopover(null,te.value)});const he=a.computed(()=>Me.value?N.value:N.value.filter(Ie=>{var De;return(De=Tr(String(Ie[T.value])))==null?void 0:De.includes(ci.value)})),Ce=a.computed(()=>i.value||f.value),Ae=a.computed(()=>F.value.map(Ie=>{var De,Oe;return((Oe=(De=Y.value)==null?void 0:De.get(Ie.value))==null?void 0:Oe.label)||Ie.label})),oe=a.computed(()=>{const Ie=W.value.reduce((De,Oe)=>(Oe.disabled||De.push(Oe.value),De),[]);return Ie.length<=F.value.length&&Ie.every(De=>F.value.some(Oe=>Oe.value===De))}),X=a.computed(()=>!!Q.value.size),Z=a.computed(()=>!W.value.length),se=a.computed(()=>W.value.length&&W.value.every(Ie=>!Ie.visible)),Me=a.computed(()=>l.value&&typeof c.value=="function"),j=a.computed(()=>!(Fr.value||Z.value||se.value)||L.value),B=a.computed(()=>o.value&&b.value&&(!ci.value||!l.value)),V=a.computed(()=>I.value-12-(B.value?32:0)),H=a.computed(()=>Fr.value?u.value:Z.value?h.value:se.value?m.value:""),$=a.computed(()=>P.value?A.value&&!Ue.value:A.value),te=a.computed(()=>ct.exports.merge({theme:"light bk-select-popover",trigger:"manual",width:Ke.value,arrow:!1,placement:"bottom-start",isShow:Ue.value,reference:ae.value,offset:6},J.value)),{register:ye,unregister:we}=Nc(Y),{register:Ne,unregister:Qe}=Nc(Q),{isHover:ut,setHover:Fe,cancelHover:at}=j0(),St=a.ref(!1),Dt=()=>{St.value||(St.value=!0,t("focus"))},qe=()=>{!St.value||(St.value=!1,t("blur"))},{popperWidth:Ke,isPopoverShow:Ue,hidePopover:kn,showPopover:Ja,togglePopover:Br}=lp({popoverMinWidth:p.value},_),_r=a.computed(()=>(l.value&&k.value||v.value)&&Ue.value);a.watch(Ue,Ie=>{Ie?(Ur(),Qa()):ci.value=""});const Zr=a.watch(Ue,()=>{setTimeout(()=>{var Ie,De;C.value&&((De=(Ie=ue.value)==null?void 0:Ie.reset)==null||De.call(Ie)),Zr()})}),Qa=()=>{var Oe;const Ie=F.value[0],De=Y.value.get(Ie==null?void 0:Ie.value);De&&!De.disabled&&De.visible?fe.value=Ie==null?void 0:Ie.value:fe.value=(Oe=W.value.find(Gn=>!Gn.disabled&&Gn.visible))==null?void 0:Oe.value},Gr=Ie=>{!l.value||W.value.forEach(De=>{var Oe;De.visible=(Oe=Tr(String(De.label)))==null?void 0:Oe.includes(Tr(Ie))})},{searchKey:ci,searchLoading:Fr}=op(Me.value?c.value:Gr,Qa),Zn=Ie=>{Ie!==n.value&&(t("change",Ie,n.value),t("update:modelValue",Ie,n.value))},gl=()=>{Ce.value||(Dt(),Br(),t("toggle",Ue.value))},ml=Ie=>{!l.value||(ci.value=Ie)},fu=(Ie,De)=>{const Oe=String(Ie);!v.value||!Oe||l.value&&W.value.find(Pi=>Tr(String(Pi.label))===Tr(Oe))||Y.value.get(Oe)||(De.stopPropagation(),o.value?(F.value.push({value:Oe,label:Oe}),Zn(F.value.map(Pi=>Pi.value))):(F.value=[{value:Oe,label:Oe}],Zn(Oe),kn()),ci.value="")},Yr=Ie=>{if(!(Ce.value||!Ie)){if(o.value){const De=F.value.findIndex(Oe=>Oe.value===Ie.value);De>-1?F.value.splice(De,1):F.value.push({value:Ie.value,label:Ie.label||Ie.value}),Zn(F.value.map(Oe=>Oe.value))}else F.value=[{label:Ie.label||Ie.value,value:Ie.value}],Zn(Ie.value),kn();Ur()}},Ur=()=>{setTimeout(()=>{var Ie,De,Oe;!k.value&&!v.value?(Ie=re.value)==null||Ie.focus():y.value==="tag"?(De=ae.value)==null||De.focus():(Oe=ne.value)==null||Oe.focus()},0)},hu=Ie=>{Ie.stopPropagation(),F.value=[],Zn(o.value?[]:""),t("clear",o.value?[]:""),kn()},pl=()=>{fe.value=""},gu=()=>{oe.value?F.value=[]:W.value.forEach(Ie=>{Ie.disabled||F.value.find(De=>De.value===Ie.value)||F.value.push({value:Ie.value,label:Ie.label||Ie.value})}),Zn(F.value.map(Ie=>Ie.value)),Ur()},mu=Ie=>{const{scrollTop:De,clientHeight:Oe,scrollHeight:Gn}=Ie.target;De+Oe===Gn&&t("scroll-end")},pu=Ie=>{if(Ce.value)return;const De=F.value.findIndex(Oe=>Oe.value===Ie);De>-1&&(F.value.splice(De,1),Zn(F.value.map(Oe=>Oe.value)))},Ra=Ie=>{var De,Oe;return((Oe=(De=Y.value)==null?void 0:De.get(Ie))==null?void 0:Oe.label)||K.value[Ie]||Ie},bl=()=>{Array.isArray(n.value)?F.value=[...n.value.map(Ie=>({value:Ie,label:Ra(Ie)}))]:!!n.value||z.value.includes(n.value)?F.value=[{value:n.value,label:Ra(n.value)}]:F.value=[]},sa=Ie=>{var Gn,Pi,yl,Cl;if(!((Gn=_.value)!=null&&Gn.contains(Ie.target))&&!((Pi=ce.value)!=null&&Pi.contains(Ie.target))&&!L.value)return;const De=W.value.filter(Vt=>!Vt.disabled&&Vt.visible),Oe=De.findIndex(Vt=>Vt.value===fe.value);if(!(!De.length||Oe===-1))switch(Ie.code){case"ArrowDown":{Ie.preventDefault();const Vt=Oe>=De.length-1?0:Oe+1;fe.value=(yl=De[Vt])==null?void 0:yl.value;break}case"ArrowUp":{Ie.preventDefault();const Vt=Oe===0?De.length-1:Oe-1;fe.value=(Cl=De[Vt])==null?void 0:Cl.value;break}case"Backspace":{if(!o.value||!F.value.length||ci.value.length||Ie.target===re.value)return;F.value.pop(),Zn(F.value.map(Vt=>Vt.value));break}case"Enter":{if(!Ue.value)Ue.value=!0;else{const Vt=Y.value.get(fe.value);Yr(Vt)}break}}},bu=({event:Ie})=>{var Oe;const{target:De}=Ie;((Oe=_.value)==null?void 0:Oe.contains(De))||_.value===De||(kn(),qe())};return a.provide(Ic,a.reactive({multiple:o,selected:F,activeOptionValue:fe,showSelectedIcon:x,register:ye,unregister:we,registerGroup:Ne,unregisterGroup:Qe,handleOptionSelected:Yr})),a.onMounted(()=>{bl(),setTimeout(()=>{w.value&&Ja()}),l4(document,"keydown",sa)}),a.onBeforeMount(()=>{o4(document,"keydown",sa)}),{selected:F,isInput:_r,options:W,isDisabled:Ce,selectedLabel:Ae,isPopoverShow:Ue,isHover:ut,popperWidth:Ke,inputRef:ne,triggerRef:_,contentRef:ce,searchRef:re,selectTagInputRef:ae,virtualRenderRef:ue,popoverRef:ie,searchLoading:Fr,isOptionsEmpty:Z,isSearchEmpty:se,isFocus:St,isShowSelectContent:j,curContentText:H,isGroup:X,searchKey:ci,isShowSelectAll:B,virtualHeight:V,filterList:he,isCollapseTags:$,popoverConfig:te,setHover:Fe,cancelHover:at,handleFocus:Dt,handleBlur:qe,handleTogglePopover:gl,handleClear:hu,hidePopover:kn,showPopover:Ja,handleToggleAll:gu,handleOptionSelected:Yr,handleClickOutside:bu,handleScroll:mu,handleDeleteTag:pu,handleInputChange:ml,handleInputEnter:fu,handleKeydown:sa,handleSelectedAllOptionMouseEnter:pl}},render(){const e=Se({"bk-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(wi,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(cn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ta,{class:"angle-up"},null),n=()=>this.multipleMode==="tag"?a.createVNode(yp,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":o=>this.searchKey=o,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.placeholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter},{prefix:()=>{var o,c;return(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(Ui,{ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.placeholder:this.placeholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,onInput:this.handleInputChange,onEnter:this.handleInputEnter},{prefix:()=>{var o,c;return(c=(o=this.$slots).prefix)==null?void 0:c.call(o)},suffix:()=>t()}),i=()=>a.createVNode("div",{class:"bk-select-trigger",style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[n()]),l=()=>{var o,c;return a.createVNode("div",{class:"bk-select-content-wrapper",ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:"bk-select-search-wrapper"},[a.createVNode(Ds,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:"bk-select-search-input",placeholder:this.searchPlaceholder,"onUpdate:modelValue":f=>this.searchKey=f},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:"bk-select-empty"},[this.searchLoading&&a.createVNode(wi,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:"bk-select-content"},[a.createVNode("div",{class:"bk-select-dropdown",style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:"bk-select-options"},[this.isShowSelectAll&&a.createVNode("li",{class:"bk-select-option",onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.selectAllText]),this.enableVirtualRender?a.createVNode(xr,{list:this.filterList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:f})=>f.map(u=>a.createVNode(Gs,{key:u[this.idKey],value:u[this.idKey],label:u[this.displayKey]},null))}):this.list.map(f=>a.createVNode(Gs,{value:f[this.idKey],label:f[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:"bk-select-options-loading"},[a.createVNode(wi,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.loadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:"bk-select-extension"},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(ni,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,ref:"popoverRef"}),{default:()=>i(),content:()=>l()})])}});const Lc=Bt(Cp,{Option:Gs,Group:cp});function Mp(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:wp}=$i,kc=Object.assign({},wp);kc.width.default="400",kc.height.default="100%";var vp=a.defineComponent({name:"Sideslider",components:{BkModal:$i,BkButton:_t},props:Te(U({},kc),{direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',\u3010${t.join(" | ")}\u3011`),!1):!0}}}),emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{let c=!0;typeof e.beforeClose=="function"&&(c=await e.beforeClose()),c&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},l=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)};return()=>{const c={header:()=>{var h,m;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"bk-sideslider-header"},[a.createVNode("div",{class:`bk-sideslider-close ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`bk-sideslider-title ${e.direction}`},[(m=(h=t.header)==null?void 0:h.call(t))!=null?m:e.title])])])},default:()=>{var h,m;return(m=(h=t.default)==null?void 0:h.call(t))!=null?m:"Content"},footer:()=>t.footer?a.createVNode("div",{class:"bk-sideslider-footer"},[t.footer()]):null},f=`bk-sideslider-wrapper ${e.scrollable?"scroll-able":""} ${e.extCls}`,u=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode($i,a.mergeProps(e,{maxHeight:u,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:l,onClose:i}),Mp(c)?c:{default:()=>[c]})}}});const E0=He(vp),A0={theme:g.theme().def("primary"),size:g.size(),curStep:g.number.def(1),controllable:g.bool.def(!1),direction:g.commonType(["horizontal","vertical"],"direction").def("horizontal"),status:g.commonType(["","error","loading"],"status").def(""),lineType:g.commonType(["dashed","solid"],"lineType").def("dashed"),text:g.bool,extCls:g.string,steps:g.array.def([]),beforeChange:g.func};var Ip=a.defineComponent({name:"Steps",props:A0,emits:["update:curStep","click"],setup(e,{emit:t}){const n=a.ref([]),i=f=>{const u=[];f.forEach(h=>{var m;typeof h=="string"?u.push(h):u.push({title:h.title,icon:h.icon,description:h.description,status:h.status,border:(m=h.border)!=null?m:!0})}),n.value.splice(0,n.value.length,...u)},l=f=>{A0.curStep=f},o=()=>{var f;n.value.splice(0,n.value.length,{title:"\u6B65\u9AA41",icon:1},{title:"\u6B65\u9AA42",icon:2},{title:"\u6B65\u9AA43",icon:3}),(f=e.steps)!=null&&f.length&&i(e.steps)},c=async f=>{try{e.controllable&&f!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(u,h)=>{const m=await e.beforeChange(f);m?u(m):h(m)}),t("update:curStep",f),t("click",f))}catch(u){console.warn(u)}};return a.onMounted(o),a.watch(()=>e.steps,()=>{i(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{l(e.curStep)},{deep:!0}),{defaultSteps:n,jumpTo:c}},render(){const e="bk-steps",t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Se({[`${this.extCls}`]:!!this.extCls,[`bk-steps-${this.direction}`]:this.direction,[`bk-steps-${this.lineType}`]:this.lineType},`${t} ${e} ${n}`),l=p=>this.curStep>p+1||this.defaultSteps[p].status==="done",o=p=>this.curStep===p+1,c=p=>{const{icon:w}=p;return w?Object.prototype.toString.call(w)==="[object Object]":typeof p=="string"},f=(p,w)=>(w.icon||(w.icon=p),!isNaN(w.icon)),u=p=>p.status==="loading",h=p=>p.status==="error",m=(p,w)=>o(p)&&this.status==="loading"||u(w)?a.createVNode(vs,{class:"bk-icon bk-steps-icon icon-loading"},null):o(p)&&this.status==="error"||h(w)?a.createVNode(An,{class:"bk-steps-icon"},null):l(p)?a.createVNode(xa,{class:"bk-steps-icon"},null):a.createVNode("span",null,[f(p,w)?p+1:a.createVNode(w.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((p,w)=>{var y,v,L;return a.createVNode("div",{class:["bk-step",p.title?"":"bk-step-no-content",l(w)?"done":"",o(w)?"current":"",o(w)&&this.status==="error"?"isError":"",p.status&&o(w)?[`bk-step-${p.status}`]:""]},[a.createVNode("span",{class:["bk-step-indicator",`bk-step-${c(p)?"icon":"number"}`,`bk-step-icon${p.status}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(w+1)}},[(L=(v=(y=this.$slots)[w+1])==null?void 0:v.call(y))!=null?L:m(w,p)]),p.title?a.createVNode("div",{class:"bk-step-content"},[a.createVNode("div",{class:"bk-step-title",style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(w+1)}},[p.title]),p.description&&a.createVNode("div",{class:"bk-step-description",title:p.description},[p.description])]):""])})])}});const V0=He(Ip);var Np=a.defineComponent({name:"Switcher",props:{theme:g.theme().def(""),size:g.size(),disabled:g.bool,showText:g.bool,isOutline:g.bool,onText:g.string.def("ON"),offText:g.string.def("OFF"),isSquare:g.bool,extCls:g.string,beforeChange:g.func.def(void 0),trueValue:g.oneOfType([g.string,g.number,g.bool]).def(!0),falseValue:g.oneOfType([g.string,g.number,g.bool]).def(!1),value:g.oneOfType([g.string,g.number,g.bool]).def(!1),modelValue:g.oneOfType([g.string,g.number,g.bool]).def(!1),withValidate:g.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=En(),i=a.ref(!1),l=a.computed(()=>e.trueValue===c.value),o=a.ref(e.modelValue!==!1),c=a.computed(()=>o.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,"bk-switcher":!0,"bk-switcher-outline":e.isOutline,"bk-switcher-square":e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":l.value,"is-unchecked":!l.value,"is-loading":i.value,"bk-primary":e.theme==="primary"};if(e.size&&!e.showText){const p=`bk-switcher-${e.size}`;m[p]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;o.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{o.value=!1});const u=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||i.value)return;const p=l.value?e.falseValue:e.trueValue,w=!l.value,y=()=>{t("update:modelValue",p),t("change",w)};let v=!0;if(typeof e.beforeChange=="function"&&(v=e.beforeChange(p),typeof v.then=="function"))return i.value=!0,v.then(()=>{y()}).finally(()=>{i.value=!1});v&&y()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&u(m)};return()=>a.createVNode("div",{class:f.value,onClick:u,tabindex:"0",onKeydown:h},[i.value?a.createVNode(Go,{class:"bk-switcher-loading"},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[l.value?e.onText:e.offText]):""])}});const J0=He(Np);var Ys=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e))(Ys||{});const Q0=["none","row","col","outer"];var In=(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))(In||{}),Pt=(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.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))(Pt||{});const Gt=(...e)=>!0,Lp={columnPick:Gt,columnFilter:Gt,columnSort:Gt,colFilterSave:Gt,rowClick:Gt,rowDblclick:Gt,rowExpand:Gt,select:Gt,selectAll:Gt,selectionChange:Gt,pageLimitChange:Gt,pageValueChange:Gt,settingChange:Gt,scrollBottom:Gt},Xe={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"},Tc=4,ii=42,Us={large:78,medium:60,small:42},kp=[{value:"small",label:"\u5C0F",height:Us.small},{value:"medium",label:"\u4E2D",height:Us.medium},{value:"large",label:"\u5927",height:Us.large}],R0="InitColumns";var $s=(e=>(e.CURRENT="current",e.ALL="all",e))($s||{});const W0={label:g.oneOfType([g.func.def(()=>""),g.string.def("")]),field:g.oneOfType([g.func.def(()=>""),g.string.def("")]),render:g.oneOfType([g.func.def(()=>""),g.string.def("")]),width:g.oneOfType([g.number.def(void 0),g.string.def("auto")]),minWidth:g.oneOfType([g.number.def(void 0),g.string.def("auto")]).def(),columnKey:g.string.def(""),showOverflowTooltip:g.oneOfType([g.bool,g.shape({content:g.string.def(""),disabled:g.bool.def(!1),watchCellResize:g.bool.def(!0)})]).def(void 0),type:g.commonType(["selection","index","expand","none"],"columnType").def("none"),resizable:g.bool.def(!0),fixed:g.oneOfType([g.bool,g.commonType(["left","right"],"fixed")]).def(!1),sort:g.oneOfType([g.shape({sortFn:g.func.def(void 0),sortScope:g.commonType(Object.values($s)).def("current"),value:g.string.def(null)}),g.bool,g.string]).def(!1),filter:g.oneOfType([g.shape({list:g.arrayOf(g.any).def([]),filterFn:g.func.def(void 0),match:g.commonType(["full","fuzzy"],"full"),filterScope:g.commonType(Object.values($s)).def("current"),btnSave:g.oneOfType([g.bool,g.string]).def("\u786E\u5B9A"),btnReset:g.oneOfType([g.bool,g.string]).def("\u91CD\u7F6E")}),g.bool,g.string]).def(!1)},Tp={data:g.arrayOf(g.any).def([]),columns:g.arrayOf(g.shape(W0)).def([]),activeColumn:g.oneOfType([g.number.def(-1),g.arrayOf(g.number.def(-1))]),columnPick:g.commonType(["multi","single","disabled"],"columnPick").def("disabled"),height:g.oneOfType([g.number,g.string]).def("auto"),minHeight:g.oneOfType([g.number,g.string]).def(ii*2),maxHeight:g.oneOfType([g.number,g.string]).def("auto"),rowHeight:g.oneOfType([g.number,g.func]).def(ii),headHeight:g.number.def(ii),showHead:g.bool.def(!0),thead:g.shape({height:g.number.def(ii),isShow:g.bool.def(!0),cellFn:g.func.def(void 0)}),virtualEnabled:g.bool.def(!1),border:g.arrayOf(g.commonType(Q0,"border")).def([Ys.ROW]),pagination:g.oneOfType([g.bool.def(!1),g.object.def({})]).def(!1),remotePagination:g.bool.def(!1),emptyText:g.string.def("\u6682\u65E0\u6570\u636E"),settings:g.oneOfType([g.shape({fields:g.arrayOf(g.shape({label:g.string,field:g.string,disabled:g.bool})),checked:g.arrayOf(g.string),limit:g.number.def(0),size:g.size(["small","medium","large"]).def("small"),sizeList:g.shape([])}),g.bool]).def(!1),rowClass:g.oneOfType([g.string,g.object,g.func]).def({}),rowStyle:g.oneOfType([g.string,g.object,g.func]).def({}),cellStyle:g.oneOfType([g.string,g.object,g.func]).def({}),cellClass:g.oneOfType([g.string,g.object,g.func]).def({}),scrollLoading:g.oneOfType([g.object,g.bool]).def(void 0),reserveExpand:g.bool.def(!1),selectionKey:g.string.def(""),isSelectedFn:g.func.def(void 0),rowKey:g.oneOfType([g.string,g.func]).def(Xe.ROW_INDEX),showOverflowTooltip:g.oneOfType([g.bool,g.shape({content:g.string.def(""),disabled:g.bool.def(!1),watchCellResize:g.bool.def(!0)})]).def(!1),asyncData:g.bool.def(!1)};var H0=a.defineComponent({name:"TableColumn",props:Te(U({},W0),{prop:g.oneOfType([g.func.def(()=>""),g.string.def("")])}),setup(e,{slots:t}){const n=a.inject(R0,i=>{},!1);return a.onMounted(()=>{const i=a.reactive(Te(U({},e),{field:e.prop||e.field}));n(i),i.render=t.default?l=>{var o;return(o=t.default)==null?void 0:o.call(t,l)}:void 0}),()=>{var i;return a.createVNode(a.Fragment,null,[(i=t.default)==null?void 0:i.call(t,{data:""})])}}});const B0=(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),Te(U(U({},t),e),{current:n})}return t}return{}};var xp=(e,t)=>{const n=a.ref(0),i=a.ref(0);let l=a.reactive({count:0,limit:10,current:1});l=B0(e.pagination,l);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=e.data.length;return}n.value=(l.current-1)*l.limit,i.value=l.current*l.limit},f=a.reactive([]),u=(y,v)=>{typeof v=="function"&&y.sort(v)},h=(y,v)=>{if(typeof v=="function"){const L=y.filter((x,k)=>v(x,k,e.data));y.splice(0,y.length,...L)}},m=(y,v,L)=>{var C;const x=t.slice(),{sortScope:k}=(C=L==null?void 0:L.sort)!=null?C:{};k===$s.ALL&&u(x,v),f.splice(0,f.length,...x.slice(n.value,i.value)),h(f,y),u(f,v)},p=(y,v,L)=>{l=B0(e.pagination,l),w(),c(),m(y,v,L)},w=()=>{!e.pagination||(o.value=e.remotePagination?l:Te(U({},l),{count:e.data.length}))};return{pageData:f,localPagination:o,resolvePageData:m,watchEffectFn:p}},Sp=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:Vn.Normal,mode:Yi.Default,indicator:null}:n.value,l=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,f,u;if(l.value){const{loading:h,size:m,mode:p,title:w,inline:y,indicator:v}=i();return(u=(f=(c=t.slots).fixedBottom)==null?void 0:f.call(c))!=null?u:a.createVNode(wi,{loading:h,size:m,mode:p,title:w,inline:y,indicator:v},null)}}}};function Dp(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var jp=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(e.limit);a.watch(()=>e.limit,l=>{t.value=l}),a.watch(()=>e.limitList,l=>{a.nextTick(()=>{l.includes(t.value)||([t.value]=l)})},{immediate:!0});const n=l=>{t.value=l};return{limit:t,render:({isFirst:l,isLast:o})=>{let c;return e.showLimit?a.createVNode("div",a.mergeProps({class:{"bk-pagination-limit":!0,"is-first":l,"is-last":o}},{disabled:e.disabled}),[a.createVNode("div",null,[a.createTextVNode("\u6BCF\u9875")]),a.createVNode(Lc,{class:"bk-pagination-limit-select",clearable:!1,size:"small",modelValue:t.value,onChange:n,disabled:e.disabled},Dp(c=e.limitList.map((f,u)=>a.createVNode(Gs,{value:f,label:`${f}`,key:`${u}_${f}`},null)))?c:{default:()=>[c]}),a.createVNode("div",null,[a.createTextVNode("\u6761")])]):null}}};const qi=5;var zp=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),l=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{l.value=!1,o.value=!1;const y=[];if(e.totalPageNum<=qi+2){for(let x=2;x<=e.totalPageNum-1;x++)y.push(x);return y}const v=Math.floor(qi/2);e.totalPageNum>qi&&(l.value=t.value-v>2,o.value=t.value+v<e.totalPageNum-1);const L=Math.min(e.totalPageNum-qi,Math.max(2,t.value-v));for(let x=L;x<L+qi;x++)y.push(x);return y});a.watch(()=>e.modelValue,y=>{a.nextTick(()=>{y>=1&&y<=e.totalPageNum?t.value=y:y<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,y=>{t.value>y&&(t.value=y)})});const f=()=>{n.value||(t.value=t.value-1)},u=()=>{i.value||(t.value=t.value+1)},h=y=>{y!==t.value&&(t.value=y)},m=()=>{t.value=Math.max(1,t.value-qi)},p=()=>{t.value=Math.min(e.totalPageNum,t.value+qi)};return{current:t,render:({isFirst:y,isLast:v})=>a.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":y,"is-last":v}},[a.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":n.value},onClick:f},[e.prevText||a.createVNode(Mi,null,null)]),a.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===1},key:"1",onClick:()=>h(1)},[a.createTextVNode("1")]),l.value&&a.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:m},[a.createVNode(ks,null,null)]),c.value.map(L=>a.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===L},key:L,onClick:()=>h(L)},[L])),o.value&&a.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:p},[a.createVNode(ks,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>h(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":i.value},onClick:u},[e.nextText||a.createVNode(vn,null,null)])])}},Pp=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),l=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const f=a.computed(()=>{const x=[];for(let k=1;k<=e.totalPageNum;k++)x.push(k);return x});a.watch(()=>e.modelValue,x=>{a.nextTick(()=>{x>=1&&x<=e.totalPageNum?i.value=x:x<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,x=>{i.value>x&&(i.value=x)})});const u=()=>{l.value||(i.value=i.value-1)},h=()=>{o.value||(i.value=i.value+1)},m=()=>{n.value=!0},p=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},w=x=>{const k=x.target,C=Number(k.textContent);!C||C<1||C>e.totalPageNum||C===i.value||(c=C)},y=x=>{["Enter","NumpadEnter"].includes(x.code)&&(x.preventDefault(),p())},v=x=>{c=x,p()};return{current:i,render:()=>a.createVNode("div",{class:"bk-pagination-small-list"},[a.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":l.value},onClick:u},[a.createVNode(Mi,null,null)]),a.createVNode(ni,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:m,onBlur:p,onInput:w,onKeydown:y},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:"bk-pagination-picker-list"},[f.value.map(x=>a.createVNode("div",{class:{item:!0,"is-actived":x===i.value},key:x,onClick:()=>v(x)},[x]))])}),a.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":o.value},onClick:h},[a.createVNode(vn,null,null)])])}},Op=()=>({isFirst:e,isLast:t})=>{const{props:n}=a.getCurrentInstance();return n.showTotalCount?a.createVNode("div",a.mergeProps({class:{"bk-pagination-total":!0,"is-first":e,"is-last":t}},{disabled:n.disabled}),[a.createTextVNode("\u5171\u8BA1"),a.createVNode("div",{class:"bk-pagination-total-num"},[n.count]),a.createTextVNode("\u6761")]):null};const Ep={modelValue:g.number.def(1),count:g.number.def(0).isRequired,limit:g.number.def(10),limitList:g.arrayOf(Number).def([10,20,50,100]),showLimit:g.bool.def(!0),type:g.oneOf(["default","compact"]).def("default"),location:g.oneOf(["left","right"]).def("right"),align:g.oneOf(["left","center","right"]).def("left"),size:g.size(),small:g.bool.def(!1),showTotalCount:g.bool.def(!0),prevText:g.string,nextText:g.string,disabled:g.bool.def(!1),beforeChange:g.func,layout:g.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout \u7684\u503C\u53EA\u652F\u6301 * total\u3001list\u3001limit *").def(["total","list","limit"])};var Ap=a.defineComponent({name:"Pagination",props:Ep,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=a.ref(0),{count:i,limit:l}=a.toRefs(e),o=Op(),{current:c,render:f}=zp(),{current:u,render:h}=Pp(),{limit:m,render:p}=jp();return a.watch([i,m,l],([w,y])=>{const v=Math.ceil(w/y);n.value=v<1?1:v},{immediate:!0}),a.watch(c,w=>{t.emit("update:modelValue",w),t.emit("change",w)}),a.watch(u,w=>{!e.small||(t.emit("update:modelValue",w),t.emit("change",w))}),a.watch(m,w=>{t.emit("limitChange",w)}),{totalPageNum:n,renderTotal:o,renderList:f,renderLimit:p,renderSmallList:h}},render(){const e=Se({"bk-pagination":!0,[`bk-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}))])}});const xc=He(Ap),It=(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=>It(e,i,n)).filter(i=>i!==void 0).at(0)},Sc=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],Vp=e=>_0(e,"auto"),_0=(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},Jp=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>Q0.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Sr=(e,t=["resizeWidth","calcWidth","width"])=>{var n,i;return(i=(n=e[t[0]])!=null?n:e[t[1]])!=null?i:e[t[2]]},Dc=(e,t,n=20,i=0)=>{const{width:l}=e.getBoundingClientRect()||{},o=l-i;let c=o;const f=[],u=(m,p)=>{const{minWidth:w=void 0}=m;if(w===void 0)return p;let y=p;return/^\d+\.?\d*$/.test(`${w}`)&&(y=Number(w)),/^\d+\.?\d*%$/.test(`${w}`)&&(y=Number(w)*o/100),/^\d+\.?\d*px$/i.test(`${w}`)&&(y=Number(`${w}`.replace(/px/i,""))),y},h=(m,p,w=!0)=>{const y=u(m,p),v=p<y?y:p;Object.assign(m,{calcWidth:v}),w&&(c=c-v,c<0&&(c=0))};if(t.forEach((m,p)=>{if(!m.isHidden){const y=String(Sr(m,["resizeWidth","width"]));let v=!0;if(/^\d+\.?\d*(px)?$/.test(y)){const L=Number(y.replace("px",""));h(m,L),v=!1}if(/^\d+\.?\d*%$/.test(y)){let L=n;if(c>0){const x=Number(y.replace("%",""));L=c*x/100}h(m,L),v=!1}v&&f.push(p)}}),f.length>0){let m=n;c>0&&(m=c/f.length,f.forEach(p=>h(t[p],m,!1)))}},Z0=(e,t,n=60,i=!1)=>{const l=ct.exports.throttle(()=>{typeof t=="function"&&t()},n),o=new ResizeObserver(()=>{l()});return i&&typeof t=="function"&&t(),{start:()=>{o.observe(e)},stop:()=>{o.disconnect(),o.unobserve(e)}}},jc=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},U({},i))},Xs=(e,t,n)=>n.type==="index"?e[Xe.ROW_INDEX]+1:ct.exports.get(e,t),Dr=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Dr(Reflect.apply(e,globalThis,t),t):[],Qp=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Xe.ROW_INDEX?`__ROW_INDEX_${n}`:ct.exports.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):Bi.v4(),Rp=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},Wp=(e,t)=>{function n(o,c){const u=(n.canvas||(n.canvas=document.createElement("canvas"))).getContext("2d");return u.font=c,u.measureText(o).width}function i(o,c){return window.getComputedStyle(o,null).getPropertyValue(c)}function l(o=document.body){const c=i(o,"font-weight")||"normal",f=i(o,"font-size")||"16px",u=i(o,"font-family")||"Times New Roman";return`${c} ${f} ${u}`}return n(t||(e==null?void 0:e.innerHTML),l(e))};var G0=a.defineComponent({name:"TableCell",props:{column:g.any.def({}),row:g.any.def({}),parentSetting:g.oneOfType([g.bool,g.shape({content:g.string.def(""),disabled:g.bool.def(!1),watchCellResize:g.bool.def(!0)})]).def(void 0)},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),l=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:o=!1}=l();let c=null,f=null;const u=()=>{let m=!0,p=n.value.innerText;return typeof o=="boolean"&&(m=!o),typeof o=="object"&&(m=o.disabled,typeof o.content=="function"&&(p=o.content(e.column,e.row)),p=o.content||n.value.innerText),{disabled:m,content:p}},h=()=>{if(!n.value||/selection|index|expand/.test(e.column.type)||!va(n.value))return;const{content:m}=u(),p=Wp(n.value,m),w=n.value.clientWidth,y=window.getComputedStyle(n.value),v=["padding-left","padding-right"].reduce((x,k)=>x+Number(y.getPropertyValue(k).replace("px","")),0),L=w-v;if(i.value=p>L,i.value){const x=a.ref(u());f===null&&(f=mc(n.value,x))}else f==null||f.destroyInstance(n.value),f=null};return a.onMounted(()=>{var p;const{disabled:m}=u();m||(h(),((p=e.column.showOverflowTooltip)==null?void 0:p.watchCellResize)!==!1&&(c=Z0(n.value,()=>{h()},60,!0),c.start()))}),a.onBeforeUnmount(()=>{c==null||c.stop(),f==null||f.destroyInstance(n.value)}),()=>{var m;return a.createVNode("div",{class:"cell",ref:n},[(m=t.default)==null?void 0:m.call(t)])}}}),zc=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)])}}),Hp=a.defineComponent({name:"BodyEmpty",props:{list:g.array.def([]),filterList:g.array.def([]),emptyText:g.string.def("\u6682\u65E0\u6570\u636E")},emits:["change"],setup(e){const t=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(Ps,{scene:"part",type:t.value,description:e.emptyText},null)}});function Bp(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var _p=a.defineComponent({name:"HeadFilter",props:{column:g.any.def({}),height:g.number.def(ii)},emits:["change","filterSave"],setup(e,{emit:t}){const{column:n}=e,i=a.reactive({isOpen:!1,checked:[]}),l=a.computed(()=>Se({[_e("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:i.checked.length,opened:i.isOpen})),o=Se({[_e("table-head-filter")]:!0}),c=I=>{i.isOpen=I},f=`light ${_e("table-head-filter")}`,u=a.computed(()=>{const{list:I=[]}=n.filter;return I.map(N=>Te(U({},N),{checked:i.checked.includes(N.value)}))}),h=(I,N="ig")=>new RegExp(`${I}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),N),m=(I,N)=>{const{match:T}=n.filter,A=Xs(N,It(n,"field",[n,N]),n);return T==="full"&&I.includes(A),I.some(P=>h(P,"img").test(A))},p=typeof n.filter.filterFn=="function"?(I,N,T,A)=>n.filter.filterFn(I,N,e.column,T,A):(I,N)=>I.length?m(I,N):!0,w=()=>{y(!0),t("filterSave",[...i.checked]),i.isOpen=!1},y=(I=!1)=>{const{disabled:N}=L(x,"\u786E\u5B9A");if(N||I){if(e.column.filter==="custom"){t("change",[...i.checked],null),i.isOpen=!1;return}t("change",[...i.checked],p)}},v=()=>{i.checked.length&&(i.checked.splice(0,i.checked.length),i.isOpen=!1,a.nextTick(()=>t("change",i.checked,p)))},L=(I,N)=>({disabled:I==="disabled"||I===!1,text:typeof I=="string"?I:N}),{btnSave:x,btnReset:k}=n.filter,C=()=>{const{disabled:I,text:N}=L(x,"\u786E\u5B9A");return I?a.createVNode("span",{class:"btn-filter-save disabled"},[N]):a.createVNode("span",{class:"btn-filter-save",onClick:w},[N])},b=()=>{const{disabled:I,text:N}=L(k,"\u91CD\u7F6E");return I?"":a.createVNode("span",{class:["btn-filter-reset",i.checked.length?"":"disable"],onClick:v},[N])};return()=>a.createVNode(ni,a.mergeProps({trigger:"click",isShow:i.isOpen,placement:"bottom-end",arrow:!1,offset:0},{theme:f},{onAfterShow:()=>c(!0),onAfterHidden:()=>c(!1)}),{default:()=>a.createVNode(Ho,{class:l.value},null),content:()=>{let I;return a.createVNode("div",{class:o},[a.createVNode(ec,{class:"content-list",modelValue:i.checked,"onUpdate:modelValue":N=>i.checked=N,onChange:()=>y(!1)},Bp(I=u.value.map(N=>a.createVNode("div",{class:"list-item"},[a.createVNode(Ii,{label:N.value},{default:()=>[N.text]})])))?I:{default:()=>[I]}),a.createVNode("div",{class:"content-footer"},[C(),a.createVNode("span",{class:"btn-filter-split"},null),b()])])}})}}),ai=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e))(ai||{}),Zp=a.defineComponent({name:"HeadSort",props:{column:g.any.def({})},emits:["change"],setup(e,{emit:t}){var o,c;const{value:n=ai.NULL}=(c=(o=e.column)==null?void 0:o.sort)!=null?c:{},i=a.ref(n),l=(f,u)=>{var v,L;if(f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault(),i.value===u?i.value=ai.NULL:i.value=u,e.column.sort==="custom"){t("change",null,u);return}const h=e.column.field,m=x=>Xs(x,h,e.column),p=(x,k)=>{const C=m(x),b=m(k);return typeof C=="number"&&typeof b=="number"?C-b:String.prototype.localeCompare.call(C,b)},w=typeof((v=e.column.sort)==null?void 0:v.sortFn)=="function"?(L=e.column.sort)==null?void 0:L.sortFn:p,y=i.value===ai.NULL?()=>!0:(x,k)=>w(x,k)*(u===ai.DESC?-1:1);t("change",y,u)};return()=>a.createVNode("span",{class:_e("head-cell-sort")},[a.createVNode(Do,{class:["sort-action","sort-asc",i.value===ai.ASC?"active":""],onClick:f=>l(f,ai.ASC)},null),a.createVNode(ws,{class:["sort-action","sort-desc",i.value===ai.DESC?"active":""],onClick:f=>l(f,ai.DESC)},null)])}});class Gp{constructor(t,n){tr(this,"props",null);tr(this,"ctx",null);this.props=t,this.ctx=n}}function F0(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var Fp=a.defineComponent({name:"Settings",props:{settings:g.oneOfType([g.shape({fields:g.arrayOf(g.shape({label:g.string,field:g.string,disabled:g.bool})),checked:g.arrayOf(g.string),limit:g.number.def(0),size:g.size(["small","medium","large"]).def("small"),sizeList:g.shape([])}),g.bool]).def(!1),columns:g.array.def([]),rowHeight:g.number.def(ii)},emits:["change"],setup(e,{emit:t}){const n=kp,i=a.ref(!1),l=a.ref(!1),o=typeof e.settings=="boolean"?a.ref({fields:e.columns.map(z=>Te(U({},z),{field:z.field||z.type})),checked:[],limit:0,size:"small",sizeList:n}):a.ref(e.settings),c=a.ref(o.value.size||"small"),f=a.ref(e.rowHeight),u=a.ref(o.value.checked),m=`light ${_e("table-settings")}`,p={checkAll:i.value,activeSize:c.value,activeHeight:f.value},w=()=>{t("change",{checked:u.value,size:c.value,height:f.value}),l.value=!1},y=()=>{i.value=p.checkAll,c.value=p.activeSize,f.value=p.activeHeight,u.value=o.value.checked||[],l.value=!1},v=()=>{Object.assign(p,{checkAll:i.value,activeSize:c.value,activeHeight:f.value}),l.value=!0},L=z=>{z.stopImmediatePropagation(),z.stopPropagation(),z.preventDefault(),i.value=!i.value;const E=o.value.fields||e.columns||[];if(i.value)u.value=E.map((ne,_)=>It(ne,"field",[ne,_]));else{const ne=E.filter(_=>_.disabled).map((_,ce)=>It(_,"field",[_,ce]));u.value.splice(0,u.value.length,...ne)}},x=a.computed(()=>{var z;return((z=o.value.limit)!=null?z:0)>0}),k=o.value.sizeList||n,C=a.computed(()=>x.value&&(o.value.limit?o.value.limit:0)<=u.value.length),b=(z,E)=>z.disabled||C.value&&!u.value.includes(It(z,"field",[z,E])),I=z=>{c.value=z.value,f.value=z.height},N=z=>({"line-size":!0,"is-medium":c.value==="medium",active:z.value===c.value}),T={marginRight:"12px"},A=()=>k.map(z=>a.createVNode("span",{class:N(z),onClick:()=>I(z)},[z.label])),P=a.computed(()=>o.value.fields||e.columns||[]),J=a.computed(()=>u.value.length>0&&!P.value.every((z,E)=>u.value.includes(It(z,"field",[z,E]))));return a.watch(()=>[u.value],()=>{u.value.length||(i.value=!1),u.value.length&&P.value.every((z,E)=>u.value.includes(It(z,"field",[z,E])))&&(i.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{u.value.splice(0,u.value.length,...o.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(ni,a.mergeProps({trigger:"manual",isShow:l.value,placement:"bottom-end",arrow:!1},{theme:m}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:v},[a.createVNode(Eo,{style:"color: #c4c6cc;"},null)]),content:()=>{let z;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[a.createTextVNode("\u8868\u683C\u8BBE\u7F6E")]),a.createVNode(Is,{class:"icon-close-action",onClick:y},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"},[a.createTextVNode("\u5B57\u6BB5\u663E\u793A\u8BBE\u7F6E")]),x.value?a.createVNode("span",{class:"limit"},[a.createTextVNode("\uFF08\u6700\u591A"),o.value.limit,a.createTextVNode("\u9879\uFF09")]):""]),x.value?"":a.createVNode("span",{class:"check-all",onClick:L},[a.createVNode(Ii,{label:"\u5168\u9009",indeterminate:Boolean(J.value),modelValue:u.value.length>0},{default:()=>[a.createTextVNode("\u5168\u9009")]})])]),a.createVNode(ec,{class:"setting-body-fields",modelValue:u.value,"onUpdate:modelValue":E=>u.value=E},F0(z=P.value.map((E,ne)=>{let _;return a.createVNode("div",{class:"field-item"},[a.createVNode(Ii,{label:It(E,"field",[E,ne]),checked:u.value.includes(It(E,"field",[E,ne])),disabled:b(E,ne)},F0(_=It(E,"label",[E,ne]))?_:{default:()=>[_]})])}))?z:{default:()=>[z]}),a.createVNode("div",{class:"setting-body-line-height"},[a.createTextVNode("\u8868\u683C\u884C\u9AD8\uFF1A"),A()])]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(_t,{theme:"primary",style:T,onClick:w},{default:()=>[a.createTextVNode("\u786E\u5B9A")]}),a.createVNode(_t,{style:T,onClick:y},{default:()=>[a.createTextVNode("\u53D6\u6D88")]})])])}}):""}}),Pc=(e,t,n)=>{const i=a.computed(()=>e.pagination&&e.data.length?ii:0),l=(p,w,y)=>({column_fixed:!!p.fixed,column_fixed_left:p.fixed!=="right",column_fixed_right:p.fixed==="right",shadow:p.fixed==="right"?w<y:w>0}),o=p=>p.fixed==="right"?"right":"left",c={left:(p=!0)=>t.filter(w=>w.fixed&&w.fixed!=="right").reduce((w,y,v)=>p&&v===0?w:w+Sr(y),0),right:(p=!0)=>t.filter(w=>w.fixed==="right").reduce((w,y,v)=>p&&v===0?w:w+Sr(y),n?Tc:0)},f=c.right,u=()=>{const p=(v,L)=>{if(!v.fixed)return{};const x=o(v),k=x==="right"?-1:1,C=`${L[x]}px`;return L[x]=L[x]+Sr(v)*k,{[x]:C}},w=f(!0);return{fixedOffset:{left:0,right:w},resolveFixedColumnStyle:p}},h=(p,w)=>{const y=L=>({width:`${c[L](!1)}px`,bottom:`${i.value}px`}),v={left:!1,right:!1};return t.filter(L=>!L.isHidden&&L.fixed).map(L=>{const x=o(L),k=v[x];return v[x]=!0,k?"":a.createVNode("div",{class:l(L,p,w),style:y(x)},null)})},m=_e("table-fixed");return{renderFixedColumns:h,fixedWrapperClass:m,getFixedColumnStyleResolve:u}};function Y0(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class Yp{constructor(t,n,i,l){tr(this,"getRowHeight",(t,n)=>{const{size:i,height:l}=this.setting;return l!=null?It(this.setting,"height",["tbody",t,n,i]):It(this.props,"rowHeight",["tbody",t,n])});tr(this,"getColumnClass",(t,n)=>({[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right"}));tr(this,"getHeadColumnClass",(t,n)=>Te(U({},this.getColumnClass(t,n)),{active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=l,this.plugins=new Gp(t,n),this.uuid=Bi.v4(),this.events=new Map}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=jc(this.props);if(!t)return null;const n=i=>{const{checked:l=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c,l.length&&this.colgroups.forEach(f=>{f.isHidden=!(l!=null?l:[]).includes(It(f,["field","type"],[f]))}),this.emitEvent(In.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(Fp,{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 n,i,l;return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):(l=(i=(n=this.context.slots).empty)==null?void 0:i.call(n))!=null?l:a.createVNode(Hp,{filterList:t,list:this.props.data,emptyText:this.props.emptyText},null)}renderTableFooter(t){return a.createVNode(xc,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.hanlePageChange(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(Pt.PAGE_LIMIT_CHANGE,t)}hanlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Pt.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(l=>l.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(l=>l.index!==t&&l.active).forEach(l=>{Object.assign(l,{active:!1})})}handleColumnHeadClick(t){this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(Pt.COLUMN_PICK,this.propActiveCols))}getSortCell(t,n){const i=(l,o)=>{this.emitEvent(In.ON_SORT_BY_CLICK,[{sortFn:l,column:t,index:n,type:o}])};return a.createVNode(Zp,{column:t,onChange:i},null)}getFilterCell(t,n){const i=(o,c)=>{const f=(u,h)=>c(o,u,h);this.emitEvent(In.ON_FILTER_CLICK,[{filterFn:f,checked:o,column:t,index:n}])},l=o=>{this.context.emit(Pt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(_p,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:l},null)}renderHeader(){const t=jc(this.props),{cellFn:n}=t,i={"--row-height":`${It(t,"height",["thead"])}px`},l=(h,m)=>{if(h.type==="selection"){const w=this.reactiveProp.rowActions.get(Xe.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Xe.ROW_SELECTION]:!!w},0,!0)}const p=[];return h.sort&&p.push(this.getSortCell(h,m)),h.filter&&p.push(this.getFilterCell(h,m)),typeof n=="function"?(p.unshift(n(h,m)),p):(p.unshift(It(h,"label",[h,m])),p)},o=h=>Array.from(h.listeners.keys()).reduce((m,p)=>{const w=p.split("_").slice(-1)[0];return Object.assign(m,{[w]:y=>{h.listeners.get(p).forEach(v=>Reflect.apply(v,this,[y,h,this]))}})},{}),{getFixedColumnStyleResolve:c}=Pc(this.props,this.colgroups),{resolveFixedColumnStyle:f,fixedOffset:u}=c();return a.createVNode("thead",{style:i},[a.createVNode(zc,null,{default:()=>[a.createVNode("tr",null,[this.filterColgroups.map((h,m)=>{let p;return a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:this.getHeadColumnClass(h,m),style:f(h,u),onClick:()=>this.handleColumnHeadClick(m)},o(h)),[a.createVNode(G0,null,Y0(p=l(h,m))?p:{default:()=>[p]})])})])]})])}renderTBody(t){const{getFixedColumnStyleResolve:n}=Pc(this.props,this.colgroups);return a.createVNode("tbody",null,[t.map((i,l)=>{const o=[...Dr(this.props.rowStyle,[i,l,this]),{"--row-height":`${this.getRowHeight(i,l)}px`}],c=[...Dr(this.props.rowClass,[i,l,this])],{resolveFixedColumnStyle:f,fixedOffset:u}=n(),h=`${this.uuid}-${i[Xe.ROW_UID]}`;return[a.createVNode(zc,{key:h},{default:()=>[a.createVNode("tr",{style:o,class:c,onClick:m=>this.handleRowClick(m,i,l,t),onDblclick:m=>this.handleRowDblClick(m,i,l,t)},[this.filterColgroups.map((m,p)=>{let w;const y=[f(m,u),...Dr(this.props.cellStyle,[m,p,i,l,this])],v=[this.getColumnClass(m,p),...Dr(this.props.cellClass,[m,p,i,l,this]),{"expand-row":i[Xe.ROW_EXPAND]}],L={cell:!0,"expand-cell":m.type==="expand"},x=`__CELL_${l}_${p}`;return a.createVNode("td",{class:v,style:y,key:x,colspan:1,rowspan:1},[a.createVNode(G0,{class:L,column:m,row:i,parentSetting:this.props.showOverflowTooltip},Y0(w=this.renderCell(i,m,l,t))?w:{default:()=>[w]})])})])]}),this.renderExpandRow(i,c)]})])}renderExpandRow(t,n){if(!!t[Xe.ROW_EXPAND]){const l=[...n,{row_expend:!0}],o=`${this.uuid}-${t[Xe.ROW_UID]}_expand`;return a.createVNode(zc,{key:o},{default:()=>{var c,f,u;return[a.createVNode("tr",{class:l},[a.createVNode("td",{colspan:this.filterColgroups.length,rowspan:1},[(u=(f=(c=this.context.slots).expandRow)==null?void 0:f.call(c,t))!=null?u:a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,l){this.context.emit(Pt.ROW_CLICK,t,n,i,l,this)}handleRowDblClick(t,n,i,l){this.context.emit(Pt.ROW_DBL_CLICK,t,n,i,l,this)}getExpandCell(t){return!!t[Xe.ROW_EXPAND]?a.createVNode(Ns,null,null):a.createVNode(Ss,null,null)}handleRowExpandClick(t,n,i,l,o){this.emitEvent(In.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:l,e:o}])}renderCellCallbackFn(t,n,i,l){const o=Xs(t,It(n,"field",[n,t]),n),c=this.props.data[t[Xe.ROW_INDEX]];return n.render({cell:o,data:c,row:t,column:n,index:i,rows:l})}renderCheckboxColumn(t,n,i=!1){const l=c=>{this.emitEvent(In.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:c}])},o=i&&!!this.reactiveProp.rowActions.get(Xe.ROW_SELECTION_INDETERMINATE);return a.createVNode(Ii,{onChange:l,modelValue:t[Xe.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,l){const o=()=>{var c,f,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,l):(u=(f=(c=this.context.slots).expandCell)==null?void 0:f.call(c,{row:t,column:n,index:i,rows:l}))!=null?u:this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,l,c)},[o()])}renderCell(t,n,i,l){var f,u;const o=()=>{const h=Xs(t,It(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,l):h},c={expand:(h,m,p,w)=>this.renderExpandColumn(h,m,p,w),selection:(h,m,p,w)=>this.renderCheckboxColumn(h,p)};return(u=(f=c[n.type])==null?void 0:f.call(c,t,n,i,l))!=null?u: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=Se({active:this.isColActive(n)}),l=`${Vp(Sr(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:l},null)})])}get filterColgroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}var Ks=(e,t)=>({initColumns:l=>{let o=[];Array.isArray(l)?o=l:o=[l],o.forEach(c=>{if(!t.find(u=>u.label===c.label&&u.field===c.field)){const u=a.unref(c);t.push(u)}})},getColumns:()=>{var l;return t!=null&&t.length?t:(l=e.columns)!=null&&l.length?e.columns:[]}});const U0=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:Sc(e.activeColumn):Array.isArray(e.activeColumn)?Sc(e.activeColumn[0]):Sc(e.activeColumn):[];var Up=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Ks(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const l=a.reactive(U0(e)),o=()=>i().map((c,f)=>({index:f,active:l.some(u=>u===f),_column:c}));return a.watchEffect(()=>{n=o();const c=U0(e);n.forEach((f,u)=>{Object.assign(f,{active:c.some(h=>h===u)})})}),{activeColumns:n}},$p=(e,t=!0)=>{const n="HeadColumnResize";let i;(function(b){b.MOUSE_MOVE="onMousemove",b.MOUSE_OUT="onMouseout",b.MOUSE_DOWN="onMousedown"})(i||(i={}));let l=!1,o=!1,c=!1,f=0,u=null,h=0;const m=a.ref(-1e3),p=b=>{var A;o=!1,c=!1;const I=document.body.style;I.cursor="";const N=b.clientX-f;u.resizeWidth=((A=u.resizeWidth)!=null?A:u.calcWidth)+N,document.removeEventListener("mouseup",p),document.removeEventListener("mousemove",y),f=0,m.value=-1e3,u=null,b.target.closest("table").querySelectorAll("th").forEach(P=>P.style.setProperty("user-select","inherit"))},w=b=>ct.exports.throttle(()=>{m.value=b.clientX-f+h},60),y=b=>{document.body.style.setProperty("cursor",""),w(b)()},v={[i.MOUSE_DOWN]:(b,I)=>{if(!l)return;o=!0,document.body.style.setProperty("cursor","col-resize"),u=I,f=b.clientX;const T=b.target.closest("table");h=f-T.getBoundingClientRect().left,document.addEventListener("mouseup",p),document.addEventListener("mousemove",y)},[i.MOUSE_MOVE]:(b,I)=>{o&&!c&&(c=!0);const N=b.target.closest("th");if(c&&N.style.setProperty("user-select","none"),!c){if(!N)return;const T=N.getBoundingClientRect();T.width>12&&T.right-b.pageX<8?(l=!0,N.style.setProperty("cursor","col-resize")):(N.style.setProperty("cursor",""),l=!1)}},[i.MOUSE_OUT]:(b,I)=>{const N=b.target;c||N.style.setProperty("cursor","")}},L=b=>`${n}_${b}`,x=()=>{e.forEach(b=>{b.resizable!==!1&&Object.keys(v).forEach(I=>{const N=L(I);b.listeners.has(N)||b.listeners.set(N,[]),b.listeners.get(N).push(v[I])})})},k=()=>{e.forEach(b=>{Object.keys(v).forEach(I=>{const N=L(I);if(b.listeners.has(N)){const T=b.listeners.get(N);T.splice(0,T.length)}})})};t&&x();const C=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:x,resetResizeEvents:k,dragOffsetX:m,dragOffsetXStyle:C}};const Xp=(e,t,n,i,l)=>{const{getColumns:o}=Ks(e,t),c=a.ref(200),f=a.ref(void 0),u=a.computed(()=>e.pagination&&e.data.length),h=a.computed(()=>Se({[_e("table")]:!0,"has-footer":u.value,"has-scroll-y":f.value||e.virtualEnabled},Jp(e.border))),m=Se({[_e("table-head")]:!0,"has-settings":!!e.settings}),p=jc(e),w=a.computed(()=>({"--row-height":`${It(p,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),y={[_e("table-body")]:!0},v=a.computed(()=>Se({[_e("table-footer")]:!0,["is-hidden"]:!e.pagination||!e.data.length})),L=()=>{const P=o();if(P.every(J=>/^\d+\.?\d*(px)?$/ig.test(`${J.width}`))){const J=P.reduce((E,ne)=>E+Number(`${ne.width}`.replace(/px/ig,"")),0),z=f.value?Tc:0;return`${J+z}px`}return"100%"},x=a.computed(()=>({minHeight:_0(e.minHeight,"auto"),width:L(),maxWidth:"100%"})),k=(P,J)=>{const z=String(P);if(/^\d+\.?\d*$/.test(z))return Number(z);if(/^\d+\.?\d*px$/ig.test(z))return Number(z.replace("px",""));if(/^\d+\.?\d*%$/ig.test(z)&&typeof J=="number"){const E=Number(z.replace("%",""));return J*E/100}return J},C=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),b=()=>e.showHead?k(e.headHeight,ii):0,I=()=>{const P=k(e.height,c.value),J=b(),z=k(e.minHeight,c.value),E=e.pagination&&e.data.length?ii:0,ne=P-J-E,_=e.height!=="auto"?`${ne}px`:!1,ce=z-J-E,re=k(e.maxHeight,void 0),ae=typeof re=="number"?`${re-J-E}px`:!1;Object.assign(C,{display:l!=null&&l.length?"block":!1,"min-height":`${ce}px`,height:_,maxHeight:ae})};a.onMounted(()=>{N(n==null?void 0:n.value)});const N=P=>{if(P){const{height:J}=P.parentElement.getBoundingClientRect();c.value=J,I(),T(P)}},T=P=>{const J=e.virtualEnabled?`.${_e("virtual-section")}`:`.${_e("table-body-content")}`,z=P.querySelector(".bk-table-body");f.value=Rp(z,J,0)};return{tableClass:h,headClass:m,contentClass:y,footerClass:v,wrapperStyle:x,contentStyle:C,headStyle:w,resetTableHeight:N,updateBorderClass:T,getColumnsWidthOffsetWidth:()=>{let P=0;return f.value&&(P=P+Tc),e.border.includes(Ys.OUTER)&&!e.border.includes(Ys.NONE)&&(P=P+2),P},hasFooter:u,hasScrollY:f}},Kp=(e,t)=>{var ce,re;const n=a.reactive([]),{getColumns:i}=Ks(e,t),l=()=>{n.splice(0,n.length,...i().map(ae=>Te(U({},ae),{calcWidth:null,resizeWidth:null,listeners:new Map})))},{dragOffsetXStyle:o,dragOffsetX:c,resetResizeEvents:f,registerResizeEvent:u}=$p(n,!0),{activeColumns:h}=Up(e,t);a.watch(()=>[e.columns,t],()=>{l(),f(),u()},{immediate:!0,deep:!0});const m=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:h,settings:e.settings,setting:{size:(ce=e.settings)==null?void 0:ce.size,height:Us[(re=e.settings)==null?void 0:re.size]}}),p=ae=>{var ue;return m.rowActions.has(ae)?(ue=m.rowActions.get(ae))==null?void 0:ue.isExpand:!1},w=(ae,ue=void 0)=>{var W;const ie=ae[Xe.ROW_UID],Y=typeof ue=="boolean"?ue:!p(ie);m.rowActions.set(ie,Object.assign({},(W=m.rowActions.get(ie))!=null?W:{},{isExpand:Y})),J()},y=()=>m.rowActions.has(Xe.ROW_SELECTION_ALL)?m.rowActions.get(Xe.ROW_SELECTION_ALL):e.selectionKey?A.every(ae=>N(ae)):!1,v=ae=>{const ue=ae[Xe.ROW_UID],{isSelected:ie=!1}=m.rowActions.get(ue)||{};return ie},L=(ae=v)=>{let ue=!1,ie=!1;A.forEach(Y=>{const W=ae(Y);!ue&&!W&&(ue=!0),!ie&&W&&(ie=!0)}),m.rowActions.set(Xe.ROW_SELECTION_ALL,ie&&!ue),m.rowActions.set(Xe.ROW_SELECTION_INDETERMINATE,ie&&ue)},x=()=>e.columns.some(ae=>ae.type==="selection"),k=()=>{x()&&L(ae=>N(ae))},C=(ae=void 0)=>{const ue=typeof ae=="boolean"?ae:!y();m.rowActions.set(Xe.ROW_SELECTION_ALL,ue),m.rowActions.set(Xe.ROW_SELECTION_INDETERMINATE,!1),A.forEach(ie=>{var Q;const Y=ie[Xe.ROW_UID],W=Object.assign({},(Q=m.rowActions.get(Y))!=null?Q:{},{isSelected:ue});m.rowActions.set(Y,W)}),J(ue),z(null,ae,!0)},b=()=>{C(!1)},I=(ae,ue)=>{var Y;const ie=ae[Xe.ROW_UID];if(ie){const W=typeof ue=="boolean"?ue:!T(ae,ie),Q=Object.assign({},(Y=m.rowActions.get(ie))!=null?Y:{},{isSelected:W});m.rowActions.set(ie,Q),ue||m.rowActions.set(Xe.ROW_SELECTION_ALL,!1),L(),J(),z(ae,ue,!1)}},N=(ae,ue=()=>!1)=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,globalThis,[{row:ae,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?ct.exports.get(ae,e.selectionKey):ue(),T=(ae,ue)=>N(ae,()=>{var Y;const ie=ue===void 0?ae[Xe.ROW_UID]:ue;return y()?!0:m.rowActions.has(ie)?(Y=m.rowActions.get(ie))==null?void 0:Y.isSelected:!1}),A=a.reactive([]),P=(ae=!1)=>{A.splice(0,A.length,...e.data.map((ue,ie)=>{const Y=Qp(ue,e,ie);return Te(U({},ue),{[Xe.ROW_INDEX]:ie,[Xe.ROW_UID]:Y,[Xe.ROW_EXPAND]:ae?p(Y):!1,[Xe.ROW_SELECTION]:T(ue,Y)})})),k()},J=ae=>{A.forEach(ue=>{Object.assign(ue,{[Xe.ROW_EXPAND]:p(ue[Xe.ROW_UID]),[Xe.ROW_SELECTION]:typeof ae=="boolean"?ae:T(ue,ue[Xe.ROW_UID])})}),typeof ae!="boolean"&&k()},z=(ae,ue,ie=!1)=>{if(e.asyncData&&e.rowKey){if(ie)e.data.forEach(Y=>{ct.exports.has(Y,e.selectionKey)&&ct.exports.set(Y,e.selectionKey,!!ue)});else if(ct.exports.has(ae,e.selectionKey)){const Y=e.data.find(W=>ct.exports.get(W,e.rowKey)===ct.exports.get(ae,e.rowKey));ct.exports.set(Y,e.selectionKey,!!ue)}}},{renderFixedColumns:E,fixedWrapperClass:ne}=Pc(e,n,!1);return{colgroups:n,dragOffsetXStyle:o,dragOffsetX:c,reactiveSchema:m,indexData:A,fixedWrapperClass:ne,initIndexData:P,updateIndexData:J,renderFixedColumns:E,setRowExpand:w,updateColGroups:l,clearSelection:b,toggleAllSelection:C,toggleRowSelection:I,getSelection:()=>A.filter(ae=>T(ae))}};var qp=a.defineComponent({name:"Table",props:Tp,emits:Lp,setup(e,t){let n=null,i=null,l=null,o=null;const c=a.reactive([]),{initColumns:f}=Ks(e,c);a.provide(R0,f);const u=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:p,dragOffsetXStyle:w,dragOffsetX:y,reactiveSchema:v,indexData:L,renderFixedColumns:x,setRowExpand:k,initIndexData:C,fixedWrapperClass:b,clearSelection:I,toggleAllSelection:N,toggleRowSelection:T,getSelection:A}=Kp(e,c),{pageData:P,localPagination:J,resolvePageData:z,watchEffectFn:E}=xp(e,L),{tableClass:ne,headClass:_,contentClass:ce,footerClass:re,wrapperStyle:ae,contentStyle:ue,headStyle:ie,updateBorderClass:Y,resetTableHeight:W,getColumnsWidthOffsetWidth:Q,hasFooter:F}=Xp(e,c,u,v,P),K=new Yp(e,t,v,p),fe=()=>{const V=u.value.querySelector(".bk-table-body-content"),H=V.querySelector("table");if(H){const $=H.scrollWidth,te=V.clientWidth;m.value=$-te}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{C(e.reserveExpand),E(l,n,i),a.nextTick(()=>{W(u.value),Y(u.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((u==null?void 0:u.value)instanceof HTMLElement){const V=Q();Dc(u.value,p,20,V),fe()}}),K.on(In.ON_SORT_BY_CLICK,V=>{var we,Ne;const{sortFn:H,column:$,index:te,type:ye}=V;typeof H=="function"&&(n=H,i=$,z(l,n,i),(Ne=(we=h.value)==null?void 0:we.reset)==null||Ne.call(we)),t.emit(Pt.COLUMN_SORT,{column:$,index:te,type:ye})}).on(In.ON_FILTER_CLICK,V=>{var we,Ne;const{filterFn:H,checked:$,column:te,index:ye}=V;typeof H=="function"&&(l=H,z(l,n,i),(Ne=(we=h.value)==null?void 0:we.reset)==null||Ne.call(we)),t.emit(Pt.COLUMN_FILTER,{checked:$,column:te,index:ye})}).on(In.ON_SETTING_CHANGE,V=>{const{checked:H=[],size:$,height:te}=V;a.nextTick(()=>{var we,Ne;Y(u.value);const ye=Q();H.length&&Dc(u.value,p,20,ye),(Ne=(we=h.value)==null?void 0:we.reset)==null||Ne.call(we),t.emit(Pt.SETTING_CHANGE,{checked:H,size:$,height:te})})}).on(In.ON_ROW_EXPAND_CLICK,V=>{const{row:H,column:$,index:te,rows:ye,e:we}=V;t.emit(Pt.ROW_EXPAND_CLICK,{row:H,column:$,index:te,rows:ye,e:we}),k(H,!H[Xe.ROW_EXPAND])}).on(In.ON_ROW_CHECK,({row:V,isAll:H,index:$,value:te})=>{H?(N(te),t.emit(Pt.ROW_SELECT_ALL,{checked:te,data:e.data})):(T(V,te),t.emit(Pt.ROW_SELECT,{row:V,index:$,checked:te,data:e.data})),t.emit(Pt.ROW_SELECT_CHANGE,{row:V,isAll:H,index:$,checked:te,data:e.data})});const he=V=>{var Qe;const H=(Qe=v.pos.bottom)!=null?Qe:0,$=V[1],{translateX:te,translateY:ye,pos:we={}}=$;v.scrollTranslateY=ye,v.scrollTranslateX=te,v.pos=we;const{bottom:Ne}=we;Ne<=2&&H>Ne&&Mf(60,()=>{t.emit(Pt.SCROLL_BOTTOM,Te(U({},we),{translateX:te,translateY:ye}))},!0)(),fe()};a.onMounted(()=>{o=Z0(u.value,()=>{(e.height==="100%"||e.height==="auto")&&W(u.value),Y(u.value);const V=Q();Dc(u.value,p,20,V)},60,!0),o.start()}),a.onBeforeUnmount(()=>{o.stop(),o=null,K.destroy()}),t.expose({setRowExpand:k,clearSelection:I,toggleAllSelection:N,toggleRowSelection:T,getSelection:A});const Ce=a.computed(()=>Te(U({},ce),{"__is-empty":!P.length})),Ae={[_e("table-body-content")]:!0,"with-virtual-render":e.virtualEnabled},oe={column_drag_line:!0,"offset-x":!0},X=a.computed(()=>Te(U({},w.value),{left:`${y.value-v.scrollTranslateX}px`})),Z={"scroll-loading":!0,_bottom:!0},se={[_e("fixed-bottom-border")]:!0,"_is-empty":!e.data.length},Me={zIndex:-1,width:0,height:0,display:"none"},{renderScrollLoading:j}=Sp(e,t),B=e.virtualEnabled?{}:{scrollXName:"",scrollYName:""};return()=>{var V,H;return a.createVNode("div",{class:ne.value,style:ae.value,ref:u},[a.createVNode("div",{class:_,style:ie.value},[K.renderTableHeadSchema()]),a.createVNode(xr,a.mergeProps({ref:h,lineHeight:K.getRowHeight,class:Ce.value,style:ue,list:P},B,{contentClassName:Ae,onContentScroll:he,throttleDelay:0,scrollEvent:!0,enabled:e.virtualEnabled}),{default:$=>K.renderTableBodySchema($.data||e.data),afterSection:()=>a.createVNode("div",{class:se},null)}),a.createVNode("div",{class:b},[x(v.scrollTranslateX,m.value),a.createVNode("div",{class:oe,style:X.value},null),a.createVNode("div",{class:Z},[j()])]),a.createVNode("div",{class:re.value},[F.value&&K.renderTableFooter(J.value)]),a.createVNode("div",{style:Me},[(H=(V=t.slots).default)==null?void 0:H.call(V)])])}}});const $0=He(qp);He(H0);const X0=He(H0),za=12;function e5(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(l=[])=>{t.curPage=1,t.totalSize=l.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(l.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:l=>{t.curPage=l,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function t5(e){const{useGroup:t,saveKey:n,displayKey:i,list:l}=a.toRefs(e),o=a.ref([]);return a.watch([t,n,i,l],()=>{o.value=[];let c=a.markRaw(l.value);t.value&&(c=c.reduce((f,u)=>{let h=[];return u.children&&(h=u.children.map(m=>U({group:{groupId:u[n.value],groupName:u[i.value]}},m))),f.concat(h)},[])),o.value=c},{immediate:!0}),o}const K0=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)(e.charCodeAt(i)&65280)!==0&&(n+=1),n+=1;return n};var q0=a.defineComponent({name:"ListTagRender",props:{node:g.object,searchKey:g.oneOfType([g.string,g.arrayOf(g.string)]),displayKey:g.string,searchKeyword:g.string,tpl:{type:Function,default:null}},render(){const e=n=>{if(this.searchKeyword){const i=new RegExp(`(${this.searchKeyword})`,"i");return n.replace(i,'<strong class="highlight-text">$1</strong>')}return n};if(this.tpl)return this.tpl(this.node,e,a.h,this);const t=this.node[this.displayKey];return a.createVNode("div",{class:"bk-selector-node"},[a.createVNode("span",{class:"text",innerHTML:e(t)},[t])])}});const n5=()=>({modelValue:g.arrayOf(g.string).def([]),placeholder:g.string.def("\u8BF7\u8F93\u5165\u5E76\u6309 Enter \u7ED3\u675F"),list:g.arrayOf(g.object).def([]),disabled:g.bool.def(!1),tooltipKey:g.string.def(""),saveKey:g.string.def("id"),displayKey:g.string.def("name"),hasDeleteIcon:g.bool.def(!1),clearable:g.bool.def(!0),trigger:g.commonType(["focus","search"]).def("search"),searchKey:g.oneOfType([g.string,g.arrayOf(g.string)]).def("name"),useGroup:g.bool.def(!1),allowCreate:g.bool.def(!1),maxData:g.number.def(-1),maxResult:g.number.def(10),contentMaxHeight:g.number.def(300),contentWidth:g.number.def(190),separator:g.string.def(""),allowNextFocus:g.bool.def(!0),allowAutoMatch:g.bool.def(!1),showClearOnlyHover:g.bool.def(!1),leftSpace:g.number.def(0),createTagValidator:{type:Function,default:null},filterCallback:{type:Function,default:null},tagTpl:{type:Function,default:null},tpl:{type:Function,default:null},pasteFn:{type:Function,default:null},withValidate:{type:Boolean,default:!0},popoverProps:Object});var i5=a.defineComponent({name:"TagRender",props:{node:g.object,displayKey:g.string,tpl:{type:Function,default:null}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])])}}),a5=a.defineComponent({name:"TagInput",directives:{bkTooltips:dc},props:n5(),emits:["update:modelValue","change","select","blur","remove","removeAll"],setup(e,{emit:t}){const n=En(),i=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),l=a.reactive(U({isShow:!1,width:190,modifiers:[{name:"offset",options:{offset:[0,4]}}]},e.popoverProps)),{maxResult:o}=a.toRefs(e),{pageState:c,initPage:f,pageChange:u}=e5(o),h=a.ref(""),m=a.ref(null),p=a.ref(null),w=a.ref(null),y=a.ref(null),v=a.ref(null),L=a.ref(null),x=a.ref(null),k=a.computed(()=>!e.disabled&&e.hasDeleteIcon),C=a.computed(()=>e.maxData===1),b=a.computed(()=>z.selectedTagList.length===0&&h.value===""&&!i.isEdit),I=a.computed(()=>e.clearable&&!e.disabled&&z.selectedTagList.length!==0&&(e.showClearOnlyHover?i.isHover:!0)),N=a.computed(()=>({"bk-tag-input-trigger":!0,active:i.isEdit,disabled:e.disabled}));a.watch([()=>e.modelValue,()=>e.list],()=>{var H;a.nextTick(()=>{ce()}),e.withValidate&&((H=n==null?void 0:n.validate)==null||H.call(n,"change"))}),a.watch(h,ct.exports.debounce(()=>{const H=c.curPageList.length!==0,{value:$}=h;$!==""&&H||$===""&&e.trigger==="focus"&&H?l.isShow=!0:(e.trigger!=="focus"||!H)&&(l.isShow=!1)},150)),a.watch(()=>l.isShow,H=>{T(),H&&v.value&&(a.nextTick(()=>{v.value.scrollTop=0}),v.value.removeEventListener("scroll",A),v.value.addEventListener("scroll",A))});const T=()=>{var $,te;const H=C.value?0:($=y.value)==null?void 0:$.offsetLeft;l.modifiers=[{name:"offset",options:{offset:[H,4]}}],(te=L.value)==null||te.update()},A=()=>{if(c.isPageLoading||v.value.scrollTop===0)return;const{scrollTop:H,offsetHeight:$,scrollHeight:te}=v.value;if(H+$>=te){const ye=c.curPage+1;ye<=c.totalPage&&(c.isPageLoading=!0,setTimeout(()=>{u(ye)},500))}},P=()=>{var $;return Array.from((($=w.value)==null?void 0:$.childNodes)||[]).filter(te=>te.nodeType!==Node.TEXT_NODE)},J=H=>{if(!e.disabled){if(H!=null&&H.target){const{className:$}=H.target;($.indexOf("bk-tag-input-trigger")>-1||$.indexOf("tag-list")>-1)&&w.value.appendChild(y.value)}clearTimeout(x.value),C.value&&E.value.length&&(z.tagListCache=[...E.value],z.selectedTagListCache=[...z.selectedTagList],h.value=z.selectedTagListCache[0][e.saveKey],V(z.selectedTagList[0],0),Q()),i.isEdit=!0,a.nextTick(()=>{var $;($=m.value)==null||$.focus(),e.trigger==="focus"&&z.localList.length!==0&&(re(),l.isShow?T():l.isShow=!0)})}},z=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),E=a.computed(()=>z.selectedTagList.map(H=>H[e.saveKey])),ne=t5(e),_=a.computed(()=>{if(e.useGroup){const H={};return c.curPageList.forEach(($,te)=>{$.__index__=te,H[$.group.groupId]||(H[$.group.groupId]={id:$.group.groupId,name:$.group.groupName,children:[]}),H[$.group.groupId].children.push($)}),Object.keys(H).map($=>H[$])}return c.curPageList}),ce=()=>{const{saveKey:H,modelValue:$,displayKey:te,allowCreate:ye,trigger:we}=e;z.selectedTagList=[],z.localList=ne.value,$.length&&($.forEach(Ne=>{const Qe=z.localList.find(ut=>Ne===ut[H]);Qe!==void 0?z.selectedTagList.push(Qe):ye&&!E.value.includes(Ne)&&z.selectedTagList.push({[H]:Ne,[te]:Ne})}),C.value||(z.localList=z.localList.filter(Ne=>!$.includes(Ne[H])))),we==="focus"&&re()},re=(H="")=>{const{searchKey:$,filterCallback:te}=e,ye=H.toLowerCase();let we=[];if(typeof te=="function")we=te(ye,$,z.localList)||[];else if(Array.isArray($)){const Ne=$.map(Qe=>z.localList.filter(ut=>ut[Qe].toLowerCase().indexOf(ye)!==-1));we=Array.from(new Set(Ne.flat()))}else we=z.localList.filter(Ne=>Ne[$].toLowerCase().indexOf(ye)!==-1);f(we)},ae=(H,$)=>{const te={"bk-selector-actived":!1,"bk-selector-selected":E.value.includes(H[e.saveKey])};return e.useGroup?te["bk-selector-actived"]=H.__index__===i.focusItemIndex:te["bk-selector-actived"]=$===i.focusItemIndex,te};a.onMounted(()=>{ce()});const ue=()=>{z.tagListCache=[],z.selectedTagListCache=[],z.selectedTagList=[]},ie=()=>{h.value=""},Y=()=>{if(C.value)return 0;const $=P().findIndex(({id:te})=>te==="tagInputItem");return $>=0?$:0},W=(H,$,te=!1)=>{if(!$||!H)return;let ye=$;te&&(ye=$.nextElementSibling||null),$.parentNode.insertBefore(H,ye)},Q=H=>{const{maxData:$,trigger:te,allowCreate:ye}=e;if($===-1||$>E.value.length){const{value:we}=H!=null&&H.target?H.target:h,Ne=K0(we);Ne?(re(we),m.value.style.width=`${Ne*za}px`):te==="focus"&&re()}else K(),h.value="",l.isShow=!1;i.isEdit=!0,i.focusItemIndex=ye?-1:0},F=()=>{var H;l.width=C.value?(H=p.value)==null?void 0:H.clientWidth:e.contentWidth},K=()=>{x.value=setTimeout(()=>{var $;const H=h.value;if(ie(),i.isEdit=!1,C.value){const[te]=z.tagListCache;H&&H===te&&z.selectedTagListCache.length?B(z.selectedTagListCache[0],"select"):Ce("remove")}else if(e.allowAutoMatch&&H){const te=c.curPageList.find(ye=>Array.isArray(e.searchKey)?e.searchKey.map(Ne=>ye[Ne]).includes(H):ye[e.searchKey]===H);te?fe(te,"select"):e.allowCreate&&fe(H,"custom")}l.isShow=!1,t("blur",H,E.value),($=n==null?void 0:n.validate)==null||$.call(n,"blur")},200)},fe=(H,$,te)=>{te==null||te.stopPropagation(),!(!H||H.disabled)&&(C.value&&ue(),B(H,$),Ce("select"),ie(),l.isShow=!1)},he=(H,$,te)=>{te==null||te.stopPropagation(),V(H,$),ie(),Ce("remove",H),m.value.style.width=`${za}px`},Ce=(H,$)=>{t("change",E.value),t(H,$),t("update:modelValue",E.value)},Ae=H=>{H.stopPropagation();const $=z.selectedTagList;z.selectedTagList=[];const te=ne.value.filter(ye=>$.some(we=>we[e.saveKey]===ye[e.saveKey]));(e.allowCreate&&te.length!==0||!e.allowCreate)&&!C.value&&z.localList.push(...te),Ce("removeAll")},oe=()=>{const H={height:v.value.clientHeight,yAxis:v.value.getBoundingClientRect().y};a.nextTick(()=>{const $=v.value.querySelector(".bk-selector-actived");if(!$)return;const te={height:$.clientHeight,yAxis:$.getBoundingClientRect().y};te.yAxis<H.yAxis&&(v.value.scrollTop=v.value.scrollTop-(H.yAxis-te.yAxis));const ye=te.yAxis+te.height-H.yAxis;ye>H.height&&(v.value.scrollTop=v.value.scrollTop+ye-H.height)})},X=(H,$)=>{const te=P();W(y.value,te[H-1]),z.selectedTagList.splice(H-1,1),J();const ye=ne.value.some(we=>we===$[e.saveKey]);(e.allowCreate&&ye||!e.allowCreate)&&!C.value&&z.localList.push($),m.value=`${za}px`,Ce("remove")},Z=H=>{if(c.isPageLoading)return;let $;const te=H.target.value,ye=K0(te),we=Y(),Ne=P();switch(H.code){case"ArrowUp":if(H.preventDefault(),!l.isShow)return;i.focusItemIndex=i.focusItemIndex-1,i.focusItemIndex=i.focusItemIndex<0?-1:i.focusItemIndex,i.focusItemIndex===-1&&(i.focusItemIndex=c.curPageList.length-1),oe();break;case"ArrowDown":if(H.preventDefault(),!l.isShow)return;i.focusItemIndex=i.focusItemIndex+1,i.focusItemIndex=i.focusItemIndex>c.curPageList.length-1?c.curPageList.length:i.focusItemIndex,i.focusItemIndex===c.curPageList.length&&(i.focusItemIndex=0),oe();break;case"ArrowLeft":if(i.isEdit=!0,!ye){if(we<1)return;W(y.value,Ne[we-1]),J()}break;case"ArrowRight":if(i.isEdit=!0,!ye){if(we===Ne.length-1)return;W(Ne[we+1],y.value),J()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&l.isShow||e.allowCreate&&i.focusItemIndex>=0&&l.isShow?fe(c.curPageList[i.focusItemIndex],"select",H):e.allowCreate&&fe(h.value,"custom",H),H.preventDefault();break;case"Backspace":we!==0&&!h.value&&($=z.selectedTagList[we-1],X(we,$));break}},se=H=>{const $=[],te=H.split(";"),ye=/^[a-zA-Z][a-zA-Z_]*/g;return te.forEach(we=>{const Ne=we.match(ye);if(Ne){const Qe=Ne.join("");$.push({[e.saveKey]:Qe,[e.displayKey]:Qe})}}),$},Me=H=>{if(H.preventDefault(),C.value)return!1;const{maxData:$,saveKey:te,displayKey:ye,pasteFn:we,allowCreate:Ne}=e,Qe=H.clipboardData.getData("text");let Fe=(we?we(Qe):se(Qe)).map(at=>at[te]);if(Fe.length){const at=P(),St=Y(),Dt=z.localList.map(Ke=>Ke[te]);if(Fe=Fe.filter(Ke=>{const Ue=(Ke==null?void 0:Ke.trim())&&!E.value.includes(Ke);return Ne?Ue:Ue&&Dt.includes(Ke)}),$!==-1){const Ke=z.selectedTagList.length;if(Ke<$){const Ue=$-Ke;Fe.length>Ue&&(Fe=[...Fe.slice(0,Ue)])}else Fe=[]}const qe=Ne?Fe.map(Ke=>{const Ue=z.localList.find(kn=>kn[te]===Ke);return Ue!=null?Ue:{[te]:Ke,[ye]:Ke}}):z.localList.filter(Ke=>Fe.includes(Ke[te]));Fe.length&&(z.selectedTagList.splice(St,0,...qe),W(y.value,at[St]),m.value.style.width=`${za}px`,z.localList=z.localList.filter(Ke=>!Fe.includes(Ke[te])),Ce("select"),J())}},j=H=>{e.disabled||(W(y.value,H.currentTarget,!0),m.value.style.width=`${za}px`,l.isShow&&T())},B=(H,$)=>{if(z.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:te,saveKey:ye,displayKey:we,createTagValidator:Ne}=e,Qe=Y();let ut=1,Fe=!1,at;const St=qe=>typeof Ne=="function"?Ne(qe):!0,Dt=qe=>z.localList.find(Ke=>Ke[ye]===qe);if($==="custom")if(te){let qe=H.split(te);qe=qe.filter(Ue=>(Ue==null?void 0:Ue.trim())&&!E.value.includes(Ue)&&St(Ue));const Ke=qe.map(Ue=>Dt(Ue)||{[ye]:Ue,[we]:Ue});qe.length&&(z.selectedTagList.splice(Qe,0,...Ke),ut=Ke.length,Fe=!0)}else{const qe=typeof H=="object";if(at=qe?H[ye]:H.trim(),at=at.replace(/\s+/g,""),at!==void 0&&!E.value.includes(at)&&St(at)){const Ke=Dt(at)||(qe?H:{[ye]:at,[we]:at});z.selectedTagList.splice(Qe,0,Ke),Fe=!0}}else H&&(at=H[ye],at!==void 0&&!E.value.includes(at)&&(z.selectedTagList.splice(Qe,0,H),Fe=!0));Fe&&a.nextTick(()=>{for(let qe=1;qe<=ut;qe++){const Ue=P()[Qe+qe];W(Ue,y.value)}m.value.style.width=`${za}px`,C.value||(e.allowNextFocus&&J(),z.localList=z.localList.filter(qe=>!E.value.includes(qe[ye])))})},V=(H,$)=>{z.selectedTagList.splice($,1);const te=ne.value.some(ye=>ye===H[e.saveKey]);(e.allowCreate&&te||!e.allowCreate)&&!C.value&&z.localList.push(H)};return Te(U(U(U({popoverProps:l},a.toRefs(i)),a.toRefs(z)),a.toRefs(c)),{isShowPlaceholder:b,isShowClear:I,curInputValue:h,formatList:ne,renderList:_,showTagClose:k,tagInputRef:m,bkTagSelectorRef:p,tagListRef:w,tagInputItemRef:y,selectorListRef:v,popoverRef:L,triggerClass:N,focusInputTrigger:J,activeClass:ae,handleInput:Q,handleFocus:F,handleBlur:K,handleTagSelected:fe,handleTagRemove:he,handleClear:Ae,tagFocus:j,handleKeydown:Z,handlePaste:Me})},render(){return a.createVNode("div",{class:"bk-tag-input",ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Os,a.mergeProps({ref:"popoverRef",theme:"light",trigger:"manual",placement:"bottom-start","content-cls":"bk-tag-input-popover-content",arrow:!1},this.popoverProps),{default:()=>{var e,t,n;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((i,l)=>{const o={boundary:"window",theme:"light",distance:12,content:i[this.tooltipKey],disabled:!this.tooltipKey};return a.withDirectives(a.createVNode("li",{class:"tag-item",onClick:this.tagFocus},[a.createVNode(i5,{node:i,tpl:this.tagTpl,displayKey:this.displayKey},null),this.showTagClose?a.createVNode(An,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,i,l)},null):null]),[[a.resolveDirective("bk-tooltips"),o]])}),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":i=>this.curInputValue=i,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholder]),[[a.vShow,this.isShowPlaceholder]]),(n=(t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))!=null?n:this.isShowClear&&a.createVNode(cn,{class:"clear-icon",onClick:this.handleClear},null)])},content:()=>a.createVNode("div",{class:"bk-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:"bk-selector-group-item"},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:"bk-selector-group-list-item"},[e.children.map((n,i)=>a.createVNode("li",{class:["bk-selector-list-item",{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(q0,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:["bk-selector-list-item",{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(q0,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:"bk-selector-list-item loading"},[a.createVNode(wi,{theme:"primary",size:Vn.Small},null)]):null])])})])}});const eh=He(a5),r5={direction:g.commonType(["horizontal","vertical"],"direction").def("horizontal"),align:g.commonType(["left","center","right"],"align").def("center"),color:g.string.def("#dde4eb"),width:g.number.def(1),type:g.commonType(["dashed","solid"],"lineType").def("dashed")};var s5=a.defineComponent({name:"Divider",props:r5,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`};let t;return this.$slots.default&&(t=a.createVNode("div",{class:["bk-divider-info",`bk-divider-info-${this.align}`]},[this.$slots.default()])),a.createVNode("div",{class:["bk-divider",`bk-divider-${this.direction}`],style:e()},[t])}});const th=He(s5),l5={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},o5={active:g.oneOfType([g.number,g.string]).def(""),type:g.commonType(["card","border-card","unborder-card"],"type").def("border-card"),tabPosition:g.commonType(["left","right","top"],"position").def("top"),closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g.commonType(["replace","insert","top"],"sortType").def("replace"),labelHeight:g.number.def(50),scrollStep:g.number.def(200),extCls:g.string.def(""),validateActive:g.bool.def(!0),showHeader:g.bool.def(!0),changeOnHover:g.bool.def(!1),changeOnHoverDelay:g.number.def(1e3)},c5=U({active:g.oneOfType([g.number,g.string]).def(""),panels:{type:Array,default:()=>[]},tabPosition:g.commonType(["left","right","top"],"position").def("top"),closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g.commonType(["replace","insert","top"],"sortType").def("replace"),labelHeight:g.number.def(50),scrollStep:g.number.def(200),validateActive:g.bool.def(!0),changeOnHover:g.bool.def(!1),changeOnHoverDelay:g.number.def(1e3)},l5),u5={name:g.oneOfType([g.number,g.string]).def(""),label:g.string||g.func,closable:g.bool,visible:g.bool.def(!0),disabled:g.bool,sortable:g.bool,renderDirective:g.commonType(["if","show"],"render").def("show"),panel:g.string||g.func};var nh=a.defineComponent({name:"TabNav",props:c5,setup(e){const t=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const f=[];let u=!1;return e.panels.filter((h,m)=>{if(!h.props)return null;const{name:p,label:w,closable:y,visible:v,disabled:L,sortable:x}=h.props;if(!v)return!1;e.active===p&&(u=!0);const k=C=>h.slots.label?a.h(h.slots.label):[void 0,""].includes(C)?`\u9009\u9879\u5361${m+1}`:typeof C=="string"?C:typeof C=="function"?a.h(C):C;return f.push({name:p,closable:y,visible:v,disabled:L,sortable:x,tabLabel:k(w)}),!0}),!u&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),f}),n=a.ref(-1),i=a.ref(-1),l=a.ref(""),o=(f,u)=>f===u;return Te(U({},{handleTabAdd(f){e.tabAdd(f)},dragstart(f,u){i.value=f,l.value=e.guid,Object.assign(u.dataTransfer,{effectAllowed:"move"}),e.tabDrag(f,u)},dragenter(f){o(l.value,e.guid)&&(n.value=f)},dragend(){n.value=-1,i.value=-1,l.value=null},drop(f,u){if(!o(l.value,e.guid))return!1;e.tabSort(i.value,f,u)},handleTabChange(f){e.tabChange(f)},handleTabRemove(f,u){e.tabRemove(f,u)}}),{navs:t,dragenterIndex:n,dragStartIndex:i,draggingEle:l,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4)})},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:l,labelHeight:o,dragstart:c,dragenter:f,dragend:u,drop:h}=this,m=()=>this.navs.map((w,y)=>{if(!w)return null;const{name:v,disabled:L,tabLabel:x}=w,k=()=>{const b=["bk-tab-header-item"];return L&&b.push("bk-tab-header--disabled"),e===v&&b.push("bk-tab-header--active"),b.join(" ")},C=(b,I)=>b||I;return a.createVNode("div",{key:v,onClick:()=>this.handleTabChange(v),draggable:C(w.sortable,i),onDragstart:b=>c(y,b),onDragenter:b=>{b.preventDefault(),f(y)},onDragleave:b=>{b.preventDefault()},onDragover:b=>{b.preventDefault()},onDragend:b=>{b.preventDefault(),u()},onDrop:b=>{b.preventDefault(),h(y,l)},class:k()},[a.createVNode("div",null,[x]),C(w.closable,t)&&a.createVNode(cn,{class:"bk-tab-header-item-close",onClick:()=>this.handleTabRemove(y,w)},null)])}),p=()=>{var y,v;const w=[];return typeof this.$slots.add=="function"?w.push((v=(y=this.$slots).add)==null?void 0:v.call(y,a.h)):n&&w.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(xs,{width:26,height:26},null)])),w.length?a.createVNode("div",{class:"bk-tab-header-operation"},[w.map((L,x)=>a.createVNode("div",{class:"bk-tab-header-item",key:x},[L]))]):null};return a.createVNode("div",{style:{lineHeight:`${o}px`},class:"bk-tab-header"},[a.createVNode("div",{class:"bk-tab-header-nav"},[m()]),p(),typeof this.$slots.setting=="function"&&a.createVNode("div",{class:"bk-tab-header-setting"},[this.$slots.setting()])])}}),d5=a.defineComponent({name:"Tab",components:{TabNav:nh},props:o5,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),l=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:p}=h;return(p||[]).forEach(w=>{let{type:y}=w;y=y.name||y,y==="TabPanel"&&w.component?m.push(w.component):(y===a.Fragment||y==="template")&&c(w,m)}),m},f=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],p=c(m);p.length!==l.value.length&&(l.value=p)}};return a.onMounted(()=>{f(),i.value=!0}),a.onUpdated(()=>{f()}),Te(U({},{tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,p){const w=l.value;if(p==="insert")if(h<m)w.splice(m+1,0,l[h]),w.splice(h,1);else if(h>m)w.splice(m,0,l[h]),w.splice(h+1,1);else return!1;else{const y=w[m];w[m]=w[h],w[h]=y}l.value=[...w],n("sort",h,m,p),n("sort-change",h,m,p)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}}),{isMounted:i,panels:l})},render(){var n,i;const e=()=>this.tabPosition==="top"?`bk-tab bk-tab--${this.tabPosition} bk-tab--${this.type} ${this.extCls}`:`bk-tab bk-tab--${this.tabPosition} ${this.extCls}`,t=()=>{const{panels:l,active:o,type:c,closable:f,addable:u,sortable:h,sortType:m,labelHeight:p,scrollStep:w,validateActive:y,changeOnHover:v,changeOnHoverDelay:L,tabPosition:x,tabAdd:k,tabChange:C,tabRemove:b,tabSort:I,tabDrag:N}=this,T={panels:l,active:o,type:c,closable:f,addable:u,sortable:h,sortType:m,labelHeight:p,scrollStep:w,validateActive:y,changeOnHover:v,changeOnHoverDelay:L,tabPosition:x,tabAdd:k,tabChange:C,tabRemove:b,tabSort:I,tabDrag:N};return!l||!Array.isArray(l)?null:a.createVNode(nh,T,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:"bk-tab-content"},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),f5=a.defineComponent({name:"TabPanel",props:u5,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;return a.withDirectives(a.createVNode("div",{ref:"content",class:"bk-tab-panel"},[t()]),[[a.vShow,e]])}});const ih=Bt(d5,{TabPanel:f5}),xi={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let ah=1;const rh=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const l=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:f=10}=n;xi[i].forEach(w=>{c+=(w.el.offsetHeight||0)+f}),ah+=1;const u=`message_${ah}`;n=Te(U({},n),{offsetX:o,offsetY:c,id:u});const h=document.createElement("div"),m=a.createVNode(e,n);m.props.onDestroy=w=>{h5(w,i,f,l),a.render(null,h)},a.render(m,h),xi[i].push(m);let p;m.props.getContainer&&va(m.props.getContainer)?p=m.props.getContainer:p=document.body,p.appendChild(h.firstElementChild)};function h5(e,t,n,i){i==null||i();const l=t.startsWith("top")?"top":"bottom";let o=-1;xi[t].forEach((h,m)=>{h.props.id===e&&(o=m)});const f=xi[t][o].el.offsetHeight,u=xi[t].length;for(let h=o;h<u;h++){const m=parseInt(xi[t][h].el.style[l],10)-f-n;xi[t][h].component.props.offsetY=m}xi[t].splice(o,1)}const g5={id:g.string.def(""),message:g.string.def(""),theme:g.theme(["primary","warning","success","error"]).def("primary"),delay:g.number.def(3e3),dismissable:g.bool.def(!0),offsetY:g.number.def(30),spacing:g.number.def(10),extCls:g.string.def(""),onClose:g.func,getContainer:g.instanceOf(HTMLElement)};var m5=a.defineComponent({name:"Message",props:g5,emits:["destroy"],setup(e,{emit:t}){const n=a.computed(()=>["bk-message",`bk-message-${e.theme}`,`${e.extCls}`]),i=Mn.getMessageNextIndex(),l=a.computed(()=>e.getContainer&&va(e.getContainer)),o=a.computed(()=>({top:`${e.offsetY}px`,zIndex:i,position:l.value?"absolute":"fixed"})),c=a.ref(!1);let f=null;const u=()=>{f=setTimeout(()=>{c.value=!1},e.delay)},h=m=>{m.preventDefault(),m.stopPropagation(),c.value=!1};return a.onMounted(()=>{e.delay&&u(),c.value=!0}),a.onUnmounted(()=>{clearTimeout(f)}),a.watch(c,()=>{c.value||t("destroy",e.id)}),{classNames:n,styles:o,visible:c,close:h}},render(){const e=()=>({primary:a.createVNode(Ts,null,null),warning:a.createVNode(Cr,null,null),success:a.createVNode(br,null,null),error:a.createVNode(cn,null,null)})[this.theme];return a.createVNode(a.Transition,{name:"bk-message-fade"},{default:()=>[a.withDirectives(a.createVNode("div",{class:this.classNames,style:this.styles},[a.createVNode("div",{class:"bk-message-content"},[a.createVNode("div",{class:"bk-message-icon"},[e()]),this.message]),this.dismissable&&a.createVNode(An,{class:"bk-message-close",onClick:this.close},null)]),[[a.vShow,this.visible]])]})}});const sh=e=>{rh(m5,e)},lh=e=>{const t=document.createElement("div"),n=a.ref(!1),i=a.shallowRef(e),l=a.defineComponent({name:"DialogConfirm",setup(f,{expose:u}){a.onMounted(()=>{(document.activeElement||document.body).blur(),i.value.isShow!==!1&&(n.value=!0)});const h=async()=>{var y,v;typeof((y=i.value)==null?void 0:y.onClosed)=="function"&&await((v=i.value)==null?void 0:v.onClosed()),n.value=!1},m=async()=>{var y,v;typeof((y=i.value)==null?void 0:y.onConfirm)=="function"&&await((v=i.value)==null?void 0:v.onConfirm()),n.value=!1};function p(y){i.value=y}u({update:p});const w=()=>{const y=[],v=[];if(i.value.subTitle)switch(typeof i.value.subTitle){case"string":y.push(i.value.subTitle);break;case"function":y.push(i.value.subTitle());break;default:y.push(i.value.subTitle);break}return y.length&&v.push(a.h("div",{class:"bk-info-sub-title",style:`text-Align:${i.value.contentAlign||"center"}`},y)),v};return()=>a.createVNode(Ef,Te(U({class:"bk-info-wrapper",headerAlign:"center",footerAlign:"center"},i.value),{isShow:n.value,onClosed:h,onConfirm:m}),w())}}),o=a.createApp(l).mount(t);return{show:()=>{n.value=!0},hide:()=>{n.value=!1},update:f=>{o.update(f)}}},p5={id:g.string.def(""),title:g.string.def(""),message:g.string.def(""),theme:g.theme(["primary","warning","success","error"]).def("primary"),position:g.position().def("top-right"),delay:g.number.def(5e3),dismissable:g.bool.def(!0),offsetX:g.number.def(100),offsetY:g.number.def(30),spacing:g.number.def(10),extCls:g.string.def(""),onClose:g.func};var b5=a.defineComponent({name:"Notify",props:p5,emits:["destroy"],setup(e,{emit:t}){const n=Mn.getMessageNextIndex(),i=a.computed(()=>e.position.indexOf("right")>1?"right":"left"),l=a.computed(()=>e.position.startsWith("top")?"top":"bottom"),o=a.computed(()=>({[i.value]:`${e.offsetX}px`,[l.value]:`${e.offsetY}px`,zIndex:n})),c=a.computed(()=>["bk-notify",`bk-notify-${e.theme}`,i.value]),f=a.ref(!1);let u=null;const h=()=>{u=setTimeout(()=>{f.value=!1},e.delay)},m=()=>{f.value=!1};return a.onMounted(()=>{e.delay&&h(),f.value=!0}),a.onUnmounted(()=>{clearTimeout(u)}),a.watch(f,()=>{f.value||t("destroy",e.id)}),{classNames:c,styles:o,visible:f,handleClose:m}},render(){const e=()=>({primary:a.createVNode(Ts,null,null),warning:a.createVNode(Cr,null,null),success:a.createVNode(br,null,null),error:a.createVNode(cn,null,null)})[this.theme];return a.createVNode(a.Transition,{name:"bk-notify-fade"},{default:()=>[a.withDirectives(a.createVNode("div",{class:this.classNames,style:this.styles},[a.createVNode("div",{class:"bk-notify-content"},[a.createVNode("div",{class:"bk-notify-icon"},[e()]),this.title?a.createVNode("div",{class:"bk-notify-content-header"},[this.title]):"",a.createVNode("div",{class:"bk-notify-content-text"},[this.message])]),this.dismissable&&a.createVNode(An,{class:"bk-notify-icon bk-notify-close",onClick:this.handleClose},null)]),[[a.vShow,this.visible]])]})}});const oh=e=>{rh(b5,e)},ch=Symbol("MENU_PROVIDER_KEY"),Oc=Symbol("MENU_PROVIDER_KEY_PATH"),y5=e=>{a.provide(ch,e)},C5=e=>{const{parentKeys:t,parentInfo:n}=Ec(),i=a.computed(()=>[...t.value,e]);a.provide(Oc,{parentInfo:{key:e,parentKey:n==null?void 0:n.key},parentKeys:i})},uh=()=>a.inject(ch),Ec=()=>{var n;const e=a.getCurrentInstance(),t=e.parent?e.parent.provides:(n=e.vnode.appContext)==null?void 0:n.provides;return t&&Oc in t?a.inject(Oc):{parentInfo:void 0,parentKeys:a.ref([])}},Ac=function(e){return(e||"").split(" ").filter(t=>!!t.trim())};function dh(e,t){if(!e||!t)return;const n=Ac(t);let i=e.getAttribute("class")||"";if(e.classList){e.classList.remove(...n);return}n.forEach(o=>{i=i.replace(` ${o} `," ")});const l=Ac(i).join(" ");e.setAttribute("class",l)}function fh(e,t){if(!e)return;let n=e.getAttribute("class")||"";const i=Ac(n),l=(t||"").split(" ").filter(o=>!i.includes(o)&&!!o.trim());e.classList?e.classList.add(...l):(n+=` ${l.join(" ")}`,e.setAttribute("class",n))}const M5=()=>({css:!0,onBeforeEnter:e=>{fh(e,"collapse-transition"),e.dataset||(e.dataset={}),e.style.height="0px",e.style.maxHeight="0px"},onEnter:e=>{e.dataset.oldOverflow=e.style.overflow,e.scrollHeight!==0?(e.style.height=`${e.scrollHeight}px`,e.style.maxHeight=`${e.scrollHeight}px`):(e.style.height="0px",e.style.maxHeight="0px"),e.style.overflow="hidden"},onAfterEnter:e=>{e.style.height="",e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow,dh(e,"collapse-transition")},onBeforeLeave:e=>{e.dataset||(e.dataset={}),e.dataset.oldOverflow=e.style.overflow,e.style.height=`${e.scrollHeight}px`,e.style.maxHeight=`${e.scrollHeight}px`,e.style.overflow="hidden"},onLeave:e=>{e.scrollHeight!==0&&(fh(e,"collapse-transition"),e.style.transitionProperty="height",e.style.height="0px",e.style.maxHeight="0px")},onAfterLeave:e=>{dh(e,"collapse-transition"),e.style.height="",e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow}}),w5={activeKey:String,collapse:Boolean,openedKeys:{type:Array},mode:{type:String,default:"vertical"},uniqueOpen:{type:Boolean,default:!0}};var v5=a.defineComponent({name:"Menu",props:w5,emits:["update:activeKey","update:openKeys","click","openChange"],setup(e,{slots:t,emit:n,expose:i}){const l=a.ref(""),o=a.ref([]),c=a.ref({}),f=a.computed(()=>e.mode),u=a.ref(e.collapse),h=a.ref([]);a.watchEffect(()=>{e.activeKey!==void 0&&(l.value=e.activeKey)}),a.watch(()=>e.collapse,()=>{u.value=e.collapse,console.info(e.collapse);const v=[...h.value],L=[...o.value];o.value=u.value?[]:v,h.value=u.value?L:[]},{immediate:!0}),a.watch(()=>e.openedKeys,(v=o.value)=>{o.value=v},{immediate:!0});const m=(v,L)=>{c.value=Te(U({},c.value),{[v]:L})},p=v=>{delete c.value[v],c.value=U({},c.value)},w=(v,L)=>{L?e.uniqueOpen?o.value=[v]:o.value.push(v):o.value=o.value.filter(x=>x!==v),n("openChange",L,c.value[v]),n("update:openKeys",[...o.value])},y=v=>{l.value=v,n("click",c.value[v]),n("update:activeKey",v,c.value[v])};return y5({activeKey:l,menuStore:c,registerMenuInfo:m,unregisterMenuInfo:p,mode:f.value,openedKeys:o,collapse:u,handleOpenChange:w,handleActiveChange:y}),i({activeKey:l,openedKeys:o,menuStore:c}),()=>{var v;return a.createVNode("div",{class:{"bk-menu":!0,"is-collapse":u.value}},[(v=t.default)==null?void 0:v.call(t)])}}}),I5=a.defineComponent({name:"MenuGroup",props:{name:{type:String,default:""}},setup(e,{slots:t}){return()=>{var n;return a.createVNode("div",{class:"bk-menu-group"},[a.createVNode("div",{class:"group-name"},[e.name]),a.createVNode("ul",{class:"group-wrap"},[(n=t.default)==null?void 0:n.call(t)])])}}}),N5=a.defineComponent({name:"MenuItem",props:{needIcon:{type:Boolean,default:!0}},emits:["click"],slots:["icon"],setup(e,{slots:t,emit:n}){var y,v;const{registerMenuInfo:i,unregisterMenuInfo:l,activeKey:o,handleActiveChange:c}=uh(),f=a.getCurrentInstance(),{parentInfo:u}=Ec(),h=((v=(y=f.vnode.key)==null?void 0:y.toString)==null?void 0:v.call(y))||String(f.uid),m=a.computed(()=>o.value===h),p=a.computed(()=>e.needIcon);i(h,{key:h,parentKey:u==null?void 0:u.key});const w=L=>{c(h),n("click",L)};return a.onBeforeUnmount(()=>l(h)),()=>{var L,x;return a.createVNode("li",{class:{"bk-menu-item":!0,"is-active":m.value},onClick:w},[p.value&&a.createVNode("span",{class:"item-icon"},[((L=t==null?void 0:t.icon)==null?void 0:L.call(t))||a.createVNode("i",{class:"default-icon"},null)]),a.createVNode("span",{class:"item-content"},[(x=t.default)==null?void 0:x.call(t)])])}}});const L5={title:{type:String,default:"title"}};var k5=a.defineComponent({name:"Submenu",props:L5,emits:["collapse"],slots:["icon"],setup(e,{slots:t,emit:n}){var k,C;const{registerMenuInfo:i,unregisterMenuInfo:l,openedKeys:o,handleOpenChange:c,collapse:f,activeKey:u,menuStore:h}=uh(),{parentInfo:m}=Ec(),p=a.getCurrentInstance(),w=((C=(k=p.vnode.key)==null?void 0:k.toString)==null?void 0:C.call(k))||String(p.uid),y=a.ref(M5()),v=a.computed(()=>o.value.includes(w)),L=a.computed(()=>{var I,N;const b=(N=(I=h.value)==null?void 0:I[u.value])==null?void 0:N.parentKey;return f.value&&b===w&&v});C5(w),i(w,{key:w,parentKey:m==null?void 0:m.key}),a.onBeforeUnmount(()=>l(w));const x=()=>{c(w,!v.value),n("collapse",!v.value,p)};return()=>{var b;return a.createVNode("li",{class:{"bk-menu-submenu":!0,"is-opened":v.value}},[a.createVNode("div",{class:{"submenu-header":!0,"is-collapse":L.value},onClick:x},[a.createVNode("span",{class:"submenu-header-icon"},[((b=t.icon)==null?void 0:b.call(t))||a.createVNode(Yo,{class:"menu-icon"},null)]),a.createVNode("span",{class:"submenu-header-content"},[e.title]),a.createVNode(Ms,{class:{"submenu-header-collapse":!0,"is-collapse":o.value.includes(w)}},null)]),a.createVNode(a.Transition,y.value,{default:()=>{var I;return[a.withDirectives(a.createVNode("ul",{class:"submenu-list"},[(I=t.default)==null?void 0:I.call(t)]),[[a.vShow,v.value]])]}})])}}});const hh=Bt(v5,{Item:N5,Submenu:k5,Group:I5}),T5={sideTitle:{type:String,default:""},navigationType:{type:String,default:"left-right"}};var gh=a.defineComponent({props:T5,slots:["side-icon"],setup(e,{slots:t}){return()=>{var n,i;return a.createVNode("div",{class:"bk-navigation-title",style:{borderBottomWidth:e.navigationType==="left-right"?"0":"1px"}},[((n=t.default)==null?void 0:n.call(t))||[a.createVNode("span",{class:"title-icon"},[((i=t["side-icon"])==null?void 0:i.call(t))||a.createVNode("i",{class:"bk-icon icon-rtx"},null)]),a.createVNode("span",{class:"title-desc"},[e.sideTitle])]])}}});const x5={navWidth:{type:[Number,String],default:60},hoverWidth:{type:[Number,String],default:260},showSideNavTitle:{type:Boolean,default:!0},sideTitle:{type:String,default:""},headerTitle:{type:String,default:""},hoverLeaveDelay:{type:Number,default:0},hoverEnterDelay:{type:Number,default:100},defaultOpen:Boolean,headHeight:{type:[Number,String],default:52},navigationType:{type:String,default:"left-right",validator(e){return["top-bottom","left-right"].includes(e)}},needMenu:{type:Boolean,default:!0}};var S5=a.defineComponent({name:"Navigation",props:x5,emits:["leave","toggle","hover","toggle-click"],slots:["header","menu","footer","side-icon","side-header"],setup(e,{emit:t}){const n=a.ref(e.headerTitle),i=a.reactive({click:!1,hover:!1,delay:!1,timer:null,enterTimer:null});e.defaultOpen&&(i.click=!i.click,i.hover=i.click,t("toggle",i.hover)),a.onBeforeUnmount(()=>{i.timer&&window.clearTimeout(i.timer)});const l=()=>{i.click||(i.enterTimer=setTimeout(()=>{i.hover=!0,i.enterTimer&&window.clearTimeout(i.enterTimer),i.timer&&window.clearTimeout(i.timer),t("hover",i.hover),t("toggle",i.hover)},e.hoverEnterDelay))},o=()=>{i.click||(i.enterTimer&&window.clearTimeout(i.enterTimer),i.timer=setTimeout(()=>{i.hover=!1,window.clearTimeout(i.timer),t("leave",i.hover),t("toggle",i.hover)},e.hoverLeaveDelay))},c=()=>{i.click=!i.click,i.hover=i.click,t("toggle",i.hover),t("toggle-click",i.hover)};return{defaultHeaderTitle:n,nav:i,onBeforeUnmount:a.onBeforeUnmount,handleMouseOver:l,handleMouseLeave:o,handleClick:c}},render(){var e,t,n,i,l,o,c,f,u,h,m,p;return a.createVNode("div",{class:"bk-navigation"},[this.navigationType==="top-bottom"&&a.createVNode("div",{class:"bk-navigation-header",style:{flexBasis:`${this.headHeight}px`}},[a.createVNode(gh,{sideTitle:this.sideTitle},{default:this.$slots["side-header"],"side-icon":this.$slots["side-header"]?void 0:this.$slots["side-icon"]}),a.createVNode("div",{class:"header-right"},[(t=(e=this.$slots).header)==null?void 0:t.call(e)])]),a.createVNode("div",{class:"bk-navigation-wrapper"},[this.needMenu&&a.createVNode("div",{class:"navigation-nav",style:{width:this.nav.click?`${this.hoverWidth}px`:`${this.navWidth}px`}},[a.createVNode("div",{class:"nav-slider",onMouseenter:this.handleMouseOver,onMouseleave:this.handleMouseLeave,style:{width:this.nav.hover?`${this.hoverWidth}px`:`${this.navWidth}px`,borderRight:this.navigationType!=="top-bottom"?"none":"1px solid #DCDEE5"}},[this.navigationType!=="top-bottom"&&this.showSideNavTitle&&a.createVNode(gh,{style:{flexBasis:`${this.headHeight}px`},sideTitle:this.sideTitle},{default:this.$slots["side-header"],"side-icon":this.$slots["side-header"]?void 0:this.$slots["side-icon"]}),a.createVNode("div",{class:"nav-slider-list",style:{height:`calc(100vh - ${+this.headHeight+56}px)`}},[(i=(n=this.$slots).menu)==null?void 0:i.call(n)]),a.createVNode("div",{class:"nav-slider-footer"},[a.createVNode("div",{class:{"is-left":this.navigationType!=="top-bottom","footer-icon":!0},onClick:this.handleClick},[a.createVNode(Ao,{class:"footer-icon-svg",style:{transform:this.nav.click?"rotate(180deg)":"rotate(0deg)"}},null)])])])]),a.createVNode("div",{class:"navigation-container",style:{maxWidth:this.needMenu?"calc(100vw - 60px)":"100vw"}},[this.navigationType!=="top-bottom"&&a.createVNode("div",{class:"container-header",style:{flexBasis:`${this.headHeight}px`}},[((o=(l=this.$slots).header)==null?void 0:o.call(l))||[a.createVNode("div",{class:"container-header-title"},[this.headerTitle]),a.createVNode("div",{class:"container-header-sets"},[(f=(c=this.$slots)["header-set"])==null?void 0:f.call(c)])]]),a.createVNode("div",{class:"container-content",style:{maxHeight:`calc(100vh - ${this.headHeight}px)`}},[(h=(u=this.$slots).default)==null?void 0:h.call(u),a.createVNode("div",{class:"container-footer"},[(p=(m=this.$slots).footer)==null?void 0:p.call(m)])])])])])}});const mh=He(S5),D5={placement:{type:String,default:"bottom-start",validator:e=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0?(console.error(`placement property is not valid: '${e}'`),!1):!0},className:{type:String},extPopoverCls:{type:String},appendToBody:{type:Boolean},triggerRef:{type:Object},onClick:Function};var Vc=a.defineComponent({props:D5,emits:["changeVisible"],setup(e,{emit:t}){let n=Object.create(null);const i=a.ref(null);a.onMounted(()=>{o()}),a.onBeforeUnmount(()=>{l()});const l=()=>{if(n&&Object.keys(n).length!==0){const u=n;u.isShow&&u.hide(),u.destroy(),n=null,t("changeVisible",!1)}},o=()=>{n&&Object.keys(n).length!==0?a.nextTick(()=>{n.update()}):a.nextTick(()=>{n=new af(e.triggerRef,i.value,{placement:e.placement,trigger:"manual",modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},{name:"offset",options:{offset:[0,4]}}]})})},c=a.computed(()=>{const u={};return e.appendToBody&&(u["z-index"]=1060+Mn.getModalNextIndex()),u}),f=a.reactive({styles:c});return Te(U({},a.toRefs(f)),{refContentRef:i,updateDropdown:o,destoryDropdown:l})},render(){var e,t,n;return a.createVNode("div",{ref:"refContentRef",class:["bk-date-picker-dropdown",this.className,this.extPopoverCls],style:this.styles,onClick:this.onClick},[(n=(t=(e=this.$slots).default)==null?void 0:t.call(e))!=null?n:""])}});const j5={showTime:{type:Boolean,required:!0},isTime:{type:Boolean,default:!1},timeDisabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0}};var z5=a.defineComponent({props:j5,emits:["pick-clear","pick-success","pick-toggle-time"],setup(e,{emit:t}){const n=a.computed(()=>({time:e.isTime?"\u9009\u62E9\u65E5\u671F":"\u9009\u62E9\u65F6\u95F4",clear:"\u6E05\u9664",ok:"\u786E\u5B9A"})),i=()=>{t("pick-clear")},l=()=>{t("pick-success")},o=()=>{e.timeDisabled||t("pick-toggle-time")},c=a.ref(null);return{labels:n,handleClear:i,handleSuccess:l,handleToggleTime:o,handleTab:u=>{const m=[...c.value.children][u.shiftKey?"shift":"pop"]();document.activeElement===m&&(u.preventDefault(),u.stopPropagation())}}},render(){return a.createVNode("div",{class:"bk-picker-confirm",ref:"elRef",onKeydown:this.handleTab},[this.showTime?a.createVNode("a",{href:"javascript: void(0);",class:"bk-picker-confirm-time",onClick:this.handleToggleTime},[this.labels.time]):"",this.clearable?a.createVNode("a",{href:"javascript: void(0);",onClick:this.handleClear,onKeydown:this.handleClear},[this.labels.clear]):"",a.createVNode("a",{href:"javascript: void(0);",class:"confirm",onClick:this.handleSuccess,onKeydown_enter:this.handleSuccess},[this.labels.ok])])}}),ph=1e3*60*60*24;function bh(e,t){return new Date(e,t+1,0).getDate()}function yh(e,t,n){return t===0&&n>50?e-1:t===11&&n<10?e+1:e}function Ch(e,t,n,i){t>11&&(t=0,e++);var l=new Date(e,t,n);i&&l.setDate(l.getDate()+4-(l.getDay()||7));var o=i?l.getFullYear():e,c=new Date(o,0,1),f=1+Math.round((l-c)/ph);i||(f+=c.getDay());var u=Math.ceil(f/7);if(!i){var h=new Date(e,t,n),m=new Date(e+1,0,1),p=m.getDay();h.getTime()>=m.getTime()-ph*p&&(u=1)}return u}function P5(e,t,n){for(var i=this.lang||"en",l=this.onlyDays,o=typeof this.weekStart=="undefined"?1:this.weekStart,c=o===1,f=[],u=new Date(e,t,1),h=u.getDay()||(c?7:0),m=o-h,p=Ch(e,t,1,c),w=bh(e,t),y=bh(e,t-1),v,L,x,k=yh(e,t,p),C={month:t,year:e,daysInMonth:w},b=0;b<7;b++){x=m;for(var I=0;I<8;I++){b>0&&I>0&&m++,m>w||m<1?(L=m>w?m-w:y+m,v=m>w?t+1:t-1):(L=m,v=t);var N=function(){return I===0?"weekLabel":b===0?"dayLabel":m<1?"prevMonth":m>w?"nextMonth":"monthDay"}(),T=x!==m&&b>0,A={desc:T?L:p,week:p,type:N,format:c?"ISO 8601":"US",date:T?new Date(Date.UTC(e,v,L)):!1,year:k,index:f.length};n&&(typeof n=="function"?A=n.call(C,A,i):n.forEach(function(P){A=P.call(C,A,i)})),l&&T?f.push(A):l||f.push(A)}b>0&&(p=Ch(e,v,L+1,c)),k=yh(e,t,p)}return C.cells=f,C}var O5=function(e){return P5.bind(e)},E5={weekPlaceholder:"",columnNames:{en:{0:"w",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday",7:"sunday"},sv:{0:"v",1:"m\xE5ndag",2:"tisdag",3:"onsdag",4:"torsdag",5:"fredag",6:"l\xF6rdag",7:"s\xF6ndag"},pt:{0:"s",1:"segunda",2:"ter\xE7a",3:"quarta",4:"quinta",5:"sexta",6:"s\xE1bado",7:"domingo"}},monthNames:{en:["January","February","March","April","May","June","July","August","September","October","November","December"],sv:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],pt:["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},classes:{dayLabel:"day-of-week",weekLabel:"week-number",prevMonth:"inactive",nextMonth:"inactive",monthDay:"day-in-month"}},Qn=E5;function A5(e){return e==null?!1:e.constructor===Array||e.constructor===Object}function Mh(e,t){for(var n in e)t[n]?A5(e[n])&&Mh(e[n],t[n]):t[n]=e[n]}function wh(e,t){var n=[Qn.classes[e.type]];return e.class?e.class=(typeof e.class=="string"?[e.class]:e.class).concat(n):e.class=n,e.type.indexOf("Label")>0&&(e.index==0&&Qn.weekPlaceholder?e.desc=Qn.weekPlaceholder:e.index<8?e.desc=Qn.columnNames[t][e.index]:e.index%8==0&&(e.desc=e.week)),e.date&&(e.monthName=Qn.monthNames[t][e.date.getMonth()]),this.monthName||(this.monthName=Qn.monthNames[t][this.month]),this.labels||(this.labels={monthNames:Qn.monthNames[t],columnNames:Qn.columnNames[t],classes:Qn.classes}),e}wh.setLabels=function(e){Mh(e,Qn)};var V5=wh,J5={Generator:O5,addLabels:V5};function un(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ot(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Nn(e){Ot(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function Q5(e,t){Ot(2,arguments);var n=Nn(e).getTime(),i=un(t);return new Date(n+i)}function R5(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function W5(e){return Ot(1,arguments),e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function H5(e){if(Ot(1,arguments),!W5(e)&&typeof e!="number")return!1;var t=Nn(e);return!isNaN(Number(t))}var B5={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},_5=function(e,t,n){var i,l=B5[e];return typeof l=="string"?i=l:t===1?i=l.one:i=l.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},Z5=_5;function Jc(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,i=e.formats[n]||e.formats[e.defaultWidth];return i}}var G5={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},F5={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Y5={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U5={date:Jc({formats:G5,defaultWidth:"full"}),time:Jc({formats:F5,defaultWidth:"full"}),dateTime:Jc({formats:Y5,defaultWidth:"full"})},$5=U5,X5={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},K5=function(e,t,n,i){return X5[e]},q5=K5;function jr(e){return function(t,n){var i=n||{},l=i.context?String(i.context):"standalone",o;if(l==="formatting"&&e.formattingValues){var c=e.defaultFormattingWidth||e.defaultWidth,f=i.width?String(i.width):c;o=e.formattingValues[f]||e.formattingValues[c]}else{var u=e.defaultWidth,h=i.width?String(i.width):e.defaultWidth;o=e.values[h]||e.values[u]}var m=e.argumentCallback?e.argumentCallback(t):t;return o[m]}}var eb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ib={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ab={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sb=function(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},lb={ordinalNumber:sb,era:jr({values:eb,defaultWidth:"wide"}),quarter:jr({values:tb,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:jr({values:nb,defaultWidth:"wide"}),day:jr({values:ib,defaultWidth:"wide"}),dayPeriod:jr({values:ab,defaultWidth:"wide",formattingValues:rb,defaultFormattingWidth:"wide"})},ob=lb;function zr(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,l=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(l);if(!o)return null;var c=o[0],f=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(f)?ub(f,function(p){return p.test(c)}):cb(f,function(p){return p.test(c)}),h;h=e.valueCallback?e.valueCallback(u):u,h=n.valueCallback?n.valueCallback(h):h;var m=t.slice(c.length);return{value:h,rest:m}}}function cb(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function ub(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function db(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(e.matchPattern);if(!i)return null;var l=i[0],o=t.match(e.parsePattern);if(!o)return null;var c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;var f=t.slice(l.length);return{value:c,rest:f}}}var fb=/^(\d+)(th|st|nd|rd)?/i,hb=/\d+/i,gb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},mb={any:[/^b/i,/^(a|c)/i]},pb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bb={any:[/1/i,/2/i,/3/i,/4/i]},yb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Cb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Mb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},wb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ib={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nb={ordinalNumber:db({matchPattern:fb,parsePattern:hb,valueCallback:function(e){return parseInt(e,10)}}),era:zr({matchPatterns:gb,defaultMatchWidth:"wide",parsePatterns:mb,defaultParseWidth:"any"}),quarter:zr({matchPatterns:pb,defaultMatchWidth:"wide",parsePatterns:bb,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:zr({matchPatterns:yb,defaultMatchWidth:"wide",parsePatterns:Cb,defaultParseWidth:"any"}),day:zr({matchPatterns:Mb,defaultMatchWidth:"wide",parsePatterns:wb,defaultParseWidth:"any"}),dayPeriod:zr({matchPatterns:vb,defaultMatchWidth:"any",parsePatterns:Ib,defaultParseWidth:"any"})},Lb=Nb,kb={code:"en-US",formatDistance:Z5,formatLong:$5,formatRelative:q5,localize:ob,match:Lb,options:{weekStartsOn:0,firstWeekContainsDate:1}},Tb=kb;function xb(e,t){Ot(2,arguments);var n=un(t);return Q5(e,-n)}var Sb=864e5;function Db(e){Ot(1,arguments);var t=Nn(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),l=n-i;return Math.floor(l/Sb)+1}function qs(e){Ot(1,arguments);var t=1,n=Nn(e),i=n.getUTCDay(),l=(i<t?7:0)+i-t;return n.setUTCDate(n.getUTCDate()-l),n.setUTCHours(0,0,0,0),n}function vh(e){Ot(1,arguments);var t=Nn(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var l=qs(i),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var c=qs(o);return t.getTime()>=l.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function jb(e){Ot(1,arguments);var t=vh(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var i=qs(n);return i}var zb=6048e5;function Pb(e){Ot(1,arguments);var t=Nn(e),n=qs(t).getTime()-jb(t).getTime();return Math.round(n/zb)+1}function el(e,t){Ot(1,arguments);var n=t||{},i=n.locale,l=i&&i.options&&i.options.weekStartsOn,o=l==null?0:un(l),c=n.weekStartsOn==null?o:un(n.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Nn(e),u=f.getUTCDay(),h=(u<c?7:0)+u-c;return f.setUTCDate(f.getUTCDate()-h),f.setUTCHours(0,0,0,0),f}function Ih(e,t){Ot(1,arguments);var n=Nn(e),i=n.getUTCFullYear(),l=t||{},o=l.locale,c=o&&o.options&&o.options.firstWeekContainsDate,f=c==null?1:un(c),u=l.firstWeekContainsDate==null?f:un(l.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(i+1,0,u),h.setUTCHours(0,0,0,0);var m=el(h,t),p=new Date(0);p.setUTCFullYear(i,0,u),p.setUTCHours(0,0,0,0);var w=el(p,t);return n.getTime()>=m.getTime()?i+1:n.getTime()>=w.getTime()?i:i-1}function Ob(e,t){Ot(1,arguments);var n=t||{},i=n.locale,l=i&&i.options&&i.options.firstWeekContainsDate,o=l==null?1:un(l),c=n.firstWeekContainsDate==null?o:un(n.firstWeekContainsDate),f=Ih(e,t),u=new Date(0);u.setUTCFullYear(f,0,c),u.setUTCHours(0,0,0,0);var h=el(u,t);return h}var Eb=6048e5;function Ab(e,t){Ot(1,arguments);var n=Nn(e),i=el(n,t).getTime()-Ob(n,t).getTime();return Math.round(i/Eb)+1}function nt(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}var Vb={y:function(e,t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return nt(t==="yy"?i%100:i,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):nt(n+1,2)},d:function(e,t){return nt(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return nt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return nt(e.getUTCHours(),t.length)},m:function(e,t){return nt(e.getUTCMinutes(),t.length)},s:function(e,t){return nt(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,i=e.getUTCMilliseconds(),l=Math.floor(i*Math.pow(10,n-3));return nt(l,t.length)}},Si=Vb,Pa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Jb={G:function(e,t,n){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var i=e.getUTCFullYear(),l=i>0?i:1-i;return n.ordinalNumber(l,{unit:"year"})}return Si.y(e,t)},Y:function(e,t,n,i){var l=Ih(e,i),o=l>0?l:1-l;if(t==="YY"){var c=o%100;return nt(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):nt(o,t.length)},R:function(e,t){var n=vh(e);return nt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return nt(n,t.length)},Q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return nt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return nt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Si.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return nt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var l=Ab(e,i);return t==="wo"?n.ordinalNumber(l,{unit:"week"}):nt(l,t.length)},I:function(e,t,n){var i=Pb(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):nt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Si.d(e,t)},D:function(e,t,n){var i=Db(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):nt(i,t.length)},E:function(e,t,n){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var l=e.getUTCDay(),o=(l-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return nt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var l=e.getUTCDay(),o=(l-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return nt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getUTCDay(),l=i===0?7:i;switch(t){case"i":return String(l);case"ii":return nt(l,t.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getUTCHours(),l=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i=e.getUTCHours(),l;switch(i===12?l=Pa.noon:i===0?l=Pa.midnight:l=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i=e.getUTCHours(),l;switch(i>=17?l=Pa.evening:i>=12?l=Pa.afternoon:i>=4?l=Pa.morning:l=Pa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Si.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Si.H(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):nt(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):nt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Si.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Si.s(e,t)},S:function(e,t){return Si.S(e,t)},X:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return Lh(o);case"XXXX":case"XX":return ea(o);case"XXXXX":case"XXX":default:return ea(o,":")}},x:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();switch(t){case"x":return Lh(o);case"xxxx":case"xx":return ea(o);case"xxxxx":case"xxx":default:return ea(o,":")}},O:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nh(o,":");case"OOOO":default:return"GMT"+ea(o,":")}},z:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nh(o,":");case"zzzz":default:return"GMT"+ea(o,":")}},t:function(e,t,n,i){var l=i._originalDate||e,o=Math.floor(l.getTime()/1e3);return nt(o,t.length)},T:function(e,t,n,i){var l=i._originalDate||e,o=l.getTime();return nt(o,t.length)}};function Nh(e,t){var n=e>0?"-":"+",i=Math.abs(e),l=Math.floor(i/60),o=i%60;if(o===0)return n+String(l);var c=t||"";return n+String(l)+c+nt(o,2)}function Lh(e,t){if(e%60===0){var n=e>0?"-":"+";return n+nt(Math.abs(e)/60,2)}return ea(e,t)}function ea(e,t){var n=t||"",i=e>0?"-":"+",l=Math.abs(e),o=nt(Math.floor(l/60),2),c=nt(l%60,2);return i+o+n+c}var Qb=Jb;function kh(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Th(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}function Rb(e,t){var n=e.match(/(P+)(p+)?/)||[],i=n[1],l=n[2];if(!l)return kh(e,t);var o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",kh(i,t)).replace("{{time}}",Th(l,t))}var Wb={p:Th,P:Rb},Hb=Wb,Bb=["D","DD"],_b=["YY","YYYY"];function Zb(e){return Bb.indexOf(e)!==-1}function Gb(e){return _b.indexOf(e)!==-1}function xh(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Fb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ub=/^'([^]*?)'?$/,$b=/''/g,Xb=/[a-zA-Z]/;function Kb(e,t,n){Ot(2,arguments);var i=String(t),l=n||{},o=l.locale||Tb,c=o.options&&o.options.firstWeekContainsDate,f=c==null?1:un(c),u=l.firstWeekContainsDate==null?f:un(l.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=o.options&&o.options.weekStartsOn,m=h==null?0:un(h),p=l.weekStartsOn==null?m:un(l.weekStartsOn);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var w=Nn(e);if(!H5(w))throw new RangeError("Invalid time value");var y=R5(w),v=xb(w,y),L={firstWeekContainsDate:u,weekStartsOn:p,locale:o,_originalDate:w},x=i.match(Yb).map(function(k){var C=k[0];if(C==="p"||C==="P"){var b=Hb[C];return b(k,o.formatLong,L)}return k}).join("").match(Fb).map(function(k){if(k==="''")return"'";var C=k[0];if(C==="'")return qb(k);var b=Qb[C];if(b)return!l.useAdditionalWeekYearTokens&&Gb(k)&&xh(k,t,e),!l.useAdditionalDayOfYearTokens&&Zb(k)&&xh(k,t,e),b(v,k,o.localize,L);if(C.match(Xb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return k}).join("");return x}function qb(e){return e.match(Ub)[1].replace($b,"'")}const Nt={},Sh=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ta=/\d\d?/,ey=/\d{3}/,ty=/\d{4}/,tl=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Dh=function(){};function jh(e,t){const n=[];for(let i=0,l=e.length;i<l;i++)n.push(e[i].substr(0,t));return n}function zh(e){return(t,n,i)=>{const l=i[e].indexOf(n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());~l&&(t.month=l)}}function Rn(e,t=2){let n=String(e);for(;n.length<t;)n=`0${n}`;return n}const Ph=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oh=["January","February","March","April","May","June","July","August","September","October","November","December"],ny=jh(Oh,3),iy=jh(Ph,3);Nt.i18n={dayNamesShort:iy,dayNames:Ph,monthNamesShort:ny,monthNames:Oh,amPm:["am","pm"],DoFn(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10)*e%10]}};const Eh={D(e){return e.getDay()},DD(e){return Rn(e.getDay())},Do(e,t){return t.DoFn(e.getDate())},d(e){return e.getDate()},dd(e){return Rn(e.getDate())},ddd(e,t){return t.dayNamesShort[e.getDay()]},dddd(e,t){return t.dayNames[e.getDay()]},M(e){return e.getMonth()+1},MM(e){return Rn(e.getMonth()+1)},MMM(e,t){return t.monthNamesShort[e.getMonth()]},MMMM(e,t){return t.monthNames[e.getMonth()]},yy(e){return String(e.getFullYear()).substr(2)},yyyy(e){return e.getFullYear()},h(e){return e.getHours()%12||12},hh(e){return Rn(e.getHours()%12||12)},H(e){return e.getHours()},HH(e){return Rn(e.getHours())},m(e){return e.getMinutes()},mm(e){return Rn(e.getMinutes())},s(e){return e.getSeconds()},ss(e){return Rn(e.getSeconds())},S(e){return Math.round(e.getMilliseconds()/100)},SS(e){return Rn(Math.round(e.getMilliseconds()/10),2)},SSS(e){return Rn(e.getMilliseconds(),3)},a(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ(e){const t=e.getTimezoneOffset();return(t>0?"-":"+")+Rn(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)}},ft={d:[ta,(e,t)=>{e.day=t}],M:[ta,(e,t)=>{e.month=t-1}],yy:[ta,(e,t)=>{const i=+`${new Date().getFullYear()}`.substr(0,2);e.year=`${t>68?i-1:i}${t}`}],h:[ta,(e,t)=>{e.hour=t}],m:[ta,(e,t)=>{e.minute=t}],s:[ta,(e,t)=>{e.second=t}],yyyy:[ty,(e,t)=>{e.year=t}],S:[/\d/,(e,t)=>{e.millisecond=t*100}],SS:[/\d{2}/,(e,t)=>{e.millisecond=t*10}],SSS:[ey,(e,t)=>{e.millisecond=t}],D:[ta,Dh],ddd:[tl,Dh],MMM:[tl,zh("monthNamesShort")],MMMM:[tl,zh("monthNames")],a:[tl,(e,t,n)=>{const i=t.toLowerCase();i===n.amPm[0]?e.isPm=!1:i===n.amPm[1]&&(e.isPm=!0)}],ZZ:[/[\\+\\-]\d\d:?\d\d/,(e,t)=>{const n=`${t}`.match(/([\\+\\-]|\d\d)/gi);let i;n&&(i=+(n[1]*60)+parseInt(n[2],10),e.timezoneOffset=n[0]==="+"?i:-i)}]};ft.DD=ft.D,ft.dddd=ft.ddd,ft.Do=ft.dd=ft.d,ft.mm=ft.m,ft.hh=ft.H=ft.HH=ft.h,ft.MM=ft.M,ft.ss=ft.s,ft.A=ft.a,Nt.masks={default:"ddd MMM dd yyyy HH:mm:ss",shortDate:"M/D/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Nt.format=(e,t,n)=>{const i=n||Nt.i18n;if(typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");return t=Nt.masks[t]||t||Nt.masks.default,t.replace(Sh,l=>l in Eh?Eh[l](e,i):l.slice(1,l.length-1))},Nt.parse=(e,t,n)=>{const i=n||Nt.i18n;if(typeof t!="string")throw new Error("Invalid format in fecha.parse");if(t=Nt.masks[t]||t,e.length>1e3)return!1;let l=!0;const o={};if(t.replace(Sh,u=>{if(ft[u]){const h=ft[u],m=e.search(h[0]);~m?e.replace(h[0],p=>(h[1](o,p,i),e=e.substr(m+p.length),p)):l=!1}return ft[u]?"":u.slice(1,u.length-1)}),!l)return!1;const c=new Date;o.isPm===!0&&o.hour!==null&&+o.hour!=12?o.hour=+o.hour+12:o.isPm===!1&&+o.hour==12&&(o.hour=0);let f;return o.timezoneOffset!==null&&o.timezoneOffset!==void 0?(o.minute=+(o.minute||0)-+o.timezoneOffset,f=new Date(Date.UTC(o.year||c.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0))):f=new Date(o.year||c.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0),f};const Qc=" - ",ri=(e,t)=>{const n=Nn(new Date(e));return!n||isNaN(n.getTime())?"":Kb(n,t||"yyyy-MM-dd")},Rc=(e,t)=>{if(Array.isArray(e)&&e.length===2){const n=e[0],i=e[1];if(n&&i)return ri(n,t)+Qc+ri(i,t)}else if(!Array.isArray(e)&&e instanceof Date)return ri(e,t);return""},Wc=(e,t)=>{const n=Array.isArray(e)?e:e.split(Qc);if(n.length===2){const i=n[0],l=n[1];return[i instanceof Date?i:Nt.parse(i,t||"yyyy-MM-dd"),l instanceof Date?l:Nt.parse(l,t||"yyyy-MM-dd")]}return[]},Oa={default:{formatter(e){return e?`${e}`:""},parser(e){return e===void 0||e===""?null:e}},date:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},datetime:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},daterange:{formatter:Rc,parser:Wc},datetimerange:{formatter:Rc,parser:Wc},timerange:{formatter:Rc,parser:Wc},time:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},month:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},year:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},multiple:{formatter(e,t){return e.filter(Boolean).map(n=>ri(n,t)).join(",")},parser(e,t){return(typeof e=="string"?e.split(","):e).map(i=>{if(i instanceof Date)return i;let l=i;return typeof i=="string"?l=i.trim():typeof i!="number"&&!i&&(l=""),Nt.parse(l,t||"yyyy-MM-dd")})}},number:{formatter(e){return e?`${e}`:""},parser(e){const t=Number(e);return isNaN(e)?null:t}}},Hc=()=>{const e=new Date;return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e},Ah=e=>e.every(t=>!t||typeof t=="string"&&t.trim()===""),nl=e=>e?[e.getHours(),e.getMinutes(),e.getSeconds()]:[0,0,0],Vh={date:"yyyy-MM-dd",month:"yyyy-MM",year:"yyyy",datetime:"yyyy-MM-dd HH:mm:ss",time:"HH:mm:ss",timerange:"HH:mm:ss",daterange:"yyyy-MM-dd",datetimerange:"yyyy-MM-dd HH:mm:ss"},Di=(e,t,n,i)=>{const l=t.includes("range"),{parser:o}=Oa[t]||Oa.default,c=i||Vh[t],f=Oa.multiple.parser;let u=e;if(e&&t==="time"&&!(e instanceof Date))u=o(e,c);else if(n&&e)u=f(e,c);else if(l)if(!e)u=[null,null];else if(typeof e=="string")u=o(e,c);else if(t==="timerange")u=o(e,c).map(h=>h||"");else{const[h,m]=e;h instanceof Date&&m instanceof Date?u=e.map(p=>new Date(p)):typeof h=="string"&&typeof m=="string"?u=o(e.join(Qc),c):(!h||!m)&&(u=[null,null])}else typeof e=="string"&&t.indexOf("time")!==0&&(u=o(e,c)||null);return l||n?u||[]:[u]},Wn=(e,t,n,i)=>{const l=Vh[t];if(n){const{formatter:c}=Oa.multiple;return c(e,i||l)}const{formatter:o}=Oa[t]||Oa.default;return o(e,i||l)},Jh=Symbol("date-picker"),Qh=Symbol("time-picker");function Rh(e,t){return e.$children.reduce((n,i)=>{i.$options.name===t&&n.push(i);const l=Rh(i,t);return n.concat(l)},[])}function dn(e,t=""){return["bk-picker-panel-icon-btn",`bk-date-picker-${e}-btn`,`bk-date-picker-${e}-btn-arrow${t}`]}const ay=(e,t)=>new Date(e,t+1,0).getDate(),Wh=(e,t)=>{const n=new Date(e),i=n.getMonth()+t,l=ay(n.getFullYear(),i);return l<n.getDate()&&n.setDate(l),n.setMonth(i),n},Hh=(()=>{const e={yyyy:n=>n.getFullYear(),m:n=>n.getMonth()+1,mm:n=>`0${n.getMonth()+1}`.slice(-2),mmm:(n,i)=>n.toLocaleDateString(i,{month:"long"}).slice(0,3),Mmm:(n,i)=>{const l=n.toLocaleDateString(i,{month:"long"});return(l[0].toUpperCase()+l.slice(1).toLowerCase()).slice(0,3)},mmmm:(n,i)=>n.toLocaleDateString(i,{month:"long"}),Mmmm:(n,i)=>{const l=n.toLocaleDateString(i,{month:"long"});return l[0].toUpperCase()+l.slice(1).toLowerCase()}},t=new RegExp(["yyyy","Mmmm","mmmm","Mmm","mmm","mm","m"].join("|"),"g");return(n,i,l)=>{const o=/(\[[^\]]+\])([^\\[\]]+)(\[[^\]]+\])/,c=i.match(o).slice(1),f=c[1],u=[c[0],c[2]].map(h=>({label:h.replace(/\[[^\]]+\]/,p=>p.slice(1,-1).replace(t,w=>e[w](l,n))),type:h.indexOf("yy")!==-1?"year":"month"}));return{separator:f,labels:u}}})(),na=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()},ry=(e,t,n)=>{if(!t||!n)return!1;const[i,l]=[t,n].sort();return e>=i&&e<=l};function sy(e){return e.toString()[0].toUpperCase()+e.toString().slice(1)}const ly=(e,...t)=>{const n=new Date(e.getTime());return n.setHours(t[0]),n.setMinutes(t[1]),n.setSeconds(t[2]),n},oy={tableDate:{type:Date,required:!0},disableDate:Function,selectionMode:{type:String,required:!0},modelValue:{type:[Date,String,Number,Array]},rangeState:{type:Object,default:()=>({from:null,to:null,selecting:!1})},focusedDate:{type:Date,required:!0}};var Bc=a.defineComponent({name:"DateTable",props:oy,emits:["pick","pick-click","changeRange"],setup(e,{emit:t}){const n=a.computed(()=>new J5.Generator({onlyDays:!0,weekStart:0})),i=a.computed(()=>{const h=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"];return h.splice(0,7-0).concat(h.splice(0,0))}),l=a.computed(()=>e.selectionMode==="range"&&e.rangeState.selecting?[e.rangeState.from]:e.modelValue),o=a.computed(()=>{const h=e.tableDate.getFullYear(),m=e.tableDate.getMonth(),p=na(new Date),w=l.value.filter(Boolean).map(na),[y,v]=l.value.map(na),L=e.rangeState.from&&na(e.rangeState.from),x=e.rangeState.to&&na(e.rangeState.to),k=e.selectionMode==="range",C=typeof e.disableDate=="function"&&e.disableDate;return n.value(h,m,b=>{b.date instanceof Date&&b.date.setTime(b.date.getTime()+b.date.getTimezoneOffset()*6e4);const I=b.date&&na(b.date),N=b.date&&m===b.date.getMonth();return Te(U({},b),{type:I===p?"today":b.type,selected:N&&w.includes(I),disabled:b.date&&C&&C(new Date(I)),range:N&&k&&ry(I,L,x),start:N&&k&&I===y,end:N&&k&&I===v})}).cells.slice(0)});return{headerDays:i,cells:o,getCellCls:h=>["bk-date-picker-cells-cell",{["bk-date-picker-cells-cell-selected"]:h.selected||h.start||h.end,["bk-date-picker-cells-cell-disabled"]:h.disabled,["bk-date-picker-cells-cell-today"]:h.type==="today",["bk-date-picker-cells-cell-prev-month"]:h.type==="prevMonth",["bk-date-picker-cells-cell-next-month"]:h.type==="nextMonth",["bk-date-picker-cells-cell-week-label"]:h.type==="weekLabel",["bk-date-picker-cells-cell-range"]:h.range&&!h.start&&!h.end}],handleClick:h=>{if(h.disabled||h.type==="weekLabel")return;const m=new Date(na(h.date));t("pick",m),t("pick-click")},handleMouseMove:h=>{if(!e.rangeState.selecting||h.disabled)return;const m=h.date;t("changeRange",m)}}},render(){return a.createVNode("div",{class:"bk-date-picker-cells"},[a.createVNode("div",{class:"bk-date-picker-cells-header"},[this.headerDays.map(e=>a.createVNode("span",null,[e]))]),this.cells.map(e=>a.createVNode("span",{class:this.getCellCls(e),onClick:()=>this.handleClick(e),onMouseenter:()=>this.handleMouseMove(e)},[a.createVNode("em",null,[e.desc])]))])}});const _c={type:{type:String,default:"date",validator(e){return["year","month","date","daterange","datetime","datetimerange","time","timerange"].indexOf(e)<0?(console.error(`type property is not valid: '${e}'`),!1):!0}},extPopoverCls:{type:String,default:""},format:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},open:{type:Boolean,default:null},multiple:{type:Boolean,default:!1},timePickerOptions:{type:Object,default:()=>({})},splitPanels:{type:Boolean,default:!0},startDate:Date,placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start",validator:e=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0?(console.error(`placement property is not valid: '${e}'`),!1):!0},transfer:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},shortcuts:{type:Array,default:()=>[]},shortcutClose:{type:Boolean,default:!1},modelValue:{type:[Date,String,Number,Array]},value:{type:[Date,String,Number,Array]},options:{type:Object,default:()=>({})},fontSize:{type:String,default:"normal"},upToNow:{type:Boolean,default:!1},useShortcutText:{type:Boolean,default:!1},shortcutSelectedIndex:{type:Number,default:-1},headerSlotCls:{type:String,default:""},footerSlotCls:{type:String,default:""},allowCrossDay:{type:Boolean,default:!1},behavior:{type:String,default:"normal",validator(e){return["simplicity","normal"].indexOf(e)>-1}},disableDate:Function,withValidate:{type:Boolean,default:!0}},Zc={disabledHours:{type:Array,default:()=>[]},disabledMinutes:{type:Array,default:()=>[]},disabledSeconds:{type:Array,default:()=>[]},hideDisabledOptions:{type:Boolean,default:!1},width:{type:Number,default:261},enterMode:{type:Boolean,default:!0}},cy={type:{type:String,default:"time",validator(e){return["time","timerange"].indexOf(e)<0?(console.error(`type property is not valid: '${e}'`),!1):!0}},allowCrossDay:{type:Boolean,default:!1}},uy={hours:{type:[Number,String],default:NaN},minutes:{type:[Number,String],default:NaN},seconds:{type:[Number,String],default:NaN},showSeconds:{type:Boolean,default:!0},steps:{type:Array,default:()=>[]}},Bh=["hours","minutes","seconds"];var dy=a.defineComponent({name:"TimeSpinner",props:U(U({},uy),Zc),emits:["change","pick-click"],setup(e,{emit:t}){const n=a.reactive({spinerSteps:[1,1,1].map((T,A)=>Math.abs(e.steps[A])||T),compiled:!1,focusedColumn:-1,focusedTime:[0,0,0]}),i=a.computed(()=>{const T=[],A=n.spinerSteps[0],P=n.focusedColumn===0&&n.focusedTime[0],J={text:0,selected:!1,disabled:!1,hide:!1};for(let z=0;z<24;z+=A){const E=JSON.parse(JSON.stringify(J));E.text=z,E.focused=z===P,e.disabledHours.length&&e.disabledHours.indexOf(z)>-1&&(E.disabled=!0,e.hideDisabledOptions&&(E.hide=!0)),e.hours===z&&(E.selected=!0),T.push(E)}return T}),l=a.computed(()=>{const T=[],A=n.spinerSteps[1],P=n.focusedColumn===1&&n.focusedTime[1],J={text:0,selected:!1,disabled:!1,hide:!1};for(let z=0;z<60;z+=A){const E=JSON.parse(JSON.stringify(J));E.text=z,E.focused=z===P,e.disabledMinutes.length&&e.disabledMinutes.indexOf(z)>-1&&(E.disabled=!0,e.hideDisabledOptions&&(E.hide=!0)),e.minutes===z&&(E.selected=!0),T.push(E)}return T}),o=a.computed(()=>{const T=[],A=n.spinerSteps[2],P=n.focusedColumn===2&&n.focusedTime[2],J={text:0,selected:!1,disabled:!1,hide:!1};for(let z=0;z<60;z+=A){const E=JSON.parse(JSON.stringify(J));E.text=z,E.focused=z===P,e.disabledSeconds.length&&e.disabledSeconds.indexOf(z)>-1&&(E.disabled=!0,e.hideDisabledOptions&&(E.hide=!0)),e.seconds===z&&(E.selected=!0),T.push(E)}return T}),c=a.computed(()=>({width:e.showSeconds?"33.33%":"50%"}));a.watch(()=>e.hours,T=>{!n.compiled||L("hours",i.value.findIndex(A=>A.text===T))}),a.watch(()=>e.minutes,T=>{!n.compiled||L("minutes",l.value.findIndex(A=>A.text===T))}),a.watch(()=>e.seconds,T=>{!n.compiled||L("seconds",l.value.findIndex(A=>A.text===T))}),a.watch(()=>n.focusedTime,(T,A)=>{Bh.forEach((P,J)=>{if(T[J]===A[J]||typeof T[J]=="undefined")return;const z=this[`${P}List`].findIndex(E=>E.text===T[J]);L(P,z)})}),a.onMounted(()=>{a.nextTick(()=>{n.compiled=!0,h()})});function f(T){let A;return T==="hours"?A=b:T==="minutes"?A=I:A=N,A.value}function u(T){return["bk-time-picker-cells-cell",{["bk-time-picker-cells-cell-selected"]:T.selected,["bk-time-picker-cells-cell-focused"]:T.focused,["bk-time-picker-cells-cell-disabled"]:T.disabled}]}function h(){const T=A=>{f(A).addEventListener("wheel",ct.exports.debounce(()=>{w(A)},32),{passive:!0})};T("hours"),T("minutes"),T("seconds")}function m(T){return f(T).querySelector("li").offsetHeight}function p(T){return f(T).offsetHeight}function w(T){const A=f(T),P=Math.min(Math.round((A.scrollTop-(p(T)*.5-10)/m(T)+3)/m(T)),T==="hours"?23:59);let J;if(T==="hours"?J=i:T==="minutes"?J=l:J=o,J.value.find(E=>E.text===P).disabled)return!1;a.nextTick(()=>{v({[T]:P})})}function y(T,A){if(A.disabled)return;const P={[T]:A.text};v(P)}function v(T){t("change",T),t("pick-click")}function L(T,A){const P=f(T),J=P.scrollTop,z=32*x(T,A);c4(P,J,z,500)}function x(T,A){const P=sy(T),J=e[`disabled${P}`];let z=A;if(J.length&&e.hideDisabledOptions){let E=0;J.forEach(ne=>ne<=A?E+=1:""),z-=E}return z}function k(){a.nextTick(()=>{Bh.forEach(T=>{const A=f(T);let P;T==="hours"?P=i:T==="minutes"?P=l:P=o,A.scrollTop=32*P.value.findIndex(J=>J.text===e[T])})})}function C(T){return T<10?`0${T}`:T}const b=a.ref(null),I=a.ref(null),N=a.ref(null);return Te(U({},a.toRefs(n)),{hoursList:i,minutesList:l,secondsList:o,styles:c,hoursRef:b,minutesRef:I,secondsRef:N,getCellCls:u,handleClick:y,updateScroll:k,padTime:C})},render(){return a.createVNode("div",{class:["bk-time-picker-cells",this.showSeconds?"bk-time-picker-cells-with-seconds":""]},[a.createVNode("div",{class:"bk-time-picker-cells-title-wrapper"},[a.createVNode("div",{class:["bk-time-picker-cells-title",this.focusedColumn===0?"active":""],style:this.styles},[a.createTextVNode("\u65F6")]),a.createVNode("div",{class:["bk-time-picker-cells-title",this.focusedColumn===1?"active":""],style:this.styles},[a.createTextVNode("\u5206")]),a.withDirectives(a.createVNode("div",{class:["bk-time-picker-cells-title",this.focusedColumn===2?"active":""],style:this.styles},[a.createTextVNode("\u79D2")]),[[a.vShow,this.showSeconds]])]),a.createVNode("div",{class:"bk-time-picker-cells-list",ref:"hoursRef",style:this.styles},[a.createVNode("ul",{class:"bk-time-picker-cells-ul"},[this.hoursList.map(e=>a.withDirectives(a.createVNode("li",{class:this.getCellCls(e),onClick:()=>this.handleClick("hours",e)},[this.padTime(e.text)]),[[a.vShow,!e.hide]]))])]),a.createVNode("div",{class:"bk-time-picker-cells-list",ref:"minutesRef",style:this.styles},[a.createVNode("ul",{class:"bk-time-picker-cells-ul"},[this.minutesList.map(e=>a.withDirectives(a.createVNode("li",{class:this.getCellCls(e),onClick:()=>this.handleClick("minutes",e)},[this.padTime(e.text)]),[[a.vShow,!e.hide]]))])]),a.withDirectives(a.createVNode("div",{class:"bk-time-picker-cells-list",ref:"secondsRef",style:this.styles},[a.createVNode("ul",{class:"bk-time-picker-cells-ul"},[this.secondsList.map(e=>a.withDirectives(a.createVNode("li",{class:this.getCellCls(e),onClick:()=>this.handleClick("seconds",e)},[this.padTime(e.text)]),[[a.vShow,!e.hide]]))])]),[[a.vShow,this.showSeconds]])])}});const fy={disabledDate:{type:Function,default:()=>!1},steps:{type:Array,default:()=>[]},format:{type:String,default:"HH:mm:ss"},value:{type:Array,required:!0},confirm:{type:Boolean,default:!1}};var _h=a.defineComponent({name:"TimePickerPanel",props:U(U(U({},_c),Zc),fy),emits:["pick","pick-click"],setup(e,{emit:t}){const n=a.reactive({date:e.value[0]||Hc(),showDate:!1}),i=a.inject(Qh),l=a.ref(null),o=a.computed(()=>!(e.format||"").match(/mm$/)),c=a.computed(()=>Nt.format(i.panelDate,e.format)),f=a.computed(()=>e.value[0]?["getHours","getMinutes","getSeconds"].map(p=>n.date[p]()):[]),u=a.computed(()=>{const p=["disabledHours","disabledMinutes","disabledSeconds"];if(e.disabledDate===(()=>!e.value[0]))return p.reduce((x,k)=>(x[k]=this[k],x),{});const w=[24,60,60],v=["Hours","Minutes","Seconds"].map(L=>e[`disabled${L}`]).map((L,x)=>{const k=w[x],C=L;for(let b=0;b<k;b+=e.steps[x]||1){const I=f.value.map((T,A)=>A===x?b:T),N=ly(n.date,...I);e.disabledDate(N,!0)&&C.push(b)}return C.filter((b,I,N)=>N.indexOf(b)===I)});return p.reduce((L,x,k)=>(L[x]=v[k],L),{})});a.watch(()=>e.value,p=>{let w=p[0]||Hc();w=new Date(w),n.date=w}),a.onMounted(()=>{i&&i.parentName==="DatePanel"&&(n.showDate=!0)});function h(p,w=!0){const y=new Date(n.date);Object.keys(p).forEach(v=>y[`set${Lo(v)}`](p[v])),w&&t("pick",y,!0,"time")}function m(){t("pick-click")}return Te(U({},a.toRefs(n)),{visibleDate:c,showSeconds:o,timeSlots:f,disabledHMS:u,timeSpinnerRef:l,handlePickClick:m,handleChange:h})},render(){return a.createVNode("div",{class:"bk-picker-panel-body-wrapper",onMousedown:e=>{e.preventDefault()}},[a.createVNode("div",{class:"bk-picker-panel-body",style:{width:`${this.width}px`}},[this.showDate?a.createVNode("div",{class:"bk-time-picker-header"},[this.visibleDate]):"",a.createVNode("div",{class:"bk-picker-panel-content"},[a.createVNode(dy,{ref:"timeSpinnerRef",showSeconds:this.showSeconds,steps:this.steps,hours:this.timeSlots[0],minutes:this.timeSlots[1],seconds:this.timeSlots[2],disabledHours:this.disabledHMS.disabledHours,disabledMinutes:this.disabledHMS.disabledMinutes,disabledSeconds:this.disabledHMS.disabledSeconds,hideDisabledOptions:this.hideDisabledOptions,"onPick-click":this.handlePickClick,onChange:this.handleChange},null)])])])}});const hy={modelValue:{type:[Date,String,Number,Array]},shortcuts:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},shortcutClose:{type:Boolean,default:!1},selectionMode:{type:String,default:"date",validator(e){return["year","month","date","time"].indexOf(e)<0?(console.error(`selectionMode property is not valid: '${e}'`),!1):!0}},startDate:{type:Date},disableDate:Function,focusedDate:{type:Date,required:!0},confirm:{type:Boolean,default:!1},showTime:{type:Boolean,default:!1},format:{type:String,default:"yyyy-MM-dd"},disabledDate:{type:Function,default:()=>!1}};var gy=a.defineComponent({name:"DatePanel",props:hy,emits:["pick","pick-success","pick-clear","pick-click","selection-mode-change"],setup(e,{slots:t,emit:n}){const i=_=>_.match(/^time/)?"time-picker":`${_}-table`,l=e.modelValue.slice().sort(),o=a.reactive({currentView:e.selectionMode||"date",pickerTable:i(e.selectionMode),dates:l,panelDate:e.startDate||l[0]||new Date}),{proxy:c}=a.getCurrentInstance();a.provide(Qh,{panelDate:o.panelDate,parentName:c.$options.name});const f=a.ref(null),u=a.ref(null),h=a.ref(null);a.watch(()=>o.currentView,_=>{console.error(11111,_),n("selection-mode-change",_),o.currentView==="time"&&a.nextTick(()=>{f.value.timeSpinnerRef.updateScroll()})}),a.watch(()=>e.selectionMode,_=>{o.currentView=_,o.pickerTable=i(_)});const m=()=>{setTimeout(()=>{o.currentView=e.selectionMode},500)},p=_=>{o.panelDate=_,o.pickerTable==="year-table"?o.pickerTable="month-table":o.pickerTable=i(o.currentView)},w=(_,ce)=>{let re=_;e.selectionMode==="year"?re=new Date(_.getFullYear(),0,1):e.selectionMode==="month"?re=new Date(o.panelDate.getFullYear(),_.getMonth(),1):re=new Date(_),o.dates=[re],n("pick",re,!1,ce||e.selectionMode)},y=()=>{m(),n("pick-success")},v=()=>{m(),n("pick-clear")},L=_=>{_.value&&n("pick",_.value(),!1,void 0,_),_.onClick&&_.onClick(this),e.shortcutClose&&y()},x=()=>{o.currentView=e.selectionMode,o.pickerTable=i(o.currentView)},k=_=>{e.selectionMode==="year"||o.pickerTable==="year-table"?o.panelDate=new Date(o.panelDate.getFullYear()+_*10,0,1):o.panelDate=Wh(o.panelDate,_*12)},C=_=>{o.panelDate=Wh(o.panelDate,_)},b=_=>{var ce,re;_&&((ce=u==null?void 0:u.value)==null||ce.updateScroll(),(re=h==null?void 0:h.value)==null||re.updateScroll())},I=a.computed(()=>o.pickerTable===`${o.currentView}-table`?w:p),N=a.computed(()=>{const _="zh-CN",ce="[yyyy]-[mm]",re=o.panelDate,{labels:ae,separator:ue}=Hh(_,ce,re),ie=Y=>()=>{o.pickerTable=i(Y)};return{separator:ue,labels:ae.map(Y=>{const W=Y;return W.handler=ie(Y.type),W})}}),T=a.computed(()=>N.value.labels[0].type==="year"||o.currentView==="date"),A=a.computed(()=>N.value.labels[1].type==="year"||o.currentView==="date"),P=a.computed(()=>o.currentView==="time"),J=()=>{o.currentView=o.currentView==="time"?"date":"time"},z=a.computed(()=>!!t.shortcuts),E=a.computed(()=>!o.dates[0]);function ne(){n("pick-click")}return Te(U({},a.toRefs(o)),{panelPickerHandlers:I,datePanelLabel:N,showLabelFirst:T,showLabelSecond:A,handleShortcutClick:L,changeYear:k,changeMonth:C,reset:x,isTime:P,hasShortcuts:z,timeDisabled:E,onToggleVisibility:b,handleToggleTime:J,handlePickSuccess:y,handlePickClear:v,handlePick:w,handlePickClick:ne,timePickerRef:f})},render(){var e,t,n;return a.createVNode("div",{class:["bk-picker-panel-body-wrapper",this.shortcuts.length||this.hasShortcuts?"bk-picker-panel-with-sidebar":""],onMousedown:i=>{i.preventDefault()}},[this.shortcuts.length?a.createVNode("div",{class:"bk-picker-panel-sidebar"},[this.shortcuts.map(i=>a.createVNode("div",{class:"bk-picker-panel-shortcut",onClick:()=>this.handleShortcutClick(i)},[i.text]))]):"",a.createVNode("div",{class:"bk-picker-panel-body",style:"width: 261px;"},[a.withDirectives(a.createVNode("div",{class:"bk-date-picker-header"},[a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.changeYear(-1)},[a.createVNode(hr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.pickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("prev"),onClick:()=>this.changeMonth(-1)},[a.createVNode(Mi,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):"",this.datePanelLabel&&Object.keys(this.datePanelLabel).length>0?a.createVNode("span",null,[a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.datePanelLabel.labels[0].handler},[this.datePanelLabel.labels[0].label]),[[a.vShow,this.showLabelFirst]]),this.currentView==="date"?` ${this.datePanelLabel.separator} `:" ",a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.datePanelLabel.labels[1].handler},[this.datePanelLabel.labels[1].label]),[[a.vShow,this.showLabelSecond]])]):"",a.createVNode("span",{class:dn("next","-double"),onClick:()=>this.changeYear(1)},[a.createVNode(gr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.pickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("next"),onClick:()=>this.changeMonth(1)},[a.createVNode(vn,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):""]),[[a.vShow,this.currentView!=="time"]]),a.createVNode("div",{class:"bk-picker-panel-content"},[this.currentView!=="time"?(()=>{switch(this.pickerTable){case"date-table":return a.createVNode(Bc,{tableDate:this.panelDate,disableDate:this.disableDate,selectionMode:this.selectionMode,modelValue:this.dates,focusedDate:this.focusedDate,onPick:this.panelPickerHandlers},null);default:return null}})():a.createVNode(_h,{ref:"timePickerRef",value:this.dates,format:this.format,disabledDate:this.disabledDate,onPick:this.handlePick,"onPick-clear":this.handlePickClear,"onPick-success":this.handlePickSuccess},null)]),this.confirm?a.createVNode(z5,{clearable:this.clearable,showTime:this.showTime,isTime:this.isTime,"onPick-toggle-time":this.handleToggleTime,"onPick-clear":this.handlePickClear,"onPick-success":this.handlePickSuccess},null):""]),this.hasShortcuts?a.createVNode("div",{class:"bk-picker-panel-sidebar"},[(n=(t=(e=this.$slots).shortcuts)==null?void 0:t.call(e))!=null?n:null]):null])}});const my={modelValue:{type:[Date,String,Number,Array]},type:{type:String,default:"date",validator(e){return["year","month","date","daterange","datetime","datetimerange","time","timerange"].indexOf(e)<0?(console.error(`type property is not valid: '${e}'`),!1):!0}},shortcuts:{type:Array,default:()=>[]},shortcutClose:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},splitPanels:{type:Boolean,default:!0},showTime:{type:Boolean,default:!1},selectionMode:{type:String,default:"date",validator(e){return["year","month","date","time"].indexOf(e)<0?(console.error(`selectionMode property is not valid: '${e}'`),!1):!0}},startDate:{type:Date},upToNow:{type:Boolean,default:!1},disableDate:Function,focusedDate:{type:Date,required:!0},confirm:{type:Boolean,default:!1}};var py=a.defineComponent({name:"DateRangePanel",props:my,emits:["pick","pick-success"],setup(e,{slots:t,emit:n}){const[i,l]=e.modelValue.map(Q=>Q||Hc()),o=e.startDate?e.startDate:i,c=a.reactive({currentView:e.selectionMode||"date",leftPickerTable:`${e.selectionMode}-table`,rightPickerTable:`${e.selectionMode}-table`,leftPanelDate:o,rightPanelDate:new Date(o.getFullYear(),o.getMonth()+1,1),rangeState:{from:e.modelValue[0],to:e.modelValue[1],selecting:i&&!l},upToNowEnable:!1,dates:e.modelValue}),f=(Q,F)=>!Q||!F?0:Q.getTime()-F.getTime(),u=()=>{c.currentView=e.selectionMode,c.leftPickerTable=`${c.currentView}-table`,c.rightPickerTable=`${c.currentView}-table`},h=a.ref(null),m=a.ref(null),p=Q=>{var F,K;Q&&((F=h==null?void 0:h.value)==null||F.updateScroll(),(K=m==null?void 0:m.value)==null||K.updateScroll())},w=(Q,F,K,fe=!0)=>{const he=new Date(c[`${Q}PanelDate`]);if(he[`set${F}`](he[`get${F}`]()+K),c[`${Q}PanelDate`]=he,!!fe)if(e.splitPanels){const Ce=Q==="left"?"right":"left";Q==="left"&&c.leftPanelDate>=c.rightPanelDate&&w(Ce,F,1),Q==="right"&&c.rightPanelDate<=c.leftPanelDate&&w(Ce,F,-1)}else{const Ce=Q==="left"?"right":"left",Ae=c[`${Ce}PanelDate`],oe=new Date(Ae);if(F==="Month"){const X=new Date(oe.getFullYear(),oe.getMonth()+K+1,0).getDate();oe.setDate(Math.min(X,oe.getDate()))}oe[`set${F}`](oe[`get${F}`]()+K),c[`${Ce}PanelDate`]=oe}},y=Q=>{const F=c.currentView==="year"?-10:-1;w(Q,"FullYear",F)},v=Q=>{const F=c.currentView==="year"?10:1;w(Q,"FullYear",F)},L=Q=>{w(Q,"Month",-1)},x=Q=>{w(Q,"Month",1)},k=Q=>{c[`${Q}PickerTable`]="year-table"},C=Q=>{c[`${Q}PickerTable`]="month-table"},b=Q=>{const F="zh-CN",K="[yyyy]-[mm]",fe=c[`${Q}PanelDate`],{labels:he,separator:Ce}=Hh(F,K,fe),Ae=oe=>{const X=oe==="month"?C:k;return()=>X(Q)};return{separator:Ce,labels:he.map(oe=>{const X=oe;return X.handler=Ae(oe.type),X})}},I=(Q,F)=>{n("pick",c.dates,Q,F||e.type)},N=(Q,F)=>{if(console.warn("handleRangePick"),c.rangeState.selecting||c.currentView==="time"){if(c.currentView==="time")c.dates=Q;else{const[K,fe]=[c.rangeState.from,Q].sort(f),he=F==="upToNow"?new Date:new Date(new Date(new Date(fe.setHours(23)).setMinutes(59)).setSeconds(59));c.dates=[K,he],c.rangeState={from:K,to:he,selecting:!1}}I(!1,F||"date")}else c.upToNowEnable=new Date(Q).getTime()<new Date().getTime(),c.rangeState={from:Q,to:null,selecting:!0}},T=(Q,F)=>{if(c[`${Q}PanelDate`]=F,c[`${Q}PickerTable`]==="year-table"?c[`${Q}PickerTable`]="month-table":c[`${Q}PickerTable`]=`${c.currentView}-table`,!e.splitPanels){const fe=Q==="left"?"right":"left";c[`${fe}PanelDate`]=F,w(fe,"Month",fe==="left"?-1:1,!1)}},A=(Q,F)=>{if(!(Q!=null&&Q.value))return!1;Q.onClick&&Q.onClick(Q,F);const K=typeof Q.value=="function"?Q.value():Q.value,[fe,he]=K;c.rangeState.from=fe,c.rangeState.to=he,c.dates=[fe,he],n("pick",K,!1,"shortcut",Q),e.shortcutClose&&n("pick-success")},P=Q=>{c.rangeState.to=Q};a.watch(()=>e.selectionMode,Q=>{c.currentView=Q||"range"});const J=a.computed(()=>c.currentView==="time"),z=a.computed(()=>b("left")),E=a.computed(()=>b("right")),ne=a.computed(()=>c.leftPickerTable.split("-").shift()),_=a.computed(()=>c.rightPickerTable.split("-").shift()),ce=a.computed(()=>z.value.labels[0].type==="year"||c.currentView==="date"),re=a.computed(()=>z.value.labels[1].type==="year"||c.currentView==="date"),ae=a.computed(()=>E.value.labels[0].type==="year"||c.currentView==="date"),ue=a.computed(()=>E.value.labels[1].type==="year"||c.currentView==="date"),ie=a.computed(()=>{const Q=`${c.currentView}-table`;return{left:c.leftPickerTable!==Q,right:c.rightPickerTable!==Q}}),Y=a.computed(()=>({left:ie.value.left?T.bind("left"):N,right:ie.value.right?T.bind("right"):N})),W=a.computed(()=>{var Q;return t.shortcuts||((Q=e.shortcuts)==null?void 0:Q.length)});return Te(U({},a.toRefs(c)),{isTime:J,hasShortcuts:W,prevYear:y,nextYear:v,prevMonth:L,nextMonth:x,leftDatePanelLabel:z,rightDatePanelLabel:E,leftDatePanelView:ne,rightDatePanelView:_,leftShowLabelFirst:ce,leftShowLabelSecond:re,rightShowLabelFirst:ae,rightShowLabelSecond:ue,preSelecting:ie,panelPickerHandlers:Y,handleShortcutClick:A,reset:u,onToggleVisibility:p,handleRangePick:N,handleChangeRange:P})},render(){return a.createVNode("div",{class:["bk-picker-panel-body-wrapper","bk-date-picker-with-range",this.shortcuts.length||this.$slots.shortcuts?"bk-picker-panel-with-sidebar":""],onMousedown:e=>{e.preventDefault()}},[a.createVNode("div",{class:["bk-picker-panel-body",this.showTime?"bk-picker-panel-body-time":"bk-picker-panel-body-date"]},[a.withDirectives(a.createVNode("div",{class:"bk-picker-panel-content bk-picker-panel-content-left",style:"width: 261px;"},[a.withDirectives(a.createVNode("div",{class:"bk-date-picker-header"},[a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.prevYear("left")},[a.createVNode(hr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.leftPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("prev"),onClick:()=>this.prevMonth("left")},[a.createVNode(Mi,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):"",this.leftDatePanelLabel&&Object.keys(this.leftDatePanelLabel).length>0?a.createVNode("span",null,[a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.leftDatePanelLabel.labels[0].handler},[this.leftDatePanelLabel.labels[0].label]),[[a.vShow,this.leftShowLabelFirst]]),this.leftDatePanelView==="date"?` ${this.leftDatePanelLabel.separator} `:" ",a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.leftDatePanelLabel.labels[1].handler},[this.leftDatePanelLabel.labels[1].label]),[[a.vShow,this.leftShowLabelSecond]])]):"",this.splitPanels||this.leftPickerTable!=="date-table"?a.createVNode("span",{class:dn("next","-double"),onClick:()=>this.nextYear("left")},[a.createVNode(gr,{style:{fontSize:"20px",lineHeight:1}},null)]):"",this.splitPanels||this.leftPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("next"),onClick:()=>this.nextMonth("left")},[a.createVNode(vn,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):""]),[[a.vShow,this.currentView!=="time"]]),this.currentView!=="time"?(()=>{switch(this.leftPickerTable){case"date-table":return a.createVNode(Bc,{selectionMode:"range",tableDate:this.leftPanelDate,disableDate:this.disableDate,rangeState:this.rangeState,modelValue:this.preSelecting.left?[this.dates[0]]:this.dates,focusedDate:this.focusedDate,onChangeRange:this.handleChangeRange,onPick:this.panelPickerHandlers.left},null);default:return null}})():""]),[[a.vShow,!this.isTime]]),a.withDirectives(a.createVNode("div",{class:"bk-picker-panel-content bk-picker-panel-content-right",style:"width: 261px;"},[a.withDirectives(a.createVNode("div",{class:"bk-date-picker-header"},[this.splitPanels||this.rightPickerTable!=="date-table"?a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.prevYear("right")},[a.createVNode(hr,{style:{fontSize:"20px",lineHeight:1}},null)]):"",this.splitPanels&&this.rightPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.prevMonth("right")},[a.createVNode(Mi,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):"",this.rightDatePanelLabel&&Object.keys(this.rightDatePanelLabel).length>0?a.createVNode("span",null,[a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.rightDatePanelLabel.labels[0].handler},[this.rightDatePanelLabel.labels[0].label]),[[a.vShow,this.rightShowLabelFirst]]),this.rightDatePanelView==="date"?` ${this.rightDatePanelLabel.separator} `:" ",a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.rightDatePanelLabel.labels[1].handler},[this.rightDatePanelLabel.labels[1].label]),[[a.vShow,this.rightShowLabelSecond]])]):"",this.upToNow?(()=>(this.rangeState.selecting||this.currentView==="time")&&this.upToNowEnable?a.createVNode("span",{class:"up-to-now",onClick:()=>this.handleRangePick(new Date,"upToNow")},[a.createTextVNode("\u81F3\u4ECA")]):a.createVNode("span",{class:"up-to-now disabled"},[a.createTextVNode("\u81F3\u4ECA")]))():"",a.createVNode("span",{class:dn("next","-double"),onClick:()=>this.nextYear("right")},[a.createVNode(gr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.rightPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("next"),onClick:()=>this.nextMonth("right")},[a.createVNode(vn,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):""]),[[a.vShow,this.currentView!=="time"]]),this.currentView!=="time"?(()=>{switch(this.rightPickerTable){case"date-table":return a.createVNode(Bc,{selectionMode:"range",tableDate:this.rightPanelDate,disableDate:this.disableDate,rangeState:this.rangeState,modelValue:this.preSelecting.right?[this.dates[this.dates.length-1]]:this.dates,focusedDate:this.focusedDate,onChangeRange:this.handleChangeRange,onPick:this.panelPickerHandlers.right},null);default:return null}})():""]),[[a.vShow,!this.isTime]])]),this.hasShortcuts?a.createVNode("div",{class:"bk-picker-panel-sidebar"},[this.$slots.shortcuts?typeof this.$slots.shortcuts=="function"?this.$slots.shortcuts():this.$slots.shortcuts:this.shortcuts.length?a.createVNode("div",{class:"bk-picker-panel-shortcuts"},[this.shortcuts.map((e,t)=>a.createVNode("div",{key:t,class:"shortcuts-item",onClick:()=>this.handleShortcutClick(e,t)},[e.text]))]):""]):null])}}),by=a.defineComponent({name:"DatePicker",directives:{clickoutside:Xn},props:_c,emits:["open-change","input","change","update:modelValue","clear","shortcut-change","pick-success"],slots:["header"],setup(e,{slots:t,emit:n}){const i=En(),l=e.type.includes("range"),o=l?[null,null]:[null],c=l?e.value||e.modelValue:[e.value||e.modelValue];let f=Ah(c)?o:Di(e.value||e.modelValue,e.type,e.multiple,e.format),u=null;e.shortcutSelectedIndex!==-1&&(u=e.shortcuts[e.shortcutSelectedIndex]||null,u&&(f=u.value()));const h=a.reactive({showClose:!1,visible:!1,internalValue:f,disableClickOutSide:!1,disableCloseUnderTransfer:!1,selectionMode:"date",forceInputRerender:1,isFocused:!1,focusedDate:f[0]||e.startDate||new Date,focusedTime:{column:0,picker:0,time:f.map(nl),active:!1},internalFocus:!1,timeEnterMode:!0,shortcut:u,onSelectionModeChange:m});function m(oe){let X=oe;return oe.match(/^date/)&&(X="date"),h.selectionMode=["year","month","date","time"].indexOf(X)>-1&&X,h.selectionMode}const p=a.computed(()=>{if(e.multiple)return h.internalValue.slice();const oe=e.type.includes("range");let X=h.internalValue.map(Z=>Z instanceof Date?new Date(Z):Z||"");return e.type.match(/^time/)&&(X=X.map(Z=>Wn(Z,e.type,e.multiple,e.format))),oe||e.multiple?X:X[0]}),w=a.computed(()=>e.type.match(/^time/)?p.value:e.multiple?Wn(p.value,e.type,e.multiple,e.format):Array.isArray(p.value)?p.value.map(oe=>Wn(oe,e.type,e.multiple,e.format)):Wn(p.value,e.type,e.multiple,e.format)),y=a.computed(()=>e.type==="daterange"||e.type==="datetimerange"?"DateRangePanel":"DatePanel"),v=a.computed(()=>e.open===null?h.visible:e.open),L=a.computed(()=>Wn(h.internalValue,e.type,e.multiple,e.format)),x=a.computed(()=>{var oe;return((oe=h.shortcut)==null?void 0:oe.text)&&e.useShortcutText?h.shortcut.text:L.value}),k=a.computed(()=>!!t.trigger||e.type==="datetime"||e.type==="datetimerange"||e.multiple),C=a.computed(()=>!!t.header),b=a.computed(()=>!!t.footer),I=a.computed(()=>!!t.shortcuts),N=a.computed(()=>{let oe="";return e.fontSize==="medium"?oe="medium-font":e.fontSize==="large"&&(oe="large-font"),oe}),T=a.computed(()=>{let oe="";return e.fontSize==="medium"?oe="medium-width":e.fontSize==="large"&&(oe="large-width"),oe}),A=a.computed(()=>{var oe;return((oe=h.shortcut)==null?void 0:oe.text)&&e.useShortcutText?!0:!e.editable||e.readonly}),P=a.computed(()=>e.options),J=a.computed(()=>y.value==="RangeTimePickerPanel"?e.allowCrossDay:!1),z=a.ref(null),E=()=>{var oe;(oe=z==null?void 0:z.value)==null||oe.focus()};a.watch(()=>h.visible,oe=>{var X,Z;oe===!1&&((X=ne.value)==null||X.destoryDropdown()),(Z=ne.value)==null||Z.updateDropdown(),n("open-change",oe)});const ne=a.ref(null);a.watch(()=>e.modelValue,oe=>{var X;h.internalValue=Di(oe,e.type,e.multiple,e.format),e.withValidate&&((X=i==null?void 0:i.validate)==null||X.call(i,"change"))}),a.watch(()=>e.open,oe=>{h.visible=oe===!0}),a.watch(()=>e.type,oe=>{m(oe)}),a.watch(()=>p,(oe,X)=>{const Z=JSON.stringify(oe),se=JSON.stringify(X);(Z!==se||typeof oe!=typeof X)&&n("input",oe)}),a.onMounted(()=>{e.type.indexOf("date")>-1,h.timeEnterMode=!0;const oe=e.modelValue,X=p.value;(typeof oe!=typeof X||JSON.stringify(oe)!==JSON.stringify(X))&&n("input",p.value),e.open!==null&&(h.visible=e.open),a.provide(Jh,{props:e,focus:()=>E()})});const _=a.ref(null),ce=oe=>{var X;if(h.disableCloseUnderTransfer)return h.disableCloseUnderTransfer=!1,!1;if(oe&&oe.type==="mousedown"&&h.visible){oe.preventDefault(),oe.stopPropagation();return}if(h.visible){const Z=(X=_==null?void 0:_.value)==null?void 0:X.$el;if(oe&&Z&&Z.contains(oe.target))return;h.visible=!1,oe==null||oe.preventDefault(),oe==null||oe.stopPropagation();return}h.isFocused=!1,h.disableClickOutSide=!1},re=()=>{var oe,X;(oe=z==null?void 0:z.value)==null||oe.focus(),(X=z==null?void 0:z.value)==null||X.click()},ae=()=>{e.readonly||e.disabled||L!=null&&L.value&&(h.showClose=!0)},ue=oe=>{h.showClose=!1},ie=oe=>{a.nextTick(()=>{var X;n("change",w.value,oe),n("update:modelValue",p.value),e.type.indexOf("time")<0&&((X=z==null?void 0:z.value)==null||X.blur())})},Y=oe=>{var H;const X=e.type.includes("range")||e.multiple,Z=L.value,se=oe.target.value,Me=Di(se,e.type,e.multiple,e.format),j=X?Me:Me[0],B=(H=e.disableDate)==null?void 0:H.call(e,j),V=Me.reduce(($,te)=>$&&te instanceof Date,!0);se!==Z&&!B&&V?(ie(e.type),h.internalValue=Me):h.forceInputRerender=h.forceInputRerender+1},W=oe=>{e.readonly||(h.isFocused=!0,!(oe&&oe.type==="focus")&&(e.disabled||(h.visible=!0)))},Q=()=>{var oe;(oe=_==null?void 0:_.value)==null||oe.reset()},F=oe=>{var X,Z;if(h.internalFocus){h.internalFocus=!1;return}if(h.visible){oe.preventDefault();return}h.isFocused=!1,m(e.type),h.internalValue=h.internalValue.slice(),Q(),(X=_==null?void 0:_.value)==null||X.onToggleVisibility(!1),(Z=i==null?void 0:i.validate)==null||Z.call(i,"blur")},K=oe=>{const{keyCode:X}=oe;if(X===9&&h.visible)if(oe.stopPropagation(),oe.preventDefault(),k.value){const se=".bk-picker-confirm > *",Me=ne.value.$el.querySelectorAll(se);h.internalFocus=!0,[...Me][oe.shiftKey?"pop":"shift"]().focus()}else ce();const Z=[37,38,39,40];if(!h.visible&&Z.includes(X)){h.visible=!0;return}X===27&&h.visible&&(oe.stopPropagation(),ce()),!!Z.includes(X)&&h.focusedTime.active&&oe.preventDefault()},fe=()=>{h.visible=!1,h.internalValue=h.internalValue.map(()=>null),n("clear"),ie(e.type),Q(),h.showClose=!1,h.shortcut=null,setTimeout(()=>m(e.type),500)},he=()=>{var oe;h.visible=!1,a.nextTick(()=>{n("pick-success")}),(oe=z==null?void 0:z.value)==null||oe.blur(),Q()},Ce=(oe,X=!1,Z,se)=>{let Me=oe;if(e.multiple){const B=Me.getTime(),V=h.internalValue.findIndex(te=>te&&te.getTime()===B),$=[...h.internalValue,Me].filter(Boolean).map(te=>te.getTime()).filter((te,ye,we)=>we.indexOf(te)===ye&&ye!==V);h.internalValue=$.map(te=>new Date(te))}else Me=Di(oe,e.type,e.multiple,e.format),h.internalValue=Array.isArray(Me)?Me:[Me];if(h.internalValue[0]){const[B]=h.internalValue;h.focusedDate=B}h.focusedTime=Te(U({},h.focusedTime),{time:h.internalValue.map(nl)}),k.value||(m(e.type),h.visible=X),Z==="upToNow"&&e.type==="daterange"&&he(),h.shortcut=se,ie(Z);const j=e.shortcuts.findIndex(B=>B===h.shortcut);n("shortcut-change",h.shortcut,j)},Ae=a.ref(null);return Te(U({},a.toRefs(h)),{panel:y,publicStringValue:w,opened:v,visualValue:L,displayValue:x,isConfirm:k,hasHeader:C,hasFooter:b,hasShortcuts:I,fontSizeCls:N,longWidthCls:T,localReadonly:A,allowCrossDayProp:J,ownPickerProps:P,pickerDropdownRef:ne,inputRef:z,triggerRef:Ae,pickerPanelRef:_,handleClose:ce,handleIconClick:re,handleInputMouseenter:ae,handleInputMouseleave:ue,handleFocus:W,handleBlur:F,handleKeydown:K,handleInputChange:Y,handleClear:fe,onPick:Ce,onPickSuccess:he})},render(){var n,i,l;const e=a.createVNode("div",null,[a.createVNode("span",{class:["icon-wrapper",this.disabled?"disabled":""],onClick:this.handleIconClick},[this.type==="time"||this.type==="timerange"?a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"time"},[a.createVNode("path",{fill:"#c4c6cc",d:"M512,128c51.9,0,102.2,10.1,149.5,30.2c45.7,19.3,86.8,47,122.1,82.3s63,76.4,82.3,122.1c20,47.3,30.2,97.6,30.2,149.5S886,614.3,865.9,661.6c-19.3,45.7-47,86.8-82.3,122.1s-76.4,63-122.1,82.3c-47.3,20-97.6,30.2-149.5,30.2S409.8,886.1,362.5,866c-45.7-19.3-86.8-47-122.1-82.3s-63-76.4-82.3-122.1c-20-47.3-30.2-97.6-30.2-149.5s10.1-102.2,30.2-149.5c19.3-45.7,47-86.8,82.3-122.1s76.4-63,122.1-82.3C409.8,138.1,460.1,128,512,128 M512,64C264.6,64,64,264.6,64,512s200.6,448,448,448s448-200.6,448-448S759.4,64,512,64L512,64z"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"512,512 512,256 448,256 448,512 448,576 512,576 768,576 768,512"},null)])]):a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"date"},[a.createVNode("path",{fill:"#c4c6cc",d:"M896,128h-96v64h64v112H160V192h64v-64h-96c-17.7,0-32,14.3-32,32v736c0,17.7,14.3,32,32,32h768c17.7,0,32-14.3,32-32V160C928,142.3,913.7,128,896,128z M160,864V368h704v496H160z"},null),a.createVNode("rect",{x:"416",y:"128",fill:"#c4c6cc",width:"192",height:"64"},null),a.createVNode("rect",{x:"288",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("rect",{x:"672",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"403.7,514.4 557.1,514.4 557.1,515.3 420.1,765.5 483.5,765.5 620.3,504.3 620.3,466.5 403.7,466.5"},null)])])]),a.createVNode("input",{type:"text",class:["bk-date-picker-editor",this.readonly?"readonly":"",this.fontSizeCls,this.behavior==="simplicity"?"only-bottom-border":""],ref:"inputRef",key:this.forceInputRerender,readonly:this.localReadonly,disabled:this.disabled,placeholder:this.placeholder,value:this.displayValue,onFocus:this.handleFocus,onClick:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onChange:this.handleInputChange},null),this.clearable&&this.showClose?a.createVNode(cn,{onClick:this.handleClear,class:"clear-action"},null):""]),t=this.hasShortcuts?{shortcuts:()=>{var o,c;return((c=(o=this.$slots).shortcuts)==null?void 0:c.call(o,{change:this.onPick}))||null}}:{};return a.withDirectives(a.createVNode("div",{class:["bk-date-picker",this.type==="datetimerange"?"long":"",this.longWidthCls]},[a.createVNode("div",{ref:"triggerRef",class:"bk-date-picker-rel",onMouseenter:this.handleInputMouseenter,onMouseleave:this.handleInputMouseleave},[(l=(i=(n=this.$slots).trigger)==null?void 0:i.call(n))!=null?l:e]),a.createVNode(a.Teleport,{to:"body",disabled:!this.appendToBody},{default:()=>[a.createVNode(a.Transition,{name:"bk-fade-down-transition"},{default:()=>[a.withDirectives(a.createVNode(Vc,{class:[this.appendToBody?"bk-date-picker-transfer":""],ref:"pickerDropdownRef",triggerRef:this.triggerRef,placement:this.placement,extPopoverCls:this.extPopoverCls,appendToBody:this.appendToBody},{default:()=>{var o,c,f,u,h,m;return[this.hasHeader?a.createVNode("div",{class:["bk-date-picker-top-wrapper",this.headerSlotCls]},[(f=(c=(o=this.$slots).header)==null?void 0:c.call(o))!=null?f:null]):null,this.panel==="DateRangePanel"?a.createVNode(py,{ref:"pickerPanelRef",type:this.type,confirm:this.isConfirm,shortcuts:this.shortcuts,shortcutClose:this.shortcutClose,modelValue:this.internalValue,selectionMode:this.selectionMode,startDate:this.startDate,disableDate:this.disableDate,focusedDate:this.focusedDate,onPick:this.onPick,"onPick-success":this.onPickSuccess,"onSelection-mode-change":this.onSelectionModeChange},t):a.createVNode(gy,{ref:"pickerPanelRef",clearable:this.clearable,showTime:this.type==="datetime"||this.type==="datetimerange",confirm:this.isConfirm,shortcuts:this.shortcuts,multiple:this.multiple,shortcutClose:this.shortcutClose,selectionMode:this.selectionMode,modelValue:this.internalValue,startDate:this.startDate,disableDate:this.disableDate,focusedDate:this.focusedDate,onPick:this.onPick,"onPick-clear":this.handleClear,"onPick-success":this.onPickSuccess,"onSelection-mode-change":this.onSelectionModeChange},t),this.hasFooter?a.createVNode("div",{class:["bk-date-picker-footer-wrapper",this.footerSlotCls]},[(m=(h=(u=this.$slots).footer)==null?void 0:h.call(u))!=null?m:null]):null]}}),[[a.vShow,this.opened]])]})]})]),[[a.resolveDirective("clickoutside"),this.handleClose]])}}),yy=a.defineComponent({name:"TimePicker",directives:{clickoutside:Xn},props:U(U(U({},_c),cy),Zc),emits:["open-change","input","change","update:modelValue","clear","shortcut-change","pick-success"],slots:["header"],setup(e,{slots:t,emit:n}){const i=En(),l=e.type.includes("range"),o=l?[null,null]:[null];let c=Ah((l?e.modelValue:[e.modelValue])||[])?o:Di(e.modelValue,e.type,e.multiple,e.format),f=null;e.shortcutSelectedIndex!==-1&&(f=e.shortcuts[e.shortcutSelectedIndex]||null,f&&(c=f.value()));const u=a.reactive({showClose:!1,visible:!1,internalValue:c,disableClickOutSide:!1,disableCloseUnderTransfer:!1,selectionMode:"date",forceInputRerender:1,isFocused:!1,focusedDate:c[0]||e.startDate||new Date,focusedTime:{column:0,picker:0,time:c.map(nl),active:!1},internalFocus:!1,timeEnterMode:!0,shortcut:f,onSelectionModeChange:h});function h(X){let Z=X;return X.match(/^date/)&&(Z="date"),u.selectionMode=["year","month","date","time"].indexOf(Z)>-1&&Z,u.selectionMode}const m=a.computed(()=>{if(e.multiple)return u.internalValue.slice();const X=e.type.includes("range");let Z=u.internalValue.map(se=>se instanceof Date?new Date(se):se||"");return e.type.match(/^time/)&&(Z=Z.map(se=>Wn(se,e.type,e.multiple,e.format))),X||e.multiple?Z:Z[0]}),p=a.computed(()=>e.type.match(/^time/)?m.value:e.multiple?Wn(m.value,e.type,e.multiple,e.format):Array.isArray(m.value)?m.value.map(X=>Wn(X,e.type,e.multiple,e.format)):Wn(m.value,e.type,e.multiple,e.format)),w=a.computed(()=>e.type==="timerange"?"RangeTimePickerPanel":"TimePickerPanel"),y=a.computed(()=>e.open===null?u.visible:e.open),v=a.computed(()=>Wn(u.internalValue,e.type,e.multiple,e.format)),L=a.computed(()=>{var X;return((X=u.shortcut)==null?void 0:X.text)&&e.useShortcutText?u.shortcut.text:v.value}),x=a.computed(()=>!!t.trigger||e.type==="datetime"||e.type==="datetimerange"||e.multiple),k=a.computed(()=>!!t.header),C=a.computed(()=>!!t.footer),b=a.computed(()=>!!t.shortcuts),I=a.computed(()=>{let X="";return e.fontSize==="medium"?X="medium-font":e.fontSize==="large"&&(X="large-font"),X}),N=a.computed(()=>{let X="";return e.fontSize==="medium"?X="medium-width":e.fontSize==="large"&&(X="large-width"),X}),T=a.computed(()=>{var X;return((X=u.shortcut)==null?void 0:X.text)&&e.useShortcutText?!0:!e.editable||e.readonly}),A=a.computed(()=>({disabledHours:e.disabledHours,disabledMinutes:e.disabledMinutes,disabledSeconds:e.disabledSeconds,hideDisabledOptions:e.hideDisabledOptions})),P=a.computed(()=>w.value==="RangeTimePickerPanel"?e.allowCrossDay:!1),J=a.ref(null),z=()=>{var X;(X=J==null?void 0:J.value)==null||X.focus()},{proxy:E}=a.getCurrentInstance();a.watch(()=>u.visible,X=>{X&&a.nextTick(()=>{Rh(E,"TimeSpinner").forEach(se=>se.updateScroll())})});const ne=a.ref(null);a.watch(()=>e.modelValue,X=>{var Z;u.internalValue=Di(X,e.type,e.multiple,e.format),e.withValidate&&((Z=i==null?void 0:i.validate)==null||Z.call(i,"change"))}),a.watch(()=>e.open,X=>{u.visible=X===!0}),a.watch(()=>e.type,X=>{h(X)}),a.watch(()=>m,(X,Z)=>{const se=JSON.stringify(X),Me=JSON.stringify(Z);(se!==Me||typeof X!=typeof Z)&&n("input",X)}),a.onMounted(()=>{e.type.indexOf("date")>-1,u.timeEnterMode=!0;const X=e.modelValue,Z=m.value;(typeof X!=typeof Z||JSON.stringify(X)!==JSON.stringify(Z))&&n("input",m.value),e.open!==null&&(u.visible=e.open),a.provide(Jh,{props:e,focus:()=>z()})});const _=a.ref(null),ce=X=>{var Z;if(u.disableCloseUnderTransfer)return u.disableCloseUnderTransfer=!1,!1;if(X&&X.type==="mousedown"&&u.visible){X.preventDefault(),X.stopPropagation();return}if(u.visible){const se=(Z=_==null?void 0:_.value)==null?void 0:Z.$el;if(X&&se&&se.contains(X.target))return;u.visible=!1,X==null||X.preventDefault(),X==null||X.stopPropagation();return}u.isFocused=!1,u.disableClickOutSide=!1},re=()=>{var X,Z;(X=J==null?void 0:J.value)==null||X.focus(),(Z=J==null?void 0:J.value)==null||Z.click()},ae=()=>{e.readonly||e.disabled||v!=null&&v.value&&(u.showClose=!0)},ue=X=>{u.showClose=!1},ie=X=>{a.nextTick(()=>{var Z;n("change",p.value,X),n("update:modelValue",m.value),e.type.indexOf("time")<0&&((Z=J==null?void 0:J.value)==null||Z.blur())})},Y=X=>{var $;const Z=e.type.includes("range")||e.multiple,se=v.value,Me=X.target.value,j=Di(Me,e.type,e.multiple,e.format),B=Z?j:j[0],V=($=e.disableDate)==null?void 0:$.call(e,B),H=j.reduce((te,ye)=>te&&ye instanceof Date,!0);Me!==se&&!V&&H?(ie(e.type),u.internalValue=j):u.forceInputRerender=u.forceInputRerender+1},W=X=>{e.readonly||(u.isFocused=!0,!(X&&X.type==="focus")&&(e.disabled||(u.visible=!0)))},Q=()=>{var X;(X=_==null?void 0:_.value)==null||X.reset()},F=X=>{var Z,se;if(u.internalFocus){u.internalFocus=!1;return}if(u.visible){X.preventDefault();return}u.isFocused=!1,h(e.type),u.internalValue=u.internalValue.slice(),Q(),(Z=_==null?void 0:_.value)==null||Z.onToggleVisibility(!1),(se=i==null?void 0:i.validate)==null||se.call(i,"blur")},K=X=>{const{keyCode:Z}=X;if(Z===9&&u.visible)if(X.stopPropagation(),X.preventDefault(),x.value){const Me=".bk-picker-confirm > *",j=ne.value.$el.querySelectorAll(Me);u.internalFocus=!0,[...j][X.shiftKey?"pop":"shift"]().focus()}else ce();const se=[37,38,39,40];if(!u.visible&&se.includes(Z)){u.visible=!0;return}Z===27&&u.visible&&(X.stopPropagation(),ce()),!!se.includes(Z)&&u.focusedTime.active&&X.preventDefault()},fe=()=>{u.visible=!1,u.internalValue=u.internalValue.map(()=>null),n("clear"),ie(e.type),Q(),u.showClose=!1,u.shortcut=null,setTimeout(()=>h(e.type),500)},he=()=>{e.appendToBody&&(u.disableCloseUnderTransfer=!0)},Ce=()=>{var X;u.visible=!1,a.nextTick(()=>{n("pick-success")}),(X=J==null?void 0:J.value)==null||X.blur(),Q()},Ae=(X,Z=!1,se,Me)=>{let j=X;if(e.multiple){const V=j.getTime(),H=u.internalValue.findIndex(ye=>ye&&ye.getTime()===V),te=[...u.internalValue,j].filter(Boolean).map(ye=>ye.getTime()).filter((ye,we,Ne)=>Ne.indexOf(ye)===we&&we!==H);u.internalValue=te.map(ye=>new Date(ye))}else j=Di(X,e.type,e.multiple,e.format),u.internalValue=Array.isArray(j)?j:[j];if(u.internalValue[0]){const[V]=u.internalValue;u.focusedDate=V}u.focusedTime=Te(U({},u.focusedTime),{time:u.internalValue.map(nl)}),x.value||(h(e.type),u.visible=Z),se==="upToNow"&&e.type==="daterange"&&Ce(),u.shortcut=Me,ie(se);const B=e.shortcuts.findIndex(V=>V===u.shortcut);n("shortcut-change",u.shortcut,B)},oe=a.ref(null);return console.error(w),console.error(w.value),Te(U({},a.toRefs(u)),{panel:w,publicStringValue:p,opened:y,visualValue:v,displayValue:L,isConfirm:x,hasHeader:k,hasFooter:C,hasShortcuts:b,fontSizeCls:I,longWidthCls:N,localReadonly:T,allowCrossDayProp:P,ownPickerProps:A,pickerDropdownRef:ne,inputRef:J,triggerRef:oe,pickerPanelRef:_,handleClose:ce,handleIconClick:re,handleInputMouseenter:ae,handleInputMouseleave:ue,handleFocus:W,handleBlur:F,handleKeydown:K,handleInputChange:Y,handleClear:fe,handleTransferClick:he,onPick:Ae,onPickSuccess:Ce})},render(){var n,i,l;const e=a.createVNode("div",null,[a.createVNode("span",{class:["icon-wrapper",this.disabled?"disabled":""],onClick:this.handleIconClick},[this.type==="time"||this.type==="timerange"?a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"time"},[a.createVNode("path",{fill:"#c4c6cc",d:"M512,128c51.9,0,102.2,10.1,149.5,30.2c45.7,19.3,86.8,47,122.1,82.3s63,76.4,82.3,122.1c20,47.3,30.2,97.6,30.2,149.5S886,614.3,865.9,661.6c-19.3,45.7-47,86.8-82.3,122.1s-76.4,63-122.1,82.3c-47.3,20-97.6,30.2-149.5,30.2S409.8,886.1,362.5,866c-45.7-19.3-86.8-47-122.1-82.3s-63-76.4-82.3-122.1c-20-47.3-30.2-97.6-30.2-149.5s10.1-102.2,30.2-149.5c19.3-45.7,47-86.8,82.3-122.1s76.4-63,122.1-82.3C409.8,138.1,460.1,128,512,128 M512,64C264.6,64,64,264.6,64,512s200.6,448,448,448s448-200.6,448-448S759.4,64,512,64L512,64z"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"512,512 512,256 448,256 448,512 448,576 512,576 768,576 768,512"},null)])]):a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"date"},[a.createVNode("path",{fill:"#c4c6cc",d:"M896,128h-96v64h64v112H160V192h64v-64h-96c-17.7,0-32,14.3-32,32v736c0,17.7,14.3,32,32,32h768c17.7,0,32-14.3,32-32V160C928,142.3,913.7,128,896,128z M160,864V368h704v496H160z"},null),a.createVNode("rect",{x:"416",y:"128",fill:"#c4c6cc",width:"192",height:"64"},null),a.createVNode("rect",{x:"288",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("rect",{x:"672",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"403.7,514.4 557.1,514.4 557.1,515.3 420.1,765.5 483.5,765.5 620.3,504.3 620.3,466.5 403.7,466.5"},null)])])]),a.createVNode("input",{type:"text",class:["bk-date-picker-editor",this.readonly?"readonly":"",this.fontSizeCls,this.behavior==="simplicity"?"only-bottom-border":""],ref:"inputRef",key:this.forceInputRerender,readonly:this.localReadonly,disabled:this.disabled,placeholder:this.placeholder,value:this.displayValue,onFocus:this.handleFocus,onClick:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onChange:this.handleInputChange},null),this.clearable&&this.showClose?a.createVNode(cn,{onClick:this.handleClear,class:"clear-action"},null):""]),t=this.hasShortcuts?{shortcuts:()=>{var o,c;return((c=(o=this.$slots).shortcuts)==null?void 0:c.call(o))||null}}:{};return a.withDirectives(a.createVNode("div",{class:["bk-date-picker",this.type==="datetimerange"?"long":"",this.longWidthCls]},[a.createVNode("div",{ref:"triggerRef",class:"bk-date-picker-rel",onMouseenter:this.handleInputMouseenter,onMouseleave:this.handleInputMouseleave},[(l=(i=(n=this.$slots).trigger)==null?void 0:i.call(n))!=null?l:e]),a.createVNode(a.Teleport,{to:"body",disabled:!this.appendToBody},{default:()=>[a.createVNode(a.Transition,{name:"bk-fade-down-transition"},{default:()=>[a.withDirectives(a.createVNode(Vc,{class:[this.appendToBody?"bk-date-picker-transfer":""],ref:"pickerDropdownRef",triggerRef:this.triggerRef,placement:this.placement,extPopoverCls:this.extPopoverCls,appendToBody:this.appendToBody,onClick:this.handleTransferClick},{default:()=>{var o,c,f,u,h,m;return[this.hasHeader?a.createVNode("div",{class:["bk-date-picker-top-wrapper",this.headerSlotCls]},[(f=(c=(o=this.$slots).header)==null?void 0:c.call(o))!=null?f:null]):null,a.createVNode(_h,{ref:"pickerPanelRef",clearable:this.clearable,confirm:this.isConfirm,shortcuts:this.shortcuts,multiple:this.multiple,shortcutClose:this.shortcutClose,value:this.internalValue,startDate:this.startDate,disableDate:this.disableDate,onPick:this.onPick,"onPick-clear":this.handleClear,"onPick-success":this.onPickSuccess,disabledHours:this.ownPickerProps.disabledHours,disabledMinutes:this.ownPickerProps.disabledMinutes,disabledSeconds:this.ownPickerProps.disabledSeconds},t),this.hasFooter?a.createVNode("div",{class:["bk-date-picker-footer-wrapper",this.footerSlotCls]},[(m=(h=(u=this.$slots).footer)==null?void 0:h.call(u))!=null?m:null]):null]}}),[[a.vShow,this.opened]])]})]})]),[[a.resolveDirective("clickoutside"),this.handleClose]])}});const Zh=He(by);var Hn=(e=>(e.OBJECT_ARRAY="objectArray",e.BASE_ARRAY="baseArray",e.NOT_ARRAY="notArray",e))(Hn||{});const Cy={title:g.arrayOf(g.string).def([]),extCls:g.string.def(""),searchPlaceholder:g.string.def(""),settingKey:g.string.def("id"),displayKey:g.string.def("value"),sortKey:g.string.def("value"),showOverflowTips:g.bool.def(!1),searchable:g.bool.def(!1),sortable:g.bool.def(!1),sourceList:g.arrayOf(g.any).def([]),targetList:g.arrayOf(g.any).def([]),emptyContent:g.arrayOf(g.string).def([])};function My(e,t,n){const i=a.ref([]),l=a.ref([]),o=()=>{e.value.forEach(c=>{const f=c[n.value];t.value.includes(f)?l.value.push(c):i.value.push(c)})};return o(),a.watch(()=>[e,t,n],o),{selectList:i,selectedList:l}}function wy(e,t){const n=a.ref(""),i=a.computed(()=>e.value.filter(l=>{const o=l[t.value];return o instanceof Object?!1:o.toString().includes(n.value)}));return{selectSearchQuery:n,selectListSearch:i}}var vy=a.defineComponent({name:"Transfer",props:Cy,emits:["change","update:targetList"],setup(e,{emit:t}){const n=a.computed(()=>Array.isArray(e.sourceList)?e.sourceList.every(b=>b.toString().includes("[object Object]"))?Hn.OBJECT_ARRAY:Hn.BASE_ARRAY:Hn.NOT_ARRAY),i=a.computed(()=>n.value===Hn.BASE_ARRAY?"value":e.settingKey),l=a.computed(()=>n.value===Hn.BASE_ARRAY?"value":e.displayKey),o=a.computed(()=>e.sortKey||l.value),c=a.computed(()=>{switch(n.value){case Hn.BASE_ARRAY:return[...new Set(e.sourceList)].map(C=>({value:C}));case Hn.OBJECT_ARRAY:return[...e.sourceList];default:return[]}}),{targetList:f}=a.toRefs(e),{selectList:u,selectedList:h}=My(c,f,i),{selectSearchQuery:m,selectListSearch:p}=wy(u,l),w=a.computed(()=>[...p.value].sort((C,b)=>{const I=C[o.value],N=b[o.value];return I>N?1:-1})),y=a.computed(()=>[...h.value].sort((C,b)=>{const I=C[o.value],N=b[o.value];return I>N?1:-1})),v=()=>{u.value=[],h.value=[...c.value],k()},L=()=>{u.value=[...c.value],h.value=[],k()},x=(C,b)=>{const I=b?u:h,N=b?h:u,T=I.value.findIndex(A=>A[i.value]===C);N.value.push(...I.value.splice(T,1)),k()},k=()=>{const C=u.value.map(I=>I[i.value]),b=h.value.map(I=>I[i.value]);t("update:targetList",b),t("change",n.value===Hn.BASE_ARRAY?C:u.value.map(I=>a.toRaw(I)),n.value===Hn.BASE_ARRAY?b:h.value.map(I=>a.toRaw(I)),b)};return{selectSearchQuery:m,selectListSearch:p,selectedList:h,selectListSort:w,selectedListSort:y,settingCode:i,displayCode:l,allToRight:v,allToLeft:L,handleItemClick:x}},render(){const e=this.sortable?this.selectListSort:this.selectListSearch,t=this.sortable?this.selectedListSort:this.selectedList,n=c=>{var p,w;const f=c==="left-header",u=f?`${(p=this.title[0])!=null?p:"\u5DE6\u4FA7\u5217\u8868"}`:`${(w=this.title[1])!=null?w:"\u53F3\u4FA7\u5217\u8868"}`,h=f?!e.length:!t.length,m=()=>{h||(f?this.allToRight():this.allToLeft())};return this.$slots[c]?a.createVNode("div",{class:"slot-header"},[this.$slots[c]()]):a.createVNode("div",{class:"header"},[`${u}\uFF08\u5171${f?e.length:t.length}\u6761\uFF09`,a.createVNode("span",{class:{disabled:h},onClick:()=>m()},[f?"\u5168\u90E8\u6DFB\u52A0":"\u6E05\u7A7A"])])},i=c=>{var h;const f=c==="left-empty-content",u=(h=f?this.emptyContent[0]:this.emptyContent[1])!=null?h:f?"\u65E0\u6570\u636E":"\u672A\u9009\u62E9\u4EFB\u4F55\u9879";return this.$slots[c]?a.createVNode("div",null,[this.$slots[c]()]):a.createVNode("div",{class:"empty"},[u])},l=(c,f=!0)=>a.createVNode("div",{class:"item-content"},[a.createVNode("span",{class:"content-text",title:c[this.displayCode]},[c[this.displayCode]]),a.createVNode("span",{class:"icon-wrapper"},[f?a.createVNode(Po,{class:"bk-icon"},null):a.createVNode(An,{class:"bk-icon"},null)])]),o=c=>{const f=c==="left",u=f?e:t,h=f?"source-option":"target-option",m=f?"left-empty-content":"right-empty-content";return u.length?a.createVNode("ul",{class:["content",this.searchable&&f?"is-search":""]},[u.map(p=>{var w,y,v;return a.createVNode("li",{key:p[this.settingCode],class:[this.$slots[h]?"custom-item":""],onClick:()=>this.handleItemClick(p[this.settingCode],f)},[(v=(y=(w=this.$slots)[h])==null?void 0:y.call(w,p))!=null?v:l(p,f)])})]):i(m)};return a.createVNode("div",{class:["bk-transfer",this.extCls]},[a.createVNode("div",{class:"source-list"},[n("left-header"),this.searchable&&a.createVNode(Ui,{modelValue:this.selectSearchQuery,"onUpdate:modelValue":c=>this.selectSearchQuery=c,class:"transfer-search-input",clearable:!0,placeholder:this.searchPlaceholder||"\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u5B57",type:"search","left-icon":"bk-icon icon-search"},null),o("left")]),a.createVNode("div",{class:"transfer"},null),a.createVNode("div",{class:"target-list"},[n("right-header"),o("right")])])}});const Gh=He(vy);var Pr=(e=>(e.NODE_CLICK="nodeClick",e.NODE_COLLAPSE="nodeCollapse",e.NODE_EXPAND="nodeExpand",e.NODE_CHECKED="nodeChecked",e))(Pr||{});const il=(...e)=>!0,Iy={nodeClick:il,nodeCollapse:il,nodeExpand:il,nodeChecked:il};var de=(e=>(e.DEPTH="__depth",e.INDEX="__index",e.UUID="__uuid",e.PARENT_ID="__parent_id",e.HAS_CHILD="__has_child",e.PATH="__path",e.IS_ROOT="__is_root",e.ORDER="__order",e.IS_OPEN="__is_open",e.IS_CHECKED="__is_checked",e.IS_SELECTED="__is_selected",e.IS_ASYNC_INIT="__is_async_init",e.IS_MATCH="__is_match",e.IS_NULL="__IS_NULL",e.IS_CACHED="__is_cached",e.IS_ASYNC="__is_async",e.IS_LOADING="__is_loading",e.TREE_NODE_ATTR="__attr__",e))(de||{});const ji={__is_open:"isOpen",__is_selected:"selected",__is_match:"isMatch",__has_child:"hasChild",__is_checked:"checked",__is_async:"async",__is_loading:"loading",__is_root:"isRoot"},Ny={data:g.arrayOf(g.any).def([]),label:g.oneOfType([g.func.def(void 0),g.string.def("label")]),nodeKey:g.string.def(void 0),children:g.string.def("children"),indent:g.number.def(18),lineHeight:g.number.def(32),levelLine:g.oneOfType([g.bool.def(!1),g.func.def(void 0),g.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:g.bool.def(!1),prefixIcon:g.oneOfType([g.func.def(()=>{}),g.bool.def(!1)]).def(!0),async:g.shape({callback:g.func.def(void 0),cache:g.bool.def(!0),deepAutoOpen:g.commonType(["once","every"],"columnType").def("once")}),offsetLeft:g.number.def(5),search:g.oneOfType([g.shape({value:g.oneOfType([g.number,g.string,g.bool]).def(""),match:g.oneOfType([g.commonType(["fuzzy","full"],"TreeSearchMatchType"),g.func]),resultType:g.commonType(["tree","list"],"TreeSearchResultType").def("tree"),openResultNode:g.bool}),g.string,g.number,g.bool]).def(void 0),emptyText:g.string.def("\u6CA1\u6709\u6570\u636E"),draggable:g.bool.def(!1),dragSort:g.bool.def(!1),selectable:g.bool.def(!0),showCheckbox:g.bool.def(!1),showNodeTypeIcon:g.bool.def(!0),selected:g.oneOfType([g.string,null,g.number,g.object]).def(null),autoCheckChildren:g.bool.def(!0),autoOpenParentNode:g.bool.def(!0)};var Ly=(e,{slots:t})=>({renderEmpty:n=>a.createVNode(Ps,{scene:"part",type:n},{default:()=>{var i,l;return[(l=(i=t.default)==null?void 0:i.call(t))!=null?l:e.emptyText]}})}),al=(e,t)=>{const n=E=>e.schema.get(E),i=(E,ne)=>{var _;return(_=n(E[de.UUID]))==null?void 0:_[ne]},l=(E,ne,_)=>{e.schema.set(E[de.UUID],Te(U({},n(E[de.UUID])),{[ne]:_}))},o=E=>i(E,de.PATH),c=E=>i(E,de.UUID),f=E=>i(E,de.IS_ROOT),u=E=>i(E,de.IS_OPEN),h=E=>i(E,de.HAS_CHILD),m=E=>i(E,de.IS_MATCH),p=E=>i(E,de.IS_CHECKED),w=E=>i(E,de.PARENT_ID),y=E=>i({[de.UUID]:E},de.PARENT_ID),v=E=>i(E,de.IS_LOADING),L=(E,ne)=>{l(E,de.IS_LOADING,ne)},x=E=>e.schema.delete(E),k=E=>n(w(E)),C=E=>{var ne;return typeof E=="object"?u(E):typeof E=="string"?(ne=n(E))==null?void 0:ne[de.IS_OPEN]:!1},b=E=>C(i(E,de.PARENT_ID)),I=E=>f(E)||b(E),N=E=>E.split("-").reduce((_,ce)=>{const re=Number(ce);return Array.isArray(_)?_[re]:_[t.children][re]},t.data),T=E=>{const ne=e.schema;return Array.prototype.filter.call(Array.from(ne.keys()),_=>ne.get(_)[de.PARENT_ID]===E[de.UUID])},A=E=>N(o({[de.UUID]:E})),P=E=>f({[de.UUID]:E})?{[t.children]:t.data}:A(y(E)),J=E=>({[ji[de.IS_LOADING]]:i(E,de.IS_LOADING),[ji[de.HAS_CHILD]]:h(E),[ji[de.IS_MATCH]]:m(E),[ji[de.IS_CHECKED]]:p(E),[ji[de.IS_OPEN]]:u(E),[ji[de.IS_ROOT]]:f(E),fullPath:i(E,de.PATH),uuid:c(E),parentId:i(E,de.PARENT_ID)});return{getSchemaVal:n,getNodeAttr:i,getNodeId:c,getNodeParentId:w,getNodeParentIdById:y,getParentNodeData:P,getParentNode:k,setNodeAttr:l,getNodePath:o,isRootNode:f,isNodeOpened:u,hasChildNode:h,isItemOpen:C,isNodeChecked:p,isNodeMatched:m,isNodeLoading:v,checkNodeIsOpen:I,getSourceNodeByPath:N,getSourceNodeByUID:A,deleteNodeSchema:x,resolveScopedSlotParam:J,setTreeNodeLoading:L,extendNodeAttr:E=>Te(U({},E),{[de.TREE_NODE_ATTR]:J(E)}),getChildNodes:T}};const Fh="1px dashed #c3cdd7",Yh=(e,t,n=null,i=null,l=null,o=[])=>{const c=e[t];return typeof c=="boolean"?c?i:l:Uh(n,e,t,o)},Uh=(e,t,n,i=[])=>{const l=t[n];if(typeof l=="string")return typeof e=="object"&&e!==null?(Object.prototype.hasOwnProperty.call(e,l)||console.error(`cannot find node label with key ${l}`),e[l]):l;if(typeof l=="function"){const o=l.apply(globalThis,[e,...i]);if(typeof o=="string")return o;console.error("props label with function return value is not string, please check and return string");return}},$h=(e,t)=>Uh(e,t,"label"),Gc=(e,t)=>e.get(t)||{},ky=(e,t,n)=>{var i;return(i=Gc(e,t))==null?void 0:i[n]},Ty=(e,t)=>({"--level-line":Yh(t,"levelLine",e,Fh,null,["tree"]),"--lineHeight":`${t.lineHeight}px`,"--indent":`${t.indent}px`,"--offset-left":`${t.offsetLeft}px`}),xy=(e,t,n={})=>{const{schema:i}=n,l=ky(i,e[de.UUID],de.DEPTH);return U({"--depth":l},typeof t.levelLine=="function"?{"--level-line":Yh(t,"levelLine",e,Fh,null,["node"])}:{})},Sy=(e,t,n)=>{const{__is_root:i,__is_open:l}=Gc(t,e[de.UUID])||{};return{"is-root":i,"bk-tree-node":!0,"is-open":l,"is-virtual-render":n.virtualRender,"level-line":n.levelLine}},Dy=(e,t)=>{const{__is_checked:n,__is_selected:i}=Gc(t,e[de.UUID])||{};return{"is-checked":n,"is-selected":i,[_e("node-row")]:!0}},jy=(e,t,n,i,l)=>{zy(e,t,n,{[i]:l})},zy=(e,t,n,i)=>{const o=e.split("-").reduce((c,f)=>{const u=Number(f);return Array.isArray(c)?c[u]:c[n][u]},t);Object.assign(o,i||{})},Or=e=>e==null?{__IS_NULL:!0}:typeof e=="string"||typeof e=="number"||typeof e=="symbol"?{[de.UUID]:e}:(Object.prototype.hasOwnProperty.call(e,de.UUID)||console.error("setNodeAction Error: node id cannot found"),e);var Xh=(e,t)=>{const{setNodeAttr:n,getNodePath:i,getNodeAttr:l,resolveScopedSlotParam:o,setTreeNodeLoading:c}=al(t,e),f=(m,p)=>{if(typeof m=="object"&&m!==null){n(p,de.IS_OPEN,!0);const w=Array.isArray(m)?m:[m];return jy(i(p),e.data,e.children,e.children,w),Promise.resolve(m)}return Promise.resolve(m)},u=m=>{const{callback:p=null,cache:w=!0}=e.async||{};if(typeof p=="function"&&l(m,de.IS_ASYNC)){if(n(m,de.IS_ASYNC_INIT,!0),!l(m,de.IS_CACHED)){n(m,de.IS_CACHED,w);const y=o(m),v=p(m,L=>f(L,m),y);if(typeof v=="object"&&v!==null)return c(m,!0),v instanceof Promise?Promise.resolve(v.then(L=>f(L,m)).catch(L=>console.error("load remote data error:",L)).finally(()=>{c(m,!1),n(m,de.IS_CACHED,!0)})):(f(v,m),c(m,!1),Promise.resolve(!0))}return Promise.resolve(!0)}return Promise.resolve(!0)},h=()=>{const m=t.data.filter(p=>l(p,de.IS_ASYNC)&&p[ji[de.IS_OPEN]]&&!l(p,de.IS_ASYNC_INIT));m.length&&Promise.all(m.map(p=>u(p))).then(()=>{h()}).catch(p=>{console.warn(p)})};return{asyncNodeClick:u,deepAutoOpen:h}},Py=(e,t,n,i,l,o)=>{let c=e.selected;const{setNodeAttr:f,getNodePath:u,getSchemaVal:h,getNodeAttr:m,getNodeId:p,getChildNodes:w,isRootNode:y,hasChildNode:v,isItemOpen:L,isNodeOpened:x,isNodeLoading:k,isNodeChecked:C,getParentNode:b,resolveScopedSlotParam:I,extendNodeAttr:N}=al(n,e),{registerNextLoop:T}=o,{asyncNodeClick:A,deepAutoOpen:P}=Xh(e,n),J=Z=>L(Z)?a.createVNode(Ro,{class:[_e("tree-icon"),_e("node-prefix")]},null):a.createVNode(Wo,{class:[_e("tree-icon"),_e("node-prefix")]},null),z=Z=>{if(typeof Z=="string")return Z;if(typeof Z=="object"&&Z!==null){if(Z.__v_isVNode)return Z;const{node:se,className:Me,text:j,style:B}=Z;return a.h(se,{class:Me,style:B},j)}return null},E=Z=>{var se,Me,j;return((j=(Me=(se=t.slots).nodeLoading)==null?void 0:Me.call(se,N(Z)))!=null?j:k(Z))?a.createVNode(pr,null,null):""},ne=Z=>{if(t.slots.nodeAction)return t.slots.nodeAction(N(Z));let se=null;return k(Z)?E(Z):typeof e.prefixIcon=="function"&&(se=e.prefixIcon(N(Z),"node_action"),se!=="default")?z(se):(se==="default"||typeof e.prefixIcon=="boolean"&&e.prefixIcon)&&(v(Z)||Z.async||!e.autoCheckChildren)?L(Z)?a.createVNode(Ns,{class:_e("node-prefix")},null):a.createVNode(Ss,{class:_e("node-prefix")},null):null},_=Z=>{if(!e.showNodeTypeIcon)return null;if(t.slots.nodeType)return t.slots.nodeType(N(Z));let se=null;return typeof e.prefixIcon=="function"&&(se=e.prefixIcon(N(Z),"node_type"),se!=="default")?z(se):se==="default"||typeof e.prefixIcon=="boolean"&&e.prefixIcon?y(Z)||v(Z)?J(Z):a.createVNode(Fo,{class:[_e("tree-icon"),_e("node-prefix")]},null):null},ce=(Z,se)=>{const Me=b(Z);Me&&(f(Me,de.IS_CHECKED,se),y(Me)||ce(Me,se))},re=(Z,se,Me)=>{w(Z).forEach(j=>{f({[de.UUID]:j},se,Me),re({[de.UUID]:j},se,Me)})},ae=(Z,se)=>{f(Z,de.IS_CHECKED,!!se),re(Z,de.IS_CHECKED,!!se),ce(Z,se),t.emit(Pr.NODE_CHECKED,l.value.filter(Me=>C(Me)).map(Me=>Me[de.UUID]))},ue=Z=>C(Z)&&!l.value.filter(se=>{var Me;return(Me=u(se))==null?void 0:Me.startsWith(u(Z))}).every(se=>C(se)),ie=Z=>C(Z)||l.value.filter(se=>{var Me;return(Me=u(se))==null?void 0:Me.startsWith(u(Z))}).some(se=>C(se)),Y=Z=>e.showCheckbox?a.createVNode(Ii,{size:"small",modelValue:ie(Z),indeterminate:ue(Z),onChange:se=>ae(Z,se)},null):null,W=(Z,se=null,Me=null,j=!0)=>{const B=se===null?!L(Z):!!se;if(B||re(Z,de.IS_OPEN,B),f(Z,de.IS_OPEN,B),j){const V=L(Z)?Pr.NODE_EXPAND:Pr.NODE_COLLAPSE;t.emit(V,Z,I(Z),h(Z[de.UUID]),Me)}},Q=(Z,se,Me)=>{if(Array.isArray(Z)){Z.forEach(j=>f(Or(j),se,Me));return}f(Or(Z),se,Me)},F=(Z,se=!0,Me=!1)=>{const j=Or(Z);if(!j[de.IS_NULL])if(Me)if(se){if(Q(j,de.IS_OPEN,!0),!y(j)){const B=m(j,de.PARENT_ID);F(B,!0,!0)}}else W(j,!1,null,!1);else Q(j,de.IS_OPEN,se)},K=(Z,se)=>{if(x(Z)){W(Z,!1,se);return}A(Z).finally(()=>{m(Z,de.IS_LOADING)?T("setNodeOpenedAfterLoading",{type:"once",fn:()=>W(Z,!0,se)}):W(Z,!0,se)})},fe=(Z,se)=>{Z.stopImmediatePropagation(),Z.stopPropagation(),Z.preventDefault(),K(se,Z)},he=(Z,se=!0,Me=!0)=>{const j=Array.isArray(Z)?Z:[Z];if(!j.length)return;const B=Or(j[0]);B[de.IS_NULL]||(e.selectable?(c!=null&&f({[de.UUID]:c},de.IS_SELECTED,!se),e.selected&&e.selected!==c&&f({[de.UUID]:e.selected},de.IS_SELECTED,!se),f(B,de.IS_SELECTED,se),c=p(B),Me&&j.length===1&&F(B,!0,!0),m(B,de.IS_ASYNC)&&A(B).then(()=>{a.nextTick(()=>{j.shift(),he(j,se,Me)})})):console.warn("props.selectable is false or undefined, please set selectable with true"))},Ce=(Z,se)=>{he(Z,!0,!1),x(Z)||K(Z,se);const Me=Pr.NODE_CLICK;t.emit(Me,Z,I(Z),h(Z[de.UUID]),se)},Ae=(Z,se)=>{if(y(se))return!1;const Me=u(se),j=`${Me}`.split("-").slice(0,Z+1);if(j.join("-")===Me)return!0;const V=j.pop(),H=parseInt(V,10);j.push(`${H+1}`);const $=j.join("-");return l.value.some(te=>te[de.PATH]===$)},oe=Z=>{if(!e.levelLine)return null;const se=j=>({"--depth":j}),Me=m(Z,de.DEPTH)+1;return new Array(Me).fill("").map((j,B)=>B).filter(j=>Ae(j,Z)).filter(j=>j>0).map(j=>a.createVNode("span",{class:"node-virtual-line",style:se(Me-j)},null))};return{renderTreeNode:Z=>{var se,Me,j,B,V;return a.createVNode("div",{"data-tree-node":p(Z),key:p(Z),class:Dy(Z,n.schema)},[a.createVNode("div",{class:Sy(Z,n.schema,e),style:xy(Z,e,n),onClick:H=>Ce(Z,H)},[a.createVNode("span",{class:[_e("node-action")],onClick:H=>fe(H,Z)},[ne(Z)]),a.createVNode("span",{class:_e("node-content")},[[Y(Z),_(Z)],a.createVNode("span",{class:_e("node-text")},[(j=(Me=(se=t.slots).node)==null?void 0:Me.call(se,N(Z)))!=null?j:[$h(Z,e)]]),(V=(B=t.slots).nodeAppend)==null?void 0:V.call(B,N(Z))]),oe(Z)])])},hanldeTreeNodeClick:K,deepAutoOpen:P,asyncNodeClick:A,setNodeAction:Q,setNodeOpened:W,setSelect:he,setOpen:F}},Oy=(e,t,n)=>{const{getSourceNodeByUID:i,getNodeParentIdById:l,getParentNodeData:o,getNodeAttr:c,getNodePath:f,isRootNode:u}=al(n,e),h=C=>C.target.closest("[data-tree-node]"),m=C=>{h(C).removeEventListener("mouseup",m)},p=C=>{const b=h(C);b.setAttribute("draggable","true"),b.addEventListener("mouseup",m)},w=C=>{C.preventDefault();const b=h(C),I=C.dataTransfer.getData("node-id"),N=b.getAttribute("data-tree-node"),T=L(I,N)?"move":"none";C.dataTransfer.effectAllowed=T,C.dataTransfer.dropEffect=T},y=C=>{C.dataTransfer.effectAllowed="move",C.dataTransfer.dropEffect="move";const b=h(C);C.dataTransfer.setData("text/plain",""),C.dataTransfer.setData("node-id",b.getAttribute("data-tree-node"))},v=C=>{C.preventDefault(),C.stopPropagation();const b=h(C),I=C.dataTransfer.getData("node-id"),N=b.getAttribute("data-tree-node");Reflect.apply(e.dragSort?x:k,globalThis,[I,N])},L=(C,b)=>{const I=f({[de.UUID]:C}),N=f({[de.UUID]:b}),T=l(C),A=l(b);return T===A?!0:I.indexOf(N)===-1&&N.indexOf(I)===-1},x=(C,b)=>{if(!L(C,b))return;const I=JSON.parse(JSON.stringify(i(C))),N=JSON.parse(JSON.stringify(i(b))),T=o(C),A=o(b),P=c({[de.UUID]:C},de.INDEX),J=c({[de.UUID]:b},de.INDEX);T==null||T[e.children].splice(P,1,N),A==null||A[e.children].splice(J,1,I)},k=(C,b)=>{const I=i(C),N=i(b);let T=null;if(u({[de.UUID]:C}))T=e.data;else{const A=l(C);if(A!=null){T=i(A);const P=c({[de.UUID]:C},de.INDEX);T==null||T[e.children].splice(P,1)}}N[e.children]||(N[e.children]=[]),N[e.children].unshift(I)};a.onMounted(()=>{if(e.draggable&&t.value){const C=t.value.$el;C.addEventListener("mousedown",p),C.addEventListener("dragstart",y),C.addEventListener("dragover",w),C.addEventListener("drop",v)}}),a.onUnmounted(()=>{if(e.draggable&&t.value){const C=t.value.$el;C.removeEventListener("mousedown",p),C.removeEventListener("dragstart",y),C.removeEventListener("dragover",w),C.removeEventListener("drop",v)}})},Ey=e=>{var w;const t=a.toRef(e,"search"),{openResultNode:n=!1,resultType:i="tree"}=(w=e.search)!=null?w:{},l=y=>["string","number","boolean"].includes(typeof y),o=(y,v)=>y===v,c=(y,v)=>new RegExp(`${y}`,"i").test(`${v}`),f=(y,v)=>Reflect.apply(y,globalThis,v),u=t.value===void 0||t.value===!1,h=(y,v)=>{if(u)return!0;if(l(t.value))return f(c,[t.value,y,v]);const{value:L="",match:x="fuzzy"}=t.value,C=typeof x=="function"?x:x==="fuzzy"?c:o;return`${L}`.length===0?!0:f(C,[L,y,v])},m=a.computed(()=>t.value!==!1&&(l(t.value)?`${t.value}`.length>0:typeof t.value=="object"));return{searchFn:h,refSearch:t,isSearchActive:m,isSearchDisabled:u,openResultNode:n,resultType:i,isTreeUI:i==="tree"}},Ay=e=>{var x;const t=(k,C=void 0,b=[])=>{const{data:I,children:N}=k,T=[],A=[];let P=0;const J=new Map;function z(ie,Y,W,Q){if(ie!=null&&J.has(ie)&&![de.UUID,de.PARENT_ID].includes(Y)){const F=J.get(ie);Object.prototype.hasOwnProperty.call(F,Y)&&typeof Q=="function"&&Reflect.apply(Q,self,[F,Y,W])&&(Object.assign(F,{[Y]:W}),z(F[de.PARENT_ID],Y,W,Q))}}function E(ie){let Y=null;return typeof k.nodeKey=="string"&&(Y=ie[k.nodeKey]||Bi.v4()),Y||ie[de.UUID]||Bi.v4()}const ne={[de.IS_OPEN]:()=>!1,[de.IS_CHECKED]:()=>!1,[de.IS_MATCH]:()=>!0,[de.IS_SELECTED]:ie=>k.selected===ie,[de.IS_CACHED]:()=>!1,[de.IS_ASYNC]:()=>null,[de.IS_LOADING]:()=>!1};function _(ie,Y,W,Q=void 0){let F=Q;Q===void 0&&typeof ne[W]=="function"&&(F=ne[W](ie,Y));const K=ji[W];if(Object.prototype.hasOwnProperty.call(Y,K))return Y[K];const fe=(b||[]).find(Ce=>Ce[de.UUID]===ie);let he;return fe&&(he=fe[W]),he==null&&(he=F),he}function ce(ie,Y){return k.selectable?_(ie,Y,de.IS_SELECTED,k.selected===ie):!1}function re(ie,Y,W){var K;const Q=_(ie,Y,de.IS_OPEN),F=J.has(W)?(K=J.get(W))==null?void 0:K[de.IS_OPEN]:!0;return Q&&F}function ae(ie){return!ie[de.IS_OPEN]}function ue(ie,Y=0,W=null,Q=null){const F=ie.length;for(let K=0;K<F;K++){const fe=ie[K];if(Array.isArray(fe))ue(fe,Y,W,Q);else if(typeof fe=="object"&&fe!==null){const he=Q!==null?`${Q}-${K}`:`${K}`,Ce=`${E(fe)}`,Ae=!!(fe[N]||[]).length;let oe=_(Ce,fe,de.IS_OPEN);k.autoOpenParentNode?oe&&z(W,de.IS_OPEN,!0,ae):oe=re(Ce,fe,W),Object.assign(fe,{[de.UUID]:Ce});const X=k.showCheckbox&&_(Ce,fe,de.IS_CHECKED);X&&T.push(Ce),J.set(Ce,{[de.DEPTH]:Y,[de.INDEX]:K,[de.UUID]:Ce,[de.PARENT_ID]:W,[de.HAS_CHILD]:Ae,[de.PATH]:he,[de.IS_ROOT]:W===null,[de.ORDER]:P,[de.IS_SELECTED]:ce(Ce,fe),[de.IS_MATCH]:_(Ce,fe,de.IS_MATCH),[de.IS_OPEN]:oe,[de.IS_CHECKED]:X,[de.IS_CACHED]:_(Ce,fe,de.IS_CACHED),[de.IS_ASYNC]:_(Ce,fe,de.IS_ASYNC),[de.IS_LOADING]:_(Ce,fe,de.IS_LOADING),[N]:null}),P+=1,A.push(Te(U({},JSON.parse(JSON.stringify(fe,(Z,se)=>Z===k.children?null:se))),{[de.IS_OPEN]:oe,[N]:null})),Object.prototype.hasOwnProperty.call(fe,N)&&ue(fe[N]||[],Y+1,Ce,he)}}}return ue(C||I),k.showCheckbox&&(T==null||T.forEach(ie=>{Array.from(J.values()).filter(Y=>{var W;return(W=Y[de.PATH])==null?void 0:W.startsWith(J.get(ie)[de.PATH])}).forEach(Y=>Object.assign(Y,{[de.IS_CHECKED]:!0})),z(ie,de.IS_CHECKED,!0,()=>!0)})),[A,J]},n=t(e),i=new Map,l=[],o=[],c=a.reactive({data:n[0],schema:n[1],levelLineSchema:{}}),f=a.computed(()=>Array.from(c.schema.values())),{asyncNodeClick:u,deepAutoOpen:h}=Xh(e,c),m=k=>{l.push(k)},p=(k,C,b=!0)=>{b&&i.has(k)&&i.delete(k),i.set(k,C)},w=k=>typeof k=="function"?{type:"loop",fn:k}:typeof k=="object"&&typeof k.type=="string"&&typeof k.fn=="function"?k:(console.error("loop event error",k),null),y=k=>{var b;const C=w(k);return C!==null&&Reflect.apply(C.fn,globalThis,[]),(b=C==null?void 0:C.type)!=null?b:"once"},v=()=>{Array.from(i.keys()).forEach(k=>{const C=i.get(k);if(Array.isArray(C)){const b=[];C.forEach((I,N)=>{y(I)==="once"&&b.unshift(N)}),b.length&&b.forEach(I=>C.splice(I,1)),C.length===0&&i.delete(k)}else y(C)==="once"&&i.delete(k)})};a.watch(()=>[e.data],k=>{var b,I;const C=t(e,k,f.value);c.data=C[0],c.schema=C[1],((b=e.async)==null?void 0:b.callback)&&((I=e.async)==null?void 0:I.deepAutoOpen)==="every"&&h(),v()},{deep:!0}),e.selectable&&a.watch(()=>e.selected,k=>{o.length=0,l.forEach(C=>{Reflect.apply(C,globalThis,[k]),o.push(()=>Reflect.apply(C,globalThis,[k]))}),p("afterSelectWatch",o)},{immediate:!0});const L=k=>{p("afterDataUpdate",k)};return(x=e.async)!=null&&x.callback&&h(),{flatData:c,schemaValues:f,asyncNodeClick:u,deepAutoOpen:h,afterDataUpdate:L,registerNextLoop:p,onSelected:m}},Vy=a.defineComponent({name:"Tree",props:Ny,emits:Iy,setup(e,t){const{flatData:n,schemaValues:i,onSelected:l,registerNextLoop:o}=Ay(e),{setNodeAttr:c,checkNodeIsOpen:f,getNodeAttr:u,getNodePath:h,isRootNode:m,isNodeOpened:p,isNodeChecked:w,isNodeMatched:y,hasChildNode:v}=al(n,e),{searchFn:L,isSearchActive:x,refSearch:k,openResultNode:C,isTreeUI:b,isSearchDisabled:I}=Ey(e);I||a.watch([k],()=>{n.data.forEach(Y=>{const W=L($h(Y,e),Y);c(Y,de.IS_MATCH,W),C&&z(Y,!0,!0)})});const N=Y=>{if(x.value){const W=()=>b?i.value.some(Q=>{var F;return((F=Q[de.PATH])==null?void 0:F.startsWith(h(Y)))&&Q[de.IS_MATCH]}):!1;return u(Y,de.IS_MATCH)||W()}return!0},T=a.computed(()=>n.data.filter(Y=>f(Y)&&N(Y))),{renderTreeNode:A,hanldeTreeNodeClick:P,setNodeOpened:J,setOpen:z,setNodeAction:E,setSelect:ne,asyncNodeClick:_}=Py(e,t,n,T,i,{registerNextLoop:o}),ce=(Y,W=!0)=>{E(Or(Y),de.IS_CHECKED,W)};l(Y=>{ne(Y,!0,e.autoOpenParentNode)});const re=()=>n;t.expose({hanldeTreeNodeClick:P,isNodeChecked:w,isRootNode:m,isNodeOpened:p,isNodeMatched:y,hasChildNode:v,setOpen:z,setChecked:ce,setNodeAction:E,setNodeOpened:J,setSelect:ne,asyncNodeClick:_,getData:re});const ae=a.ref(),{renderEmpty:ue}=Ly(e,t);Oy(e,ae,n);const ie=Y=>{if(Y.length)return Y.map(A);const W=x.value?"search-empty":"empty";return ue(W)};return()=>a.createVNode(xr,{class:_e("tree"),style:Ty(null,e),list:T.value,lineHeight:e.lineHeight,enabled:e.virtualRender,contentClassName:_e("container"),throttleDelay:0,ref:ae},{default:Y=>ie(Y.data||[])})}});const Kh=He(Vy),qh=e=>e.__v_isVNode;var Jy=a.defineComponent({name:"ComposeFormItem",props:{headBackgroundColor:{type:String,default:"#FAFBFD"},tailBackgroundColor:String},render(){if(!this.$slots.default)return null;const e=this.$slots.default();if(e.length>1){const t=e.length;let n=0,i=null;for(;n<t;){if(qh(e[n])){i=e[n];break}n=n+1}let l=t-1,o=null;for(;l>=0&&l>n;){if(qh(e[l])){o=e[l];break}l=l-1}if(i&&o){i.props||(i.props={});let c="bk-compose-form-item-head";i.props.class&&(c+=` ${i.props.class}`),this.headBackgroundColor&&(i.props.style=Object.assign(i.props.style||{},{"background-color":this.headBackgroundColor})),i.props.class=c,o.props||(o.props={});let f="bk-compose-form-item-tail";o.props.class&&(f+=` ${o.props.class}`),this.tailBackgroundColor&&(o.props.style=Object.assign(o.props.style||{},{"background-color":this.tailBackgroundColor})),o.props.class=f}}return a.h("div",{class:"bk-compose-form-item"},e)}});const Qy={formType:g.oneOf(["default","vertical"]).def("default"),labelWidth:g.oneOfType([Number,String]),labelPosition:g.oneOf(["left","center","right"]),model:g.object,rules:g.object};var Ry=a.defineComponent({name:"Form",props:Qy,emits:["submit"],setup(e,t){let n=[];const i=u=>{n.push(u)},l=u=>{n=n.reduce((h,m)=>(m!==u&&h.push(m),h),[])};return a.provide(bf,{props:e,register:i,unregister:l}),{handleSubmit:u=>{u.preventDefault(),t.emit("submit")},validate:u=>{let h={};return u?h=(typeof u=="string"?[u]:u).reduce((p,w)=>Te(U({},p),{[w]:!0}),{}):h=n.reduce((m,p)=>p.property?Te(U({},m),{[p.property]:!0}):m,{}),Promise.all(n.reduce((m,p)=>(h[p.property]&&m.push(p.validate()),m),[])).then(()=>Promise.resolve(e.model))},clearValidate:u=>{let h={};u?h=(typeof u=="string"?[u]:u).reduce((p,w)=>Te(U({},p),{[w]:!0}),{}):h=n.reduce((m,p)=>Te(U({},m),{[p.property]:!0}),{}),n.forEach(m=>h[m.property]&&m.clearValidate())}}},render(){var t,n;const e=Se({"bk-form":!0,[`bk-form--${this.formType}`]:!0});return a.createVNode("form",{class:e,onSubmit:this.handleSubmit},[(n=(t=this.$slots).default)==null?void 0:n.call(t)])}}),Ln={required:e=>e!==""&&e!==void 0&&e!==null,min:(e,t)=>e>=t,max:(e,t)=>t>=e,email:e=>/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/.test(e),maxlength:(e,t)=>e.length<=t,pattern:(e,t)=>t.test(e)};const Wy={label:g.string,labelWidth:g.oneOfType([Number,String]),labelPosition:g.oneOf(["left","center","right"]),property:g.string.def(""),required:g.bool.def(!1),email:g.bool.def(!1),max:g.number,min:g.number,maxlength:g.number,rules:g.array,autoCheck:g.bool.def(!1),description:g.string,errorDisplayType:g.oneOf(["tooltips","normal"]).def("normal")},Hy=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),By=e=>{const t=[];return e.required&&t.push({validator:Ln.required,message:`${e.label}\u4E0D\u80FD\u4E3A\u7A7A`,trigger:"blur"}),e.email&&t.push({validator:Ln.email,message:`${e.label}\u683C\u5F0F\u4E0D\u6B63\u786E`,trigger:"blur"}),Number(e.max)>-1&&t.push({validator:n=>Ln.max(n,e.max),message:`${e.label}\u6700\u5927\u503C${e.max}`,trigger:"blur"}),Number(e.min)>-1&&t.push({validator:n=>Ln.min(n,e.min),message:`${e.label}\u6700\u5C0F\u503C${e.min}`,trigger:"blur"}),Number(e.maxlength)>-1&&t.push({validator:n=>Ln.maxlength(n,e.maxlength),message:`${e.label}\u6700\u5927\u957F\u5EA6${e.maxlength}`,trigger:"blur"}),t},_y=(e,t)=>{const n=e.reduce((i,l)=>{let o;if(l.required)o=Ln.required;else if(l.email)o=Ln.email;else if(Number(l.max)>-1)o=c=>Ln.max(c,l.max);else if(Number(l.min)>-1)o=c=>Ln.min(c,l.max);else if(Number(l.maxlength)>-1)o=c=>Ln.min(c,l.max);else if(Object.prototype.toString.call(l.pattern)==="[object RegExp]")o=c=>Ln.pattern(c,l.pattern);else if(Object.prototype.toString.call(l.validator)==="[object Function]")o=l.validator;else return i;return i.push({validator:o,message:l.message,trigger:l.trigger}),i},[]);return[...t,...n]},Zy=(e,t)=>t.reduce((n,i)=>!i.trigger||!e?(n.push(i),n):((Array.isArray(i.trigger)?i.trigger:[i.trigger]).includes(e)&&n.push(i),n),[]),e9=e=>e!==void 0;var Gy=a.defineComponent({name:"FormItem",directives:{bkTooltips:dc},props:Wy,setup(e){const t=a.getCurrentInstance(),n=a.reactive({isError:!1,errorMessage:""}),i=s4(),l=Boolean(i),o=a.computed(()=>l?i.props.formType==="vertical":!1),c=a.computed(()=>{const h={width:"",paddingRight:"",textAlign:""},m=e9(e.labelWidth)?e.labelWidth:l&&i.props.labelWidth;e9(m)&&(h.width=`${m}px`,h.paddingRight=m?"":"0px");const p=e.labelPosition||l&&i.props.labelPosition;return p&&(h["text-align"]=p),h}),f=h=>{if(!e.property||l&&!i.props.model)return Promise.resolve(!0);let m=[];l&&i.props.rules&&Hy(i.props.rules,e.property)&&(m=i.props.rules[e.property]),e.rules&&(m=e.rules),m=Zy(h,_y(m,By(e))),m.length>0&&(n.isError=!1,n.errorMessage="");const p=ct.exports.get(i.props.model,e.property),w=(()=>{let y=-1;return()=>{if(y=y+1,y>=m.length)return Promise.resolve(!0);const v=m[y];return Promise.resolve().then(()=>{const L=v.validator(p);return typeof L!="boolean"&&typeof L.then=="function"?L.then(x=>{if(x===!1)return Promise.reject(v.message)}).then(()=>w(),()=>(n.isError=!0,n.errorMessage=v.message,Promise.reject(v.message))):L?w():(n.isError=!0,n.errorMessage=v.message,Promise.reject(v.message))})}})();return w()},u=()=>{n.isError=!1,n.errorMessage=""};return a.provide(yf,Te(U({},e),{validate:f,clearValidate:u})),a.onMounted(()=>{l&&i.register(t.proxy)}),a.onBeforeUnmount(()=>{l&&i.unregister(t.proxy)}),Te(U({},a.toRefs(n)),{labelStyles:c,isFormTypeVertical:o,validate:f,clearValidate:u})},render(){var i,l,o,c;const e=Se({"bk-form-item":!0,"is-error":this.isError,"is-required":this.required}),t=()=>this.$slots.label?this.$slots.label():this.description?a.withDirectives(a.createVNode("span",{class:{"bk-form-label-description":Boolean(this.description)}},[this.label]),[[a.resolveDirective("bk-tooltips"),this.description]]):this.label,n=()=>this.isError?this.errorDisplayType==="tooltips"?a.withDirectives(a.createVNode("div",{class:"bk-form-error-tips"},[a.createVNode(Jo,null,null)]),[[a.resolveDirective("bk-tooltips"),this.errorMessage]]):a.createVNode("div",{class:"bk-form-error"},[this.$slots.error?this.$slots.error(this.errorMessage):this.errorMessage]):null;return a.createVNode("div",{class:e},[a.createVNode("div",{class:"bk-form-label",style:this.labelStyles},[t(),this.isFormTypeVertical&&((l=(i=this.$slots).labelAppend)==null?void 0:l.call(i))]),a.createVNode("div",{class:"bk-form-content"},[(c=(o=this.$slots).default)==null?void 0:c.call(o),n()])])}});const t9=Bt(Ry,{FormItem:Gy,ComposeFormItem:Jy}),Fy={span:g.number.def(1),offset:g.number.def(0),pull:g.number.def(0),push:g.number.def(0)};var Yy=a.defineComponent({name:"Col",props:Fy,emits:[],setup(e,t){const{col:n,gutter:i,flex:l}=a.inject("containerProps"),{span:o,offset:c,pull:f,push:u}=e,h=a.computed(()=>o||n);a.provide("containerProps",{col:h.value,gutter:i,flex:l});const m=function(w){return`${Number((w*100).toFixed(3))}%`},p=a.computed(()=>({width:m(h.value/n),"padding-right":`${i/2}px`,"padding-left":`${i/2}px`,"margin-left":c?m(c/n):null,right:f?m(f/n):null,left:u?m(u/n):null}));return()=>{var w,y;return a.createVNode("div",{class:"bk-grid-col",style:p.value},[(y=(w=t.slots).default)==null?void 0:y.call(w)])}}});const Uy={col:g.number.def(24),gutter:g.number.def(20),margin:g.number.def(20),flex:g.bool.def(!1),extCls:g.string};var $y=a.defineComponent({name:"Container",props:Uy,emits:[],setup(e,t){const{col:n,gutter:i,flex:l,extCls:o}=e;a.provide("containerProps",{col:n,gutter:i,flex:l});const c=a.computed(()=>o?`bk-grid-container ${o}`:"bk-grid-container"),f=a.computed(()=>{const{margin:u}=e;return{"padding-right":`${u}px`,"padding-left":`${u}px`}});return()=>{var u,h;return a.createVNode("div",{class:c.value,style:f.value},[(h=(u=t.slots).default)==null?void 0:h.call(u)])}}}),Xy=a.defineComponent({name:"Row",emits:[],setup(e,t){const{col:n,gutter:i,flex:l}=a.inject("containerProps");a.provide("containerProps",{col:n,gutter:i,flex:l});const o=a.computed(()=>Te(U({},l?{display:["-webkit-box","-ms-flexbox","flex"]}:{}),{"margin-right":`-${i/2}px`,"margin-left":`-${i/2}px`}));return()=>{var c,f;return a.createVNode("div",{class:"bk-grid-row",style:o.value},[(f=(c=t.slots).default)==null?void 0:f.call(c)])}}});const rl=Bt($y,{Row:Xy,Col:Yy}),Ky=["auto","auto-start","auto-end","top","right","bottom","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],qy=["hover","click","manual"];var eC=a.defineComponent({name:"Dropdown",props:{isShow:g.bool.def(!1),placement:g.commonType(Ky,"placement").def("bottom"),trigger:g.commonType(qy,"trigger").def("hover"),disabled:g.bool.def(!1),popoverOptions:g.object.def({}),extCls:g.string},emits:["showChange","show","hide"],setup(e,{emit:t}){const n=o=>{t("showChange",o)};return{afterShow:()=>{t("show"),n(!0)},afterHidden:()=>{t("hide"),n(!1)}}},render(){const e=Se({"bk-dropdown":!0},this.$props.extCls),t={theme:"light bk-dropdown-popover",trigger:this.trigger,arrow:!1,placement:this.placement,isShow:this.isShow,disabled:this.disabled},n=ct.exports.merge(t,this.popoverOptions);return a.createVNode("div",{class:e},[a.createVNode(ni,a.mergeProps(n,{onAfterShow:this.afterShow,onAfterHidden:this.afterHidden}),{default:()=>{var i,l;return a.createVNode("div",{class:"bk-dropdown-reference"},[a.createTextVNode(" "),(l=(i=this.$slots).default)==null?void 0:l.call(i),a.createTextVNode(" ")])},content:()=>{var i,l;return a.createVNode("div",{class:"bk-dropdown-content"},[a.createTextVNode(" "),(l=(i=this.$slots).content)==null?void 0:l.call(i),a.createTextVNode(" ")])}})])}}),tC=a.defineComponent({name:"DropdownItem",props:{extCls:g.string},emits:["click"],setup(e,{emit:t}){const n=l=>{l.stopPropagation(),t("click",l)};return{wrapperCLasses:a.computed(()=>["bk-dropdown-item",e.extCls]),handleClick:n}},render(){var e,t;return a.createVNode("li",{class:this.wrapperCLasses,onClick:this.handleClick},[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}}),nC=a.defineComponent({name:"DropdownMenu",props:{extCls:g.string},setup(e){return{wrapperCLasses:a.computed(()=>["bk-dropdown-menu",e.extCls])}},render(){var e,t;return a.createVNode("ul",{class:this.wrapperCLasses},[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});const n9=Bt(eC,{DropdownMenu:nC,DropdownItem:tC});var Fc=a.defineComponent({name:"CascaderPanel",props:{width:g.oneOfType([g.number,g.string]).def("auto"),height:g.oneOfType([g.number,g.string]).def(216),store:g.object.def({}),separator:g.string.def(""),suggestions:g.arrayOf(gf()),isFiltering:g.bool.def(!1),searchKey:g.oneOfType([g.string,g.number]).def(""),modelValue:g.arrayOf(g.oneOfType([xo(),String,Number]))},emits:["update:modelValue"],setup(e,{emit:t}){const{store:n}=e,i=a.reactive({list:[e.store.getNodes()]}),l=a.ref([]),o=a.ref([]),c=C=>typeof C=="number"?`${C}px`:C,f=c(e.height),u=c(e.width),h=C=>{C.length===0&&(i.list=i.list.slice(0,1),l.value=[]),C.forEach(b=>{const I=n.getNodeById(b);p(I)}),o.value=C},m=C=>{C.isDisabled||(C.config.multiple?o.value=n.getCheckedNodes().map(b=>b.path):o.value=C.path,t("update:modelValue",o.value))},p=C=>{var b;if(!(!C||(C==null?void 0:C.isDisabled))){if(i.list=i.list.slice(0,C.level),l.value=l.value.slice(0,C.level-1),(b=C.children)!=null&&b.length){i.list.push(C.children),l.value.push(C);return}if(n.config.isRemote&&!C.isLeaf){C.loading=!0;const I=N=>{n.appendNodes(N,C||null),i.list.push(C.children),l.value.push(C),C.loading=!1};n.config.remoteMethod(C,I)}}},w=C=>{const{trigger:b,checkAnyLevel:I,multiple:N}=C.config;return{onClick:A=>{(!C.isLeaf||N)&&A.stopPropagation(),b==="click"&&p(C),I&&!N&&m(C),C.isLeaf&&!N&&m(C)},onMouseenter:()=>{b==="hover"&&p(C)}}},y=C=>{const{multiple:b}=C.config;return{onClick:N=>{if(b){N.stopPropagation(),x(C,!C.checked);return}p(C),C.isLeaf&&!b&&m(C)}}},v=C=>(l.value[C.level-1]||{}).id===C.id,L=(C,b)=>{const{multiple:I}=C.config;return I?b.some(N=>fr(N,C.path)):fr(b,C.path)},x=(C,b)=>{C.setNodeCheck(b||!1),m(C)},k=C=>C.loading?a.createVNode(pr,{class:"icon-spinner"},null):a.createVNode(vn,{class:"icon-angle-right"},null);return a.watch(()=>e.modelValue,C=>{h(C)},{immediate:!0}),a.watch(()=>e.store,C=>{i.list=[C.getNodes()]}),{menus:i,activePath:l,nodeExpandHandler:p,isNodeInPath:v,nodeEvent:w,isCheckedNode:L,checkValue:o,checkNode:x,iconRender:k,panelWidth:u,panelHeight:f,searchPanelEvents:y}},render(){const e=parseInt(this.panelWidth,10)>200?this.panelWidth:`${200}px`,t=()=>this.suggestions.length?a.createVNode("ul",{class:"bk-cascader-panel bk-scroll-y",style:{height:this.panelHeight,width:this.panelWidth}},[this.suggestions.map(n=>a.createVNode("li",a.mergeProps({class:["bk-cascader-node",{"is-selected":this.isNodeInPath(n)},{"is-disabled":n.isDisabled},{"is-checked":this.isCheckedNode(n,this.checkValue)}]},this.searchPanelEvents(n)),[n.pathNames.join(this.separator)]))]):a.createVNode("div",{class:"bk-cascader-search-empty",style:{width:e}},[a.createVNode("span",null,[a.createTextVNode("\u6682\u65E0\u641C\u7D22\u7ED3\u679C")])]);return a.createVNode("div",{class:"bk-cascader-panel-wrapper"},[this.isFiltering?t():this.menus.list.map(n=>a.createVNode("ul",{class:"bk-cascader-panel bk-scroll-y",style:{height:this.panelHeight,width:this.panelWidth}},[n.map(i=>{var l,o;return a.createVNode("li",a.mergeProps({class:["bk-cascader-node",{"is-selected":this.isNodeInPath(i)},{"is-disabled":i.isDisabled},{"is-checked":!i.config.multiple&&this.isCheckedNode(i,this.checkValue)}]},Object.assign(this.nodeEvent(i),i.config.multiple?{}:{})),[i.config.multiple&&a.createVNode(Ii,{disabled:i.isDisabled,modelValue:i.checked,"onUpdate:modelValue":c=>i.checked=c,indeterminate:i.isIndeterminate,onChange:c=>this.checkNode(i,c)},null),(o=(l=this.$slots).default)==null?void 0:o.call(l,{node:i,data:i.data}),i.isLeaf?"":this.iconRender(i)])})]))])}});function i9(e){return e.data.disabled?!0:e.level!==1?i9(e.parent):e.data.disabled}class sl{constructor(t,n,i){this.data=t,this.config=n,this.parent=i||null,this.leaf=t.leaf,this.level=this.parent?this.parent.level+1:1,this.initState()}initState(){const{idKey:t,nameKey:n,childrenKey:i}=this.config;this.id=this.data[t],this.name=this.data[n],this.loading=!1,this.loaded=!1,this.checked=!1;const l=this.data[i];this.children=(l||[]).map(o=>new sl(o,this.config,this)),this.pathNodes=this.calculateNodesPath(),this.path=this.pathNodes.map(o=>o.id),this.pathNames=this.pathNodes.map(o=>o.name)}get isLeaf(){var t;return this.config.isRemote?this.leaf||(this.loaded?!this.children.length:!1):!(Array.isArray(this.children)&&((t=this.children)==null?void 0:t.length)!==0)}get isDisabled(){return i9(this)}broadcast(t,n){const i=`onParent${Lo(t)}`;this.children.forEach(l=>{var o;l&&(l.broadcast(t,n),(o=l[i])==null||o.call(l,n))})}emit(t){var l;const{parent:n}=this,i=`onChild${Lo(t)}`;n&&((l=n[i])==null||l.call(n),n.emit(t))}onParentCheck(t){this.isDisabled||this.setCheckState(t)}onChildCheck(){const{children:t}=this,n=t.filter(l=>!l.isDisabled),i=n.length?n.every(l=>l.checked):!1;this.setCheckState(i)}setCheckState(t){const n=this.children.length,i=this.children.reduce((l,o)=>{const c=o.isIndeterminate?.5:0,f=o.checked?1:c;return l+f},0);this.checked=t,this.isIndeterminate=i!==n&&i>0}setNodeCheck(t){if(this.checked!==t){if(this.config.checkAnyLevel){this.checked=t;return}this.broadcast("check",t),this.setCheckState(t),this.emit("check")}}calculateNodesPath(){const t=[this];let{parent:n}=this;for(;n;)t.unshift(n),n=n.parent;return t}}const a9=(e,t)=>e.reduce((n,i)=>(i.isLeaf?n.push(i):(!t&&n.push(i),n=n.concat(a9(i.children,t))),n),[]);class r9{constructor(t){const{list:n}=t;this.data=n,this.config=t,this.nodes=this.data.map(i=>new sl(i,this.config))}getNodes(){return this.nodes}clearChecked(){this.getFlattedNodes().forEach(t=>{t.checked=!1,t.isIndeterminate=!1})}removeTag(t){this.getFlattedNodes().find(n=>fr(t,n.path)?(n.checked=!1,!0):!1)}getFlattedNodes(t=!1){return a9(this.nodes,t)}getCheckedNodes(){return this.getFlattedNodes().filter(t=>t.checked)}getNodeByValue(t){var i;return(i=this.getFlattedNodes().filter(l=>fr(l.path,t))[0])!=null?i:null}getNodeById(t){return this.getFlattedNodes().find(n=>n.id===t)}appendNode(t,n){const i=new sl(t,this.config,n);(n?n.children:this.nodes).push(i)}appendNodes(t,n){t.forEach(i=>this.appendNode(i,n))}}var iC=a.defineComponent({name:"Cascader",directives:{clickoutside:Xn},components:{CascaderPanel:Fc,BkPopover:ni},props:{modelValue:g.arrayOf(g.oneOfType([xo(),String,Number])),list:g.array.def([]),placeholder:g.string.def("\u8BF7\u9009\u62E9"),filterable:g.bool.def(!1),multiple:g.bool.def(!1),disabled:g.bool.def(!1),clearable:g.bool.def(!0),trigger:g.string.def("click"),checkAnyLevel:g.bool.def(!1),isRemote:g.bool.def(!1),remoteMethod:g.func,showCompleteName:g.bool.def(!0),idKey:g.string.def("id"),nameKey:g.string.def("name"),childrenKey:g.string.def("children"),separator:g.string.def("/"),limitOneLine:g.bool.def(!1),extCls:g.string.def(""),scrollHeight:g.oneOfType([g.number,g.string]).def(216),scrollWidth:g.oneOfType([g.number,g.string]).def("auto")},emits:["update:modelValue","change","clear","toggle"],setup(e,{emit:t}){const{separator:n,multiple:i}=e,{isHover:l,setHover:o,cancelHover:c}=j0(),f=a.ref(new r9(e)),u=a.ref(!1),h=a.ref(""),m=a.ref([]),{modelValue:p}=a.toRefs(e),w=a.ref(),y=a.ref(""),v=a.ref([]),L=a.ref(!1),x=a.computed({get:()=>p.value,set:E=>{t("update:modelValue",E)}}),k=a.ref(null),C=E=>e.showCompleteName?E.pathNames.join(n):E.pathNames[E.pathNames.length-1],b=()=>{y.value=h.value},I=E=>{var ne;if(i){m.value=f.value.getCheckedNodes().map(_=>({text:C(_),key:_.id}));return}if(!e.checkAnyLevel&&((ne=k==null?void 0:k.value)==null||ne.hide()),E.length===0)h.value="";else{const _=f.value.getNodeByValue(E);if(!_)return;h.value=C(_)}b()},N=E=>{E.stopPropagation(),f.value.clearChecked(),y.value="",I([]),t("update:modelValue",[]),t("clear",JSON.parse(JSON.stringify(e.modelValue)))},T=(E,ne,_)=>{_.stopPropagation();const ce=JSON.parse(JSON.stringify(E)),re=ce.splice(ne,1)[0];f.value.removeTag(re),I(ce),t("update:modelValue",f.value.getCheckedNodes().map(ae=>ae.path))},A=(E,ne)=>{I(E),t("update:modelValue",E),ne!==void 0&&t("change",E)},P=()=>{f.value=new r9(e),I(e.modelValue)},J=E=>{t("toggle",E.isShow),E.isShow||(L.value=!1)},z=Mf(200,E=>{const ne=E.target;if(y.value=ne.value,y.value===""){L.value=!1;return}L.value=!0;const _=f.value.getFlattedNodes().filter(ce=>(e.checkAnyLevel||ce.isLeaf)&&ce.pathNames.join(e.separator).includes(y.value));v.value=_,!(k!=null&&k.value.isShow)&&(k==null||k.value.show())});return a.watch(()=>e.modelValue,A,{immediate:!0}),a.watch(()=>e.list,P,{deep:!0,immediate:!0}),{store:f,updateValue:I,panelShow:u,selectedText:h,checkedValue:x,handleClear:N,isHover:l,setHover:o,popover:k,cancelHover:c,selectedTags:m,removeTag:T,cascaderPanel:w,popoverChangeEmitter:J,searchKey:y,suggestions:v,isFiltering:L,searchInputHandler:z}},render(){const e=()=>this.clearable&&this.isHover?a.createVNode(cn,{class:"bk-icon-clear-icon",onClick:this.handleClear},null):a.createVNode(Ta,{class:"bk-icon-angle-up"},null),t=()=>this.limitOneLine?a.createVNode("span",null,[this.selectedText]):a.createVNode("div",{class:"cascader-tag-list"},[this.selectedTags.map((n,i)=>a.createVNode("span",{class:"cascader-tag-item"},[a.createVNode("span",{class:"cascader-tag-item-name"},[n.text]),a.createVNode(An,{class:"bk-icon-clear-icon",onClick:l=>this.removeTag(this.modelValue,i,l)},null)]))]);return a.createVNode("div",{class:["bk-cascader","bk-cascader-wrapper",this.extCls,{"bk-is-show-panel":this.panelShow,"is-unselected":this.modelValue.length===0,"is-hover":this.isHover,"is-filterable":this.filterable}],tabindex:"0","data-placeholder":this.placeholder,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[e(),a.createVNode(ni,{placement:"bottom-start",theme:"light bk-cascader-popover",trigger:"click",arrow:!1,class:"bk-cascader-popover-wrapper",ref:"popover",onAfterHidden:this.popoverChangeEmitter,onAfterShow:this.popoverChangeEmitter,boundary:"body"},{default:()=>a.createVNode("div",{class:"bk-cascader-name"},[this.multiple&&this.selectedTags.length>0&&t(),this.filterable?a.createVNode("input",{class:"bk-cascader-search-input",type:"text",onInput:this.searchInputHandler,placeholder:this.placeholder,value:this.searchKey},null):a.createVNode("span",null,[this.selectedText])]),content:()=>a.createVNode("div",{class:"bk-cascader-popover"},[a.createVNode(Fc,{store:this.store,ref:"cascaderPanel",width:this.scrollWidth,height:this.scrollHeight,"search-key":this.searchKey,separator:this.separator,"is-filtering":this.isFiltering,suggestions:this.suggestions,modelValue:this.checkedValue,"onUpdate:modelValue":n=>this.checkedValue=n},{default:n=>this.$slots.default?this.$slots.default(n):a.createVNode("span",{class:"bk-cascader-node-name"},[n.node.name])})])})])}});const s9=Bt(iC,{CascaderPanel:Fc});var l9=a.defineComponent({name:"SliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:()=>({})}},emits:["emitChange","resetSize","update:modelValue"],setup(e,{emit:t}){const n=a.ref(!1),i=a.ref(!1),l=a.ref(0),o=a.ref(0),c=a.ref(0),f=a.ref(null),u=a.ref(e.modelValue),h=a.ref(0),m=a.ref(0),p=a.ref(!1),w=a.ref(null),y=a.computed(()=>{var J,z;let A="";if((J=e.params.customContent)!=null&&J[e.modelValue]){const E=e.params.customContent[e.modelValue];A=E.tip||E.label||""}const P=e.params.vertical?"right":"top";return(z=e.params)!=null&&z.showTip?{content:e.params.formatterTipLabel(`${A||(e==null?void 0:e.modelValue)||"0"}`),placement:P}:{content:"",placement:P}}),v=a.computed(()=>`${(e.modelValue-e.params.minValue)/(e.params.maxValue-e.params.minValue)*100}%`),L=a.computed(()=>e.params.vertical?{bottom:v.value}:{left:v.value}),x=a.computed(()=>e.params.formatterButtonLabel(e.modelValue)),k=A=>{e.params.disable||(A.preventDefault(),C(A),Er(window,"mousemove",b),Er(window,"touchmove",b),Er(window,"mouseup",I),Er(window,"touchend",I))},C=A=>{n.value=!0,i.value=!0,e.params.vertical?l.value=A.clientY:o.value=A.clientX,c.value=parseFloat(v.value),f.value=c.value},b=A=>{if(n.value){i.value=!1,t("resetSize");let P=0;e.params.vertical?(h.value=A.clientY,P=(l.value-h.value)/e.params.sliderSize*100):(m.value=A.clientX,P=(m.value-o.value)/e.params.sliderSize*100),f.value=c.value+P,N(f.value)}},I=()=>{p.value=!1,n.value&&(setTimeout(()=>{n.value=!1,i.value||(N(f.value),t("emitChange"))},0),ll(window,"mousemove",b),ll(window,"touchmove",b),ll(window,"mouseup",I),ll(window,"touchend",I))},N=A=>{if(A===null||isNaN(A))return;A<0?f.value=0:A>100&&(f.value=100);const P=100/((e.params.maxValue-e.params.minValue)/e.params.step);let z=Math.round(A/P)*P*(e.params.maxValue-e.params.minValue)*.01+e.params.minValue;z=parseFloat(z.toFixed(e.params.precision)),t("update:modelValue",z),!n.value&&e.modelValue!==u.value&&(u.value=e.modelValue)};return{renderDom:()=>a.createVNode("div",{class:["bk-slider-button",e.params.vertical?"vertical":"horizontal",{grabbing:n.value}],ref:w,tabindex:"0",style:L.value,onClick:A=>A.stopPropagation(),onMousedown:k},[Boolean(y.value.content)?a.createVNode(Os,{content:y.value.content,theme:"dark",placement:y.value.placement,boundary:document.body},{default:()=>[a.createVNode("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null)]}):a.createVNode("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null),e.params.showButtonLabel&&!e.params.showIntervalLabel?a.createVNode("div",{class:["slider-button-label",e.params.vertical?"vertical":"horizontal"]},[x.value]):void 0]),setPosition:N,tip:y}},render(){return this.renderDom()}});const Er=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},ll=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)};var aC=a.defineComponent({name:"Slider",props:{modelValue:g.oneOfType([g.array,g.number]),extCls:{type:String,default:""},vertical:{type:Boolean,default:!1},height:{type:String,default:"200px"},disable:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},maxValue:{type:[Number],default:100},minValue:{type:[Number],default:0},step:{type:[Number],default:1},range:{type:Boolean,default:!1},showInterval:{type:Boolean,default:!1},showIntervalLabel:{type:Boolean,default:!1},showButtonLabel:{type:Boolean,default:!1},showBetweenLabel:{type:Boolean,default:!1},showInput:{type:Boolean,default:!1},customContent:{type:Object,default:null},formatterLabel:{type:Function,default:e=>e},formatterButtonLabel:{type:Function,default:e=>e},formatterTipLabel:{type:Function,default:e=>e}},emits:["update:modelValue","change"],setup(e,{slots:t,emit:n}){const i=a.ref(1),l=a.ref(null),o=a.ref(null),c=a.ref(null),f=a.ref(0),u=a.ref(0),h=a.ref(null),m=a.ref(null),p=a.ref(null),w=a.ref(null),y=a.computed(()=>{const W=[e.minValue,e.maxValue,e.step].map(Q=>{const F=`${Q}`.split(".")[1];return F?F.length:0});return Math.max.apply(null,W)}),v=a.computed(()=>Math.min(l.value,o.value)),L=a.computed(()=>Math.max(l.value,o.value)),x=a.computed(()=>e.range?`${100*(L.value-v.value)/(e.maxValue-e.minValue)}%`:`${100*(l.value-e.minValue)/(e.maxValue-e.minValue)}%`),k=a.computed(()=>e.range?`${100*(v.value-e.minValue)/(e.maxValue-e.minValue)}%`:"0%"),C=a.computed(()=>e.vertical?{height:x.value,bottom:k.value}:{width:x.value,left:k.value}),b=a.computed(()=>{if(!e.showInterval||e.minValue>e.maxValue)return[];if(e.step===0)return console.warn("WARNNING:step should not be 0"),[];const W=(e.maxValue-e.minValue)/e.step,Q=100*e.step/(e.maxValue-e.minValue),F=[];for(let K=1;K<W;K++)F.push(K*Q);return e.range?F.filter(K=>K<100*(v.value-e.minValue)/(e.maxValue-e.minValue)||K>100*(L.value-e.minValue)/(e.maxValue-e.minValue)):F.filter(K=>K>100*(l.value-e.minValue)/(e.maxValue-e.minValue))}),I=a.computed(()=>e.vertical?{height:e.height,width:"4px"}:{}),N=a.computed(()=>{if(!e.showIntervalLabel)return[];if(e.step===0)return console.warn("WARNNING:step should not be 0"),[];const W=100*e.step/(e.maxValue-e.minValue),Q=[];for(let F=e.minValue,K=0;F<=e.maxValue;F+=e.step,K++){const fe={stepWidth:K*W,stepLabel:e.formatterLabel(F)};Q.push(fe)}return Q}),T=a.computed(()=>Array.isArray(e.modelValue)),A=a.computed(()=>e.customContent?Object.keys(e.customContent).sort((W,Q)=>Number(W)-Number(Q)).filter(W=>Number(W)>=e.minValue&&Number(W)<=e.maxValue).map(W=>{const{tip:Q}=e.customContent[W],{label:F}=e.customContent[W];return{tip:Q||F||"",label:F||"",percent:(Number(W)-e.minValue)/(e.maxValue-e.minValue)*100}}):[]),P=a.computed(()=>({vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:y.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:i.value,formatterTipLabel:e.formatterTipLabel}));a.watch(()=>e.modelValue,()=>{ne()}),a.watch(()=>l.value,W=>{e.range?n("update:modelValue",[v.value,L.value]):n("update:modelValue",W),f.value=W}),a.watch(()=>o.value,W=>{n("update:modelValue",[v.value,L.value]),u.value=W}),a.onMounted(()=>{e.range?(Array.isArray(e.modelValue)?(l.value=Math.max(e.minValue,Number(e.modelValue[0])),o.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(l.value=e.minValue,o.value=e.maxValue),c.value=[l.value,o.value]):(typeof e.modelValue!="number"||isNaN(e.modelValue)?l.value=e.minValue:l.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),c.value=l.value),J(),Er(window,"resize",J())});const J=()=>{h.value&&(i.value=h.value[`client${e.vertical?"Height":"Width"}`])},z=W=>{var Q,F;if(W.stopPropagation(),!e.disable){if(J(),e.vertical){const K=(Q=h.value)==null?void 0:Q.getBoundingClientRect().bottom;re((K-W.clientY)/i.value*100)}else{const K=(F=h.value)==null?void 0:F.getBoundingClientRect().left;re((W.clientX-K)/i.value*100)}_()}},E=()=>e.range?![v.value,L.value].every((W,Q)=>W===c.value[Q]):e.modelValue!==c.value,ne=()=>{if(e.minValue>e.maxValue){console.error("min should not be greater than max.");return}const W=e.modelValue;e.range&&Array.isArray(W)?W[1]<e.minValue?n("update:modelValue",[e.minValue,e.minValue]):W[0]>e.maxValue?n("update:modelValue",[e.maxValue,e.maxValue]):W[0]<e.minValue?n("update:modelValue",[e.minValue,W[1]]):W[1]>e.maxValue?n("update:modelValue",[W[0],e.maxValue]):(l.value=Number(W[0]),o.value=Number(W[1]),E()&&(c.value=W.slice())):!e.range&&typeof W=="number"&&!isNaN(W)&&(W<e.minValue?n("update:modelValue",e.minValue):W>e.maxValue?n("update:modelValue",e.maxValue):(l.value=W,E()&&(c.value=W)))},_=async()=>{await a.nextTick(),n("change",e.range?[v.value,L.value]:e.modelValue)},ce=W=>e.vertical?{bottom:`${W}%`}:{left:`${W}%`},re=W=>{if(!e.range){m.value.setPosition(W);return}const Q=e.minValue+W*(e.maxValue-e.minValue)/100;Math.abs(v.value-Q)<Math.abs(L.value-Q)?w.value=l.value<o.value?m.value:p.value:w.value=l.value>o.value?m.value:p.value,w.value.setPosition(W)},ae=W=>{if(W==="")return;const Q=parseFloat(W);Q<e.minValue?(f.value=e.minValue,l.value=e.minValue):Q>e.maxValue?(f.value=e.maxValue,l.value=e.maxValue):l.value=Q},ue=W=>{if(W===""||typeof W=="number")return;const Q=parseFloat(W);Q<e.minValue?(u.value=e.minValue,o.value=e.minValue):Q>e.maxValue?(u.value=e.maxValue,o.value=e.maxValue):o.value=Q},ie=W=>{let Q=0;return W==="start"?Q=e.vertical?e.maxValue:e.minValue:Q=e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[l.value,o.value].includes(Q)?"0":"1"};return{renderDom:()=>{var W,Q;return a.createVNode("div",{class:["bk-slider",e.extCls]},[(W=t.start)==null?void 0:W.call(t),a.createVNode("div",{class:"bk-slider-runway",ref:h,style:I.value,onClick:z},[a.createVNode("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:C.value},null),e.showInterval?b.value.map((F,K)=>a.createVNode("div",{key:K,class:["bk-slider-interval",{vertical:e.vertical}],style:ce(F)},null)):void 0,e.customContent?A.value.map((F,K)=>a.createVNode("div",{key:K,class:["bk-slider-interval",{vertical:e.vertical}],style:ce(F.percent)},null)):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?a.createVNode("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[function(){if(e.showBetweenLabel)return[a.createVNode("div",{class:"label-start",style:[{opacity:ie("start")}]},[e.formatterLabel(e.minValue)]),a.createVNode("div",{class:"label-end",style:[{opacity:ie("end")}]},[e.formatterLabel(e.maxValue)])];if(e.showIntervalLabel)return N.value.map((F,K)=>a.createVNode("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:K,style:ce(F.stepWidth)},[F.stepLabel]));if(e.customContent)return A.value.map((F,K)=>a.createVNode("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:K,style:ce(F.percent)},[F.label]))}()]):void 0,a.createVNode(l9,{modelValue:l.value,"onUpdate:modelValue":F=>l.value=F,ref:m,params:P.value,onEmitChange:_,onResetSize:J},null),e.range?a.createVNode(l9,{modelValue:o.value,"onUpdate:modelValue":F=>o.value=F,ref:p,params:P.value,onEmitChange:_,onResetSize:J},null):void 0]),e.showInput&&!e.vertical?a.createVNode("div",{class:"bk-slider-input"},[a.createVNode("div",{class:"input-item"},[a.createVNode(Ui,{type:"number",modelValue:f.value,max:e.maxValue,min:e.minValue,onChange:ae},null)]),T.value&&o.value?[a.createVNode("div",{class:"input-center"},[a.createTextVNode("\uFF5E")]),a.createVNode("div",{class:"input-item"},[a.createVNode(Ui,{type:"number",modelValue:u.value,max:e.maxValue,min:e.minValue,onChange:ue},null)])]:void 0]):void 0,(Q=t.end)==null?void 0:Q.call(t)])}}},render(){return this.renderDom()}});const o9=He(aC);var rC=a.defineComponent({name:"ResizeLayout",props:{placement:g.placement().def("left"),min:g.number.def(3),max:g.number.def(1/0),triggerWidth:g.number.def(5),triggerOffset:g.number.def(3),initialDivide:g.oneOfType([String,Number]).def("20%"),immediate:g.bool,disabled:g.bool,collapsible:g.bool,autoMinimize:g.oneOfType([Boolean,Number]).def(!1),border:g.bool.def(!0)},emits:["before-resize","resizing","after-resize","collapse-change"],setup(e,{emit:t}){const{placement:n,initialDivide:i,triggerOffset:l,triggerWidth:o,max:c,min:f,immediate:u,autoMinimize:h}=a.toRefs(e),m=a.ref(!1),p=a.ref(!0),w=a.ref(!1),y=a.ref(null),v=a.ref({}),L=a.ref(null),x=a.ref(null),k=a.ref(null),C=a.ref(null),b=a.computed(()=>["left","right"].includes(n.value)),I=a.computed(()=>b.value?"width":"height"),N=a.computed(()=>{let ie=i.value;return typeof ie=="number"&&(ie=`${ie}px`),{[I.value]:ie}}),T=a.computed(()=>({[`margin-${n.value}`]:`${l.value-o.value}px`,[I.value]:`${o.value}px`})),A=a.computed(()=>h.value?typeof h.value=="boolean"?50:h.value:0),P=()=>{const ie=L.value.getBoundingClientRect();y.value=b.value?ie.width:ie.height},J=new ResizeObserver(P),z=()=>{switch(x.value.style.visibility="visible",n.value){case"left":x.value.style.inset=`0 auto auto ${v.value.aside.width}px`;break;case"right":x.value.style.inset=`0 ${v.value.aside.width}px auto auto`;break;case"top":x.value.style.inset=`${v.value.aside.height}px auto auto 0`;break;case"bottom":x.value.style.inset=`auto auto ${v.value.aside.height}px 0`;break}},E=()=>{k.value.style.display="block",k.value.style.cursor=b.value?"col-resize":"row-resize"},ne=ie=>Math.min(c.value,Math.max(f.value,ie),y.value-o.value),_=ie=>{t("before-resize",ie);const Y=C.value.getBoundingClientRect();v.value=Object.freeze({mouse:{clientX:ie.clientX,clientY:ie.clientY},aside:{width:Y.width,height:Y.height}}),E(),u.value||z(),document.onselectstart=()=>!1,document.ondragstart=()=>!1;const W=K=>{t("resizing",K)},Q=K=>{let fe;switch(n.value){case"top":fe=K.clientY-v.value.mouse.clientY;break;case"right":fe=v.value.mouse.clientX-K.clientX;break;case"bottom":fe=v.value.mouse.clientY-K.clientY;break;case"left":fe=K.clientX-v.value.mouse.clientX}const he=v.value.aside[I.value]+fe,Ce=ne(he)+l.value,Ae=`${Ce}px`;u.value?C.value.style[I.value]=Ae:x.value.style[n.value]=Ae,W(Ce)},F=()=>{if(x.value.style.visibility="hidden",k.value.style.display="none",document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",F),document.onselectstart=null,document.ondragstart=null,a.nextTick(()=>{ce(),t("after-resize",parseFloat(x.value.style[n.value]))}),u.value)return!1;C.value.style[I.value]=x.value.style[n.value]};document.addEventListener("mousemove",Q),document.addEventListener("mouseup",F)},ce=()=>{if(!h.value)return!1;const ie=C.value.getBoundingClientRect();if(w.value=m.value=ie[I.value]<=A.value,!w.value)return p.value=!0,!1;ae(),a.nextTick(()=>{C.value.setAttribute(`data-${I.value}`,N.value[I.value])})},re=ie=>{m.value=typeof ie=="boolean"?ie:!m.value,ae(),t("collapse-change",m.value)},ae=()=>{const ie=C.value.getBoundingClientRect();ue(!m.value),m.value?(C.value.setAttribute(`data-${I.value}`,`${ie[I.value]}px`),C.value.style[I.value]="5px"):(p.value=!0,C.value.style[I.value]=C.value.getAttribute(`data-${I.value}`))},ue=ie=>{const Y=()=>{p.value=ie,C.value.style.transition="",C.value.removeEventListener("transitionend",Y)};C.value.addEventListener("transitionend",Y),C.value.style.transition=`${I.value} cubic-bezier(0.4, 0, 0.2, 1) .3s`};return a.onMounted(()=>{J.observe(L.value)}),a.onBeforeUnmount(()=>{J.unobserve(L.value)}),{collapsed:m,asideContentVisible:p,minimized:w,limitMax:y,state:v,vertical:b,cssPropKey:I,bkResizeLayoutRef:L,resizeProxyRef:x,resizeMaskRef:k,asideRef:C,triggerStyle:T,asideStyle:N,handleMousedown:_,setCollapse:re}},render(){var t,n,i,l,o,c;const e=["bk-resize-layout",`bk-resize-layout-${this.placement}`,{"bk-resize-layout-collapsed":this.collapsed,"bk-resize-layout-border":this.border}];return a.createVNode("div",{ref:"bkResizeLayoutRef",class:e},[a.createVNode("aside",{class:"bk-resize-layout-aside",ref:"asideRef",style:this.asideStyle},[a.withDirectives(a.createVNode("div",{class:"bk-resize-layout-aside-content"},[(n=(t=this.$slots).aside)==null?void 0:n.call(t)]),[[a.vShow,this.asideContentVisible]]),a.withDirectives(a.createVNode("i",{class:"bk-resize-trigger",style:this.triggerStyle,onMousedown:a.withModifiers(this.handleMousedown,["left"])},null),[[a.vShow,!this.disabled&&(!this.collapsed||this.autoMinimize)]]),a.withDirectives(a.createVNode("i",{class:["bk-resize-proxy",this.placement],ref:"resizeProxyRef"},null),[[a.vShow,!this.collapsed||this.autoMinimize]]),this.collapsible&&(((l=(i=this.$slots)["collapse-trigger"])==null?void 0:l.call(i))||(this.collapsed?a.createVNode(vn,{class:"bk-resize-collapse",onClick:this.setCollapse},null):a.createVNode(Mi,{class:"bk-resize-collapse",onClick:this.setCollapse},null)))]),a.createVNode("main",{class:"bk-resize-layout-main"},[(c=(o=this.$slots).main)==null?void 0:c.call(o)]),a.createVNode("div",{class:"bk-resize-mask",ref:"resizeMaskRef"},null)])}});const c9=He(rC),sC={list:g.array.def([]),titleAble:g.bool.def(!1),extCls:g.string};var lC=a.defineComponent({name:"Timeline",props:sC,emits:["select"],setup(e,{emit:t}){const n=a.ref([]),i=c=>{const f=[];c.forEach(u=>{var h;f.push({tag:u.tag,content:u.content,type:u.type,size:u.size,color:u.color,icon:u.icon,filled:u.filled,border:(h=u.border)!=null?h:!0})}),n.value.splice(0,n.value.length,...f)},l=()=>{var c;n.value.splice(0,n.value.length,{tag:"\u6B65\u9AA41",content:"\u5185\u5BB91"},{tag:"\u6B65\u9AA42",content:"\u5185\u5BB92"},{tag:"\u6B65\u9AA43",content:"\u5185\u5BB93"}),(c=e.list)!=null&&c.length&&i(e.list)},o=c=>{try{t("select",c)}catch(f){console.warn(f)}};return a.onMounted(l),a.watch(()=>e.list,()=>{i(e.list)},{deep:!0}),{defaultTimelines:n,titleSelect:o}},render(){const e=n=>{const{icon:i}=n;return i?typeof i=="function":!1},t=n=>{const i="bk-timeline",l=["blue","red","green","yellow","gray"],o=n.type?`${i}-${n.type}`:`${i}-default`,c=n.size?`${i}-${n.size}`:"",f=n.filled?`${i}-filled`:"",u=n.color&&l.includes(n.color)?`${i}-${n.color}`:"";return Se({},`${i} ${o} ${c} ${u} ${f}`)};return a.createVNode("ul",{class:["bk-timeline",this.extCls]},[this.defaultTimelines.map(n=>{var i,l,o;return a.createVNode("li",{class:["bk-timeline-dot",t(n)]},[e(n)?a.createVNode("div",{class:"bk-timeline-icon",style:{border:n.border?`2px solid ${n.color}`:"0px",borderRadius:n.border?"50%":"0"}},[a.createVNode("span",{class:"bk-timeline-icon-inner"},[a.createVNode(n.icon,null,null)])]):"",a.createVNode("div",{class:"bk-timeline-section"},[a.createVNode("div",{class:"bk-timeline-title",onClick:()=>{this.titleSelect(n)}},[(o=(l=(i=this.$slots).default)==null?void 0:l.call(i))!=null?o:a.createVNode("span",{innerHTML:n.tag},null)]),n.content?a.createVNode("div",{class:"bk-timeline-content",innerHTML:n.content},null):""])])})])}});const u9=He(lC),oC={list:g.array.def([]),controllable:g.bool.def(!1),showSteps:g.bool.def(!1),curProcess:g.number.def(0),displayKey:g.string.def("content"),extCls:g.string};var cC=a.defineComponent({name:"BKProcess",props:oC,emits:["update:curProcess","click"],setup(e,{emit:t}){const n=a.ref([]),i=a.ref(0),l=()=>{var c;n.value.splice(0,n.value.length,{content:"\u6B65\u9AA41"},{content:"\u6B65\u9AA42"},{content:"\u6B65\u9AA43"},{content:"\u6B65\u9AA44"},{content:"\u6B65\u9AA45"}),(c=e.list)!=null&&c.length&&n.value.splice(0,n.value.length,...e.list)},o=async c=>{try{e.controllable&&c!==e.curProcess&&(t("update:curProcess",c),t("click",c))}catch(f){console.warn(f)}};return a.onMounted(l),{defaultProcessList:n,paddingBottom:i,jumpTo:o}},render(){const e="bk-process",t=Se({[`${this.extCls}`]:!!this.extCls},`${e}`),n=f=>f.status==="loading",i=f=>f.status==="error",l=f=>this.curProcess>=f+1||this.defaultProcessList[f].status==="done",o=f=>f.icon?f.icon:"",c=(f,u)=>f===this.curProcess-1&&n(u)?a.createVNode(vs,{class:"bk-icon bk-process-icon icon-loading"},null):i(u)?a.createVNode(An,{class:"bk-process-icon"},null):l(f)?a.createVNode(xa,{class:"bk-process-icon-done"},null):a.createVNode("span",{class:"number"},[o(u)]);return a.createVNode("div",{class:t},[a.createVNode("ul",{style:{paddingBottom:`${this.paddingBottom}px`}},[this.defaultProcessList.map((f,u)=>a.createVNode("li",{onClick:()=>{this.jumpTo(u+1)},style:{cursor:this.controllable?"pointer":""},class:{success:this.curProcess>=u+1,current:n(f)&&u===this.curProcess-1}},[f[this.displayKey],c(u,f)]))])])}});const d9=He(cC),ia="bk-upload";var si=(e=>(e.BUTTON="button",e.DRAGGABLE="draggable",e.PICTURE="picture",e))(si||{}),Ea=(e=>(e.NEW="new",e.UPLOADING="uploading",e.SUCCESS="success",e.FAIL="fail",e))(Ea||{});const f9=[si.BUTTON,si.DRAGGABLE,si.PICTURE];var li={theme:{type:String,default:"draggable",validator:e=>!e||f9.includes(e)?!0:(console.error(`invalid theme, ${e}, the theme must be one of \u3010${f9.join(" | ")}\u3011`),!1)},files:{type:Array,default:()=>[]},name:{type:String,default:"upload_file"},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},accept:{type:String},delayTime:{type:Number,default:0},url:{type:String,required:!1},method:{type:String,default:"post"},size:{type:[Number,Object],default(){return{maxFileSize:5,maxImgSize:1}}},handleResCode:{type:Function,default(e){return!!(e&&e.code===0)}},headers:{type:Object,default:()=>({})},header:{type:[Array,Object],default:()=>[]},tip:{type:String,default:""},validateName:{type:RegExp},withCredentials:{type:Boolean,default:!1},limit:Number,data:{type:[Array,Object],default:()=>[]},formDataAttributes:{type:[Array,Object],default:()=>[]},extCls:{type:String,default:""},customRequest:Function,beforeUpload:{type:Function,default:null},beforeRemove:{type:Function,default:null},sliceUpload:{type:Boolean,default:!1},sliceUrl:{type:String,default:""},mergeUrl:{type:String,default:""},chunkSize:{type:Number,default:10}};function h9(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var uC=a.defineComponent({name:"UploadList",props:{theme:li.theme,disabled:li.disabled,files:li.files,multiple:li.multiple},emits:["remove","retry"],setup(e,{slots:t,emit:n}){const{theme:i,disabled:l,multiple:o}=a.toRefs(e),c=`${ia}-list`,f=a.computed(()=>i.value===si.PICTURE),u=a.computed(()=>f.value&&!o.value),h=a.computed(()=>Se({[c]:!0,[`${c}--${i.value}`]:!0,[`${c}--disabled`]:l.value}));function m(C){const b=["Bytes","KB","MB","GB","TB"],I=Math.floor(Math.log(C)/Math.log(1024));return`${(C/1024**I).toFixed(2)}${b[I]}`}function p(C,b){n("remove",C,b)}function w(C,b){n("retry",C,b)}const y=()=>{let C;return a.createVNode(a.TransitionGroup,{name:`${c}__item`},h9(C=e.files.map(b=>{const I=Se({[`${c}__item`]:!0,[`${c}__item-picture`]:!0,[`${c}__item--${b.status}`]:!0});return a.createVNode("li",{key:b.uid,class:I},[t!=null&&t.file?t.file({file:b}):v(b)])}))?C:{default:()=>[C]})},v=C=>[a.withDirectives(a.createVNode("img",{src:C.url,class:`${c}__picture-item-thumbnail`,alt:""},null),[[a.vShow,C.status!=="uploading"]]),a.createVNode(a.Fragment,null,[C.status==="uploading"&&a.createVNode(kr,{class:`${c}__picture-item-progress`,type:"circle",color:"#3a84ff",bgColor:"#333",width:50,titleStyle:{color:"#fff"},percent:C.percentage},null)]),a.createVNode(a.Fragment,null,[!l.value&&a.createVNode("div",{class:`${c}__picture-item-actions`},[a.createVNode(mr,{class:"action-icon",onClick:b=>p(C,b)},null)])])],L=()=>{let C;return a.createVNode(a.TransitionGroup,{name:`${c}__item`},h9(C=e.files.map(b=>{const I=Se({[`${c}__item`]:!0,[`${c}__item--${b.status}`]:!0});return a.createVNode("li",{key:b.uid,class:I},[t!=null&&t.file?t.file({file:b}):k(b)])}))?C:{default:()=>[C]})},x=C=>{var P;const b=(P=C==null?void 0:C.raw)==null?void 0:P.type,[I]=(b==null?void 0:b.split("/"))||"";let T={text:yr,image:Bo,application:yr,video:$o,audio:Oo}[I]||yr;return["application/zip","application/rar","application/tar","application/gz","application/x-gzip"].includes(b)&&(T=jo),a.h(T,{class:`${c}__item-file-icon`})},k=C=>[a.createVNode("div",{class:`${c}__item-icon`},[C.isPic?a.createVNode("img",{src:C.url,class:`${c}__item-thumbnail`,alt:""},null):x(C)]),a.createVNode("div",{class:`${c}__item-summary`},[a.createVNode("div",{class:`${c}__item-name`,title:C.name},[C.name]),C.status!=="uploading"&&a.createVNode("div",{class:`${c}__item-message`,title:C.statusText},[C.status==="success"&&a.createVNode("span",null,[a.createVNode(xa,{class:`${c}__item-message-success-icon`},null),C.statusText||"\u4E0A\u4F20\u6210\u529F"]),C.status==="fail"&&a.createVNode("span",null,[C.statusText||"\u4E0A\u4F20\u5931\u8D25"])]),C.status==="uploading"&&a.createVNode(kr,{class:`${c}__item-progress`,showText:!1,percent:C.percentage,size:"small"},null),C.status!=="fail"&&a.createVNode("div",{class:`${c}__item-speed`},[a.withDirectives(a.createVNode("span",{class:`${c}__item-speed-size`},[m(C.size)]),[[a.vShow,C.size]]),a.withDirectives(a.createVNode("span",{class:`${c}__item-speed-percentage`},[C.percentage,a.createTextVNode("%")]),[[a.vShow,C.status==="uploading"]])]),!l.value&&a.createVNode("div",{class:`${c}__item-actions`},[C.status==="fail"&&a.createVNode(Zo,{class:`${c}__item-retry-icon`,onClick:b=>w(C,b)},null),a.createVNode(mr,{class:`${c}__item-del-icon`,onClick:b=>p(C,b)},null)])])];return()=>{var C;return a.createVNode(a.Fragment,null,[u.value?(t==null?void 0:t.innerTrigger)&&(t==null?void 0:t.innerTrigger((C=e.files)==null?void 0:C[0])):a.createVNode("ul",{class:h.value},[f.value?y():L(),(t==null?void 0:t.innerTrigger)&&(t==null?void 0:t.innerTrigger())])])}}}),g9=a.defineComponent({name:"UploadTrigger",props:{theme:li.theme,disabled:li.disabled,multiple:li.multiple,accept:li.accept,file:{type:Object,default:null}},emits:["change","remove"],setup(e,{slots:t,emit:n}){const{theme:i,disabled:l,file:o,multiple:c,accept:f}=a.toRefs(e),u=`${ia}-trigger`,h=a.computed(()=>i.value===si.BUTTON),m=a.computed(()=>i.value===si.DRAGGABLE),p=a.computed(()=>i.value===si.PICTURE),w=a.computed(()=>p.value&&!c.value),y=a.computed(()=>p.value&&!f.value?"image/png,image/jpeg,image/jpg":f.value),v=a.ref(null),L=a.computed(()=>{var ne,_,ce;return Se({[u]:!0,[`${u}--${i.value}`]:!0,[`${u}--single-picture`]:w.value,[`${u}--has-file`]:(ne=o.value)!=null?ne:!1,[`${u}--${(_=o.value)==null?void 0:_.status}`]:(ce=o.value)!=null?ce:!1,[`${u}--dragover`]:N.value,[`${u}--disabled`]:l.value})}),x=()=>{v.value.value=null,v.value.click()},k=ne=>{const{files:_}=ne.target;n("change",Array.from(_))},C=()=>{e.disabled||x()},b=ne=>{ne.defaultPrevented||ne.target!==ne.currentTarget||((ne.code==="Enter"||ne.code==="Space")&&x(),ne.preventDefault())};function I(ne,_){n("remove",ne,_),_.stopPropagation(),_.preventDefault()}const N=a.ref(!1),T=()=>{const ne=ae=>{if(l.value)return;ae.preventDefault(),N.value=!1;const ue=Array.from(ae.dataTransfer.files);if(!y.value){n("change",ue);return}const ie=ue.filter(Y=>{const{type:W,name:Q}=Y,F=Q.includes(".")?`.${Q.split(".").pop()}`:"",K=W.replace(/\/.*$/,"");return y.value.split(",").map(fe=>fe.trim()).filter(fe=>fe).some(fe=>fe.startsWith(".")?F===fe:/\/\*$/.test(fe)?K===fe.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(fe)?W===fe:!1)});n("change",ie)},_=ae=>{ae.preventDefault(),N.value=!0},ce=()=>{N.value=!1},re=Se({[`${u}__draggable`]:!0});return a.createVNode("div",{class:re,onDrop:ne,onDragover:_,onDragleave:ce},[t.default?t.default():a.createVNode(a.Fragment,null,[a.createVNode(js,{class:`${u}__draggable-icon`},null),a.createVNode("div",{class:`${u}__draggable-text`},[a.createTextVNode("\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\u6216"),a.createVNode("span",{class:`${u}__draggable-upload-link`},[a.createTextVNode("\u70B9\u51FB\u4E0A\u4F20")])])])])},A=()=>a.createVNode(a.Fragment,null,[w.value&&e.file?J(e.file):P()]),P=()=>a.createVNode(a.Fragment,null,[t.default?t.default():a.createVNode("div",{class:`${u}__picture-inner`},[a.createVNode(xs,{class:`${u}__picture-icon`},null),a.createVNode("div",{class:`${u}__picture-text`},[a.createTextVNode("\u70B9\u51FB\u4E0A\u4F20")])])]),J=ne=>[a.withDirectives(a.createVNode("img",{src:ne.url,class:`${u}__picture-thumbnail`,alt:""},null),[[a.vShow,ne.status!=="uploading"]]),a.createVNode(a.Fragment,null,[ne.status==="uploading"&&a.createVNode(kr,{class:`${u}__picture-progress`,type:"circle",color:"#3a84ff",bgColor:"#333",width:50,titleStyle:{color:"#fff"},percent:ne.percentage},null)]),a.createVNode(a.Fragment,null,[!e.disabled&&a.createVNode("div",{class:`${u}__picture-actions`},[a.createVNode(mr,{class:"action-icon",onClick:_=>I(ne,_)},null)])])],z=()=>a.createVNode(_t,{disabled:l.value},{default:()=>[a.createVNode(js,{class:`${u}__button-icon`},null),a.createVNode("span",{class:`${u}__button-text`},[a.createTextVNode("\u4E0A\u4F20\u6587\u4EF6")])]}),E=()=>{if(h.value)return z();if(m.value)return T();if(p.value)return A()};return()=>{var ne;return a.createVNode("div",{class:L.value,tabindex:"0",onClick:C,onKeydown:b},[t.trigger?[t.trigger(),(ne=t==null?void 0:t.default)==null?void 0:ne.call(t)]:E(),a.createVNode("input",{ref:v,class:"bk-upload__input-file",tabindex:"-1",onChange:k,accept:y.value,multiple:c.value,disabled:l.value,type:"file"},null)])}}}),m9={exports:{}};(function(e,t){(function(n){e.exports=n()})(function(n){var i=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function l(k,C){var b=k[0],I=k[1],N=k[2],T=k[3];b+=(I&N|~I&T)+C[0]-680876936|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[1]-389564586|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[2]+606105819|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[3]-1044525330|0,I=(I<<22|I>>>10)+N|0,b+=(I&N|~I&T)+C[4]-176418897|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[5]+1200080426|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[6]-1473231341|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[7]-45705983|0,I=(I<<22|I>>>10)+N|0,b+=(I&N|~I&T)+C[8]+1770035416|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[9]-1958414417|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[10]-42063|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[11]-1990404162|0,I=(I<<22|I>>>10)+N|0,b+=(I&N|~I&T)+C[12]+1804603682|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[13]-40341101|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[14]-1502002290|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[15]+1236535329|0,I=(I<<22|I>>>10)+N|0,b+=(I&T|N&~T)+C[1]-165796510|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[6]-1069501632|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[11]+643717713|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[0]-373897302|0,I=(I<<20|I>>>12)+N|0,b+=(I&T|N&~T)+C[5]-701558691|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[10]+38016083|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[15]-660478335|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[4]-405537848|0,I=(I<<20|I>>>12)+N|0,b+=(I&T|N&~T)+C[9]+568446438|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[14]-1019803690|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[3]-187363961|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[8]+1163531501|0,I=(I<<20|I>>>12)+N|0,b+=(I&T|N&~T)+C[13]-1444681467|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[2]-51403784|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[7]+1735328473|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[12]-1926607734|0,I=(I<<20|I>>>12)+N|0,b+=(I^N^T)+C[5]-378558|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[8]-2022574463|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[11]+1839030562|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[14]-35309556|0,I=(I<<23|I>>>9)+N|0,b+=(I^N^T)+C[1]-1530992060|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[4]+1272893353|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[7]-155497632|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[10]-1094730640|0,I=(I<<23|I>>>9)+N|0,b+=(I^N^T)+C[13]+681279174|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[0]-358537222|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[3]-722521979|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[6]+76029189|0,I=(I<<23|I>>>9)+N|0,b+=(I^N^T)+C[9]-640364487|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[12]-421815835|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[15]+530742520|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[2]-995338651|0,I=(I<<23|I>>>9)+N|0,b+=(N^(I|~T))+C[0]-198630844|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[7]+1126891415|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[14]-1416354905|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[5]-57434055|0,I=(I<<21|I>>>11)+N|0,b+=(N^(I|~T))+C[12]+1700485571|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[3]-1894986606|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[10]-1051523|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[1]-2054922799|0,I=(I<<21|I>>>11)+N|0,b+=(N^(I|~T))+C[8]+1873313359|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[15]-30611744|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[6]-1560198380|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[13]+1309151649|0,I=(I<<21|I>>>11)+N|0,b+=(N^(I|~T))+C[4]-145523070|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[11]-1120210379|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[2]+718787259|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[9]-343485551|0,I=(I<<21|I>>>11)+N|0,k[0]=b+k[0]|0,k[1]=I+k[1]|0,k[2]=N+k[2]|0,k[3]=T+k[3]|0}function o(k){var C=[],b;for(b=0;b<64;b+=4)C[b>>2]=k.charCodeAt(b)+(k.charCodeAt(b+1)<<8)+(k.charCodeAt(b+2)<<16)+(k.charCodeAt(b+3)<<24);return C}function c(k){var C=[],b;for(b=0;b<64;b+=4)C[b>>2]=k[b]+(k[b+1]<<8)+(k[b+2]<<16)+(k[b+3]<<24);return C}function f(k){var C=k.length,b=[1732584193,-271733879,-1732584194,271733878],I,N,T,A,P,J;for(I=64;I<=C;I+=64)l(b,o(k.substring(I-64,I)));for(k=k.substring(I-64),N=k.length,T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],I=0;I<N;I+=1)T[I>>2]|=k.charCodeAt(I)<<(I%4<<3);if(T[I>>2]|=128<<(I%4<<3),I>55)for(l(b,T),I=0;I<16;I+=1)T[I]=0;return A=C*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(A[2],16),J=parseInt(A[1],16)||0,T[14]=P,T[15]=J,l(b,T),b}function u(k){var C=k.length,b=[1732584193,-271733879,-1732584194,271733878],I,N,T,A,P,J;for(I=64;I<=C;I+=64)l(b,c(k.subarray(I-64,I)));for(k=I-64<C?k.subarray(I-64):new Uint8Array(0),N=k.length,T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],I=0;I<N;I+=1)T[I>>2]|=k[I]<<(I%4<<3);if(T[I>>2]|=128<<(I%4<<3),I>55)for(l(b,T),I=0;I<16;I+=1)T[I]=0;return A=C*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(A[2],16),J=parseInt(A[1],16)||0,T[14]=P,T[15]=J,l(b,T),b}function h(k){var C="",b;for(b=0;b<4;b+=1)C+=i[k>>b*8+4&15]+i[k>>b*8&15];return C}function m(k){var C;for(C=0;C<k.length;C+=1)k[C]=h(k[C]);return k.join("")}m(f("hello")),typeof ArrayBuffer!="undefined"&&!ArrayBuffer.prototype.slice&&function(){function k(C,b){return C=C|0||0,C<0?Math.max(C+b,0):Math.min(C,b)}ArrayBuffer.prototype.slice=function(C,b){var I=this.byteLength,N=k(C,I),T=I,A,P,J,z;return b!==n&&(T=k(b,I)),N>T?new ArrayBuffer(0):(A=T-N,P=new ArrayBuffer(A),J=new Uint8Array(P),z=new Uint8Array(this,N,A),J.set(z),P)}}();function p(k){return/[\u0080-\uFFFF]/.test(k)&&(k=unescape(encodeURIComponent(k))),k}function w(k,C){var b=k.length,I=new ArrayBuffer(b),N=new Uint8Array(I),T;for(T=0;T<b;T+=1)N[T]=k.charCodeAt(T);return C?N:I}function y(k){return String.fromCharCode.apply(null,new Uint8Array(k))}function v(k,C,b){var I=new Uint8Array(k.byteLength+C.byteLength);return I.set(new Uint8Array(k)),I.set(new Uint8Array(C),k.byteLength),b?I:I.buffer}function L(k){var C=[],b=k.length,I;for(I=0;I<b-1;I+=2)C.push(parseInt(k.substr(I,2),16));return String.fromCharCode.apply(String,C)}function x(){this.reset()}return x.prototype.append=function(k){return this.appendBinary(p(k)),this},x.prototype.appendBinary=function(k){this._buff+=k,this._length+=k.length;var C=this._buff.length,b;for(b=64;b<=C;b+=64)l(this._hash,o(this._buff.substring(b-64,b)));return this._buff=this._buff.substring(b-64),this},x.prototype.end=function(k){var C=this._buff,b=C.length,I,N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T;for(I=0;I<b;I+=1)N[I>>2]|=C.charCodeAt(I)<<(I%4<<3);return this._finish(N,b),T=m(this._hash),k&&(T=L(T)),this.reset(),T},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(k){return this._buff=k.buff,this._length=k.length,this._hash=k.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(k,C){var b=C,I,N,T;if(k[b>>2]|=128<<(b%4<<3),b>55)for(l(this._hash,k),b=0;b<16;b+=1)k[b]=0;I=this._length*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(I[2],16),T=parseInt(I[1],16)||0,k[14]=N,k[15]=T,l(this._hash,k)},x.hash=function(k,C){return x.hashBinary(p(k),C)},x.hashBinary=function(k,C){var b=f(k),I=m(b);return C?L(I):I},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(k){var C=v(this._buff.buffer,k,!0),b=C.length,I;for(this._length+=k.byteLength,I=64;I<=b;I+=64)l(this._hash,c(C.subarray(I-64,I)));return this._buff=I-64<b?new Uint8Array(C.buffer.slice(I-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(k){var C=this._buff,b=C.length,I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],N,T;for(N=0;N<b;N+=1)I[N>>2]|=C[N]<<(N%4<<3);return this._finish(I,b),T=m(this._hash),k&&(T=L(T)),this.reset(),T},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var k=x.prototype.getState.call(this);return k.buff=y(k.buff),k},x.ArrayBuffer.prototype.setState=function(k){return k.buff=w(k.buff,!0),x.prototype.setState.call(this,k)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(k,C){var b=u(new Uint8Array(k)),I=m(b);return C?L(I):I},x})})(m9);var p9=m9.exports;function Yc(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}const dC=e=>{if(typeof XMLHttpRequest=="undefined")throw new Error("XMLHttpRequest is undefined");const t=new XMLHttpRequest,{action:n}=e;t.upload&&t.upload.addEventListener("progress",o=>{const c=o;c.percent=o.total>0?o.loaded/o.total*100:0,e.onProgress(c)});const i=new FormData;if(e.data){let o=e.data;Array.isArray(o)||(o=[o]),o.forEach(c=>{for(const[f,u]of Object.entries(c))Array.isArray(u)?i.append(f,...u):i.append(f,u)})}if(e.formDataAttributes){let o=e.formDataAttributes;Array.isArray(o)||(o=[o]),o.forEach(c=>{Array.isArray(c.value)?i.append(c.name,...c.value):i.append(c.name,c.value)})}if(i.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(new Error("An error occurred during upload"))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(new Error("An error occurred during upload"));e.onSuccess(Yc(t))}),t.addEventListener("loadend",()=>{e.onComplete()}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0),e.header)if(Array.isArray(e.header))e.header.forEach(o=>{const c=o.name,f=o.value;t.setRequestHeader(c,f)});else{const o=e.header.name,c=e.header.value;t.setRequestHeader(o,c)}const l=e.headers||{};if(l instanceof Headers)l.forEach((o,c)=>t.setRequestHeader(c,o));else for(const[o,c]of Object.entries(l))ef(c)||t.setRequestHeader(o,String(c));return t.send(i),t},b9=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,fC=async e=>{const t=e.chunkSize*1024*1024,{file:n}=e;if(!n)throw new Error("File not found");const i=Math.ceil(n.size/t),l=await gC(n,t),o=[];hC(e,n,i,l,o,t),await Promise.all(o).then(()=>{const c={size:n.size,name:n.name,total:i,hash:l},f=new XMLHttpRequest;f.open(e.method,e.mergeUrl,!0),f.onreadystatechange=()=>{if(f.readyState===4){if(f.status<200||f.status>=300)return e.onError(new Error("An error occurred during upload"));e.onSuccess(Yc(f))}},f.onloadend=()=>{e.onComplete()},f.setRequestHeader("Content-type","application/JSON"),f.send(JSON.stringify(c))})},hC=(e,t,n,i,l,o)=>{for(let c=0;c<n;c++){const f=new Promise((u,h)=>{const m=c*o,p=Math.min(t.size,m+o),w=new FormData;if(e.data){let L=e.data;Array.isArray(L)||(L=[L]),L.forEach(x=>{for(const[k,C]of Object.entries(x))Array.isArray(C)?w.append(k,...C):w.append(k,C)})}if(e.formDataAttributes){let L=e.formDataAttributes;Array.isArray(L)||(L=[L]),L.forEach(x=>{Array.isArray(x.value)?w.append(x.name,...x.value):w.append(x.name,x.value)})}w.append("file",b9.call(t,m,p)),w.append("name",t.name),w.append("total",n.toString()),w.append("index",c.toString()),w.append("size",t.size.toString()),w.append("hash",i.toString());const y=new XMLHttpRequest;if(y.onreadystatechange=()=>{if(y.readyState===4){const L=Yc(y);y.status<200||y.status>=300?(h(L),e.onError(new Error("An error occurred during upload"))):u("reponseText")}},y.upload.addEventListener("progress",L=>{const x=L;e.onProgress(x,c)},!1),e.withCredentials&&"withCredentials"in y&&(y.withCredentials=!0),y.open(e.method,e.sliceUrl,!0),e.header)if(Array.isArray(e.header))e.header.forEach(L=>{const x=L.name,k=L.value;y.setRequestHeader(x,k)});else{const L=e.header.name,x=e.header.value;y.setRequestHeader(L,x)}const v=e.headers||{};if(v instanceof Headers)v.forEach((L,x)=>y.setRequestHeader(x,L));else for(const[L,x]of Object.entries(v))ef(x)||y.setRequestHeader(L,String(x));y.send(w)});l.push(f)}},gC=(e,t)=>new Promise((n,i)=>{const l=Math.ceil(e.size/t);let o=0;const c=new p9.ArrayBuffer,f=new FileReader;function u(){const h=o*t,m=h+t>=e.size?e.size:h+t;f.readAsArrayBuffer(b9.call(e,h,m))}f.onload=h=>{if(c.append(h.target.result),o+=1,o<l)u();else{const m=c.end(),p=new p9;p.append(m),p.append(e.name);const w=p.end();n(w)}},f.onerror=()=>{i(new Error("File slcie failed"))},u()}).catch(n=>{console.log(n)});function y9(e){return Date.now()+e}var mC=(e,t)=>{const n=a.computed(()=>{var w;return typeof e.size=="number"?e.size:(w=e==null?void 0:e.size)==null?void 0:w.maxImgSize}),i=a.computed(()=>{var w;return typeof e.size=="number"?e.size:(w=e==null?void 0:e.size)==null?void 0:w.maxImgSize}),l=a.ref([]);function o(w){return l.value.find(y=>y.uid===w.uid)}let c=0;function f(w){var x;c+=1,w.uid=y9(c);const y={uid:w.uid,name:w.name,status:Ea.NEW,size:w.size,raw:w},v=w.type.startsWith("image/");let L=null;if(v){try{y.url=window.URL.createObjectURL(w)}catch(k){console.error(k)}y.isPic=!0}return e.validateName&&!((x=e.validateName)!=null&&x.test(y.name))&&(y.status=Ea.FAIL,y.statusText="invalid filename",L=new Error(y.statusText)),v&&w.size>n.value*1024**2&&(y.status=Ea.FAIL,y.statusText="invalid file size",L=new Error(y.statusText)),!v&&w.size>i.value*1024**2&&(y.status=Ea.FAIL,y.statusText="invalid file size",L=new Error(y.statusText)),l.value.push(y),L}async function u(w){var L;const y=w instanceof File?o(w):w,v=x=>{var k;t.onRemove(x,l.value),l.value.splice(l.value.indexOf(y),1),(k=x.url)!=null&&k.startsWith("blob:")&&URL.revokeObjectURL(x.url)};e.beforeRemove?await((L=e.beforeRemove)==null?void 0:L.call(e,y,l.value))!==!1&&v(y):v(y)}async function h(w,y,v){const L=o(y);!L||(L.status="fail",L.statusText=w.message,L.response=v)}async function m(w,y){const v=o(y);!v||(v.status="success",v.response=w)}async function p(w,y){const v=o(y);!v||(v.status="uploading",v.percentage=Math.round(w.percent))}return a.watch(()=>e.files,w=>{l.value=w.map(y=>{var v,L;return c+=1,Te(U({},y),{uid:(v=y.uid)!=null?v:y9(c),status:(L=y.status)!=null?L:Ea.SUCCESS})})},{immediate:!0,deep:!0}),{fileList:l,handlePreprocess:f,handleRemove:u,handleError:h,handleSuccess:m,handleProgress:p}},pC=a.defineComponent({name:"Upload",props:li,emits:["exceed","progress","success","error","delete","done"],setup(e,{slots:t,emit:n,expose:i}){const l=a.shallowRef({}),o=a.computed(()=>e.theme===si.PICTURE),c=a.computed(()=>o.value&&!e.multiple),f=a.computed(()=>{var N;return Se({[ia]:!0,[`${ia}--${e.theme}`]:!0,[`${ia}--disabled`]:e.disabled,[`${ia}--single-picture`]:c.value,[e.extCls]:(N=e.extCls)!=null?N:!1})}),u={theme:e.theme,multiple:e.multiple,disabled:e.disabled,accept:e.accept};function h(N,T){I(N),n("delete",N,T)}const{fileList:m,handlePreprocess:p,handleRemove:w,handleProgress:y,handleSuccess:v,handleError:L}=mC(e,{onRemove:h});function x(N){if(!N.length)return;if(e.limit&&m.value.length+N.length>e.limit){n("exceed",N,m.value);return}let T=N;(!e.multiple||e.limit===1)&&(T=N.slice(0,1));for(const A of T){const P=A,J=p(P);if(J){n("error",P,m.value,J);return}e.autoUpload&&C(P,T)}}function k(N){b(N.raw)}async function C(N,T){var P;if(!e.beforeUpload)return b(N,T);let A;try{A=await((P=e.beforeUpload)==null?void 0:P.call(e,N))}catch{A=!1}if(A===!1){w(N);return}b(N,T)}function b(N,T){const{headers:A,header:P,data:J,formDataAttributes:z,method:E,withCredentials:ne,name:_,url:ce,sliceUrl:re,mergeUrl:ae,chunkSize:ue,customRequest:ie}=e,{uid:Y}=N,W={headers:A,header:P,withCredentials:ne,file:N,data:J,formDataAttributes:z,method:E,filename:_,action:ce,sliceUrl:re,mergeUrl:ae,chunkSize:ue,onProgress:K=>{y(K,N),n("progress",K,N,m.value)},onSuccess:K=>{var he;const fe=K;if((he=e==null?void 0:e.handleResCode)!=null&&he.call(e,fe))v(K,N),n("success",K,N,m.value);else{const Ce=new Error((fe==null?void 0:fe.message)||"unknow error");L(Ce,N,K),n("error",N,m.value,Ce)}delete l.value[Y]},onError:K=>{L(K,N),n("error",N,m.value,K),delete l.value[Y]},onComplete:()=>{T&&T.indexOf(N)===T.length-1&&n("done",m.value)}};let Q=e.sliceUpload?fC:dC;ie&&(Q=ie);const F=Q(W);l.value[Y]=F,F instanceof Promise&&F.then(W.onSuccess,W.onError)}function I(N){let T=l.value;N&&(T={[N.uid]:l.value[N.uid]}),Object.keys(T).forEach(A=>{if(T[A]instanceof XMLHttpRequest){const P=T[A];P==null||P.abort()}delete l.value[A]})}return a.onBeforeUnmount(()=>{m.value.forEach(({url:N})=>{N!=null&&N.startsWith("blob:")&&URL.revokeObjectURL(N)})}),i({handleRemove:w,handleRetry:k}),()=>a.createVNode("div",{class:f.value},[!o.value&&a.createVNode(g9,a.mergeProps(u,{onChange:x}),t),t.tip?t.tip():e.tip&&a.createVNode("div",{class:`${ia}__tip`},[e.tip]),a.createVNode(uC,{files:m.value,theme:e.theme,disabled:e.disabled,multiple:e.multiple,onRemove:w,onRetry:k},{innerTrigger:N=>o.value&&a.createVNode(g9,a.mergeProps(u,{file:N,onChange:x,onRemove:w}),t),file:t.file})])}});const C9=He(pC);function zi(){}zi.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=i.callback;typeof i=="function"&&(l=i,i={}),this.options=i;var o=this;function c(L){return l?(setTimeout(function(){l(void 0,L)},0),!0):L}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var f=n.length,u=t.length,h=1,m=f+u,p=[{newPos:-1,components:[]}],w=this.extractCommon(p[0],n,t,0);if(p[0].newPos+1>=f&&w+1>=u)return c([{value:this.join(n),count:n.length}]);function y(){for(var L=-1*h;L<=h;L+=2){var x=void 0,k=p[L-1],C=p[L+1],b=(C?C.newPos:0)-L;k&&(p[L-1]=void 0);var I=k&&k.newPos+1<f,N=C&&0<=b&&b<u;if(!I&&!N){p[L]=void 0;continue}if(!I||N&&k.newPos<C.newPos?(x=yC(C),o.pushComponent(x.components,void 0,!0)):(x=k,x.newPos++,o.pushComponent(x.components,!0,void 0)),b=o.extractCommon(x,n,t,L),x.newPos+1>=f&&b+1>=u)return c(bC(o,x.components,n,t,o.useLongestToken));p[L]=x}h++}if(l)(function L(){setTimeout(function(){if(h>m)return l();y()||L()},0)})();else for(;h<=m;){var v=y();if(v)return v}},pushComponent:function(t,n,i){var l=t[t.length-1];l&&l.added===n&&l.removed===i?t[t.length-1]={count:l.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,l){for(var o=n.length,c=i.length,f=t.newPos,u=f-l,h=0;f+1<o&&u+1<c&&this.equals(n[f+1],i[u+1]);)f++,u++,h++;return h&&t.components.push({count:h}),t.newPos=f,u},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function bC(e,t,n,i,l){for(var o=0,c=t.length,f=0,u=0;o<c;o++){var h=t[o];if(h.removed){if(h.value=e.join(i.slice(u,u+h.count)),u+=h.count,o&&t[o-1].added){var p=t[o-1];t[o-1]=t[o],t[o]=p}}else{if(!h.added&&l){var m=n.slice(f,f+h.count);m=m.map(function(y,v){var L=i[u+v];return L.length>y.length?L:y}),h.value=e.join(m)}else h.value=e.join(n.slice(f,f+h.count));f+=h.count,h.added||(u+=h.count)}}var w=t[c-1];return c>1&&typeof w.value=="string"&&(w.added||w.removed)&&e.equals("",w.value)&&(t[c-2].value+=w.value,t.pop()),t}function yC(e){return{newPos:e.newPos,components:e.components.slice(0)}}var M9=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,w9=/\S/,v9=new zi;v9.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!w9.test(e)&&!w9.test(t)},v9.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M9.test(t[n])&&M9.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Uc=new zi;Uc.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var l=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),t.push(l))}return t};function CC(e,t,n){return Uc.diff(e,t,n)}var MC=new zi;MC.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var wC=new zi;wC.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ol(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ol=function(t){return typeof t}:ol=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(e)}function $c(e){return vC(e)||IC(e)||NC(e)||LC()}function vC(e){if(Array.isArray(e))return Xc(e)}function IC(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function NC(e,t){if(!!e){if(typeof e=="string")return Xc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xc(e,t)}}function Xc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function LC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
57
+ `,P={d:A,stroke:m||"#f5f5f5","stroke-linecap":f,"stroke-width":w,"fill-opacity":"0",class:"process-circle-trail",style:N},J={d:A,stroke:c||"#13ce66","stroke-linecap":f,"stroke-width":l>0&&w||0,"fill-opacity":"0",class:`process-circle-path bk-${u}-circle-trail`,style:T};return a.createVNode("div",{class:"progress-outer-circle",style:v},[a.createVNode("svg",{viewBox:"0 0 100 100"},[a.createVNode("path",P,null),a.createVNode("path",J,null)]),a.createVNode("span",{class:"progress-circle-text",style:p},[n==null?void 0:n.default()])])},$m=(e,{attrs:t,slots:n})=>{const{percent:i,strokeWidth:l,size:o,color:c,titleStyle:f,showText:u,textInside:h,theme:m}=t,p={height:`${l}px`,lineHeight:`${l}px`},w={width:`${i}%`,background:c,animationDuration:"3s"},y=(v=!0)=>(u||n.default)&&(v&&h||!v&&!h)?n==null?void 0:n.default():null;return a.createVNode("div",{class:"progress-outer"},[a.createVNode("div",{class:`bk-progress-${o||"normal"} progress-bar`,style:p},[a.createVNode("div",{style:w,class:{"progress-inner":!0,[`bk-${m}`]:!0}},[a.createVNode("div",{class:"inner-text",style:f},[y()])])]),y(!1)])};function I0(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var Xm=a.defineComponent({name:"Progress",props:{extCls:g.string,type:g.string.validate(e=>["line","circle","dashboard"].includes(e)).def("line"),percent:g.number.def(0),theme:g.theme().def("primary"),size:g.size(),width:g.number.def(126),strokeWidth:g.number,strokeLinecap:g.string.def("round"),textInside:g.bool.def(!1),showText:g.bool.def(!0),color:g.string,bgColor:g.string,fixed:g.number.validate(e=>e>=0&&e<=20).def(0),format:g.func.def(e=>`${e}%`),titleStyle:g.object.def({fontSize:"16px",verticalAlign:"middle"})},setup(){return{}},methods:{validPercent(e){return!e||e<0?0:e>100?100:e},renderProcessInfo(){var f;const{showText:e,format:t,percent:n,textInside:i,titleStyle:l,fixed:o}=this.$props,c=t((f=this.validPercent(n))==null?void 0:f.toFixed(o));return(e||this.$slots.default)&&i?this.$slots.default?this.$slots.default():a.createVNode("span",null,[c]):!e||i?null:a.createVNode("span",{class:"progress-text",style:typeof c=="string"?l:void 0},[this.$slots.default?this.$slots.default():c])}},render(){const e=this.renderProcessInfo(),t=Te(U({},this.$props),{percent:this.validPercent(this.percent)});let n=a.createVNode($m,t,I0(e)?e:{default:()=>[e]});(this.type==="circle"||this.type==="dashboard")&&(n=a.createVNode(Um,t,I0(e)?e:{default:()=>[e]}));const i={class:Se({extCls:!!this.extCls},`bk-progress bk-progress-${this.type}`)};return a.createVNode("div",i,[n])}});const kr=He(Xm),N0=Symbol("RadioGroup");function L0(){const e=a.ref(!1);return[e,{blur:()=>{e.value=!1},focus:()=>{e.value=!0}}]}const k0=()=>{const e=a.getCurrentInstance(),{props:t,emit:n}=e,i=a.inject(N0,So),l=!Cf(i),o=a.ref(!1),c=a.computed(()=>l&&i.props.disabled?!0:t.disabled);l?a.watch(()=>i.props.modelValue,h=>{o.value=h===t.label},{immediate:!0}):a.watch(()=>t.modelValue,h=>{h!==""&&(o.value=h===t.label)},{immediate:!0});const f=(h=!0)=>{o.value=h},u=h=>{if(c.value)return;const m=h.target;o.value=m.checked;const p=o.value?t.label:"";n("change",p),n("update:modelValue",p),l&&i.handleChange(e.proxy),a.nextTick(()=>{m.checked!==o.value&&(m.checked=o.value)})};return a.onMounted(()=>{l&&i.register(e.proxy)}),a.onBeforeUnmount(()=>{l&&i.unregister(e.proxy)}),{isChecked:o,isDisabled:c,setChecked:f,handleChange:u}},Km={name:g.string.def(""),label:g.oneOfType([String,Number,Boolean]).isRequired,modelValue:g.oneOfType([String,Number,Boolean]).def(""),checked:g.bool.def(!1),disabled:g.bool.def(!1)};var qm=a.defineComponent({name:"Radio",props:Km,emits:["change","update:modelValue"],setup(){const[e,{blur:t,focus:n}]=L0(),{isChecked:i,isDisabled:l,setChecked:o,handleChange:c}=k0();return{isFocused:e,isChecked:i,isDisabled:l,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c}},render(){const e=Se({"bk-radio":!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked});return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:"bk-radio-input",type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),a.createVNode("span",{class:"bk-radio-text"},[this.$slots.default?this.$slots.default():this.label])])}});const ep={name:g.string.def(""),label:g.oneOfType([String,Number,Boolean]).isRequired,modelValue:g.oneOfType([String,Number,Boolean]).def(""),checked:g.bool.def(!1),disabled:g.bool.def(!1),size:g.size()};var tp=a.defineComponent({name:"RadioButton",props:ep,emits:["change","update:modelValue"],setup(){const[e,{blur:t,focus:n}]=L0(),{isChecked:i,isDisabled:l,setChecked:o,handleChange:c}=k0();return{isFocused:e,isChecked:i,isDisabled:l,setChecked:o,handleBlur:t,handleFocus:n,handleChange:c}},render(){const e=Se({"bk-radio-button":!0,"is-focused":this.isFocused,"is-disabled":this.isDisabled,"is-checked":this.isChecked});return a.createVNode("label",{class:e,tabindex:"0"},[a.createVNode("input",{class:"bk-radio-button-input",type:"radio",tabindex:"0",value:this.label,checked:this.isChecked,disabled:this.isDisabled,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange},null),a.createVNode("div",{class:"bk-radio-button-text"},[this.$slots.default?this.$slots.default():this.label])])}});const np={name:g.string.def(""),modelValue:g.oneOfType([String,Number,Boolean]),disabled:g.bool,withValidate:g.bool.def(!0)};var ip=a.defineComponent({name:"RadioGroup",props:np,emits:["change","update:modelValue"],setup(e,t){const n=En(),i=[],l=f=>{i.push(f)},o=f=>{const u=i.indexOf(f);u>-1&&i.splice(u,1)},c=f=>{const u=f.label;i.forEach(h=>{h!==f&&h.setChecked(!1)}),t.emit("update:modelValue",u),t.emit("change",u)};return a.provide(N0,{props:e,register:l,unregister:o,handleChange:c}),a.watch(()=>e.modelValue,()=>{var f;e.withValidate&&((f=n==null?void 0:n.validate)==null||f.call(n,"change"))}),a.onMounted(()=>{e.modelValue!==""&&i.forEach(f=>{f.setChecked(f.label===e.modelValue)})}),{}},render(){var e;return a.createVNode("div",{class:"bk-radio-group"},[(e=this.$slots)==null?void 0:e.default()])}});const T0=Bt(qm,{Group:ip,Button:tp});var Zs=a.defineComponent({name:"Star",props:{rate:g.number.def(0),width:g.number.def(15),height:g.number.def(16),editable:g.bool.def(!0),hoverRate:g.number.def(0),max:g.number.def(5)},emits:["chooseRate","changeHover"],setup(e,{emit:t}){const n=f=>{if(!e.editable)return;const u=f+1;t("chooseRate",u)},i=f=>{if(!e.editable)return;const u=f+1;t("changeHover",u)},l=f=>Se({"bk-is-select":f<Math.floor(o.value),"bk-is-edit":e.editable,"bk-rate-star":!0}),o=a.computed(()=>e.hoverRate||e.rate),c={width:`${e.width}px`,height:`${e.height}px`,minWidth:`${e.width}px`};return()=>a.createVNode("p",{class:"bk-rate-stars"},[Array(e.max).fill(1).map((f,u)=>a.createVNode("svg",{class:l(u),style:c,x:"0px",y:"0px",viewBox:"0 0 64 64",onClick:()=>n(u),onMouseenter:()=>i(u)},[a.createVNode("g",{transform:"translate(-143.000000, -635.000000)"},[a.createVNode("g",{transform:"translate(83.000000, 114.000000)"},[a.createVNode("g",{transform:"translate(15.000000, 384.000000)"},[a.createVNode("g",{transform:"translate(29.000000, 137.000000)"},[a.createVNode("polygon",{class:"st1",points:"48,53 28.2,63.9 32,40.8 16,24.4 38.1,21 48,-0.1 57.8,21 79.9,24.4 63.9,40.8 67.7,63.9"},null)])])])])]))])}}),ap=a.defineComponent({name:"Rate",components:{star:Zs},props:{modelValue:g.number.def(0),size:g.size(),editable:g.bool.def(!0),withValidate:g.bool.def(!0)},emits:["change","update:modelValue"],setup(e,{emit:t}){const n=En(),i=a.ref(0),l=p=>{!e.editable||(t("update:modelValue",p),t("change",p))},o=p=>{i.value=p},c=Se({"bk-rate":!0}),u={small:{width:12,height:12},large:{width:18,height:18}}[e.size]||{width:15,height:16},h=a.computed(()=>{const p=Math.floor(e.modelValue),w=(u.width+3)*p,y=u.width*(e.modelValue-p);return{width:`${w+y}px`}}),m={width:u.width,height:u.height};return a.watch(()=>e.modelValue,()=>{var p;e.withValidate&&((p=n==null?void 0:n.validate)==null||p.call(n,"change"))}),()=>a.createVNode("p",{class:c},[e.editable?a.createVNode(Zs,a.mergeProps({rate:e.modelValue,"hover-rate":i.value,onChooseRate:l,onChangeHover:o,onMouseleave:()=>o(0)},m),null):[a.createVNode(Zs,a.mergeProps({rate:5,style:h.value,class:"bk-score-real",editable:!1},m),null),a.createVNode(Zs,a.mergeProps({rate:0,editable:!1},m),null)]])}});const x0=He(ap);var rp=a.defineComponent({name:"Swiper",props:{isLoop:g.bool.def(!0),loopTime:g.number.def(8e3),pics:g.array.def([]),list:g.array.def([]),height:g.number,width:g.number},emits:["index-change"],setup(e,{emit:t,slots:n}){const{isLoop:i,loopTime:l,pics:o,list:c,height:f,width:u}=a.toRefs(e),h=a.ref(),m=a.ref(0),p=a.ref(0),w=a.ref(0),y=a.ref(0);let v;const L=a.computed(()=>{var _;return((_=c.value)==null?void 0:_.length)>0?c.value:o.value}),x=a.computed(()=>({width:`${p.value*L.value.length}px`,transform:`translateX(-${p.value*m.value}px)`})),k=a.computed(()=>({width:`${p.value}px`,height:`${w.value}px`})),C=_=>{let ce=_;_>=L.value.length&&(ce=0),_<0&&(ce=L.value.length-1),m.value=ce,t("index-change",ce)},b=_=>{!_||window.open(_,"_blank")},I=_=>["bk-swiper-img",{"bk-swiper-link":_.link},_.class],N=_=>({"background-image":`url(${_.url})`,"background-color":_.color}),T=_=>({"bk-current-index":m.value===_}),A=()=>{i.value&&(y.value=window.setTimeout(()=>{C(m.value+1),A()},l.value))},P=()=>{window.clearTimeout(y.value)},J=()=>{var ce;const _=(ce=h.value)==null?void 0:ce.parentElement;!_||!window.ResizeObserver||(v=new ResizeObserver(()=>{ne()}),v.observe(_))},z=()=>{var _;(_=v.disconnect)==null||_.call(v)},E=_=>{if(_===void 0)return{height:0,width:0};const ce=getComputedStyle(_),re=_.clientWidth-parseFloat(ce.paddingTop)-parseFloat(ce.paddingBottom);return{height:_.clientHeight-parseFloat(ce.paddingLeft)-parseFloat(ce.paddingRight),width:re}},ne=()=>{var ce;const _=E((ce=h.value)==null?void 0:ce.parentElement);p.value=+u.value>0?u.value:_.width,w.value=+f.value>0?f.value:_.height};return a.watch([f,u],ne),a.onMounted(()=>{ne(),A(),J()}),a.onBeforeUnmount(()=>{P(),z()}),()=>a.createVNode("section",{class:"bk-swiper-home",ref:h,style:k.value},[a.createVNode("hgroup",{style:x.value,class:"bk-transition bk-swiper-main"},[L.value.map(_=>{var ce,re;return a.createVNode("h3",{class:"bk-swiper-card",style:k.value},[(re=(ce=n.default)==null?void 0:ce.call(n,_))!=null?re:a.createVNode("span",{class:I(_),style:N(_),onClick:()=>b(_.link)},null)])})]),a.createVNode("ul",{class:"bk-swiper-index"},[L.value.map((_,ce)=>a.createVNode("li",{class:T(ce),onMouseover:()=>C(ce)},null))]),a.createVNode("span",{class:"bk-swiper-nav bk-nav-prev",onClick:()=>C(m.value-1)},[a.createVNode("i",{class:"bk-swiper-nav-icon"},null)]),a.createVNode("span",{class:"bk-swiper-nav bk-nav-next",onClick:()=>C(m.value+1)},[a.createVNode("i",{class:"bk-swiper-nav-icon"},null)])])}});const S0=He(rp),Ic=Symbol("BkSelect"),D0=Symbol("BkOptionGroup");function j0(){const e=a.ref(!1);return{isHover:e,setHover:()=>{e.value=!0},cancelHover:()=>{e.value=!1}}}function Nc(e){return{register:(i,l)=>{if(!!l){if(e.value.has(i)){console.warn(`repeat ${i}`,l);return}return e.value.set(i,l)}},unregister:i=>{e.value.delete(i)}}}function sp(e,t=200){let n,i=e;return a.customRef((l,o)=>({get(){return l(),i},set(c){clearTimeout(n),c===void 0||c===""?(i=c,o()):n=setTimeout(()=>{i=c,o()},t)}}))}function lp(e,t){const{popoverMinWidth:n}=e;let i=null;const l=a.ref("auto"),o=a.ref(!1),c=()=>{o.value=!o.value},f=()=>{o.value=!1},u=()=>{o.value=!0},h=()=>{var m;l.value=Math.max((m=t.value)==null?void 0:m.offsetWidth,n)};return a.onMounted(()=>{!t.value||(i=V1(t.value,h,60,!0),i.start())}),a.onBeforeUnmount(()=>{i==null||i.stop(),i=null}),{isPopoverShow:o,popperWidth:l,togglePopover:c,hidePopover:f,showPopover:u}}function op(e,t){const n=sp(""),i=a.ref(!1);return a.watch(n,async()=>{try{i.value=!0,await e(n.value),i.value=!1}catch(l){console.error(l)}finally{t==null||t()}}),{searchKey:n,searchLoading:i}}function Tr(e=""){return e&&String(e).trim().toLowerCase()}var Gs=a.defineComponent({name:"Option",props:{value:g.any,label:g.string.def(""),disabled:g.bool.def(!1)},setup(e){const{proxy:t}=a.getCurrentInstance(),n=a.reactive({visible:!0}),{disabled:i,value:l}=a.toRefs(e),o=a.inject(Ic,null),c=a.inject(D0,null),f=a.computed(()=>{var y;return(y=o==null?void 0:o.selected)==null?void 0:y.some(v=>v.value===l.value)}),u=a.computed(()=>o==null?void 0:o.multiple),h=a.computed(()=>(o==null?void 0:o.activeOptionValue)===l.value),m=a.computed(()=>o==null?void 0:o.showSelectedIcon),p=()=>{i.value||o==null||o.handleOptionSelected(t)},w=()=>{o.activeOptionValue=l.value};return a.onBeforeMount(()=>{o==null||o.register(l.value,t),c==null||c.register(l.value,t)}),a.onBeforeUnmount(()=>{o==null||o.unregister(l.value),c==null||c.unregister(l.value)}),Te(U({},a.toRefs(n)),{selected:f,multiple:u,isHover:h,showSelectedIcon:m,handleOptionClick:p,handleMouseEnter:w})},render(){var t,n,i;const e=Se({"is-selected":this.selected,"is-disabled":this.disabled,"is-multiple":this.multiple,"is-hover":this.isHover,"bk-select-option":!0});return a.withDirectives(a.createVNode("li",{class:e,onClick:this.handleOptionClick,onMouseenter:this.handleMouseEnter},[(i=(n=(t=this.$slots).default)==null?void 0:n.call(t))!=null?i:a.createVNode("span",{class:"bk-select-option-item",title:this.label},[this.label]),this.multiple&&this.selected&&this.showSelectedIcon&&a.createVNode(xa,{class:"bk-select-selected-icon",width:22,height:22},null)]),[[a.vShow,this.visible]])}}),cp=a.defineComponent({name:"Group",props:{label:g.string.def(""),disabled:g.bool.def(!1),collapsible:g.bool.def(!1),collapse:g.bool.def(!1)},setup(e,{emit:t}){const n=a.getCurrentInstance(),{proxy:i}=n,l=a.inject(Ic,null),o=a.reactive({groupCollapse:e.collapse,visible:!0}),c=a.ref(new Map),{register:f,unregister:u}=Nc(c),h=a.computed(()=>`${e.label} (${[...c.value.values()].filter(p=>p.visible).length})`),m=()=>{!e.collapsible||e.disabled||(o.groupCollapse=!o.groupCollapse,t("update:collapse",o.groupCollapse))};return a.provide(D0,a.reactive(Te(U({},a.toRefs(e)),{register:f,unregister:u,groupCollapse:a.toRef(o,"groupCollapse")}))),a.onBeforeMount(()=>{l==null||l.registerGroup(n.uid,i)}),a.onBeforeUnmount(()=>{l==null||l.unregisterGroup(n.uid)}),Te(U({},a.toRefs(o)),{groupLabel:h,handleToggleCollapse:m})},render(){var i,l;const e=Se({"bk-option-group":!0,collapsible:this.collapsible,disabled:this.disabled}),t=Se({"bk-option-group-label":!0,collapsible:this.collapsible}),n=Se({"default-group-label-icon":!0,collapse:this.groupCollapse});return a.withDirectives(a.createVNode("ul",{class:e},[a.createVNode("li",{class:t,onClick:this.handleToggleCollapse},[this.$slots.label?this.$slots.label():a.createVNode("span",{class:"default-group-label"},[this.collapsible&&a.createVNode(ws,{class:n},null),a.createVNode("span",{class:"default-group-label-title"},[this.groupLabel])])]),a.withDirectives(a.createVNode("ul",{class:"bk-option-group-content"},[(l=(i=this.$slots).default)==null?void 0:l.call(i)]),[[a.vShow,!this.groupCollapse]])]),[[a.vShow,this.visible]])}});const up={onContentScroll:Function},dp=U({list:g.array.def([]),enabled:g.bool.def(!0),scrollEvent:g.bool.def(!1),lineHeight:g.oneOfType([g.number,g.func]).def(30),minHeight:g.number.def(30),height:g.oneOfType([g.string.def("100%"),g.number]).def("100%"),width:g.oneOfType([g.string.def("100%"),g.number]).def("100%"),className:g.oneOfType([g.arrayOf(g.string),g.object,g.arrayOf(g.object),g.string]).def(""),contentClassName:g.oneOfType([g.arrayOf(g.string),g.object,g.arrayOf(g.object),g.string]).def(""),contentStyle:g.object.def({}),scrollXName:g.string.def(_e("F-scroll-x")),scrollYName:g.string.def(_e("F-scroll-y")),groupItemCount:g.number.def(1),preloadItemCount:g.number.def(1),renderAs:g.string.def("div"),contentAs:g.string.def("div"),scrollOffsetTop:g.number.def(0),scrollPosition:g.string.def("content"),abosuteHeight:g.oneOfType([g.string.def("auto"),g.number]).def("auto"),throttleDelay:g.number.def(60)},up);var fp=(e,t)=>{const{renderAs:n,contentAs:i}=e,l=(f,u,h,m,p,w,y)=>{t.emit("content-scroll",[f,{translateY:p,translateX:w,pos:y}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:l,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent};return{rendAsTag:()=>{var f,u,h,m,p,w,y,v,L,x,k,C;return a.h(n,{class:e.className},[(h=(u=(f=t.slots).beforeContent)==null?void 0:u.call(f))!=null?h:"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[(w=(p=(m=t.slots).default)==null?void 0:p.call(m,{data:e.list}))!=null?w:""]),[[o,c]]),(L=(v=(y=t.slots).afterContent)==null?void 0:v.call(y))!=null?L:"",(C=(k=(x=t.slots).afterSection)==null?void 0:k.call(x))!=null?C:""])}}};function z0(e,t,n,i){let l=0,o=0,c=0,f=0;for(;l<e;l++){if(f=i(l,[l*n,(l+1)*n,"virtual"]),o+f>t){c=t-o;break}o+=f}return{startIndex:l,height:o,diffHeight:c}}function P0(e,t,n,i,l){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:f,count:u,groupItemCount:h,startIndex:m,endIndex:p}=n,{offsetHeight:w}=i;let y=0,v=0,L=0;if(typeof e=="number"&&(y=Math.floor(o/e),v=Math.ceil(w/e)+y,L=o%e),typeof e=="function"){const x=z0(u,o,h,e);y=x.startIndex>0?x.startIndex:0,L=x.diffHeight,v=z0(u,w,h,e).startIndex+y+1}if(o!==f||y!==m||v!==p){const x=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(l,y,v,o,L,c,{bottom:x>=0?x:0})}}function hp(e,t,n){const{lineHeight:i=30,handleScrollCallback:l,pagination:o={},onlyScroll:c}=n.value;if(c){const w=t.scrollTop,y=t.scrollLeft,v=t.scrollHeight-t.offsetHeight-t.scrollTop;l(e,null,null,w,w,y,{bottom:v>=0?v:0});return}const{startIndex:f,endIndex:u,groupItemCount:h,count:m,scrollTop:p}=o;P0(i,l,{scrollTop:p,startIndex:f,endIndex:u,groupItemCount:h,count:m},t,e)}const O0=(e=60)=>ct.exports.throttle((t,n,i)=>hp(t,n,i),e),gp=(e,t,n,i=60)=>{Reflect.apply(O0(i),globalThis,[e,t,n])};var mp={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",l=>{gp(l,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",O0)}}},pp=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:mp},props:dp,emits:["content-scroll"],setup(e,t){const{renderAs:n,contentAs:i}=e,l=A=>typeof A=="string"?[A]:typeof A=="object"&&!Array.isArray(A)?[A]:A;if(!e.enabled){const{rendAsTag:A}=fp(e,t);return A}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),f=(A,P,J,z,E,ne,_)=>{c.startIndex=P,c.endIndex=J,c.scrollTop=z,c.translateY=E,c.translateX=ne,c.pos=_,t.emit("content-scroll",[A,c])};a.onMounted(()=>{a.nextTick(()=>{p(e.list),w()})}),a.watch(()=>e.list,()=>{u(),w()},{deep:!0}),a.watch(()=>e.lineHeight,()=>{u(),w()});const u=()=>{p(e.list)},h=a.ref(0),m=a.ref(0),p=A=>{if(h.value=Math.ceil((A||[]).length/e.groupItemCount),c.count=h.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"){m.value=0;let J=0;for(let z=0;z<h.value;z++){const E=e.lineHeight.call(this,z,A.slice(z*e.groupItemCount,e.groupItemCount));J+=typeof E=="number"?E:0}m.value=J}else m.value=e.lineHeight*h.value;else m.value=e.abosuteHeight},w=(A=!0)=>{var J;const P=(J=o.value)==null?void 0:J.parentNode;P0(e.lineHeight,f,c,P,null),A&&o.value&&o.value.scrollTo(0,0)},y=a.computed(()=>(e.list||[]).map((A,P)=>Te(U({},A),{$index:P}))),v=a.computed(()=>y.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),L=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),x=a.computed(()=>U({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"?L.value:{})),k=a.computed(()=>{const A=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${m.value<e.minHeight?e.minHeight:m.value}px`,display:A?"none":"block"}}),C=a.computed(()=>[_e("virtual-render"),e.scrollXName,e.scrollYName,...l(e.className),e.scrollPosition==="container"?_e("virtual-content"):""]),b=a.computed(()=>[e.scrollPosition==="content"?_e("virtual-content"):"",...l(e.contentClassName)]),I=a.resolveDirective("bkVirtualRender"),N={lineHeight:e.lineHeight,handleScrollCallback:f,pagination:c,throttleDelay:e.throttleDelay},T=()=>{u(),w()};return t.expose({reset:T}),()=>{var A,P,J,z,E,ne,_,ce,re,ae,ue,ie;return a.h(n||"div",{ref:o,class:C.value,style:x.value},[(J=(P=(A=t.slots).beforeContent)==null?void 0:P.call(A))!=null?J:"",a.withDirectives(a.h(i||"div",{class:b.value,style:U(U({},L.value),e.contentStyle)},[(ne=(E=(z=t.slots).default)==null?void 0:E.call(z,{data:v.value}))!=null?ne:""]),[[I,N]]),(re=(ce=(_=t.slots).afterContent)==null?void 0:ce.call(_))!=null?re:"",a.h("div",{class:[_e("virtual-section")],style:k.value}),(ie=(ue=(ae=t.slots).afterSection)==null?void 0:ue.call(ae))!=null?ie:""])}}});const xr=He(pp);var bp=a.defineComponent({name:"Tag",props:{theme:g.theme(["success","info","warning","danger"]).def(""),closable:g.bool.def(!1),type:g.commonType(["","filled","stroke"]).def(""),checkable:g.bool.def(!1),checked:g.bool.def(!1),radius:g.string.def("2px"),extCls:g.string.def("")},emits:["change","close"],slots:["icon"],setup(e,{emit:t}){const n=a.computed(()=>Se({"bk-tag-closable":e.closable,"bk-tag-checkable":e.checkable,"bk-tag-check":e.checked,[`bk-tag-${e.type}`]:e.type,[`bk-tag-${e.theme}`]:e.theme,[e.extCls]:!!e.extCls},"bk-tag")),i=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:n,wrapperStyle:i,handleClose:c=>{c.preventDefault(),c.stopPropagation(),t("close",c)},handleClick:c=>{c.preventDefault(),c.stopPropagation(),e.checkable&&t("change",!e.checked)}}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:"bk-tag-icon"},[this.$slots.icon()]):"",a.createVNode("span",{class:"bk-tag-text"},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(An,{class:"bk-tag-close",onClick:this.handleClose},null):""])}});const Fs=He(bp);var yp=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:g.theme(["success","info","warning","danger"]).def(""),placeholder:g.string.def(""),filterable:g.bool.def(!1),allowCreate:g.bool.def(!1),disabled:g.bool.def(!1),modelValue:g.any,collapseTags:g.bool.def(!1)},emits:["update:modelValue","remove","enter"],setup(e,{emit:t}){const{proxy:n}=a.getCurrentInstance(),{modelValue:i,collapseTags:l,selected:o}=a.toRefs(e),c=a.ref(i.value),f=a.ref(),u=a.ref(null);a.watch(i,()=>{c.value=i.value}),a.watch([o,l],()=>{v()},{flush:"post"});const h=L=>{t("remove",L)},m=()=>{var L;(L=f.value)==null||L.focus()},p=L=>{t("update:modelValue",L.target.value)},w=L=>{switch(L.code){case"Enter":{t("enter",L.target.value,L);break}}},y=L=>{const x=[...n.$el.querySelectorAll(".bk-tag")];return typeof L=="number"?x[L]:x},v=()=>{!l.value||(u.value=null,setTimeout(()=>{const L=y(),x=L.findIndex((k,C)=>C?L[C-1].offsetTop!==k.offsetTop:!1);x-1>-1?u.value=x-1:u.value=null}))};return{overflowTagIndex:u,value:c,inputRef:f,handleRemoveTag:h,focus:m,handleInput:p,handleKeydown:w}},render(){var i,l,o,c,f,u,h;const e=Se({"bk-select-tag":!0,"bk-select-tag--default":!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags}),t=Se({"bk-select-tag-wrapper":!0}),n={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:e},[(l=(i=this.$slots)==null?void 0:i.prefix)==null?void 0:l.call(i),a.createVNode("span",{class:t},[(f=(c=(o=this.$slots).default)==null?void 0:c.call(o))!=null?f:this.selected.map((m,p)=>a.createVNode(Fs,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&p>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(m.value)},{default:()=>[m.label]})),this.overflowTagIndex&&this.collapseTags&&a.createVNode(Fs,{class:"bk-select-overflow-tag"},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]})]),a.createVNode("input",{class:"bk-select-tag-input",ref:"inputRef",type:"text",style:n,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null),(h=(u=this.$slots)==null?void 0:u.suffix)==null?void 0:h.call(u)])}}),Cp=a.defineComponent({name:"Select",directives:{clickoutside:Xn},props:{modelValue:g.any,multiple:g.bool.def(!1),disabled:g.bool.def(!1),size:g.size().def("default"),clearable:g.bool.def(!0),loading:g.bool.def(!1),filterable:g.bool.def(!1),remoteMethod:g.func,scrollHeight:g.number.def(200),showSelectAll:g.bool.def(!1),popoverMinWidth:g.number.def(0),showOnInit:g.bool.def(!1),multipleMode:g.oneOf(["default","tag"]).def("default"),tagTheme:g.theme(["success","info","warning","danger"]).def(""),behavior:g.oneOf(["normal","simplicity"]).def("normal"),collapseTags:g.bool.def(!1),autoHeight:g.bool.def(!0),noDataText:g.string.def("\u65E0\u6570\u636E"),noMatchText:g.string.def("\u65E0\u5339\u914D\u6570\u636E"),loadingText:g.string.def("\u52A0\u8F7D\u4E2D..."),placeholder:g.string.def("\u8BF7\u9009\u62E9"),searchPlaceholder:g.string.def("\u8BF7\u8F93\u5165\u5173\u952E\u5B57"),selectAllText:g.string.def("\u5168\u90E8"),scrollLoading:g.bool.def(!1),allowCreate:g.bool.def(!1),popoverOptions:g.object.def({}),customContent:g.bool.def(!1),list:g.array.def([]),idKey:g.string.def("value"),displayKey:g.string.def("label"),withValidate:g.bool.def(!0),showSelectedIcon:g.bool.def(!0),inputSearch:g.bool.def(!0),enableVirtualRender:g.bool.def(!1),allowEmptyValues:g.array.def([])},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const{modelValue:n,disabled:i,filterable:l,multiple:o,remoteMethod:c,loading:f,loadingText:u,noDataText:h,noMatchText:m,popoverMinWidth:p,showOnInit:w,multipleMode:y,allowCreate:v,customContent:L,showSelectedIcon:x,inputSearch:k,enableVirtualRender:C,showSelectAll:b,scrollHeight:I,list:N,displayKey:T,collapseTags:A,autoHeight:P,popoverOptions:J,allowEmptyValues:z}=a.toRefs(e),E=En(),ne=a.ref(),_=a.ref(),ce=a.ref(),re=a.ref(),ae=a.ref(),ue=a.ref(),ie=a.ref(),Y=a.ref(new Map),W=a.computed(()=>[...Y.value.values()]),Q=a.ref(new Map),F=a.ref([]),K=a.computed(()=>F.value.reduce((Ie,De)=>(Ie[De.value]=De.label,Ie),{})),fe=a.ref();a.watch(n,()=>{var Ie;bl(),e.withValidate&&((Ie=E==null?void 0:E.validate)==null||Ie.call(E,"change"))},{deep:!0}),a.watch(F,()=>{var Ie;(Ie=ie.value)==null||Ie.updatePopover(null,te.value)});const he=a.computed(()=>Me.value?N.value:N.value.filter(Ie=>{var De;return(De=Tr(String(Ie[T.value])))==null?void 0:De.includes(ci.value)})),Ce=a.computed(()=>i.value||f.value),Ae=a.computed(()=>F.value.map(Ie=>{var De,Oe;return((Oe=(De=Y.value)==null?void 0:De.get(Ie.value))==null?void 0:Oe.label)||Ie.label})),oe=a.computed(()=>{const Ie=W.value.reduce((De,Oe)=>(Oe.disabled||De.push(Oe.value),De),[]);return Ie.length<=F.value.length&&Ie.every(De=>F.value.some(Oe=>Oe.value===De))}),X=a.computed(()=>!!Q.value.size),Z=a.computed(()=>!W.value.length),se=a.computed(()=>W.value.length&&W.value.every(Ie=>!Ie.visible)),Me=a.computed(()=>l.value&&typeof c.value=="function"),j=a.computed(()=>!(Fr.value||Z.value||se.value)||L.value),B=a.computed(()=>o.value&&b.value&&(!ci.value||!l.value)),V=a.computed(()=>I.value-12-(B.value?32:0)),H=a.computed(()=>Fr.value?u.value:Z.value?h.value:se.value?m.value:""),$=a.computed(()=>P.value?A.value&&!Ue.value:A.value),te=a.computed(()=>ct.exports.merge({theme:"light bk-select-popover",trigger:"manual",width:Ke.value,arrow:!1,placement:"bottom-start",isShow:Ue.value,reference:ae.value,offset:6},J.value)),{register:ye,unregister:we}=Nc(Y),{register:Ne,unregister:Qe}=Nc(Q),{isHover:ut,setHover:Fe,cancelHover:at}=j0(),St=a.ref(!1),Dt=()=>{St.value||(St.value=!0,t("focus"))},qe=()=>{!St.value||(St.value=!1,t("blur"))},{popperWidth:Ke,isPopoverShow:Ue,hidePopover:kn,showPopover:Ja,togglePopover:Br}=lp({popoverMinWidth:p.value},_),_r=a.computed(()=>(l.value&&k.value||v.value)&&Ue.value);a.watch(Ue,Ie=>{Ie?(Ur(),Qa()):ci.value=""});const Zr=a.watch(Ue,()=>{setTimeout(()=>{var Ie,De;C.value&&((De=(Ie=ue.value)==null?void 0:Ie.reset)==null||De.call(Ie)),Zr()})}),Qa=()=>{var Oe;const Ie=F.value[0],De=Y.value.get(Ie==null?void 0:Ie.value);De&&!De.disabled&&De.visible?fe.value=Ie==null?void 0:Ie.value:fe.value=(Oe=W.value.find(Gn=>!Gn.disabled&&Gn.visible))==null?void 0:Oe.value},Gr=Ie=>{!l.value||W.value.forEach(De=>{var Oe;De.visible=(Oe=Tr(String(De.label)))==null?void 0:Oe.includes(Tr(Ie))})},{searchKey:ci,searchLoading:Fr}=op(Me.value?c.value:Gr,Qa),Zn=Ie=>{Ie!==n.value&&(t("change",Ie,n.value),t("update:modelValue",Ie,n.value))},gl=()=>{Ce.value||(Dt(),Br(),t("toggle",Ue.value))},ml=Ie=>{!l.value||(ci.value=Ie)},fu=(Ie,De)=>{const Oe=String(Ie);!v.value||!Oe||l.value&&W.value.find(Pi=>Tr(String(Pi.label))===Tr(Oe))||Y.value.get(Oe)||(De.stopPropagation(),o.value?(F.value.push({value:Oe,label:Oe}),Zn(F.value.map(Pi=>Pi.value))):(F.value=[{value:Oe,label:Oe}],Zn(Oe),kn()),ci.value="")},Yr=Ie=>{if(!(Ce.value||!Ie)){if(o.value){const De=F.value.findIndex(Oe=>Oe.value===Ie.value);De>-1?F.value.splice(De,1):F.value.push({value:Ie.value,label:Ie.label||Ie.value}),Zn(F.value.map(Oe=>Oe.value))}else F.value=[{label:Ie.label||Ie.value,value:Ie.value}],Zn(Ie.value),kn();Ur()}},Ur=()=>{setTimeout(()=>{var Ie,De,Oe;!k.value&&!v.value?(Ie=re.value)==null||Ie.focus():y.value==="tag"?(De=ae.value)==null||De.focus():(Oe=ne.value)==null||Oe.focus()},0)},hu=Ie=>{Ie.stopPropagation(),F.value=[],Zn(o.value?[]:""),t("clear",o.value?[]:""),kn()},pl=()=>{fe.value=""},gu=()=>{oe.value?F.value=[]:W.value.forEach(Ie=>{Ie.disabled||F.value.find(De=>De.value===Ie.value)||F.value.push({value:Ie.value,label:Ie.label||Ie.value})}),Zn(F.value.map(Ie=>Ie.value)),Ur()},mu=Ie=>{const{scrollTop:De,clientHeight:Oe,scrollHeight:Gn}=Ie.target;De+Oe===Gn&&t("scroll-end")},pu=Ie=>{if(Ce.value)return;const De=F.value.findIndex(Oe=>Oe.value===Ie);De>-1&&(F.value.splice(De,1),Zn(F.value.map(Oe=>Oe.value)))},Ra=Ie=>{var De,Oe;return((Oe=(De=Y.value)==null?void 0:De.get(Ie))==null?void 0:Oe.label)||K.value[Ie]||Ie},bl=()=>{Array.isArray(n.value)?F.value=[...n.value.map(Ie=>({value:Ie,label:Ra(Ie)}))]:!!n.value||z.value.includes(n.value)?F.value=[{value:n.value,label:Ra(n.value)}]:F.value=[]},sa=Ie=>{var Gn,Pi,yl,Cl;if(!((Gn=_.value)!=null&&Gn.contains(Ie.target))&&!((Pi=ce.value)!=null&&Pi.contains(Ie.target))&&!L.value)return;const De=W.value.filter(Vt=>!Vt.disabled&&Vt.visible),Oe=De.findIndex(Vt=>Vt.value===fe.value);if(!(!De.length||Oe===-1))switch(Ie.code){case"ArrowDown":{Ie.preventDefault();const Vt=Oe>=De.length-1?0:Oe+1;fe.value=(yl=De[Vt])==null?void 0:yl.value;break}case"ArrowUp":{Ie.preventDefault();const Vt=Oe===0?De.length-1:Oe-1;fe.value=(Cl=De[Vt])==null?void 0:Cl.value;break}case"Backspace":{if(!o.value||!F.value.length||ci.value.length||Ie.target===re.value)return;F.value.pop(),Zn(F.value.map(Vt=>Vt.value));break}case"Enter":{if(!Ue.value)Ue.value=!0;else{const Vt=Y.value.get(fe.value);Yr(Vt)}break}}},bu=({event:Ie})=>{var Oe;const{target:De}=Ie;((Oe=_.value)==null?void 0:Oe.contains(De))||_.value===De||(kn(),qe())};return a.provide(Ic,a.reactive({multiple:o,selected:F,activeOptionValue:fe,showSelectedIcon:x,register:ye,unregister:we,registerGroup:Ne,unregisterGroup:Qe,handleOptionSelected:Yr})),a.onMounted(()=>{bl(),setTimeout(()=>{w.value&&Ja()}),l4(document,"keydown",sa)}),a.onBeforeMount(()=>{o4(document,"keydown",sa)}),{selected:F,isInput:_r,options:W,isDisabled:Ce,selectedLabel:Ae,isPopoverShow:Ue,isHover:ut,popperWidth:Ke,inputRef:ne,triggerRef:_,contentRef:ce,searchRef:re,selectTagInputRef:ae,virtualRenderRef:ue,popoverRef:ie,searchLoading:Fr,isOptionsEmpty:Z,isSearchEmpty:se,isFocus:St,isShowSelectContent:j,curContentText:H,isGroup:X,searchKey:ci,isShowSelectAll:B,virtualHeight:V,filterList:he,isCollapseTags:$,popoverConfig:te,setHover:Fe,cancelHover:at,handleFocus:Dt,handleBlur:qe,handleTogglePopover:gl,handleClear:hu,hidePopover:kn,showPopover:Ja,handleToggleAll:gu,handleOptionSelected:Yr,handleClickOutside:bu,handleScroll:mu,handleDeleteTag:pu,handleInputChange:ml,handleInputEnter:fu,handleKeydown:sa,handleSelectedAllOptionMouseEnter:pl}},render(){const e=Se({"bk-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(wi,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(cn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ta,{class:"angle-up"},null),n=()=>this.multipleMode==="tag"?a.createVNode(yp,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":o=>this.searchKey=o,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.placeholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter},{prefix:()=>{var o,c;return(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(Ui,{ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.placeholder:this.placeholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,onInput:this.handleInputChange,onEnter:this.handleInputEnter},{prefix:()=>{var o,c;return(c=(o=this.$slots).prefix)==null?void 0:c.call(o)},suffix:()=>t()}),i=()=>a.createVNode("div",{class:"bk-select-trigger",style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[n()]),l=()=>{var o,c;return a.createVNode("div",{class:"bk-select-content-wrapper",ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:"bk-select-search-wrapper"},[a.createVNode(Ds,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:"bk-select-search-input",placeholder:this.searchPlaceholder,"onUpdate:modelValue":f=>this.searchKey=f},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:"bk-select-empty"},[this.searchLoading&&a.createVNode(wi,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:"bk-select-content"},[a.createVNode("div",{class:"bk-select-dropdown",style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:"bk-select-options"},[this.isShowSelectAll&&a.createVNode("li",{class:"bk-select-option",onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.selectAllText]),this.enableVirtualRender?a.createVNode(xr,{list:this.filterList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:f})=>f.map(u=>a.createVNode(Gs,{key:u[this.idKey],value:u[this.idKey],label:u[this.displayKey]},null))}):this.list.map(f=>a.createVNode(Gs,{value:f[this.idKey],label:f[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:"bk-select-options-loading"},[a.createVNode(wi,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.loadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:"bk-select-extension"},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(ni,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,ref:"popoverRef"}),{default:()=>i(),content:()=>l()})])}});const Lc=Bt(Cp,{Option:Gs,Group:cp});function Mp(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:wp}=$i,kc=Object.assign({},wp);kc.width.default="400",kc.height.default="100%";var vp=a.defineComponent({name:"Sideslider",components:{BkModal:$i,BkButton:_t},props:Te(U({},kc),{direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',\u3010${t.join(" | ")}\u3011`),!1):!0}}}),emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{let c=!0;typeof e.beforeClose=="function"&&(c=await e.beforeClose()),c&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},l=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)};return()=>{const c={header:()=>{var h,m;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"bk-sideslider-header"},[a.createVNode("div",{class:`bk-sideslider-close ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`bk-sideslider-title ${e.direction}`},[(m=(h=t.header)==null?void 0:h.call(t))!=null?m:e.title])])])},default:()=>{var h,m;return(m=(h=t.default)==null?void 0:h.call(t))!=null?m:"Content"},footer:()=>t.footer?a.createVNode("div",{class:"bk-sideslider-footer"},[t.footer()]):null},f=`bk-sideslider-wrapper ${e.scrollable?"scroll-able":""} ${e.extCls}`,u=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode($i,a.mergeProps(e,{maxHeight:u,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:l,onClose:i}),Mp(c)?c:{default:()=>[c]})}}});const E0=He(vp),A0={theme:g.theme().def("primary"),size:g.size(),curStep:g.number.def(1),controllable:g.bool.def(!1),direction:g.commonType(["horizontal","vertical"],"direction").def("horizontal"),status:g.commonType(["","error","loading"],"status").def(""),lineType:g.commonType(["dashed","solid"],"lineType").def("dashed"),text:g.bool,extCls:g.string,steps:g.array.def([]),beforeChange:g.func};var Ip=a.defineComponent({name:"Steps",props:A0,emits:["update:curStep","click"],setup(e,{emit:t}){const n=a.ref([]),i=f=>{const u=[];f.forEach(h=>{var m;typeof h=="string"?u.push(h):u.push({title:h.title,icon:h.icon,description:h.description,status:h.status,border:(m=h.border)!=null?m:!0})}),n.value.splice(0,n.value.length,...u)},l=f=>{A0.curStep=f},o=()=>{var f;n.value.splice(0,n.value.length,{title:"\u6B65\u9AA41",icon:1},{title:"\u6B65\u9AA42",icon:2},{title:"\u6B65\u9AA43",icon:3}),(f=e.steps)!=null&&f.length&&i(e.steps)},c=async f=>{try{e.controllable&&f!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(u,h)=>{const m=await e.beforeChange(f);m?u(m):h(m)}),t("update:curStep",f),t("click",f))}catch(u){console.warn(u)}};return a.onMounted(o),a.watch(()=>e.steps,()=>{i(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{l(e.curStep)},{deep:!0}),{defaultSteps:n,jumpTo:c}},render(){const e="bk-steps",t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Se({[`${this.extCls}`]:!!this.extCls,[`bk-steps-${this.direction}`]:this.direction,[`bk-steps-${this.lineType}`]:this.lineType},`${t} ${e} ${n}`),l=p=>this.curStep>p+1||this.defaultSteps[p].status==="done",o=p=>this.curStep===p+1,c=p=>{const{icon:w}=p;return w?Object.prototype.toString.call(w)==="[object Object]":typeof p=="string"},f=(p,w)=>(w.icon||(w.icon=p),!isNaN(w.icon)),u=p=>p.status==="loading",h=p=>p.status==="error",m=(p,w)=>o(p)&&this.status==="loading"||u(w)?a.createVNode(vs,{class:"bk-icon bk-steps-icon icon-loading"},null):o(p)&&this.status==="error"||h(w)?a.createVNode(An,{class:"bk-steps-icon"},null):l(p)?a.createVNode(xa,{class:"bk-steps-icon"},null):a.createVNode("span",null,[f(p,w)?p+1:a.createVNode(w.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((p,w)=>{var y,v,L;return a.createVNode("div",{class:["bk-step",p.title?"":"bk-step-no-content",l(w)?"done":"",o(w)?"current":"",o(w)&&this.status==="error"?"isError":"",p.status&&o(w)?[`bk-step-${p.status}`]:""]},[a.createVNode("span",{class:["bk-step-indicator",`bk-step-${c(p)?"icon":"number"}`,`bk-step-icon${p.status}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(w+1)}},[(L=(v=(y=this.$slots)[w+1])==null?void 0:v.call(y))!=null?L:m(w,p)]),p.title?a.createVNode("div",{class:"bk-step-content"},[a.createVNode("div",{class:"bk-step-title",style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(w+1)}},[p.title]),p.description&&a.createVNode("div",{class:"bk-step-description",title:p.description},[p.description])]):""])})])}});const V0=He(Ip);var Np=a.defineComponent({name:"Switcher",props:{theme:g.theme().def(""),size:g.size(),disabled:g.bool,showText:g.bool,isOutline:g.bool,onText:g.string.def("ON"),offText:g.string.def("OFF"),isSquare:g.bool,extCls:g.string,beforeChange:g.func.def(void 0),trueValue:g.oneOfType([g.string,g.number,g.bool]).def(!0),falseValue:g.oneOfType([g.string,g.number,g.bool]).def(!1),value:g.oneOfType([g.string,g.number,g.bool]).def(!1),modelValue:g.oneOfType([g.string,g.number,g.bool]).def(!1),withValidate:g.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=En(),i=a.ref(!1),l=a.computed(()=>e.trueValue===c.value),o=a.ref(e.modelValue!==!1),c=a.computed(()=>o.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,"bk-switcher":!0,"bk-switcher-outline":e.isOutline,"bk-switcher-square":e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":l.value,"is-unchecked":!l.value,"is-loading":i.value,"bk-primary":e.theme==="primary"};if(e.size&&!e.showText){const p=`bk-switcher-${e.size}`;m[p]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;o.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{o.value=!1});const u=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||i.value)return;const p=l.value?e.falseValue:e.trueValue,w=!l.value,y=()=>{t("update:modelValue",p),t("change",w)};let v=!0;if(typeof e.beforeChange=="function"&&(v=e.beforeChange(p),typeof v.then=="function"))return i.value=!0,v.then(()=>{y()}).finally(()=>{i.value=!1});v&&y()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&u(m)};return()=>a.createVNode("div",{class:f.value,onClick:u,tabindex:"0",onKeydown:h},[i.value?a.createVNode(Go,{class:"bk-switcher-loading"},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[l.value?e.onText:e.offText]):""])}});const J0=He(Np);var Ys=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e))(Ys||{});const Q0=["none","row","col","outer"];var In=(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))(In||{}),Pt=(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.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))(Pt||{});const Gt=(...e)=>!0,Lp={columnPick:Gt,columnFilter:Gt,columnSort:Gt,colFilterSave:Gt,rowClick:Gt,rowDblclick:Gt,rowExpand:Gt,select:Gt,selectAll:Gt,selectionChange:Gt,pageLimitChange:Gt,pageValueChange:Gt,settingChange:Gt,scrollBottom:Gt},Xe={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"},Tc=4,ii=42,Us={large:78,medium:60,small:42},kp=[{value:"small",label:"\u5C0F",height:Us.small},{value:"medium",label:"\u4E2D",height:Us.medium},{value:"large",label:"\u5927",height:Us.large}],R0="InitColumns";var $s=(e=>(e.CURRENT="current",e.ALL="all",e))($s||{});const W0={label:g.oneOfType([g.func.def(()=>""),g.string.def("")]),field:g.oneOfType([g.func.def(()=>""),g.string.def("")]),render:g.oneOfType([g.func.def(()=>""),g.string.def("")]),width:g.oneOfType([g.number.def(void 0),g.string.def("auto")]),minWidth:g.oneOfType([g.number.def(void 0),g.string.def("auto")]).def(),columnKey:g.string.def(""),showOverflowTooltip:g.oneOfType([g.bool,g.shape({content:g.string.def(""),disabled:g.bool.def(!1),watchCellResize:g.bool.def(!0)})]).def(void 0),type:g.commonType(["selection","index","expand","none"],"columnType").def("none"),resizable:g.bool.def(!0),fixed:g.oneOfType([g.bool,g.commonType(["left","right"],"fixed")]).def(!1),sort:g.oneOfType([g.shape({sortFn:g.func.def(void 0),sortScope:g.commonType(Object.values($s)).def("current"),value:g.string.def(null)}),g.bool,g.string]).def(!1),filter:g.oneOfType([g.shape({list:g.arrayOf(g.any).def([]),filterFn:g.func.def(void 0),match:g.commonType(["full","fuzzy"],"full"),filterScope:g.commonType(Object.values($s)).def("current"),btnSave:g.oneOfType([g.bool,g.string]).def("\u786E\u5B9A"),btnReset:g.oneOfType([g.bool,g.string]).def("\u91CD\u7F6E")}),g.bool,g.string]).def(!1)},Tp={data:g.arrayOf(g.any).def([]),columns:g.arrayOf(g.shape(W0)).def([]),activeColumn:g.oneOfType([g.number.def(-1),g.arrayOf(g.number.def(-1))]),columnPick:g.commonType(["multi","single","disabled"],"columnPick").def("disabled"),height:g.oneOfType([g.number,g.string]).def("auto"),minHeight:g.oneOfType([g.number,g.string]).def(ii*2),maxHeight:g.oneOfType([g.number,g.string]).def("auto"),rowHeight:g.oneOfType([g.number,g.func]).def(ii),headHeight:g.number.def(ii),showHead:g.bool.def(!0),thead:g.shape({height:g.number.def(ii),isShow:g.bool.def(!0),cellFn:g.func.def(void 0)}),virtualEnabled:g.bool.def(!1),border:g.arrayOf(g.commonType(Q0,"border")).def([Ys.ROW]),pagination:g.oneOfType([g.bool.def(!1),g.object.def({})]).def(!1),remotePagination:g.bool.def(!1),emptyText:g.string.def("\u6682\u65E0\u6570\u636E"),settings:g.oneOfType([g.shape({fields:g.arrayOf(g.shape({label:g.string,field:g.string,disabled:g.bool})),checked:g.arrayOf(g.string),limit:g.number.def(0),size:g.size(["small","medium","large"]).def("small"),sizeList:g.shape([])}),g.bool]).def(!1),rowClass:g.oneOfType([g.string,g.object,g.func]).def({}),rowStyle:g.oneOfType([g.string,g.object,g.func]).def({}),cellStyle:g.oneOfType([g.string,g.object,g.func]).def({}),cellClass:g.oneOfType([g.string,g.object,g.func]).def({}),scrollLoading:g.oneOfType([g.object,g.bool]).def(void 0),reserveExpand:g.bool.def(!1),selectionKey:g.string.def(""),isSelectedFn:g.func.def(void 0),rowKey:g.oneOfType([g.string,g.func]).def(Xe.ROW_INDEX),showOverflowTooltip:g.oneOfType([g.bool,g.shape({content:g.string.def(""),disabled:g.bool.def(!1),watchCellResize:g.bool.def(!0)})]).def(!1),asyncData:g.bool.def(!1)};var H0=a.defineComponent({name:"TableColumn",props:Te(U({},W0),{prop:g.oneOfType([g.func.def(()=>""),g.string.def("")])}),setup(e,{slots:t}){const n=a.inject(R0,i=>{},!1);return a.onMounted(()=>{const i=a.reactive(Te(U({},e),{field:e.prop||e.field}));n(i),i.render=t.default?l=>{var o;return(o=t.default)==null?void 0:o.call(t,l)}:void 0}),()=>{var i;return a.createVNode(a.Fragment,null,[(i=t.default)==null?void 0:i.call(t,{data:""})])}}});const B0=(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),Te(U(U({},t),e),{current:n})}return t}return{}};var xp=(e,t)=>{const n=a.ref(0),i=a.ref(0);let l=a.reactive({count:0,limit:10,current:1});l=B0(e.pagination,l);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=e.data.length;return}n.value=(l.current-1)*l.limit,i.value=l.current*l.limit},f=a.reactive([]),u=(y,v)=>{typeof v=="function"&&y.sort(v)},h=(y,v)=>{if(typeof v=="function"){const L=y.filter((x,k)=>v(x,k,e.data));y.splice(0,y.length,...L)}},m=(y,v,L)=>{var C;const x=t.slice(),{sortScope:k}=(C=L==null?void 0:L.sort)!=null?C:{};k===$s.ALL&&u(x,v),f.splice(0,f.length,...x.slice(n.value,i.value)),h(f,y),u(f,v)},p=(y,v,L)=>{l=B0(e.pagination,l),w(),c(),m(y,v,L)},w=()=>{!e.pagination||(o.value=e.remotePagination?l:Te(U({},l),{count:e.data.length}))};return{pageData:f,localPagination:o,resolvePageData:m,watchEffectFn:p}},Sp=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:Vn.Normal,mode:Yi.Default,indicator:null}:n.value,l=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,f,u;if(l.value){const{loading:h,size:m,mode:p,title:w,inline:y,indicator:v}=i();return(u=(f=(c=t.slots).fixedBottom)==null?void 0:f.call(c))!=null?u:a.createVNode(wi,{loading:h,size:m,mode:p,title:w,inline:y,indicator:v},null)}}}};function Dp(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var jp=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(e.limit);a.watch(()=>e.limit,l=>{t.value=l}),a.watch(()=>e.limitList,l=>{a.nextTick(()=>{l.includes(t.value)||([t.value]=l)})},{immediate:!0});const n=l=>{t.value=l};return{limit:t,render:({isFirst:l,isLast:o})=>{let c;return e.showLimit?a.createVNode("div",a.mergeProps({class:{"bk-pagination-limit":!0,"is-first":l,"is-last":o}},{disabled:e.disabled}),[a.createVNode("div",null,[a.createTextVNode("\u6BCF\u9875")]),a.createVNode(Lc,{class:"bk-pagination-limit-select",clearable:!1,size:"small",modelValue:t.value,onChange:n,disabled:e.disabled},Dp(c=e.limitList.map((f,u)=>a.createVNode(Gs,{value:f,label:`${f}`,key:`${u}_${f}`},null)))?c:{default:()=>[c]}),a.createVNode("div",null,[a.createTextVNode("\u6761")])]):null}}};const qi=5;var zp=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),l=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{l.value=!1,o.value=!1;const y=[];if(e.totalPageNum<=qi+2){for(let x=2;x<=e.totalPageNum-1;x++)y.push(x);return y}const v=Math.floor(qi/2);e.totalPageNum>qi&&(l.value=t.value-v>2,o.value=t.value+v<e.totalPageNum-1);const L=Math.min(e.totalPageNum-qi,Math.max(2,t.value-v));for(let x=L;x<L+qi;x++)y.push(x);return y});a.watch(()=>e.modelValue,y=>{a.nextTick(()=>{y>=1&&y<=e.totalPageNum?t.value=y:y<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,y=>{t.value>y&&(t.value=y)})});const f=()=>{n.value||(t.value=t.value-1)},u=()=>{i.value||(t.value=t.value+1)},h=y=>{y!==t.value&&(t.value=y)},m=()=>{t.value=Math.max(1,t.value-qi)},p=()=>{t.value=Math.min(e.totalPageNum,t.value+qi)};return{current:t,render:({isFirst:y,isLast:v})=>a.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":y,"is-last":v}},[a.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":n.value},onClick:f},[e.prevText||a.createVNode(Mi,null,null)]),a.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===1},key:"1",onClick:()=>h(1)},[a.createTextVNode("1")]),l.value&&a.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:m},[a.createVNode(ks,null,null)]),c.value.map(L=>a.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===L},key:L,onClick:()=>h(L)},[L])),o.value&&a.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:p},[a.createVNode(ks,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>h(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":i.value},onClick:u},[e.nextText||a.createVNode(vn,null,null)])])}},Pp=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),l=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const f=a.computed(()=>{const x=[];for(let k=1;k<=e.totalPageNum;k++)x.push(k);return x});a.watch(()=>e.modelValue,x=>{a.nextTick(()=>{x>=1&&x<=e.totalPageNum?i.value=x:x<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,x=>{i.value>x&&(i.value=x)})});const u=()=>{l.value||(i.value=i.value-1)},h=()=>{o.value||(i.value=i.value+1)},m=()=>{n.value=!0},p=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},w=x=>{const k=x.target,C=Number(k.textContent);!C||C<1||C>e.totalPageNum||C===i.value||(c=C)},y=x=>{["Enter","NumpadEnter"].includes(x.code)&&(x.preventDefault(),p())},v=x=>{c=x,p()};return{current:i,render:()=>a.createVNode("div",{class:"bk-pagination-small-list"},[a.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":l.value},onClick:u},[a.createVNode(Mi,null,null)]),a.createVNode(ni,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:m,onBlur:p,onInput:w,onKeydown:y},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:"bk-pagination-picker-list"},[f.value.map(x=>a.createVNode("div",{class:{item:!0,"is-actived":x===i.value},key:x,onClick:()=>v(x)},[x]))])}),a.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":o.value},onClick:h},[a.createVNode(vn,null,null)])])}},Op=()=>({isFirst:e,isLast:t})=>{const{props:n}=a.getCurrentInstance();return n.showTotalCount?a.createVNode("div",a.mergeProps({class:{"bk-pagination-total":!0,"is-first":e,"is-last":t}},{disabled:n.disabled}),[a.createTextVNode("\u5171\u8BA1"),a.createVNode("div",{class:"bk-pagination-total-num"},[n.count]),a.createTextVNode("\u6761")]):null};const Ep={modelValue:g.number.def(1),count:g.number.def(0).isRequired,limit:g.number.def(10),limitList:g.arrayOf(Number).def([10,20,50,100]),showLimit:g.bool.def(!0),type:g.oneOf(["default","compact"]).def("default"),location:g.oneOf(["left","right"]).def("right"),align:g.oneOf(["left","center","right"]).def("left"),size:g.size(),small:g.bool.def(!1),showTotalCount:g.bool.def(!0),prevText:g.string,nextText:g.string,disabled:g.bool.def(!1),beforeChange:g.func,layout:g.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout \u7684\u503C\u53EA\u652F\u6301 * total\u3001list\u3001limit *").def(["total","list","limit"])};var Ap=a.defineComponent({name:"Pagination",props:Ep,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=a.ref(0),{count:i,limit:l}=a.toRefs(e),o=Op(),{current:c,render:f}=zp(),{current:u,render:h}=Pp(),{limit:m,render:p}=jp();return a.watch([i,m,l],([w,y])=>{const v=Math.ceil(w/y);n.value=v<1?1:v},{immediate:!0}),a.watch(c,w=>{t.emit("update:modelValue",w),t.emit("change",w)}),a.watch(u,w=>{!e.small||(t.emit("update:modelValue",w),t.emit("change",w))}),a.watch(m,w=>{t.emit("limitChange",w)}),{totalPageNum:n,renderTotal:o,renderList:f,renderLimit:p,renderSmallList:h}},render(){const e=Se({"bk-pagination":!0,[`bk-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}))])}});const xc=He(Ap),It=(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=>It(e,i,n)).filter(i=>i!==void 0).at(0)},Sc=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],Vp=e=>_0(e,"auto"),_0=(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},Jp=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>Q0.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Sr=(e,t=["resizeWidth","calcWidth","width"])=>{var n,i;return(i=(n=e[t[0]])!=null?n:e[t[1]])!=null?i:e[t[2]]},Dc=(e,t,n=20,i=0)=>{const{width:l}=e.getBoundingClientRect()||{},o=l-i;let c=o;const f=[],u=(m,p)=>{const{minWidth:w=void 0}=m;if(w===void 0)return p;let y=p;return/^\d+\.?\d*$/.test(`${w}`)&&(y=Number(w)),/^\d+\.?\d*%$/.test(`${w}`)&&(y=Number(w)*o/100),/^\d+\.?\d*px$/i.test(`${w}`)&&(y=Number(`${w}`.replace(/px/i,""))),y},h=(m,p,w=!0)=>{const y=u(m,p),v=p<y?y:p;Object.assign(m,{calcWidth:v}),w&&(c=c-v,c<0&&(c=0))};if(t.forEach((m,p)=>{if(!m.isHidden){const y=String(Sr(m,["resizeWidth","width"]));let v=!0;if(/^\d+\.?\d*(px)?$/.test(y)){const L=Number(y.replace("px",""));h(m,L),v=!1}if(/^\d+\.?\d*%$/.test(y)){let L=n;if(c>0){const x=Number(y.replace("%",""));L=c*x/100}h(m,L),v=!1}v&&f.push(p)}}),f.length>0){let m=n;c>0&&(m=c/f.length,f.forEach(p=>h(t[p],m,!1)))}},Z0=(e,t,n=60,i=!1)=>{const l=ct.exports.throttle(()=>{typeof t=="function"&&t()},n),o=new ResizeObserver(()=>{l()});return i&&typeof t=="function"&&t(),{start:()=>{o.observe(e)},stop:()=>{o.disconnect(),o.unobserve(e)}}},jc=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},U({},i))},Xs=(e,t,n)=>n.type==="index"?e[Xe.ROW_INDEX]+1:ct.exports.get(e,t),Dr=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Dr(Reflect.apply(e,globalThis,t),t):[],Qp=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Xe.ROW_INDEX?`__ROW_INDEX_${n}`:ct.exports.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):Bi.v4(),Rp=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},Wp=(e,t)=>{function n(o,c){const u=(n.canvas||(n.canvas=document.createElement("canvas"))).getContext("2d");return u.font=c,u.measureText(o).width}function i(o,c){return window.getComputedStyle(o,null).getPropertyValue(c)}function l(o=document.body){const c=i(o,"font-weight")||"normal",f=i(o,"font-size")||"16px",u=i(o,"font-family")||"Times New Roman";return`${c} ${f} ${u}`}return n(t||(e==null?void 0:e.innerHTML),l(e))};var G0=a.defineComponent({name:"TableCell",props:{column:g.any.def({}),row:g.any.def({}),parentSetting:g.oneOfType([g.bool,g.shape({content:g.string.def(""),disabled:g.bool.def(!1),watchCellResize:g.bool.def(!0)})]).def(void 0)},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),l=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:o=!1}=l();let c=null,f=null;const u=()=>{let m=!0,p=n.value.innerText;return typeof o=="boolean"&&(m=!o),typeof o=="object"&&(m=o.disabled,typeof o.content=="function"&&(p=o.content(e.column,e.row)),p=o.content||n.value.innerText),{disabled:m,content:p}},h=()=>{if(!n.value||/selection|index|expand/.test(e.column.type)||!va(n.value))return;const{content:m}=u(),p=Wp(n.value,m),w=n.value.clientWidth,y=window.getComputedStyle(n.value),v=["padding-left","padding-right"].reduce((x,k)=>x+Number(y.getPropertyValue(k).replace("px","")),0),L=w-v;if(i.value=p>L,i.value){const x=a.ref(u());f===null&&(f=mc(n.value,x))}else f==null||f.destroyInstance(n.value),f=null};return a.onMounted(()=>{var p;const{disabled:m}=u();m||(h(),((p=e.column.showOverflowTooltip)==null?void 0:p.watchCellResize)!==!1&&(c=Z0(n.value,()=>{h()},60,!0),c.start()))}),a.onBeforeUnmount(()=>{c==null||c.stop(),f==null||f.destroyInstance(n.value)}),()=>{var m;return a.createVNode("div",{class:"cell",ref:n},[(m=t.default)==null?void 0:m.call(t)])}}}),zc=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)])}}),Hp=a.defineComponent({name:"BodyEmpty",props:{list:g.array.def([]),filterList:g.array.def([]),emptyText:g.string.def("\u6682\u65E0\u6570\u636E")},emits:["change"],setup(e){const t=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(Ps,{scene:"part",type:t.value,description:e.emptyText},null)}});function Bp(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var _p=a.defineComponent({name:"HeadFilter",props:{column:g.any.def({}),height:g.number.def(ii)},emits:["change","filterSave"],setup(e,{emit:t}){const{column:n}=e,i=a.reactive({isOpen:!1,checked:[]}),l=a.computed(()=>Se({[_e("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:i.checked.length,opened:i.isOpen})),o=Se({[_e("table-head-filter")]:!0}),c=I=>{i.isOpen=I},f=`light ${_e("table-head-filter")}`,u=a.computed(()=>{const{list:I=[]}=n.filter;return I.map(N=>Te(U({},N),{checked:i.checked.includes(N.value)}))}),h=(I,N="ig")=>new RegExp(`${I}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),N),m=(I,N)=>{const{match:T}=n.filter,A=Xs(N,It(n,"field",[n,N]),n);return T==="full"&&I.includes(A),I.some(P=>h(P,"img").test(A))},p=typeof n.filter.filterFn=="function"?(I,N,T,A)=>n.filter.filterFn(I,N,e.column,T,A):(I,N)=>I.length?m(I,N):!0,w=()=>{y(!0),t("filterSave",[...i.checked]),i.isOpen=!1},y=(I=!1)=>{const{disabled:N}=L(x,"\u786E\u5B9A");if(N||I){if(e.column.filter==="custom"){t("change",[...i.checked],null),i.isOpen=!1;return}t("change",[...i.checked],p)}},v=()=>{i.checked.length&&(i.checked.splice(0,i.checked.length),i.isOpen=!1,a.nextTick(()=>t("change",i.checked,p)))},L=(I,N)=>({disabled:I==="disabled"||I===!1,text:typeof I=="string"?I:N}),{btnSave:x,btnReset:k}=n.filter,C=()=>{const{disabled:I,text:N}=L(x,"\u786E\u5B9A");return I?a.createVNode("span",{class:"btn-filter-save disabled"},[N]):a.createVNode("span",{class:"btn-filter-save",onClick:w},[N])},b=()=>{const{disabled:I,text:N}=L(k,"\u91CD\u7F6E");return I?"":a.createVNode("span",{class:["btn-filter-reset",i.checked.length?"":"disable"],onClick:v},[N])};return()=>a.createVNode(ni,a.mergeProps({trigger:"click",isShow:i.isOpen,placement:"bottom-end",arrow:!1,offset:0},{theme:f},{onAfterShow:()=>c(!0),onAfterHidden:()=>c(!1)}),{default:()=>a.createVNode(Ho,{class:l.value},null),content:()=>{let I;return a.createVNode("div",{class:o},[a.createVNode(ec,{class:"content-list",modelValue:i.checked,"onUpdate:modelValue":N=>i.checked=N,onChange:()=>y(!1)},Bp(I=u.value.map(N=>a.createVNode("div",{class:"list-item"},[a.createVNode(Ii,{label:N.value},{default:()=>[N.text]})])))?I:{default:()=>[I]}),a.createVNode("div",{class:"content-footer"},[C(),a.createVNode("span",{class:"btn-filter-split"},null),b()])])}})}}),ai=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e))(ai||{}),Zp=a.defineComponent({name:"HeadSort",props:{column:g.any.def({})},emits:["change"],setup(e,{emit:t}){var o,c;const{value:n=ai.NULL}=(c=(o=e.column)==null?void 0:o.sort)!=null?c:{},i=a.ref(n),l=(f,u)=>{var v,L;if(f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault(),i.value===u?i.value=ai.NULL:i.value=u,e.column.sort==="custom"){t("change",null,u);return}const h=e.column.field,m=x=>Xs(x,h,e.column),p=(x,k)=>{const C=m(x),b=m(k);return typeof C=="number"&&typeof b=="number"?C-b:String.prototype.localeCompare.call(C,b)},w=typeof((v=e.column.sort)==null?void 0:v.sortFn)=="function"?(L=e.column.sort)==null?void 0:L.sortFn:p,y=i.value===ai.NULL?()=>!0:(x,k)=>w(x,k)*(u===ai.DESC?-1:1);t("change",y,u)};return()=>a.createVNode("span",{class:_e("head-cell-sort")},[a.createVNode(Do,{class:["sort-action","sort-asc",i.value===ai.ASC?"active":""],onClick:f=>l(f,ai.ASC)},null),a.createVNode(ws,{class:["sort-action","sort-desc",i.value===ai.DESC?"active":""],onClick:f=>l(f,ai.DESC)},null)])}});class Gp{constructor(t,n){tr(this,"props",null);tr(this,"ctx",null);this.props=t,this.ctx=n}}function F0(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var Fp=a.defineComponent({name:"Settings",props:{settings:g.oneOfType([g.shape({fields:g.arrayOf(g.shape({label:g.string,field:g.string,disabled:g.bool})),checked:g.arrayOf(g.string),limit:g.number.def(0),size:g.size(["small","medium","large"]).def("small"),sizeList:g.shape([])}),g.bool]).def(!1),columns:g.array.def([]),rowHeight:g.number.def(ii)},emits:["change"],setup(e,{emit:t}){const n=kp,i=a.ref(!1),l=a.ref(!1),o=typeof e.settings=="boolean"?a.ref({fields:e.columns.map(z=>Te(U({},z),{field:z.field||z.type})),checked:[],limit:0,size:"small",sizeList:n}):a.ref(e.settings),c=a.ref(o.value.size||"small"),f=a.ref(e.rowHeight),u=a.ref(o.value.checked),m=`light ${_e("table-settings")}`,p={checkAll:i.value,activeSize:c.value,activeHeight:f.value},w=()=>{t("change",{checked:u.value,size:c.value,height:f.value}),l.value=!1},y=()=>{i.value=p.checkAll,c.value=p.activeSize,f.value=p.activeHeight,u.value=o.value.checked||[],l.value=!1},v=()=>{Object.assign(p,{checkAll:i.value,activeSize:c.value,activeHeight:f.value}),l.value=!0},L=z=>{z.stopImmediatePropagation(),z.stopPropagation(),z.preventDefault(),i.value=!i.value;const E=o.value.fields||e.columns||[];if(i.value)u.value=E.map((ne,_)=>It(ne,"field",[ne,_]));else{const ne=E.filter(_=>_.disabled).map((_,ce)=>It(_,"field",[_,ce]));u.value.splice(0,u.value.length,...ne)}},x=a.computed(()=>{var z;return((z=o.value.limit)!=null?z:0)>0}),k=o.value.sizeList||n,C=a.computed(()=>x.value&&(o.value.limit?o.value.limit:0)<=u.value.length),b=(z,E)=>z.disabled||C.value&&!u.value.includes(It(z,"field",[z,E])),I=z=>{c.value=z.value,f.value=z.height},N=z=>({"line-size":!0,"is-medium":c.value==="medium",active:z.value===c.value}),T={marginRight:"12px"},A=()=>k.map(z=>a.createVNode("span",{class:N(z),onClick:()=>I(z)},[z.label])),P=a.computed(()=>o.value.fields||e.columns||[]),J=a.computed(()=>u.value.length>0&&!P.value.every((z,E)=>u.value.includes(It(z,"field",[z,E]))));return a.watch(()=>[u.value],()=>{u.value.length||(i.value=!1),u.value.length&&P.value.every((z,E)=>u.value.includes(It(z,"field",[z,E])))&&(i.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{u.value.splice(0,u.value.length,...o.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(ni,a.mergeProps({trigger:"manual",isShow:l.value,placement:"bottom-end",arrow:!1},{theme:m}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:v},[a.createVNode(Eo,{style:"color: #c4c6cc;"},null)]),content:()=>{let z;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[a.createTextVNode("\u8868\u683C\u8BBE\u7F6E")]),a.createVNode(Is,{class:"icon-close-action",onClick:y},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"},[a.createTextVNode("\u5B57\u6BB5\u663E\u793A\u8BBE\u7F6E")]),x.value?a.createVNode("span",{class:"limit"},[a.createTextVNode("\uFF08\u6700\u591A"),o.value.limit,a.createTextVNode("\u9879\uFF09")]):""]),x.value?"":a.createVNode("span",{class:"check-all",onClick:L},[a.createVNode(Ii,{label:"\u5168\u9009",indeterminate:Boolean(J.value),modelValue:u.value.length>0},{default:()=>[a.createTextVNode("\u5168\u9009")]})])]),a.createVNode(ec,{class:"setting-body-fields",modelValue:u.value,"onUpdate:modelValue":E=>u.value=E},F0(z=P.value.map((E,ne)=>{let _;return a.createVNode("div",{class:"field-item"},[a.createVNode(Ii,{label:It(E,"field",[E,ne]),checked:u.value.includes(It(E,"field",[E,ne])),disabled:b(E,ne)},F0(_=It(E,"label",[E,ne]))?_:{default:()=>[_]})])}))?z:{default:()=>[z]}),a.createVNode("div",{class:"setting-body-line-height"},[a.createTextVNode("\u8868\u683C\u884C\u9AD8\uFF1A"),A()])]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(_t,{theme:"primary",style:T,onClick:w},{default:()=>[a.createTextVNode("\u786E\u5B9A")]}),a.createVNode(_t,{style:T,onClick:y},{default:()=>[a.createTextVNode("\u53D6\u6D88")]})])])}}):""}}),Pc=(e,t,n)=>{const i=a.computed(()=>e.pagination&&e.data.length?ii:0),l=(p,w,y)=>({column_fixed:!!p.fixed,column_fixed_left:p.fixed!=="right",column_fixed_right:p.fixed==="right",shadow:p.fixed==="right"?w<y:w>0}),o=p=>p.fixed==="right"?"right":"left",c={left:(p=!0)=>t.filter(w=>w.fixed&&w.fixed!=="right").reduce((w,y,v)=>p&&v===0?w:w+Sr(y),0),right:(p=!0)=>t.filter(w=>w.fixed==="right").reduce((w,y,v)=>p&&v===0?w:w+Sr(y),n?Tc:0)},f=c.right,u=()=>{const p=(v,L)=>{if(!v.fixed)return{};const x=o(v),k=x==="right"?-1:1,C=`${L[x]}px`;return L[x]=L[x]+Sr(v)*k,{[x]:C}},w=f(!0);return{fixedOffset:{left:0,right:w},resolveFixedColumnStyle:p}},h=(p,w)=>{const y=L=>({width:`${c[L](!1)}px`,bottom:`${i.value}px`}),v={left:!1,right:!1};return t.filter(L=>!L.isHidden&&L.fixed).map(L=>{const x=o(L),k=v[x];return v[x]=!0,k?"":a.createVNode("div",{class:l(L,p,w),style:y(x)},null)})},m=_e("table-fixed");return{renderFixedColumns:h,fixedWrapperClass:m,getFixedColumnStyleResolve:u}};function Y0(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class Yp{constructor(t,n,i,l){tr(this,"getRowHeight",(t,n)=>{const{size:i,height:l}=this.setting;return l!=null?It(this.setting,"height",["tbody",t,n,i]):It(this.props,"rowHeight",["tbody",t,n])});tr(this,"getColumnClass",(t,n)=>({[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right"}));tr(this,"getHeadColumnClass",(t,n)=>Te(U({},this.getColumnClass(t,n)),{active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=l,this.plugins=new Gp(t,n),this.uuid=Bi.v4(),this.events=new Map}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=jc(this.props);if(!t)return null;const n=i=>{const{checked:l=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c,l.length&&this.colgroups.forEach(f=>{f.isHidden=!(l!=null?l:[]).includes(It(f,["field","type"],[f]))}),this.emitEvent(In.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(Fp,{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 n,i,l;return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):(l=(i=(n=this.context.slots).empty)==null?void 0:i.call(n))!=null?l:a.createVNode(Hp,{filterList:t,list:this.props.data,emptyText:this.props.emptyText},null)}renderTableFooter(t){return a.createVNode(xc,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.hanlePageChange(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(Pt.PAGE_LIMIT_CHANGE,t)}hanlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Pt.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(l=>l.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(l=>l.index!==t&&l.active).forEach(l=>{Object.assign(l,{active:!1})})}handleColumnHeadClick(t){this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(Pt.COLUMN_PICK,this.propActiveCols))}getSortCell(t,n){const i=(l,o)=>{this.emitEvent(In.ON_SORT_BY_CLICK,[{sortFn:l,column:t,index:n,type:o}])};return a.createVNode(Zp,{column:t,onChange:i},null)}getFilterCell(t,n){const i=(o,c)=>{const f=(u,h)=>c(o,u,h);this.emitEvent(In.ON_FILTER_CLICK,[{filterFn:f,checked:o,column:t,index:n}])},l=o=>{this.context.emit(Pt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(_p,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:l},null)}renderHeader(){const t=jc(this.props),{cellFn:n}=t,i={"--row-height":`${It(t,"height",["thead"])}px`},l=(h,m)=>{if(h.type==="selection"){const w=this.reactiveProp.rowActions.get(Xe.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Xe.ROW_SELECTION]:!!w},0,!0)}const p=[];return h.sort&&p.push(this.getSortCell(h,m)),h.filter&&p.push(this.getFilterCell(h,m)),typeof n=="function"?(p.unshift(n(h,m)),p):(p.unshift(It(h,"label",[h,m])),p)},o=h=>Array.from(h.listeners.keys()).reduce((m,p)=>{const w=p.split("_").slice(-1)[0];return Object.assign(m,{[w]:y=>{h.listeners.get(p).forEach(v=>Reflect.apply(v,this,[y,h,this]))}})},{}),{getFixedColumnStyleResolve:c}=Pc(this.props,this.colgroups),{resolveFixedColumnStyle:f,fixedOffset:u}=c();return a.createVNode("thead",{style:i},[a.createVNode(zc,null,{default:()=>[a.createVNode("tr",null,[this.filterColgroups.map((h,m)=>{let p;return a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:this.getHeadColumnClass(h,m),style:f(h,u),onClick:()=>this.handleColumnHeadClick(m)},o(h)),[a.createVNode(G0,null,Y0(p=l(h,m))?p:{default:()=>[p]})])})])]})])}renderTBody(t){const{getFixedColumnStyleResolve:n}=Pc(this.props,this.colgroups);return a.createVNode("tbody",null,[t.map((i,l)=>{const o=[...Dr(this.props.rowStyle,[i,l,this]),{"--row-height":`${this.getRowHeight(i,l)}px`}],c=[...Dr(this.props.rowClass,[i,l,this])],{resolveFixedColumnStyle:f,fixedOffset:u}=n(),h=`${this.uuid}-${i[Xe.ROW_UID]}`;return[a.createVNode(zc,{key:h},{default:()=>[a.createVNode("tr",{style:o,class:c,onClick:m=>this.handleRowClick(m,i,l,t),onDblclick:m=>this.handleRowDblClick(m,i,l,t)},[this.filterColgroups.map((m,p)=>{let w;const y=[f(m,u),...Dr(this.props.cellStyle,[m,p,i,l,this])],v=[this.getColumnClass(m,p),...Dr(this.props.cellClass,[m,p,i,l,this]),{"expand-row":i[Xe.ROW_EXPAND]}],L={cell:!0,"expand-cell":m.type==="expand"},x=`__CELL_${l}_${p}`;return a.createVNode("td",{class:v,style:y,key:x,colspan:1,rowspan:1},[a.createVNode(G0,{class:L,column:m,row:i,parentSetting:this.props.showOverflowTooltip},Y0(w=this.renderCell(i,m,l,t))?w:{default:()=>[w]})])})])]}),this.renderExpandRow(i,c)]})])}renderExpandRow(t,n){if(!!t[Xe.ROW_EXPAND]){const l=[...n,{row_expend:!0}],o=`${this.uuid}-${t[Xe.ROW_UID]}_expand`;return a.createVNode(zc,{key:o},{default:()=>{var c,f,u;return[a.createVNode("tr",{class:l},[a.createVNode("td",{colspan:this.filterColgroups.length,rowspan:1},[(u=(f=(c=this.context.slots).expandRow)==null?void 0:f.call(c,t))!=null?u:a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,l){this.context.emit(Pt.ROW_CLICK,t,n,i,l,this)}handleRowDblClick(t,n,i,l){this.context.emit(Pt.ROW_DBL_CLICK,t,n,i,l,this)}getExpandCell(t){return!!t[Xe.ROW_EXPAND]?a.createVNode(Ns,null,null):a.createVNode(Ss,null,null)}handleRowExpandClick(t,n,i,l,o){this.emitEvent(In.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:l,e:o}])}renderCellCallbackFn(t,n,i,l){const o=Xs(t,It(n,"field",[n,t]),n),c=this.props.data[t[Xe.ROW_INDEX]];return n.render({cell:o,data:c,row:t,column:n,index:i,rows:l})}renderCheckboxColumn(t,n,i=!1){const l=c=>{this.emitEvent(In.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:c}])},o=i&&!!this.reactiveProp.rowActions.get(Xe.ROW_SELECTION_INDETERMINATE);return a.createVNode(Ii,{onChange:l,modelValue:t[Xe.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,l){const o=()=>{var c,f,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,l):(u=(f=(c=this.context.slots).expandCell)==null?void 0:f.call(c,{row:t,column:n,index:i,rows:l}))!=null?u:this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,l,c)},[o()])}renderCell(t,n,i,l){var f,u;const o=()=>{const h=Xs(t,It(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,l):h},c={expand:(h,m,p,w)=>this.renderExpandColumn(h,m,p,w),selection:(h,m,p,w)=>this.renderCheckboxColumn(h,p)};return(u=(f=c[n.type])==null?void 0:f.call(c,t,n,i,l))!=null?u: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=Se({active:this.isColActive(n)}),l=`${Vp(Sr(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:l},null)})])}get filterColgroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}var Ks=(e,t)=>({initColumns:l=>{let o=[];Array.isArray(l)?o=l:o=[l],o.forEach(c=>{if(!t.find(u=>u.label===c.label&&u.field===c.field)){const u=a.unref(c);t.push(u)}})},getColumns:()=>{var l;return t!=null&&t.length?t:(l=e.columns)!=null&&l.length?e.columns:[]}});const U0=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:Sc(e.activeColumn):Array.isArray(e.activeColumn)?Sc(e.activeColumn[0]):Sc(e.activeColumn):[];var Up=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=Ks(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const l=a.reactive(U0(e)),o=()=>i().map((c,f)=>({index:f,active:l.some(u=>u===f),_column:c}));return a.watchEffect(()=>{n=o();const c=U0(e);n.forEach((f,u)=>{Object.assign(f,{active:c.some(h=>h===u)})})}),{activeColumns:n}},$p=(e,t=!0)=>{const n="HeadColumnResize";let i;(function(b){b.MOUSE_MOVE="onMousemove",b.MOUSE_OUT="onMouseout",b.MOUSE_DOWN="onMousedown"})(i||(i={}));let l=!1,o=!1,c=!1,f=0,u=null,h=0;const m=a.ref(-1e3),p=b=>{var A;o=!1,c=!1;const I=document.body.style;I.cursor="";const N=b.clientX-f;u.resizeWidth=((A=u.resizeWidth)!=null?A:u.calcWidth)+N,document.removeEventListener("mouseup",p),document.removeEventListener("mousemove",y),f=0,m.value=-1e3,u=null,b.target.closest("table").querySelectorAll("th").forEach(P=>P.style.setProperty("user-select","inherit"))},w=b=>ct.exports.throttle(()=>{m.value=b.clientX-f+h},60),y=b=>{document.body.style.setProperty("cursor",""),w(b)()},v={[i.MOUSE_DOWN]:(b,I)=>{if(!l)return;o=!0,document.body.style.setProperty("cursor","col-resize"),u=I,f=b.clientX;const T=b.target.closest("table");h=f-T.getBoundingClientRect().left,document.addEventListener("mouseup",p),document.addEventListener("mousemove",y)},[i.MOUSE_MOVE]:(b,I)=>{o&&!c&&(c=!0);const N=b.target.closest("th");if(c&&N.style.setProperty("user-select","none"),!c){if(!N)return;const T=N.getBoundingClientRect();T.width>12&&T.right-b.pageX<8?(l=!0,N.style.setProperty("cursor","col-resize")):(N.style.setProperty("cursor",""),l=!1)}},[i.MOUSE_OUT]:(b,I)=>{const N=b.target;c||N.style.setProperty("cursor","")}},L=b=>`${n}_${b}`,x=()=>{e.forEach(b=>{b.resizable!==!1&&Object.keys(v).forEach(I=>{const N=L(I);b.listeners.has(N)||b.listeners.set(N,[]),b.listeners.get(N).push(v[I])})})},k=()=>{e.forEach(b=>{Object.keys(v).forEach(I=>{const N=L(I);if(b.listeners.has(N)){const T=b.listeners.get(N);T.splice(0,T.length)}})})};t&&x();const C=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:x,resetResizeEvents:k,dragOffsetX:m,dragOffsetXStyle:C}};const Xp=(e,t,n,i,l)=>{const{getColumns:o}=Ks(e,t),c=a.ref(200),f=a.ref(void 0),u=a.computed(()=>e.pagination&&e.data.length),h=a.computed(()=>Se({[_e("table")]:!0,"has-footer":u.value,"has-scroll-y":f.value||e.virtualEnabled},Jp(e.border))),m=Se({[_e("table-head")]:!0,"has-settings":!!e.settings}),p=jc(e),w=a.computed(()=>({"--row-height":`${It(p,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),y={[_e("table-body")]:!0},v=a.computed(()=>Se({[_e("table-footer")]:!0,["is-hidden"]:!e.pagination||!e.data.length})),L=()=>{const P=o();if(P.every(J=>/^\d+\.?\d*(px)?$/ig.test(`${J.width}`))){const J=P.reduce((E,ne)=>E+Number(`${ne.width}`.replace(/px/ig,"")),0),z=f.value?Tc:0;return`${J+z}px`}return"100%"},x=a.computed(()=>({minHeight:_0(e.minHeight,"auto"),width:L(),maxWidth:"100%"})),k=(P,J)=>{const z=String(P);if(/^\d+\.?\d*$/.test(z))return Number(z);if(/^\d+\.?\d*px$/ig.test(z))return Number(z.replace("px",""));if(/^\d+\.?\d*%$/ig.test(z)&&typeof J=="number"){const E=Number(z.replace("%",""));return J*E/100}return J},C=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),b=()=>e.showHead?k(e.headHeight,ii):0,I=()=>{const P=k(e.height,c.value),J=b(),z=k(e.minHeight,c.value),E=e.pagination&&e.data.length?ii:0,ne=P-J-E,_=e.height!=="auto"?`${ne}px`:!1,ce=z-J-E,re=k(e.maxHeight,void 0),ae=typeof re=="number"?`${re-J-E}px`:!1;Object.assign(C,{display:l!=null&&l.length?"block":!1,"min-height":`${ce}px`,height:_,maxHeight:ae})};a.onMounted(()=>{N(n==null?void 0:n.value)});const N=P=>{if(P){const{height:J}=P.parentElement.getBoundingClientRect();c.value=J,I(),T(P)}},T=P=>{const J=e.virtualEnabled?`.${_e("virtual-section")}`:`.${_e("table-body-content")}`,z=P.querySelector(".bk-table-body");f.value=Rp(z,J,0)};return{tableClass:h,headClass:m,contentClass:y,footerClass:v,wrapperStyle:x,contentStyle:C,headStyle:w,resetTableHeight:N,updateBorderClass:T,getColumnsWidthOffsetWidth:()=>{let P=0;return f.value&&(P=P+Tc),e.border.includes(Ys.OUTER)&&!e.border.includes(Ys.NONE)&&(P=P+2),P},hasFooter:u,hasScrollY:f}},Kp=(e,t)=>{var ce,re;const n=a.reactive([]),{getColumns:i}=Ks(e,t),l=()=>{n.splice(0,n.length,...i().map(ae=>Te(U({},ae),{calcWidth:null,resizeWidth:null,listeners:new Map})))},{dragOffsetXStyle:o,dragOffsetX:c,resetResizeEvents:f,registerResizeEvent:u}=$p(n,!0),{activeColumns:h}=Up(e,t);a.watch(()=>[e.columns,t],()=>{l(),f(),u()},{immediate:!0,deep:!0});const m=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:h,settings:e.settings,setting:{size:(ce=e.settings)==null?void 0:ce.size,height:Us[(re=e.settings)==null?void 0:re.size]}}),p=ae=>{var ue;return m.rowActions.has(ae)?(ue=m.rowActions.get(ae))==null?void 0:ue.isExpand:!1},w=(ae,ue=void 0)=>{var W;const ie=ae[Xe.ROW_UID],Y=typeof ue=="boolean"?ue:!p(ie);m.rowActions.set(ie,Object.assign({},(W=m.rowActions.get(ie))!=null?W:{},{isExpand:Y})),J()},y=()=>m.rowActions.has(Xe.ROW_SELECTION_ALL)?m.rowActions.get(Xe.ROW_SELECTION_ALL):e.selectionKey?A.every(ae=>N(ae)):!1,v=ae=>{const ue=ae[Xe.ROW_UID],{isSelected:ie=!1}=m.rowActions.get(ue)||{};return ie},L=(ae=v)=>{let ue=!1,ie=!1;A.forEach(Y=>{const W=ae(Y);!ue&&!W&&(ue=!0),!ie&&W&&(ie=!0)}),m.rowActions.set(Xe.ROW_SELECTION_ALL,ie&&!ue),m.rowActions.set(Xe.ROW_SELECTION_INDETERMINATE,ie&&ue)},x=()=>e.columns.some(ae=>ae.type==="selection"),k=()=>{x()&&L(ae=>N(ae))},C=(ae=void 0)=>{const ue=typeof ae=="boolean"?ae:!y();m.rowActions.set(Xe.ROW_SELECTION_ALL,ue),m.rowActions.set(Xe.ROW_SELECTION_INDETERMINATE,!1),A.forEach(ie=>{var Q;const Y=ie[Xe.ROW_UID],W=Object.assign({},(Q=m.rowActions.get(Y))!=null?Q:{},{isSelected:ue});m.rowActions.set(Y,W)}),J(ue),z(null,ae,!0)},b=()=>{C(!1)},I=(ae,ue)=>{var Y;const ie=ae[Xe.ROW_UID];if(ie){const W=typeof ue=="boolean"?ue:!T(ae,ie),Q=Object.assign({},(Y=m.rowActions.get(ie))!=null?Y:{},{isSelected:W});m.rowActions.set(ie,Q),ue||m.rowActions.set(Xe.ROW_SELECTION_ALL,!1),L(),J(),z(ae,ue,!1)}},N=(ae,ue=()=>!1)=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,globalThis,[{row:ae,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?ct.exports.get(ae,e.selectionKey):ue(),T=(ae,ue)=>N(ae,()=>{var Y;const ie=ue===void 0?ae[Xe.ROW_UID]:ue;return y()?!0:m.rowActions.has(ie)?(Y=m.rowActions.get(ie))==null?void 0:Y.isSelected:!1}),A=a.reactive([]),P=(ae=!1)=>{A.splice(0,A.length,...e.data.map((ue,ie)=>{const Y=Qp(ue,e,ie);return Te(U({},ue),{[Xe.ROW_INDEX]:ie,[Xe.ROW_UID]:Y,[Xe.ROW_EXPAND]:ae?p(Y):!1,[Xe.ROW_SELECTION]:T(ue,Y)})})),k()},J=ae=>{A.forEach(ue=>{Object.assign(ue,{[Xe.ROW_EXPAND]:p(ue[Xe.ROW_UID]),[Xe.ROW_SELECTION]:typeof ae=="boolean"?ae:T(ue,ue[Xe.ROW_UID])})}),typeof ae!="boolean"&&k()},z=(ae,ue,ie=!1)=>{if(e.asyncData&&e.rowKey){if(ie)e.data.forEach(Y=>{ct.exports.has(Y,e.selectionKey)&&ct.exports.set(Y,e.selectionKey,!!ue)});else if(ct.exports.has(ae,e.selectionKey)){const Y=e.data.find(W=>ct.exports.get(W,e.rowKey)===ct.exports.get(ae,e.rowKey));ct.exports.set(Y,e.selectionKey,!!ue)}}},{renderFixedColumns:E,fixedWrapperClass:ne}=Pc(e,n,!1);return{colgroups:n,dragOffsetXStyle:o,dragOffsetX:c,reactiveSchema:m,indexData:A,fixedWrapperClass:ne,initIndexData:P,updateIndexData:J,renderFixedColumns:E,setRowExpand:w,updateColGroups:l,clearSelection:b,toggleAllSelection:C,toggleRowSelection:I,getSelection:()=>A.filter(ae=>T(ae))}};var qp=a.defineComponent({name:"Table",props:Tp,emits:Lp,setup(e,t){let n=null,i=null,l=null,o=null;const c=a.reactive([]),{initColumns:f}=Ks(e,c);a.provide(R0,f);const u=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:p,dragOffsetXStyle:w,dragOffsetX:y,reactiveSchema:v,indexData:L,renderFixedColumns:x,setRowExpand:k,initIndexData:C,fixedWrapperClass:b,clearSelection:I,toggleAllSelection:N,toggleRowSelection:T,getSelection:A}=Kp(e,c),{pageData:P,localPagination:J,resolvePageData:z,watchEffectFn:E}=xp(e,L),{tableClass:ne,headClass:_,contentClass:ce,footerClass:re,wrapperStyle:ae,contentStyle:ue,headStyle:ie,updateBorderClass:Y,resetTableHeight:W,getColumnsWidthOffsetWidth:Q,hasFooter:F}=Xp(e,c,u,v,P),K=new Yp(e,t,v,p),fe=()=>{const V=u.value.querySelector(".bk-table-body-content"),H=V.querySelector("table");if(H){const $=H.scrollWidth,te=V.clientWidth;m.value=$-te}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{C(e.reserveExpand),E(l,n,i),a.nextTick(()=>{W(u.value),Y(u.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((u==null?void 0:u.value)instanceof HTMLElement){const V=Q();Dc(u.value,p,20,V),fe()}}),K.on(In.ON_SORT_BY_CLICK,V=>{var we,Ne;const{sortFn:H,column:$,index:te,type:ye}=V;typeof H=="function"&&(n=H,i=$,z(l,n,i),(Ne=(we=h.value)==null?void 0:we.reset)==null||Ne.call(we)),t.emit(Pt.COLUMN_SORT,{column:$,index:te,type:ye})}).on(In.ON_FILTER_CLICK,V=>{var we,Ne;const{filterFn:H,checked:$,column:te,index:ye}=V;typeof H=="function"&&(l=H,z(l,n,i),(Ne=(we=h.value)==null?void 0:we.reset)==null||Ne.call(we)),t.emit(Pt.COLUMN_FILTER,{checked:$,column:te,index:ye})}).on(In.ON_SETTING_CHANGE,V=>{const{checked:H=[],size:$,height:te}=V;a.nextTick(()=>{var we,Ne;Y(u.value);const ye=Q();H.length&&Dc(u.value,p,20,ye),(Ne=(we=h.value)==null?void 0:we.reset)==null||Ne.call(we),t.emit(Pt.SETTING_CHANGE,{checked:H,size:$,height:te})})}).on(In.ON_ROW_EXPAND_CLICK,V=>{const{row:H,column:$,index:te,rows:ye,e:we}=V;t.emit(Pt.ROW_EXPAND_CLICK,{row:H,column:$,index:te,rows:ye,e:we}),k(H,!H[Xe.ROW_EXPAND])}).on(In.ON_ROW_CHECK,({row:V,isAll:H,index:$,value:te})=>{H?(N(te),t.emit(Pt.ROW_SELECT_ALL,{checked:te,data:e.data})):(T(V,te),t.emit(Pt.ROW_SELECT,{row:V,index:$,checked:te,data:e.data})),t.emit(Pt.ROW_SELECT_CHANGE,{row:V,isAll:H,index:$,checked:te,data:e.data})});const he=V=>{var Qe;const H=(Qe=v.pos.bottom)!=null?Qe:0,$=V[1],{translateX:te,translateY:ye,pos:we={}}=$;v.scrollTranslateY=ye,v.scrollTranslateX=te,v.pos=we;const{bottom:Ne}=we;Ne<=2&&H>Ne&&Mf(60,()=>{t.emit(Pt.SCROLL_BOTTOM,Te(U({},we),{translateX:te,translateY:ye}))},!0)(),fe()};a.onMounted(()=>{o=Z0(u.value,()=>{(e.height==="100%"||e.height==="auto")&&W(u.value),Y(u.value);const V=Q();Dc(u.value,p,20,V)},60,!0),o.start()}),a.onBeforeUnmount(()=>{o.stop(),o=null,K.destroy()}),t.expose({setRowExpand:k,clearSelection:I,toggleAllSelection:N,toggleRowSelection:T,getSelection:A});const Ce=a.computed(()=>Te(U({},ce),{"__is-empty":!P.length})),Ae={[_e("table-body-content")]:!0,"with-virtual-render":e.virtualEnabled},oe={column_drag_line:!0,"offset-x":!0},X=a.computed(()=>Te(U({},w.value),{left:`${y.value-v.scrollTranslateX}px`})),Z={"scroll-loading":!0,_bottom:!0},se={[_e("fixed-bottom-border")]:!0,"_is-empty":!e.data.length},Me={zIndex:-1,width:0,height:0,display:"none"},{renderScrollLoading:j}=Sp(e,t),B=e.virtualEnabled?{}:{scrollXName:"",scrollYName:""};return()=>{var V,H;return a.createVNode("div",{class:ne.value,style:ae.value,ref:u},[a.createVNode("div",{class:_,style:ie.value},[K.renderTableHeadSchema()]),a.createVNode(xr,a.mergeProps({ref:h,lineHeight:K.getRowHeight,class:Ce.value,style:ue,list:P},B,{contentClassName:Ae,onContentScroll:he,throttleDelay:0,scrollEvent:!0,enabled:e.virtualEnabled}),{default:$=>K.renderTableBodySchema($.data||e.data),afterSection:()=>a.createVNode("div",{class:se},null)}),a.createVNode("div",{class:b},[x(v.scrollTranslateX,m.value),a.createVNode("div",{class:oe,style:X.value},null),a.createVNode("div",{class:Z},[j()])]),a.createVNode("div",{class:re.value},[F.value&&K.renderTableFooter(J.value)]),a.createVNode("div",{style:Me},[(H=(V=t.slots).default)==null?void 0:H.call(V)])])}}});const $0=He(qp);He(H0);const X0=He(H0),za=12;function e5(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(l=[])=>{t.curPage=1,t.totalSize=l.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(l.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:l=>{t.curPage=l,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function t5(e){const{useGroup:t,saveKey:n,displayKey:i,list:l}=a.toRefs(e),o=a.ref([]);return a.watch([t,n,i,l],()=>{o.value=[];let c=a.markRaw(l.value);t.value&&(c=c.reduce((f,u)=>{let h=[];return u.children&&(h=u.children.map(m=>U({group:{groupId:u[n.value],groupName:u[i.value]}},m))),f.concat(h)},[])),o.value=c},{immediate:!0}),o}const K0=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)(e.charCodeAt(i)&65280)!==0&&(n+=1),n+=1;return n};var q0=a.defineComponent({name:"ListTagRender",props:{node:g.object,searchKey:g.oneOfType([g.string,g.arrayOf(g.string)]),displayKey:g.string,searchKeyword:g.string,tpl:{type:Function,default:null}},render(){const e=n=>{if(this.searchKeyword){const i=new RegExp(`(${this.searchKeyword})`,"i");return n.replace(i,'<strong class="highlight-text">$1</strong>')}return n};if(this.tpl)return this.tpl(this.node,e,a.h,this);const t=this.node[this.displayKey];return a.createVNode("div",{class:"bk-selector-node"},[a.createVNode("span",{class:"text",innerHTML:e(t)},[t])])}});const n5=()=>({modelValue:g.arrayOf(g.string).def([]),placeholder:g.string.def("\u8BF7\u8F93\u5165\u5E76\u6309 Enter \u7ED3\u675F"),list:g.arrayOf(g.object).def([]),disabled:g.bool.def(!1),tooltipKey:g.string.def(""),saveKey:g.string.def("id"),displayKey:g.string.def("name"),hasDeleteIcon:g.bool.def(!1),clearable:g.bool.def(!0),trigger:g.commonType(["focus","search"]).def("search"),searchKey:g.oneOfType([g.string,g.arrayOf(g.string)]).def("name"),useGroup:g.bool.def(!1),allowCreate:g.bool.def(!1),maxData:g.number.def(-1),maxResult:g.number.def(10),contentMaxHeight:g.number.def(300),contentWidth:g.number.def(190),separator:g.string.def(""),allowNextFocus:g.bool.def(!0),allowAutoMatch:g.bool.def(!1),showClearOnlyHover:g.bool.def(!1),leftSpace:g.number.def(0),createTagValidator:{type:Function,default:null},filterCallback:{type:Function,default:null},tagTpl:{type:Function,default:null},tpl:{type:Function,default:null},pasteFn:{type:Function,default:null},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})}});var i5=a.defineComponent({name:"TagRender",props:{node:g.object,displayKey:g.string,tpl:{type:Function,default:null}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])])}}),a5=a.defineComponent({name:"TagInput",directives:{bkTooltips:dc},props:n5(),emits:["update:modelValue","change","select","blur","remove","removeAll"],setup(e,{emit:t}){const n=En(),i=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),l=a.reactive(U({isShow:!1,width:190,modifiers:[{name:"offset",options:{offset:[0,4]}}]},e.popoverProps)),{maxResult:o}=a.toRefs(e),{pageState:c,initPage:f,pageChange:u}=e5(o),h=a.ref(""),m=a.ref(null),p=a.ref(null),w=a.ref(null),y=a.ref(null),v=a.ref(null),L=a.ref(null),x=a.ref(null),k=a.computed(()=>!e.disabled&&e.hasDeleteIcon),C=a.computed(()=>e.maxData===1),b=a.computed(()=>z.selectedTagList.length===0&&h.value===""&&!i.isEdit),I=a.computed(()=>e.clearable&&!e.disabled&&z.selectedTagList.length!==0&&(e.showClearOnlyHover?i.isHover:!0)),N=a.computed(()=>({"bk-tag-input-trigger":!0,active:i.isEdit,disabled:e.disabled}));a.watch([()=>e.modelValue,()=>e.list],()=>{var H;a.nextTick(()=>{ce()}),e.withValidate&&((H=n==null?void 0:n.validate)==null||H.call(n,"change"))}),a.watch(h,ct.exports.debounce(()=>{const H=c.curPageList.length!==0,{value:$}=h;$!==""&&H||$===""&&e.trigger==="focus"&&H?l.isShow=!0:(e.trigger!=="focus"||!H)&&(l.isShow=!1)},150)),a.watch(()=>l.isShow,H=>{T(),H&&v.value&&(a.nextTick(()=>{v.value.scrollTop=0}),v.value.removeEventListener("scroll",A),v.value.addEventListener("scroll",A))});const T=()=>{var $,te;const H=C.value?0:($=y.value)==null?void 0:$.offsetLeft;l.modifiers=[{name:"offset",options:{offset:[H,4]}}],(te=L.value)==null||te.update()},A=()=>{if(c.isPageLoading||v.value.scrollTop===0)return;const{scrollTop:H,offsetHeight:$,scrollHeight:te}=v.value;if(H+$>=te){const ye=c.curPage+1;ye<=c.totalPage&&(c.isPageLoading=!0,setTimeout(()=>{u(ye)},500))}},P=()=>{var $;return Array.from((($=w.value)==null?void 0:$.childNodes)||[]).filter(te=>te.nodeType!==Node.TEXT_NODE)},J=H=>{if(!e.disabled){if(H!=null&&H.target){const{className:$}=H.target;($.indexOf("bk-tag-input-trigger")>-1||$.indexOf("tag-list")>-1)&&w.value.appendChild(y.value)}clearTimeout(x.value),C.value&&E.value.length&&(z.tagListCache=[...E.value],z.selectedTagListCache=[...z.selectedTagList],h.value=z.selectedTagListCache[0][e.saveKey],V(z.selectedTagList[0],0),Q()),i.isEdit=!0,a.nextTick(()=>{var $;($=m.value)==null||$.focus(),e.trigger==="focus"&&z.localList.length!==0&&(re(),l.isShow?T():l.isShow=!0)})}},z=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),E=a.computed(()=>z.selectedTagList.map(H=>H[e.saveKey])),ne=t5(e),_=a.computed(()=>{if(e.useGroup){const H={};return c.curPageList.forEach(($,te)=>{$.__index__=te,H[$.group.groupId]||(H[$.group.groupId]={id:$.group.groupId,name:$.group.groupName,children:[]}),H[$.group.groupId].children.push($)}),Object.keys(H).map($=>H[$])}return c.curPageList}),ce=()=>{const{saveKey:H,modelValue:$,displayKey:te,allowCreate:ye,trigger:we}=e;z.selectedTagList=[],z.localList=ne.value,$.length&&($.forEach(Ne=>{const Qe=z.localList.find(ut=>Ne===ut[H]);Qe!==void 0?z.selectedTagList.push(Qe):ye&&!E.value.includes(Ne)&&z.selectedTagList.push({[H]:Ne,[te]:Ne})}),C.value||(z.localList=z.localList.filter(Ne=>!$.includes(Ne[H])))),we==="focus"&&re()},re=(H="")=>{const{searchKey:$,filterCallback:te}=e,ye=H.toLowerCase();let we=[];if(typeof te=="function")we=te(ye,$,z.localList)||[];else if(Array.isArray($)){const Ne=$.map(Qe=>z.localList.filter(ut=>ut[Qe].toLowerCase().indexOf(ye)!==-1));we=Array.from(new Set(Ne.flat()))}else we=z.localList.filter(Ne=>Ne[$].toLowerCase().indexOf(ye)!==-1);f(we)},ae=(H,$)=>{const te={"bk-selector-actived":!1,"bk-selector-selected":E.value.includes(H[e.saveKey])};return e.useGroup?te["bk-selector-actived"]=H.__index__===i.focusItemIndex:te["bk-selector-actived"]=$===i.focusItemIndex,te};a.onMounted(()=>{ce()});const ue=()=>{z.tagListCache=[],z.selectedTagListCache=[],z.selectedTagList=[]},ie=()=>{h.value=""},Y=()=>{if(C.value)return 0;const $=P().findIndex(({id:te})=>te==="tagInputItem");return $>=0?$:0},W=(H,$,te=!1)=>{if(!$||!H)return;let ye=$;te&&(ye=$.nextElementSibling||null),$.parentNode.insertBefore(H,ye)},Q=H=>{const{maxData:$,trigger:te,allowCreate:ye}=e;if($===-1||$>E.value.length){const{value:we}=H!=null&&H.target?H.target:h,Ne=K0(we);Ne?(re(we),m.value.style.width=`${Ne*za}px`):te==="focus"&&re()}else K(),h.value="",l.isShow=!1;i.isEdit=!0,i.focusItemIndex=ye?-1:0},F=()=>{var H;l.width=C.value?(H=p.value)==null?void 0:H.clientWidth:e.contentWidth},K=()=>{x.value=setTimeout(()=>{var $;const H=h.value;if(ie(),i.isEdit=!1,C.value){const[te]=z.tagListCache;H&&H===te&&z.selectedTagListCache.length?B(z.selectedTagListCache[0],"select"):Ce("remove")}else if(e.allowAutoMatch&&H){const te=c.curPageList.find(ye=>Array.isArray(e.searchKey)?e.searchKey.map(Ne=>ye[Ne]).includes(H):ye[e.searchKey]===H);te?fe(te,"select"):e.allowCreate&&fe(H,"custom")}l.isShow=!1,t("blur",H,E.value),($=n==null?void 0:n.validate)==null||$.call(n,"blur")},200)},fe=(H,$,te)=>{te==null||te.stopPropagation(),!(!H||H.disabled)&&(C.value&&ue(),B(H,$),Ce("select"),ie(),l.isShow=!1)},he=(H,$,te)=>{te==null||te.stopPropagation(),V(H,$),ie(),Ce("remove",H),m.value.style.width=`${za}px`},Ce=(H,$)=>{t("change",E.value),t(H,$),t("update:modelValue",E.value)},Ae=H=>{H.stopPropagation();const $=z.selectedTagList;z.selectedTagList=[];const te=ne.value.filter(ye=>$.some(we=>we[e.saveKey]===ye[e.saveKey]));(e.allowCreate&&te.length!==0||!e.allowCreate)&&!C.value&&z.localList.push(...te),Ce("removeAll")},oe=()=>{const H={height:v.value.clientHeight,yAxis:v.value.getBoundingClientRect().y};a.nextTick(()=>{const $=v.value.querySelector(".bk-selector-actived");if(!$)return;const te={height:$.clientHeight,yAxis:$.getBoundingClientRect().y};te.yAxis<H.yAxis&&(v.value.scrollTop=v.value.scrollTop-(H.yAxis-te.yAxis));const ye=te.yAxis+te.height-H.yAxis;ye>H.height&&(v.value.scrollTop=v.value.scrollTop+ye-H.height)})},X=(H,$)=>{const te=P();W(y.value,te[H-1]),z.selectedTagList.splice(H-1,1),J();const ye=ne.value.some(we=>we===$[e.saveKey]);(e.allowCreate&&ye||!e.allowCreate)&&!C.value&&z.localList.push($),m.value=`${za}px`,Ce("remove")},Z=H=>{if(c.isPageLoading)return;let $;const te=H.target.value,ye=K0(te),we=Y(),Ne=P();switch(H.code){case"ArrowUp":if(H.preventDefault(),!l.isShow)return;i.focusItemIndex=i.focusItemIndex-1,i.focusItemIndex=i.focusItemIndex<0?-1:i.focusItemIndex,i.focusItemIndex===-1&&(i.focusItemIndex=c.curPageList.length-1),oe();break;case"ArrowDown":if(H.preventDefault(),!l.isShow)return;i.focusItemIndex=i.focusItemIndex+1,i.focusItemIndex=i.focusItemIndex>c.curPageList.length-1?c.curPageList.length:i.focusItemIndex,i.focusItemIndex===c.curPageList.length&&(i.focusItemIndex=0),oe();break;case"ArrowLeft":if(i.isEdit=!0,!ye){if(we<1)return;W(y.value,Ne[we-1]),J()}break;case"ArrowRight":if(i.isEdit=!0,!ye){if(we===Ne.length-1)return;W(Ne[we+1],y.value),J()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&l.isShow||e.allowCreate&&i.focusItemIndex>=0&&l.isShow?fe(c.curPageList[i.focusItemIndex],"select",H):e.allowCreate&&fe(h.value,"custom",H),H.preventDefault();break;case"Backspace":we!==0&&!h.value&&($=z.selectedTagList[we-1],X(we,$));break}},se=H=>{const $=[],te=H.split(";"),ye=/^[a-zA-Z][a-zA-Z_]*/g;return te.forEach(we=>{const Ne=we.match(ye);if(Ne){const Qe=Ne.join("");$.push({[e.saveKey]:Qe,[e.displayKey]:Qe})}}),$},Me=H=>{if(H.preventDefault(),C.value)return!1;const{maxData:$,saveKey:te,displayKey:ye,pasteFn:we,allowCreate:Ne}=e,Qe=H.clipboardData.getData("text");let Fe=(we?we(Qe):se(Qe)).map(at=>at[te]);if(Fe.length){const at=P(),St=Y(),Dt=z.localList.map(Ke=>Ke[te]);if(Fe=Fe.filter(Ke=>{const Ue=(Ke==null?void 0:Ke.trim())&&!E.value.includes(Ke);return Ne?Ue:Ue&&Dt.includes(Ke)}),$!==-1){const Ke=z.selectedTagList.length;if(Ke<$){const Ue=$-Ke;Fe.length>Ue&&(Fe=[...Fe.slice(0,Ue)])}else Fe=[]}const qe=Ne?Fe.map(Ke=>{const Ue=z.localList.find(kn=>kn[te]===Ke);return Ue!=null?Ue:{[te]:Ke,[ye]:Ke}}):z.localList.filter(Ke=>Fe.includes(Ke[te]));Fe.length&&(z.selectedTagList.splice(St,0,...qe),W(y.value,at[St]),m.value.style.width=`${za}px`,z.localList=z.localList.filter(Ke=>!Fe.includes(Ke[te])),Ce("select"),J())}},j=H=>{e.disabled||(W(y.value,H.currentTarget,!0),m.value.style.width=`${za}px`,l.isShow&&T())},B=(H,$)=>{if(z.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:te,saveKey:ye,displayKey:we,createTagValidator:Ne}=e,Qe=Y();let ut=1,Fe=!1,at;const St=qe=>typeof Ne=="function"?Ne(qe):!0,Dt=qe=>z.localList.find(Ke=>Ke[ye]===qe);if($==="custom")if(te){let qe=H.split(te);qe=qe.filter(Ue=>(Ue==null?void 0:Ue.trim())&&!E.value.includes(Ue)&&St(Ue));const Ke=qe.map(Ue=>Dt(Ue)||{[ye]:Ue,[we]:Ue});qe.length&&(z.selectedTagList.splice(Qe,0,...Ke),ut=Ke.length,Fe=!0)}else{const qe=typeof H=="object";if(at=qe?H[ye]:H.trim(),at=at.replace(/\s+/g,""),at!==void 0&&!E.value.includes(at)&&St(at)){const Ke=Dt(at)||(qe?H:{[ye]:at,[we]:at});z.selectedTagList.splice(Qe,0,Ke),Fe=!0}}else H&&(at=H[ye],at!==void 0&&!E.value.includes(at)&&(z.selectedTagList.splice(Qe,0,H),Fe=!0));Fe&&a.nextTick(()=>{for(let qe=1;qe<=ut;qe++){const Ue=P()[Qe+qe];W(Ue,y.value)}m.value.style.width=`${za}px`,C.value||(e.allowNextFocus&&J(),z.localList=z.localList.filter(qe=>!E.value.includes(qe[ye])))})},V=(H,$)=>{z.selectedTagList.splice($,1);const te=ne.value.some(ye=>ye===H[e.saveKey]);(e.allowCreate&&te||!e.allowCreate)&&!C.value&&z.localList.push(H)};return Te(U(U(U({popoverProps:l},a.toRefs(i)),a.toRefs(z)),a.toRefs(c)),{isShowPlaceholder:b,isShowClear:I,curInputValue:h,formatList:ne,renderList:_,showTagClose:k,tagInputRef:m,bkTagSelectorRef:p,tagListRef:w,tagInputItemRef:y,selectorListRef:v,popoverRef:L,triggerClass:N,focusInputTrigger:J,activeClass:ae,handleInput:Q,handleFocus:F,handleBlur:K,handleTagSelected:fe,handleTagRemove:he,handleClear:Ae,tagFocus:j,handleKeydown:Z,handlePaste:Me})},render(){return a.createVNode("div",{class:"bk-tag-input",ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Os,a.mergeProps({ref:"popoverRef",theme:"light",trigger:"manual",placement:"bottom-start","content-cls":"bk-tag-input-popover-content",arrow:!1},this.popoverProps),{default:()=>{var e,t,n;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((i,l)=>{const o={boundary:"window",theme:"light",distance:12,content:i[this.tooltipKey],disabled:!this.tooltipKey};return a.withDirectives(a.createVNode("li",{class:"tag-item",onClick:this.tagFocus},[a.createVNode(i5,{node:i,tpl:this.tagTpl,displayKey:this.displayKey},null),this.showTagClose?a.createVNode(An,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,i,l)},null):null]),[[a.resolveDirective("bk-tooltips"),o]])}),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":i=>this.curInputValue=i,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholder]),[[a.vShow,this.isShowPlaceholder]]),(n=(t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))!=null?n:this.isShowClear&&a.createVNode(cn,{class:"clear-icon",onClick:this.handleClear},null)])},content:()=>a.createVNode("div",{class:"bk-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:"bk-selector-group-item"},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:"bk-selector-group-list-item"},[e.children.map((n,i)=>a.createVNode("li",{class:["bk-selector-list-item",{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(q0,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:["bk-selector-list-item",{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(q0,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:"bk-selector-list-item loading"},[a.createVNode(wi,{theme:"primary",size:Vn.Small},null)]):null])])})])}});const eh=He(a5),r5={direction:g.commonType(["horizontal","vertical"],"direction").def("horizontal"),align:g.commonType(["left","center","right"],"align").def("center"),color:g.string.def("#dde4eb"),width:g.number.def(1),type:g.commonType(["dashed","solid"],"lineType").def("dashed")};var s5=a.defineComponent({name:"Divider",props:r5,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`};let t;return this.$slots.default&&(t=a.createVNode("div",{class:["bk-divider-info",`bk-divider-info-${this.align}`]},[this.$slots.default()])),a.createVNode("div",{class:["bk-divider",`bk-divider-${this.direction}`],style:e()},[t])}});const th=He(s5),l5={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},o5={active:g.oneOfType([g.number,g.string]).def(""),type:g.commonType(["card","border-card","unborder-card"],"type").def("border-card"),tabPosition:g.commonType(["left","right","top"],"position").def("top"),closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g.commonType(["replace","insert","top"],"sortType").def("replace"),labelHeight:g.number.def(50),scrollStep:g.number.def(200),extCls:g.string.def(""),validateActive:g.bool.def(!0),showHeader:g.bool.def(!0),changeOnHover:g.bool.def(!1),changeOnHoverDelay:g.number.def(1e3)},c5=U({active:g.oneOfType([g.number,g.string]).def(""),panels:{type:Array,default:()=>[]},tabPosition:g.commonType(["left","right","top"],"position").def("top"),closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g.commonType(["replace","insert","top"],"sortType").def("replace"),labelHeight:g.number.def(50),scrollStep:g.number.def(200),validateActive:g.bool.def(!0),changeOnHover:g.bool.def(!1),changeOnHoverDelay:g.number.def(1e3)},l5),u5={name:g.oneOfType([g.number,g.string]).def(""),label:g.string||g.func,closable:g.bool,visible:g.bool.def(!0),disabled:g.bool,sortable:g.bool,renderDirective:g.commonType(["if","show"],"render").def("show"),panel:g.string||g.func};var nh=a.defineComponent({name:"TabNav",props:c5,setup(e){const t=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const f=[];let u=!1;return e.panels.filter((h,m)=>{if(!h.props)return null;const{name:p,label:w,closable:y,visible:v,disabled:L,sortable:x}=h.props;if(!v)return!1;e.active===p&&(u=!0);const k=C=>h.slots.label?a.h(h.slots.label):[void 0,""].includes(C)?`\u9009\u9879\u5361${m+1}`:typeof C=="string"?C:typeof C=="function"?a.h(C):C;return f.push({name:p,closable:y,visible:v,disabled:L,sortable:x,tabLabel:k(w)}),!0}),!u&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),f}),n=a.ref(-1),i=a.ref(-1),l=a.ref(""),o=(f,u)=>f===u;return Te(U({},{handleTabAdd(f){e.tabAdd(f)},dragstart(f,u){i.value=f,l.value=e.guid,Object.assign(u.dataTransfer,{effectAllowed:"move"}),e.tabDrag(f,u)},dragenter(f){o(l.value,e.guid)&&(n.value=f)},dragend(){n.value=-1,i.value=-1,l.value=null},drop(f,u){if(!o(l.value,e.guid))return!1;e.tabSort(i.value,f,u)},handleTabChange(f){e.tabChange(f)},handleTabRemove(f,u){e.tabRemove(f,u)}}),{navs:t,dragenterIndex:n,dragStartIndex:i,draggingEle:l,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4)})},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:l,labelHeight:o,dragstart:c,dragenter:f,dragend:u,drop:h}=this,m=()=>this.navs.map((w,y)=>{if(!w)return null;const{name:v,disabled:L,tabLabel:x}=w,k=()=>{const b=["bk-tab-header-item"];return L&&b.push("bk-tab-header--disabled"),e===v&&b.push("bk-tab-header--active"),b.join(" ")},C=(b,I)=>b||I;return a.createVNode("div",{key:v,onClick:()=>this.handleTabChange(v),draggable:C(w.sortable,i),onDragstart:b=>c(y,b),onDragenter:b=>{b.preventDefault(),f(y)},onDragleave:b=>{b.preventDefault()},onDragover:b=>{b.preventDefault()},onDragend:b=>{b.preventDefault(),u()},onDrop:b=>{b.preventDefault(),h(y,l)},class:k()},[a.createVNode("div",null,[x]),C(w.closable,t)&&a.createVNode(cn,{class:"bk-tab-header-item-close",onClick:()=>this.handleTabRemove(y,w)},null)])}),p=()=>{var y,v;const w=[];return typeof this.$slots.add=="function"?w.push((v=(y=this.$slots).add)==null?void 0:v.call(y,a.h)):n&&w.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(xs,{width:26,height:26},null)])),w.length?a.createVNode("div",{class:"bk-tab-header-operation"},[w.map((L,x)=>a.createVNode("div",{class:"bk-tab-header-item",key:x},[L]))]):null};return a.createVNode("div",{style:{lineHeight:`${o}px`},class:"bk-tab-header"},[a.createVNode("div",{class:"bk-tab-header-nav"},[m()]),p(),typeof this.$slots.setting=="function"&&a.createVNode("div",{class:"bk-tab-header-setting"},[this.$slots.setting()])])}}),d5=a.defineComponent({name:"Tab",components:{TabNav:nh},props:o5,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),l=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:p}=h;return(p||[]).forEach(w=>{let{type:y}=w;y=y.name||y,y==="TabPanel"&&w.component?m.push(w.component):(y===a.Fragment||y==="template")&&c(w,m)}),m},f=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],p=c(m);p.length!==l.value.length&&(l.value=p)}};return a.onMounted(()=>{f(),i.value=!0}),a.onUpdated(()=>{f()}),Te(U({},{tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,p){const w=l.value;if(p==="insert")if(h<m)w.splice(m+1,0,l[h]),w.splice(h,1);else if(h>m)w.splice(m,0,l[h]),w.splice(h+1,1);else return!1;else{const y=w[m];w[m]=w[h],w[h]=y}l.value=[...w],n("sort",h,m,p),n("sort-change",h,m,p)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}}),{isMounted:i,panels:l})},render(){var n,i;const e=()=>this.tabPosition==="top"?`bk-tab bk-tab--${this.tabPosition} bk-tab--${this.type} ${this.extCls}`:`bk-tab bk-tab--${this.tabPosition} ${this.extCls}`,t=()=>{const{panels:l,active:o,type:c,closable:f,addable:u,sortable:h,sortType:m,labelHeight:p,scrollStep:w,validateActive:y,changeOnHover:v,changeOnHoverDelay:L,tabPosition:x,tabAdd:k,tabChange:C,tabRemove:b,tabSort:I,tabDrag:N}=this,T={panels:l,active:o,type:c,closable:f,addable:u,sortable:h,sortType:m,labelHeight:p,scrollStep:w,validateActive:y,changeOnHover:v,changeOnHoverDelay:L,tabPosition:x,tabAdd:k,tabChange:C,tabRemove:b,tabSort:I,tabDrag:N};return!l||!Array.isArray(l)?null:a.createVNode(nh,T,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:"bk-tab-content"},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),f5=a.defineComponent({name:"TabPanel",props:u5,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;return a.withDirectives(a.createVNode("div",{ref:"content",class:"bk-tab-panel"},[t()]),[[a.vShow,e]])}});const ih=Bt(d5,{TabPanel:f5}),xi={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let ah=1;const rh=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const l=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:f=10}=n;xi[i].forEach(w=>{c+=(w.el.offsetHeight||0)+f}),ah+=1;const u=`message_${ah}`;n=Te(U({},n),{offsetX:o,offsetY:c,id:u});const h=document.createElement("div"),m=a.createVNode(e,n);m.props.onDestroy=w=>{h5(w,i,f,l),a.render(null,h)},a.render(m,h),xi[i].push(m);let p;m.props.getContainer&&va(m.props.getContainer)?p=m.props.getContainer:p=document.body,p.appendChild(h.firstElementChild)};function h5(e,t,n,i){i==null||i();const l=t.startsWith("top")?"top":"bottom";let o=-1;xi[t].forEach((h,m)=>{h.props.id===e&&(o=m)});const f=xi[t][o].el.offsetHeight,u=xi[t].length;for(let h=o;h<u;h++){const m=parseInt(xi[t][h].el.style[l],10)-f-n;xi[t][h].component.props.offsetY=m}xi[t].splice(o,1)}const g5={id:g.string.def(""),message:g.string.def(""),theme:g.theme(["primary","warning","success","error"]).def("primary"),delay:g.number.def(3e3),dismissable:g.bool.def(!0),offsetY:g.number.def(30),spacing:g.number.def(10),extCls:g.string.def(""),onClose:g.func,getContainer:g.instanceOf(HTMLElement)};var m5=a.defineComponent({name:"Message",props:g5,emits:["destroy"],setup(e,{emit:t}){const n=a.computed(()=>["bk-message",`bk-message-${e.theme}`,`${e.extCls}`]),i=Mn.getMessageNextIndex(),l=a.computed(()=>e.getContainer&&va(e.getContainer)),o=a.computed(()=>({top:`${e.offsetY}px`,zIndex:i,position:l.value?"absolute":"fixed"})),c=a.ref(!1);let f=null;const u=()=>{f=setTimeout(()=>{c.value=!1},e.delay)},h=m=>{m.preventDefault(),m.stopPropagation(),c.value=!1};return a.onMounted(()=>{e.delay&&u(),c.value=!0}),a.onUnmounted(()=>{clearTimeout(f)}),a.watch(c,()=>{c.value||t("destroy",e.id)}),{classNames:n,styles:o,visible:c,close:h}},render(){const e=()=>({primary:a.createVNode(Ts,null,null),warning:a.createVNode(Cr,null,null),success:a.createVNode(br,null,null),error:a.createVNode(cn,null,null)})[this.theme];return a.createVNode(a.Transition,{name:"bk-message-fade"},{default:()=>[a.withDirectives(a.createVNode("div",{class:this.classNames,style:this.styles},[a.createVNode("div",{class:"bk-message-content"},[a.createVNode("div",{class:"bk-message-icon"},[e()]),this.message]),this.dismissable&&a.createVNode(An,{class:"bk-message-close",onClick:this.close},null)]),[[a.vShow,this.visible]])]})}});const sh=e=>{rh(m5,e)},lh=e=>{const t=document.createElement("div"),n=a.ref(!1),i=a.shallowRef(e),l=a.defineComponent({name:"DialogConfirm",setup(f,{expose:u}){a.onMounted(()=>{(document.activeElement||document.body).blur(),i.value.isShow!==!1&&(n.value=!0)});const h=async()=>{var y,v;typeof((y=i.value)==null?void 0:y.onClosed)=="function"&&await((v=i.value)==null?void 0:v.onClosed()),n.value=!1},m=async()=>{var y,v;typeof((y=i.value)==null?void 0:y.onConfirm)=="function"&&await((v=i.value)==null?void 0:v.onConfirm()),n.value=!1};function p(y){i.value=y}u({update:p});const w=()=>{const y=[],v=[];if(i.value.subTitle)switch(typeof i.value.subTitle){case"string":y.push(i.value.subTitle);break;case"function":y.push(i.value.subTitle());break;default:y.push(i.value.subTitle);break}return y.length&&v.push(a.h("div",{class:"bk-info-sub-title",style:`text-Align:${i.value.contentAlign||"center"}`},y)),v};return()=>a.createVNode(Ef,Te(U({class:"bk-info-wrapper",headerAlign:"center",footerAlign:"center"},i.value),{isShow:n.value,onClosed:h,onConfirm:m}),w())}}),o=a.createApp(l).mount(t);return{show:()=>{n.value=!0},hide:()=>{n.value=!1},update:f=>{o.update(f)}}},p5={id:g.string.def(""),title:g.string.def(""),message:g.string.def(""),theme:g.theme(["primary","warning","success","error"]).def("primary"),position:g.position().def("top-right"),delay:g.number.def(5e3),dismissable:g.bool.def(!0),offsetX:g.number.def(100),offsetY:g.number.def(30),spacing:g.number.def(10),extCls:g.string.def(""),onClose:g.func};var b5=a.defineComponent({name:"Notify",props:p5,emits:["destroy"],setup(e,{emit:t}){const n=Mn.getMessageNextIndex(),i=a.computed(()=>e.position.indexOf("right")>1?"right":"left"),l=a.computed(()=>e.position.startsWith("top")?"top":"bottom"),o=a.computed(()=>({[i.value]:`${e.offsetX}px`,[l.value]:`${e.offsetY}px`,zIndex:n})),c=a.computed(()=>["bk-notify",`bk-notify-${e.theme}`,i.value]),f=a.ref(!1);let u=null;const h=()=>{u=setTimeout(()=>{f.value=!1},e.delay)},m=()=>{f.value=!1};return a.onMounted(()=>{e.delay&&h(),f.value=!0}),a.onUnmounted(()=>{clearTimeout(u)}),a.watch(f,()=>{f.value||t("destroy",e.id)}),{classNames:c,styles:o,visible:f,handleClose:m}},render(){const e=()=>({primary:a.createVNode(Ts,null,null),warning:a.createVNode(Cr,null,null),success:a.createVNode(br,null,null),error:a.createVNode(cn,null,null)})[this.theme];return a.createVNode(a.Transition,{name:"bk-notify-fade"},{default:()=>[a.withDirectives(a.createVNode("div",{class:this.classNames,style:this.styles},[a.createVNode("div",{class:"bk-notify-content"},[a.createVNode("div",{class:"bk-notify-icon"},[e()]),this.title?a.createVNode("div",{class:"bk-notify-content-header"},[this.title]):"",a.createVNode("div",{class:"bk-notify-content-text"},[this.message])]),this.dismissable&&a.createVNode(An,{class:"bk-notify-icon bk-notify-close",onClick:this.handleClose},null)]),[[a.vShow,this.visible]])]})}});const oh=e=>{rh(b5,e)},ch=Symbol("MENU_PROVIDER_KEY"),Oc=Symbol("MENU_PROVIDER_KEY_PATH"),y5=e=>{a.provide(ch,e)},C5=e=>{const{parentKeys:t,parentInfo:n}=Ec(),i=a.computed(()=>[...t.value,e]);a.provide(Oc,{parentInfo:{key:e,parentKey:n==null?void 0:n.key},parentKeys:i})},uh=()=>a.inject(ch),Ec=()=>{var n;const e=a.getCurrentInstance(),t=e.parent?e.parent.provides:(n=e.vnode.appContext)==null?void 0:n.provides;return t&&Oc in t?a.inject(Oc):{parentInfo:void 0,parentKeys:a.ref([])}},Ac=function(e){return(e||"").split(" ").filter(t=>!!t.trim())};function dh(e,t){if(!e||!t)return;const n=Ac(t);let i=e.getAttribute("class")||"";if(e.classList){e.classList.remove(...n);return}n.forEach(o=>{i=i.replace(` ${o} `," ")});const l=Ac(i).join(" ");e.setAttribute("class",l)}function fh(e,t){if(!e)return;let n=e.getAttribute("class")||"";const i=Ac(n),l=(t||"").split(" ").filter(o=>!i.includes(o)&&!!o.trim());e.classList?e.classList.add(...l):(n+=` ${l.join(" ")}`,e.setAttribute("class",n))}const M5=()=>({css:!0,onBeforeEnter:e=>{fh(e,"collapse-transition"),e.dataset||(e.dataset={}),e.style.height="0px",e.style.maxHeight="0px"},onEnter:e=>{e.dataset.oldOverflow=e.style.overflow,e.scrollHeight!==0?(e.style.height=`${e.scrollHeight}px`,e.style.maxHeight=`${e.scrollHeight}px`):(e.style.height="0px",e.style.maxHeight="0px"),e.style.overflow="hidden"},onAfterEnter:e=>{e.style.height="",e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow,dh(e,"collapse-transition")},onBeforeLeave:e=>{e.dataset||(e.dataset={}),e.dataset.oldOverflow=e.style.overflow,e.style.height=`${e.scrollHeight}px`,e.style.maxHeight=`${e.scrollHeight}px`,e.style.overflow="hidden"},onLeave:e=>{e.scrollHeight!==0&&(fh(e,"collapse-transition"),e.style.transitionProperty="height",e.style.height="0px",e.style.maxHeight="0px")},onAfterLeave:e=>{dh(e,"collapse-transition"),e.style.height="",e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow}}),w5={activeKey:String,collapse:Boolean,openedKeys:{type:Array},mode:{type:String,default:"vertical"},uniqueOpen:{type:Boolean,default:!0}};var v5=a.defineComponent({name:"Menu",props:w5,emits:["update:activeKey","update:openKeys","click","openChange"],setup(e,{slots:t,emit:n,expose:i}){const l=a.ref(""),o=a.ref([]),c=a.ref({}),f=a.computed(()=>e.mode),u=a.ref(e.collapse),h=a.ref([]);a.watchEffect(()=>{e.activeKey!==void 0&&(l.value=e.activeKey)}),a.watch(()=>e.collapse,()=>{u.value=e.collapse,console.info(e.collapse);const v=[...h.value],L=[...o.value];o.value=u.value?[]:v,h.value=u.value?L:[]},{immediate:!0}),a.watch(()=>e.openedKeys,(v=o.value)=>{o.value=v},{immediate:!0});const m=(v,L)=>{c.value=Te(U({},c.value),{[v]:L})},p=v=>{delete c.value[v],c.value=U({},c.value)},w=(v,L)=>{L?e.uniqueOpen?o.value=[v]:o.value.push(v):o.value=o.value.filter(x=>x!==v),n("openChange",L,c.value[v]),n("update:openKeys",[...o.value])},y=v=>{l.value=v,n("click",c.value[v]),n("update:activeKey",v,c.value[v])};return y5({activeKey:l,menuStore:c,registerMenuInfo:m,unregisterMenuInfo:p,mode:f.value,openedKeys:o,collapse:u,handleOpenChange:w,handleActiveChange:y}),i({activeKey:l,openedKeys:o,menuStore:c}),()=>{var v;return a.createVNode("div",{class:{"bk-menu":!0,"is-collapse":u.value}},[(v=t.default)==null?void 0:v.call(t)])}}}),I5=a.defineComponent({name:"MenuGroup",props:{name:{type:String,default:""}},setup(e,{slots:t}){return()=>{var n;return a.createVNode("div",{class:"bk-menu-group"},[a.createVNode("div",{class:"group-name"},[e.name]),a.createVNode("ul",{class:"group-wrap"},[(n=t.default)==null?void 0:n.call(t)])])}}}),N5=a.defineComponent({name:"MenuItem",props:{needIcon:{type:Boolean,default:!0}},emits:["click"],slots:["icon"],setup(e,{slots:t,emit:n}){var y,v;const{registerMenuInfo:i,unregisterMenuInfo:l,activeKey:o,handleActiveChange:c}=uh(),f=a.getCurrentInstance(),{parentInfo:u}=Ec(),h=((v=(y=f.vnode.key)==null?void 0:y.toString)==null?void 0:v.call(y))||String(f.uid),m=a.computed(()=>o.value===h),p=a.computed(()=>e.needIcon);i(h,{key:h,parentKey:u==null?void 0:u.key});const w=L=>{c(h),n("click",L)};return a.onBeforeUnmount(()=>l(h)),()=>{var L,x;return a.createVNode("li",{class:{"bk-menu-item":!0,"is-active":m.value},onClick:w},[p.value&&a.createVNode("span",{class:"item-icon"},[((L=t==null?void 0:t.icon)==null?void 0:L.call(t))||a.createVNode("i",{class:"default-icon"},null)]),a.createVNode("span",{class:"item-content"},[(x=t.default)==null?void 0:x.call(t)])])}}});const L5={title:{type:String,default:"title"}};var k5=a.defineComponent({name:"Submenu",props:L5,emits:["collapse"],slots:["icon"],setup(e,{slots:t,emit:n}){var k,C;const{registerMenuInfo:i,unregisterMenuInfo:l,openedKeys:o,handleOpenChange:c,collapse:f,activeKey:u,menuStore:h}=uh(),{parentInfo:m}=Ec(),p=a.getCurrentInstance(),w=((C=(k=p.vnode.key)==null?void 0:k.toString)==null?void 0:C.call(k))||String(p.uid),y=a.ref(M5()),v=a.computed(()=>o.value.includes(w)),L=a.computed(()=>{var I,N;const b=(N=(I=h.value)==null?void 0:I[u.value])==null?void 0:N.parentKey;return f.value&&b===w&&v});C5(w),i(w,{key:w,parentKey:m==null?void 0:m.key}),a.onBeforeUnmount(()=>l(w));const x=()=>{c(w,!v.value),n("collapse",!v.value,p)};return()=>{var b;return a.createVNode("li",{class:{"bk-menu-submenu":!0,"is-opened":v.value}},[a.createVNode("div",{class:{"submenu-header":!0,"is-collapse":L.value},onClick:x},[a.createVNode("span",{class:"submenu-header-icon"},[((b=t.icon)==null?void 0:b.call(t))||a.createVNode(Yo,{class:"menu-icon"},null)]),a.createVNode("span",{class:"submenu-header-content"},[e.title]),a.createVNode(Ms,{class:{"submenu-header-collapse":!0,"is-collapse":o.value.includes(w)}},null)]),a.createVNode(a.Transition,y.value,{default:()=>{var I;return[a.withDirectives(a.createVNode("ul",{class:"submenu-list"},[(I=t.default)==null?void 0:I.call(t)]),[[a.vShow,v.value]])]}})])}}});const hh=Bt(v5,{Item:N5,Submenu:k5,Group:I5}),T5={sideTitle:{type:String,default:""},navigationType:{type:String,default:"left-right"}};var gh=a.defineComponent({props:T5,slots:["side-icon"],setup(e,{slots:t}){return()=>{var n,i;return a.createVNode("div",{class:"bk-navigation-title",style:{borderBottomWidth:e.navigationType==="left-right"?"0":"1px"}},[((n=t.default)==null?void 0:n.call(t))||[a.createVNode("span",{class:"title-icon"},[((i=t["side-icon"])==null?void 0:i.call(t))||a.createVNode("i",{class:"bk-icon icon-rtx"},null)]),a.createVNode("span",{class:"title-desc"},[e.sideTitle])]])}}});const x5={navWidth:{type:[Number,String],default:60},hoverWidth:{type:[Number,String],default:260},showSideNavTitle:{type:Boolean,default:!0},sideTitle:{type:String,default:""},headerTitle:{type:String,default:""},hoverLeaveDelay:{type:Number,default:0},hoverEnterDelay:{type:Number,default:100},defaultOpen:Boolean,headHeight:{type:[Number,String],default:52},navigationType:{type:String,default:"left-right",validator(e){return["top-bottom","left-right"].includes(e)}},needMenu:{type:Boolean,default:!0}};var S5=a.defineComponent({name:"Navigation",props:x5,emits:["leave","toggle","hover","toggle-click"],slots:["header","menu","footer","side-icon","side-header"],setup(e,{emit:t}){const n=a.ref(e.headerTitle),i=a.reactive({click:!1,hover:!1,delay:!1,timer:null,enterTimer:null});e.defaultOpen&&(i.click=!i.click,i.hover=i.click,t("toggle",i.hover)),a.onBeforeUnmount(()=>{i.timer&&window.clearTimeout(i.timer)});const l=()=>{i.click||(i.enterTimer=setTimeout(()=>{i.hover=!0,i.enterTimer&&window.clearTimeout(i.enterTimer),i.timer&&window.clearTimeout(i.timer),t("hover",i.hover),t("toggle",i.hover)},e.hoverEnterDelay))},o=()=>{i.click||(i.enterTimer&&window.clearTimeout(i.enterTimer),i.timer=setTimeout(()=>{i.hover=!1,window.clearTimeout(i.timer),t("leave",i.hover),t("toggle",i.hover)},e.hoverLeaveDelay))},c=()=>{i.click=!i.click,i.hover=i.click,t("toggle",i.hover),t("toggle-click",i.hover)};return{defaultHeaderTitle:n,nav:i,onBeforeUnmount:a.onBeforeUnmount,handleMouseOver:l,handleMouseLeave:o,handleClick:c}},render(){var e,t,n,i,l,o,c,f,u,h,m,p;return a.createVNode("div",{class:"bk-navigation"},[this.navigationType==="top-bottom"&&a.createVNode("div",{class:"bk-navigation-header",style:{flexBasis:`${this.headHeight}px`}},[a.createVNode(gh,{sideTitle:this.sideTitle},{default:this.$slots["side-header"],"side-icon":this.$slots["side-header"]?void 0:this.$slots["side-icon"]}),a.createVNode("div",{class:"header-right"},[(t=(e=this.$slots).header)==null?void 0:t.call(e)])]),a.createVNode("div",{class:"bk-navigation-wrapper"},[this.needMenu&&a.createVNode("div",{class:"navigation-nav",style:{width:this.nav.click?`${this.hoverWidth}px`:`${this.navWidth}px`}},[a.createVNode("div",{class:"nav-slider",onMouseenter:this.handleMouseOver,onMouseleave:this.handleMouseLeave,style:{width:this.nav.hover?`${this.hoverWidth}px`:`${this.navWidth}px`,borderRight:this.navigationType!=="top-bottom"?"none":"1px solid #DCDEE5"}},[this.navigationType!=="top-bottom"&&this.showSideNavTitle&&a.createVNode(gh,{style:{flexBasis:`${this.headHeight}px`},sideTitle:this.sideTitle},{default:this.$slots["side-header"],"side-icon":this.$slots["side-header"]?void 0:this.$slots["side-icon"]}),a.createVNode("div",{class:"nav-slider-list",style:{height:`calc(100vh - ${+this.headHeight+56}px)`}},[(i=(n=this.$slots).menu)==null?void 0:i.call(n)]),a.createVNode("div",{class:"nav-slider-footer"},[a.createVNode("div",{class:{"is-left":this.navigationType!=="top-bottom","footer-icon":!0},onClick:this.handleClick},[a.createVNode(Ao,{class:"footer-icon-svg",style:{transform:this.nav.click?"rotate(180deg)":"rotate(0deg)"}},null)])])])]),a.createVNode("div",{class:"navigation-container",style:{maxWidth:this.needMenu?"calc(100vw - 60px)":"100vw"}},[this.navigationType!=="top-bottom"&&a.createVNode("div",{class:"container-header",style:{flexBasis:`${this.headHeight}px`}},[((o=(l=this.$slots).header)==null?void 0:o.call(l))||[a.createVNode("div",{class:"container-header-title"},[this.headerTitle]),a.createVNode("div",{class:"container-header-sets"},[(f=(c=this.$slots)["header-set"])==null?void 0:f.call(c)])]]),a.createVNode("div",{class:"container-content",style:{maxHeight:`calc(100vh - ${this.headHeight}px)`}},[(h=(u=this.$slots).default)==null?void 0:h.call(u),a.createVNode("div",{class:"container-footer"},[(p=(m=this.$slots).footer)==null?void 0:p.call(m)])])])])])}});const mh=He(S5),D5={placement:{type:String,default:"bottom-start",validator:e=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0?(console.error(`placement property is not valid: '${e}'`),!1):!0},className:{type:String},extPopoverCls:{type:String},appendToBody:{type:Boolean},triggerRef:{type:Object},onClick:Function};var Vc=a.defineComponent({props:D5,emits:["changeVisible"],setup(e,{emit:t}){let n=Object.create(null);const i=a.ref(null);a.onMounted(()=>{o()}),a.onBeforeUnmount(()=>{l()});const l=()=>{if(n&&Object.keys(n).length!==0){const u=n;u.isShow&&u.hide(),u.destroy(),n=null,t("changeVisible",!1)}},o=()=>{n&&Object.keys(n).length!==0?a.nextTick(()=>{n.update()}):a.nextTick(()=>{n=new af(e.triggerRef,i.value,{placement:e.placement,trigger:"manual",modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},{name:"offset",options:{offset:[0,4]}}]})})},c=a.computed(()=>{const u={};return e.appendToBody&&(u["z-index"]=1060+Mn.getModalNextIndex()),u}),f=a.reactive({styles:c});return Te(U({},a.toRefs(f)),{refContentRef:i,updateDropdown:o,destoryDropdown:l})},render(){var e,t,n;return a.createVNode("div",{ref:"refContentRef",class:["bk-date-picker-dropdown",this.className,this.extPopoverCls],style:this.styles,onClick:this.onClick},[(n=(t=(e=this.$slots).default)==null?void 0:t.call(e))!=null?n:""])}});const j5={showTime:{type:Boolean,required:!0},isTime:{type:Boolean,default:!1},timeDisabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0}};var z5=a.defineComponent({props:j5,emits:["pick-clear","pick-success","pick-toggle-time"],setup(e,{emit:t}){const n=a.computed(()=>({time:e.isTime?"\u9009\u62E9\u65E5\u671F":"\u9009\u62E9\u65F6\u95F4",clear:"\u6E05\u9664",ok:"\u786E\u5B9A"})),i=()=>{t("pick-clear")},l=()=>{t("pick-success")},o=()=>{e.timeDisabled||t("pick-toggle-time")},c=a.ref(null);return{labels:n,handleClear:i,handleSuccess:l,handleToggleTime:o,handleTab:u=>{const m=[...c.value.children][u.shiftKey?"shift":"pop"]();document.activeElement===m&&(u.preventDefault(),u.stopPropagation())}}},render(){return a.createVNode("div",{class:"bk-picker-confirm",ref:"elRef",onKeydown:this.handleTab},[this.showTime?a.createVNode("a",{href:"javascript: void(0);",class:"bk-picker-confirm-time",onClick:this.handleToggleTime},[this.labels.time]):"",this.clearable?a.createVNode("a",{href:"javascript: void(0);",onClick:this.handleClear,onKeydown:this.handleClear},[this.labels.clear]):"",a.createVNode("a",{href:"javascript: void(0);",class:"confirm",onClick:this.handleSuccess,onKeydown_enter:this.handleSuccess},[this.labels.ok])])}}),ph=1e3*60*60*24;function bh(e,t){return new Date(e,t+1,0).getDate()}function yh(e,t,n){return t===0&&n>50?e-1:t===11&&n<10?e+1:e}function Ch(e,t,n,i){t>11&&(t=0,e++);var l=new Date(e,t,n);i&&l.setDate(l.getDate()+4-(l.getDay()||7));var o=i?l.getFullYear():e,c=new Date(o,0,1),f=1+Math.round((l-c)/ph);i||(f+=c.getDay());var u=Math.ceil(f/7);if(!i){var h=new Date(e,t,n),m=new Date(e+1,0,1),p=m.getDay();h.getTime()>=m.getTime()-ph*p&&(u=1)}return u}function P5(e,t,n){for(var i=this.lang||"en",l=this.onlyDays,o=typeof this.weekStart=="undefined"?1:this.weekStart,c=o===1,f=[],u=new Date(e,t,1),h=u.getDay()||(c?7:0),m=o-h,p=Ch(e,t,1,c),w=bh(e,t),y=bh(e,t-1),v,L,x,k=yh(e,t,p),C={month:t,year:e,daysInMonth:w},b=0;b<7;b++){x=m;for(var I=0;I<8;I++){b>0&&I>0&&m++,m>w||m<1?(L=m>w?m-w:y+m,v=m>w?t+1:t-1):(L=m,v=t);var N=function(){return I===0?"weekLabel":b===0?"dayLabel":m<1?"prevMonth":m>w?"nextMonth":"monthDay"}(),T=x!==m&&b>0,A={desc:T?L:p,week:p,type:N,format:c?"ISO 8601":"US",date:T?new Date(Date.UTC(e,v,L)):!1,year:k,index:f.length};n&&(typeof n=="function"?A=n.call(C,A,i):n.forEach(function(P){A=P.call(C,A,i)})),l&&T?f.push(A):l||f.push(A)}b>0&&(p=Ch(e,v,L+1,c)),k=yh(e,t,p)}return C.cells=f,C}var O5=function(e){return P5.bind(e)},E5={weekPlaceholder:"",columnNames:{en:{0:"w",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday",7:"sunday"},sv:{0:"v",1:"m\xE5ndag",2:"tisdag",3:"onsdag",4:"torsdag",5:"fredag",6:"l\xF6rdag",7:"s\xF6ndag"},pt:{0:"s",1:"segunda",2:"ter\xE7a",3:"quarta",4:"quinta",5:"sexta",6:"s\xE1bado",7:"domingo"}},monthNames:{en:["January","February","March","April","May","June","July","August","September","October","November","December"],sv:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],pt:["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},classes:{dayLabel:"day-of-week",weekLabel:"week-number",prevMonth:"inactive",nextMonth:"inactive",monthDay:"day-in-month"}},Qn=E5;function A5(e){return e==null?!1:e.constructor===Array||e.constructor===Object}function Mh(e,t){for(var n in e)t[n]?A5(e[n])&&Mh(e[n],t[n]):t[n]=e[n]}function wh(e,t){var n=[Qn.classes[e.type]];return e.class?e.class=(typeof e.class=="string"?[e.class]:e.class).concat(n):e.class=n,e.type.indexOf("Label")>0&&(e.index==0&&Qn.weekPlaceholder?e.desc=Qn.weekPlaceholder:e.index<8?e.desc=Qn.columnNames[t][e.index]:e.index%8==0&&(e.desc=e.week)),e.date&&(e.monthName=Qn.monthNames[t][e.date.getMonth()]),this.monthName||(this.monthName=Qn.monthNames[t][this.month]),this.labels||(this.labels={monthNames:Qn.monthNames[t],columnNames:Qn.columnNames[t],classes:Qn.classes}),e}wh.setLabels=function(e){Mh(e,Qn)};var V5=wh,J5={Generator:O5,addLabels:V5};function un(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ot(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Nn(e){Ot(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function Q5(e,t){Ot(2,arguments);var n=Nn(e).getTime(),i=un(t);return new Date(n+i)}function R5(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function W5(e){return Ot(1,arguments),e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function H5(e){if(Ot(1,arguments),!W5(e)&&typeof e!="number")return!1;var t=Nn(e);return!isNaN(Number(t))}var B5={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},_5=function(e,t,n){var i,l=B5[e];return typeof l=="string"?i=l:t===1?i=l.one:i=l.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},Z5=_5;function Jc(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,i=e.formats[n]||e.formats[e.defaultWidth];return i}}var G5={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},F5={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Y5={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U5={date:Jc({formats:G5,defaultWidth:"full"}),time:Jc({formats:F5,defaultWidth:"full"}),dateTime:Jc({formats:Y5,defaultWidth:"full"})},$5=U5,X5={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},K5=function(e,t,n,i){return X5[e]},q5=K5;function jr(e){return function(t,n){var i=n||{},l=i.context?String(i.context):"standalone",o;if(l==="formatting"&&e.formattingValues){var c=e.defaultFormattingWidth||e.defaultWidth,f=i.width?String(i.width):c;o=e.formattingValues[f]||e.formattingValues[c]}else{var u=e.defaultWidth,h=i.width?String(i.width):e.defaultWidth;o=e.values[h]||e.values[u]}var m=e.argumentCallback?e.argumentCallback(t):t;return o[m]}}var eb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ib={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ab={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},rb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sb=function(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},lb={ordinalNumber:sb,era:jr({values:eb,defaultWidth:"wide"}),quarter:jr({values:tb,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:jr({values:nb,defaultWidth:"wide"}),day:jr({values:ib,defaultWidth:"wide"}),dayPeriod:jr({values:ab,defaultWidth:"wide",formattingValues:rb,defaultFormattingWidth:"wide"})},ob=lb;function zr(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,l=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(l);if(!o)return null;var c=o[0],f=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(f)?ub(f,function(p){return p.test(c)}):cb(f,function(p){return p.test(c)}),h;h=e.valueCallback?e.valueCallback(u):u,h=n.valueCallback?n.valueCallback(h):h;var m=t.slice(c.length);return{value:h,rest:m}}}function cb(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function ub(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function db(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(e.matchPattern);if(!i)return null;var l=i[0],o=t.match(e.parsePattern);if(!o)return null;var c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;var f=t.slice(l.length);return{value:c,rest:f}}}var fb=/^(\d+)(th|st|nd|rd)?/i,hb=/\d+/i,gb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},mb={any:[/^b/i,/^(a|c)/i]},pb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bb={any:[/1/i,/2/i,/3/i,/4/i]},yb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Cb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Mb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},wb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ib={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nb={ordinalNumber:db({matchPattern:fb,parsePattern:hb,valueCallback:function(e){return parseInt(e,10)}}),era:zr({matchPatterns:gb,defaultMatchWidth:"wide",parsePatterns:mb,defaultParseWidth:"any"}),quarter:zr({matchPatterns:pb,defaultMatchWidth:"wide",parsePatterns:bb,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:zr({matchPatterns:yb,defaultMatchWidth:"wide",parsePatterns:Cb,defaultParseWidth:"any"}),day:zr({matchPatterns:Mb,defaultMatchWidth:"wide",parsePatterns:wb,defaultParseWidth:"any"}),dayPeriod:zr({matchPatterns:vb,defaultMatchWidth:"any",parsePatterns:Ib,defaultParseWidth:"any"})},Lb=Nb,kb={code:"en-US",formatDistance:Z5,formatLong:$5,formatRelative:q5,localize:ob,match:Lb,options:{weekStartsOn:0,firstWeekContainsDate:1}},Tb=kb;function xb(e,t){Ot(2,arguments);var n=un(t);return Q5(e,-n)}var Sb=864e5;function Db(e){Ot(1,arguments);var t=Nn(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),l=n-i;return Math.floor(l/Sb)+1}function qs(e){Ot(1,arguments);var t=1,n=Nn(e),i=n.getUTCDay(),l=(i<t?7:0)+i-t;return n.setUTCDate(n.getUTCDate()-l),n.setUTCHours(0,0,0,0),n}function vh(e){Ot(1,arguments);var t=Nn(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var l=qs(i),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var c=qs(o);return t.getTime()>=l.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function jb(e){Ot(1,arguments);var t=vh(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var i=qs(n);return i}var zb=6048e5;function Pb(e){Ot(1,arguments);var t=Nn(e),n=qs(t).getTime()-jb(t).getTime();return Math.round(n/zb)+1}function el(e,t){Ot(1,arguments);var n=t||{},i=n.locale,l=i&&i.options&&i.options.weekStartsOn,o=l==null?0:un(l),c=n.weekStartsOn==null?o:un(n.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Nn(e),u=f.getUTCDay(),h=(u<c?7:0)+u-c;return f.setUTCDate(f.getUTCDate()-h),f.setUTCHours(0,0,0,0),f}function Ih(e,t){Ot(1,arguments);var n=Nn(e),i=n.getUTCFullYear(),l=t||{},o=l.locale,c=o&&o.options&&o.options.firstWeekContainsDate,f=c==null?1:un(c),u=l.firstWeekContainsDate==null?f:un(l.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(i+1,0,u),h.setUTCHours(0,0,0,0);var m=el(h,t),p=new Date(0);p.setUTCFullYear(i,0,u),p.setUTCHours(0,0,0,0);var w=el(p,t);return n.getTime()>=m.getTime()?i+1:n.getTime()>=w.getTime()?i:i-1}function Ob(e,t){Ot(1,arguments);var n=t||{},i=n.locale,l=i&&i.options&&i.options.firstWeekContainsDate,o=l==null?1:un(l),c=n.firstWeekContainsDate==null?o:un(n.firstWeekContainsDate),f=Ih(e,t),u=new Date(0);u.setUTCFullYear(f,0,c),u.setUTCHours(0,0,0,0);var h=el(u,t);return h}var Eb=6048e5;function Ab(e,t){Ot(1,arguments);var n=Nn(e),i=el(n,t).getTime()-Ob(n,t).getTime();return Math.round(i/Eb)+1}function nt(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}var Vb={y:function(e,t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return nt(t==="yy"?i%100:i,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):nt(n+1,2)},d:function(e,t){return nt(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return nt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return nt(e.getUTCHours(),t.length)},m:function(e,t){return nt(e.getUTCMinutes(),t.length)},s:function(e,t){return nt(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,i=e.getUTCMilliseconds(),l=Math.floor(i*Math.pow(10,n-3));return nt(l,t.length)}},Si=Vb,Pa={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Jb={G:function(e,t,n){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var i=e.getUTCFullYear(),l=i>0?i:1-i;return n.ordinalNumber(l,{unit:"year"})}return Si.y(e,t)},Y:function(e,t,n,i){var l=Ih(e,i),o=l>0?l:1-l;if(t==="YY"){var c=o%100;return nt(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):nt(o,t.length)},R:function(e,t){var n=vh(e);return nt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return nt(n,t.length)},Q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return nt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return nt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Si.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return nt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var l=Ab(e,i);return t==="wo"?n.ordinalNumber(l,{unit:"week"}):nt(l,t.length)},I:function(e,t,n){var i=Pb(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):nt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Si.d(e,t)},D:function(e,t,n){var i=Db(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):nt(i,t.length)},E:function(e,t,n){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var l=e.getUTCDay(),o=(l-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return nt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var l=e.getUTCDay(),o=(l-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return nt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getUTCDay(),l=i===0?7:i;switch(t){case"i":return String(l);case"ii":return nt(l,t.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getUTCHours(),l=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i=e.getUTCHours(),l;switch(i===12?l=Pa.noon:i===0?l=Pa.midnight:l=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i=e.getUTCHours(),l;switch(i>=17?l=Pa.evening:i>=12?l=Pa.afternoon:i>=4?l=Pa.morning:l=Pa.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Si.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Si.H(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):nt(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):nt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Si.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Si.s(e,t)},S:function(e,t){return Si.S(e,t)},X:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return Lh(o);case"XXXX":case"XX":return ea(o);case"XXXXX":case"XXX":default:return ea(o,":")}},x:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();switch(t){case"x":return Lh(o);case"xxxx":case"xx":return ea(o);case"xxxxx":case"xxx":default:return ea(o,":")}},O:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nh(o,":");case"OOOO":default:return"GMT"+ea(o,":")}},z:function(e,t,n,i){var l=i._originalDate||e,o=l.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nh(o,":");case"zzzz":default:return"GMT"+ea(o,":")}},t:function(e,t,n,i){var l=i._originalDate||e,o=Math.floor(l.getTime()/1e3);return nt(o,t.length)},T:function(e,t,n,i){var l=i._originalDate||e,o=l.getTime();return nt(o,t.length)}};function Nh(e,t){var n=e>0?"-":"+",i=Math.abs(e),l=Math.floor(i/60),o=i%60;if(o===0)return n+String(l);var c=t||"";return n+String(l)+c+nt(o,2)}function Lh(e,t){if(e%60===0){var n=e>0?"-":"+";return n+nt(Math.abs(e)/60,2)}return ea(e,t)}function ea(e,t){var n=t||"",i=e>0?"-":"+",l=Math.abs(e),o=nt(Math.floor(l/60),2),c=nt(l%60,2);return i+o+n+c}var Qb=Jb;function kh(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Th(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}function Rb(e,t){var n=e.match(/(P+)(p+)?/)||[],i=n[1],l=n[2];if(!l)return kh(e,t);var o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",kh(i,t)).replace("{{time}}",Th(l,t))}var Wb={p:Th,P:Rb},Hb=Wb,Bb=["D","DD"],_b=["YY","YYYY"];function Zb(e){return Bb.indexOf(e)!==-1}function Gb(e){return _b.indexOf(e)!==-1}function xh(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Fb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ub=/^'([^]*?)'?$/,$b=/''/g,Xb=/[a-zA-Z]/;function Kb(e,t,n){Ot(2,arguments);var i=String(t),l=n||{},o=l.locale||Tb,c=o.options&&o.options.firstWeekContainsDate,f=c==null?1:un(c),u=l.firstWeekContainsDate==null?f:un(l.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=o.options&&o.options.weekStartsOn,m=h==null?0:un(h),p=l.weekStartsOn==null?m:un(l.weekStartsOn);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var w=Nn(e);if(!H5(w))throw new RangeError("Invalid time value");var y=R5(w),v=xb(w,y),L={firstWeekContainsDate:u,weekStartsOn:p,locale:o,_originalDate:w},x=i.match(Yb).map(function(k){var C=k[0];if(C==="p"||C==="P"){var b=Hb[C];return b(k,o.formatLong,L)}return k}).join("").match(Fb).map(function(k){if(k==="''")return"'";var C=k[0];if(C==="'")return qb(k);var b=Qb[C];if(b)return!l.useAdditionalWeekYearTokens&&Gb(k)&&xh(k,t,e),!l.useAdditionalDayOfYearTokens&&Zb(k)&&xh(k,t,e),b(v,k,o.localize,L);if(C.match(Xb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return k}).join("");return x}function qb(e){return e.match(Ub)[1].replace($b,"'")}const Nt={},Sh=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ta=/\d\d?/,ey=/\d{3}/,ty=/\d{4}/,tl=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Dh=function(){};function jh(e,t){const n=[];for(let i=0,l=e.length;i<l;i++)n.push(e[i].substr(0,t));return n}function zh(e){return(t,n,i)=>{const l=i[e].indexOf(n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());~l&&(t.month=l)}}function Rn(e,t=2){let n=String(e);for(;n.length<t;)n=`0${n}`;return n}const Ph=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oh=["January","February","March","April","May","June","July","August","September","October","November","December"],ny=jh(Oh,3),iy=jh(Ph,3);Nt.i18n={dayNamesShort:iy,dayNames:Ph,monthNamesShort:ny,monthNames:Oh,amPm:["am","pm"],DoFn(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10)*e%10]}};const Eh={D(e){return e.getDay()},DD(e){return Rn(e.getDay())},Do(e,t){return t.DoFn(e.getDate())},d(e){return e.getDate()},dd(e){return Rn(e.getDate())},ddd(e,t){return t.dayNamesShort[e.getDay()]},dddd(e,t){return t.dayNames[e.getDay()]},M(e){return e.getMonth()+1},MM(e){return Rn(e.getMonth()+1)},MMM(e,t){return t.monthNamesShort[e.getMonth()]},MMMM(e,t){return t.monthNames[e.getMonth()]},yy(e){return String(e.getFullYear()).substr(2)},yyyy(e){return e.getFullYear()},h(e){return e.getHours()%12||12},hh(e){return Rn(e.getHours()%12||12)},H(e){return e.getHours()},HH(e){return Rn(e.getHours())},m(e){return e.getMinutes()},mm(e){return Rn(e.getMinutes())},s(e){return e.getSeconds()},ss(e){return Rn(e.getSeconds())},S(e){return Math.round(e.getMilliseconds()/100)},SS(e){return Rn(Math.round(e.getMilliseconds()/10),2)},SSS(e){return Rn(e.getMilliseconds(),3)},a(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ(e){const t=e.getTimezoneOffset();return(t>0?"-":"+")+Rn(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)}},ft={d:[ta,(e,t)=>{e.day=t}],M:[ta,(e,t)=>{e.month=t-1}],yy:[ta,(e,t)=>{const i=+`${new Date().getFullYear()}`.substr(0,2);e.year=`${t>68?i-1:i}${t}`}],h:[ta,(e,t)=>{e.hour=t}],m:[ta,(e,t)=>{e.minute=t}],s:[ta,(e,t)=>{e.second=t}],yyyy:[ty,(e,t)=>{e.year=t}],S:[/\d/,(e,t)=>{e.millisecond=t*100}],SS:[/\d{2}/,(e,t)=>{e.millisecond=t*10}],SSS:[ey,(e,t)=>{e.millisecond=t}],D:[ta,Dh],ddd:[tl,Dh],MMM:[tl,zh("monthNamesShort")],MMMM:[tl,zh("monthNames")],a:[tl,(e,t,n)=>{const i=t.toLowerCase();i===n.amPm[0]?e.isPm=!1:i===n.amPm[1]&&(e.isPm=!0)}],ZZ:[/[\\+\\-]\d\d:?\d\d/,(e,t)=>{const n=`${t}`.match(/([\\+\\-]|\d\d)/gi);let i;n&&(i=+(n[1]*60)+parseInt(n[2],10),e.timezoneOffset=n[0]==="+"?i:-i)}]};ft.DD=ft.D,ft.dddd=ft.ddd,ft.Do=ft.dd=ft.d,ft.mm=ft.m,ft.hh=ft.H=ft.HH=ft.h,ft.MM=ft.M,ft.ss=ft.s,ft.A=ft.a,Nt.masks={default:"ddd MMM dd yyyy HH:mm:ss",shortDate:"M/D/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Nt.format=(e,t,n)=>{const i=n||Nt.i18n;if(typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");return t=Nt.masks[t]||t||Nt.masks.default,t.replace(Sh,l=>l in Eh?Eh[l](e,i):l.slice(1,l.length-1))},Nt.parse=(e,t,n)=>{const i=n||Nt.i18n;if(typeof t!="string")throw new Error("Invalid format in fecha.parse");if(t=Nt.masks[t]||t,e.length>1e3)return!1;let l=!0;const o={};if(t.replace(Sh,u=>{if(ft[u]){const h=ft[u],m=e.search(h[0]);~m?e.replace(h[0],p=>(h[1](o,p,i),e=e.substr(m+p.length),p)):l=!1}return ft[u]?"":u.slice(1,u.length-1)}),!l)return!1;const c=new Date;o.isPm===!0&&o.hour!==null&&+o.hour!=12?o.hour=+o.hour+12:o.isPm===!1&&+o.hour==12&&(o.hour=0);let f;return o.timezoneOffset!==null&&o.timezoneOffset!==void 0?(o.minute=+(o.minute||0)-+o.timezoneOffset,f=new Date(Date.UTC(o.year||c.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0))):f=new Date(o.year||c.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0),f};const Qc=" - ",ri=(e,t)=>{const n=Nn(new Date(e));return!n||isNaN(n.getTime())?"":Kb(n,t||"yyyy-MM-dd")},Rc=(e,t)=>{if(Array.isArray(e)&&e.length===2){const n=e[0],i=e[1];if(n&&i)return ri(n,t)+Qc+ri(i,t)}else if(!Array.isArray(e)&&e instanceof Date)return ri(e,t);return""},Wc=(e,t)=>{const n=Array.isArray(e)?e:e.split(Qc);if(n.length===2){const i=n[0],l=n[1];return[i instanceof Date?i:Nt.parse(i,t||"yyyy-MM-dd"),l instanceof Date?l:Nt.parse(l,t||"yyyy-MM-dd")]}return[]},Oa={default:{formatter(e){return e?`${e}`:""},parser(e){return e===void 0||e===""?null:e}},date:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},datetime:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},daterange:{formatter:Rc,parser:Wc},datetimerange:{formatter:Rc,parser:Wc},timerange:{formatter:Rc,parser:Wc},time:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},month:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},year:{formatter:(e,t)=>ri(e,t),parser:(e,t)=>Nt.parse(e,t||"yyyy-MM-dd")},multiple:{formatter(e,t){return e.filter(Boolean).map(n=>ri(n,t)).join(",")},parser(e,t){return(typeof e=="string"?e.split(","):e).map(i=>{if(i instanceof Date)return i;let l=i;return typeof i=="string"?l=i.trim():typeof i!="number"&&!i&&(l=""),Nt.parse(l,t||"yyyy-MM-dd")})}},number:{formatter(e){return e?`${e}`:""},parser(e){const t=Number(e);return isNaN(e)?null:t}}},Hc=()=>{const e=new Date;return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e},Ah=e=>e.every(t=>!t||typeof t=="string"&&t.trim()===""),nl=e=>e?[e.getHours(),e.getMinutes(),e.getSeconds()]:[0,0,0],Vh={date:"yyyy-MM-dd",month:"yyyy-MM",year:"yyyy",datetime:"yyyy-MM-dd HH:mm:ss",time:"HH:mm:ss",timerange:"HH:mm:ss",daterange:"yyyy-MM-dd",datetimerange:"yyyy-MM-dd HH:mm:ss"},Di=(e,t,n,i)=>{const l=t.includes("range"),{parser:o}=Oa[t]||Oa.default,c=i||Vh[t],f=Oa.multiple.parser;let u=e;if(e&&t==="time"&&!(e instanceof Date))u=o(e,c);else if(n&&e)u=f(e,c);else if(l)if(!e)u=[null,null];else if(typeof e=="string")u=o(e,c);else if(t==="timerange")u=o(e,c).map(h=>h||"");else{const[h,m]=e;h instanceof Date&&m instanceof Date?u=e.map(p=>new Date(p)):typeof h=="string"&&typeof m=="string"?u=o(e.join(Qc),c):(!h||!m)&&(u=[null,null])}else typeof e=="string"&&t.indexOf("time")!==0&&(u=o(e,c)||null);return l||n?u||[]:[u]},Wn=(e,t,n,i)=>{const l=Vh[t];if(n){const{formatter:c}=Oa.multiple;return c(e,i||l)}const{formatter:o}=Oa[t]||Oa.default;return o(e,i||l)},Jh=Symbol("date-picker"),Qh=Symbol("time-picker");function Rh(e,t){return e.$children.reduce((n,i)=>{i.$options.name===t&&n.push(i);const l=Rh(i,t);return n.concat(l)},[])}function dn(e,t=""){return["bk-picker-panel-icon-btn",`bk-date-picker-${e}-btn`,`bk-date-picker-${e}-btn-arrow${t}`]}const ay=(e,t)=>new Date(e,t+1,0).getDate(),Wh=(e,t)=>{const n=new Date(e),i=n.getMonth()+t,l=ay(n.getFullYear(),i);return l<n.getDate()&&n.setDate(l),n.setMonth(i),n},Hh=(()=>{const e={yyyy:n=>n.getFullYear(),m:n=>n.getMonth()+1,mm:n=>`0${n.getMonth()+1}`.slice(-2),mmm:(n,i)=>n.toLocaleDateString(i,{month:"long"}).slice(0,3),Mmm:(n,i)=>{const l=n.toLocaleDateString(i,{month:"long"});return(l[0].toUpperCase()+l.slice(1).toLowerCase()).slice(0,3)},mmmm:(n,i)=>n.toLocaleDateString(i,{month:"long"}),Mmmm:(n,i)=>{const l=n.toLocaleDateString(i,{month:"long"});return l[0].toUpperCase()+l.slice(1).toLowerCase()}},t=new RegExp(["yyyy","Mmmm","mmmm","Mmm","mmm","mm","m"].join("|"),"g");return(n,i,l)=>{const o=/(\[[^\]]+\])([^\\[\]]+)(\[[^\]]+\])/,c=i.match(o).slice(1),f=c[1],u=[c[0],c[2]].map(h=>({label:h.replace(/\[[^\]]+\]/,p=>p.slice(1,-1).replace(t,w=>e[w](l,n))),type:h.indexOf("yy")!==-1?"year":"month"}));return{separator:f,labels:u}}})(),na=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()},ry=(e,t,n)=>{if(!t||!n)return!1;const[i,l]=[t,n].sort();return e>=i&&e<=l};function sy(e){return e.toString()[0].toUpperCase()+e.toString().slice(1)}const ly=(e,...t)=>{const n=new Date(e.getTime());return n.setHours(t[0]),n.setMinutes(t[1]),n.setSeconds(t[2]),n},oy={tableDate:{type:Date,required:!0},disableDate:Function,selectionMode:{type:String,required:!0},modelValue:{type:[Date,String,Number,Array]},rangeState:{type:Object,default:()=>({from:null,to:null,selecting:!1})},focusedDate:{type:Date,required:!0}};var Bc=a.defineComponent({name:"DateTable",props:oy,emits:["pick","pick-click","changeRange"],setup(e,{emit:t}){const n=a.computed(()=>new J5.Generator({onlyDays:!0,weekStart:0})),i=a.computed(()=>{const h=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"];return h.splice(0,7-0).concat(h.splice(0,0))}),l=a.computed(()=>e.selectionMode==="range"&&e.rangeState.selecting?[e.rangeState.from]:e.modelValue),o=a.computed(()=>{const h=e.tableDate.getFullYear(),m=e.tableDate.getMonth(),p=na(new Date),w=l.value.filter(Boolean).map(na),[y,v]=l.value.map(na),L=e.rangeState.from&&na(e.rangeState.from),x=e.rangeState.to&&na(e.rangeState.to),k=e.selectionMode==="range",C=typeof e.disableDate=="function"&&e.disableDate;return n.value(h,m,b=>{b.date instanceof Date&&b.date.setTime(b.date.getTime()+b.date.getTimezoneOffset()*6e4);const I=b.date&&na(b.date),N=b.date&&m===b.date.getMonth();return Te(U({},b),{type:I===p?"today":b.type,selected:N&&w.includes(I),disabled:b.date&&C&&C(new Date(I)),range:N&&k&&ry(I,L,x),start:N&&k&&I===y,end:N&&k&&I===v})}).cells.slice(0)});return{headerDays:i,cells:o,getCellCls:h=>["bk-date-picker-cells-cell",{["bk-date-picker-cells-cell-selected"]:h.selected||h.start||h.end,["bk-date-picker-cells-cell-disabled"]:h.disabled,["bk-date-picker-cells-cell-today"]:h.type==="today",["bk-date-picker-cells-cell-prev-month"]:h.type==="prevMonth",["bk-date-picker-cells-cell-next-month"]:h.type==="nextMonth",["bk-date-picker-cells-cell-week-label"]:h.type==="weekLabel",["bk-date-picker-cells-cell-range"]:h.range&&!h.start&&!h.end}],handleClick:h=>{if(h.disabled||h.type==="weekLabel")return;const m=new Date(na(h.date));t("pick",m),t("pick-click")},handleMouseMove:h=>{if(!e.rangeState.selecting||h.disabled)return;const m=h.date;t("changeRange",m)}}},render(){return a.createVNode("div",{class:"bk-date-picker-cells"},[a.createVNode("div",{class:"bk-date-picker-cells-header"},[this.headerDays.map(e=>a.createVNode("span",null,[e]))]),this.cells.map(e=>a.createVNode("span",{class:this.getCellCls(e),onClick:()=>this.handleClick(e),onMouseenter:()=>this.handleMouseMove(e)},[a.createVNode("em",null,[e.desc])]))])}});const _c={type:{type:String,default:"date",validator(e){return["year","month","date","daterange","datetime","datetimerange","time","timerange"].indexOf(e)<0?(console.error(`type property is not valid: '${e}'`),!1):!0}},extPopoverCls:{type:String,default:""},format:String,readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},open:{type:Boolean,default:null},multiple:{type:Boolean,default:!1},timePickerOptions:{type:Object,default:()=>({})},splitPanels:{type:Boolean,default:!0},startDate:Date,placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start",validator:e=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0?(console.error(`placement property is not valid: '${e}'`),!1):!0},transfer:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},shortcuts:{type:Array,default:()=>[]},shortcutClose:{type:Boolean,default:!1},modelValue:{type:[Date,String,Number,Array]},value:{type:[Date,String,Number,Array]},options:{type:Object,default:()=>({})},fontSize:{type:String,default:"normal"},upToNow:{type:Boolean,default:!1},useShortcutText:{type:Boolean,default:!1},shortcutSelectedIndex:{type:Number,default:-1},headerSlotCls:{type:String,default:""},footerSlotCls:{type:String,default:""},allowCrossDay:{type:Boolean,default:!1},behavior:{type:String,default:"normal",validator(e){return["simplicity","normal"].indexOf(e)>-1}},disableDate:Function,withValidate:{type:Boolean,default:!0}},Zc={disabledHours:{type:Array,default:()=>[]},disabledMinutes:{type:Array,default:()=>[]},disabledSeconds:{type:Array,default:()=>[]},hideDisabledOptions:{type:Boolean,default:!1},width:{type:Number,default:261},enterMode:{type:Boolean,default:!0}},cy={type:{type:String,default:"time",validator(e){return["time","timerange"].indexOf(e)<0?(console.error(`type property is not valid: '${e}'`),!1):!0}},allowCrossDay:{type:Boolean,default:!1}},uy={hours:{type:[Number,String],default:NaN},minutes:{type:[Number,String],default:NaN},seconds:{type:[Number,String],default:NaN},showSeconds:{type:Boolean,default:!0},steps:{type:Array,default:()=>[]}},Bh=["hours","minutes","seconds"];var dy=a.defineComponent({name:"TimeSpinner",props:U(U({},uy),Zc),emits:["change","pick-click"],setup(e,{emit:t}){const n=a.reactive({spinerSteps:[1,1,1].map((T,A)=>Math.abs(e.steps[A])||T),compiled:!1,focusedColumn:-1,focusedTime:[0,0,0]}),i=a.computed(()=>{const T=[],A=n.spinerSteps[0],P=n.focusedColumn===0&&n.focusedTime[0],J={text:0,selected:!1,disabled:!1,hide:!1};for(let z=0;z<24;z+=A){const E=JSON.parse(JSON.stringify(J));E.text=z,E.focused=z===P,e.disabledHours.length&&e.disabledHours.indexOf(z)>-1&&(E.disabled=!0,e.hideDisabledOptions&&(E.hide=!0)),e.hours===z&&(E.selected=!0),T.push(E)}return T}),l=a.computed(()=>{const T=[],A=n.spinerSteps[1],P=n.focusedColumn===1&&n.focusedTime[1],J={text:0,selected:!1,disabled:!1,hide:!1};for(let z=0;z<60;z+=A){const E=JSON.parse(JSON.stringify(J));E.text=z,E.focused=z===P,e.disabledMinutes.length&&e.disabledMinutes.indexOf(z)>-1&&(E.disabled=!0,e.hideDisabledOptions&&(E.hide=!0)),e.minutes===z&&(E.selected=!0),T.push(E)}return T}),o=a.computed(()=>{const T=[],A=n.spinerSteps[2],P=n.focusedColumn===2&&n.focusedTime[2],J={text:0,selected:!1,disabled:!1,hide:!1};for(let z=0;z<60;z+=A){const E=JSON.parse(JSON.stringify(J));E.text=z,E.focused=z===P,e.disabledSeconds.length&&e.disabledSeconds.indexOf(z)>-1&&(E.disabled=!0,e.hideDisabledOptions&&(E.hide=!0)),e.seconds===z&&(E.selected=!0),T.push(E)}return T}),c=a.computed(()=>({width:e.showSeconds?"33.33%":"50%"}));a.watch(()=>e.hours,T=>{!n.compiled||L("hours",i.value.findIndex(A=>A.text===T))}),a.watch(()=>e.minutes,T=>{!n.compiled||L("minutes",l.value.findIndex(A=>A.text===T))}),a.watch(()=>e.seconds,T=>{!n.compiled||L("seconds",l.value.findIndex(A=>A.text===T))}),a.watch(()=>n.focusedTime,(T,A)=>{Bh.forEach((P,J)=>{if(T[J]===A[J]||typeof T[J]=="undefined")return;const z=this[`${P}List`].findIndex(E=>E.text===T[J]);L(P,z)})}),a.onMounted(()=>{a.nextTick(()=>{n.compiled=!0,h()})});function f(T){let A;return T==="hours"?A=b:T==="minutes"?A=I:A=N,A.value}function u(T){return["bk-time-picker-cells-cell",{["bk-time-picker-cells-cell-selected"]:T.selected,["bk-time-picker-cells-cell-focused"]:T.focused,["bk-time-picker-cells-cell-disabled"]:T.disabled}]}function h(){const T=A=>{f(A).addEventListener("wheel",ct.exports.debounce(()=>{w(A)},32),{passive:!0})};T("hours"),T("minutes"),T("seconds")}function m(T){return f(T).querySelector("li").offsetHeight}function p(T){return f(T).offsetHeight}function w(T){const A=f(T),P=Math.min(Math.round((A.scrollTop-(p(T)*.5-10)/m(T)+3)/m(T)),T==="hours"?23:59);let J;if(T==="hours"?J=i:T==="minutes"?J=l:J=o,J.value.find(E=>E.text===P).disabled)return!1;a.nextTick(()=>{v({[T]:P})})}function y(T,A){if(A.disabled)return;const P={[T]:A.text};v(P)}function v(T){t("change",T),t("pick-click")}function L(T,A){const P=f(T),J=P.scrollTop,z=32*x(T,A);c4(P,J,z,500)}function x(T,A){const P=sy(T),J=e[`disabled${P}`];let z=A;if(J.length&&e.hideDisabledOptions){let E=0;J.forEach(ne=>ne<=A?E+=1:""),z-=E}return z}function k(){a.nextTick(()=>{Bh.forEach(T=>{const A=f(T);let P;T==="hours"?P=i:T==="minutes"?P=l:P=o,A.scrollTop=32*P.value.findIndex(J=>J.text===e[T])})})}function C(T){return T<10?`0${T}`:T}const b=a.ref(null),I=a.ref(null),N=a.ref(null);return Te(U({},a.toRefs(n)),{hoursList:i,minutesList:l,secondsList:o,styles:c,hoursRef:b,minutesRef:I,secondsRef:N,getCellCls:u,handleClick:y,updateScroll:k,padTime:C})},render(){return a.createVNode("div",{class:["bk-time-picker-cells",this.showSeconds?"bk-time-picker-cells-with-seconds":""]},[a.createVNode("div",{class:"bk-time-picker-cells-title-wrapper"},[a.createVNode("div",{class:["bk-time-picker-cells-title",this.focusedColumn===0?"active":""],style:this.styles},[a.createTextVNode("\u65F6")]),a.createVNode("div",{class:["bk-time-picker-cells-title",this.focusedColumn===1?"active":""],style:this.styles},[a.createTextVNode("\u5206")]),a.withDirectives(a.createVNode("div",{class:["bk-time-picker-cells-title",this.focusedColumn===2?"active":""],style:this.styles},[a.createTextVNode("\u79D2")]),[[a.vShow,this.showSeconds]])]),a.createVNode("div",{class:"bk-time-picker-cells-list",ref:"hoursRef",style:this.styles},[a.createVNode("ul",{class:"bk-time-picker-cells-ul"},[this.hoursList.map(e=>a.withDirectives(a.createVNode("li",{class:this.getCellCls(e),onClick:()=>this.handleClick("hours",e)},[this.padTime(e.text)]),[[a.vShow,!e.hide]]))])]),a.createVNode("div",{class:"bk-time-picker-cells-list",ref:"minutesRef",style:this.styles},[a.createVNode("ul",{class:"bk-time-picker-cells-ul"},[this.minutesList.map(e=>a.withDirectives(a.createVNode("li",{class:this.getCellCls(e),onClick:()=>this.handleClick("minutes",e)},[this.padTime(e.text)]),[[a.vShow,!e.hide]]))])]),a.withDirectives(a.createVNode("div",{class:"bk-time-picker-cells-list",ref:"secondsRef",style:this.styles},[a.createVNode("ul",{class:"bk-time-picker-cells-ul"},[this.secondsList.map(e=>a.withDirectives(a.createVNode("li",{class:this.getCellCls(e),onClick:()=>this.handleClick("seconds",e)},[this.padTime(e.text)]),[[a.vShow,!e.hide]]))])]),[[a.vShow,this.showSeconds]])])}});const fy={disabledDate:{type:Function,default:()=>!1},steps:{type:Array,default:()=>[]},format:{type:String,default:"HH:mm:ss"},value:{type:Array,required:!0},confirm:{type:Boolean,default:!1}};var _h=a.defineComponent({name:"TimePickerPanel",props:U(U(U({},_c),Zc),fy),emits:["pick","pick-click"],setup(e,{emit:t}){const n=a.reactive({date:e.value[0]||Hc(),showDate:!1}),i=a.inject(Qh),l=a.ref(null),o=a.computed(()=>!(e.format||"").match(/mm$/)),c=a.computed(()=>Nt.format(i.panelDate,e.format)),f=a.computed(()=>e.value[0]?["getHours","getMinutes","getSeconds"].map(p=>n.date[p]()):[]),u=a.computed(()=>{const p=["disabledHours","disabledMinutes","disabledSeconds"];if(e.disabledDate===(()=>!e.value[0]))return p.reduce((x,k)=>(x[k]=this[k],x),{});const w=[24,60,60],v=["Hours","Minutes","Seconds"].map(L=>e[`disabled${L}`]).map((L,x)=>{const k=w[x],C=L;for(let b=0;b<k;b+=e.steps[x]||1){const I=f.value.map((T,A)=>A===x?b:T),N=ly(n.date,...I);e.disabledDate(N,!0)&&C.push(b)}return C.filter((b,I,N)=>N.indexOf(b)===I)});return p.reduce((L,x,k)=>(L[x]=v[k],L),{})});a.watch(()=>e.value,p=>{let w=p[0]||Hc();w=new Date(w),n.date=w}),a.onMounted(()=>{i&&i.parentName==="DatePanel"&&(n.showDate=!0)});function h(p,w=!0){const y=new Date(n.date);Object.keys(p).forEach(v=>y[`set${Lo(v)}`](p[v])),w&&t("pick",y,!0,"time")}function m(){t("pick-click")}return Te(U({},a.toRefs(n)),{visibleDate:c,showSeconds:o,timeSlots:f,disabledHMS:u,timeSpinnerRef:l,handlePickClick:m,handleChange:h})},render(){return a.createVNode("div",{class:"bk-picker-panel-body-wrapper",onMousedown:e=>{e.preventDefault()}},[a.createVNode("div",{class:"bk-picker-panel-body",style:{width:`${this.width}px`}},[this.showDate?a.createVNode("div",{class:"bk-time-picker-header"},[this.visibleDate]):"",a.createVNode("div",{class:"bk-picker-panel-content"},[a.createVNode(dy,{ref:"timeSpinnerRef",showSeconds:this.showSeconds,steps:this.steps,hours:this.timeSlots[0],minutes:this.timeSlots[1],seconds:this.timeSlots[2],disabledHours:this.disabledHMS.disabledHours,disabledMinutes:this.disabledHMS.disabledMinutes,disabledSeconds:this.disabledHMS.disabledSeconds,hideDisabledOptions:this.hideDisabledOptions,"onPick-click":this.handlePickClick,onChange:this.handleChange},null)])])])}});const hy={modelValue:{type:[Date,String,Number,Array]},shortcuts:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},shortcutClose:{type:Boolean,default:!1},selectionMode:{type:String,default:"date",validator(e){return["year","month","date","time"].indexOf(e)<0?(console.error(`selectionMode property is not valid: '${e}'`),!1):!0}},startDate:{type:Date},disableDate:Function,focusedDate:{type:Date,required:!0},confirm:{type:Boolean,default:!1},showTime:{type:Boolean,default:!1},format:{type:String,default:"yyyy-MM-dd"},disabledDate:{type:Function,default:()=>!1}};var gy=a.defineComponent({name:"DatePanel",props:hy,emits:["pick","pick-success","pick-clear","pick-click","selection-mode-change"],setup(e,{slots:t,emit:n}){const i=_=>_.match(/^time/)?"time-picker":`${_}-table`,l=e.modelValue.slice().sort(),o=a.reactive({currentView:e.selectionMode||"date",pickerTable:i(e.selectionMode),dates:l,panelDate:e.startDate||l[0]||new Date}),{proxy:c}=a.getCurrentInstance();a.provide(Qh,{panelDate:o.panelDate,parentName:c.$options.name});const f=a.ref(null),u=a.ref(null),h=a.ref(null);a.watch(()=>o.currentView,_=>{console.error(11111,_),n("selection-mode-change",_),o.currentView==="time"&&a.nextTick(()=>{f.value.timeSpinnerRef.updateScroll()})}),a.watch(()=>e.selectionMode,_=>{o.currentView=_,o.pickerTable=i(_)});const m=()=>{setTimeout(()=>{o.currentView=e.selectionMode},500)},p=_=>{o.panelDate=_,o.pickerTable==="year-table"?o.pickerTable="month-table":o.pickerTable=i(o.currentView)},w=(_,ce)=>{let re=_;e.selectionMode==="year"?re=new Date(_.getFullYear(),0,1):e.selectionMode==="month"?re=new Date(o.panelDate.getFullYear(),_.getMonth(),1):re=new Date(_),o.dates=[re],n("pick",re,!1,ce||e.selectionMode)},y=()=>{m(),n("pick-success")},v=()=>{m(),n("pick-clear")},L=_=>{_.value&&n("pick",_.value(),!1,void 0,_),_.onClick&&_.onClick(this),e.shortcutClose&&y()},x=()=>{o.currentView=e.selectionMode,o.pickerTable=i(o.currentView)},k=_=>{e.selectionMode==="year"||o.pickerTable==="year-table"?o.panelDate=new Date(o.panelDate.getFullYear()+_*10,0,1):o.panelDate=Wh(o.panelDate,_*12)},C=_=>{o.panelDate=Wh(o.panelDate,_)},b=_=>{var ce,re;_&&((ce=u==null?void 0:u.value)==null||ce.updateScroll(),(re=h==null?void 0:h.value)==null||re.updateScroll())},I=a.computed(()=>o.pickerTable===`${o.currentView}-table`?w:p),N=a.computed(()=>{const _="zh-CN",ce="[yyyy]-[mm]",re=o.panelDate,{labels:ae,separator:ue}=Hh(_,ce,re),ie=Y=>()=>{o.pickerTable=i(Y)};return{separator:ue,labels:ae.map(Y=>{const W=Y;return W.handler=ie(Y.type),W})}}),T=a.computed(()=>N.value.labels[0].type==="year"||o.currentView==="date"),A=a.computed(()=>N.value.labels[1].type==="year"||o.currentView==="date"),P=a.computed(()=>o.currentView==="time"),J=()=>{o.currentView=o.currentView==="time"?"date":"time"},z=a.computed(()=>!!t.shortcuts),E=a.computed(()=>!o.dates[0]);function ne(){n("pick-click")}return Te(U({},a.toRefs(o)),{panelPickerHandlers:I,datePanelLabel:N,showLabelFirst:T,showLabelSecond:A,handleShortcutClick:L,changeYear:k,changeMonth:C,reset:x,isTime:P,hasShortcuts:z,timeDisabled:E,onToggleVisibility:b,handleToggleTime:J,handlePickSuccess:y,handlePickClear:v,handlePick:w,handlePickClick:ne,timePickerRef:f})},render(){var e,t,n;return a.createVNode("div",{class:["bk-picker-panel-body-wrapper",this.shortcuts.length||this.hasShortcuts?"bk-picker-panel-with-sidebar":""],onMousedown:i=>{i.preventDefault()}},[this.shortcuts.length?a.createVNode("div",{class:"bk-picker-panel-sidebar"},[this.shortcuts.map(i=>a.createVNode("div",{class:"bk-picker-panel-shortcut",onClick:()=>this.handleShortcutClick(i)},[i.text]))]):"",a.createVNode("div",{class:"bk-picker-panel-body",style:"width: 261px;"},[a.withDirectives(a.createVNode("div",{class:"bk-date-picker-header"},[a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.changeYear(-1)},[a.createVNode(hr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.pickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("prev"),onClick:()=>this.changeMonth(-1)},[a.createVNode(Mi,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):"",this.datePanelLabel&&Object.keys(this.datePanelLabel).length>0?a.createVNode("span",null,[a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.datePanelLabel.labels[0].handler},[this.datePanelLabel.labels[0].label]),[[a.vShow,this.showLabelFirst]]),this.currentView==="date"?` ${this.datePanelLabel.separator} `:" ",a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.datePanelLabel.labels[1].handler},[this.datePanelLabel.labels[1].label]),[[a.vShow,this.showLabelSecond]])]):"",a.createVNode("span",{class:dn("next","-double"),onClick:()=>this.changeYear(1)},[a.createVNode(gr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.pickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("next"),onClick:()=>this.changeMonth(1)},[a.createVNode(vn,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):""]),[[a.vShow,this.currentView!=="time"]]),a.createVNode("div",{class:"bk-picker-panel-content"},[this.currentView!=="time"?(()=>{switch(this.pickerTable){case"date-table":return a.createVNode(Bc,{tableDate:this.panelDate,disableDate:this.disableDate,selectionMode:this.selectionMode,modelValue:this.dates,focusedDate:this.focusedDate,onPick:this.panelPickerHandlers},null);default:return null}})():a.createVNode(_h,{ref:"timePickerRef",value:this.dates,format:this.format,disabledDate:this.disabledDate,onPick:this.handlePick,"onPick-clear":this.handlePickClear,"onPick-success":this.handlePickSuccess},null)]),this.confirm?a.createVNode(z5,{clearable:this.clearable,showTime:this.showTime,isTime:this.isTime,"onPick-toggle-time":this.handleToggleTime,"onPick-clear":this.handlePickClear,"onPick-success":this.handlePickSuccess},null):""]),this.hasShortcuts?a.createVNode("div",{class:"bk-picker-panel-sidebar"},[(n=(t=(e=this.$slots).shortcuts)==null?void 0:t.call(e))!=null?n:null]):null])}});const my={modelValue:{type:[Date,String,Number,Array]},type:{type:String,default:"date",validator(e){return["year","month","date","daterange","datetime","datetimerange","time","timerange"].indexOf(e)<0?(console.error(`type property is not valid: '${e}'`),!1):!0}},shortcuts:{type:Array,default:()=>[]},shortcutClose:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},splitPanels:{type:Boolean,default:!0},showTime:{type:Boolean,default:!1},selectionMode:{type:String,default:"date",validator(e){return["year","month","date","time"].indexOf(e)<0?(console.error(`selectionMode property is not valid: '${e}'`),!1):!0}},startDate:{type:Date},upToNow:{type:Boolean,default:!1},disableDate:Function,focusedDate:{type:Date,required:!0},confirm:{type:Boolean,default:!1}};var py=a.defineComponent({name:"DateRangePanel",props:my,emits:["pick","pick-success"],setup(e,{slots:t,emit:n}){const[i,l]=e.modelValue.map(Q=>Q||Hc()),o=e.startDate?e.startDate:i,c=a.reactive({currentView:e.selectionMode||"date",leftPickerTable:`${e.selectionMode}-table`,rightPickerTable:`${e.selectionMode}-table`,leftPanelDate:o,rightPanelDate:new Date(o.getFullYear(),o.getMonth()+1,1),rangeState:{from:e.modelValue[0],to:e.modelValue[1],selecting:i&&!l},upToNowEnable:!1,dates:e.modelValue}),f=(Q,F)=>!Q||!F?0:Q.getTime()-F.getTime(),u=()=>{c.currentView=e.selectionMode,c.leftPickerTable=`${c.currentView}-table`,c.rightPickerTable=`${c.currentView}-table`},h=a.ref(null),m=a.ref(null),p=Q=>{var F,K;Q&&((F=h==null?void 0:h.value)==null||F.updateScroll(),(K=m==null?void 0:m.value)==null||K.updateScroll())},w=(Q,F,K,fe=!0)=>{const he=new Date(c[`${Q}PanelDate`]);if(he[`set${F}`](he[`get${F}`]()+K),c[`${Q}PanelDate`]=he,!!fe)if(e.splitPanels){const Ce=Q==="left"?"right":"left";Q==="left"&&c.leftPanelDate>=c.rightPanelDate&&w(Ce,F,1),Q==="right"&&c.rightPanelDate<=c.leftPanelDate&&w(Ce,F,-1)}else{const Ce=Q==="left"?"right":"left",Ae=c[`${Ce}PanelDate`],oe=new Date(Ae);if(F==="Month"){const X=new Date(oe.getFullYear(),oe.getMonth()+K+1,0).getDate();oe.setDate(Math.min(X,oe.getDate()))}oe[`set${F}`](oe[`get${F}`]()+K),c[`${Ce}PanelDate`]=oe}},y=Q=>{const F=c.currentView==="year"?-10:-1;w(Q,"FullYear",F)},v=Q=>{const F=c.currentView==="year"?10:1;w(Q,"FullYear",F)},L=Q=>{w(Q,"Month",-1)},x=Q=>{w(Q,"Month",1)},k=Q=>{c[`${Q}PickerTable`]="year-table"},C=Q=>{c[`${Q}PickerTable`]="month-table"},b=Q=>{const F="zh-CN",K="[yyyy]-[mm]",fe=c[`${Q}PanelDate`],{labels:he,separator:Ce}=Hh(F,K,fe),Ae=oe=>{const X=oe==="month"?C:k;return()=>X(Q)};return{separator:Ce,labels:he.map(oe=>{const X=oe;return X.handler=Ae(oe.type),X})}},I=(Q,F)=>{n("pick",c.dates,Q,F||e.type)},N=(Q,F)=>{if(console.warn("handleRangePick"),c.rangeState.selecting||c.currentView==="time"){if(c.currentView==="time")c.dates=Q;else{const[K,fe]=[c.rangeState.from,Q].sort(f),he=F==="upToNow"?new Date:new Date(new Date(new Date(fe.setHours(23)).setMinutes(59)).setSeconds(59));c.dates=[K,he],c.rangeState={from:K,to:he,selecting:!1}}I(!1,F||"date")}else c.upToNowEnable=new Date(Q).getTime()<new Date().getTime(),c.rangeState={from:Q,to:null,selecting:!0}},T=(Q,F)=>{if(c[`${Q}PanelDate`]=F,c[`${Q}PickerTable`]==="year-table"?c[`${Q}PickerTable`]="month-table":c[`${Q}PickerTable`]=`${c.currentView}-table`,!e.splitPanels){const fe=Q==="left"?"right":"left";c[`${fe}PanelDate`]=F,w(fe,"Month",fe==="left"?-1:1,!1)}},A=(Q,F)=>{if(!(Q!=null&&Q.value))return!1;Q.onClick&&Q.onClick(Q,F);const K=typeof Q.value=="function"?Q.value():Q.value,[fe,he]=K;c.rangeState.from=fe,c.rangeState.to=he,c.dates=[fe,he],n("pick",K,!1,"shortcut",Q),e.shortcutClose&&n("pick-success")},P=Q=>{c.rangeState.to=Q};a.watch(()=>e.selectionMode,Q=>{c.currentView=Q||"range"});const J=a.computed(()=>c.currentView==="time"),z=a.computed(()=>b("left")),E=a.computed(()=>b("right")),ne=a.computed(()=>c.leftPickerTable.split("-").shift()),_=a.computed(()=>c.rightPickerTable.split("-").shift()),ce=a.computed(()=>z.value.labels[0].type==="year"||c.currentView==="date"),re=a.computed(()=>z.value.labels[1].type==="year"||c.currentView==="date"),ae=a.computed(()=>E.value.labels[0].type==="year"||c.currentView==="date"),ue=a.computed(()=>E.value.labels[1].type==="year"||c.currentView==="date"),ie=a.computed(()=>{const Q=`${c.currentView}-table`;return{left:c.leftPickerTable!==Q,right:c.rightPickerTable!==Q}}),Y=a.computed(()=>({left:ie.value.left?T.bind("left"):N,right:ie.value.right?T.bind("right"):N})),W=a.computed(()=>{var Q;return t.shortcuts||((Q=e.shortcuts)==null?void 0:Q.length)});return Te(U({},a.toRefs(c)),{isTime:J,hasShortcuts:W,prevYear:y,nextYear:v,prevMonth:L,nextMonth:x,leftDatePanelLabel:z,rightDatePanelLabel:E,leftDatePanelView:ne,rightDatePanelView:_,leftShowLabelFirst:ce,leftShowLabelSecond:re,rightShowLabelFirst:ae,rightShowLabelSecond:ue,preSelecting:ie,panelPickerHandlers:Y,handleShortcutClick:A,reset:u,onToggleVisibility:p,handleRangePick:N,handleChangeRange:P})},render(){return a.createVNode("div",{class:["bk-picker-panel-body-wrapper","bk-date-picker-with-range",this.shortcuts.length||this.$slots.shortcuts?"bk-picker-panel-with-sidebar":""],onMousedown:e=>{e.preventDefault()}},[a.createVNode("div",{class:["bk-picker-panel-body",this.showTime?"bk-picker-panel-body-time":"bk-picker-panel-body-date"]},[a.withDirectives(a.createVNode("div",{class:"bk-picker-panel-content bk-picker-panel-content-left",style:"width: 261px;"},[a.withDirectives(a.createVNode("div",{class:"bk-date-picker-header"},[a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.prevYear("left")},[a.createVNode(hr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.leftPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("prev"),onClick:()=>this.prevMonth("left")},[a.createVNode(Mi,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):"",this.leftDatePanelLabel&&Object.keys(this.leftDatePanelLabel).length>0?a.createVNode("span",null,[a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.leftDatePanelLabel.labels[0].handler},[this.leftDatePanelLabel.labels[0].label]),[[a.vShow,this.leftShowLabelFirst]]),this.leftDatePanelView==="date"?` ${this.leftDatePanelLabel.separator} `:" ",a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.leftDatePanelLabel.labels[1].handler},[this.leftDatePanelLabel.labels[1].label]),[[a.vShow,this.leftShowLabelSecond]])]):"",this.splitPanels||this.leftPickerTable!=="date-table"?a.createVNode("span",{class:dn("next","-double"),onClick:()=>this.nextYear("left")},[a.createVNode(gr,{style:{fontSize:"20px",lineHeight:1}},null)]):"",this.splitPanels||this.leftPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("next"),onClick:()=>this.nextMonth("left")},[a.createVNode(vn,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):""]),[[a.vShow,this.currentView!=="time"]]),this.currentView!=="time"?(()=>{switch(this.leftPickerTable){case"date-table":return a.createVNode(Bc,{selectionMode:"range",tableDate:this.leftPanelDate,disableDate:this.disableDate,rangeState:this.rangeState,modelValue:this.preSelecting.left?[this.dates[0]]:this.dates,focusedDate:this.focusedDate,onChangeRange:this.handleChangeRange,onPick:this.panelPickerHandlers.left},null);default:return null}})():""]),[[a.vShow,!this.isTime]]),a.withDirectives(a.createVNode("div",{class:"bk-picker-panel-content bk-picker-panel-content-right",style:"width: 261px;"},[a.withDirectives(a.createVNode("div",{class:"bk-date-picker-header"},[this.splitPanels||this.rightPickerTable!=="date-table"?a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.prevYear("right")},[a.createVNode(hr,{style:{fontSize:"20px",lineHeight:1}},null)]):"",this.splitPanels&&this.rightPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("prev","-double"),onClick:()=>this.prevMonth("right")},[a.createVNode(Mi,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):"",this.rightDatePanelLabel&&Object.keys(this.rightDatePanelLabel).length>0?a.createVNode("span",null,[a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.rightDatePanelLabel.labels[0].handler},[this.rightDatePanelLabel.labels[0].label]),[[a.vShow,this.rightShowLabelFirst]]),this.rightDatePanelView==="date"?` ${this.rightDatePanelLabel.separator} `:" ",a.withDirectives(a.createVNode("span",{class:"bk-date-picker-header-label",onClick:()=>this.rightDatePanelLabel.labels[1].handler},[this.rightDatePanelLabel.labels[1].label]),[[a.vShow,this.rightShowLabelSecond]])]):"",this.upToNow?(()=>(this.rangeState.selecting||this.currentView==="time")&&this.upToNowEnable?a.createVNode("span",{class:"up-to-now",onClick:()=>this.handleRangePick(new Date,"upToNow")},[a.createTextVNode("\u81F3\u4ECA")]):a.createVNode("span",{class:"up-to-now disabled"},[a.createTextVNode("\u81F3\u4ECA")]))():"",a.createVNode("span",{class:dn("next","-double"),onClick:()=>this.nextYear("right")},[a.createVNode(gr,{style:{fontSize:"20px",lineHeight:1}},null)]),this.rightPickerTable==="date-table"?a.withDirectives(a.createVNode("span",{class:dn("next"),onClick:()=>this.nextMonth("right")},[a.createVNode(vn,{style:{fontSize:"20px",lineHeight:1}},null)]),[[a.vShow,this.currentView==="date"]]):""]),[[a.vShow,this.currentView!=="time"]]),this.currentView!=="time"?(()=>{switch(this.rightPickerTable){case"date-table":return a.createVNode(Bc,{selectionMode:"range",tableDate:this.rightPanelDate,disableDate:this.disableDate,rangeState:this.rangeState,modelValue:this.preSelecting.right?[this.dates[this.dates.length-1]]:this.dates,focusedDate:this.focusedDate,onChangeRange:this.handleChangeRange,onPick:this.panelPickerHandlers.right},null);default:return null}})():""]),[[a.vShow,!this.isTime]])]),this.hasShortcuts?a.createVNode("div",{class:"bk-picker-panel-sidebar"},[this.$slots.shortcuts?typeof this.$slots.shortcuts=="function"?this.$slots.shortcuts():this.$slots.shortcuts:this.shortcuts.length?a.createVNode("div",{class:"bk-picker-panel-shortcuts"},[this.shortcuts.map((e,t)=>a.createVNode("div",{key:t,class:"shortcuts-item",onClick:()=>this.handleShortcutClick(e,t)},[e.text]))]):""]):null])}}),by=a.defineComponent({name:"DatePicker",directives:{clickoutside:Xn},props:_c,emits:["open-change","input","change","update:modelValue","clear","shortcut-change","pick-success"],slots:["header"],setup(e,{slots:t,emit:n}){const i=En(),l=e.type.includes("range"),o=l?[null,null]:[null],c=l?e.value||e.modelValue:[e.value||e.modelValue];let f=Ah(c)?o:Di(e.value||e.modelValue,e.type,e.multiple,e.format),u=null;e.shortcutSelectedIndex!==-1&&(u=e.shortcuts[e.shortcutSelectedIndex]||null,u&&(f=u.value()));const h=a.reactive({showClose:!1,visible:!1,internalValue:f,disableClickOutSide:!1,disableCloseUnderTransfer:!1,selectionMode:"date",forceInputRerender:1,isFocused:!1,focusedDate:f[0]||e.startDate||new Date,focusedTime:{column:0,picker:0,time:f.map(nl),active:!1},internalFocus:!1,timeEnterMode:!0,shortcut:u,onSelectionModeChange:m});function m(oe){let X=oe;return oe.match(/^date/)&&(X="date"),h.selectionMode=["year","month","date","time"].indexOf(X)>-1&&X,h.selectionMode}const p=a.computed(()=>{if(e.multiple)return h.internalValue.slice();const oe=e.type.includes("range");let X=h.internalValue.map(Z=>Z instanceof Date?new Date(Z):Z||"");return e.type.match(/^time/)&&(X=X.map(Z=>Wn(Z,e.type,e.multiple,e.format))),oe||e.multiple?X:X[0]}),w=a.computed(()=>e.type.match(/^time/)?p.value:e.multiple?Wn(p.value,e.type,e.multiple,e.format):Array.isArray(p.value)?p.value.map(oe=>Wn(oe,e.type,e.multiple,e.format)):Wn(p.value,e.type,e.multiple,e.format)),y=a.computed(()=>e.type==="daterange"||e.type==="datetimerange"?"DateRangePanel":"DatePanel"),v=a.computed(()=>e.open===null?h.visible:e.open),L=a.computed(()=>Wn(h.internalValue,e.type,e.multiple,e.format)),x=a.computed(()=>{var oe;return((oe=h.shortcut)==null?void 0:oe.text)&&e.useShortcutText?h.shortcut.text:L.value}),k=a.computed(()=>!!t.trigger||e.type==="datetime"||e.type==="datetimerange"||e.multiple),C=a.computed(()=>!!t.header),b=a.computed(()=>!!t.footer),I=a.computed(()=>!!t.shortcuts),N=a.computed(()=>{let oe="";return e.fontSize==="medium"?oe="medium-font":e.fontSize==="large"&&(oe="large-font"),oe}),T=a.computed(()=>{let oe="";return e.fontSize==="medium"?oe="medium-width":e.fontSize==="large"&&(oe="large-width"),oe}),A=a.computed(()=>{var oe;return((oe=h.shortcut)==null?void 0:oe.text)&&e.useShortcutText?!0:!e.editable||e.readonly}),P=a.computed(()=>e.options),J=a.computed(()=>y.value==="RangeTimePickerPanel"?e.allowCrossDay:!1),z=a.ref(null),E=()=>{var oe;(oe=z==null?void 0:z.value)==null||oe.focus()};a.watch(()=>h.visible,oe=>{var X,Z;oe===!1&&((X=ne.value)==null||X.destoryDropdown()),(Z=ne.value)==null||Z.updateDropdown(),n("open-change",oe)});const ne=a.ref(null);a.watch(()=>e.modelValue,oe=>{var X;h.internalValue=Di(oe,e.type,e.multiple,e.format),e.withValidate&&((X=i==null?void 0:i.validate)==null||X.call(i,"change"))}),a.watch(()=>e.open,oe=>{h.visible=oe===!0}),a.watch(()=>e.type,oe=>{m(oe)}),a.watch(()=>p,(oe,X)=>{const Z=JSON.stringify(oe),se=JSON.stringify(X);(Z!==se||typeof oe!=typeof X)&&n("input",oe)}),a.onMounted(()=>{e.type.indexOf("date")>-1,h.timeEnterMode=!0;const oe=e.modelValue,X=p.value;(typeof oe!=typeof X||JSON.stringify(oe)!==JSON.stringify(X))&&n("input",p.value),e.open!==null&&(h.visible=e.open),a.provide(Jh,{props:e,focus:()=>E()})});const _=a.ref(null),ce=oe=>{var X;if(h.disableCloseUnderTransfer)return h.disableCloseUnderTransfer=!1,!1;if(oe&&oe.type==="mousedown"&&h.visible){oe.preventDefault(),oe.stopPropagation();return}if(h.visible){const Z=(X=_==null?void 0:_.value)==null?void 0:X.$el;if(oe&&Z&&Z.contains(oe.target))return;h.visible=!1,oe==null||oe.preventDefault(),oe==null||oe.stopPropagation();return}h.isFocused=!1,h.disableClickOutSide=!1},re=()=>{var oe,X;(oe=z==null?void 0:z.value)==null||oe.focus(),(X=z==null?void 0:z.value)==null||X.click()},ae=()=>{e.readonly||e.disabled||L!=null&&L.value&&(h.showClose=!0)},ue=oe=>{h.showClose=!1},ie=oe=>{a.nextTick(()=>{var X;n("change",w.value,oe),n("update:modelValue",p.value),e.type.indexOf("time")<0&&((X=z==null?void 0:z.value)==null||X.blur())})},Y=oe=>{var H;const X=e.type.includes("range")||e.multiple,Z=L.value,se=oe.target.value,Me=Di(se,e.type,e.multiple,e.format),j=X?Me:Me[0],B=(H=e.disableDate)==null?void 0:H.call(e,j),V=Me.reduce(($,te)=>$&&te instanceof Date,!0);se!==Z&&!B&&V?(ie(e.type),h.internalValue=Me):h.forceInputRerender=h.forceInputRerender+1},W=oe=>{e.readonly||(h.isFocused=!0,!(oe&&oe.type==="focus")&&(e.disabled||(h.visible=!0)))},Q=()=>{var oe;(oe=_==null?void 0:_.value)==null||oe.reset()},F=oe=>{var X,Z;if(h.internalFocus){h.internalFocus=!1;return}if(h.visible){oe.preventDefault();return}h.isFocused=!1,m(e.type),h.internalValue=h.internalValue.slice(),Q(),(X=_==null?void 0:_.value)==null||X.onToggleVisibility(!1),(Z=i==null?void 0:i.validate)==null||Z.call(i,"blur")},K=oe=>{const{keyCode:X}=oe;if(X===9&&h.visible)if(oe.stopPropagation(),oe.preventDefault(),k.value){const se=".bk-picker-confirm > *",Me=ne.value.$el.querySelectorAll(se);h.internalFocus=!0,[...Me][oe.shiftKey?"pop":"shift"]().focus()}else ce();const Z=[37,38,39,40];if(!h.visible&&Z.includes(X)){h.visible=!0;return}X===27&&h.visible&&(oe.stopPropagation(),ce()),!!Z.includes(X)&&h.focusedTime.active&&oe.preventDefault()},fe=()=>{h.visible=!1,h.internalValue=h.internalValue.map(()=>null),n("clear"),ie(e.type),Q(),h.showClose=!1,h.shortcut=null,setTimeout(()=>m(e.type),500)},he=()=>{var oe;h.visible=!1,a.nextTick(()=>{n("pick-success")}),(oe=z==null?void 0:z.value)==null||oe.blur(),Q()},Ce=(oe,X=!1,Z,se)=>{let Me=oe;if(e.multiple){const B=Me.getTime(),V=h.internalValue.findIndex(te=>te&&te.getTime()===B),$=[...h.internalValue,Me].filter(Boolean).map(te=>te.getTime()).filter((te,ye,we)=>we.indexOf(te)===ye&&ye!==V);h.internalValue=$.map(te=>new Date(te))}else Me=Di(oe,e.type,e.multiple,e.format),h.internalValue=Array.isArray(Me)?Me:[Me];if(h.internalValue[0]){const[B]=h.internalValue;h.focusedDate=B}h.focusedTime=Te(U({},h.focusedTime),{time:h.internalValue.map(nl)}),k.value||(m(e.type),h.visible=X),Z==="upToNow"&&e.type==="daterange"&&he(),h.shortcut=se,ie(Z);const j=e.shortcuts.findIndex(B=>B===h.shortcut);n("shortcut-change",h.shortcut,j)},Ae=a.ref(null);return Te(U({},a.toRefs(h)),{panel:y,publicStringValue:w,opened:v,visualValue:L,displayValue:x,isConfirm:k,hasHeader:C,hasFooter:b,hasShortcuts:I,fontSizeCls:N,longWidthCls:T,localReadonly:A,allowCrossDayProp:J,ownPickerProps:P,pickerDropdownRef:ne,inputRef:z,triggerRef:Ae,pickerPanelRef:_,handleClose:ce,handleIconClick:re,handleInputMouseenter:ae,handleInputMouseleave:ue,handleFocus:W,handleBlur:F,handleKeydown:K,handleInputChange:Y,handleClear:fe,onPick:Ce,onPickSuccess:he})},render(){var n,i,l;const e=a.createVNode("div",null,[a.createVNode("span",{class:["icon-wrapper",this.disabled?"disabled":""],onClick:this.handleIconClick},[this.type==="time"||this.type==="timerange"?a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"time"},[a.createVNode("path",{fill:"#c4c6cc",d:"M512,128c51.9,0,102.2,10.1,149.5,30.2c45.7,19.3,86.8,47,122.1,82.3s63,76.4,82.3,122.1c20,47.3,30.2,97.6,30.2,149.5S886,614.3,865.9,661.6c-19.3,45.7-47,86.8-82.3,122.1s-76.4,63-122.1,82.3c-47.3,20-97.6,30.2-149.5,30.2S409.8,886.1,362.5,866c-45.7-19.3-86.8-47-122.1-82.3s-63-76.4-82.3-122.1c-20-47.3-30.2-97.6-30.2-149.5s10.1-102.2,30.2-149.5c19.3-45.7,47-86.8,82.3-122.1s76.4-63,122.1-82.3C409.8,138.1,460.1,128,512,128 M512,64C264.6,64,64,264.6,64,512s200.6,448,448,448s448-200.6,448-448S759.4,64,512,64L512,64z"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"512,512 512,256 448,256 448,512 448,576 512,576 768,576 768,512"},null)])]):a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"date"},[a.createVNode("path",{fill:"#c4c6cc",d:"M896,128h-96v64h64v112H160V192h64v-64h-96c-17.7,0-32,14.3-32,32v736c0,17.7,14.3,32,32,32h768c17.7,0,32-14.3,32-32V160C928,142.3,913.7,128,896,128z M160,864V368h704v496H160z"},null),a.createVNode("rect",{x:"416",y:"128",fill:"#c4c6cc",width:"192",height:"64"},null),a.createVNode("rect",{x:"288",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("rect",{x:"672",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"403.7,514.4 557.1,514.4 557.1,515.3 420.1,765.5 483.5,765.5 620.3,504.3 620.3,466.5 403.7,466.5"},null)])])]),a.createVNode("input",{type:"text",class:["bk-date-picker-editor",this.readonly?"readonly":"",this.fontSizeCls,this.behavior==="simplicity"?"only-bottom-border":""],ref:"inputRef",key:this.forceInputRerender,readonly:this.localReadonly,disabled:this.disabled,placeholder:this.placeholder,value:this.displayValue,onFocus:this.handleFocus,onClick:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onChange:this.handleInputChange},null),this.clearable&&this.showClose?a.createVNode(cn,{onClick:this.handleClear,class:"clear-action"},null):""]),t=this.hasShortcuts?{shortcuts:()=>{var o,c;return((c=(o=this.$slots).shortcuts)==null?void 0:c.call(o,{change:this.onPick}))||null}}:{};return a.withDirectives(a.createVNode("div",{class:["bk-date-picker",this.type==="datetimerange"?"long":"",this.longWidthCls]},[a.createVNode("div",{ref:"triggerRef",class:"bk-date-picker-rel",onMouseenter:this.handleInputMouseenter,onMouseleave:this.handleInputMouseleave},[(l=(i=(n=this.$slots).trigger)==null?void 0:i.call(n))!=null?l:e]),a.createVNode(a.Teleport,{to:"body",disabled:!this.appendToBody},{default:()=>[a.createVNode(a.Transition,{name:"bk-fade-down-transition"},{default:()=>[a.withDirectives(a.createVNode(Vc,{class:[this.appendToBody?"bk-date-picker-transfer":""],ref:"pickerDropdownRef",triggerRef:this.triggerRef,placement:this.placement,extPopoverCls:this.extPopoverCls,appendToBody:this.appendToBody},{default:()=>{var o,c,f,u,h,m;return[this.hasHeader?a.createVNode("div",{class:["bk-date-picker-top-wrapper",this.headerSlotCls]},[(f=(c=(o=this.$slots).header)==null?void 0:c.call(o))!=null?f:null]):null,this.panel==="DateRangePanel"?a.createVNode(py,{ref:"pickerPanelRef",type:this.type,confirm:this.isConfirm,shortcuts:this.shortcuts,shortcutClose:this.shortcutClose,modelValue:this.internalValue,selectionMode:this.selectionMode,startDate:this.startDate,disableDate:this.disableDate,focusedDate:this.focusedDate,onPick:this.onPick,"onPick-success":this.onPickSuccess,"onSelection-mode-change":this.onSelectionModeChange},t):a.createVNode(gy,{ref:"pickerPanelRef",clearable:this.clearable,showTime:this.type==="datetime"||this.type==="datetimerange",confirm:this.isConfirm,shortcuts:this.shortcuts,multiple:this.multiple,shortcutClose:this.shortcutClose,selectionMode:this.selectionMode,modelValue:this.internalValue,startDate:this.startDate,disableDate:this.disableDate,focusedDate:this.focusedDate,onPick:this.onPick,"onPick-clear":this.handleClear,"onPick-success":this.onPickSuccess,"onSelection-mode-change":this.onSelectionModeChange},t),this.hasFooter?a.createVNode("div",{class:["bk-date-picker-footer-wrapper",this.footerSlotCls]},[(m=(h=(u=this.$slots).footer)==null?void 0:h.call(u))!=null?m:null]):null]}}),[[a.vShow,this.opened]])]})]})]),[[a.resolveDirective("clickoutside"),this.handleClose]])}}),yy=a.defineComponent({name:"TimePicker",directives:{clickoutside:Xn},props:U(U(U({},_c),cy),Zc),emits:["open-change","input","change","update:modelValue","clear","shortcut-change","pick-success"],slots:["header"],setup(e,{slots:t,emit:n}){const i=En(),l=e.type.includes("range"),o=l?[null,null]:[null];let c=Ah((l?e.modelValue:[e.modelValue])||[])?o:Di(e.modelValue,e.type,e.multiple,e.format),f=null;e.shortcutSelectedIndex!==-1&&(f=e.shortcuts[e.shortcutSelectedIndex]||null,f&&(c=f.value()));const u=a.reactive({showClose:!1,visible:!1,internalValue:c,disableClickOutSide:!1,disableCloseUnderTransfer:!1,selectionMode:"date",forceInputRerender:1,isFocused:!1,focusedDate:c[0]||e.startDate||new Date,focusedTime:{column:0,picker:0,time:c.map(nl),active:!1},internalFocus:!1,timeEnterMode:!0,shortcut:f,onSelectionModeChange:h});function h(X){let Z=X;return X.match(/^date/)&&(Z="date"),u.selectionMode=["year","month","date","time"].indexOf(Z)>-1&&Z,u.selectionMode}const m=a.computed(()=>{if(e.multiple)return u.internalValue.slice();const X=e.type.includes("range");let Z=u.internalValue.map(se=>se instanceof Date?new Date(se):se||"");return e.type.match(/^time/)&&(Z=Z.map(se=>Wn(se,e.type,e.multiple,e.format))),X||e.multiple?Z:Z[0]}),p=a.computed(()=>e.type.match(/^time/)?m.value:e.multiple?Wn(m.value,e.type,e.multiple,e.format):Array.isArray(m.value)?m.value.map(X=>Wn(X,e.type,e.multiple,e.format)):Wn(m.value,e.type,e.multiple,e.format)),w=a.computed(()=>e.type==="timerange"?"RangeTimePickerPanel":"TimePickerPanel"),y=a.computed(()=>e.open===null?u.visible:e.open),v=a.computed(()=>Wn(u.internalValue,e.type,e.multiple,e.format)),L=a.computed(()=>{var X;return((X=u.shortcut)==null?void 0:X.text)&&e.useShortcutText?u.shortcut.text:v.value}),x=a.computed(()=>!!t.trigger||e.type==="datetime"||e.type==="datetimerange"||e.multiple),k=a.computed(()=>!!t.header),C=a.computed(()=>!!t.footer),b=a.computed(()=>!!t.shortcuts),I=a.computed(()=>{let X="";return e.fontSize==="medium"?X="medium-font":e.fontSize==="large"&&(X="large-font"),X}),N=a.computed(()=>{let X="";return e.fontSize==="medium"?X="medium-width":e.fontSize==="large"&&(X="large-width"),X}),T=a.computed(()=>{var X;return((X=u.shortcut)==null?void 0:X.text)&&e.useShortcutText?!0:!e.editable||e.readonly}),A=a.computed(()=>({disabledHours:e.disabledHours,disabledMinutes:e.disabledMinutes,disabledSeconds:e.disabledSeconds,hideDisabledOptions:e.hideDisabledOptions})),P=a.computed(()=>w.value==="RangeTimePickerPanel"?e.allowCrossDay:!1),J=a.ref(null),z=()=>{var X;(X=J==null?void 0:J.value)==null||X.focus()},{proxy:E}=a.getCurrentInstance();a.watch(()=>u.visible,X=>{X&&a.nextTick(()=>{Rh(E,"TimeSpinner").forEach(se=>se.updateScroll())})});const ne=a.ref(null);a.watch(()=>e.modelValue,X=>{var Z;u.internalValue=Di(X,e.type,e.multiple,e.format),e.withValidate&&((Z=i==null?void 0:i.validate)==null||Z.call(i,"change"))}),a.watch(()=>e.open,X=>{u.visible=X===!0}),a.watch(()=>e.type,X=>{h(X)}),a.watch(()=>m,(X,Z)=>{const se=JSON.stringify(X),Me=JSON.stringify(Z);(se!==Me||typeof X!=typeof Z)&&n("input",X)}),a.onMounted(()=>{e.type.indexOf("date")>-1,u.timeEnterMode=!0;const X=e.modelValue,Z=m.value;(typeof X!=typeof Z||JSON.stringify(X)!==JSON.stringify(Z))&&n("input",m.value),e.open!==null&&(u.visible=e.open),a.provide(Jh,{props:e,focus:()=>z()})});const _=a.ref(null),ce=X=>{var Z;if(u.disableCloseUnderTransfer)return u.disableCloseUnderTransfer=!1,!1;if(X&&X.type==="mousedown"&&u.visible){X.preventDefault(),X.stopPropagation();return}if(u.visible){const se=(Z=_==null?void 0:_.value)==null?void 0:Z.$el;if(X&&se&&se.contains(X.target))return;u.visible=!1,X==null||X.preventDefault(),X==null||X.stopPropagation();return}u.isFocused=!1,u.disableClickOutSide=!1},re=()=>{var X,Z;(X=J==null?void 0:J.value)==null||X.focus(),(Z=J==null?void 0:J.value)==null||Z.click()},ae=()=>{e.readonly||e.disabled||v!=null&&v.value&&(u.showClose=!0)},ue=X=>{u.showClose=!1},ie=X=>{a.nextTick(()=>{var Z;n("change",p.value,X),n("update:modelValue",m.value),e.type.indexOf("time")<0&&((Z=J==null?void 0:J.value)==null||Z.blur())})},Y=X=>{var $;const Z=e.type.includes("range")||e.multiple,se=v.value,Me=X.target.value,j=Di(Me,e.type,e.multiple,e.format),B=Z?j:j[0],V=($=e.disableDate)==null?void 0:$.call(e,B),H=j.reduce((te,ye)=>te&&ye instanceof Date,!0);Me!==se&&!V&&H?(ie(e.type),u.internalValue=j):u.forceInputRerender=u.forceInputRerender+1},W=X=>{e.readonly||(u.isFocused=!0,!(X&&X.type==="focus")&&(e.disabled||(u.visible=!0)))},Q=()=>{var X;(X=_==null?void 0:_.value)==null||X.reset()},F=X=>{var Z,se;if(u.internalFocus){u.internalFocus=!1;return}if(u.visible){X.preventDefault();return}u.isFocused=!1,h(e.type),u.internalValue=u.internalValue.slice(),Q(),(Z=_==null?void 0:_.value)==null||Z.onToggleVisibility(!1),(se=i==null?void 0:i.validate)==null||se.call(i,"blur")},K=X=>{const{keyCode:Z}=X;if(Z===9&&u.visible)if(X.stopPropagation(),X.preventDefault(),x.value){const Me=".bk-picker-confirm > *",j=ne.value.$el.querySelectorAll(Me);u.internalFocus=!0,[...j][X.shiftKey?"pop":"shift"]().focus()}else ce();const se=[37,38,39,40];if(!u.visible&&se.includes(Z)){u.visible=!0;return}Z===27&&u.visible&&(X.stopPropagation(),ce()),!!se.includes(Z)&&u.focusedTime.active&&X.preventDefault()},fe=()=>{u.visible=!1,u.internalValue=u.internalValue.map(()=>null),n("clear"),ie(e.type),Q(),u.showClose=!1,u.shortcut=null,setTimeout(()=>h(e.type),500)},he=()=>{e.appendToBody&&(u.disableCloseUnderTransfer=!0)},Ce=()=>{var X;u.visible=!1,a.nextTick(()=>{n("pick-success")}),(X=J==null?void 0:J.value)==null||X.blur(),Q()},Ae=(X,Z=!1,se,Me)=>{let j=X;if(e.multiple){const V=j.getTime(),H=u.internalValue.findIndex(ye=>ye&&ye.getTime()===V),te=[...u.internalValue,j].filter(Boolean).map(ye=>ye.getTime()).filter((ye,we,Ne)=>Ne.indexOf(ye)===we&&we!==H);u.internalValue=te.map(ye=>new Date(ye))}else j=Di(X,e.type,e.multiple,e.format),u.internalValue=Array.isArray(j)?j:[j];if(u.internalValue[0]){const[V]=u.internalValue;u.focusedDate=V}u.focusedTime=Te(U({},u.focusedTime),{time:u.internalValue.map(nl)}),x.value||(h(e.type),u.visible=Z),se==="upToNow"&&e.type==="daterange"&&Ce(),u.shortcut=Me,ie(se);const B=e.shortcuts.findIndex(V=>V===u.shortcut);n("shortcut-change",u.shortcut,B)},oe=a.ref(null);return console.error(w),console.error(w.value),Te(U({},a.toRefs(u)),{panel:w,publicStringValue:p,opened:y,visualValue:v,displayValue:L,isConfirm:x,hasHeader:k,hasFooter:C,hasShortcuts:b,fontSizeCls:I,longWidthCls:N,localReadonly:T,allowCrossDayProp:P,ownPickerProps:A,pickerDropdownRef:ne,inputRef:J,triggerRef:oe,pickerPanelRef:_,handleClose:ce,handleIconClick:re,handleInputMouseenter:ae,handleInputMouseleave:ue,handleFocus:W,handleBlur:F,handleKeydown:K,handleInputChange:Y,handleClear:fe,handleTransferClick:he,onPick:Ae,onPickSuccess:Ce})},render(){var n,i,l;const e=a.createVNode("div",null,[a.createVNode("span",{class:["icon-wrapper",this.disabled?"disabled":""],onClick:this.handleIconClick},[this.type==="time"||this.type==="timerange"?a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"time"},[a.createVNode("path",{fill:"#c4c6cc",d:"M512,128c51.9,0,102.2,10.1,149.5,30.2c45.7,19.3,86.8,47,122.1,82.3s63,76.4,82.3,122.1c20,47.3,30.2,97.6,30.2,149.5S886,614.3,865.9,661.6c-19.3,45.7-47,86.8-82.3,122.1s-76.4,63-122.1,82.3c-47.3,20-97.6,30.2-149.5,30.2S409.8,886.1,362.5,866c-45.7-19.3-86.8-47-122.1-82.3s-63-76.4-82.3-122.1c-20-47.3-30.2-97.6-30.2-149.5s10.1-102.2,30.2-149.5c19.3-45.7,47-86.8,82.3-122.1s76.4-63,122.1-82.3C409.8,138.1,460.1,128,512,128 M512,64C264.6,64,64,264.6,64,512s200.6,448,448,448s448-200.6,448-448S759.4,64,512,64L512,64z"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"512,512 512,256 448,256 448,512 448,576 512,576 768,576 768,512"},null)])]):a.createVNode("svg",{class:"picker-icon",x:"0px",y:"0px",viewBox:"0 0 1024 1024"},[a.createVNode("g",{id:"date"},[a.createVNode("path",{fill:"#c4c6cc",d:"M896,128h-96v64h64v112H160V192h64v-64h-96c-17.7,0-32,14.3-32,32v736c0,17.7,14.3,32,32,32h768c17.7,0,32-14.3,32-32V160C928,142.3,913.7,128,896,128z M160,864V368h704v496H160z"},null),a.createVNode("rect",{x:"416",y:"128",fill:"#c4c6cc",width:"192",height:"64"},null),a.createVNode("rect",{x:"288",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("rect",{x:"672",y:"96",fill:"#c4c6cc",width:"64",height:"128"},null),a.createVNode("polygon",{fill:"#c4c6cc",points:"403.7,514.4 557.1,514.4 557.1,515.3 420.1,765.5 483.5,765.5 620.3,504.3 620.3,466.5 403.7,466.5"},null)])])]),a.createVNode("input",{type:"text",class:["bk-date-picker-editor",this.readonly?"readonly":"",this.fontSizeCls,this.behavior==="simplicity"?"only-bottom-border":""],ref:"inputRef",key:this.forceInputRerender,readonly:this.localReadonly,disabled:this.disabled,placeholder:this.placeholder,value:this.displayValue,onFocus:this.handleFocus,onClick:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onChange:this.handleInputChange},null),this.clearable&&this.showClose?a.createVNode(cn,{onClick:this.handleClear,class:"clear-action"},null):""]),t=this.hasShortcuts?{shortcuts:()=>{var o,c;return((c=(o=this.$slots).shortcuts)==null?void 0:c.call(o))||null}}:{};return a.withDirectives(a.createVNode("div",{class:["bk-date-picker",this.type==="datetimerange"?"long":"",this.longWidthCls]},[a.createVNode("div",{ref:"triggerRef",class:"bk-date-picker-rel",onMouseenter:this.handleInputMouseenter,onMouseleave:this.handleInputMouseleave},[(l=(i=(n=this.$slots).trigger)==null?void 0:i.call(n))!=null?l:e]),a.createVNode(a.Teleport,{to:"body",disabled:!this.appendToBody},{default:()=>[a.createVNode(a.Transition,{name:"bk-fade-down-transition"},{default:()=>[a.withDirectives(a.createVNode(Vc,{class:[this.appendToBody?"bk-date-picker-transfer":""],ref:"pickerDropdownRef",triggerRef:this.triggerRef,placement:this.placement,extPopoverCls:this.extPopoverCls,appendToBody:this.appendToBody,onClick:this.handleTransferClick},{default:()=>{var o,c,f,u,h,m;return[this.hasHeader?a.createVNode("div",{class:["bk-date-picker-top-wrapper",this.headerSlotCls]},[(f=(c=(o=this.$slots).header)==null?void 0:c.call(o))!=null?f:null]):null,a.createVNode(_h,{ref:"pickerPanelRef",clearable:this.clearable,confirm:this.isConfirm,shortcuts:this.shortcuts,multiple:this.multiple,shortcutClose:this.shortcutClose,value:this.internalValue,startDate:this.startDate,disableDate:this.disableDate,onPick:this.onPick,"onPick-clear":this.handleClear,"onPick-success":this.onPickSuccess,disabledHours:this.ownPickerProps.disabledHours,disabledMinutes:this.ownPickerProps.disabledMinutes,disabledSeconds:this.ownPickerProps.disabledSeconds},t),this.hasFooter?a.createVNode("div",{class:["bk-date-picker-footer-wrapper",this.footerSlotCls]},[(m=(h=(u=this.$slots).footer)==null?void 0:h.call(u))!=null?m:null]):null]}}),[[a.vShow,this.opened]])]})]})]),[[a.resolveDirective("clickoutside"),this.handleClose]])}});const Zh=He(by);var Hn=(e=>(e.OBJECT_ARRAY="objectArray",e.BASE_ARRAY="baseArray",e.NOT_ARRAY="notArray",e))(Hn||{});const Cy={title:g.arrayOf(g.string).def([]),extCls:g.string.def(""),searchPlaceholder:g.string.def(""),settingKey:g.string.def("id"),displayKey:g.string.def("value"),sortKey:g.string.def("value"),showOverflowTips:g.bool.def(!1),searchable:g.bool.def(!1),sortable:g.bool.def(!1),sourceList:g.arrayOf(g.any).def([]),targetList:g.arrayOf(g.any).def([]),emptyContent:g.arrayOf(g.string).def([])};function My(e,t,n){const i=a.ref([]),l=a.ref([]),o=()=>{e.value.forEach(c=>{const f=c[n.value];t.value.includes(f)?l.value.push(c):i.value.push(c)})};return o(),a.watch(()=>[e,t,n],o),{selectList:i,selectedList:l}}function wy(e,t){const n=a.ref(""),i=a.computed(()=>e.value.filter(l=>{const o=l[t.value];return o instanceof Object?!1:o.toString().includes(n.value)}));return{selectSearchQuery:n,selectListSearch:i}}var vy=a.defineComponent({name:"Transfer",props:Cy,emits:["change","update:targetList"],setup(e,{emit:t}){const n=a.computed(()=>Array.isArray(e.sourceList)?e.sourceList.every(b=>b.toString().includes("[object Object]"))?Hn.OBJECT_ARRAY:Hn.BASE_ARRAY:Hn.NOT_ARRAY),i=a.computed(()=>n.value===Hn.BASE_ARRAY?"value":e.settingKey),l=a.computed(()=>n.value===Hn.BASE_ARRAY?"value":e.displayKey),o=a.computed(()=>e.sortKey||l.value),c=a.computed(()=>{switch(n.value){case Hn.BASE_ARRAY:return[...new Set(e.sourceList)].map(C=>({value:C}));case Hn.OBJECT_ARRAY:return[...e.sourceList];default:return[]}}),{targetList:f}=a.toRefs(e),{selectList:u,selectedList:h}=My(c,f,i),{selectSearchQuery:m,selectListSearch:p}=wy(u,l),w=a.computed(()=>[...p.value].sort((C,b)=>{const I=C[o.value],N=b[o.value];return I>N?1:-1})),y=a.computed(()=>[...h.value].sort((C,b)=>{const I=C[o.value],N=b[o.value];return I>N?1:-1})),v=()=>{u.value=[],h.value=[...c.value],k()},L=()=>{u.value=[...c.value],h.value=[],k()},x=(C,b)=>{const I=b?u:h,N=b?h:u,T=I.value.findIndex(A=>A[i.value]===C);N.value.push(...I.value.splice(T,1)),k()},k=()=>{const C=u.value.map(I=>I[i.value]),b=h.value.map(I=>I[i.value]);t("update:targetList",b),t("change",n.value===Hn.BASE_ARRAY?C:u.value.map(I=>a.toRaw(I)),n.value===Hn.BASE_ARRAY?b:h.value.map(I=>a.toRaw(I)),b)};return{selectSearchQuery:m,selectListSearch:p,selectedList:h,selectListSort:w,selectedListSort:y,settingCode:i,displayCode:l,allToRight:v,allToLeft:L,handleItemClick:x}},render(){const e=this.sortable?this.selectListSort:this.selectListSearch,t=this.sortable?this.selectedListSort:this.selectedList,n=c=>{var p,w;const f=c==="left-header",u=f?`${(p=this.title[0])!=null?p:"\u5DE6\u4FA7\u5217\u8868"}`:`${(w=this.title[1])!=null?w:"\u53F3\u4FA7\u5217\u8868"}`,h=f?!e.length:!t.length,m=()=>{h||(f?this.allToRight():this.allToLeft())};return this.$slots[c]?a.createVNode("div",{class:"slot-header"},[this.$slots[c]()]):a.createVNode("div",{class:"header"},[`${u}\uFF08\u5171${f?e.length:t.length}\u6761\uFF09`,a.createVNode("span",{class:{disabled:h},onClick:()=>m()},[f?"\u5168\u90E8\u6DFB\u52A0":"\u6E05\u7A7A"])])},i=c=>{var h;const f=c==="left-empty-content",u=(h=f?this.emptyContent[0]:this.emptyContent[1])!=null?h:f?"\u65E0\u6570\u636E":"\u672A\u9009\u62E9\u4EFB\u4F55\u9879";return this.$slots[c]?a.createVNode("div",null,[this.$slots[c]()]):a.createVNode("div",{class:"empty"},[u])},l=(c,f=!0)=>a.createVNode("div",{class:"item-content"},[a.createVNode("span",{class:"content-text",title:c[this.displayCode]},[c[this.displayCode]]),a.createVNode("span",{class:"icon-wrapper"},[f?a.createVNode(Po,{class:"bk-icon"},null):a.createVNode(An,{class:"bk-icon"},null)])]),o=c=>{const f=c==="left",u=f?e:t,h=f?"source-option":"target-option",m=f?"left-empty-content":"right-empty-content";return u.length?a.createVNode("ul",{class:["content",this.searchable&&f?"is-search":""]},[u.map(p=>{var w,y,v;return a.createVNode("li",{key:p[this.settingCode],class:[this.$slots[h]?"custom-item":""],onClick:()=>this.handleItemClick(p[this.settingCode],f)},[(v=(y=(w=this.$slots)[h])==null?void 0:y.call(w,p))!=null?v:l(p,f)])})]):i(m)};return a.createVNode("div",{class:["bk-transfer",this.extCls]},[a.createVNode("div",{class:"source-list"},[n("left-header"),this.searchable&&a.createVNode(Ui,{modelValue:this.selectSearchQuery,"onUpdate:modelValue":c=>this.selectSearchQuery=c,class:"transfer-search-input",clearable:!0,placeholder:this.searchPlaceholder||"\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u5B57",type:"search","left-icon":"bk-icon icon-search"},null),o("left")]),a.createVNode("div",{class:"transfer"},null),a.createVNode("div",{class:"target-list"},[n("right-header"),o("right")])])}});const Gh=He(vy);var Pr=(e=>(e.NODE_CLICK="nodeClick",e.NODE_COLLAPSE="nodeCollapse",e.NODE_EXPAND="nodeExpand",e.NODE_CHECKED="nodeChecked",e))(Pr||{});const il=(...e)=>!0,Iy={nodeClick:il,nodeCollapse:il,nodeExpand:il,nodeChecked:il};var de=(e=>(e.DEPTH="__depth",e.INDEX="__index",e.UUID="__uuid",e.PARENT_ID="__parent_id",e.HAS_CHILD="__has_child",e.PATH="__path",e.IS_ROOT="__is_root",e.ORDER="__order",e.IS_OPEN="__is_open",e.IS_CHECKED="__is_checked",e.IS_SELECTED="__is_selected",e.IS_ASYNC_INIT="__is_async_init",e.IS_MATCH="__is_match",e.IS_NULL="__IS_NULL",e.IS_CACHED="__is_cached",e.IS_ASYNC="__is_async",e.IS_LOADING="__is_loading",e.TREE_NODE_ATTR="__attr__",e))(de||{});const ji={__is_open:"isOpen",__is_selected:"selected",__is_match:"isMatch",__has_child:"hasChild",__is_checked:"checked",__is_async:"async",__is_loading:"loading",__is_root:"isRoot"},Ny={data:g.arrayOf(g.any).def([]),label:g.oneOfType([g.func.def(void 0),g.string.def("label")]),nodeKey:g.string.def(void 0),children:g.string.def("children"),indent:g.number.def(18),lineHeight:g.number.def(32),levelLine:g.oneOfType([g.bool.def(!1),g.func.def(void 0),g.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:g.bool.def(!1),prefixIcon:g.oneOfType([g.func.def(()=>{}),g.bool.def(!1)]).def(!0),async:g.shape({callback:g.func.def(void 0),cache:g.bool.def(!0),deepAutoOpen:g.commonType(["once","every"],"columnType").def("once")}),offsetLeft:g.number.def(5),search:g.oneOfType([g.shape({value:g.oneOfType([g.number,g.string,g.bool]).def(""),match:g.oneOfType([g.commonType(["fuzzy","full"],"TreeSearchMatchType"),g.func]),resultType:g.commonType(["tree","list"],"TreeSearchResultType").def("tree"),openResultNode:g.bool}),g.string,g.number,g.bool]).def(void 0),emptyText:g.string.def("\u6CA1\u6709\u6570\u636E"),draggable:g.bool.def(!1),dragSort:g.bool.def(!1),selectable:g.bool.def(!0),showCheckbox:g.bool.def(!1),showNodeTypeIcon:g.bool.def(!0),selected:g.oneOfType([g.string,null,g.number,g.object]).def(null),autoCheckChildren:g.bool.def(!0),autoOpenParentNode:g.bool.def(!0)};var Ly=(e,{slots:t})=>({renderEmpty:n=>a.createVNode(Ps,{scene:"part",type:n},{default:()=>{var i,l;return[(l=(i=t.default)==null?void 0:i.call(t))!=null?l:e.emptyText]}})}),al=(e,t)=>{const n=E=>e.schema.get(E),i=(E,ne)=>{var _;return(_=n(E[de.UUID]))==null?void 0:_[ne]},l=(E,ne,_)=>{e.schema.set(E[de.UUID],Te(U({},n(E[de.UUID])),{[ne]:_}))},o=E=>i(E,de.PATH),c=E=>i(E,de.UUID),f=E=>i(E,de.IS_ROOT),u=E=>i(E,de.IS_OPEN),h=E=>i(E,de.HAS_CHILD),m=E=>i(E,de.IS_MATCH),p=E=>i(E,de.IS_CHECKED),w=E=>i(E,de.PARENT_ID),y=E=>i({[de.UUID]:E},de.PARENT_ID),v=E=>i(E,de.IS_LOADING),L=(E,ne)=>{l(E,de.IS_LOADING,ne)},x=E=>e.schema.delete(E),k=E=>n(w(E)),C=E=>{var ne;return typeof E=="object"?u(E):typeof E=="string"?(ne=n(E))==null?void 0:ne[de.IS_OPEN]:!1},b=E=>C(i(E,de.PARENT_ID)),I=E=>f(E)||b(E),N=E=>E.split("-").reduce((_,ce)=>{const re=Number(ce);return Array.isArray(_)?_[re]:_[t.children][re]},t.data),T=E=>{const ne=e.schema;return Array.prototype.filter.call(Array.from(ne.keys()),_=>ne.get(_)[de.PARENT_ID]===E[de.UUID])},A=E=>N(o({[de.UUID]:E})),P=E=>f({[de.UUID]:E})?{[t.children]:t.data}:A(y(E)),J=E=>({[ji[de.IS_LOADING]]:i(E,de.IS_LOADING),[ji[de.HAS_CHILD]]:h(E),[ji[de.IS_MATCH]]:m(E),[ji[de.IS_CHECKED]]:p(E),[ji[de.IS_OPEN]]:u(E),[ji[de.IS_ROOT]]:f(E),fullPath:i(E,de.PATH),uuid:c(E),parentId:i(E,de.PARENT_ID)});return{getSchemaVal:n,getNodeAttr:i,getNodeId:c,getNodeParentId:w,getNodeParentIdById:y,getParentNodeData:P,getParentNode:k,setNodeAttr:l,getNodePath:o,isRootNode:f,isNodeOpened:u,hasChildNode:h,isItemOpen:C,isNodeChecked:p,isNodeMatched:m,isNodeLoading:v,checkNodeIsOpen:I,getSourceNodeByPath:N,getSourceNodeByUID:A,deleteNodeSchema:x,resolveScopedSlotParam:J,setTreeNodeLoading:L,extendNodeAttr:E=>Te(U({},E),{[de.TREE_NODE_ATTR]:J(E)}),getChildNodes:T}};const Fh="1px dashed #c3cdd7",Yh=(e,t,n=null,i=null,l=null,o=[])=>{const c=e[t];return typeof c=="boolean"?c?i:l:Uh(n,e,t,o)},Uh=(e,t,n,i=[])=>{const l=t[n];if(typeof l=="string")return typeof e=="object"&&e!==null?(Object.prototype.hasOwnProperty.call(e,l)||console.error(`cannot find node label with key ${l}`),e[l]):l;if(typeof l=="function"){const o=l.apply(globalThis,[e,...i]);if(typeof o=="string")return o;console.error("props label with function return value is not string, please check and return string");return}},$h=(e,t)=>Uh(e,t,"label"),Gc=(e,t)=>e.get(t)||{},ky=(e,t,n)=>{var i;return(i=Gc(e,t))==null?void 0:i[n]},Ty=(e,t)=>({"--level-line":Yh(t,"levelLine",e,Fh,null,["tree"]),"--lineHeight":`${t.lineHeight}px`,"--indent":`${t.indent}px`,"--offset-left":`${t.offsetLeft}px`}),xy=(e,t,n={})=>{const{schema:i}=n,l=ky(i,e[de.UUID],de.DEPTH);return U({"--depth":l},typeof t.levelLine=="function"?{"--level-line":Yh(t,"levelLine",e,Fh,null,["node"])}:{})},Sy=(e,t,n)=>{const{__is_root:i,__is_open:l}=Gc(t,e[de.UUID])||{};return{"is-root":i,"bk-tree-node":!0,"is-open":l,"is-virtual-render":n.virtualRender,"level-line":n.levelLine}},Dy=(e,t)=>{const{__is_checked:n,__is_selected:i}=Gc(t,e[de.UUID])||{};return{"is-checked":n,"is-selected":i,[_e("node-row")]:!0}},jy=(e,t,n,i,l)=>{zy(e,t,n,{[i]:l})},zy=(e,t,n,i)=>{const o=e.split("-").reduce((c,f)=>{const u=Number(f);return Array.isArray(c)?c[u]:c[n][u]},t);Object.assign(o,i||{})},Or=e=>e==null?{__IS_NULL:!0}:typeof e=="string"||typeof e=="number"||typeof e=="symbol"?{[de.UUID]:e}:(Object.prototype.hasOwnProperty.call(e,de.UUID)||console.error("setNodeAction Error: node id cannot found"),e);var Xh=(e,t)=>{const{setNodeAttr:n,getNodePath:i,getNodeAttr:l,resolveScopedSlotParam:o,setTreeNodeLoading:c}=al(t,e),f=(m,p)=>{if(typeof m=="object"&&m!==null){n(p,de.IS_OPEN,!0);const w=Array.isArray(m)?m:[m];return jy(i(p),e.data,e.children,e.children,w),Promise.resolve(m)}return Promise.resolve(m)},u=m=>{const{callback:p=null,cache:w=!0}=e.async||{};if(typeof p=="function"&&l(m,de.IS_ASYNC)){if(n(m,de.IS_ASYNC_INIT,!0),!l(m,de.IS_CACHED)){n(m,de.IS_CACHED,w);const y=o(m),v=p(m,L=>f(L,m),y);if(typeof v=="object"&&v!==null)return c(m,!0),v instanceof Promise?Promise.resolve(v.then(L=>f(L,m)).catch(L=>console.error("load remote data error:",L)).finally(()=>{c(m,!1),n(m,de.IS_CACHED,!0)})):(f(v,m),c(m,!1),Promise.resolve(!0))}return Promise.resolve(!0)}return Promise.resolve(!0)},h=()=>{const m=t.data.filter(p=>l(p,de.IS_ASYNC)&&p[ji[de.IS_OPEN]]&&!l(p,de.IS_ASYNC_INIT));m.length&&Promise.all(m.map(p=>u(p))).then(()=>{h()}).catch(p=>{console.warn(p)})};return{asyncNodeClick:u,deepAutoOpen:h}},Py=(e,t,n,i,l,o)=>{let c=e.selected;const{setNodeAttr:f,getNodePath:u,getSchemaVal:h,getNodeAttr:m,getNodeId:p,getChildNodes:w,isRootNode:y,hasChildNode:v,isItemOpen:L,isNodeOpened:x,isNodeLoading:k,isNodeChecked:C,getParentNode:b,resolveScopedSlotParam:I,extendNodeAttr:N}=al(n,e),{registerNextLoop:T}=o,{asyncNodeClick:A,deepAutoOpen:P}=Xh(e,n),J=Z=>L(Z)?a.createVNode(Ro,{class:[_e("tree-icon"),_e("node-prefix")]},null):a.createVNode(Wo,{class:[_e("tree-icon"),_e("node-prefix")]},null),z=Z=>{if(typeof Z=="string")return Z;if(typeof Z=="object"&&Z!==null){if(Z.__v_isVNode)return Z;const{node:se,className:Me,text:j,style:B}=Z;return a.h(se,{class:Me,style:B},j)}return null},E=Z=>{var se,Me,j;return((j=(Me=(se=t.slots).nodeLoading)==null?void 0:Me.call(se,N(Z)))!=null?j:k(Z))?a.createVNode(pr,null,null):""},ne=Z=>{if(t.slots.nodeAction)return t.slots.nodeAction(N(Z));let se=null;return k(Z)?E(Z):typeof e.prefixIcon=="function"&&(se=e.prefixIcon(N(Z),"node_action"),se!=="default")?z(se):(se==="default"||typeof e.prefixIcon=="boolean"&&e.prefixIcon)&&(v(Z)||Z.async||!e.autoCheckChildren)?L(Z)?a.createVNode(Ns,{class:_e("node-prefix")},null):a.createVNode(Ss,{class:_e("node-prefix")},null):null},_=Z=>{if(!e.showNodeTypeIcon)return null;if(t.slots.nodeType)return t.slots.nodeType(N(Z));let se=null;return typeof e.prefixIcon=="function"&&(se=e.prefixIcon(N(Z),"node_type"),se!=="default")?z(se):se==="default"||typeof e.prefixIcon=="boolean"&&e.prefixIcon?y(Z)||v(Z)?J(Z):a.createVNode(Fo,{class:[_e("tree-icon"),_e("node-prefix")]},null):null},ce=(Z,se)=>{const Me=b(Z);Me&&(f(Me,de.IS_CHECKED,se),y(Me)||ce(Me,se))},re=(Z,se,Me)=>{w(Z).forEach(j=>{f({[de.UUID]:j},se,Me),re({[de.UUID]:j},se,Me)})},ae=(Z,se)=>{f(Z,de.IS_CHECKED,!!se),re(Z,de.IS_CHECKED,!!se),ce(Z,se),t.emit(Pr.NODE_CHECKED,l.value.filter(Me=>C(Me)).map(Me=>Me[de.UUID]))},ue=Z=>C(Z)&&!l.value.filter(se=>{var Me;return(Me=u(se))==null?void 0:Me.startsWith(u(Z))}).every(se=>C(se)),ie=Z=>C(Z)||l.value.filter(se=>{var Me;return(Me=u(se))==null?void 0:Me.startsWith(u(Z))}).some(se=>C(se)),Y=Z=>e.showCheckbox?a.createVNode(Ii,{size:"small",modelValue:ie(Z),indeterminate:ue(Z),onChange:se=>ae(Z,se)},null):null,W=(Z,se=null,Me=null,j=!0)=>{const B=se===null?!L(Z):!!se;if(B||re(Z,de.IS_OPEN,B),f(Z,de.IS_OPEN,B),j){const V=L(Z)?Pr.NODE_EXPAND:Pr.NODE_COLLAPSE;t.emit(V,Z,I(Z),h(Z[de.UUID]),Me)}},Q=(Z,se,Me)=>{if(Array.isArray(Z)){Z.forEach(j=>f(Or(j),se,Me));return}f(Or(Z),se,Me)},F=(Z,se=!0,Me=!1)=>{const j=Or(Z);if(!j[de.IS_NULL])if(Me)if(se){if(Q(j,de.IS_OPEN,!0),!y(j)){const B=m(j,de.PARENT_ID);F(B,!0,!0)}}else W(j,!1,null,!1);else Q(j,de.IS_OPEN,se)},K=(Z,se)=>{if(x(Z)){W(Z,!1,se);return}A(Z).finally(()=>{m(Z,de.IS_LOADING)?T("setNodeOpenedAfterLoading",{type:"once",fn:()=>W(Z,!0,se)}):W(Z,!0,se)})},fe=(Z,se)=>{Z.stopImmediatePropagation(),Z.stopPropagation(),Z.preventDefault(),K(se,Z)},he=(Z,se=!0,Me=!0)=>{const j=Array.isArray(Z)?Z:[Z];if(!j.length)return;const B=Or(j[0]);B[de.IS_NULL]||(e.selectable?(c!=null&&f({[de.UUID]:c},de.IS_SELECTED,!se),e.selected&&e.selected!==c&&f({[de.UUID]:e.selected},de.IS_SELECTED,!se),f(B,de.IS_SELECTED,se),c=p(B),Me&&j.length===1&&F(B,!0,!0),m(B,de.IS_ASYNC)&&A(B).then(()=>{a.nextTick(()=>{j.shift(),he(j,se,Me)})})):console.warn("props.selectable is false or undefined, please set selectable with true"))},Ce=(Z,se)=>{he(Z,!0,!1),x(Z)||K(Z,se);const Me=Pr.NODE_CLICK;t.emit(Me,Z,I(Z),h(Z[de.UUID]),se)},Ae=(Z,se)=>{if(y(se))return!1;const Me=u(se),j=`${Me}`.split("-").slice(0,Z+1);if(j.join("-")===Me)return!0;const V=j.pop(),H=parseInt(V,10);j.push(`${H+1}`);const $=j.join("-");return l.value.some(te=>te[de.PATH]===$)},oe=Z=>{if(!e.levelLine)return null;const se=j=>({"--depth":j}),Me=m(Z,de.DEPTH)+1;return new Array(Me).fill("").map((j,B)=>B).filter(j=>Ae(j,Z)).filter(j=>j>0).map(j=>a.createVNode("span",{class:"node-virtual-line",style:se(Me-j)},null))};return{renderTreeNode:Z=>{var se,Me,j,B,V;return a.createVNode("div",{"data-tree-node":p(Z),key:p(Z),class:Dy(Z,n.schema)},[a.createVNode("div",{class:Sy(Z,n.schema,e),style:xy(Z,e,n),onClick:H=>Ce(Z,H)},[a.createVNode("span",{class:[_e("node-action")],onClick:H=>fe(H,Z)},[ne(Z)]),a.createVNode("span",{class:_e("node-content")},[[Y(Z),_(Z)],a.createVNode("span",{class:_e("node-text")},[(j=(Me=(se=t.slots).node)==null?void 0:Me.call(se,N(Z)))!=null?j:[$h(Z,e)]]),(V=(B=t.slots).nodeAppend)==null?void 0:V.call(B,N(Z))]),oe(Z)])])},hanldeTreeNodeClick:K,deepAutoOpen:P,asyncNodeClick:A,setNodeAction:Q,setNodeOpened:W,setSelect:he,setOpen:F}},Oy=(e,t,n)=>{const{getSourceNodeByUID:i,getNodeParentIdById:l,getParentNodeData:o,getNodeAttr:c,getNodePath:f,isRootNode:u}=al(n,e),h=C=>C.target.closest("[data-tree-node]"),m=C=>{h(C).removeEventListener("mouseup",m)},p=C=>{const b=h(C);b.setAttribute("draggable","true"),b.addEventListener("mouseup",m)},w=C=>{C.preventDefault();const b=h(C),I=C.dataTransfer.getData("node-id"),N=b.getAttribute("data-tree-node"),T=L(I,N)?"move":"none";C.dataTransfer.effectAllowed=T,C.dataTransfer.dropEffect=T},y=C=>{C.dataTransfer.effectAllowed="move",C.dataTransfer.dropEffect="move";const b=h(C);C.dataTransfer.setData("text/plain",""),C.dataTransfer.setData("node-id",b.getAttribute("data-tree-node"))},v=C=>{C.preventDefault(),C.stopPropagation();const b=h(C),I=C.dataTransfer.getData("node-id"),N=b.getAttribute("data-tree-node");Reflect.apply(e.dragSort?x:k,globalThis,[I,N])},L=(C,b)=>{const I=f({[de.UUID]:C}),N=f({[de.UUID]:b}),T=l(C),A=l(b);return T===A?!0:I.indexOf(N)===-1&&N.indexOf(I)===-1},x=(C,b)=>{if(!L(C,b))return;const I=JSON.parse(JSON.stringify(i(C))),N=JSON.parse(JSON.stringify(i(b))),T=o(C),A=o(b),P=c({[de.UUID]:C},de.INDEX),J=c({[de.UUID]:b},de.INDEX);T==null||T[e.children].splice(P,1,N),A==null||A[e.children].splice(J,1,I)},k=(C,b)=>{const I=i(C),N=i(b);let T=null;if(u({[de.UUID]:C}))T=e.data;else{const A=l(C);if(A!=null){T=i(A);const P=c({[de.UUID]:C},de.INDEX);T==null||T[e.children].splice(P,1)}}N[e.children]||(N[e.children]=[]),N[e.children].unshift(I)};a.onMounted(()=>{if(e.draggable&&t.value){const C=t.value.$el;C.addEventListener("mousedown",p),C.addEventListener("dragstart",y),C.addEventListener("dragover",w),C.addEventListener("drop",v)}}),a.onUnmounted(()=>{if(e.draggable&&t.value){const C=t.value.$el;C.removeEventListener("mousedown",p),C.removeEventListener("dragstart",y),C.removeEventListener("dragover",w),C.removeEventListener("drop",v)}})},Ey=e=>{var w;const t=a.toRef(e,"search"),{openResultNode:n=!1,resultType:i="tree"}=(w=e.search)!=null?w:{},l=y=>["string","number","boolean"].includes(typeof y),o=(y,v)=>y===v,c=(y,v)=>new RegExp(`${y}`,"i").test(`${v}`),f=(y,v)=>Reflect.apply(y,globalThis,v),u=t.value===void 0||t.value===!1,h=(y,v)=>{if(u)return!0;if(l(t.value))return f(c,[t.value,y,v]);const{value:L="",match:x="fuzzy"}=t.value,C=typeof x=="function"?x:x==="fuzzy"?c:o;return`${L}`.length===0?!0:f(C,[L,y,v])},m=a.computed(()=>t.value!==!1&&(l(t.value)?`${t.value}`.length>0:typeof t.value=="object"));return{searchFn:h,refSearch:t,isSearchActive:m,isSearchDisabled:u,openResultNode:n,resultType:i,isTreeUI:i==="tree"}},Ay=e=>{var x;const t=(k,C=void 0,b=[])=>{const{data:I,children:N}=k,T=[],A=[];let P=0;const J=new Map;function z(ie,Y,W,Q){if(ie!=null&&J.has(ie)&&![de.UUID,de.PARENT_ID].includes(Y)){const F=J.get(ie);Object.prototype.hasOwnProperty.call(F,Y)&&typeof Q=="function"&&Reflect.apply(Q,self,[F,Y,W])&&(Object.assign(F,{[Y]:W}),z(F[de.PARENT_ID],Y,W,Q))}}function E(ie){let Y=null;return typeof k.nodeKey=="string"&&(Y=ie[k.nodeKey]||Bi.v4()),Y||ie[de.UUID]||Bi.v4()}const ne={[de.IS_OPEN]:()=>!1,[de.IS_CHECKED]:()=>!1,[de.IS_MATCH]:()=>!0,[de.IS_SELECTED]:ie=>k.selected===ie,[de.IS_CACHED]:()=>!1,[de.IS_ASYNC]:()=>null,[de.IS_LOADING]:()=>!1};function _(ie,Y,W,Q=void 0){let F=Q;Q===void 0&&typeof ne[W]=="function"&&(F=ne[W](ie,Y));const K=ji[W];if(Object.prototype.hasOwnProperty.call(Y,K))return Y[K];const fe=(b||[]).find(Ce=>Ce[de.UUID]===ie);let he;return fe&&(he=fe[W]),he==null&&(he=F),he}function ce(ie,Y){return k.selectable?_(ie,Y,de.IS_SELECTED,k.selected===ie):!1}function re(ie,Y,W){var K;const Q=_(ie,Y,de.IS_OPEN),F=J.has(W)?(K=J.get(W))==null?void 0:K[de.IS_OPEN]:!0;return Q&&F}function ae(ie){return!ie[de.IS_OPEN]}function ue(ie,Y=0,W=null,Q=null){const F=ie.length;for(let K=0;K<F;K++){const fe=ie[K];if(Array.isArray(fe))ue(fe,Y,W,Q);else if(typeof fe=="object"&&fe!==null){const he=Q!==null?`${Q}-${K}`:`${K}`,Ce=`${E(fe)}`,Ae=!!(fe[N]||[]).length;let oe=_(Ce,fe,de.IS_OPEN);k.autoOpenParentNode?oe&&z(W,de.IS_OPEN,!0,ae):oe=re(Ce,fe,W),Object.assign(fe,{[de.UUID]:Ce});const X=k.showCheckbox&&_(Ce,fe,de.IS_CHECKED);X&&T.push(Ce),J.set(Ce,{[de.DEPTH]:Y,[de.INDEX]:K,[de.UUID]:Ce,[de.PARENT_ID]:W,[de.HAS_CHILD]:Ae,[de.PATH]:he,[de.IS_ROOT]:W===null,[de.ORDER]:P,[de.IS_SELECTED]:ce(Ce,fe),[de.IS_MATCH]:_(Ce,fe,de.IS_MATCH),[de.IS_OPEN]:oe,[de.IS_CHECKED]:X,[de.IS_CACHED]:_(Ce,fe,de.IS_CACHED),[de.IS_ASYNC]:_(Ce,fe,de.IS_ASYNC),[de.IS_LOADING]:_(Ce,fe,de.IS_LOADING),[N]:null}),P+=1,A.push(Te(U({},JSON.parse(JSON.stringify(fe,(Z,se)=>Z===k.children?null:se))),{[de.IS_OPEN]:oe,[N]:null})),Object.prototype.hasOwnProperty.call(fe,N)&&ue(fe[N]||[],Y+1,Ce,he)}}}return ue(C||I),k.showCheckbox&&(T==null||T.forEach(ie=>{Array.from(J.values()).filter(Y=>{var W;return(W=Y[de.PATH])==null?void 0:W.startsWith(J.get(ie)[de.PATH])}).forEach(Y=>Object.assign(Y,{[de.IS_CHECKED]:!0})),z(ie,de.IS_CHECKED,!0,()=>!0)})),[A,J]},n=t(e),i=new Map,l=[],o=[],c=a.reactive({data:n[0],schema:n[1],levelLineSchema:{}}),f=a.computed(()=>Array.from(c.schema.values())),{asyncNodeClick:u,deepAutoOpen:h}=Xh(e,c),m=k=>{l.push(k)},p=(k,C,b=!0)=>{b&&i.has(k)&&i.delete(k),i.set(k,C)},w=k=>typeof k=="function"?{type:"loop",fn:k}:typeof k=="object"&&typeof k.type=="string"&&typeof k.fn=="function"?k:(console.error("loop event error",k),null),y=k=>{var b;const C=w(k);return C!==null&&Reflect.apply(C.fn,globalThis,[]),(b=C==null?void 0:C.type)!=null?b:"once"},v=()=>{Array.from(i.keys()).forEach(k=>{const C=i.get(k);if(Array.isArray(C)){const b=[];C.forEach((I,N)=>{y(I)==="once"&&b.unshift(N)}),b.length&&b.forEach(I=>C.splice(I,1)),C.length===0&&i.delete(k)}else y(C)==="once"&&i.delete(k)})};a.watch(()=>[e.data],k=>{var b,I;const C=t(e,k,f.value);c.data=C[0],c.schema=C[1],((b=e.async)==null?void 0:b.callback)&&((I=e.async)==null?void 0:I.deepAutoOpen)==="every"&&h(),v()},{deep:!0}),e.selectable&&a.watch(()=>e.selected,k=>{o.length=0,l.forEach(C=>{Reflect.apply(C,globalThis,[k]),o.push(()=>Reflect.apply(C,globalThis,[k]))}),p("afterSelectWatch",o)},{immediate:!0});const L=k=>{p("afterDataUpdate",k)};return(x=e.async)!=null&&x.callback&&h(),{flatData:c,schemaValues:f,asyncNodeClick:u,deepAutoOpen:h,afterDataUpdate:L,registerNextLoop:p,onSelected:m}},Vy=a.defineComponent({name:"Tree",props:Ny,emits:Iy,setup(e,t){const{flatData:n,schemaValues:i,onSelected:l,registerNextLoop:o}=Ay(e),{setNodeAttr:c,checkNodeIsOpen:f,getNodeAttr:u,getNodePath:h,isRootNode:m,isNodeOpened:p,isNodeChecked:w,isNodeMatched:y,hasChildNode:v}=al(n,e),{searchFn:L,isSearchActive:x,refSearch:k,openResultNode:C,isTreeUI:b,isSearchDisabled:I}=Ey(e);I||a.watch([k],()=>{n.data.forEach(Y=>{const W=L($h(Y,e),Y);c(Y,de.IS_MATCH,W),C&&z(Y,!0,!0)})});const N=Y=>{if(x.value){const W=()=>b?i.value.some(Q=>{var F;return((F=Q[de.PATH])==null?void 0:F.startsWith(h(Y)))&&Q[de.IS_MATCH]}):!1;return u(Y,de.IS_MATCH)||W()}return!0},T=a.computed(()=>n.data.filter(Y=>f(Y)&&N(Y))),{renderTreeNode:A,hanldeTreeNodeClick:P,setNodeOpened:J,setOpen:z,setNodeAction:E,setSelect:ne,asyncNodeClick:_}=Py(e,t,n,T,i,{registerNextLoop:o}),ce=(Y,W=!0)=>{E(Or(Y),de.IS_CHECKED,W)};l(Y=>{ne(Y,!0,e.autoOpenParentNode)});const re=()=>n;t.expose({hanldeTreeNodeClick:P,isNodeChecked:w,isRootNode:m,isNodeOpened:p,isNodeMatched:y,hasChildNode:v,setOpen:z,setChecked:ce,setNodeAction:E,setNodeOpened:J,setSelect:ne,asyncNodeClick:_,getData:re});const ae=a.ref(),{renderEmpty:ue}=Ly(e,t);Oy(e,ae,n);const ie=Y=>{if(Y.length)return Y.map(A);const W=x.value?"search-empty":"empty";return ue(W)};return()=>a.createVNode(xr,{class:_e("tree"),style:Ty(null,e),list:T.value,lineHeight:e.lineHeight,enabled:e.virtualRender,contentClassName:_e("container"),throttleDelay:0,ref:ae},{default:Y=>ie(Y.data||[])})}});const Kh=He(Vy),qh=e=>e.__v_isVNode;var Jy=a.defineComponent({name:"ComposeFormItem",props:{headBackgroundColor:{type:String,default:"#FAFBFD"},tailBackgroundColor:String},render(){if(!this.$slots.default)return null;const e=this.$slots.default();if(e.length>1){const t=e.length;let n=0,i=null;for(;n<t;){if(qh(e[n])){i=e[n];break}n=n+1}let l=t-1,o=null;for(;l>=0&&l>n;){if(qh(e[l])){o=e[l];break}l=l-1}if(i&&o){i.props||(i.props={});let c="bk-compose-form-item-head";i.props.class&&(c+=` ${i.props.class}`),this.headBackgroundColor&&(i.props.style=Object.assign(i.props.style||{},{"background-color":this.headBackgroundColor})),i.props.class=c,o.props||(o.props={});let f="bk-compose-form-item-tail";o.props.class&&(f+=` ${o.props.class}`),this.tailBackgroundColor&&(o.props.style=Object.assign(o.props.style||{},{"background-color":this.tailBackgroundColor})),o.props.class=f}}return a.h("div",{class:"bk-compose-form-item"},e)}});const Qy={formType:g.oneOf(["default","vertical"]).def("default"),labelWidth:g.oneOfType([Number,String]),labelPosition:g.oneOf(["left","center","right"]),model:g.object,rules:g.object};var Ry=a.defineComponent({name:"Form",props:Qy,emits:["submit"],setup(e,t){let n=[];const i=u=>{n.push(u)},l=u=>{n=n.reduce((h,m)=>(m!==u&&h.push(m),h),[])};return a.provide(bf,{props:e,register:i,unregister:l}),{handleSubmit:u=>{u.preventDefault(),t.emit("submit")},validate:u=>{let h={};return u?h=(typeof u=="string"?[u]:u).reduce((p,w)=>Te(U({},p),{[w]:!0}),{}):h=n.reduce((m,p)=>p.property?Te(U({},m),{[p.property]:!0}):m,{}),Promise.all(n.reduce((m,p)=>(h[p.property]&&m.push(p.validate()),m),[])).then(()=>Promise.resolve(e.model))},clearValidate:u=>{let h={};u?h=(typeof u=="string"?[u]:u).reduce((p,w)=>Te(U({},p),{[w]:!0}),{}):h=n.reduce((m,p)=>Te(U({},m),{[p.property]:!0}),{}),n.forEach(m=>h[m.property]&&m.clearValidate())}}},render(){var t,n;const e=Se({"bk-form":!0,[`bk-form--${this.formType}`]:!0});return a.createVNode("form",{class:e,onSubmit:this.handleSubmit},[(n=(t=this.$slots).default)==null?void 0:n.call(t)])}}),Ln={required:e=>e!==""&&e!==void 0&&e!==null,min:(e,t)=>e>=t,max:(e,t)=>t>=e,email:e=>/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/.test(e),maxlength:(e,t)=>e.length<=t,pattern:(e,t)=>t.test(e)};const Wy={label:g.string,labelWidth:g.oneOfType([Number,String]),labelPosition:g.oneOf(["left","center","right"]),property:g.string.def(""),required:g.bool.def(!1),email:g.bool.def(!1),max:g.number,min:g.number,maxlength:g.number,rules:g.array,autoCheck:g.bool.def(!1),description:g.string,errorDisplayType:g.oneOf(["tooltips","normal"]).def("normal")},Hy=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),By=e=>{const t=[];return e.required&&t.push({validator:Ln.required,message:`${e.label}\u4E0D\u80FD\u4E3A\u7A7A`,trigger:"blur"}),e.email&&t.push({validator:Ln.email,message:`${e.label}\u683C\u5F0F\u4E0D\u6B63\u786E`,trigger:"blur"}),Number(e.max)>-1&&t.push({validator:n=>Ln.max(n,e.max),message:`${e.label}\u6700\u5927\u503C${e.max}`,trigger:"blur"}),Number(e.min)>-1&&t.push({validator:n=>Ln.min(n,e.min),message:`${e.label}\u6700\u5C0F\u503C${e.min}`,trigger:"blur"}),Number(e.maxlength)>-1&&t.push({validator:n=>Ln.maxlength(n,e.maxlength),message:`${e.label}\u6700\u5927\u957F\u5EA6${e.maxlength}`,trigger:"blur"}),t},_y=(e,t)=>{const n=e.reduce((i,l)=>{let o;if(l.required)o=Ln.required;else if(l.email)o=Ln.email;else if(Number(l.max)>-1)o=c=>Ln.max(c,l.max);else if(Number(l.min)>-1)o=c=>Ln.min(c,l.max);else if(Number(l.maxlength)>-1)o=c=>Ln.min(c,l.max);else if(Object.prototype.toString.call(l.pattern)==="[object RegExp]")o=c=>Ln.pattern(c,l.pattern);else if(Object.prototype.toString.call(l.validator)==="[object Function]")o=l.validator;else return i;return i.push({validator:o,message:l.message,trigger:l.trigger}),i},[]);return[...t,...n]},Zy=(e,t)=>t.reduce((n,i)=>!i.trigger||!e?(n.push(i),n):((Array.isArray(i.trigger)?i.trigger:[i.trigger]).includes(e)&&n.push(i),n),[]),e9=e=>e!==void 0;var Gy=a.defineComponent({name:"FormItem",directives:{bkTooltips:dc},props:Wy,setup(e){const t=a.getCurrentInstance(),n=a.reactive({isError:!1,errorMessage:""}),i=s4(),l=Boolean(i),o=a.computed(()=>l?i.props.formType==="vertical":!1),c=a.computed(()=>{const h={width:"",paddingRight:"",textAlign:""},m=e9(e.labelWidth)?e.labelWidth:l&&i.props.labelWidth;e9(m)&&(h.width=`${m}px`,h.paddingRight=m?"":"0px");const p=e.labelPosition||l&&i.props.labelPosition;return p&&(h["text-align"]=p),h}),f=h=>{if(!e.property||l&&!i.props.model)return Promise.resolve(!0);let m=[];l&&i.props.rules&&Hy(i.props.rules,e.property)&&(m=i.props.rules[e.property]),e.rules&&(m=e.rules),m=Zy(h,_y(m,By(e))),m.length>0&&(n.isError=!1,n.errorMessage="");const p=ct.exports.get(i.props.model,e.property),w=(()=>{let y=-1;return()=>{if(y=y+1,y>=m.length)return Promise.resolve(!0);const v=m[y];return Promise.resolve().then(()=>{const L=v.validator(p);return typeof L!="boolean"&&typeof L.then=="function"?L.then(x=>{if(x===!1)return Promise.reject(v.message)}).then(()=>w(),()=>(n.isError=!0,n.errorMessage=v.message,Promise.reject(v.message))):L?w():(n.isError=!0,n.errorMessage=v.message,Promise.reject(v.message))})}})();return w()},u=()=>{n.isError=!1,n.errorMessage=""};return a.provide(yf,Te(U({},e),{validate:f,clearValidate:u})),a.onMounted(()=>{l&&i.register(t.proxy)}),a.onBeforeUnmount(()=>{l&&i.unregister(t.proxy)}),Te(U({},a.toRefs(n)),{labelStyles:c,isFormTypeVertical:o,validate:f,clearValidate:u})},render(){var i,l,o,c;const e=Se({"bk-form-item":!0,"is-error":this.isError,"is-required":this.required}),t=()=>this.$slots.label?this.$slots.label():this.description?a.withDirectives(a.createVNode("span",{class:{"bk-form-label-description":Boolean(this.description)}},[this.label]),[[a.resolveDirective("bk-tooltips"),this.description]]):this.label,n=()=>this.isError?this.errorDisplayType==="tooltips"?a.withDirectives(a.createVNode("div",{class:"bk-form-error-tips"},[a.createVNode(Jo,null,null)]),[[a.resolveDirective("bk-tooltips"),this.errorMessage]]):a.createVNode("div",{class:"bk-form-error"},[this.$slots.error?this.$slots.error(this.errorMessage):this.errorMessage]):null;return a.createVNode("div",{class:e},[a.createVNode("div",{class:"bk-form-label",style:this.labelStyles},[t(),this.isFormTypeVertical&&((l=(i=this.$slots).labelAppend)==null?void 0:l.call(i))]),a.createVNode("div",{class:"bk-form-content"},[(c=(o=this.$slots).default)==null?void 0:c.call(o),n()])])}});const t9=Bt(Ry,{FormItem:Gy,ComposeFormItem:Jy}),Fy={span:g.number.def(1),offset:g.number.def(0),pull:g.number.def(0),push:g.number.def(0)};var Yy=a.defineComponent({name:"Col",props:Fy,emits:[],setup(e,t){const{col:n,gutter:i,flex:l}=a.inject("containerProps"),{span:o,offset:c,pull:f,push:u}=e,h=a.computed(()=>o||n);a.provide("containerProps",{col:h.value,gutter:i,flex:l});const m=function(w){return`${Number((w*100).toFixed(3))}%`},p=a.computed(()=>({width:m(h.value/n),"padding-right":`${i/2}px`,"padding-left":`${i/2}px`,"margin-left":c?m(c/n):null,right:f?m(f/n):null,left:u?m(u/n):null}));return()=>{var w,y;return a.createVNode("div",{class:"bk-grid-col",style:p.value},[(y=(w=t.slots).default)==null?void 0:y.call(w)])}}});const Uy={col:g.number.def(24),gutter:g.number.def(20),margin:g.number.def(20),flex:g.bool.def(!1),extCls:g.string};var $y=a.defineComponent({name:"Container",props:Uy,emits:[],setup(e,t){const{col:n,gutter:i,flex:l,extCls:o}=e;a.provide("containerProps",{col:n,gutter:i,flex:l});const c=a.computed(()=>o?`bk-grid-container ${o}`:"bk-grid-container"),f=a.computed(()=>{const{margin:u}=e;return{"padding-right":`${u}px`,"padding-left":`${u}px`}});return()=>{var u,h;return a.createVNode("div",{class:c.value,style:f.value},[(h=(u=t.slots).default)==null?void 0:h.call(u)])}}}),Xy=a.defineComponent({name:"Row",emits:[],setup(e,t){const{col:n,gutter:i,flex:l}=a.inject("containerProps");a.provide("containerProps",{col:n,gutter:i,flex:l});const o=a.computed(()=>Te(U({},l?{display:["-webkit-box","-ms-flexbox","flex"]}:{}),{"margin-right":`-${i/2}px`,"margin-left":`-${i/2}px`}));return()=>{var c,f;return a.createVNode("div",{class:"bk-grid-row",style:o.value},[(f=(c=t.slots).default)==null?void 0:f.call(c)])}}});const rl=Bt($y,{Row:Xy,Col:Yy}),Ky=["auto","auto-start","auto-end","top","right","bottom","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],qy=["hover","click","manual"];var eC=a.defineComponent({name:"Dropdown",props:{isShow:g.bool.def(!1),placement:g.commonType(Ky,"placement").def("bottom"),trigger:g.commonType(qy,"trigger").def("hover"),disabled:g.bool.def(!1),popoverOptions:g.object.def({}),extCls:g.string},emits:["showChange","show","hide"],setup(e,{emit:t}){const n=o=>{t("showChange",o)};return{afterShow:()=>{t("show"),n(!0)},afterHidden:()=>{t("hide"),n(!1)}}},render(){const e=Se({"bk-dropdown":!0},this.$props.extCls),t={theme:"light bk-dropdown-popover",trigger:this.trigger,arrow:!1,placement:this.placement,isShow:this.isShow,disabled:this.disabled},n=ct.exports.merge(t,this.popoverOptions);return a.createVNode("div",{class:e},[a.createVNode(ni,a.mergeProps(n,{onAfterShow:this.afterShow,onAfterHidden:this.afterHidden}),{default:()=>{var i,l;return a.createVNode("div",{class:"bk-dropdown-reference"},[a.createTextVNode(" "),(l=(i=this.$slots).default)==null?void 0:l.call(i),a.createTextVNode(" ")])},content:()=>{var i,l;return a.createVNode("div",{class:"bk-dropdown-content"},[a.createTextVNode(" "),(l=(i=this.$slots).content)==null?void 0:l.call(i),a.createTextVNode(" ")])}})])}}),tC=a.defineComponent({name:"DropdownItem",props:{extCls:g.string},emits:["click"],setup(e,{emit:t}){const n=l=>{l.stopPropagation(),t("click",l)};return{wrapperCLasses:a.computed(()=>["bk-dropdown-item",e.extCls]),handleClick:n}},render(){var e,t;return a.createVNode("li",{class:this.wrapperCLasses,onClick:this.handleClick},[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}}),nC=a.defineComponent({name:"DropdownMenu",props:{extCls:g.string},setup(e){return{wrapperCLasses:a.computed(()=>["bk-dropdown-menu",e.extCls])}},render(){var e,t;return a.createVNode("ul",{class:this.wrapperCLasses},[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});const n9=Bt(eC,{DropdownMenu:nC,DropdownItem:tC});var Fc=a.defineComponent({name:"CascaderPanel",props:{width:g.oneOfType([g.number,g.string]).def("auto"),height:g.oneOfType([g.number,g.string]).def(216),store:g.object.def({}),separator:g.string.def(""),suggestions:g.arrayOf(gf()),isFiltering:g.bool.def(!1),searchKey:g.oneOfType([g.string,g.number]).def(""),modelValue:g.arrayOf(g.oneOfType([xo(),String,Number]))},emits:["update:modelValue"],setup(e,{emit:t}){const{store:n}=e,i=a.reactive({list:[e.store.getNodes()]}),l=a.ref([]),o=a.ref([]),c=C=>typeof C=="number"?`${C}px`:C,f=c(e.height),u=c(e.width),h=C=>{C.length===0&&(i.list=i.list.slice(0,1),l.value=[]),C.forEach(b=>{const I=n.getNodeById(b);p(I)}),o.value=C},m=C=>{C.isDisabled||(C.config.multiple?o.value=n.getCheckedNodes().map(b=>b.path):o.value=C.path,t("update:modelValue",o.value))},p=C=>{var b;if(!(!C||(C==null?void 0:C.isDisabled))){if(i.list=i.list.slice(0,C.level),l.value=l.value.slice(0,C.level-1),(b=C.children)!=null&&b.length){i.list.push(C.children),l.value.push(C);return}if(n.config.isRemote&&!C.isLeaf){C.loading=!0;const I=N=>{n.appendNodes(N,C||null),i.list.push(C.children),l.value.push(C),C.loading=!1};n.config.remoteMethod(C,I)}}},w=C=>{const{trigger:b,checkAnyLevel:I,multiple:N}=C.config;return{onClick:A=>{(!C.isLeaf||N)&&A.stopPropagation(),b==="click"&&p(C),I&&!N&&m(C),C.isLeaf&&!N&&m(C)},onMouseenter:()=>{b==="hover"&&p(C)}}},y=C=>{const{multiple:b}=C.config;return{onClick:N=>{if(b){N.stopPropagation(),x(C,!C.checked);return}p(C),C.isLeaf&&!b&&m(C)}}},v=C=>(l.value[C.level-1]||{}).id===C.id,L=(C,b)=>{const{multiple:I}=C.config;return I?b.some(N=>fr(N,C.path)):fr(b,C.path)},x=(C,b)=>{C.setNodeCheck(b||!1),m(C)},k=C=>C.loading?a.createVNode(pr,{class:"icon-spinner"},null):a.createVNode(vn,{class:"icon-angle-right"},null);return a.watch(()=>e.modelValue,C=>{h(C)},{immediate:!0}),a.watch(()=>e.store,C=>{i.list=[C.getNodes()]}),{menus:i,activePath:l,nodeExpandHandler:p,isNodeInPath:v,nodeEvent:w,isCheckedNode:L,checkValue:o,checkNode:x,iconRender:k,panelWidth:u,panelHeight:f,searchPanelEvents:y}},render(){const e=parseInt(this.panelWidth,10)>200?this.panelWidth:`${200}px`,t=()=>this.suggestions.length?a.createVNode("ul",{class:"bk-cascader-panel bk-scroll-y",style:{height:this.panelHeight,width:this.panelWidth}},[this.suggestions.map(n=>a.createVNode("li",a.mergeProps({class:["bk-cascader-node",{"is-selected":this.isNodeInPath(n)},{"is-disabled":n.isDisabled},{"is-checked":this.isCheckedNode(n,this.checkValue)}]},this.searchPanelEvents(n)),[n.pathNames.join(this.separator)]))]):a.createVNode("div",{class:"bk-cascader-search-empty",style:{width:e}},[a.createVNode("span",null,[a.createTextVNode("\u6682\u65E0\u641C\u7D22\u7ED3\u679C")])]);return a.createVNode("div",{class:"bk-cascader-panel-wrapper"},[this.isFiltering?t():this.menus.list.map(n=>a.createVNode("ul",{class:"bk-cascader-panel bk-scroll-y",style:{height:this.panelHeight,width:this.panelWidth}},[n.map(i=>{var l,o;return a.createVNode("li",a.mergeProps({class:["bk-cascader-node",{"is-selected":this.isNodeInPath(i)},{"is-disabled":i.isDisabled},{"is-checked":!i.config.multiple&&this.isCheckedNode(i,this.checkValue)}]},Object.assign(this.nodeEvent(i),i.config.multiple?{}:{})),[i.config.multiple&&a.createVNode(Ii,{disabled:i.isDisabled,modelValue:i.checked,"onUpdate:modelValue":c=>i.checked=c,indeterminate:i.isIndeterminate,onChange:c=>this.checkNode(i,c)},null),(o=(l=this.$slots).default)==null?void 0:o.call(l,{node:i,data:i.data}),i.isLeaf?"":this.iconRender(i)])})]))])}});function i9(e){return e.data.disabled?!0:e.level!==1?i9(e.parent):e.data.disabled}class sl{constructor(t,n,i){this.data=t,this.config=n,this.parent=i||null,this.leaf=t.leaf,this.level=this.parent?this.parent.level+1:1,this.initState()}initState(){const{idKey:t,nameKey:n,childrenKey:i}=this.config;this.id=this.data[t],this.name=this.data[n],this.loading=!1,this.loaded=!1,this.checked=!1;const l=this.data[i];this.children=(l||[]).map(o=>new sl(o,this.config,this)),this.pathNodes=this.calculateNodesPath(),this.path=this.pathNodes.map(o=>o.id),this.pathNames=this.pathNodes.map(o=>o.name)}get isLeaf(){var t;return this.config.isRemote?this.leaf||(this.loaded?!this.children.length:!1):!(Array.isArray(this.children)&&((t=this.children)==null?void 0:t.length)!==0)}get isDisabled(){return i9(this)}broadcast(t,n){const i=`onParent${Lo(t)}`;this.children.forEach(l=>{var o;l&&(l.broadcast(t,n),(o=l[i])==null||o.call(l,n))})}emit(t){var l;const{parent:n}=this,i=`onChild${Lo(t)}`;n&&((l=n[i])==null||l.call(n),n.emit(t))}onParentCheck(t){this.isDisabled||this.setCheckState(t)}onChildCheck(){const{children:t}=this,n=t.filter(l=>!l.isDisabled),i=n.length?n.every(l=>l.checked):!1;this.setCheckState(i)}setCheckState(t){const n=this.children.length,i=this.children.reduce((l,o)=>{const c=o.isIndeterminate?.5:0,f=o.checked?1:c;return l+f},0);this.checked=t,this.isIndeterminate=i!==n&&i>0}setNodeCheck(t){if(this.checked!==t){if(this.config.checkAnyLevel){this.checked=t;return}this.broadcast("check",t),this.setCheckState(t),this.emit("check")}}calculateNodesPath(){const t=[this];let{parent:n}=this;for(;n;)t.unshift(n),n=n.parent;return t}}const a9=(e,t)=>e.reduce((n,i)=>(i.isLeaf?n.push(i):(!t&&n.push(i),n=n.concat(a9(i.children,t))),n),[]);class r9{constructor(t){const{list:n}=t;this.data=n,this.config=t,this.nodes=this.data.map(i=>new sl(i,this.config))}getNodes(){return this.nodes}clearChecked(){this.getFlattedNodes().forEach(t=>{t.checked=!1,t.isIndeterminate=!1})}removeTag(t){this.getFlattedNodes().find(n=>fr(t,n.path)?(n.checked=!1,!0):!1)}getFlattedNodes(t=!1){return a9(this.nodes,t)}getCheckedNodes(){return this.getFlattedNodes().filter(t=>t.checked)}getNodeByValue(t){var i;return(i=this.getFlattedNodes().filter(l=>fr(l.path,t))[0])!=null?i:null}getNodeById(t){return this.getFlattedNodes().find(n=>n.id===t)}appendNode(t,n){const i=new sl(t,this.config,n);(n?n.children:this.nodes).push(i)}appendNodes(t,n){t.forEach(i=>this.appendNode(i,n))}}var iC=a.defineComponent({name:"Cascader",directives:{clickoutside:Xn},components:{CascaderPanel:Fc,BkPopover:ni},props:{modelValue:g.arrayOf(g.oneOfType([xo(),String,Number])),list:g.array.def([]),placeholder:g.string.def("\u8BF7\u9009\u62E9"),filterable:g.bool.def(!1),multiple:g.bool.def(!1),disabled:g.bool.def(!1),clearable:g.bool.def(!0),trigger:g.string.def("click"),checkAnyLevel:g.bool.def(!1),isRemote:g.bool.def(!1),remoteMethod:g.func,showCompleteName:g.bool.def(!0),idKey:g.string.def("id"),nameKey:g.string.def("name"),childrenKey:g.string.def("children"),separator:g.string.def("/"),limitOneLine:g.bool.def(!1),extCls:g.string.def(""),scrollHeight:g.oneOfType([g.number,g.string]).def(216),scrollWidth:g.oneOfType([g.number,g.string]).def("auto")},emits:["update:modelValue","change","clear","toggle"],setup(e,{emit:t}){const{separator:n,multiple:i}=e,{isHover:l,setHover:o,cancelHover:c}=j0(),f=a.ref(new r9(e)),u=a.ref(!1),h=a.ref(""),m=a.ref([]),{modelValue:p}=a.toRefs(e),w=a.ref(),y=a.ref(""),v=a.ref([]),L=a.ref(!1),x=a.computed({get:()=>p.value,set:E=>{t("update:modelValue",E)}}),k=a.ref(null),C=E=>e.showCompleteName?E.pathNames.join(n):E.pathNames[E.pathNames.length-1],b=()=>{y.value=h.value},I=E=>{var ne;if(i){m.value=f.value.getCheckedNodes().map(_=>({text:C(_),key:_.id}));return}if(!e.checkAnyLevel&&((ne=k==null?void 0:k.value)==null||ne.hide()),E.length===0)h.value="";else{const _=f.value.getNodeByValue(E);if(!_)return;h.value=C(_)}b()},N=E=>{E.stopPropagation(),f.value.clearChecked(),y.value="",I([]),t("update:modelValue",[]),t("clear",JSON.parse(JSON.stringify(e.modelValue)))},T=(E,ne,_)=>{_.stopPropagation();const ce=JSON.parse(JSON.stringify(E)),re=ce.splice(ne,1)[0];f.value.removeTag(re),I(ce),t("update:modelValue",f.value.getCheckedNodes().map(ae=>ae.path))},A=(E,ne)=>{I(E),t("update:modelValue",E),ne!==void 0&&t("change",E)},P=()=>{f.value=new r9(e),I(e.modelValue)},J=E=>{t("toggle",E.isShow),E.isShow||(L.value=!1)},z=Mf(200,E=>{const ne=E.target;if(y.value=ne.value,y.value===""){L.value=!1;return}L.value=!0;const _=f.value.getFlattedNodes().filter(ce=>(e.checkAnyLevel||ce.isLeaf)&&ce.pathNames.join(e.separator).includes(y.value));v.value=_,!(k!=null&&k.value.isShow)&&(k==null||k.value.show())});return a.watch(()=>e.modelValue,A,{immediate:!0}),a.watch(()=>e.list,P,{deep:!0,immediate:!0}),{store:f,updateValue:I,panelShow:u,selectedText:h,checkedValue:x,handleClear:N,isHover:l,setHover:o,popover:k,cancelHover:c,selectedTags:m,removeTag:T,cascaderPanel:w,popoverChangeEmitter:J,searchKey:y,suggestions:v,isFiltering:L,searchInputHandler:z}},render(){const e=()=>this.clearable&&this.isHover?a.createVNode(cn,{class:"bk-icon-clear-icon",onClick:this.handleClear},null):a.createVNode(Ta,{class:"bk-icon-angle-up"},null),t=()=>this.limitOneLine?a.createVNode("span",null,[this.selectedText]):a.createVNode("div",{class:"cascader-tag-list"},[this.selectedTags.map((n,i)=>a.createVNode("span",{class:"cascader-tag-item"},[a.createVNode("span",{class:"cascader-tag-item-name"},[n.text]),a.createVNode(An,{class:"bk-icon-clear-icon",onClick:l=>this.removeTag(this.modelValue,i,l)},null)]))]);return a.createVNode("div",{class:["bk-cascader","bk-cascader-wrapper",this.extCls,{"bk-is-show-panel":this.panelShow,"is-unselected":this.modelValue.length===0,"is-hover":this.isHover,"is-filterable":this.filterable}],tabindex:"0","data-placeholder":this.placeholder,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[e(),a.createVNode(ni,{placement:"bottom-start",theme:"light bk-cascader-popover",trigger:"click",arrow:!1,class:"bk-cascader-popover-wrapper",ref:"popover",onAfterHidden:this.popoverChangeEmitter,onAfterShow:this.popoverChangeEmitter,boundary:"body"},{default:()=>a.createVNode("div",{class:"bk-cascader-name"},[this.multiple&&this.selectedTags.length>0&&t(),this.filterable?a.createVNode("input",{class:"bk-cascader-search-input",type:"text",onInput:this.searchInputHandler,placeholder:this.placeholder,value:this.searchKey},null):a.createVNode("span",null,[this.selectedText])]),content:()=>a.createVNode("div",{class:"bk-cascader-popover"},[a.createVNode(Fc,{store:this.store,ref:"cascaderPanel",width:this.scrollWidth,height:this.scrollHeight,"search-key":this.searchKey,separator:this.separator,"is-filtering":this.isFiltering,suggestions:this.suggestions,modelValue:this.checkedValue,"onUpdate:modelValue":n=>this.checkedValue=n},{default:n=>this.$slots.default?this.$slots.default(n):a.createVNode("span",{class:"bk-cascader-node-name"},[n.node.name])})])})])}});const s9=Bt(iC,{CascaderPanel:Fc});var l9=a.defineComponent({name:"SliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:()=>({})}},emits:["emitChange","resetSize","update:modelValue"],setup(e,{emit:t}){const n=a.ref(!1),i=a.ref(!1),l=a.ref(0),o=a.ref(0),c=a.ref(0),f=a.ref(null),u=a.ref(e.modelValue),h=a.ref(0),m=a.ref(0),p=a.ref(!1),w=a.ref(null),y=a.computed(()=>{var J,z;let A="";if((J=e.params.customContent)!=null&&J[e.modelValue]){const E=e.params.customContent[e.modelValue];A=E.tip||E.label||""}const P=e.params.vertical?"right":"top";return(z=e.params)!=null&&z.showTip?{content:e.params.formatterTipLabel(`${A||(e==null?void 0:e.modelValue)||"0"}`),placement:P}:{content:"",placement:P}}),v=a.computed(()=>`${(e.modelValue-e.params.minValue)/(e.params.maxValue-e.params.minValue)*100}%`),L=a.computed(()=>e.params.vertical?{bottom:v.value}:{left:v.value}),x=a.computed(()=>e.params.formatterButtonLabel(e.modelValue)),k=A=>{e.params.disable||(A.preventDefault(),C(A),Er(window,"mousemove",b),Er(window,"touchmove",b),Er(window,"mouseup",I),Er(window,"touchend",I))},C=A=>{n.value=!0,i.value=!0,e.params.vertical?l.value=A.clientY:o.value=A.clientX,c.value=parseFloat(v.value),f.value=c.value},b=A=>{if(n.value){i.value=!1,t("resetSize");let P=0;e.params.vertical?(h.value=A.clientY,P=(l.value-h.value)/e.params.sliderSize*100):(m.value=A.clientX,P=(m.value-o.value)/e.params.sliderSize*100),f.value=c.value+P,N(f.value)}},I=()=>{p.value=!1,n.value&&(setTimeout(()=>{n.value=!1,i.value||(N(f.value),t("emitChange"))},0),ll(window,"mousemove",b),ll(window,"touchmove",b),ll(window,"mouseup",I),ll(window,"touchend",I))},N=A=>{if(A===null||isNaN(A))return;A<0?f.value=0:A>100&&(f.value=100);const P=100/((e.params.maxValue-e.params.minValue)/e.params.step);let z=Math.round(A/P)*P*(e.params.maxValue-e.params.minValue)*.01+e.params.minValue;z=parseFloat(z.toFixed(e.params.precision)),t("update:modelValue",z),!n.value&&e.modelValue!==u.value&&(u.value=e.modelValue)};return{renderDom:()=>a.createVNode("div",{class:["bk-slider-button",e.params.vertical?"vertical":"horizontal",{grabbing:n.value}],ref:w,tabindex:"0",style:L.value,onClick:A=>A.stopPropagation(),onMousedown:k},[Boolean(y.value.content)?a.createVNode(Os,{content:y.value.content,theme:"dark",placement:y.value.placement,boundary:document.body},{default:()=>[a.createVNode("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null)]}):a.createVNode("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null),e.params.showButtonLabel&&!e.params.showIntervalLabel?a.createVNode("div",{class:["slider-button-label",e.params.vertical?"vertical":"horizontal"]},[x.value]):void 0]),setPosition:N,tip:y}},render(){return this.renderDom()}});const Er=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},ll=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)};var aC=a.defineComponent({name:"Slider",props:{modelValue:g.oneOfType([g.array,g.number]),extCls:{type:String,default:""},vertical:{type:Boolean,default:!1},height:{type:String,default:"200px"},disable:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},maxValue:{type:[Number],default:100},minValue:{type:[Number],default:0},step:{type:[Number],default:1},range:{type:Boolean,default:!1},showInterval:{type:Boolean,default:!1},showIntervalLabel:{type:Boolean,default:!1},showButtonLabel:{type:Boolean,default:!1},showBetweenLabel:{type:Boolean,default:!1},showInput:{type:Boolean,default:!1},customContent:{type:Object,default:null},formatterLabel:{type:Function,default:e=>e},formatterButtonLabel:{type:Function,default:e=>e},formatterTipLabel:{type:Function,default:e=>e}},emits:["update:modelValue","change"],setup(e,{slots:t,emit:n}){const i=a.ref(1),l=a.ref(null),o=a.ref(null),c=a.ref(null),f=a.ref(0),u=a.ref(0),h=a.ref(null),m=a.ref(null),p=a.ref(null),w=a.ref(null),y=a.computed(()=>{const W=[e.minValue,e.maxValue,e.step].map(Q=>{const F=`${Q}`.split(".")[1];return F?F.length:0});return Math.max.apply(null,W)}),v=a.computed(()=>Math.min(l.value,o.value)),L=a.computed(()=>Math.max(l.value,o.value)),x=a.computed(()=>e.range?`${100*(L.value-v.value)/(e.maxValue-e.minValue)}%`:`${100*(l.value-e.minValue)/(e.maxValue-e.minValue)}%`),k=a.computed(()=>e.range?`${100*(v.value-e.minValue)/(e.maxValue-e.minValue)}%`:"0%"),C=a.computed(()=>e.vertical?{height:x.value,bottom:k.value}:{width:x.value,left:k.value}),b=a.computed(()=>{if(!e.showInterval||e.minValue>e.maxValue)return[];if(e.step===0)return console.warn("WARNNING:step should not be 0"),[];const W=(e.maxValue-e.minValue)/e.step,Q=100*e.step/(e.maxValue-e.minValue),F=[];for(let K=1;K<W;K++)F.push(K*Q);return e.range?F.filter(K=>K<100*(v.value-e.minValue)/(e.maxValue-e.minValue)||K>100*(L.value-e.minValue)/(e.maxValue-e.minValue)):F.filter(K=>K>100*(l.value-e.minValue)/(e.maxValue-e.minValue))}),I=a.computed(()=>e.vertical?{height:e.height,width:"4px"}:{}),N=a.computed(()=>{if(!e.showIntervalLabel)return[];if(e.step===0)return console.warn("WARNNING:step should not be 0"),[];const W=100*e.step/(e.maxValue-e.minValue),Q=[];for(let F=e.minValue,K=0;F<=e.maxValue;F+=e.step,K++){const fe={stepWidth:K*W,stepLabel:e.formatterLabel(F)};Q.push(fe)}return Q}),T=a.computed(()=>Array.isArray(e.modelValue)),A=a.computed(()=>e.customContent?Object.keys(e.customContent).sort((W,Q)=>Number(W)-Number(Q)).filter(W=>Number(W)>=e.minValue&&Number(W)<=e.maxValue).map(W=>{const{tip:Q}=e.customContent[W],{label:F}=e.customContent[W];return{tip:Q||F||"",label:F||"",percent:(Number(W)-e.minValue)/(e.maxValue-e.minValue)*100}}):[]),P=a.computed(()=>({vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:y.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:i.value,formatterTipLabel:e.formatterTipLabel}));a.watch(()=>e.modelValue,()=>{ne()}),a.watch(()=>l.value,W=>{e.range?n("update:modelValue",[v.value,L.value]):n("update:modelValue",W),f.value=W}),a.watch(()=>o.value,W=>{n("update:modelValue",[v.value,L.value]),u.value=W}),a.onMounted(()=>{e.range?(Array.isArray(e.modelValue)?(l.value=Math.max(e.minValue,Number(e.modelValue[0])),o.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(l.value=e.minValue,o.value=e.maxValue),c.value=[l.value,o.value]):(typeof e.modelValue!="number"||isNaN(e.modelValue)?l.value=e.minValue:l.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),c.value=l.value),J(),Er(window,"resize",J())});const J=()=>{h.value&&(i.value=h.value[`client${e.vertical?"Height":"Width"}`])},z=W=>{var Q,F;if(W.stopPropagation(),!e.disable){if(J(),e.vertical){const K=(Q=h.value)==null?void 0:Q.getBoundingClientRect().bottom;re((K-W.clientY)/i.value*100)}else{const K=(F=h.value)==null?void 0:F.getBoundingClientRect().left;re((W.clientX-K)/i.value*100)}_()}},E=()=>e.range?![v.value,L.value].every((W,Q)=>W===c.value[Q]):e.modelValue!==c.value,ne=()=>{if(e.minValue>e.maxValue){console.error("min should not be greater than max.");return}const W=e.modelValue;e.range&&Array.isArray(W)?W[1]<e.minValue?n("update:modelValue",[e.minValue,e.minValue]):W[0]>e.maxValue?n("update:modelValue",[e.maxValue,e.maxValue]):W[0]<e.minValue?n("update:modelValue",[e.minValue,W[1]]):W[1]>e.maxValue?n("update:modelValue",[W[0],e.maxValue]):(l.value=Number(W[0]),o.value=Number(W[1]),E()&&(c.value=W.slice())):!e.range&&typeof W=="number"&&!isNaN(W)&&(W<e.minValue?n("update:modelValue",e.minValue):W>e.maxValue?n("update:modelValue",e.maxValue):(l.value=W,E()&&(c.value=W)))},_=async()=>{await a.nextTick(),n("change",e.range?[v.value,L.value]:e.modelValue)},ce=W=>e.vertical?{bottom:`${W}%`}:{left:`${W}%`},re=W=>{if(!e.range){m.value.setPosition(W);return}const Q=e.minValue+W*(e.maxValue-e.minValue)/100;Math.abs(v.value-Q)<Math.abs(L.value-Q)?w.value=l.value<o.value?m.value:p.value:w.value=l.value>o.value?m.value:p.value,w.value.setPosition(W)},ae=W=>{if(W==="")return;const Q=parseFloat(W);Q<e.minValue?(f.value=e.minValue,l.value=e.minValue):Q>e.maxValue?(f.value=e.maxValue,l.value=e.maxValue):l.value=Q},ue=W=>{if(W===""||typeof W=="number")return;const Q=parseFloat(W);Q<e.minValue?(u.value=e.minValue,o.value=e.minValue):Q>e.maxValue?(u.value=e.maxValue,o.value=e.maxValue):o.value=Q},ie=W=>{let Q=0;return W==="start"?Q=e.vertical?e.maxValue:e.minValue:Q=e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[l.value,o.value].includes(Q)?"0":"1"};return{renderDom:()=>{var W,Q;return a.createVNode("div",{class:["bk-slider",e.extCls]},[(W=t.start)==null?void 0:W.call(t),a.createVNode("div",{class:"bk-slider-runway",ref:h,style:I.value,onClick:z},[a.createVNode("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:C.value},null),e.showInterval?b.value.map((F,K)=>a.createVNode("div",{key:K,class:["bk-slider-interval",{vertical:e.vertical}],style:ce(F)},null)):void 0,e.customContent?A.value.map((F,K)=>a.createVNode("div",{key:K,class:["bk-slider-interval",{vertical:e.vertical}],style:ce(F.percent)},null)):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?a.createVNode("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[function(){if(e.showBetweenLabel)return[a.createVNode("div",{class:"label-start",style:[{opacity:ie("start")}]},[e.formatterLabel(e.minValue)]),a.createVNode("div",{class:"label-end",style:[{opacity:ie("end")}]},[e.formatterLabel(e.maxValue)])];if(e.showIntervalLabel)return N.value.map((F,K)=>a.createVNode("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:K,style:ce(F.stepWidth)},[F.stepLabel]));if(e.customContent)return A.value.map((F,K)=>a.createVNode("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:K,style:ce(F.percent)},[F.label]))}()]):void 0,a.createVNode(l9,{modelValue:l.value,"onUpdate:modelValue":F=>l.value=F,ref:m,params:P.value,onEmitChange:_,onResetSize:J},null),e.range?a.createVNode(l9,{modelValue:o.value,"onUpdate:modelValue":F=>o.value=F,ref:p,params:P.value,onEmitChange:_,onResetSize:J},null):void 0]),e.showInput&&!e.vertical?a.createVNode("div",{class:"bk-slider-input"},[a.createVNode("div",{class:"input-item"},[a.createVNode(Ui,{type:"number",modelValue:f.value,max:e.maxValue,min:e.minValue,onChange:ae},null)]),T.value&&o.value?[a.createVNode("div",{class:"input-center"},[a.createTextVNode("\uFF5E")]),a.createVNode("div",{class:"input-item"},[a.createVNode(Ui,{type:"number",modelValue:u.value,max:e.maxValue,min:e.minValue,onChange:ue},null)])]:void 0]):void 0,(Q=t.end)==null?void 0:Q.call(t)])}}},render(){return this.renderDom()}});const o9=He(aC);var rC=a.defineComponent({name:"ResizeLayout",props:{placement:g.placement().def("left"),min:g.number.def(3),max:g.number.def(1/0),triggerWidth:g.number.def(5),triggerOffset:g.number.def(3),initialDivide:g.oneOfType([String,Number]).def("20%"),immediate:g.bool,disabled:g.bool,collapsible:g.bool,autoMinimize:g.oneOfType([Boolean,Number]).def(!1),border:g.bool.def(!0)},emits:["before-resize","resizing","after-resize","collapse-change"],setup(e,{emit:t}){const{placement:n,initialDivide:i,triggerOffset:l,triggerWidth:o,max:c,min:f,immediate:u,autoMinimize:h}=a.toRefs(e),m=a.ref(!1),p=a.ref(!0),w=a.ref(!1),y=a.ref(null),v=a.ref({}),L=a.ref(null),x=a.ref(null),k=a.ref(null),C=a.ref(null),b=a.computed(()=>["left","right"].includes(n.value)),I=a.computed(()=>b.value?"width":"height"),N=a.computed(()=>{let ie=i.value;return typeof ie=="number"&&(ie=`${ie}px`),{[I.value]:ie}}),T=a.computed(()=>({[`margin-${n.value}`]:`${l.value-o.value}px`,[I.value]:`${o.value}px`})),A=a.computed(()=>h.value?typeof h.value=="boolean"?50:h.value:0),P=()=>{const ie=L.value.getBoundingClientRect();y.value=b.value?ie.width:ie.height},J=new ResizeObserver(P),z=()=>{switch(x.value.style.visibility="visible",n.value){case"left":x.value.style.inset=`0 auto auto ${v.value.aside.width}px`;break;case"right":x.value.style.inset=`0 ${v.value.aside.width}px auto auto`;break;case"top":x.value.style.inset=`${v.value.aside.height}px auto auto 0`;break;case"bottom":x.value.style.inset=`auto auto ${v.value.aside.height}px 0`;break}},E=()=>{k.value.style.display="block",k.value.style.cursor=b.value?"col-resize":"row-resize"},ne=ie=>Math.min(c.value,Math.max(f.value,ie),y.value-o.value),_=ie=>{t("before-resize",ie);const Y=C.value.getBoundingClientRect();v.value=Object.freeze({mouse:{clientX:ie.clientX,clientY:ie.clientY},aside:{width:Y.width,height:Y.height}}),E(),u.value||z(),document.onselectstart=()=>!1,document.ondragstart=()=>!1;const W=K=>{t("resizing",K)},Q=K=>{let fe;switch(n.value){case"top":fe=K.clientY-v.value.mouse.clientY;break;case"right":fe=v.value.mouse.clientX-K.clientX;break;case"bottom":fe=v.value.mouse.clientY-K.clientY;break;case"left":fe=K.clientX-v.value.mouse.clientX}const he=v.value.aside[I.value]+fe,Ce=ne(he)+l.value,Ae=`${Ce}px`;u.value?C.value.style[I.value]=Ae:x.value.style[n.value]=Ae,W(Ce)},F=()=>{if(x.value.style.visibility="hidden",k.value.style.display="none",document.removeEventListener("mousemove",Q),document.removeEventListener("mouseup",F),document.onselectstart=null,document.ondragstart=null,a.nextTick(()=>{ce(),t("after-resize",parseFloat(x.value.style[n.value]))}),u.value)return!1;C.value.style[I.value]=x.value.style[n.value]};document.addEventListener("mousemove",Q),document.addEventListener("mouseup",F)},ce=()=>{if(!h.value)return!1;const ie=C.value.getBoundingClientRect();if(w.value=m.value=ie[I.value]<=A.value,!w.value)return p.value=!0,!1;ae(),a.nextTick(()=>{C.value.setAttribute(`data-${I.value}`,N.value[I.value])})},re=ie=>{m.value=typeof ie=="boolean"?ie:!m.value,ae(),t("collapse-change",m.value)},ae=()=>{const ie=C.value.getBoundingClientRect();ue(!m.value),m.value?(C.value.setAttribute(`data-${I.value}`,`${ie[I.value]}px`),C.value.style[I.value]="5px"):(p.value=!0,C.value.style[I.value]=C.value.getAttribute(`data-${I.value}`))},ue=ie=>{const Y=()=>{p.value=ie,C.value.style.transition="",C.value.removeEventListener("transitionend",Y)};C.value.addEventListener("transitionend",Y),C.value.style.transition=`${I.value} cubic-bezier(0.4, 0, 0.2, 1) .3s`};return a.onMounted(()=>{J.observe(L.value)}),a.onBeforeUnmount(()=>{J.unobserve(L.value)}),{collapsed:m,asideContentVisible:p,minimized:w,limitMax:y,state:v,vertical:b,cssPropKey:I,bkResizeLayoutRef:L,resizeProxyRef:x,resizeMaskRef:k,asideRef:C,triggerStyle:T,asideStyle:N,handleMousedown:_,setCollapse:re}},render(){var t,n,i,l,o,c;const e=["bk-resize-layout",`bk-resize-layout-${this.placement}`,{"bk-resize-layout-collapsed":this.collapsed,"bk-resize-layout-border":this.border}];return a.createVNode("div",{ref:"bkResizeLayoutRef",class:e},[a.createVNode("aside",{class:"bk-resize-layout-aside",ref:"asideRef",style:this.asideStyle},[a.withDirectives(a.createVNode("div",{class:"bk-resize-layout-aside-content"},[(n=(t=this.$slots).aside)==null?void 0:n.call(t)]),[[a.vShow,this.asideContentVisible]]),a.withDirectives(a.createVNode("i",{class:"bk-resize-trigger",style:this.triggerStyle,onMousedown:a.withModifiers(this.handleMousedown,["left"])},null),[[a.vShow,!this.disabled&&(!this.collapsed||this.autoMinimize)]]),a.withDirectives(a.createVNode("i",{class:["bk-resize-proxy",this.placement],ref:"resizeProxyRef"},null),[[a.vShow,!this.collapsed||this.autoMinimize]]),this.collapsible&&(((l=(i=this.$slots)["collapse-trigger"])==null?void 0:l.call(i))||(this.collapsed?a.createVNode(vn,{class:"bk-resize-collapse",onClick:this.setCollapse},null):a.createVNode(Mi,{class:"bk-resize-collapse",onClick:this.setCollapse},null)))]),a.createVNode("main",{class:"bk-resize-layout-main"},[(c=(o=this.$slots).main)==null?void 0:c.call(o)]),a.createVNode("div",{class:"bk-resize-mask",ref:"resizeMaskRef"},null)])}});const c9=He(rC),sC={list:g.array.def([]),titleAble:g.bool.def(!1),extCls:g.string};var lC=a.defineComponent({name:"Timeline",props:sC,emits:["select"],setup(e,{emit:t}){const n=a.ref([]),i=c=>{const f=[];c.forEach(u=>{var h;f.push({tag:u.tag,content:u.content,type:u.type,size:u.size,color:u.color,icon:u.icon,filled:u.filled,border:(h=u.border)!=null?h:!0})}),n.value.splice(0,n.value.length,...f)},l=()=>{var c;n.value.splice(0,n.value.length,{tag:"\u6B65\u9AA41",content:"\u5185\u5BB91"},{tag:"\u6B65\u9AA42",content:"\u5185\u5BB92"},{tag:"\u6B65\u9AA43",content:"\u5185\u5BB93"}),(c=e.list)!=null&&c.length&&i(e.list)},o=c=>{try{t("select",c)}catch(f){console.warn(f)}};return a.onMounted(l),a.watch(()=>e.list,()=>{i(e.list)},{deep:!0}),{defaultTimelines:n,titleSelect:o}},render(){const e=n=>{const{icon:i}=n;return i?typeof i=="function":!1},t=n=>{const i="bk-timeline",l=["blue","red","green","yellow","gray"],o=n.type?`${i}-${n.type}`:`${i}-default`,c=n.size?`${i}-${n.size}`:"",f=n.filled?`${i}-filled`:"",u=n.color&&l.includes(n.color)?`${i}-${n.color}`:"";return Se({},`${i} ${o} ${c} ${u} ${f}`)};return a.createVNode("ul",{class:["bk-timeline",this.extCls]},[this.defaultTimelines.map(n=>{var i,l,o;return a.createVNode("li",{class:["bk-timeline-dot",t(n)]},[e(n)?a.createVNode("div",{class:"bk-timeline-icon",style:{border:n.border?`2px solid ${n.color}`:"0px",borderRadius:n.border?"50%":"0"}},[a.createVNode("span",{class:"bk-timeline-icon-inner"},[a.createVNode(n.icon,null,null)])]):"",a.createVNode("div",{class:"bk-timeline-section"},[a.createVNode("div",{class:"bk-timeline-title",onClick:()=>{this.titleSelect(n)}},[(o=(l=(i=this.$slots).default)==null?void 0:l.call(i))!=null?o:a.createVNode("span",{innerHTML:n.tag},null)]),n.content?a.createVNode("div",{class:"bk-timeline-content",innerHTML:n.content},null):""])])})])}});const u9=He(lC),oC={list:g.array.def([]),controllable:g.bool.def(!1),showSteps:g.bool.def(!1),curProcess:g.number.def(0),displayKey:g.string.def("content"),extCls:g.string};var cC=a.defineComponent({name:"Process",props:oC,emits:["update:curProcess","click"],setup(e,{emit:t}){const n=a.ref([]),i=a.ref(0),l=()=>{var c;n.value.splice(0,n.value.length,{content:"\u6B65\u9AA41"},{content:"\u6B65\u9AA42"},{content:"\u6B65\u9AA43"},{content:"\u6B65\u9AA44"}),(c=e.list)!=null&&c.length&&n.value.splice(0,n.value.length,...e.list)},o=async c=>{try{e.controllable&&c!==e.curProcess&&(t("update:curProcess",c),t("click",c))}catch(f){console.warn(f)}};return a.onMounted(l),{defaultProcessList:n,paddingBottom:i,jumpTo:o}},render(){const e="bk-process",t=Se({[`${this.extCls}`]:!!this.extCls},`${e}`),n=f=>f.status==="loading",i=f=>f.status==="error",l=f=>this.curProcess>=f+1||this.defaultProcessList[f].status==="done",o=f=>f.icon?f.icon:"",c=(f,u)=>{if(f===this.curProcess-1&&n(u))return a.createVNode(vs,{class:"bk-icon bk-process-icon icon-loading"},null);if(f===this.curProcess-1&&i(u))return a.createVNode(An,{class:"bk-process-icon"},null);if(f===this.curProcess-1&&o(u))return a.createVNode("span",{class:"bk-process-icon-custom"},[a.createVNode(u.icon,null,null)]);if(l(f))return a.createVNode(xa,{class:"bk-process-icon-done"},null)};return a.createVNode("div",{class:t},[a.createVNode("ul",{style:{paddingBottom:`${this.paddingBottom}px`}},[this.defaultProcessList.map((f,u)=>a.createVNode("li",{onClick:()=>{this.jumpTo(u+1)},style:{cursor:this.controllable?"pointer":""},class:{success:this.curProcess>=u+1,current:n(f)&&u===this.curProcess-1,error:i(f)&&u===this.curProcess-1}},[f[this.displayKey],c(u,f)]))])])}});const d9=He(cC),ia="bk-upload";var si=(e=>(e.BUTTON="button",e.DRAGGABLE="draggable",e.PICTURE="picture",e))(si||{}),Ea=(e=>(e.NEW="new",e.UPLOADING="uploading",e.SUCCESS="success",e.FAIL="fail",e))(Ea||{});const f9=[si.BUTTON,si.DRAGGABLE,si.PICTURE];var li={theme:{type:String,default:"draggable",validator:e=>!e||f9.includes(e)?!0:(console.error(`invalid theme, ${e}, the theme must be one of \u3010${f9.join(" | ")}\u3011`),!1)},files:{type:Array,default:()=>[]},name:{type:String,default:"upload_file"},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},accept:{type:String},delayTime:{type:Number,default:0},url:{type:String,required:!1},method:{type:String,default:"post"},size:{type:[Number,Object],default(){return{maxFileSize:5,maxImgSize:1}}},handleResCode:{type:Function,default(e){return!!(e&&e.code===0)}},headers:{type:Object,default:()=>({})},header:{type:[Array,Object],default:()=>[]},tip:{type:String,default:""},validateName:{type:RegExp},withCredentials:{type:Boolean,default:!1},limit:Number,data:{type:[Array,Object],default:()=>[]},formDataAttributes:{type:[Array,Object],default:()=>[]},extCls:{type:String,default:""},customRequest:Function,beforeUpload:{type:Function,default:null},beforeRemove:{type:Function,default:null},sliceUpload:{type:Boolean,default:!1},sliceUrl:{type:String,default:""},mergeUrl:{type:String,default:""},chunkSize:{type:Number,default:10}};function h9(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}var uC=a.defineComponent({name:"UploadList",props:{theme:li.theme,disabled:li.disabled,files:li.files,multiple:li.multiple},emits:["remove","retry"],setup(e,{slots:t,emit:n}){const{theme:i,disabled:l,multiple:o}=a.toRefs(e),c=`${ia}-list`,f=a.computed(()=>i.value===si.PICTURE),u=a.computed(()=>f.value&&!o.value),h=a.computed(()=>Se({[c]:!0,[`${c}--${i.value}`]:!0,[`${c}--disabled`]:l.value}));function m(C){const b=["Bytes","KB","MB","GB","TB"],I=Math.floor(Math.log(C)/Math.log(1024));return`${(C/1024**I).toFixed(2)}${b[I]}`}function p(C,b){n("remove",C,b)}function w(C,b){n("retry",C,b)}const y=()=>{let C;return a.createVNode(a.TransitionGroup,{name:`${c}__item`},h9(C=e.files.map(b=>{const I=Se({[`${c}__item`]:!0,[`${c}__item-picture`]:!0,[`${c}__item--${b.status}`]:!0});return a.createVNode("li",{key:b.uid,class:I},[t!=null&&t.file?t.file({file:b}):v(b)])}))?C:{default:()=>[C]})},v=C=>[a.withDirectives(a.createVNode("img",{src:C.url,class:`${c}__picture-item-thumbnail`,alt:""},null),[[a.vShow,C.status!=="uploading"]]),a.createVNode(a.Fragment,null,[C.status==="uploading"&&a.createVNode(kr,{class:`${c}__picture-item-progress`,type:"circle",color:"#3a84ff",bgColor:"#333",width:50,titleStyle:{color:"#fff"},percent:C.percentage},null)]),a.createVNode(a.Fragment,null,[!l.value&&a.createVNode("div",{class:`${c}__picture-item-actions`},[a.createVNode(mr,{class:"action-icon",onClick:b=>p(C,b)},null)])])],L=()=>{let C;return a.createVNode(a.TransitionGroup,{name:`${c}__item`},h9(C=e.files.map(b=>{const I=Se({[`${c}__item`]:!0,[`${c}__item--${b.status}`]:!0});return a.createVNode("li",{key:b.uid,class:I},[t!=null&&t.file?t.file({file:b}):k(b)])}))?C:{default:()=>[C]})},x=C=>{var P;const b=(P=C==null?void 0:C.raw)==null?void 0:P.type,[I]=(b==null?void 0:b.split("/"))||"";let T={text:yr,image:Bo,application:yr,video:$o,audio:Oo}[I]||yr;return["application/zip","application/rar","application/tar","application/gz","application/x-gzip"].includes(b)&&(T=jo),a.h(T,{class:`${c}__item-file-icon`})},k=C=>[a.createVNode("div",{class:`${c}__item-icon`},[C.isPic?a.createVNode("img",{src:C.url,class:`${c}__item-thumbnail`,alt:""},null):x(C)]),a.createVNode("div",{class:`${c}__item-summary`},[a.createVNode("div",{class:`${c}__item-name`,title:C.name},[C.name]),C.status!=="uploading"&&a.createVNode("div",{class:`${c}__item-message`,title:C.statusText},[C.status==="success"&&a.createVNode("span",null,[a.createVNode(xa,{class:`${c}__item-message-success-icon`},null),C.statusText||"\u4E0A\u4F20\u6210\u529F"]),C.status==="fail"&&a.createVNode("span",null,[C.statusText||"\u4E0A\u4F20\u5931\u8D25"])]),C.status==="uploading"&&a.createVNode(kr,{class:`${c}__item-progress`,showText:!1,percent:C.percentage,size:"small"},null),C.status!=="fail"&&a.createVNode("div",{class:`${c}__item-speed`},[a.withDirectives(a.createVNode("span",{class:`${c}__item-speed-size`},[m(C.size)]),[[a.vShow,C.size]]),a.withDirectives(a.createVNode("span",{class:`${c}__item-speed-percentage`},[C.percentage,a.createTextVNode("%")]),[[a.vShow,C.status==="uploading"]])]),!l.value&&a.createVNode("div",{class:`${c}__item-actions`},[C.status==="fail"&&a.createVNode(Zo,{class:`${c}__item-retry-icon`,onClick:b=>w(C,b)},null),a.createVNode(mr,{class:`${c}__item-del-icon`,onClick:b=>p(C,b)},null)])])];return()=>{var C;return a.createVNode(a.Fragment,null,[u.value?(t==null?void 0:t.innerTrigger)&&(t==null?void 0:t.innerTrigger((C=e.files)==null?void 0:C[0])):a.createVNode("ul",{class:h.value},[f.value?y():L(),(t==null?void 0:t.innerTrigger)&&(t==null?void 0:t.innerTrigger())])])}}}),g9=a.defineComponent({name:"UploadTrigger",props:{theme:li.theme,disabled:li.disabled,multiple:li.multiple,accept:li.accept,file:{type:Object,default:null}},emits:["change","remove"],setup(e,{slots:t,emit:n}){const{theme:i,disabled:l,file:o,multiple:c,accept:f}=a.toRefs(e),u=`${ia}-trigger`,h=a.computed(()=>i.value===si.BUTTON),m=a.computed(()=>i.value===si.DRAGGABLE),p=a.computed(()=>i.value===si.PICTURE),w=a.computed(()=>p.value&&!c.value),y=a.computed(()=>p.value&&!f.value?"image/png,image/jpeg,image/jpg":f.value),v=a.ref(null),L=a.computed(()=>{var ne,_,ce;return Se({[u]:!0,[`${u}--${i.value}`]:!0,[`${u}--single-picture`]:w.value,[`${u}--has-file`]:(ne=o.value)!=null?ne:!1,[`${u}--${(_=o.value)==null?void 0:_.status}`]:(ce=o.value)!=null?ce:!1,[`${u}--dragover`]:N.value,[`${u}--disabled`]:l.value})}),x=()=>{v.value.value=null,v.value.click()},k=ne=>{const{files:_}=ne.target;n("change",Array.from(_))},C=()=>{e.disabled||x()},b=ne=>{ne.defaultPrevented||ne.target!==ne.currentTarget||((ne.code==="Enter"||ne.code==="Space")&&x(),ne.preventDefault())};function I(ne,_){n("remove",ne,_),_.stopPropagation(),_.preventDefault()}const N=a.ref(!1),T=()=>{const ne=ae=>{if(l.value)return;ae.preventDefault(),N.value=!1;const ue=Array.from(ae.dataTransfer.files);if(!y.value){n("change",ue);return}const ie=ue.filter(Y=>{const{type:W,name:Q}=Y,F=Q.includes(".")?`.${Q.split(".").pop()}`:"",K=W.replace(/\/.*$/,"");return y.value.split(",").map(fe=>fe.trim()).filter(fe=>fe).some(fe=>fe.startsWith(".")?F===fe:/\/\*$/.test(fe)?K===fe.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(fe)?W===fe:!1)});n("change",ie)},_=ae=>{ae.preventDefault(),N.value=!0},ce=()=>{N.value=!1},re=Se({[`${u}__draggable`]:!0});return a.createVNode("div",{class:re,onDrop:ne,onDragover:_,onDragleave:ce},[t.default?t.default():a.createVNode(a.Fragment,null,[a.createVNode(js,{class:`${u}__draggable-icon`},null),a.createVNode("div",{class:`${u}__draggable-text`},[a.createTextVNode("\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\u6216"),a.createVNode("span",{class:`${u}__draggable-upload-link`},[a.createTextVNode("\u70B9\u51FB\u4E0A\u4F20")])])])])},A=()=>a.createVNode(a.Fragment,null,[w.value&&e.file?J(e.file):P()]),P=()=>a.createVNode(a.Fragment,null,[t.default?t.default():a.createVNode("div",{class:`${u}__picture-inner`},[a.createVNode(xs,{class:`${u}__picture-icon`},null),a.createVNode("div",{class:`${u}__picture-text`},[a.createTextVNode("\u70B9\u51FB\u4E0A\u4F20")])])]),J=ne=>[a.withDirectives(a.createVNode("img",{src:ne.url,class:`${u}__picture-thumbnail`,alt:""},null),[[a.vShow,ne.status!=="uploading"]]),a.createVNode(a.Fragment,null,[ne.status==="uploading"&&a.createVNode(kr,{class:`${u}__picture-progress`,type:"circle",color:"#3a84ff",bgColor:"#333",width:50,titleStyle:{color:"#fff"},percent:ne.percentage},null)]),a.createVNode(a.Fragment,null,[!e.disabled&&a.createVNode("div",{class:`${u}__picture-actions`},[a.createVNode(mr,{class:"action-icon",onClick:_=>I(ne,_)},null)])])],z=()=>a.createVNode(_t,{disabled:l.value},{default:()=>[a.createVNode(js,{class:`${u}__button-icon`},null),a.createVNode("span",{class:`${u}__button-text`},[a.createTextVNode("\u4E0A\u4F20\u6587\u4EF6")])]}),E=()=>{if(h.value)return z();if(m.value)return T();if(p.value)return A()};return()=>{var ne;return a.createVNode("div",{class:L.value,tabindex:"0",onClick:C,onKeydown:b},[t.trigger?[t.trigger(),(ne=t==null?void 0:t.default)==null?void 0:ne.call(t)]:E(),a.createVNode("input",{ref:v,class:"bk-upload__input-file",tabindex:"-1",onChange:k,accept:y.value,multiple:c.value,disabled:l.value,type:"file"},null)])}}}),m9={exports:{}};(function(e,t){(function(n){e.exports=n()})(function(n){var i=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function l(k,C){var b=k[0],I=k[1],N=k[2],T=k[3];b+=(I&N|~I&T)+C[0]-680876936|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[1]-389564586|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[2]+606105819|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[3]-1044525330|0,I=(I<<22|I>>>10)+N|0,b+=(I&N|~I&T)+C[4]-176418897|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[5]+1200080426|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[6]-1473231341|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[7]-45705983|0,I=(I<<22|I>>>10)+N|0,b+=(I&N|~I&T)+C[8]+1770035416|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[9]-1958414417|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[10]-42063|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[11]-1990404162|0,I=(I<<22|I>>>10)+N|0,b+=(I&N|~I&T)+C[12]+1804603682|0,b=(b<<7|b>>>25)+I|0,T+=(b&I|~b&N)+C[13]-40341101|0,T=(T<<12|T>>>20)+b|0,N+=(T&b|~T&I)+C[14]-1502002290|0,N=(N<<17|N>>>15)+T|0,I+=(N&T|~N&b)+C[15]+1236535329|0,I=(I<<22|I>>>10)+N|0,b+=(I&T|N&~T)+C[1]-165796510|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[6]-1069501632|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[11]+643717713|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[0]-373897302|0,I=(I<<20|I>>>12)+N|0,b+=(I&T|N&~T)+C[5]-701558691|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[10]+38016083|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[15]-660478335|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[4]-405537848|0,I=(I<<20|I>>>12)+N|0,b+=(I&T|N&~T)+C[9]+568446438|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[14]-1019803690|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[3]-187363961|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[8]+1163531501|0,I=(I<<20|I>>>12)+N|0,b+=(I&T|N&~T)+C[13]-1444681467|0,b=(b<<5|b>>>27)+I|0,T+=(b&N|I&~N)+C[2]-51403784|0,T=(T<<9|T>>>23)+b|0,N+=(T&I|b&~I)+C[7]+1735328473|0,N=(N<<14|N>>>18)+T|0,I+=(N&b|T&~b)+C[12]-1926607734|0,I=(I<<20|I>>>12)+N|0,b+=(I^N^T)+C[5]-378558|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[8]-2022574463|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[11]+1839030562|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[14]-35309556|0,I=(I<<23|I>>>9)+N|0,b+=(I^N^T)+C[1]-1530992060|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[4]+1272893353|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[7]-155497632|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[10]-1094730640|0,I=(I<<23|I>>>9)+N|0,b+=(I^N^T)+C[13]+681279174|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[0]-358537222|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[3]-722521979|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[6]+76029189|0,I=(I<<23|I>>>9)+N|0,b+=(I^N^T)+C[9]-640364487|0,b=(b<<4|b>>>28)+I|0,T+=(b^I^N)+C[12]-421815835|0,T=(T<<11|T>>>21)+b|0,N+=(T^b^I)+C[15]+530742520|0,N=(N<<16|N>>>16)+T|0,I+=(N^T^b)+C[2]-995338651|0,I=(I<<23|I>>>9)+N|0,b+=(N^(I|~T))+C[0]-198630844|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[7]+1126891415|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[14]-1416354905|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[5]-57434055|0,I=(I<<21|I>>>11)+N|0,b+=(N^(I|~T))+C[12]+1700485571|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[3]-1894986606|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[10]-1051523|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[1]-2054922799|0,I=(I<<21|I>>>11)+N|0,b+=(N^(I|~T))+C[8]+1873313359|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[15]-30611744|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[6]-1560198380|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[13]+1309151649|0,I=(I<<21|I>>>11)+N|0,b+=(N^(I|~T))+C[4]-145523070|0,b=(b<<6|b>>>26)+I|0,T+=(I^(b|~N))+C[11]-1120210379|0,T=(T<<10|T>>>22)+b|0,N+=(b^(T|~I))+C[2]+718787259|0,N=(N<<15|N>>>17)+T|0,I+=(T^(N|~b))+C[9]-343485551|0,I=(I<<21|I>>>11)+N|0,k[0]=b+k[0]|0,k[1]=I+k[1]|0,k[2]=N+k[2]|0,k[3]=T+k[3]|0}function o(k){var C=[],b;for(b=0;b<64;b+=4)C[b>>2]=k.charCodeAt(b)+(k.charCodeAt(b+1)<<8)+(k.charCodeAt(b+2)<<16)+(k.charCodeAt(b+3)<<24);return C}function c(k){var C=[],b;for(b=0;b<64;b+=4)C[b>>2]=k[b]+(k[b+1]<<8)+(k[b+2]<<16)+(k[b+3]<<24);return C}function f(k){var C=k.length,b=[1732584193,-271733879,-1732584194,271733878],I,N,T,A,P,J;for(I=64;I<=C;I+=64)l(b,o(k.substring(I-64,I)));for(k=k.substring(I-64),N=k.length,T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],I=0;I<N;I+=1)T[I>>2]|=k.charCodeAt(I)<<(I%4<<3);if(T[I>>2]|=128<<(I%4<<3),I>55)for(l(b,T),I=0;I<16;I+=1)T[I]=0;return A=C*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(A[2],16),J=parseInt(A[1],16)||0,T[14]=P,T[15]=J,l(b,T),b}function u(k){var C=k.length,b=[1732584193,-271733879,-1732584194,271733878],I,N,T,A,P,J;for(I=64;I<=C;I+=64)l(b,c(k.subarray(I-64,I)));for(k=I-64<C?k.subarray(I-64):new Uint8Array(0),N=k.length,T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],I=0;I<N;I+=1)T[I>>2]|=k[I]<<(I%4<<3);if(T[I>>2]|=128<<(I%4<<3),I>55)for(l(b,T),I=0;I<16;I+=1)T[I]=0;return A=C*8,A=A.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(A[2],16),J=parseInt(A[1],16)||0,T[14]=P,T[15]=J,l(b,T),b}function h(k){var C="",b;for(b=0;b<4;b+=1)C+=i[k>>b*8+4&15]+i[k>>b*8&15];return C}function m(k){var C;for(C=0;C<k.length;C+=1)k[C]=h(k[C]);return k.join("")}m(f("hello")),typeof ArrayBuffer!="undefined"&&!ArrayBuffer.prototype.slice&&function(){function k(C,b){return C=C|0||0,C<0?Math.max(C+b,0):Math.min(C,b)}ArrayBuffer.prototype.slice=function(C,b){var I=this.byteLength,N=k(C,I),T=I,A,P,J,z;return b!==n&&(T=k(b,I)),N>T?new ArrayBuffer(0):(A=T-N,P=new ArrayBuffer(A),J=new Uint8Array(P),z=new Uint8Array(this,N,A),J.set(z),P)}}();function p(k){return/[\u0080-\uFFFF]/.test(k)&&(k=unescape(encodeURIComponent(k))),k}function w(k,C){var b=k.length,I=new ArrayBuffer(b),N=new Uint8Array(I),T;for(T=0;T<b;T+=1)N[T]=k.charCodeAt(T);return C?N:I}function y(k){return String.fromCharCode.apply(null,new Uint8Array(k))}function v(k,C,b){var I=new Uint8Array(k.byteLength+C.byteLength);return I.set(new Uint8Array(k)),I.set(new Uint8Array(C),k.byteLength),b?I:I.buffer}function L(k){var C=[],b=k.length,I;for(I=0;I<b-1;I+=2)C.push(parseInt(k.substr(I,2),16));return String.fromCharCode.apply(String,C)}function x(){this.reset()}return x.prototype.append=function(k){return this.appendBinary(p(k)),this},x.prototype.appendBinary=function(k){this._buff+=k,this._length+=k.length;var C=this._buff.length,b;for(b=64;b<=C;b+=64)l(this._hash,o(this._buff.substring(b-64,b)));return this._buff=this._buff.substring(b-64),this},x.prototype.end=function(k){var C=this._buff,b=C.length,I,N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T;for(I=0;I<b;I+=1)N[I>>2]|=C.charCodeAt(I)<<(I%4<<3);return this._finish(N,b),T=m(this._hash),k&&(T=L(T)),this.reset(),T},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(k){return this._buff=k.buff,this._length=k.length,this._hash=k.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(k,C){var b=C,I,N,T;if(k[b>>2]|=128<<(b%4<<3),b>55)for(l(this._hash,k),b=0;b<16;b+=1)k[b]=0;I=this._length*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(I[2],16),T=parseInt(I[1],16)||0,k[14]=N,k[15]=T,l(this._hash,k)},x.hash=function(k,C){return x.hashBinary(p(k),C)},x.hashBinary=function(k,C){var b=f(k),I=m(b);return C?L(I):I},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(k){var C=v(this._buff.buffer,k,!0),b=C.length,I;for(this._length+=k.byteLength,I=64;I<=b;I+=64)l(this._hash,c(C.subarray(I-64,I)));return this._buff=I-64<b?new Uint8Array(C.buffer.slice(I-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(k){var C=this._buff,b=C.length,I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],N,T;for(N=0;N<b;N+=1)I[N>>2]|=C[N]<<(N%4<<3);return this._finish(I,b),T=m(this._hash),k&&(T=L(T)),this.reset(),T},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var k=x.prototype.getState.call(this);return k.buff=y(k.buff),k},x.ArrayBuffer.prototype.setState=function(k){return k.buff=w(k.buff,!0),x.prototype.setState.call(this,k)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(k,C){var b=u(new Uint8Array(k)),I=m(b);return C?L(I):I},x})})(m9);var p9=m9.exports;function Yc(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}const dC=e=>{if(typeof XMLHttpRequest=="undefined")throw new Error("XMLHttpRequest is undefined");const t=new XMLHttpRequest,{action:n}=e;t.upload&&t.upload.addEventListener("progress",o=>{const c=o;c.percent=o.total>0?o.loaded/o.total*100:0,e.onProgress(c)});const i=new FormData;if(e.data){let o=e.data;Array.isArray(o)||(o=[o]),o.forEach(c=>{for(const[f,u]of Object.entries(c))Array.isArray(u)?i.append(f,...u):i.append(f,u)})}if(e.formDataAttributes){let o=e.formDataAttributes;Array.isArray(o)||(o=[o]),o.forEach(c=>{Array.isArray(c.value)?i.append(c.name,...c.value):i.append(c.name,c.value)})}if(i.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(new Error("An error occurred during upload"))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(new Error("An error occurred during upload"));e.onSuccess(Yc(t))}),t.addEventListener("loadend",()=>{e.onComplete()}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0),e.header)if(Array.isArray(e.header))e.header.forEach(o=>{const c=o.name,f=o.value;t.setRequestHeader(c,f)});else{const o=e.header.name,c=e.header.value;t.setRequestHeader(o,c)}const l=e.headers||{};if(l instanceof Headers)l.forEach((o,c)=>t.setRequestHeader(c,o));else for(const[o,c]of Object.entries(l))ef(c)||t.setRequestHeader(o,String(c));return t.send(i),t},b9=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,fC=async e=>{const t=e.chunkSize*1024*1024,{file:n}=e;if(!n)throw new Error("File not found");const i=Math.ceil(n.size/t),l=await gC(n,t),o=[];hC(e,n,i,l,o,t),await Promise.all(o).then(()=>{const c={size:n.size,name:n.name,total:i,hash:l},f=new XMLHttpRequest;f.open(e.method,e.mergeUrl,!0),f.onreadystatechange=()=>{if(f.readyState===4){if(f.status<200||f.status>=300)return e.onError(new Error("An error occurred during upload"));e.onSuccess(Yc(f))}},f.onloadend=()=>{e.onComplete()},f.setRequestHeader("Content-type","application/JSON"),f.send(JSON.stringify(c))})},hC=(e,t,n,i,l,o)=>{for(let c=0;c<n;c++){const f=new Promise((u,h)=>{const m=c*o,p=Math.min(t.size,m+o),w=new FormData;if(e.data){let L=e.data;Array.isArray(L)||(L=[L]),L.forEach(x=>{for(const[k,C]of Object.entries(x))Array.isArray(C)?w.append(k,...C):w.append(k,C)})}if(e.formDataAttributes){let L=e.formDataAttributes;Array.isArray(L)||(L=[L]),L.forEach(x=>{Array.isArray(x.value)?w.append(x.name,...x.value):w.append(x.name,x.value)})}w.append("file",b9.call(t,m,p)),w.append("name",t.name),w.append("total",n.toString()),w.append("index",c.toString()),w.append("size",t.size.toString()),w.append("hash",i.toString());const y=new XMLHttpRequest;if(y.onreadystatechange=()=>{if(y.readyState===4){const L=Yc(y);y.status<200||y.status>=300?(h(L),e.onError(new Error("An error occurred during upload"))):u("reponseText")}},y.upload.addEventListener("progress",L=>{const x=L;e.onProgress(x,c)},!1),e.withCredentials&&"withCredentials"in y&&(y.withCredentials=!0),y.open(e.method,e.sliceUrl,!0),e.header)if(Array.isArray(e.header))e.header.forEach(L=>{const x=L.name,k=L.value;y.setRequestHeader(x,k)});else{const L=e.header.name,x=e.header.value;y.setRequestHeader(L,x)}const v=e.headers||{};if(v instanceof Headers)v.forEach((L,x)=>y.setRequestHeader(x,L));else for(const[L,x]of Object.entries(v))ef(x)||y.setRequestHeader(L,String(x));y.send(w)});l.push(f)}},gC=(e,t)=>new Promise((n,i)=>{const l=Math.ceil(e.size/t);let o=0;const c=new p9.ArrayBuffer,f=new FileReader;function u(){const h=o*t,m=h+t>=e.size?e.size:h+t;f.readAsArrayBuffer(b9.call(e,h,m))}f.onload=h=>{if(c.append(h.target.result),o+=1,o<l)u();else{const m=c.end(),p=new p9;p.append(m),p.append(e.name);const w=p.end();n(w)}},f.onerror=()=>{i(new Error("File slcie failed"))},u()}).catch(n=>{console.log(n)});function y9(e){return Date.now()+e}var mC=(e,t)=>{const n=a.computed(()=>{var w;return typeof e.size=="number"?e.size:(w=e==null?void 0:e.size)==null?void 0:w.maxImgSize}),i=a.computed(()=>{var w;return typeof e.size=="number"?e.size:(w=e==null?void 0:e.size)==null?void 0:w.maxImgSize}),l=a.ref([]);function o(w){return l.value.find(y=>y.uid===w.uid)}let c=0;function f(w){var x;c+=1,w.uid=y9(c);const y={uid:w.uid,name:w.name,status:Ea.NEW,size:w.size,raw:w},v=w.type.startsWith("image/");let L=null;if(v){try{y.url=window.URL.createObjectURL(w)}catch(k){console.error(k)}y.isPic=!0}return e.validateName&&!((x=e.validateName)!=null&&x.test(y.name))&&(y.status=Ea.FAIL,y.statusText="invalid filename",L=new Error(y.statusText)),v&&w.size>n.value*1024**2&&(y.status=Ea.FAIL,y.statusText="invalid file size",L=new Error(y.statusText)),!v&&w.size>i.value*1024**2&&(y.status=Ea.FAIL,y.statusText="invalid file size",L=new Error(y.statusText)),l.value.push(y),L}async function u(w){var L;const y=w instanceof File?o(w):w,v=x=>{var k;t.onRemove(x,l.value),l.value.splice(l.value.indexOf(y),1),(k=x.url)!=null&&k.startsWith("blob:")&&URL.revokeObjectURL(x.url)};e.beforeRemove?await((L=e.beforeRemove)==null?void 0:L.call(e,y,l.value))!==!1&&v(y):v(y)}async function h(w,y,v){const L=o(y);!L||(L.status="fail",L.statusText=w.message,L.response=v)}async function m(w,y){const v=o(y);!v||(v.status="success",v.response=w)}async function p(w,y){const v=o(y);!v||(v.status="uploading",v.percentage=Math.round(w.percent))}return a.watch(()=>e.files,w=>{l.value=w.map(y=>{var v,L;return c+=1,Te(U({},y),{uid:(v=y.uid)!=null?v:y9(c),status:(L=y.status)!=null?L:Ea.SUCCESS})})},{immediate:!0,deep:!0}),{fileList:l,handlePreprocess:f,handleRemove:u,handleError:h,handleSuccess:m,handleProgress:p}},pC=a.defineComponent({name:"Upload",props:li,emits:["exceed","progress","success","error","delete","done"],setup(e,{slots:t,emit:n,expose:i}){const l=a.shallowRef({}),o=a.computed(()=>e.theme===si.PICTURE),c=a.computed(()=>o.value&&!e.multiple),f=a.computed(()=>{var N;return Se({[ia]:!0,[`${ia}--${e.theme}`]:!0,[`${ia}--disabled`]:e.disabled,[`${ia}--single-picture`]:c.value,[e.extCls]:(N=e.extCls)!=null?N:!1})}),u={theme:e.theme,multiple:e.multiple,disabled:e.disabled,accept:e.accept};function h(N,T){I(N),n("delete",N,T)}const{fileList:m,handlePreprocess:p,handleRemove:w,handleProgress:y,handleSuccess:v,handleError:L}=mC(e,{onRemove:h});function x(N){if(!N.length)return;if(e.limit&&m.value.length+N.length>e.limit){n("exceed",N,m.value);return}let T=N;(!e.multiple||e.limit===1)&&(T=N.slice(0,1));for(const A of T){const P=A,J=p(P);if(J){n("error",P,m.value,J);return}e.autoUpload&&C(P,T)}}function k(N){b(N.raw)}async function C(N,T){var P;if(!e.beforeUpload)return b(N,T);let A;try{A=await((P=e.beforeUpload)==null?void 0:P.call(e,N))}catch{A=!1}if(A===!1){w(N);return}b(N,T)}function b(N,T){const{headers:A,header:P,data:J,formDataAttributes:z,method:E,withCredentials:ne,name:_,url:ce,sliceUrl:re,mergeUrl:ae,chunkSize:ue,customRequest:ie}=e,{uid:Y}=N,W={headers:A,header:P,withCredentials:ne,file:N,data:J,formDataAttributes:z,method:E,filename:_,action:ce,sliceUrl:re,mergeUrl:ae,chunkSize:ue,onProgress:K=>{y(K,N),n("progress",K,N,m.value)},onSuccess:K=>{var he;const fe=K;if((he=e==null?void 0:e.handleResCode)!=null&&he.call(e,fe))v(K,N),n("success",K,N,m.value);else{const Ce=new Error((fe==null?void 0:fe.message)||"unknow error");L(Ce,N,K),n("error",N,m.value,Ce)}delete l.value[Y]},onError:K=>{L(K,N),n("error",N,m.value,K),delete l.value[Y]},onComplete:()=>{T&&T.indexOf(N)===T.length-1&&n("done",m.value)}};let Q=e.sliceUpload?fC:dC;ie&&(Q=ie);const F=Q(W);l.value[Y]=F,F instanceof Promise&&F.then(W.onSuccess,W.onError)}function I(N){let T=l.value;N&&(T={[N.uid]:l.value[N.uid]}),Object.keys(T).forEach(A=>{if(T[A]instanceof XMLHttpRequest){const P=T[A];P==null||P.abort()}delete l.value[A]})}return a.onBeforeUnmount(()=>{m.value.forEach(({url:N})=>{N!=null&&N.startsWith("blob:")&&URL.revokeObjectURL(N)})}),i({handleRemove:w,handleRetry:k}),()=>a.createVNode("div",{class:f.value},[!o.value&&a.createVNode(g9,a.mergeProps(u,{onChange:x}),t),t.tip?t.tip():e.tip&&a.createVNode("div",{class:`${ia}__tip`},[e.tip]),a.createVNode(uC,{files:m.value,theme:e.theme,disabled:e.disabled,multiple:e.multiple,onRemove:w,onRetry:k},{innerTrigger:N=>o.value&&a.createVNode(g9,a.mergeProps(u,{file:N,onChange:x,onRemove:w}),t),file:t.file})])}});const C9=He(pC);function zi(){}zi.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=i.callback;typeof i=="function"&&(l=i,i={}),this.options=i;var o=this;function c(L){return l?(setTimeout(function(){l(void 0,L)},0),!0):L}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var f=n.length,u=t.length,h=1,m=f+u,p=[{newPos:-1,components:[]}],w=this.extractCommon(p[0],n,t,0);if(p[0].newPos+1>=f&&w+1>=u)return c([{value:this.join(n),count:n.length}]);function y(){for(var L=-1*h;L<=h;L+=2){var x=void 0,k=p[L-1],C=p[L+1],b=(C?C.newPos:0)-L;k&&(p[L-1]=void 0);var I=k&&k.newPos+1<f,N=C&&0<=b&&b<u;if(!I&&!N){p[L]=void 0;continue}if(!I||N&&k.newPos<C.newPos?(x=yC(C),o.pushComponent(x.components,void 0,!0)):(x=k,x.newPos++,o.pushComponent(x.components,!0,void 0)),b=o.extractCommon(x,n,t,L),x.newPos+1>=f&&b+1>=u)return c(bC(o,x.components,n,t,o.useLongestToken));p[L]=x}h++}if(l)(function L(){setTimeout(function(){if(h>m)return l();y()||L()},0)})();else for(;h<=m;){var v=y();if(v)return v}},pushComponent:function(t,n,i){var l=t[t.length-1];l&&l.added===n&&l.removed===i?t[t.length-1]={count:l.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,l){for(var o=n.length,c=i.length,f=t.newPos,u=f-l,h=0;f+1<o&&u+1<c&&this.equals(n[f+1],i[u+1]);)f++,u++,h++;return h&&t.components.push({count:h}),t.newPos=f,u},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function bC(e,t,n,i,l){for(var o=0,c=t.length,f=0,u=0;o<c;o++){var h=t[o];if(h.removed){if(h.value=e.join(i.slice(u,u+h.count)),u+=h.count,o&&t[o-1].added){var p=t[o-1];t[o-1]=t[o],t[o]=p}}else{if(!h.added&&l){var m=n.slice(f,f+h.count);m=m.map(function(y,v){var L=i[u+v];return L.length>y.length?L:y}),h.value=e.join(m)}else h.value=e.join(n.slice(f,f+h.count));f+=h.count,h.added||(u+=h.count)}}var w=t[c-1];return c>1&&typeof w.value=="string"&&(w.added||w.removed)&&e.equals("",w.value)&&(t[c-2].value+=w.value,t.pop()),t}function yC(e){return{newPos:e.newPos,components:e.components.slice(0)}}var M9=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,w9=/\S/,v9=new zi;v9.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!w9.test(e)&&!w9.test(t)},v9.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M9.test(t[n])&&M9.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Uc=new zi;Uc.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var l=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),t.push(l))}return t};function CC(e,t,n){return Uc.diff(e,t,n)}var MC=new zi;MC.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var wC=new zi;wC.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ol(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ol=function(t){return typeof t}:ol=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(e)}function $c(e){return vC(e)||IC(e)||NC(e)||LC()}function vC(e){if(Array.isArray(e))return Xc(e)}function IC(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function NC(e,t){if(!!e){if(typeof e=="string")return Xc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xc(e,t)}}function Xc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function LC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
58
58
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var kC=Object.prototype.toString,Ar=new zi;Ar.useLongestToken=!0,Ar.tokenize=Uc.tokenize,Ar.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,l=i===void 0?function(o,c){return typeof c=="undefined"?n:c}:i;return typeof e=="string"?e:JSON.stringify(Kc(e,null,null,l),l," ")},Ar.equals=function(e,t){return zi.prototype.equals.call(Ar,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Kc(e,t,n,i,l){t=t||[],n=n||[],i&&(e=i(l,e));var o;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var c;if(kC.call(e)==="[object Array]"){for(t.push(e),c=new Array(e.length),n.push(c),o=0;o<e.length;o+=1)c[o]=Kc(e[o],t,n,i,l);return t.pop(),n.pop(),c}if(e&&e.toJSON&&(e=e.toJSON()),ol(e)==="object"&&e!==null){t.push(e),c={},n.push(c);var f=[],u;for(u in e)e.hasOwnProperty(u)&&f.push(u);for(f.sort(),o=0;o<f.length;o+=1)u=f[o],c[u]=Kc(e[u],t,n,i,u);t.pop(),n.pop()}else c=e;return c}var qc=new zi;qc.tokenize=function(e){return e.slice()},qc.join=qc.removeEmpty=function(e){return e};function TC(e,t,n,i,l,o,c){c||(c={}),typeof c.context=="undefined"&&(c.context=4);var f=CC(n,i,c);f.push({value:"",lines:[]});function u(k){return k.map(function(C){return" "+C})}for(var h=[],m=0,p=0,w=[],y=1,v=1,L=function(C){var b=f[C],I=b.lines||b.value.replace(/\n$/,"").split(`
59
59
  `);if(b.lines=I,b.added||b.removed){var N;if(!m){var T=f[C-1];m=y,p=v,T&&(w=c.context>0?u(T.lines.slice(-c.context)):[],m-=w.length,p-=w.length)}(N=w).push.apply(N,$c(I.map(function(ce){return(b.added?"+":"-")+ce}))),b.added?v+=I.length:y+=I.length}else{if(m)if(I.length<=c.context*2&&C<f.length-2){var A;(A=w).push.apply(A,$c(u(I)))}else{var P,J=Math.min(I.length,c.context);(P=w).push.apply(P,$c(u(I.slice(0,J))));var z={oldStart:m,oldLines:y-m+J,newStart:p,newLines:v-p+J,lines:w};if(C>=f.length-2&&I.length<=c.context){var E=/\n$/.test(n),ne=/\n$/.test(i),_=I.length==0&&w.length>z.oldLines;!E&&_&&n.length>0&&w.splice(z.oldLines,0,"\"),(!E&&!_||!ne)&&w.push("\")}h.push(z),m=0,p=0,w=[]}y+=I.length,v+=I.length}},x=0;x<f.length;x++)L(x);return{oldFileName:e,newFileName:t,oldHeader:l,newHeader:o,hunks:h}}function xC(e){var t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(typeof e.oldHeader=="undefined"?"":" "+e.oldHeader)),t.push("+++ "+e.newFileName+(typeof e.newHeader=="undefined"?"":" "+e.newHeader));for(var n=0;n<e.hunks.length;n++){var i=e.hunks[n];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),t.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@"),t.push.apply(t,i.lines)}return t.join(`
60
60
  `)+`