@xtctwins/tctwins-bimx-engine 0.3.4 → 0.3.5

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.
Files changed (21) hide show
  1. package/dist/{AnnotationTool-o5g0AREJ.mjs → AnnotationTool-DK5_6F3a.mjs} +2 -2
  2. package/dist/BIMX_Viewer_Lib.es.js +1 -1
  3. package/dist/BIMX_Viewer_Lib.umd.js +2 -2
  4. package/dist/{CameraViewTool-DYukyv5Q.mjs → CameraViewTool-bj-D4qTC.mjs} +1 -1
  5. package/dist/{CommentTool-0voGtLXB.mjs → CommentTool-BiJ_ERXE.mjs} +1 -1
  6. package/dist/{HiddenTool-CB8a3I71.mjs → HiddenTool--ZhEcHHx.mjs} +1 -1
  7. package/dist/{InspectorTool-D_zuKOsj.mjs → InspectorTool-BZ3KodJ6.mjs} +3 -3
  8. package/dist/{MeasureTool-F0pD5KDj.mjs → MeasureTool-ZX_QY2P8.mjs} +2 -2
  9. package/dist/{MouseTool-DwVd0jsi.mjs → MouseTool-B4KE8WTI.mjs} +1 -1
  10. package/dist/{NavigateTool-D9yL9I0-.mjs → NavigateTool-NHXzZdfp.mjs} +1 -1
  11. package/dist/{RoamTool-C0cFwyiz.mjs → RoamTool-JAcpc5HA.mjs} +1 -1
  12. package/dist/{ScreenShotTool-BlQ4pLfp.mjs → ScreenShotTool-BJikIQgo.mjs} +2 -2
  13. package/dist/{SectionTool-BSqICcbP.mjs → SectionTool-Ba4Vhyjs.mjs} +4 -4
  14. package/dist/{SettingTool-Jvi1wkwu.mjs → SettingTool-CIJjnSxn.mjs} +3 -3
  15. package/dist/{StructureTree-DQ_lU3sB.mjs → StructureTree-CF3k1jc2.mjs} +3 -3
  16. package/dist/{alert-Bc55oe1i.mjs → alert-BgvqkGnh.mjs} +1 -1
  17. package/dist/{el-input-number-CpL0IdzD.mjs → el-input-number-D1zL_-nH.mjs} +1 -1
  18. package/dist/{index-BSouWIqa.mjs → index-Cg9YgLyf.mjs} +33 -15
  19. package/dist/{panel.vue_vue_type_style_index_0_lang-Bt42YE-8.mjs → panel.vue_vue_type_style_index_0_lang-C-9DvZAr.mjs} +1 -1
  20. package/dist/{tallPanel-DURfdD5Z.mjs → tallPanel-8Rc6OZ8T.mjs} +1 -1
  21. package/package.json +2 -2
@@ -17,7 +17,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:x,curr
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,VD=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function UD(N){const Q=window.getComputedStyle(N),a=Q.getPropertyValue("box-sizing"),x=Number.parseFloat(Q.getPropertyValue("padding-bottom"))+Number.parseFloat(Q.getPropertyValue("padding-top")),S=Number.parseFloat(Q.getPropertyValue("border-bottom-width"))+Number.parseFloat(Q.getPropertyValue("border-top-width"));return{contextStyle:VD.map(h=>`${h}:${Q.getPropertyValue(h)}`).join(";"),paddingSize:x,borderSize:S,boxSizing:a}}function H_(N,Q=1,a){var x;go||(go=document.createElement("textarea"),document.body.appendChild(go));const{paddingSize:S,borderSize:A,boxSizing:h,contextStyle:d}=UD(N);go.setAttribute("style",`${d};${jD}`),go.value=N.value||N.placeholder||"";let u=go.scrollHeight;const l={};h==="border-box"?u=u+A:h==="content-box"&&(u=u-S),go.value="";const c=go.scrollHeight-S;if(Ri(Q)){let f=c*Q;h==="border-box"&&(f=f+S+A),u=Math.max(f,u),l.minHeight=`${f}px`}if(Ri(a)){let f=c*a;h==="border-box"&&(f=f+S+A),u=Math.min(f,u)}return l.height=`${u}px`,(x=go.parentNode)==null||x.removeChild(go),go=void 0,l}const HD=ei({id:{type:String,default:void 0},size:po,disabled:Boolean,modelValue:{type:Pr([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Pr([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ho},prefixIcon:{type:ho},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Pr([Object,Array,String]),default:()=>J4({})},autofocus:Boolean,rows:{type:Number,default:2},...Ys(["ariaLabel"])}),zD={[Wi]:N=>Dn(N),input:N=>Dn(N),change:N=>Dn(N),focus:N=>N instanceof FocusEvent,blur:N=>N instanceof FocusEvent,clear:()=>!0,mouseleave:N=>N instanceof MouseEvent,mouseenter:N=>N instanceof MouseEvent,keydown:N=>N instanceof Event,compositionstart:N=>N instanceof CompositionEvent,compositionupdate:N=>N instanceof CompositionEvent,compositionend:N=>N instanceof CompositionEvent},GD=s.defineComponent({name:"ElInput",inheritAttrs:!1}),QD=s.defineComponent({...GD,props:HD,emits:zD,setup(N,{expose:Q,emit:a}){const x=N,S=s.useAttrs(),A=s.useSlots(),h=s.computed(()=>{const be={};return x.containerRole==="combobox"&&(be["aria-haspopup"]=S["aria-haspopup"],be["aria-owns"]=S["aria-owns"],be["aria-expanded"]=S["aria-expanded"]),be}),d=s.computed(()=>[x.type==="textarea"?b.b():_.b(),_.m(m.value),_.is("disabled",v.value),_.is("exceed",ee.value),{[_.b("group")]:A.prepend||A.append,[_.m("prefix")]:A.prefix||x.prefixIcon,[_.m("suffix")]:A.suffix||x.suffixIcon||x.clearable||x.showPassword,[_.bm("suffix","password-clear")]:F.value&&V.value,[_.b("hidden")]:x.type==="hidden"},S.class]),u=s.computed(()=>[_.e("wrapper"),_.is("focus",H.value)]),l=eI({excludeKeys:s.computed(()=>Object.keys(h.value))}),{form:c,formItem:f}=Ao(),{inputId:p}=vl(x,{formItemContext:f}),m=mo(),v=gl(),_=Jr("input"),b=Jr("textarea"),w=s.shallowRef(),C=s.shallowRef(),k=s.ref(!1),T=s.ref(!1),R=s.ref(),U=s.shallowRef(x.inputStyle),G=s.computed(()=>w.value||C.value),{wrapperRef:j,isFocused:H}=N_(G,{afterBlur(){var be;x.validateEvent&&((be=f==null?void 0:f.validate)==null||be.call(f,"blur").catch(De=>Ki(De)))}}),W=s.computed(()=>{var be;return(be=c==null?void 0:c.statusIcon)!=null?be:!1}),K=s.computed(()=>(f==null?void 0:f.validateState)||""),$=s.computed(()=>K.value&&s_[K.value]),O=s.computed(()=>T.value?ui.View:ui.Hide),L=s.computed(()=>[S.style]),M=s.computed(()=>[x.inputStyle,U.value,{resize:x.resize}]),I=s.computed(()=>ko(x.modelValue)?"":String(x.modelValue)),F=s.computed(()=>x.clearable&&!v.value&&!x.readonly&&!!I.value&&(H.value||k.value)),V=s.computed(()=>x.showPassword&&!v.value&&!x.readonly&&!!I.value&&(!!I.value||H.value)),D=s.computed(()=>x.showWordLimit&&!!x.maxlength&&(x.type==="text"||x.type==="textarea")&&!v.value&&!x.readonly&&!x.showPassword),X=s.computed(()=>I.value.length),ee=s.computed(()=>!!D.value&&X.value>Number(x.maxlength)),q=s.computed(()=>!!A.suffix||!!x.suffixIcon||F.value||x.showPassword||D.value||!!K.value&&W.value),[ne,oe]=ED(w);ea(C,be=>{if(de(),!D.value||x.resize!=="both")return;const De=be[0],{width:Je}=De.contentRect;R.value={right:`calc(100% - ${Je+15+6}px)`}});const he=()=>{const{type:be,autosize:De}=x;if(!(!Ln||be!=="textarea"||!C.value))if(De){const Je=qn(De)?De.minRows:void 0,Qe=qn(De)?De.maxRows:void 0,ot=H_(C.value,Je,Qe);U.value={overflowY:"hidden",...ot},s.nextTick(()=>{C.value.offsetHeight,U.value=ot})}else U.value={minHeight:H_(C.value).minHeight}},de=(be=>{let De=!1;return()=>{var Je;if(De||!x.autosize)return;((Je=C.value)==null?void 0:Je.offsetParent)===null||(be(),De=!0)}})(he),se=()=>{const be=G.value,De=x.formatter?x.formatter(I.value):I.value;!be||be.value===De||(be.value=De)},re=async be=>{ne();let{value:De}=be.target;if(x.formatter&&(De=x.parser?x.parser(De):De),!Ce.value){if(De===I.value){se();return}a(Wi,De),a("input",De),await s.nextTick(),se(),oe()}},ae=be=>{a("change",be.target.value)},{isComposing:Ce,handleCompositionStart:me,handleCompositionUpdate:ce,handleCompositionEnd:pe}=L_({emit:a,afterComposition:re}),B=()=>{T.value=!T.value,ke()},ke=async()=>{var be;await s.nextTick(),(be=G.value)==null||be.focus()},Ee=()=>{var be;return(be=G.value)==null?void 0:be.blur()},ge=be=>{k.value=!1,a("mouseleave",be)},Ae=be=>{k.value=!0,a("mouseenter",be)},fe=be=>{a("keydown",be)},ue=()=>{var be;(be=G.value)==null||be.select()},_e=()=>{a(Wi,""),a("change",""),a("clear"),a("input","")};return s.watch(()=>x.modelValue,()=>{var be;s.nextTick(()=>he()),x.validateEvent&&((be=f==null?void 0:f.validate)==null||be.call(f,"change").catch(De=>Ki(De)))}),s.watch(I,()=>se()),s.watch(()=>x.type,async()=>{await s.nextTick(),se(),he()}),s.onMounted(()=>{!x.formatter&&x.parser&&Ki("ElInput","If you set the parser, you also need to set the formatter."),se(),s.nextTick(he)}),Q({input:w,textarea:C,ref:G,textareaStyle:M,autosize:s.toRef(x,"autosize"),isComposing:Ce,focus:ke,blur:Ee,select:ue,clear:_e,resizeTextarea:he}),(be,De)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps(s.unref(h),{class:[s.unref(d),{[s.unref(_).bm("group","append")]:be.$slots.append,[s.unref(_).bm("group","prepend")]:be.$slots.prepend}],style:s.unref(L),role:be.containerRole,onMouseenter:Ae,onMouseleave:ge}),[s.createCommentVNode(" input "),be.type!=="textarea"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createCommentVNode(" prepend slot "),be.$slots.prepend?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(_).be("group","prepend"))},[s.renderSlot(be.$slots,"prepend")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref_key:"wrapperRef",ref:j,class:s.normalizeClass(s.unref(u))},[s.createCommentVNode(" prefix slot "),be.$slots.prefix||be.prefixIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(_).e("prefix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(_).e("prefix-inner"))},[s.renderSlot(be.$slots,"prefix"),be.prefixIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(_).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(be.prefixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("input",s.mergeProps({id:s.unref(p),ref_key:"input",ref:w,class:s.unref(_).e("inner")},s.unref(l),{minlength:be.minlength,maxlength:be.maxlength,type:be.showPassword?T.value?"text":"password":be.type,disabled:s.unref(v),readonly:be.readonly,autocomplete:be.autocomplete,tabindex:be.tabindex,"aria-label":be.ariaLabel,placeholder:be.placeholder,style:be.inputStyle,form:be.form,autofocus:be.autofocus,onCompositionstart:s.unref(me),onCompositionupdate:s.unref(ce),onCompositionend:s.unref(pe),onInput:re,onChange:ae,onKeydown:fe}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),s.createCommentVNode(" suffix slot "),s.unref(q)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(_).e("suffix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(_).e("suffix-inner"))},[!s.unref(F)||!s.unref(V)||!s.unref(D)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(be.$slots,"suffix"),be.suffixIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(_).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(be.suffixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],64)):s.createCommentVNode("v-if",!0),s.unref(F)?(s.openBlock(),s.createBlock(s.unref(ni),{key:1,class:s.normalizeClass([s.unref(_).e("icon"),s.unref(_).e("clear")]),onMousedown:s.withModifiers(s.unref(du),["prevent"]),onClick:_e},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(V)?(s.openBlock(),s.createBlock(s.unref(ni),{key:2,class:s.normalizeClass([s.unref(_).e("icon"),s.unref(_).e("password")]),onClick:B},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(O))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.unref(D)?(s.openBlock(),s.createElementBlock("span",{key:3,class:s.normalizeClass(s.unref(_).e("count"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(_).e("count-inner"))},s.toDisplayString(s.unref(X))+" / "+s.toDisplayString(be.maxlength),3)],2)):s.createCommentVNode("v-if",!0),s.unref(K)&&s.unref($)&&s.unref(W)?(s.openBlock(),s.createBlock(s.unref(ni),{key:4,class:s.normalizeClass([s.unref(_).e("icon"),s.unref(_).e("validateIcon"),s.unref(_).is("loading",s.unref(K)==="validating")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref($))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0)],2),s.createCommentVNode(" append slot "),be.$slots.append?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(_).be("group","append"))},[s.renderSlot(be.$slots,"append")],2)):s.createCommentVNode("v-if",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createCommentVNode(" textarea "),s.createElementVNode("textarea",s.mergeProps({id:s.unref(p),ref_key:"textarea",ref:C,class:[s.unref(b).e("inner"),s.unref(_).is("focus",s.unref(H))]},s.unref(l),{minlength:be.minlength,maxlength:be.maxlength,tabindex:be.tabindex,disabled:s.unref(v),readonly:be.readonly,autocomplete:be.autocomplete,style:s.unref(M),"aria-label":be.ariaLabel,placeholder:be.placeholder,form:be.form,autofocus:be.autofocus,rows:be.rows,onCompositionstart:s.unref(me),onCompositionupdate:s.unref(ce),onCompositionend:s.unref(pe),onInput:re,onChange:ae,onKeydown:fe}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend"]),s.unref(D)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(R.value),class:s.normalizeClass(s.unref(_).e("count"))},s.toDisplayString(s.unref(X))+" / "+s.toDisplayString(be.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var WD=si(QD,[["__file","input.vue"]]);const Sn=Gn(WD),lc=4,$D={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},KD=({move:N,size:Q,bar:a})=>({[a.size]:Q,transform:`translate${a.axis}(${N}%)`}),Dm=Symbol("scrollbarContextKey"),XD=ei({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),YD="Thumb";var z_=si(s.defineComponent({__name:"thumb",props:XD,setup(N){const Q=N,a=s.inject(Dm),x=Jr("scrollbar");a||ch(YD,"can not inject scrollbar context");const S=s.ref(),A=s.ref(),h=s.ref({}),d=s.ref(!1);let u=!1,l=!1,c=Ln?document.onselectstart:null;const f=s.computed(()=>$D[Q.vertical?"vertical":"horizontal"]),p=s.computed(()=>KD({size:Q.size,move:Q.move,bar:f.value})),m=s.computed(()=>S.value[f.value.offset]**2/a.wrapElement[f.value.scrollSize]/Q.ratio/A.value[f.value.offset]),v=U=>{var G;if(U.stopPropagation(),U.ctrlKey||[1,2].includes(U.button))return;(G=window.getSelection())==null||G.removeAllRanges(),b(U);const j=U.currentTarget;j&&(h.value[f.value.axis]=j[f.value.offset]-(U[f.value.client]-j.getBoundingClientRect()[f.value.direction]))},_=U=>{if(!A.value||!S.value||!a.wrapElement)return;const G=Math.abs(U.target.getBoundingClientRect()[f.value.direction]-U[f.value.client]),j=A.value[f.value.offset]/2,H=(G-j)*100*m.value/S.value[f.value.offset];a.wrapElement[f.value.scroll]=H*a.wrapElement[f.value.scrollSize]/100},b=U=>{U.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),c=document.onselectstart,document.onselectstart=()=>!1},w=U=>{if(!S.value||!A.value||u===!1)return;const G=h.value[f.value.axis];if(!G)return;const j=(S.value.getBoundingClientRect()[f.value.direction]-U[f.value.client])*-1,H=A.value[f.value.offset]-G,W=(j-H)*100*m.value/S.value[f.value.offset];a.wrapElement[f.value.scroll]=W*a.wrapElement[f.value.scrollSize]/100},C=()=>{u=!1,h.value[f.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),R(),l&&(d.value=!1)},k=()=>{l=!1,d.value=!!Q.size},T=()=>{l=!0,d.value=u};s.onBeforeUnmount(()=>{R(),document.removeEventListener("mouseup",C)});const R=()=>{document.onselectstart!==c&&(document.onselectstart=c)};return Zn(s.toRef(a,"scrollbarElement"),"mousemove",k),Zn(s.toRef(a,"scrollbarElement"),"mouseleave",T),(U,G)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(x).b("fade"),persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{ref_key:"instance",ref:S,class:s.normalizeClass([s.unref(x).e("bar"),s.unref(x).is(s.unref(f).key)]),onMousedown:_},[s.createElementVNode("div",{ref_key:"thumb",ref:A,class:s.normalizeClass(s.unref(x).e("thumb")),style:s.normalizeStyle(s.unref(p)),onMousedown:v},null,38)],34),[[s.vShow,U.always||d.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const JD=ei({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var ZD=si(s.defineComponent({__name:"bar",props:JD,setup(N,{expose:Q}){const a=N,x=s.inject(Dm),S=s.ref(0),A=s.ref(0),h=s.ref(""),d=s.ref(""),u=s.ref(1),l=s.ref(1);return Q({handleScroll:p=>{if(p){const m=p.offsetHeight-lc,v=p.offsetWidth-lc;A.value=p.scrollTop*100/m*u.value,S.value=p.scrollLeft*100/v*l.value}},update:()=>{const p=x==null?void 0:x.wrapElement;if(!p)return;const m=p.offsetHeight-lc,v=p.offsetWidth-lc,_=m**2/p.scrollHeight,b=v**2/p.scrollWidth,w=Math.max(_,a.minSize),C=Math.max(b,a.minSize);u.value=_/(m-_)/(w/(m-w)),l.value=b/(v-b)/(C/(v-C)),d.value=w+lc<m?`${w}px`:"",h.value=C+lc<v?`${C}px`:""}}),(p,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(z_,{move:S.value,ratio:l.value,size:h.value,always:p.always},null,8,["move","ratio","size","always"]),s.createVNode(z_,{move:A.value,ratio:u.value,size:d.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const qD=ei({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Pr([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,...Ys(["ariaLabel","ariaOrientation"])}),eF={scroll:({scrollTop:N,scrollLeft:Q})=>[N,Q].every(Ri)},Fm="ElScrollbar",tF=s.defineComponent({name:Fm}),rF=s.defineComponent({...tF,props:qD,emits:eF,setup(N,{expose:Q,emit:a}){const x=N,S=Jr("scrollbar");let A,h,d=0,u=0;const l=s.ref(),c=s.ref(),f=s.ref(),p=s.ref(),m=s.computed(()=>{const R={};return x.height&&(R.height=dh(x.height)),x.maxHeight&&(R.maxHeight=dh(x.maxHeight)),[x.wrapStyle,R]}),v=s.computed(()=>[x.wrapClass,S.e("wrap"),{[S.em("wrap","hidden-default")]:!x.native}]),_=s.computed(()=>[S.e("view"),x.viewClass]),b=()=>{var R;c.value&&((R=p.value)==null||R.handleScroll(c.value),d=c.value.scrollTop,u=c.value.scrollLeft,a("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function w(R,U){qn(R)?c.value.scrollTo(R):Ri(R)&&Ri(U)&&c.value.scrollTo(R,U)}const C=R=>{if(!Ri(R)){Ki(Fm,"value must be a number");return}c.value.scrollTop=R},k=R=>{if(!Ri(R)){Ki(Fm,"value must be a number");return}c.value.scrollLeft=R},T=()=>{var R;(R=p.value)==null||R.update()};return s.watch(()=>x.noresize,R=>{R?(A==null||A(),h==null||h()):({stop:A}=ea(f,T),h=Zn("resize",T))},{immediate:!0}),s.watch(()=>[x.maxHeight,x.height],()=>{x.native||s.nextTick(()=>{var R;T(),c.value&&((R=p.value)==null||R.handleScroll(c.value))})}),s.provide(Dm,s.reactive({scrollbarElement:l,wrapElement:c})),s.onActivated(()=>{c.value.scrollTop=d,c.value.scrollLeft=u}),s.onMounted(()=>{x.native||s.nextTick(()=>{T()})}),s.onUpdated(()=>T()),Q({wrapRef:c,update:T,scrollTo:w,setScrollTop:C,setScrollLeft:k,handleScroll:b}),(R,U)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:s.normalizeClass(s.unref(S).b())},[s.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:s.normalizeClass(s.unref(v)),style:s.normalizeStyle(s.unref(m)),onScroll:b},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.tag),{id:R.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(_)),style:s.normalizeStyle(R.viewStyle),role:R.role,"aria-label":R.ariaLabel,"aria-orientation":R.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(R.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),R.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(ZD,{key:0,ref_key:"barRef",ref:p,always:R.always,"min-size":R.minSize},null,8,["always","min-size"]))],2))}});var iF=si(rF,[["__file","scrollbar.vue"]]);const yn=Gn(iF),Rm=Symbol("popper"),G_=Symbol("popperContent"),Q_=ei({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),nF=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),sF=s.defineComponent({...nF,props:Q_,setup(N,{expose:Q}){const a=N,x=s.ref(),S=s.ref(),A=s.ref(),h=s.ref(),d=s.computed(()=>a.role),u={triggerRef:x,popperInstanceRef:S,contentRef:A,referenceRef:h,role:d};return Q(u),s.provide(Rm,u),(l,c)=>s.renderSlot(l.$slots,"default")}});var oF=si(sF,[["__file","popper.vue"]]);const W_=ei({arrowOffset:{type:Number,default:5}}),aF=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),lF=s.defineComponent({...aF,props:W_,setup(N,{expose:Q}){const a=N,x=Jr("popper"),{arrowOffset:S,arrowRef:A,arrowStyle:h}=s.inject(G_,void 0);return s.watch(()=>a.arrowOffset,d=>{S.value=d}),s.onBeforeUnmount(()=>{A.value=void 0}),Q({arrowRef:A}),(d,u)=>(s.openBlock(),s.createElementBlock("span",{ref_key:"arrowRef",ref:A,class:s.normalizeClass(s.unref(x).e("arrow")),style:s.normalizeStyle(s.unref(h)),"data-popper-arrow":""},null,6))}});var cF=si(lF,[["__file","arrow.vue"]]);const Om="ElOnlyChild",uF=s.defineComponent({name:Om,setup(N,{slots:Q,attrs:a}){var x;const S=s.inject(D_),A=_D((x=S==null?void 0:S.setForwardRef)!=null?x:du);return()=>{var h;const d=(h=Q.default)==null?void 0:h.call(Q,a);if(!d)return null;if(d.length>1)return Ki(Om,"requires exact only one valid child."),null;const u=$_(d);return u?s.withDirectives(s.cloneVNode(u,a),[[A]]):(Ki(Om,"no valid child node found"),null)}}});function $_(N){if(!N)return null;const Q=N;for(const a of Q){if(qn(a))switch(a.type){case s.Comment:continue;case s.Text:case"svg":return K_(a);case s.Fragment:return $_(a.children);default:return a}return K_(a)}return null}function K_(N){const Q=Jr("only-child");return s.createVNode("span",{class:Q.e("content")},[N])}const X_=ei({virtualRef:{type:Pr(Object)},virtualTriggering:Boolean,onMouseenter:{type:Pr(Function)},onMouseleave:{type:Pr(Function)},onClick:{type:Pr(Function)},onKeydown:{type:Pr(Function)},onFocus:{type:Pr(Function)},onBlur:{type:Pr(Function)},onContextmenu:{type:Pr(Function)},id:String,open:Boolean}),dF=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),hF=s.defineComponent({...dF,props:X_,setup(N,{expose:Q}){const a=N,{role:x,triggerRef:S}=s.inject(Rm,void 0);bD(S);const A=s.computed(()=>d.value?a.id:void 0),h=s.computed(()=>{if(x&&x.value==="tooltip")return a.open&&a.id?a.id:void 0}),d=s.computed(()=>{if(x&&x.value!=="tooltip")return x.value}),u=s.computed(()=>d.value?`${a.open}`:void 0);let l;const c=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return s.onMounted(()=>{s.watch(()=>a.virtualRef,f=>{f&&(S.value=qo(f))},{immediate:!0}),s.watch(S,(f,p)=>{l==null||l(),l=void 0,fl(f)&&(c.forEach(m=>{var v;const _=a[m];_&&(f.addEventListener(m.slice(2).toLowerCase(),_),(v=p==null?void 0:p.removeEventListener)==null||v.call(p,m.slice(2).toLowerCase(),_))}),l=s.watch([A,h,d,u],m=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((v,_)=>{ko(m[_])?f.removeAttribute(v):f.setAttribute(v,m[_])})},{immediate:!0})),fl(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(m=>p.removeAttribute(m))},{immediate:!0})}),s.onBeforeUnmount(()=>{if(l==null||l(),l=void 0,S.value&&fl(S.value)){const f=S.value;c.forEach(p=>{const m=a[p];m&&f.removeEventListener(p.slice(2).toLowerCase(),m)}),S.value=void 0}}),Q({triggerRef:S}),(f,p)=>f.virtualTriggering?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(s.unref(uF),s.mergeProps({key:0},f.$attrs,{"aria-controls":s.unref(A),"aria-describedby":s.unref(h),"aria-expanded":s.unref(u),"aria-haspopup":s.unref(d)}),{default:s.withCtx(()=>[s.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var fF=si(hF,[["__file","trigger.vue"]]);const Nm="focus-trap.focus-after-trapped",Lm="focus-trap.focus-after-released",pF="focus-trap.focusout-prevented",Y_={cancelable:!0,bubbles:!1},mF={cancelable:!0,bubbles:!1},J_="focusAfterTrapped",Z_="focusAfterReleased",AF=Symbol("elFocusTrap"),jm=s.ref(),gh=s.ref(0),Vm=s.ref(0);let vh=0;const q_=N=>{const Q=[],a=document.createTreeWalker(N,NodeFilter.SHOW_ELEMENT,{acceptNode:x=>{const S=x.tagName==="INPUT"&&x.type==="hidden";return x.disabled||x.hidden||S?NodeFilter.FILTER_SKIP:x.tabIndex>=0||x===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)Q.push(a.currentNode);return Q},e1=(N,Q)=>{for(const a of N)if(!gF(a,Q))return a},gF=(N,Q)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(N).visibility==="hidden")return!0;for(;N;){if(Q&&N===Q)return!1;if(getComputedStyle(N).display==="none")return!0;N=N.parentElement}return!1},vF=N=>{const Q=q_(N),a=e1(Q,N),x=e1(Q.reverse(),N);return[a,x]},yF=N=>N instanceof HTMLInputElement&&"select"in N,Ra=(N,Q)=>{if(N&&N.focus){const a=document.activeElement;N.focus({preventScroll:!0}),Vm.value=window.performance.now(),N!==a&&yF(N)&&Q&&N.select()}};function t1(N,Q){const a=[...N],x=N.indexOf(Q);return x!==-1&&a.splice(x,1),a}const bF=()=>{let N=[];return{push:x=>{const S=N[0];S&&x!==S&&S.pause(),N=t1(N,x),N.unshift(x)},remove:x=>{var S,A;N=t1(N,x),(A=(S=N[0])==null?void 0:S.resume)==null||A.call(S)}}},_F=(N,Q=!1)=>{const a=document.activeElement;for(const x of N)if(Ra(x,Q),document.activeElement!==a)return},r1=bF(),wF=()=>gh.value>Vm.value,yh=()=>{jm.value="pointer",gh.value=window.performance.now()},i1=()=>{jm.value="keyboard",gh.value=window.performance.now()},xF=()=>(s.onMounted(()=>{vh===0&&(document.addEventListener("mousedown",yh),document.addEventListener("touchstart",yh),document.addEventListener("keydown",i1)),vh++}),s.onBeforeUnmount(()=>{vh--,vh<=0&&(document.removeEventListener("mousedown",yh),document.removeEventListener("touchstart",yh),document.removeEventListener("keydown",i1))}),{focusReason:jm,lastUserFocusTimestamp:gh,lastAutomatedFocusTimestamp:Vm}),bh=N=>new CustomEvent(pF,{...mF,detail:N}),CF=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[J_,Z_,"focusin","focusout","focusout-prevented","release-requested"],setup(N,{emit:Q}){const a=s.ref();let x,S;const{focusReason:A}=xF();mD(v=>{N.trapped&&!h.paused&&Q("release-requested",v)});const h={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},d=v=>{if(!N.loop&&!N.trapped||h.paused)return;const{key:_,altKey:b,ctrlKey:w,metaKey:C,currentTarget:k,shiftKey:T}=v,{loop:R}=N,U=_===Ii.tab&&!b&&!w&&!C,G=document.activeElement;if(U&&G){const j=k,[H,W]=vF(j);if(H&&W){if(!T&&G===W){const $=bh({focusReason:A.value});Q("focusout-prevented",$),$.defaultPrevented||(v.preventDefault(),R&&Ra(H,!0))}else if(T&&[H,j].includes(G)){const $=bh({focusReason:A.value});Q("focusout-prevented",$),$.defaultPrevented||(v.preventDefault(),R&&Ra(W,!0))}}else if(G===j){const $=bh({focusReason:A.value});Q("focusout-prevented",$),$.defaultPrevented||v.preventDefault()}}};s.provide(AF,{focusTrapRef:a,onKeydown:d}),s.watch(()=>N.focusTrapEl,v=>{v&&(a.value=v)},{immediate:!0}),s.watch([a],([v],[_])=>{v&&(v.addEventListener("keydown",d),v.addEventListener("focusin",c),v.addEventListener("focusout",f)),_&&(_.removeEventListener("keydown",d),_.removeEventListener("focusin",c),_.removeEventListener("focusout",f))});const u=v=>{Q(J_,v)},l=v=>Q(Z_,v),c=v=>{const _=s.unref(a);if(!_)return;const b=v.target,w=v.relatedTarget,C=b&&_.contains(b);N.trapped||w&&_.contains(w)||(x=w),C&&Q("focusin",v),!h.paused&&N.trapped&&(C?S=b:Ra(S,!0))},f=v=>{const _=s.unref(a);if(!(h.paused||!_))if(N.trapped){const b=v.relatedTarget;!ko(b)&&!_.contains(b)&&setTimeout(()=>{if(!h.paused&&N.trapped){const w=bh({focusReason:A.value});Q("focusout-prevented",w),w.defaultPrevented||Ra(S,!0)}},0)}else{const b=v.target;b&&_.contains(b)||Q("focusout",v)}};async function p(){await s.nextTick();const v=s.unref(a);if(v){r1.push(h);const _=v.contains(document.activeElement)?x:document.activeElement;if(x=_,!v.contains(_)){const w=new Event(Nm,Y_);v.addEventListener(Nm,u),v.dispatchEvent(w),w.defaultPrevented||s.nextTick(()=>{let C=N.focusStartEl;Dn(C)||(Ra(C),document.activeElement!==C&&(C="first")),C==="first"&&_F(q_(v),!0),(document.activeElement===_||C==="container")&&Ra(v)})}}}function m(){const v=s.unref(a);if(v){v.removeEventListener(Nm,u);const _=new CustomEvent(Lm,{...Y_,detail:{focusReason:A.value}});v.addEventListener(Lm,l),v.dispatchEvent(_),!_.defaultPrevented&&(A.value=="keyboard"||!wF()||v.contains(document.activeElement))&&Ra(x??document.body),v.removeEventListener(Lm,l),r1.remove(h)}}return s.onMounted(()=>{N.trapped&&p(),s.watch(()=>N.trapped,v=>{v?p():m()})}),s.onBeforeUnmount(()=>{N.trapped&&m(),a.value&&(a.value.removeEventListener("keydown",d),a.value.removeEventListener("focusin",c),a.value.removeEventListener("focusout",f),a.value=void 0)}),{onKeydown:d}}});function EF(N,Q,a,x,S,A){return s.renderSlot(N.$slots,"default",{handleKeydown:N.onKeydown})}var BF=si(CF,[["render",EF],["__file","focus-trap.vue"]]);const PF=["fixed","absolute"],SF=ei({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Pr(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:rc,default:"bottom"},popperOptions:{type:Pr(Object),default:()=>({})},strategy:{type:String,values:PF,default:"absolute"}}),n1=ei({...SF,id:String,style:{type:Pr([String,Array,Object])},className:{type:Pr([String,Array,Object])},effect:{type:Pr(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Pr([String,Array,Object])},popperStyle:{type:Pr([String,Array,Object])},referenceEl:{type:Pr(Object)},triggerTargetEl:{type:Pr(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Ys(["ariaLabel"])}),kF={mouseenter:N=>N instanceof MouseEvent,mouseleave:N=>N instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},MF=(N,Q=[])=>{const{placement:a,strategy:x,popperOptions:S}=N,A={placement:a,strategy:x,...S,modifiers:[...IF(N),...Q]};return DF(A,S==null?void 0:S.modifiers),A},TF=N=>{if(Ln)return qo(N)};function IF(N){const{offset:Q,gpuAcceleration:a,fallbackPlacements:x}=N;return[{name:"offset",options:{offset:[0,Q??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:x}},{name:"computeStyles",options:{gpuAcceleration:a}}]}function DF(N,Q){Q&&(N.modifiers=[...N.modifiers,...Q??[]])}const FF=0,RF=N=>{const{popperInstanceRef:Q,contentRef:a,triggerRef:x,role:S}=s.inject(Rm,void 0),A=s.ref(),h=s.ref(),d=s.computed(()=>({name:"eventListeners",enabled:!!N.visible})),u=s.computed(()=>{var w;const C=s.unref(A),k=(w=s.unref(h))!=null?w:FF;return{name:"arrow",enabled:!N4(C),options:{element:C,padding:k}}}),l=s.computed(()=>({onFirstUpdate:()=>{v()},...MF(N,[s.unref(u),s.unref(d)])})),c=s.computed(()=>TF(N.referenceEl)||s.unref(x)),{attributes:f,state:p,styles:m,update:v,forceUpdate:_,instanceRef:b}=hD(c,a,l);return s.watch(b,w=>Q.value=w),s.onMounted(()=>{s.watch(()=>{var w;return(w=s.unref(c))==null?void 0:w.getBoundingClientRect()},()=>{v()})}),{attributes:f,arrowRef:A,contentRef:a,instanceRef:b,state:p,styles:m,role:S,forceUpdate:_,update:v}},OF=(N,{attributes:Q,styles:a,role:x})=>{const{nextZIndex:S}=CD(),A=Jr("popper"),h=s.computed(()=>s.unref(Q).popper),d=s.ref(Ri(N.zIndex)?N.zIndex:S()),u=s.computed(()=>[A.b(),A.is("pure",N.pure),A.is(N.effect),N.popperClass]),l=s.computed(()=>[{zIndex:s.unref(d)},s.unref(a).popper,N.popperStyle||{}]),c=s.computed(()=>x.value==="dialog"?"false":void 0),f=s.computed(()=>s.unref(a).arrow||{});return{ariaModal:c,arrowStyle:f,contentAttrs:h,contentClass:u,contentStyle:l,contentZIndex:d,updateZIndex:()=>{d.value=Ri(N.zIndex)?N.zIndex:S()}}},NF=(N,Q)=>{const a=s.ref(!1),x=s.ref();return{focusStartRef:x,trapped:a,onFocusAfterReleased:l=>{var c;((c=l.detail)==null?void 0:c.focusReason)!=="pointer"&&(x.value="first",Q("blur"))},onFocusAfterTrapped:()=>{Q("focus")},onFocusInTrap:l=>{N.visible&&!a.value&&(l.target&&(x.value=l.target),a.value=!0)},onFocusoutPrevented:l=>{N.trapping||(l.detail.focusReason==="pointer"&&l.preventDefault(),a.value=!1)},onReleaseRequested:()=>{a.value=!1,Q("close")}}},LF=s.defineComponent({name:"ElPopperContent"}),jF=s.defineComponent({...LF,props:n1,emits:kF,setup(N,{expose:Q,emit:a}){const x=N,{focusStartRef:S,trapped:A,onFocusAfterReleased:h,onFocusAfterTrapped:d,onFocusInTrap:u,onFocusoutPrevented:l,onReleaseRequested:c}=NF(x,a),{attributes:f,arrowRef:p,contentRef:m,styles:v,instanceRef:_,role:b,update:w}=RF(x),{ariaModal:C,arrowStyle:k,contentAttrs:T,contentClass:R,contentStyle:U,updateZIndex:G}=OF(x,{styles:v,attributes:f,role:b}),j=s.inject(Su,void 0),H=s.ref();s.provide(G_,{arrowStyle:k,arrowRef:p,arrowOffset:H}),j&&s.provide(Su,{...j,addInputId:du,removeInputId:du});let W;const K=(O=!0)=>{w(),O&&G()},$=()=>{K(!1),x.visible&&x.focusOnShow?A.value=!0:x.visible===!1&&(A.value=!1)};return s.onMounted(()=>{s.watch(()=>x.triggerTargetEl,(O,L)=>{W==null||W(),W=void 0;const M=s.unref(O||m.value),I=s.unref(L||m.value);fl(M)&&(W=s.watch([b,()=>x.ariaLabel,C,()=>x.id],F=>{["role","aria-label","aria-modal","id"].forEach((V,D)=>{ko(F[D])?M.removeAttribute(V):M.setAttribute(V,F[D])})},{immediate:!0})),I!==M&&fl(I)&&["role","aria-label","aria-modal","id"].forEach(F=>{I.removeAttribute(F)})},{immediate:!0}),s.watch(()=>x.visible,$,{immediate:!0})}),s.onBeforeUnmount(()=>{W==null||W(),W=void 0}),Q({popperContentRef:m,popperInstanceRef:_,updatePopper:K,contentStyle:U}),(O,L)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps({ref_key:"contentRef",ref:m},s.unref(T),{style:s.unref(U),class:s.unref(R),tabindex:"-1",onMouseenter:M=>O.$emit("mouseenter",M),onMouseleave:M=>O.$emit("mouseleave",M)}),[s.createVNode(s.unref(BF),{trapped:s.unref(A),"trap-on-focus-in":!0,"focus-trap-el":s.unref(m),"focus-start-el":s.unref(S),onFocusAfterTrapped:s.unref(d),onFocusAfterReleased:s.unref(h),onFocusin:s.unref(u),onFocusoutPrevented:s.unref(l),onReleaseRequested:s.unref(c)},{default:s.withCtx(()=>[s.renderSlot(O.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var VF=si(jF,[["__file","content.vue"]]);const UF=Gn(oF),_h=Symbol("elTooltip"),Um=ei({...vD,...n1,appendTo:{type:Pr([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Pr(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Ys(["ariaLabel"])}),s1=ei({...X_,disabled:Boolean,trigger:{type:Pr([String,Array]),default:"hover"},triggerKeys:{type:Pr(Array),default:()=>[Ii.enter,Ii.space]}}),{useModelToggleProps:HF,useModelToggleEmits:zF,useModelToggle:GF}=o_("visible"),QF=ei({...Q_,...HF,...Um,...s1,...W_,showArrow:{type:Boolean,default:!0}}),WF=[...zF,"before-show","before-hide","show","hide","open","close"],$F=(N,Q)=>bi(N)?N.includes(Q):N===Q,cc=(N,Q,a)=>x=>{$F(s.unref(N),Q)&&a(x)},KF=s.defineComponent({name:"ElTooltipTrigger"}),XF=s.defineComponent({...KF,props:s1,setup(N,{expose:Q}){const a=N,x=Jr("tooltip"),{controlled:S,id:A,open:h,onOpen:d,onClose:u,onToggle:l}=s.inject(_h,void 0),c=s.ref(null),f=()=>{if(s.unref(S)||a.disabled)return!0},p=s.toRef(a,"trigger"),m=Zo(f,cc(p,"hover",d)),v=Zo(f,cc(p,"hover",u)),_=Zo(f,cc(p,"click",T=>{T.button===0&&l(T)})),b=Zo(f,cc(p,"focus",d)),w=Zo(f,cc(p,"focus",u)),C=Zo(f,cc(p,"contextmenu",T=>{T.preventDefault(),l(T)})),k=Zo(f,T=>{const{code:R}=T;a.triggerKeys.includes(R)&&(T.preventDefault(),l(T))});return Q({triggerRef:c}),(T,R)=>(s.openBlock(),s.createBlock(s.unref(fF),{id:s.unref(A),"virtual-ref":T.virtualRef,open:s.unref(h),"virtual-triggering":T.virtualTriggering,class:s.normalizeClass(s.unref(x).e("trigger")),onBlur:s.unref(w),onClick:s.unref(_),onContextmenu:s.unref(C),onFocus:s.unref(b),onMouseenter:s.unref(m),onMouseleave:s.unref(v),onKeydown:s.unref(k)},{default:s.withCtx(()=>[s.renderSlot(T.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var YF=si(XF,[["__file","trigger.vue"]]);const JF=ei({to:{type:Pr([String,Object]),required:!0},disabled:Boolean});var ZF=si(s.defineComponent({__name:"teleport",props:JF,setup(N){return(Q,a)=>Q.disabled?s.renderSlot(Q.$slots,"default",{key:0}):(s.openBlock(),s.createBlock(s.Teleport,{key:1,to:Q.to},[s.renderSlot(Q.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const qF=Gn(ZF),eR=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),tR=s.defineComponent({...eR,props:Um,setup(N,{expose:Q}){const a=N,{selector:x}=I_(),S=Jr("tooltip"),A=s.ref(null);let h;const{controlled:d,id:u,open:l,trigger:c,onClose:f,onOpen:p,onShow:m,onHide:v,onBeforeShow:_,onBeforeHide:b}=s.inject(_h,void 0),w=s.computed(()=>a.transition||`${S.namespace.value}-fade-in-linear`),C=s.computed(()=>process.env.NODE_ENV==="test"?!0:a.persistent);s.onBeforeUnmount(()=>{h==null||h()});const k=s.computed(()=>s.unref(C)?!0:s.unref(l)),T=s.computed(()=>a.disabled?!1:s.unref(l)),R=s.computed(()=>a.appendTo||x.value),U=s.computed(()=>{var I;return(I=a.style)!=null?I:{}}),G=s.computed(()=>!s.unref(l)),j=()=>{v()},H=()=>{if(s.unref(d))return!0},W=Zo(H,()=>{a.enterable&&s.unref(c)==="hover"&&p()}),K=Zo(H,()=>{s.unref(c)==="hover"&&f()}),$=()=>{var I,F;(F=(I=A.value)==null?void 0:I.updatePopper)==null||F.call(I),_==null||_()},O=()=>{b==null||b()},L=()=>{m(),h=tb(s.computed(()=>{var I;return(I=A.value)==null?void 0:I.popperContentRef}),()=>{if(s.unref(d))return;s.unref(c)!=="hover"&&f()})},M=()=>{a.virtualTriggering||f()};return s.watch(()=>s.unref(l),I=>{I||h==null||h()},{flush:"post"}),s.watch(()=>a.content,()=>{var I,F;(F=(I=A.value)==null?void 0:I.updatePopper)==null||F.call(I)}),Q({contentRef:A}),(I,F)=>(s.openBlock(),s.createBlock(s.unref(qF),{disabled:!I.teleported,to:s.unref(R)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(w),onAfterLeave:j,onBeforeEnter:$,onAfterEnter:L,onBeforeLeave:O},{default:s.withCtx(()=>[s.unref(k)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(VF),s.mergeProps({key:0,id:s.unref(u),ref_key:"contentRef",ref:A},I.$attrs,{"aria-label":I.ariaLabel,"aria-hidden":s.unref(G),"boundaries-padding":I.boundariesPadding,"fallback-placements":I.fallbackPlacements,"gpu-acceleration":I.gpuAcceleration,offset:I.offset,placement:I.placement,"popper-options":I.popperOptions,strategy:I.strategy,effect:I.effect,enterable:I.enterable,pure:I.pure,"popper-class":I.popperClass,"popper-style":[I.popperStyle,s.unref(U)],"reference-el":I.referenceEl,"trigger-target-el":I.triggerTargetEl,visible:s.unref(T),"z-index":I.zIndex,onMouseenter:s.unref(W),onMouseleave:s.unref(K),onBlur:M,onClose:s.unref(f)}),{default:s.withCtx(()=>[s.renderSlot(I.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[s.vShow,s.unref(T)]]):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var rR=si(tR,[["__file","content.vue"]]);const iR=s.defineComponent({name:"ElTooltip"}),nR=s.defineComponent({...iR,props:QF,emits:WF,setup(N,{expose:Q,emit:a}){const x=N;gD();const S=Pu(),A=s.ref(),h=s.ref(),d=()=>{var w;const C=s.unref(A);C&&((w=C.popperInstanceRef)==null||w.update())},u=s.ref(!1),l=s.ref(),{show:c,hide:f,hasUpdateHandler:p}=GF({indicator:u,toggleReason:l}),{onOpen:m,onClose:v}=yD({showAfter:s.toRef(x,"showAfter"),hideAfter:s.toRef(x,"hideAfter"),autoClose:s.toRef(x,"autoClose"),open:c,close:f}),_=s.computed(()=>uo(x.visible)&&!p.value);s.provide(_h,{controlled:_,id:S,open:s.readonly(u),trigger:s.toRef(x,"trigger"),onOpen:w=>{m(w)},onClose:w=>{v(w)},onToggle:w=>{s.unref(u)?v(w):m(w)},onShow:()=>{a("show",l.value)},onHide:()=>{a("hide",l.value)},onBeforeShow:()=>{a("before-show",l.value)},onBeforeHide:()=>{a("before-hide",l.value)},updatePopper:d}),s.watch(()=>x.disabled,w=>{w&&u.value&&(u.value=!1)});const b=w=>{var C,k;const T=(k=(C=h.value)==null?void 0:C.contentRef)==null?void 0:k.popperContentRef,R=(w==null?void 0:w.relatedTarget)||document.activeElement;return T&&T.contains(R)};return s.onDeactivated(()=>u.value&&f()),Q({popperRef:A,contentRef:h,isFocusInsideContent:b,updatePopper:d,onOpen:m,onClose:v,hide:f}),(w,C)=>(s.openBlock(),s.createBlock(s.unref(UF),{ref_key:"popperRef",ref:A,role:w.role},{default:s.withCtx(()=>[s.createVNode(YF,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:s.withCtx(()=>[w.$slots.default?s.renderSlot(w.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(rR,{ref_key:"contentRef",ref:h,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":w.popperClass,"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:s.withCtx(()=>[s.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:w.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(w.content),1))]),w.showArrow?(s.openBlock(),s.createBlock(s.unref(cF),{key:0,"arrow-offset":w.arrowOffset},null,8,["arrow-offset"])):s.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var sR=si(nR,[["__file","tooltip.vue"]]);const ku=Gn(sR),o1=Symbol("buttonGroupContextKey"),oR=(N,Q)=>{yu({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},s.computed(()=>N.type==="text"));const a=s.inject(o1,void 0),x=FD("button"),{form:S}=Ao(),A=mo(s.computed(()=>a==null?void 0:a.size)),h=gl(),d=s.ref(),u=s.useSlots(),l=s.computed(()=>N.type||(a==null?void 0:a.type)||""),c=s.computed(()=>{var v,_,b;return(b=(_=N.autoInsertSpace)!=null?_:(v=x.value)==null?void 0:v.autoInsertSpace)!=null?b:!1}),f=s.computed(()=>N.tag==="button"?{ariaDisabled:h.value||N.loading,disabled:h.value||N.loading,autofocus:N.autofocus,type:N.nativeType}:{}),p=s.computed(()=>{var v;const _=(v=u.default)==null?void 0:v.call(u);if(c.value&&(_==null?void 0:_.length)===1){const b=_[0];if((b==null?void 0:b.type)===s.Text){const w=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(w.trim())}}return!1});return{_disabled:h,_size:A,_type:l,_ref:d,_props:f,shouldAddSpace:p,handleClick:v=>{N.nativeType==="reset"&&(S==null||S.resetFields()),Q("click",v)}}},Hm=ei({size:po,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ho},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ho,default:()=>ui.Loading},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Pr([String,Object]),default:"button"}}),aR={click:N=>N instanceof MouseEvent};function Qn(N,Q){lR(N)&&(N="100%");var a=cR(N);return N=Q===360?N:Math.min(Q,Math.max(0,parseFloat(N))),a&&(N=parseInt(String(N*Q),10)/100),Math.abs(N-Q)<1e-6?1:(Q===360?N=(N<0?N%Q+Q:N%Q)/parseFloat(String(Q)):N=N%Q/parseFloat(String(Q)),N)}function wh(N){return Math.min(1,Math.max(0,N))}function lR(N){return typeof N=="string"&&N.indexOf(".")!==-1&&parseFloat(N)===1}function cR(N){return typeof N=="string"&&N.indexOf("%")!==-1}function a1(N){return N=parseFloat(N),(isNaN(N)||N<0||N>1)&&(N=1),N}function xh(N){return N<=1?"".concat(Number(N)*100,"%"):N}function yl(N){return N.length===1?"0"+N:String(N)}function uR(N,Q,a){return{r:Qn(N,255)*255,g:Qn(Q,255)*255,b:Qn(a,255)*255}}function l1(N,Q,a){N=Qn(N,255),Q=Qn(Q,255),a=Qn(a,255);var x=Math.max(N,Q,a),S=Math.min(N,Q,a),A=0,h=0,d=(x+S)/2;if(x===S)h=0,A=0;else{var u=x-S;switch(h=d>.5?u/(2-x-S):u/(x+S),x){case N:A=(Q-a)/u+(Q<a?6:0);break;case Q:A=(a-N)/u+2;break;case a:A=(N-Q)/u+4;break}A/=6}return{h:A,s:h,l:d}}function zm(N,Q,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?N+(Q-N)*(6*a):a<1/2?Q:a<2/3?N+(Q-N)*(2/3-a)*6:N}function dR(N,Q,a){var x,S,A;if(N=Qn(N,360),Q=Qn(Q,100),a=Qn(a,100),Q===0)S=a,A=a,x=a;else{var h=a<.5?a*(1+Q):a+Q-a*Q,d=2*a-h;x=zm(d,h,N+1/3),S=zm(d,h,N),A=zm(d,h,N-1/3)}return{r:x*255,g:S*255,b:A*255}}function c1(N,Q,a){N=Qn(N,255),Q=Qn(Q,255),a=Qn(a,255);var x=Math.max(N,Q,a),S=Math.min(N,Q,a),A=0,h=x,d=x-S,u=x===0?0:d/x;if(x===S)A=0;else{switch(x){case N:A=(Q-a)/d+(Q<a?6:0);break;case Q:A=(a-N)/d+2;break;case a:A=(N-Q)/d+4;break}A/=6}return{h:A,s:u,v:h}}function hR(N,Q,a){N=Qn(N,360)*6,Q=Qn(Q,100),a=Qn(a,100);var x=Math.floor(N),S=N-x,A=a*(1-Q),h=a*(1-S*Q),d=a*(1-(1-S)*Q),u=x%6,l=[a,h,A,A,d,a][u],c=[d,a,a,h,A,A][u],f=[A,A,d,a,a,h][u];return{r:l*255,g:c*255,b:f*255}}function u1(N,Q,a,x){var S=[yl(Math.round(N).toString(16)),yl(Math.round(Q).toString(16)),yl(Math.round(a).toString(16))];return x&&S[0].startsWith(S[0].charAt(1))&&S[1].startsWith(S[1].charAt(1))&&S[2].startsWith(S[2].charAt(1))?S[0].charAt(0)+S[1].charAt(0)+S[2].charAt(0):S.join("")}function fR(N,Q,a,x,S){var A=[yl(Math.round(N).toString(16)),yl(Math.round(Q).toString(16)),yl(Math.round(a).toString(16)),yl(pR(x))];return S&&A[0].startsWith(A[0].charAt(1))&&A[1].startsWith(A[1].charAt(1))&&A[2].startsWith(A[2].charAt(1))&&A[3].startsWith(A[3].charAt(1))?A[0].charAt(0)+A[1].charAt(0)+A[2].charAt(0)+A[3].charAt(0):A.join("")}function pR(N){return Math.round(parseFloat(N)*255).toString(16)}function d1(N){return Ds(N)/255}function Ds(N){return parseInt(N,16)}function mR(N){return{r:N>>16,g:(N&65280)>>8,b:N&255}}var Gm={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function AR(N){var Q={r:0,g:0,b:0},a=1,x=null,S=null,A=null,h=!1,d=!1;return typeof N=="string"&&(N=yR(N)),typeof N=="object"&&(oa(N.r)&&oa(N.g)&&oa(N.b)?(Q=uR(N.r,N.g,N.b),h=!0,d=String(N.r).substr(-1)==="%"?"prgb":"rgb"):oa(N.h)&&oa(N.s)&&oa(N.v)?(x=xh(N.s),S=xh(N.v),Q=hR(N.h,x,S),h=!0,d="hsv"):oa(N.h)&&oa(N.s)&&oa(N.l)&&(x=xh(N.s),A=xh(N.l),Q=dR(N.h,x,A),h=!0,d="hsl"),Object.prototype.hasOwnProperty.call(N,"a")&&(a=N.a)),a=a1(a),{ok:h,format:N.format||d,r:Math.min(255,Math.max(Q.r,0)),g:Math.min(255,Math.max(Q.g,0)),b:Math.min(255,Math.max(Q.b,0)),a}}var gR="[-\\+]?\\d+%?",vR="[-\\+]?\\d*\\.\\d+%?",Oa="(?:".concat(vR,")|(?:").concat(gR,")"),Qm="[\\s|\\(]+(".concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")\\s*\\)?"),Wm="[\\s|\\(]+(".concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")\\s*\\)?"),vo={CSS_UNIT:new RegExp(Oa),rgb:new RegExp("rgb"+Qm),rgba:new RegExp("rgba"+Wm),hsl:new RegExp("hsl"+Qm),hsla:new RegExp("hsla"+Wm),hsv:new RegExp("hsv"+Qm),hsva:new RegExp("hsva"+Wm),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function yR(N){if(N=N.trim().toLowerCase(),N.length===0)return!1;var Q=!1;if(Gm[N])N=Gm[N],Q=!0;else if(N==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var a=vo.rgb.exec(N);return a?{r:a[1],g:a[2],b:a[3]}:(a=vo.rgba.exec(N),a?{r:a[1],g:a[2],b:a[3],a:a[4]}:(a=vo.hsl.exec(N),a?{h:a[1],s:a[2],l:a[3]}:(a=vo.hsla.exec(N),a?{h:a[1],s:a[2],l:a[3],a:a[4]}:(a=vo.hsv.exec(N),a?{h:a[1],s:a[2],v:a[3]}:(a=vo.hsva.exec(N),a?{h:a[1],s:a[2],v:a[3],a:a[4]}:(a=vo.hex8.exec(N),a?{r:Ds(a[1]),g:Ds(a[2]),b:Ds(a[3]),a:d1(a[4]),format:Q?"name":"hex8"}:(a=vo.hex6.exec(N),a?{r:Ds(a[1]),g:Ds(a[2]),b:Ds(a[3]),format:Q?"name":"hex"}:(a=vo.hex4.exec(N),a?{r:Ds(a[1]+a[1]),g:Ds(a[2]+a[2]),b:Ds(a[3]+a[3]),a:d1(a[4]+a[4]),format:Q?"name":"hex8"}:(a=vo.hex3.exec(N),a?{r:Ds(a[1]+a[1]),g:Ds(a[2]+a[2]),b:Ds(a[3]+a[3]),format:Q?"name":"hex"}:!1)))))))))}function oa(N){return!!vo.CSS_UNIT.exec(String(N))}var bR=function(){function N(Q,a){Q===void 0&&(Q=""),a===void 0&&(a={});var x;if(Q instanceof N)return Q;typeof Q=="number"&&(Q=mR(Q)),this.originalInput=Q;var S=AR(Q);this.originalInput=Q,this.r=S.r,this.g=S.g,this.b=S.b,this.a=S.a,this.roundA=Math.round(100*this.a)/100,this.format=(x=a.format)!==null&&x!==void 0?x:S.format,this.gradientType=a.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=S.ok}return N.prototype.isDark=function(){return this.getBrightness()<128},N.prototype.isLight=function(){return!this.isDark()},N.prototype.getBrightness=function(){var Q=this.toRgb();return(Q.r*299+Q.g*587+Q.b*114)/1e3},N.prototype.getLuminance=function(){var Q=this.toRgb(),a,x,S,A=Q.r/255,h=Q.g/255,d=Q.b/255;return A<=.03928?a=A/12.92:a=Math.pow((A+.055)/1.055,2.4),h<=.03928?x=h/12.92:x=Math.pow((h+.055)/1.055,2.4),d<=.03928?S=d/12.92:S=Math.pow((d+.055)/1.055,2.4),.2126*a+.7152*x+.0722*S},N.prototype.getAlpha=function(){return this.a},N.prototype.setAlpha=function(Q){return this.a=a1(Q),this.roundA=Math.round(100*this.a)/100,this},N.prototype.isMonochrome=function(){var Q=this.toHsl().s;return Q===0},N.prototype.toHsv=function(){var Q=c1(this.r,this.g,this.b);return{h:Q.h*360,s:Q.s,v:Q.v,a:this.a}},N.prototype.toHsvString=function(){var Q=c1(this.r,this.g,this.b),a=Math.round(Q.h*360),x=Math.round(Q.s*100),S=Math.round(Q.v*100);return this.a===1?"hsv(".concat(a,", ").concat(x,"%, ").concat(S,"%)"):"hsva(".concat(a,", ").concat(x,"%, ").concat(S,"%, ").concat(this.roundA,")")},N.prototype.toHsl=function(){var Q=l1(this.r,this.g,this.b);return{h:Q.h*360,s:Q.s,l:Q.l,a:this.a}},N.prototype.toHslString=function(){var Q=l1(this.r,this.g,this.b),a=Math.round(Q.h*360),x=Math.round(Q.s*100),S=Math.round(Q.l*100);return this.a===1?"hsl(".concat(a,", ").concat(x,"%, ").concat(S,"%)"):"hsla(".concat(a,", ").concat(x,"%, ").concat(S,"%, ").concat(this.roundA,")")},N.prototype.toHex=function(Q){return Q===void 0&&(Q=!1),u1(this.r,this.g,this.b,Q)},N.prototype.toHexString=function(Q){return Q===void 0&&(Q=!1),"#"+this.toHex(Q)},N.prototype.toHex8=function(Q){return Q===void 0&&(Q=!1),fR(this.r,this.g,this.b,this.a,Q)},N.prototype.toHex8String=function(Q){return Q===void 0&&(Q=!1),"#"+this.toHex8(Q)},N.prototype.toHexShortString=function(Q){return Q===void 0&&(Q=!1),this.a===1?this.toHexString(Q):this.toHex8String(Q)},N.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},N.prototype.toRgbString=function(){var Q=Math.round(this.r),a=Math.round(this.g),x=Math.round(this.b);return this.a===1?"rgb(".concat(Q,", ").concat(a,", ").concat(x,")"):"rgba(".concat(Q,", ").concat(a,", ").concat(x,", ").concat(this.roundA,")")},N.prototype.toPercentageRgb=function(){var Q=function(a){return"".concat(Math.round(Qn(a,255)*100),"%")};return{r:Q(this.r),g:Q(this.g),b:Q(this.b),a:this.a}},N.prototype.toPercentageRgbString=function(){var Q=function(a){return Math.round(Qn(a,255)*100)};return this.a===1?"rgb(".concat(Q(this.r),"%, ").concat(Q(this.g),"%, ").concat(Q(this.b),"%)"):"rgba(".concat(Q(this.r),"%, ").concat(Q(this.g),"%, ").concat(Q(this.b),"%, ").concat(this.roundA,")")},N.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var Q="#"+u1(this.r,this.g,this.b,!1),a=0,x=Object.entries(Gm);a<x.length;a++){var S=x[a],A=S[0],h=S[1];if(Q===h)return A}return!1},N.prototype.toString=function(Q){var a=!!Q;Q=Q??this.format;var x=!1,S=this.a<1&&this.a>=0,A=!a&&S&&(Q.startsWith("hex")||Q==="name");return A?Q==="name"&&this.a===0?this.toName():this.toRgbString():(Q==="rgb"&&(x=this.toRgbString()),Q==="prgb"&&(x=this.toPercentageRgbString()),(Q==="hex"||Q==="hex6")&&(x=this.toHexString()),Q==="hex3"&&(x=this.toHexString(!0)),Q==="hex4"&&(x=this.toHex8String(!0)),Q==="hex8"&&(x=this.toHex8String()),Q==="name"&&(x=this.toName()),Q==="hsl"&&(x=this.toHslString()),Q==="hsv"&&(x=this.toHsvString()),x||this.toHexString())},N.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},N.prototype.clone=function(){return new N(this.toString())},N.prototype.lighten=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.l+=Q/100,a.l=wh(a.l),new N(a)},N.prototype.brighten=function(Q){Q===void 0&&(Q=10);var a=this.toRgb();return a.r=Math.max(0,Math.min(255,a.r-Math.round(255*-(Q/100)))),a.g=Math.max(0,Math.min(255,a.g-Math.round(255*-(Q/100)))),a.b=Math.max(0,Math.min(255,a.b-Math.round(255*-(Q/100)))),new N(a)},N.prototype.darken=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.l-=Q/100,a.l=wh(a.l),new N(a)},N.prototype.tint=function(Q){return Q===void 0&&(Q=10),this.mix("white",Q)},N.prototype.shade=function(Q){return Q===void 0&&(Q=10),this.mix("black",Q)},N.prototype.desaturate=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.s-=Q/100,a.s=wh(a.s),new N(a)},N.prototype.saturate=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.s+=Q/100,a.s=wh(a.s),new N(a)},N.prototype.greyscale=function(){return this.desaturate(100)},N.prototype.spin=function(Q){var a=this.toHsl(),x=(a.h+Q)%360;return a.h=x<0?360+x:x,new N(a)},N.prototype.mix=function(Q,a){a===void 0&&(a=50);var x=this.toRgb(),S=new N(Q).toRgb(),A=a/100,h={r:(S.r-x.r)*A+x.r,g:(S.g-x.g)*A+x.g,b:(S.b-x.b)*A+x.b,a:(S.a-x.a)*A+x.a};return new N(h)},N.prototype.analogous=function(Q,a){Q===void 0&&(Q=6),a===void 0&&(a=30);var x=this.toHsl(),S=360/a,A=[this];for(x.h=(x.h-(S*Q>>1)+720)%360;--Q;)x.h=(x.h+S)%360,A.push(new N(x));return A},N.prototype.complement=function(){var Q=this.toHsl();return Q.h=(Q.h+180)%360,new N(Q)},N.prototype.monochromatic=function(Q){Q===void 0&&(Q=6);for(var a=this.toHsv(),x=a.h,S=a.s,A=a.v,h=[],d=1/Q;Q--;)h.push(new N({h:x,s:S,v:A})),A=(A+d)%1;return h},N.prototype.splitcomplement=function(){var Q=this.toHsl(),a=Q.h;return[this,new N({h:(a+72)%360,s:Q.s,l:Q.l}),new N({h:(a+216)%360,s:Q.s,l:Q.l})]},N.prototype.onBackground=function(Q){var a=this.toRgb(),x=new N(Q).toRgb(),S=a.a+x.a*(1-a.a);return new N({r:(a.r*a.a+x.r*x.a*(1-a.a))/S,g:(a.g*a.a+x.g*x.a*(1-a.a))/S,b:(a.b*a.a+x.b*x.a*(1-a.a))/S,a:S})},N.prototype.triad=function(){return this.polyad(3)},N.prototype.tetrad=function(){return this.polyad(4)},N.prototype.polyad=function(Q){for(var a=this.toHsl(),x=a.h,S=[this],A=360/Q,h=1;h<Q;h++)S.push(new N({h:(x+h*A)%360,s:a.s,l:a.l}));return S},N.prototype.equals=function(Q){return this.toRgbString()===new N(Q).toRgbString()},N}();function Na(N,Q=20){return N.mix("#141414",Q).toString()}function _R(N){const Q=gl(),a=Jr("button");return s.computed(()=>{let x={},S=N.color;if(S){const A=S.match(/var\((.*?)\)/);A&&(S=window.getComputedStyle(window.document.documentElement).getPropertyValue(A[1]));const h=new bR(S),d=N.dark?h.tint(20).toString():Na(h,20);if(N.plain)x=a.cssVarBlock({"bg-color":N.dark?Na(h,90):h.tint(90).toString(),"text-color":S,"border-color":N.dark?Na(h,50):h.tint(50).toString(),"hover-text-color":`var(${a.cssVarName("color-white")})`,"hover-bg-color":S,"hover-border-color":S,"active-bg-color":d,"active-text-color":`var(${a.cssVarName("color-white")})`,"active-border-color":d}),Q.value&&(x[a.cssVarBlockName("disabled-bg-color")]=N.dark?Na(h,90):h.tint(90).toString(),x[a.cssVarBlockName("disabled-text-color")]=N.dark?Na(h,50):h.tint(50).toString(),x[a.cssVarBlockName("disabled-border-color")]=N.dark?Na(h,80):h.tint(80).toString());else{const u=N.dark?Na(h,30):h.tint(30).toString(),l=h.isDark()?`var(${a.cssVarName("color-white")})`:`var(${a.cssVarName("color-black")})`;if(x=a.cssVarBlock({"bg-color":S,"text-color":l,"border-color":S,"hover-bg-color":u,"hover-text-color":l,"hover-border-color":u,"active-bg-color":d,"active-border-color":d}),Q.value){const c=N.dark?Na(h,50):h.tint(50).toString();x[a.cssVarBlockName("disabled-bg-color")]=c,x[a.cssVarBlockName("disabled-text-color")]=N.dark?"rgba(255, 255, 255, 0.5)":`var(${a.cssVarName("color-white")})`,x[a.cssVarBlockName("disabled-border-color")]=c}}}return x})}const wR=s.defineComponent({name:"ElButton"}),xR=s.defineComponent({...wR,props:Hm,emits:aR,setup(N,{expose:Q,emit:a}){const x=N,S=_R(x),A=Jr("button"),{_ref:h,_size:d,_type:u,_disabled:l,_props:c,shouldAddSpace:f,handleClick:p}=oR(x,a),m=s.computed(()=>[A.b(),A.m(u.value),A.m(d.value),A.is("disabled",l.value),A.is("loading",x.loading),A.is("plain",x.plain),A.is("round",x.round),A.is("circle",x.circle),A.is("text",x.text),A.is("link",x.link),A.is("has-bg",x.bg)]);return Q({ref:h,size:d,type:u,disabled:l,shouldAddSpace:f}),(v,_)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.tag),s.mergeProps({ref_key:"_ref",ref:h},s.unref(c),{class:s.unref(m),style:s.unref(S),onClick:s.unref(p)}),{default:s.withCtx(()=>[v.loading?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[v.$slots.loading?s.renderSlot(v.$slots,"loading",{key:0}):(s.openBlock(),s.createBlock(s.unref(ni),{key:1,class:s.normalizeClass(s.unref(A).is("loading"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.loadingIcon)))]),_:1},8,["class"]))],64)):v.icon||v.$slots.icon?(s.openBlock(),s.createBlock(s.unref(ni),{key:1},{default:s.withCtx(()=>[v.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.icon),{key:0})):s.renderSlot(v.$slots,"icon",{key:1})]),_:3})):s.createCommentVNode("v-if",!0),v.$slots.default?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass({[s.unref(A).em("text","expand")]:s.unref(f)})},[s.renderSlot(v.$slots,"default")],2)):s.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var CR=si(xR,[["__file","button.vue"]]);const ER={size:Hm.size,type:Hm.type},BR=s.defineComponent({name:"ElButtonGroup"}),PR=s.defineComponent({...BR,props:ER,setup(N){const Q=N;s.provide(o1,s.reactive({size:s.toRef(Q,"size"),type:s.toRef(Q,"type")}));const a=Jr("button");return(x,S)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(a).b("group"))},[s.renderSlot(x.$slots,"default")],2))}});var h1=si(PR,[["__file","button-group.vue"]]);const Ch=Gn(CR,{ButtonGroup:h1});pl(h1);var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aa(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var f1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){var a=1e3,x=6e4,S=36e5,A="millisecond",h="second",d="minute",u="hour",l="day",c="week",f="month",p="quarter",m="year",v="date",_="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var M=["th","st","nd","rd"],I=L%100;return"["+L+(M[(I-20)%10]||M[I]||M[0])+"]"}},k=function(L,M,I){var F=String(L);return!F||F.length>=M?L:""+Array(M+1-F.length).join(I)+L},T={s:k,z:function(L){var M=-L.utcOffset(),I=Math.abs(M),F=Math.floor(I/60),V=I%60;return(M<=0?"+":"-")+k(F,2,"0")+":"+k(V,2,"0")},m:function L(M,I){if(M.date()<I.date())return-L(I,M);var F=12*(I.year()-M.year())+(I.month()-M.month()),V=M.clone().add(F,f),D=I-V<0,X=M.clone().add(F+(D?-1:1),f);return+(-(F+(I-V)/(D?V-X:X-V))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:m,w:c,d:l,D:v,h:u,m:d,s:h,ms:A,Q:p}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},R="en",U={};U[R]=C;var G="$isDayjsObject",j=function(L){return L instanceof $||!(!L||!L[G])},H=function L(M,I,F){var V;if(!M)return R;if(typeof M=="string"){var D=M.toLowerCase();U[D]&&(V=D),I&&(U[D]=I,V=D);var X=M.split("-");if(!V&&X.length>1)return L(X[0])}else{var ee=M.name;U[ee]=M,V=ee}return!F&&V&&(R=V),V||!F&&R},W=function(L,M){if(j(L))return L.clone();var I=typeof M=="object"?M:{};return I.date=L,I.args=arguments,new $(I)},K=T;K.l=H,K.i=j,K.w=function(L,M){return W(L,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var $=function(){function L(I){this.$L=H(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[G]=!0}var M=L.prototype;return M.parse=function(I){this.$d=function(F){var V=F.date,D=F.utc;if(V===null)return new Date(NaN);if(K.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var X=V.match(b);if(X){var ee=X[2]-1||0,q=(X[7]||"0").substring(0,3);return D?new Date(Date.UTC(X[1],ee,X[3]||1,X[4]||0,X[5]||0,X[6]||0,q)):new Date(X[1],ee,X[3]||1,X[4]||0,X[5]||0,X[6]||0,q)}}return new Date(V)}(I),this.init()},M.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},M.$utils=function(){return K},M.isValid=function(){return this.$d.toString()!==_},M.isSame=function(I,F){var V=W(I);return this.startOf(F)<=V&&V<=this.endOf(F)},M.isAfter=function(I,F){return W(I)<this.startOf(F)},M.isBefore=function(I,F){return this.endOf(F)<W(I)},M.$g=function(I,F,V){return K.u(I)?this[F]:this.set(V,I)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(I,F){var V=this,D=!!K.u(F)||F,X=K.p(I),ee=function(re,ae){var Ce=K.w(V.$u?Date.UTC(V.$y,ae,re):new Date(V.$y,ae,re),V);return D?Ce:Ce.endOf(l)},q=function(re,ae){return K.w(V.toDate()[re].apply(V.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(ae)),V)},ne=this.$W,oe=this.$M,he=this.$D,te="set"+(this.$u?"UTC":"");switch(X){case m:return D?ee(1,0):ee(31,11);case f:return D?ee(1,oe):ee(0,oe+1);case c:var de=this.$locale().weekStart||0,se=(ne<de?ne+7:ne)-de;return ee(D?he-se:he+(6-se),oe);case l:case v:return q(te+"Hours",0);case u:return q(te+"Minutes",1);case d:return q(te+"Seconds",2);case h:return q(te+"Milliseconds",3);default:return this.clone()}},M.endOf=function(I){return this.startOf(I,!1)},M.$set=function(I,F){var V,D=K.p(I),X="set"+(this.$u?"UTC":""),ee=(V={},V[l]=X+"Date",V[v]=X+"Date",V[f]=X+"Month",V[m]=X+"FullYear",V[u]=X+"Hours",V[d]=X+"Minutes",V[h]=X+"Seconds",V[A]=X+"Milliseconds",V)[D],q=D===l?this.$D+(F-this.$W):F;if(D===f||D===m){var ne=this.clone().set(v,1);ne.$d[ee](q),ne.init(),this.$d=ne.set(v,Math.min(this.$D,ne.daysInMonth())).$d}else ee&&this.$d[ee](q);return this.init(),this},M.set=function(I,F){return this.clone().$set(I,F)},M.get=function(I){return this[K.p(I)]()},M.add=function(I,F){var V,D=this;I=Number(I);var X=K.p(F),ee=function(oe){var he=W(D);return K.w(he.date(he.date()+Math.round(oe*I)),D)};if(X===f)return this.set(f,this.$M+I);if(X===m)return this.set(m,this.$y+I);if(X===l)return ee(1);if(X===c)return ee(7);var q=(V={},V[d]=x,V[u]=S,V[h]=a,V)[X]||1,ne=this.$d.getTime()+I*q;return K.w(ne,this)},M.subtract=function(I,F){return this.add(-1*I,F)},M.format=function(I){var F=this,V=this.$locale();if(!this.isValid())return V.invalidDate||_;var D=I||"YYYY-MM-DDTHH:mm:ssZ",X=K.z(this),ee=this.$H,q=this.$m,ne=this.$M,oe=V.weekdays,he=V.months,te=V.meridiem,de=function(ae,Ce,me,ce){return ae&&(ae[Ce]||ae(F,D))||me[Ce].slice(0,ce)},se=function(ae){return K.s(ee%12||12,ae,"0")},re=te||function(ae,Ce,me){var ce=ae<12?"AM":"PM";return me?ce.toLowerCase():ce};return D.replace(w,function(ae,Ce){return Ce||function(me){switch(me){case"YY":return String(F.$y).slice(-2);case"YYYY":return K.s(F.$y,4,"0");case"M":return ne+1;case"MM":return K.s(ne+1,2,"0");case"MMM":return de(V.monthsShort,ne,he,3);case"MMMM":return de(he,ne);case"D":return F.$D;case"DD":return K.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return de(V.weekdaysMin,F.$W,oe,2);case"ddd":return de(V.weekdaysShort,F.$W,oe,3);case"dddd":return oe[F.$W];case"H":return String(ee);case"HH":return K.s(ee,2,"0");case"h":return se(1);case"hh":return se(2);case"a":return re(ee,q,!0);case"A":return re(ee,q,!1);case"m":return String(q);case"mm":return K.s(q,2,"0");case"s":return String(F.$s);case"ss":return K.s(F.$s,2,"0");case"SSS":return K.s(F.$ms,3,"0");case"Z":return X}return null}(ae)||X.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(I,F,V){var D,X=this,ee=K.p(F),q=W(I),ne=(q.utcOffset()-this.utcOffset())*x,oe=this-q,he=function(){return K.m(X,q)};switch(ee){case m:D=he()/12;break;case f:D=he();break;case p:D=he()/3;break;case c:D=(oe-ne)/6048e5;break;case l:D=(oe-ne)/864e5;break;case u:D=oe/S;break;case d:D=oe/x;break;case h:D=oe/a;break;default:D=oe}return V?D:K.a(D)},M.daysInMonth=function(){return this.endOf(f).$D},M.$locale=function(){return U[this.$L]},M.locale=function(I,F){if(!I)return this.$L;var V=this.clone(),D=H(I,F,!0);return D&&(V.$L=D),V},M.clone=function(){return K.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},L}(),O=$.prototype;return W.prototype=O,[["$ms",A],["$s",h],["$m",d],["$H",u],["$W",l],["$M",f],["$y",m],["$D",v]].forEach(function(L){O[L[1]]=function(M){return this.$g(M,L[0],L[1])}}),W.extend=function(L,M){return L.$i||(L(M,$,W),L.$i=!0),W},W.locale=H,W.isDayjs=j,W.unix=function(L){return W(1e3*L)},W.en=U[R],W.Ls=U,W.p={},W})})(f1);var SR=f1.exports;const Ir=aa(SR);var p1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){var a={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},x=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,S=/\d\d/,A=/\d\d?/,h=/\d*[^-_:/,()\s\d]+/,d={},u=function(_){return(_=+_)+(_>68?1900:2e3)},l=function(_){return function(b){this[_]=+b}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(_){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var w=b.match(/([+-]|\d\d)/g),C=60*w[1]+(+w[2]||0);return C===0?0:w[0]==="+"?-C:C}(_)}],f=function(_){var b=d[_];return b&&(b.indexOf?b:b.s.concat(b.f))},p=function(_,b){var w,C=d.meridiem;if(C){for(var k=1;k<=24;k+=1)if(_.indexOf(C(k,0,b))>-1){w=k>12;break}}else w=_===(b?"pm":"PM");return w},m={A:[h,function(_){this.afternoon=p(_,!1)}],a:[h,function(_){this.afternoon=p(_,!0)}],S:[/\d/,function(_){this.milliseconds=100*+_}],SS:[S,function(_){this.milliseconds=10*+_}],SSS:[/\d{3}/,function(_){this.milliseconds=+_}],s:[A,l("seconds")],ss:[A,l("seconds")],m:[A,l("minutes")],mm:[A,l("minutes")],H:[A,l("hours")],h:[A,l("hours")],HH:[A,l("hours")],hh:[A,l("hours")],D:[A,l("day")],DD:[S,l("day")],Do:[h,function(_){var b=d.ordinal,w=_.match(/\d+/);if(this.day=w[0],b)for(var C=1;C<=31;C+=1)b(C).replace(/\[|\]/g,"")===_&&(this.day=C)}],M:[A,l("month")],MM:[S,l("month")],MMM:[h,function(_){var b=f("months"),w=(f("monthsShort")||b.map(function(C){return C.slice(0,3)})).indexOf(_)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[h,function(_){var b=f("months").indexOf(_)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,l("year")],YY:[S,function(_){this.year=u(_)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function v(_){var b,w;b=_,w=d&&d.formats;for(var C=(_=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(H,W,K){var $=K&&K.toUpperCase();return W||w[K]||a[K]||w[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,L,M){return L||M.slice(1)})})).match(x),k=C.length,T=0;T<k;T+=1){var R=C[T],U=m[R],G=U&&U[0],j=U&&U[1];C[T]=j?{regex:G,parser:j}:R.replace(/^\[|\]$/g,"")}return function(H){for(var W={},K=0,$=0;K<k;K+=1){var O=C[K];if(typeof O=="string")$+=O.length;else{var L=O.regex,M=O.parser,I=H.slice($),F=L.exec(I)[0];M.call(W,F),H=H.replace(F,"")}}return function(V){var D=V.afternoon;if(D!==void 0){var X=V.hours;D?X<12&&(V.hours+=12):X===12&&(V.hours=0),delete V.afternoon}}(W),W}}return function(_,b,w){w.p.customParseFormat=!0,_&&_.parseTwoDigitYear&&(u=_.parseTwoDigitYear);var C=b.prototype,k=C.parse;C.parse=function(T){var R=T.date,U=T.utc,G=T.args;this.$u=U;var j=G[1];if(typeof j=="string"){var H=G[2]===!0,W=G[3]===!0,K=H||W,$=G[2];W&&($=G[2]),d=this.$locale(),!H&&$&&(d=w.Ls[$]),this.$d=function(I,F,V){try{if(["x","X"].indexOf(F)>-1)return new Date((F==="X"?1e3:1)*I);var D=v(F)(I),X=D.year,ee=D.month,q=D.day,ne=D.hours,oe=D.minutes,he=D.seconds,te=D.milliseconds,de=D.zone,se=new Date,re=q||(X||ee?1:se.getDate()),ae=X||se.getFullYear(),Ce=0;X&&!ee||(Ce=ee>0?ee-1:se.getMonth());var me=ne||0,ce=oe||0,pe=he||0,B=te||0;return de?new Date(Date.UTC(ae,Ce,re,me,ce,pe,B+60*de.offset*1e3)):V?new Date(Date.UTC(ae,Ce,re,me,ce,pe,B)):new Date(ae,Ce,re,me,ce,pe,B)}catch{return new Date("")}}(R,j,U),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),K&&R!=this.format(j)&&(this.$d=new Date("")),d={}}else if(j instanceof Array)for(var O=j.length,L=1;L<=O;L+=1){G[1]=j[L-1];var M=w.apply(this,G);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}L===O&&(this.$d=new Date(""))}else k.call(this,T)}}})})(p1);var kR=p1.exports;const MR=aa(kR),m1=["hours","minutes","seconds"],A1="HH:mm:ss",uc="YYYY-MM-DD",TR={date:uc,dates:uc,week:"gggg[w]ww",year:"YYYY",years:"YYYY",month:"YYYY-MM",months:"YYYY-MM",datetime:`${uc} ${A1}`,monthrange:"YYYY-MM",yearrange:"YYYY",daterange:uc,datetimerange:`${uc} ${A1}`},$m=(N,Q)=>[N>0?N-1:void 0,N,N<Q?N+1:void 0],g1=N=>Array.from(Array.from({length:N}).keys()),v1=N=>N.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim(),y1=N=>N.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g,"").trim(),b1=function(N,Q){const a=ub(N),x=ub(Q);return a&&x?N.getTime()===Q.getTime():!a&&!x?N===Q:!1},_1=function(N,Q){const a=bi(N),x=bi(Q);return a&&x?N.length!==Q.length?!1:N.every((S,A)=>b1(S,Q[A])):!a&&!x?b1(N,Q):!1},w1=function(N,Q,a){const x=t_(Q)||Q==="x"?Ir(N).locale(a):Ir(N,Q).locale(a);return x.isValid()?x:void 0},x1=function(N,Q,a){return t_(Q)?N:Q==="x"?+N:Ir(N).locale(a).format(Q)},Km=(N,Q)=>{var a;const x=[],S=Q==null?void 0:Q();for(let A=0;A<N;A++)x.push((a=S==null?void 0:S.includes(A))!=null?a:!1);return x},C1=ei({disabledHours:{type:Pr(Function)},disabledMinutes:{type:Pr(Function)},disabledSeconds:{type:Pr(Function)}}),IR=ei({visible:Boolean,actualVisible:{type:Boolean,default:void 0},format:{type:String,default:""}}),E1=ei({id:{type:Pr([Array,String])},name:{type:Pr([Array,String]),default:""},popperClass:{type:String,default:""},format:String,valueFormat:String,dateFormat:String,timeFormat:String,type:{type:String,default:""},clearable:{type:Boolean,default:!0},clearIcon:{type:Pr([String,Object]),default:ui.CircleClose},editable:{type:Boolean,default:!0},prefixIcon:{type:Pr([String,Object]),default:""},size:po,readonly:Boolean,disabled:Boolean,placeholder:{type:String,default:""},popperOptions:{type:Pr(Object),default:()=>({})},modelValue:{type:Pr([Date,Array,String,Number]),default:""},rangeSeparator:{type:String,default:"-"},startPlaceholder:String,endPlaceholder:String,defaultValue:{type:Pr([Date,Array])},defaultTime:{type:Pr([Date,Array])},isRange:Boolean,...C1,disabledDate:{type:Function},cellClassName:{type:Function},shortcuts:{type:Array,default:()=>[]},arrowControl:Boolean,tabindex:{type:Pr([String,Number]),default:0},validateEvent:{type:Boolean,default:!0},unlinkPanels:Boolean,...j_,...Ys(["ariaLabel"])}),DR=s.defineComponent({name:"Picker"}),FR=s.defineComponent({...DR,props:E1,emits:["update:modelValue","change","focus","blur","clear","calendar-change","panel-change","visible-change","keydown"],setup(N,{expose:Q,emit:a}){const x=N,S=s.useAttrs(),{lang:A}=es(),h=Jr("date"),d=Jr("input"),u=Jr("range"),{form:l,formItem:c}=Ao(),f=s.inject("ElPopperOptions",{}),{valueOnClear:p}=V_(x,null),m=s.ref(),v=s.ref(),_=s.ref(!1),b=s.ref(!1),w=s.ref(null);let C=!1,k=!1;const T=s.computed(()=>[h.b("editor"),h.bm("editor",x.type),d.e("wrapper"),h.is("disabled",ne.value),h.is("active",_.value),u.b("editor"),fe?u.bm("editor",fe.value):"",S.class]),R=s.computed(()=>[d.e("icon"),u.e("close-icon"),me.value?"":u.e("close-icon--hidden")]);s.watch(_,Ne=>{Ne?s.nextTick(()=>{Ne&&(w.value=x.modelValue)}):(De.value=null,s.nextTick(()=>{U(x.modelValue)}))});const U=(Ne,tt)=>{(tt||!_1(Ne,w.value))&&(a("change",Ne),x.validateEvent&&(c==null||c.validate("change").catch(Pt=>Ki(Pt))))},G=Ne=>{if(!_1(x.modelValue,Ne)){let tt;bi(Ne)?tt=Ne.map(Pt=>x1(Pt,x.valueFormat,A.value)):Ne&&(tt=x1(Ne,x.valueFormat,A.value)),a("update:modelValue",Ne&&tt,A.value)}},j=Ne=>{a("keydown",Ne)},H=s.computed(()=>{if(v.value){const Ne=Ae.value?v.value:v.value.$el;return Array.from(Ne.querySelectorAll("input"))}return[]}),W=(Ne,tt,Pt)=>{const Rt=H.value;Rt.length&&(!Pt||Pt==="min"?(Rt[0].setSelectionRange(Ne,tt),Rt[0].focus()):Pt==="max"&&(Rt[1].setSelectionRange(Ne,tt),Rt[1].focus()))},K=()=>{D(!0,!0),s.nextTick(()=>{k=!1})},$=(Ne="",tt=!1)=>{tt||(k=!0),_.value=tt;let Pt;bi(Ne)?Pt=Ne.map(Rt=>Rt.toDate()):Pt=Ne&&Ne.toDate(),De.value=null,G(Pt)},O=()=>{b.value=!0},L=()=>{a("visible-change",!0)},M=Ne=>{(Ne==null?void 0:Ne.key)===Ii.esc&&D(!0,!0)},I=()=>{b.value=!1,_.value=!1,k=!1,a("visible-change",!1)},F=()=>{_.value=!0},V=()=>{_.value=!1},D=(Ne=!0,tt=!1)=>{k=tt;const[Pt,Rt]=s.unref(H);let Ht=Pt;!Ne&&Ae.value&&(Ht=Rt),Ht&&Ht.focus()},X=Ne=>{x.readonly||ne.value||_.value||k||(_.value=!0,a("focus",Ne))};let ee;const q=Ne=>{const tt=async()=>{setTimeout(()=>{var Pt;ee===tt&&(!((Pt=m.value)!=null&&Pt.isFocusInsideContent()&&!C)&&H.value.filter(Rt=>Rt.contains(document.activeElement)).length===0&&(Je(),_.value=!1,a("blur",Ne),x.validateEvent&&(c==null||c.validate("blur").catch(Rt=>Ki(Rt)))),C=!1)},0)};ee=tt,tt()},ne=s.computed(()=>x.disabled||(l==null?void 0:l.disabled)),oe=s.computed(()=>{let Ne;if(pe.value?ze.value.getDefaultValue&&(Ne=ze.value.getDefaultValue()):bi(x.modelValue)?Ne=x.modelValue.map(tt=>w1(tt,x.valueFormat,A.value)):Ne=w1(x.modelValue,x.valueFormat,A.value),ze.value.getRangeAvailableTime){const tt=ze.value.getRangeAvailableTime(Ne);vu(tt,Ne)||(Ne=tt,G(bi(Ne)?Ne.map(Pt=>Pt.toDate()):Ne.toDate()))}return bi(Ne)&&Ne.some(tt=>!tt)&&(Ne=[]),Ne}),he=s.computed(()=>{if(!ze.value.panelReady)return"";const Ne=ot(oe.value);return bi(De.value)?[De.value[0]||Ne&&Ne[0]||"",De.value[1]||Ne&&Ne[1]||""]:De.value!==null?De.value:!de.value&&pe.value||!_.value&&pe.value?"":Ne?se.value||re.value||ae.value?Ne.join(", "):Ne:""}),te=s.computed(()=>x.type.includes("time")),de=s.computed(()=>x.type.startsWith("time")),se=s.computed(()=>x.type==="dates"),re=s.computed(()=>x.type==="months"),ae=s.computed(()=>x.type==="years"),Ce=s.computed(()=>x.prefixIcon||(te.value?ui.Clock:ui.Calendar)),me=s.ref(!1),ce=Ne=>{x.readonly||ne.value||(me.value&&(Ne.stopPropagation(),K(),ze.value.handleClear?ze.value.handleClear():G(p.value),U(p.value,!0),me.value=!1,_.value=!1),a("clear"))},pe=s.computed(()=>{const{modelValue:Ne}=x;return!Ne||bi(Ne)&&!Ne.filter(Boolean).length}),B=async Ne=>{var tt;x.readonly||ne.value||(((tt=Ne.target)==null?void 0:tt.tagName)!=="INPUT"||H.value.includes(document.activeElement))&&(_.value=!0)},ke=()=>{x.readonly||ne.value||!pe.value&&x.clearable&&(me.value=!0)},Ee=()=>{me.value=!1},ge=Ne=>{var tt;x.readonly||ne.value||(((tt=Ne.touches[0].target)==null?void 0:tt.tagName)!=="INPUT"||H.value.includes(document.activeElement))&&(_.value=!0)},Ae=s.computed(()=>x.type.includes("range")),fe=mo(),ue=s.computed(()=>{var Ne,tt;return(tt=(Ne=s.unref(m))==null?void 0:Ne.popperRef)==null?void 0:tt.contentRef}),_e=s.computed(()=>{var Ne;return s.unref(Ae)?s.unref(v):(Ne=s.unref(v))==null?void 0:Ne.$el}),be=tb(_e,Ne=>{const tt=s.unref(ue),Pt=s.unref(_e);tt&&(Ne.target===tt||Ne.composedPath().includes(tt))||Ne.target===Pt||Ne.composedPath().includes(Pt)||(_.value=!1)});s.onBeforeUnmount(()=>{be==null||be()});const De=s.ref(null),Je=()=>{if(De.value){const Ne=Qe(he.value);Ne&&ct(Ne)&&(G(bi(Ne)?Ne.map(tt=>tt.toDate()):Ne.toDate()),De.value=null)}De.value===""&&(G(p.value),U(p.value),De.value=null)},Qe=Ne=>Ne?ze.value.parseUserInput(Ne):null,ot=Ne=>Ne?ze.value.formatToString(Ne):null,ct=Ne=>ze.value.isValidValue(Ne),ht=async Ne=>{if(x.readonly||ne.value)return;const{code:tt}=Ne;if(j(Ne),tt===Ii.esc){_.value===!0&&(_.value=!1,Ne.preventDefault(),Ne.stopPropagation());return}if(tt===Ii.down&&(ze.value.handleFocusPicker&&(Ne.preventDefault(),Ne.stopPropagation()),_.value===!1&&(_.value=!0,await s.nextTick()),ze.value.handleFocusPicker)){ze.value.handleFocusPicker();return}if(tt===Ii.tab){C=!0;return}if(tt===Ii.enter||tt===Ii.numpadEnter){(De.value===null||De.value===""||ct(Qe(he.value)))&&(Je(),_.value=!1),Ne.stopPropagation();return}if(De.value){Ne.stopPropagation();return}ze.value.handleKeydownInput&&ze.value.handleKeydownInput(Ne)},it=Ne=>{De.value=Ne,_.value||(_.value=!0)},Ze=Ne=>{const tt=Ne.target;De.value?De.value=[tt.value,De.value[1]]:De.value=[tt.value,null]},Xe=Ne=>{const tt=Ne.target;De.value?De.value=[De.value[0],tt.value]:De.value=[null,tt.value]},dt=()=>{var Ne;const tt=De.value,Pt=Qe(tt&&tt[0]),Rt=s.unref(oe);if(Pt&&Pt.isValid()){De.value=[ot(Pt),((Ne=he.value)==null?void 0:Ne[1])||null];const Ht=[Pt,Rt&&(Rt[1]||null)];ct(Ht)&&(G(Ht),De.value=null)}},at=()=>{var Ne;const tt=s.unref(De),Pt=Qe(tt&&tt[1]),Rt=s.unref(oe);if(Pt&&Pt.isValid()){De.value=[((Ne=s.unref(he))==null?void 0:Ne[0])||null,ot(Pt)];const Ht=[Rt&&Rt[0],Pt];ct(Ht)&&(G(Ht),De.value=null)}},ze=s.ref({}),Ke=Ne=>{ze.value[Ne[0]]=Ne[1],ze.value.panelReady=!0},ut=Ne=>{a("calendar-change",Ne)},yt=(Ne,tt,Pt)=>{a("panel-change",Ne,tt,Pt)};return s.provide("EP_PICKER_BASE",{props:x}),Q({focus:D,handleFocusInput:X,handleBlurInput:q,handleOpen:F,handleClose:V,onPick:$}),(Ne,tt)=>(s.openBlock(),s.createBlock(s.unref(ku),s.mergeProps({ref_key:"refPopper",ref:m,visible:_.value,effect:"light",pure:"",trigger:"click"},Ne.$attrs,{role:"dialog",teleported:"",transition:`${s.unref(h).namespace.value}-zoom-in-top`,"popper-class":[`${s.unref(h).namespace.value}-picker__popper`,Ne.popperClass],"popper-options":s.unref(f),"fallback-placements":["bottom","top","right","left"],"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"hide-after":0,persistent:"",onBeforeShow:O,onShow:L,onHide:I}),{default:s.withCtx(()=>[s.unref(Ae)?(s.openBlock(),s.createElementBlock("div",{key:1,ref_key:"inputRef",ref:v,class:s.normalizeClass(s.unref(T)),style:s.normalizeStyle(Ne.$attrs.style),onClick:X,onMouseenter:ke,onMouseleave:Ee,onTouchstartPassive:ge,onKeydown:ht},[s.unref(Ce)?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass([s.unref(d).e("icon"),s.unref(u).e("icon")]),onMousedown:s.withModifiers(B,["prevent"]),onTouchstartPassive:ge},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(Ce))))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.createElementVNode("input",{id:Ne.id&&Ne.id[0],autocomplete:"off",name:Ne.name&&Ne.name[0],placeholder:Ne.startPlaceholder,value:s.unref(he)&&s.unref(he)[0],disabled:s.unref(ne),readonly:!Ne.editable||Ne.readonly,class:s.normalizeClass(s.unref(u).b("input")),onMousedown:B,onInput:Ze,onChange:dt,onFocus:X,onBlur:q},null,42,["id","name","placeholder","value","disabled","readonly"]),s.renderSlot(Ne.$slots,"range-separator",{},()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(u).b("separator"))},s.toDisplayString(Ne.rangeSeparator),3)]),s.createElementVNode("input",{id:Ne.id&&Ne.id[1],autocomplete:"off",name:Ne.name&&Ne.name[1],placeholder:Ne.endPlaceholder,value:s.unref(he)&&s.unref(he)[1],disabled:s.unref(ne),readonly:!Ne.editable||Ne.readonly,class:s.normalizeClass(s.unref(u).b("input")),onMousedown:B,onFocus:X,onBlur:q,onInput:Xe,onChange:at},null,42,["id","name","placeholder","value","disabled","readonly"]),Ne.clearIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:1,class:s.normalizeClass(s.unref(R)),onClick:ce},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(Ne.clearIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],38)):(s.openBlock(),s.createBlock(s.unref(Sn),{key:0,id:Ne.id,ref_key:"inputRef",ref:v,"container-role":"combobox","model-value":s.unref(he),name:Ne.name,size:s.unref(fe),disabled:s.unref(ne),placeholder:Ne.placeholder,class:s.normalizeClass([s.unref(h).b("editor"),s.unref(h).bm("editor",Ne.type),Ne.$attrs.class]),style:s.normalizeStyle(Ne.$attrs.style),readonly:!Ne.editable||Ne.readonly||s.unref(se)||s.unref(re)||s.unref(ae)||Ne.type==="week","aria-label":Ne.ariaLabel,tabindex:Ne.tabindex,"validate-event":!1,onInput:it,onFocus:X,onBlur:q,onKeydown:ht,onChange:Je,onMousedown:B,onMouseenter:ke,onMouseleave:Ee,onTouchstartPassive:ge,onClick:s.withModifiers(()=>{},["stop"])},{prefix:s.withCtx(()=>[s.unref(Ce)?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(d).e("icon")),onMousedown:s.withModifiers(B,["prevent"]),onTouchstartPassive:ge},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(Ce))))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0)]),suffix:s.withCtx(()=>[me.value&&Ne.clearIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(`${s.unref(d).e("icon")} clear-icon`),onClick:s.withModifiers(ce,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(Ne.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)]),_:1},8,["id","model-value","name","size","disabled","placeholder","class","style","readonly","aria-label","tabindex","onKeydown","onClick"]))]),content:s.withCtx(()=>[s.renderSlot(Ne.$slots,"default",{visible:_.value,actualVisible:b.value,parsedValue:s.unref(oe),format:Ne.format,dateFormat:Ne.dateFormat,timeFormat:Ne.timeFormat,unlinkPanels:Ne.unlinkPanels,type:Ne.type,defaultValue:Ne.defaultValue,onPick:$,onSelectRange:W,onSetPickerOption:Ke,onCalendarChange:ut,onPanelChange:yt,onKeydown:M,onMousedown:s.withModifiers(()=>{},["stop"])})]),_:3},16,["visible","transition","popper-class","popper-options"]))}});var RR=si(FR,[["__file","picker.vue"]]);const OR=ei({...IR,datetimeRole:String,parsedValue:{type:Pr(Object)}}),NR=({getAvailableHours:N,getAvailableMinutes:Q,getAvailableSeconds:a})=>{const x=(h,d,u,l)=>{const c={hour:N,minute:Q,second:a};let f=h;return["hour","minute","second"].forEach(p=>{if(c[p]){let m;const v=c[p];switch(p){case"minute":{m=v(f.hour(),d,l);break}case"second":{m=v(f.hour(),f.minute(),d,l);break}default:{m=v(d,l);break}}if(m!=null&&m.length&&!m.includes(f[p]())){const _=u?0:m.length-1;f=f[p](m[_])}}}),f},S={};return{timePickerOptions:S,getAvailableTime:x,onSetOption:([h,d])=>{S[h]=d}}},Xm=N=>{const Q=(x,S)=>x||S,a=x=>x!==!0;return N.map(Q).filter(a)},B1=(N,Q,a)=>({getHoursList:(h,d)=>Km(24,N&&(()=>N==null?void 0:N(h,d))),getMinutesList:(h,d,u)=>Km(60,Q&&(()=>Q==null?void 0:Q(h,d,u))),getSecondsList:(h,d,u,l)=>Km(60,a&&(()=>a==null?void 0:a(h,d,u,l)))}),LR=(N,Q,a)=>{const{getHoursList:x,getMinutesList:S,getSecondsList:A}=B1(N,Q,a);return{getAvailableHours:(l,c)=>Xm(x(l,c)),getAvailableMinutes:(l,c,f)=>Xm(S(l,c,f)),getAvailableSeconds:(l,c,f,p)=>Xm(A(l,c,f,p))}},jR=N=>{const Q=s.ref(N.parsedValue);return s.watch(()=>N.visible,a=>{a||(Q.value=N.parsedValue)}),Q},La=new Map;if(Ln){let N;document.addEventListener("mousedown",Q=>N=Q),document.addEventListener("mouseup",Q=>{if(N){for(const a of La.values())for(const{documentHandler:x}of a)x(Q,N);N=void 0}})}function P1(N,Q){let a=[];return Array.isArray(Q.arg)?a=Q.arg:fl(Q.arg)&&a.push(Q.arg),function(x,S){const A=Q.instance.popperRef,h=x.target,d=S==null?void 0:S.target,u=!Q||!Q.instance,l=!h||!d,c=N.contains(h)||N.contains(d),f=N===h,p=a.length&&a.some(v=>v==null?void 0:v.contains(h))||a.length&&a.includes(d),m=A&&(A.contains(h)||A.contains(d));u||l||c||f||p||m||Q.value(x,S)}}const Eh={beforeMount(N,Q){La.has(N)||La.set(N,[]),La.get(N).push({documentHandler:P1(N,Q),bindingFn:Q.value})},updated(N,Q){La.has(N)||La.set(N,[]);const a=La.get(N),x=a.findIndex(A=>A.bindingFn===Q.oldValue),S={documentHandler:P1(N,Q),bindingFn:Q.value};x>=0?a.splice(x,1,S):a.push(S)},unmounted(N){La.delete(N)}},VR=100,UR=600,Bh={beforeMount(N,Q){const a=Q.value,{interval:x=VR,delay:S=UR}=mn(a)?{}:a;let A,h;const d=()=>mn(a)?a():a.handler(),u=()=>{h&&(clearTimeout(h),h=void 0),A&&(clearInterval(A),A=void 0)};N.addEventListener("mousedown",l=>{l.button===0&&(u(),d(),document.addEventListener("mouseup",()=>u(),{once:!0}),h=setTimeout(()=>{A=setInterval(()=>{d()},x)},S))})}},HR=ei({role:{type:String,required:!0},spinnerDate:{type:Pr(Object),required:!0},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:Pr(String),default:""},...C1});var zR=si(s.defineComponent({__name:"basic-time-spinner",props:HR,emits:["change","select-range","set-option"],setup(N,{emit:Q}){const a=N,x=Jr("time"),{getHoursList:S,getMinutesList:A,getSecondsList:h}=B1(a.disabledHours,a.disabledMinutes,a.disabledSeconds);let d=!1;const u=s.ref(),l=s.ref(),c=s.ref(),f=s.ref(),p={hours:l,minutes:c,seconds:f},m=s.computed(()=>a.showSeconds?m1:m1.slice(0,2)),v=s.computed(()=>{const{spinnerDate:D}=a,X=D.hour(),ee=D.minute(),q=D.second();return{hours:X,minutes:ee,seconds:q}}),_=s.computed(()=>{const{hours:D,minutes:X}=s.unref(v);return{hours:S(a.role),minutes:A(D,a.role),seconds:h(D,X,a.role)}}),b=s.computed(()=>{const{hours:D,minutes:X,seconds:ee}=s.unref(v);return{hours:$m(D,23),minutes:$m(X,59),seconds:$m(ee,59)}}),w=ah(D=>{d=!1,T(D)},200),C=D=>{if(!!!a.amPmMode)return"";const ee=a.amPmMode==="A";let q=D<12?" am":" pm";return ee&&(q=q.toUpperCase()),q},k=D=>{let X;switch(D){case"hours":X=[0,2];break;case"minutes":X=[3,5];break;case"seconds":X=[6,8];break}const[ee,q]=X;Q("select-range",ee,q),u.value=D},T=D=>{G(D,s.unref(v)[D])},R=()=>{T("hours"),T("minutes"),T("seconds")},U=D=>D.querySelector(`.${x.namespace.value}-scrollbar__wrap`),G=(D,X)=>{if(a.arrowControl)return;const ee=s.unref(p[D]);ee&&ee.$el&&(U(ee.$el).scrollTop=Math.max(0,X*j(D)))},j=D=>{const X=s.unref(p[D]),ee=X==null?void 0:X.$el.querySelector("li");return ee&&Number.parseFloat(Q4(ee,"height"))||0},H=()=>{K(1)},W=()=>{K(-1)},K=D=>{u.value||k("hours");const X=u.value,ee=s.unref(v)[X],q=u.value==="hours"?24:60,ne=$(X,ee,D,q);O(X,ne),G(X,ne),s.nextTick(()=>k(X))},$=(D,X,ee,q)=>{let ne=(X+ee+q)%q;const oe=s.unref(_)[D];for(;oe[ne]&&ne!==X;)ne=(ne+ee+q)%q;return ne},O=(D,X)=>{if(s.unref(_)[D][X])return;const{hours:ne,minutes:oe,seconds:he}=s.unref(v);let te;switch(D){case"hours":te=a.spinnerDate.hour(X).minute(oe).second(he);break;case"minutes":te=a.spinnerDate.hour(ne).minute(X).second(he);break;case"seconds":te=a.spinnerDate.hour(ne).minute(oe).second(X);break}Q("change",te)},L=(D,{value:X,disabled:ee})=>{ee||(O(D,X),k(D),G(D,X))},M=D=>{d=!0,w(D);const X=Math.min(Math.round((U(s.unref(p[D]).$el).scrollTop-(I(D)*.5-10)/j(D)+3)/j(D)),D==="hours"?23:59);O(D,X)},I=D=>s.unref(p[D]).$el.offsetHeight,F=()=>{const D=X=>{const ee=s.unref(p[X]);ee&&ee.$el&&(U(ee.$el).onscroll=()=>{M(X)})};D("hours"),D("minutes"),D("seconds")};s.onMounted(()=>{s.nextTick(()=>{!a.arrowControl&&F(),R(),a.role==="start"&&k("hours")})});const V=(D,X)=>{p[X].value=D};return Q("set-option",[`${a.role}_scrollDown`,K]),Q("set-option",[`${a.role}_emitSelectRange`,k]),s.watch(()=>a.spinnerDate,()=>{d||R()}),(D,X)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(x).b("spinner"),{"has-seconds":D.showSeconds}])},[D.arrowControl?s.createCommentVNode("v-if",!0):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(s.unref(m),ee=>(s.openBlock(),s.createBlock(s.unref(yn),{key:ee,ref_for:!0,ref:q=>V(q,ee),class:s.normalizeClass(s.unref(x).be("spinner","wrapper")),"wrap-style":"max-height: inherit;","view-class":s.unref(x).be("spinner","list"),noresize:"",tag:"ul",onMouseenter:q=>k(ee),onMousemove:q=>T(ee)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(_)[ee],(q,ne)=>(s.openBlock(),s.createElementBlock("li",{key:ne,class:s.normalizeClass([s.unref(x).be("spinner","item"),s.unref(x).is("active",ne===s.unref(v)[ee]),s.unref(x).is("disabled",q)]),onClick:oe=>L(ee,{value:ne,disabled:q})},[ee==="hours"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(("0"+(D.amPmMode?ne%12||12:ne)).slice(-2))+s.toDisplayString(C(ne)),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(("0"+ne).slice(-2)),1)],64))],10,["onClick"]))),128))]),_:2},1032,["class","view-class","onMouseenter","onMousemove"]))),128)),D.arrowControl?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(s.unref(m),ee=>(s.openBlock(),s.createElementBlock("div",{key:ee,class:s.normalizeClass([s.unref(x).be("spinner","wrapper"),s.unref(x).is("arrow")]),onMouseenter:q=>k(ee)},[s.withDirectives((s.openBlock(),s.createBlock(s.unref(ni),{class:s.normalizeClass(["arrow-up",s.unref(x).be("spinner","arrow")])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowUp))]),_:1},8,["class"])),[[s.unref(Bh),W]]),s.withDirectives((s.openBlock(),s.createBlock(s.unref(ni),{class:s.normalizeClass(["arrow-down",s.unref(x).be("spinner","arrow")])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowDown))]),_:1},8,["class"])),[[s.unref(Bh),H]]),s.createElementVNode("ul",{class:s.normalizeClass(s.unref(x).be("spinner","list"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(b)[ee],(q,ne)=>(s.openBlock(),s.createElementBlock("li",{key:ne,class:s.normalizeClass([s.unref(x).be("spinner","item"),s.unref(x).is("active",q===s.unref(v)[ee]),s.unref(x).is("disabled",s.unref(_)[ee][q])])},[typeof q=="number"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[ee==="hours"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(("0"+(D.amPmMode?q%12||12:q)).slice(-2))+s.toDisplayString(C(q)),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(("0"+q).slice(-2)),1)],64))],64)):s.createCommentVNode("v-if",!0)],2))),128))],2)],42,["onMouseenter"]))),128)):s.createCommentVNode("v-if",!0)],2))}}),[["__file","basic-time-spinner.vue"]]),Ym=si(s.defineComponent({__name:"panel-time-pick",props:OR,emits:["pick","select-range","set-picker-option"],setup(N,{emit:Q}){const a=N,x=s.inject("EP_PICKER_BASE"),{arrowControl:S,disabledHours:A,disabledMinutes:h,disabledSeconds:d,defaultValue:u}=x.props,{getAvailableHours:l,getAvailableMinutes:c,getAvailableSeconds:f}=LR(A,h,d),p=Jr("time"),{t:m,lang:v}=es(),_=s.ref([0,2]),b=jR(a),w=s.computed(()=>Ts(a.actualVisible)?`${p.namespace.value}-zoom-in-top`:""),C=s.computed(()=>a.format.includes("ss")),k=s.computed(()=>a.format.includes("A")?"A":a.format.includes("a")?"a":""),T=V=>{const D=Ir(V).locale(v.value),X=L(D);return D.isSame(X)},R=()=>{Q("pick",b.value,!1)},U=(V=!1,D=!1)=>{D||Q("pick",a.parsedValue,V)},G=V=>{if(!a.visible)return;const D=L(V).millisecond(0);Q("pick",D,!0)},j=(V,D)=>{Q("select-range",V,D),_.value=[V,D]},H=V=>{const D=[0,3].concat(C.value?[6]:[]),X=["hours","minutes"].concat(C.value?["seconds"]:[]),q=(D.indexOf(_.value[0])+V+D.length)%D.length;K.start_emitSelectRange(X[q])},W=V=>{const D=V.code,{left:X,right:ee,up:q,down:ne}=Ii;if([X,ee].includes(D)){H(D===X?-1:1),V.preventDefault();return}if([q,ne].includes(D)){const oe=D===q?-1:1;K.start_scrollDown(oe),V.preventDefault();return}},{timePickerOptions:K,onSetOption:$,getAvailableTime:O}=NR({getAvailableHours:l,getAvailableMinutes:c,getAvailableSeconds:f}),L=V=>O(V,a.datetimeRole||"",!0),M=V=>V?Ir(V,a.format).locale(v.value):null,I=V=>V?V.format(a.format):null,F=()=>Ir(u).locale(v.value);return Q("set-picker-option",["isValidValue",T]),Q("set-picker-option",["formatToString",I]),Q("set-picker-option",["parseUserInput",M]),Q("set-picker-option",["handleKeydownInput",W]),Q("set-picker-option",["getRangeAvailableTime",L]),Q("set-picker-option",["getDefaultValue",F]),(V,D)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(w)},{default:s.withCtx(()=>[V.actualVisible||V.visible?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(p).b("panel"))},[s.createElementVNode("div",{class:s.normalizeClass([s.unref(p).be("panel","content"),{"has-seconds":s.unref(C)}])},[s.createVNode(zR,{ref:"spinner",role:V.datetimeRole||"start","arrow-control":s.unref(S),"show-seconds":s.unref(C),"am-pm-mode":s.unref(k),"spinner-date":V.parsedValue,"disabled-hours":s.unref(A),"disabled-minutes":s.unref(h),"disabled-seconds":s.unref(d),onChange:G,onSetOption:s.unref($),onSelectRange:j},null,8,["role","arrow-control","show-seconds","am-pm-mode","spinner-date","disabled-hours","disabled-minutes","disabled-seconds","onSetOption"])],2),s.createElementVNode("div",{class:s.normalizeClass(s.unref(p).be("panel","footer"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(p).be("panel","btn"),"cancel"]),onClick:R},s.toDisplayString(s.unref(m)("el.datepicker.cancel")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(p).be("panel","btn"),"confirm"]),onClick:X=>U()},s.toDisplayString(s.unref(m)("el.datepicker.confirm")),11,["onClick"])],2)],2)):s.createCommentVNode("v-if",!0)]),_:1},8,["name"]))}}),[["__file","panel-time-pick.vue"]]),S1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x,S){var A=x.prototype,h=function(f){return f&&(f.indexOf?f:f.s)},d=function(f,p,m,v,_){var b=f.name?f:f.$locale(),w=h(b[p]),C=h(b[m]),k=w||C.map(function(R){return R.slice(0,v)});if(!_)return k;var T=b.weekStart;return k.map(function(R,U){return k[(U+(T||0))%7]})},u=function(){return S.Ls[S.locale()]},l=function(f,p){return f.formats[p]||function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,_,b){return _||b.slice(1)})}(f.formats[p.toUpperCase()])},c=function(){var f=this;return{months:function(p){return p?p.format("MMMM"):d(f,"months")},monthsShort:function(p){return p?p.format("MMM"):d(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(p){return p?p.format("dddd"):d(f,"weekdays")},weekdaysMin:function(p){return p?p.format("dd"):d(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(p){return p?p.format("ddd"):d(f,"weekdaysShort","weekdays",3)},longDateFormat:function(p){return l(f.$locale(),p)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};A.localeData=function(){return c.bind(this)()},S.localeData=function(){var f=u();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return S.weekdays()},weekdaysShort:function(){return S.weekdaysShort()},weekdaysMin:function(){return S.weekdaysMin()},months:function(){return S.months()},monthsShort:function(){return S.monthsShort()},longDateFormat:function(p){return l(f,p)},meridiem:f.meridiem,ordinal:f.ordinal}},S.months=function(){return d(u(),"months")},S.monthsShort=function(){return d(u(),"monthsShort","months",3)},S.weekdays=function(f){return d(u(),"weekdays",null,null,f)},S.weekdaysShort=function(f){return d(u(),"weekdaysShort","weekdays",3,f)},S.weekdaysMin=function(f){return d(u(),"weekdaysMin","weekdays",2,f)}}})})(S1);var GR=S1.exports;const QR=aa(GR),k1={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:po,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Ys(["ariaControls"])},M1={[Wi]:N=>Dn(N)||Ri(N)||uo(N),change:N=>Dn(N)||Ri(N)||uo(N)},dc=Symbol("checkboxGroupContextKey"),WR=({model:N,isChecked:Q})=>{const a=s.inject(dc,void 0),x=s.computed(()=>{var A,h;const d=(A=a==null?void 0:a.max)==null?void 0:A.value,u=(h=a==null?void 0:a.min)==null?void 0:h.value;return!Ts(d)&&N.value.length>=d&&!Q.value||!Ts(u)&&N.value.length<=u&&Q.value});return{isDisabled:gl(s.computed(()=>(a==null?void 0:a.disabled.value)||x.value)),isLimitDisabled:x}},$R=(N,{model:Q,isLimitExceeded:a,hasOwnLabel:x,isDisabled:S,isLabeledByFormItem:A})=>{const h=s.inject(dc,void 0),{formItem:d}=Ao(),{emit:u}=s.getCurrentInstance();function l(v){var _,b,w,C;return[!0,N.trueValue,N.trueLabel].includes(v)?(b=(_=N.trueValue)!=null?_:N.trueLabel)!=null?b:!0:(C=(w=N.falseValue)!=null?w:N.falseLabel)!=null?C:!1}function c(v,_){u("change",l(v),_)}function f(v){if(a.value)return;const _=v.target;u("change",l(_.checked),v)}async function p(v){a.value||!x.value&&!S.value&&A.value&&(v.composedPath().some(w=>w.tagName==="LABEL")||(Q.value=l([!1,N.falseValue,N.falseLabel].includes(Q.value)),await s.nextTick(),c(Q.value,v)))}const m=s.computed(()=>(h==null?void 0:h.validateEvent)||N.validateEvent);return s.watch(()=>N.modelValue,()=>{m.value&&(d==null||d.validate("change").catch(v=>Ki(v)))}),{handleChange:f,onClickRoot:p}},KR=N=>{const Q=s.ref(!1),{emit:a}=s.getCurrentInstance(),x=s.inject(dc,void 0),S=s.computed(()=>Ts(x)===!1),A=s.ref(!1),h=s.computed({get(){var d,u;return S.value?(d=x==null?void 0:x.modelValue)==null?void 0:d.value:(u=N.modelValue)!=null?u:Q.value},set(d){var u,l;S.value&&bi(d)?(A.value=((u=x==null?void 0:x.max)==null?void 0:u.value)!==void 0&&d.length>(x==null?void 0:x.max.value)&&d.length>h.value.length,A.value===!1&&((l=x==null?void 0:x.changeEvent)==null||l.call(x,d))):(a(Wi,d),Q.value=d)}});return{model:h,isGroup:S,isLimitExceeded:A}},XR=(N,Q,{model:a})=>{const x=s.inject(dc,void 0),S=s.ref(!1),A=s.computed(()=>ec(N.value)?N.label:N.value),h=s.computed(()=>{const c=a.value;return uo(c)?c:bi(c)?qn(A.value)?c.map(s.toRaw).some(f=>vu(f,A.value)):c.map(s.toRaw).includes(A.value):c!=null?c===N.trueValue||c===N.trueLabel:!!c}),d=mo(s.computed(()=>{var c;return(c=x==null?void 0:x.size)==null?void 0:c.value}),{prop:!0}),u=mo(s.computed(()=>{var c;return(c=x==null?void 0:x.size)==null?void 0:c.value})),l=s.computed(()=>!!Q.default||!ec(A.value));return{checkboxButtonSize:d,isChecked:h,isFocused:S,checkboxSize:u,hasOwnLabel:l,actualValue:A}},T1=(N,Q)=>{const{formItem:a}=Ao(),{model:x,isGroup:S,isLimitExceeded:A}=KR(N),{isFocused:h,isChecked:d,checkboxButtonSize:u,checkboxSize:l,hasOwnLabel:c,actualValue:f}=XR(N,Q,{model:x}),{isDisabled:p}=WR({model:x,isChecked:d}),{inputId:m,isLabeledByFormItem:v}=vl(N,{formItemContext:a,disableIdGeneration:c,disableIdManagement:S}),{handleChange:_,onClickRoot:b}=$R(N,{model:x,isLimitExceeded:A,hasOwnLabel:c,isDisabled:p,isLabeledByFormItem:v});return(()=>{function C(){var k,T;bi(x.value)&&!x.value.includes(f.value)?x.value.push(f.value):x.value=(T=(k=N.trueValue)!=null?k:N.trueLabel)!=null?T:!0}N.checked&&C()})(),yu({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>S.value&&ec(N.value))),yu({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!N.trueLabel)),yu({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!N.falseLabel)),{inputId:m,isLabeledByFormItem:v,isChecked:d,isDisabled:p,isFocused:h,checkboxButtonSize:u,checkboxSize:l,hasOwnLabel:c,model:x,actualValue:f,handleChange:_,onClickRoot:b}},YR=s.defineComponent({name:"ElCheckbox"}),JR=s.defineComponent({...YR,props:k1,emits:M1,setup(N){const Q=N,a=s.useSlots(),{inputId:x,isLabeledByFormItem:S,isChecked:A,isDisabled:h,isFocused:d,checkboxSize:u,hasOwnLabel:l,model:c,actualValue:f,handleChange:p,onClickRoot:m}=T1(Q,a),v=Jr("checkbox"),_=s.computed(()=>[v.b(),v.m(u.value),v.is("disabled",h.value),v.is("bordered",Q.border),v.is("checked",A.value)]),b=s.computed(()=>[v.e("input"),v.is("disabled",h.value),v.is("checked",A.value),v.is("indeterminate",Q.indeterminate),v.is("focus",d.value)]);return(w,C)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(l)&&s.unref(S)?"span":"label"),{class:s.normalizeClass(s.unref(_)),"aria-controls":w.indeterminate?w.ariaControls:null,onClick:s.unref(m)},{default:s.withCtx(()=>{var k,T;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(b))},[w.trueValue||w.falseValue||w.trueLabel||w.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(x),"onUpdate:modelValue":R=>s.isRef(c)?c.value=R:null,class:s.normalizeClass(s.unref(v).e("original")),type:"checkbox",indeterminate:w.indeterminate,name:w.name,tabindex:w.tabindex,disabled:s.unref(h),"true-value":(k=w.trueValue)!=null?k:w.trueLabel,"false-value":(T=w.falseValue)!=null?T:w.falseLabel,onChange:s.unref(p),onFocus:R=>d.value=!0,onBlur:R=>d.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(c)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,id:s.unref(x),"onUpdate:modelValue":R=>s.isRef(c)?c.value=R:null,class:s.normalizeClass(s.unref(v).e("original")),type:"checkbox",indeterminate:w.indeterminate,disabled:s.unref(h),value:s.unref(f),name:w.name,tabindex:w.tabindex,onChange:s.unref(p),onFocus:R=>d.value=!0,onBlur:R=>d.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(c)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(v).e("inner"))},null,2)],2),s.unref(l)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(v).e("label"))},[s.renderSlot(w.$slots,"default"),w.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(w.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var ZR=si(JR,[["__file","checkbox.vue"]]);const qR=s.defineComponent({name:"ElCheckboxButton"}),eO=s.defineComponent({...qR,props:k1,emits:M1,setup(N){const Q=N,a=s.useSlots(),{isFocused:x,isChecked:S,isDisabled:A,checkboxButtonSize:h,model:d,actualValue:u,handleChange:l}=T1(Q,a),c=s.inject(dc,void 0),f=Jr("checkbox"),p=s.computed(()=>{var v,_,b,w;const C=(_=(v=c==null?void 0:c.fill)==null?void 0:v.value)!=null?_:"";return{backgroundColor:C,borderColor:C,color:(w=(b=c==null?void 0:c.textColor)==null?void 0:b.value)!=null?w:"",boxShadow:C?`-1px 0 0 0 ${C}`:void 0}}),m=s.computed(()=>[f.b("button"),f.bm("button",h.value),f.is("disabled",A.value),f.is("checked",S.value),f.is("focus",x.value)]);return(v,_)=>{var b,w;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass(s.unref(m))},[v.trueValue||v.falseValue||v.trueLabel||v.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>s.isRef(d)?d.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:s.unref(A),"true-value":(b=v.trueValue)!=null?b:v.trueLabel,"false-value":(w=v.falseValue)!=null?w:v.falseLabel,onChange:s.unref(l),onFocus:C=>x.value=!0,onBlur:C=>x.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>s.isRef(d)?d.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:s.unref(A),value:s.unref(u),onChange:s.unref(l),onFocus:C=>x.value=!0,onBlur:C=>x.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]),v.$slots.default||v.label?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(s.unref(f).be("button","inner")),style:s.normalizeStyle(s.unref(S)?s.unref(p):void 0)},[s.renderSlot(v.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(v.label),1)])],6)):s.createCommentVNode("v-if",!0)],2)}}});var I1=si(eO,[["__file","checkbox-button.vue"]]);const tO=ei({modelValue:{type:Pr(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:po,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),rO={[Wi]:N=>bi(N),change:N=>bi(N)},iO=s.defineComponent({name:"ElCheckboxGroup"}),nO=s.defineComponent({...iO,props:tO,emits:rO,setup(N,{emit:Q}){const a=N,x=Jr("checkbox"),{formItem:S}=Ao(),{inputId:A,isLabeledByFormItem:h}=vl(a,{formItemContext:S}),d=async l=>{Q(Wi,l),await s.nextTick(),Q("change",l)},u=s.computed({get(){return a.modelValue},set(l){d(l)}});return s.provide(dc,{...e_(s.toRefs(a),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:d}),s.watch(()=>a.modelValue,()=>{a.validateEvent&&(S==null||S.validate("change").catch(l=>Ki(l)))}),(l,c)=>{var f;return s.openBlock(),s.createBlock(s.resolveDynamicComponent(l.tag),{id:s.unref(A),class:s.normalizeClass(s.unref(x).b("group")),role:"group","aria-label":s.unref(h)?void 0:l.ariaLabel||"checkbox-group","aria-labelledby":s.unref(h)?(f=s.unref(S))==null?void 0:f.labelId:void 0},{default:s.withCtx(()=>[s.renderSlot(l.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var D1=si(nO,[["__file","checkbox-group.vue"]]);const Jm=Gn(ZR,{CheckboxButton:I1,CheckboxGroup:D1});pl(I1);const F1=pl(D1),R1=ei({modelValue:{type:[String,Number,Boolean],default:void 0},size:po,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),sO=ei({...R1,border:Boolean}),O1={[Wi]:N=>Dn(N)||Ri(N)||uo(N),[Mo]:N=>Dn(N)||Ri(N)||uo(N)},N1=Symbol("radioGroupKey"),L1=(N,Q)=>{const a=s.ref(),x=s.inject(N1,void 0),S=s.computed(()=>!!x),A=s.computed(()=>ec(N.value)?N.label:N.value),h=s.computed({get(){return S.value?x.modelValue:N.modelValue},set(f){S.value?x.changeEvent(f):Q&&Q(Wi,f),a.value.checked=N.modelValue===A.value}}),d=mo(s.computed(()=>x==null?void 0:x.size)),u=gl(s.computed(()=>x==null?void 0:x.disabled)),l=s.ref(!1),c=s.computed(()=>u.value||S.value&&h.value!==A.value?-1:0);return yu({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},s.computed(()=>S.value&&ec(N.value))),{radioRef:a,isGroup:S,radioGroup:x,focus:l,size:d,disabled:u,tabIndex:c,modelValue:h,actualValue:A}},oO=s.defineComponent({name:"ElRadio"}),aO=s.defineComponent({...oO,props:sO,emits:O1,setup(N,{emit:Q}){const a=N,x=Jr("radio"),{radioRef:S,radioGroup:A,focus:h,size:d,disabled:u,modelValue:l,actualValue:c}=L1(a,Q);function f(){s.nextTick(()=>Q("change",l.value))}return(p,m)=>{var v;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass([s.unref(x).b(),s.unref(x).is("disabled",s.unref(u)),s.unref(x).is("focus",s.unref(h)),s.unref(x).is("bordered",p.border),s.unref(x).is("checked",s.unref(l)===s.unref(c)),s.unref(x).m(s.unref(d))])},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(x).e("input"),s.unref(x).is("disabled",s.unref(u)),s.unref(x).is("checked",s.unref(l)===s.unref(c))])},[s.withDirectives(s.createElementVNode("input",{ref_key:"radioRef",ref:S,"onUpdate:modelValue":_=>s.isRef(l)?l.value=_:null,class:s.normalizeClass(s.unref(x).e("original")),value:s.unref(c),name:p.name||((v=s.unref(A))==null?void 0:v.name),disabled:s.unref(u),checked:s.unref(l)===s.unref(c),type:"radio",onFocus:_=>h.value=!0,onBlur:_=>h.value=!1,onChange:f,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[s.vModelRadio,s.unref(l)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(x).e("inner"))},null,2)],2),s.createElementVNode("span",{class:s.normalizeClass(s.unref(x).e("label")),onKeydown:s.withModifiers(()=>{},["stop"])},[s.renderSlot(p.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var lO=si(aO,[["__file","radio.vue"]]);const cO=ei({...R1}),uO=s.defineComponent({name:"ElRadioButton"}),dO=s.defineComponent({...uO,props:cO,setup(N){const Q=N,a=Jr("radio"),{radioRef:x,focus:S,size:A,disabled:h,modelValue:d,radioGroup:u,actualValue:l}=L1(Q),c=s.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(f,p)=>{var m;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass([s.unref(a).b("button"),s.unref(a).is("active",s.unref(d)===s.unref(l)),s.unref(a).is("disabled",s.unref(h)),s.unref(a).is("focus",s.unref(S)),s.unref(a).bm("button",s.unref(A))])},[s.withDirectives(s.createElementVNode("input",{ref_key:"radioRef",ref:x,"onUpdate:modelValue":v=>s.isRef(d)?d.value=v:null,class:s.normalizeClass(s.unref(a).be("button","original-radio")),value:s.unref(l),type:"radio",name:f.name||((m=s.unref(u))==null?void 0:m.name),disabled:s.unref(h),onFocus:v=>S.value=!0,onBlur:v=>S.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[s.vModelRadio,s.unref(d)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).be("button","inner")),style:s.normalizeStyle(s.unref(d)===s.unref(l)?s.unref(c):{}),onKeydown:s.withModifiers(()=>{},["stop"])},[s.renderSlot(f.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(f.label),1)])],46,["onKeydown"])],2)}}});var j1=si(dO,[["__file","radio-button.vue"]]);const hO=ei({id:{type:String,default:void 0},size:po,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),fO=O1,pO=s.defineComponent({name:"ElRadioGroup"}),mO=s.defineComponent({...pO,props:hO,emits:fO,setup(N,{emit:Q}){const a=N,x=Jr("radio"),S=Pu(),A=s.ref(),{formItem:h}=Ao(),{inputId:d,isLabeledByFormItem:u}=vl(a,{formItemContext:h}),l=f=>{Q(Wi,f),s.nextTick(()=>Q("change",f))};s.onMounted(()=>{const f=A.value.querySelectorAll("[type=radio]"),p=f[0];!Array.from(f).some(m=>m.checked)&&p&&(p.tabIndex=0)});const c=s.computed(()=>a.name||S.value);return s.provide(N1,s.reactive({...s.toRefs(a),changeEvent:l,name:c})),s.watch(()=>a.modelValue,()=>{a.validateEvent&&(h==null||h.validate("change").catch(f=>Ki(f)))}),(f,p)=>(s.openBlock(),s.createElementBlock("div",{id:s.unref(d),ref_key:"radioGroupRef",ref:A,class:s.normalizeClass(s.unref(x).b("group")),role:"radiogroup","aria-label":s.unref(u)?void 0:f.ariaLabel||"radio-group","aria-labelledby":s.unref(u)?s.unref(h).labelId:void 0},[s.renderSlot(f.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var V1=si(mO,[["__file","radio-group.vue"]]);const AO=Gn(lO,{RadioButton:j1,RadioGroup:V1}),gO=pl(V1);pl(j1);const Zm=ei({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:ym},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),vO={close:N=>N instanceof MouseEvent,click:N=>N instanceof MouseEvent},yO=s.defineComponent({name:"ElTag"}),bO=s.defineComponent({...yO,props:Zm,emits:vO,setup(N,{emit:Q}){const a=N,x=mo(),S=Jr("tag"),A=s.computed(()=>{const{type:u,hit:l,effect:c,closable:f,round:p}=a;return[S.b(),S.is("closable",f),S.m(u||"primary"),S.m(x.value),S.m(c),S.is("hit",l),S.is("round",p)]}),h=u=>{Q("close",u)},d=u=>{Q("click",u)};return(u,l)=>u.disableTransitions?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(A)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:d},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(S).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(S).e("close")),onClick:s.withModifiers(h,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)):(s.openBlock(),s.createBlock(s.Transition,{key:1,name:`${s.unref(S).namespace.value}-zoom-in-center`,appear:""},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(A)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:d},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(S).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(S).e("close")),onClick:s.withModifiers(h,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var _O=si(bO,[["__file","tag.vue"]]);const wO=Gn(_O),xO=s.defineComponent({name:"ElCollapseTransition"}),CO=s.defineComponent({...xO,setup(N){const Q=Jr("collapse-transition"),a=S=>{S.style.maxHeight="",S.style.overflow=S.dataset.oldOverflow,S.style.paddingTop=S.dataset.oldPaddingTop,S.style.paddingBottom=S.dataset.oldPaddingBottom},x={beforeEnter(S){S.dataset||(S.dataset={}),S.dataset.oldPaddingTop=S.style.paddingTop,S.dataset.oldPaddingBottom=S.style.paddingBottom,S.style.height&&(S.dataset.elExistsHeight=S.style.height),S.style.maxHeight=0,S.style.paddingTop=0,S.style.paddingBottom=0},enter(S){requestAnimationFrame(()=>{S.dataset.oldOverflow=S.style.overflow,S.dataset.elExistsHeight?S.style.maxHeight=S.dataset.elExistsHeight:S.scrollHeight!==0?S.style.maxHeight=`${S.scrollHeight}px`:S.style.maxHeight=0,S.style.paddingTop=S.dataset.oldPaddingTop,S.style.paddingBottom=S.dataset.oldPaddingBottom,S.style.overflow="hidden"})},afterEnter(S){S.style.maxHeight="",S.style.overflow=S.dataset.oldOverflow},enterCancelled(S){a(S)},beforeLeave(S){S.dataset||(S.dataset={}),S.dataset.oldPaddingTop=S.style.paddingTop,S.dataset.oldPaddingBottom=S.style.paddingBottom,S.dataset.oldOverflow=S.style.overflow,S.style.maxHeight=`${S.scrollHeight}px`,S.style.overflow="hidden"},leave(S){S.scrollHeight!==0&&(S.style.maxHeight=0,S.style.paddingTop=0,S.style.paddingBottom=0)},afterLeave(S){a(S)},leaveCancelled(S){a(S)}};return(S,A)=>(s.openBlock(),s.createBlock(s.Transition,s.mergeProps({name:s.unref(Q).b()},s.toHandlers(x)),{default:s.withCtx(()=>[s.renderSlot(S.$slots,"default")]),_:3},16,["name"]))}});var EO=si(CO,[["__file","collapse-transition.vue"]]);const BO=Gn(EO);var U1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){var S=x.prototype,A=S.format;S.format=function(h){var d=this,u=this.$locale();if(!this.isValid())return A.bind(this)(h);var l=this.$utils(),c=(h||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(f){switch(f){case"Q":return Math.ceil((d.$M+1)/3);case"Do":return u.ordinal(d.$D);case"gggg":return d.weekYear();case"GGGG":return d.isoWeekYear();case"wo":return u.ordinal(d.week(),"W");case"w":case"ww":return l.s(d.week(),f==="w"?1:2,"0");case"W":case"WW":return l.s(d.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return l.s(String(d.$H===0?24:d.$H),f==="k"?1:2,"0");case"X":return Math.floor(d.$d.getTime()/1e3);case"x":return d.$d.getTime();case"z":return"["+d.offsetName()+"]";case"zzz":return"["+d.offsetName("long")+"]";default:return f}});return A.bind(this)(c)}}})})(U1);var PO=U1.exports;const SO=aa(PO);var H1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){var a="week",x="year";return function(S,A,h){var d=A.prototype;d.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var l=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var c=h(this).startOf(x).add(1,x).date(l),f=h(this).endOf(a);if(c.isBefore(f))return 1}var p=h(this).startOf(x).date(l).startOf(a).subtract(1,"millisecond"),m=this.diff(p,a,!0);return m<0?h(this).startOf("week").week():Math.ceil(m)},d.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}})})(H1);var kO=H1.exports;const MO=aa(kO);var z1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){x.prototype.weekYear=function(){var S=this.month(),A=this.week(),h=this.year();return A===1&&S===11?h+1:S===0&&A>=52?h-1:h}}})})(z1);var TO=z1.exports;const IO=aa(TO);var G1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x,S){x.prototype.dayOfYear=function(A){var h=Math.round((S(this).startOf("day")-S(this).startOf("year"))/864e5)+1;return A==null?h:this.add(A-h,"day")}}})})(G1);var DO=G1.exports;const FO=aa(DO);var Q1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){x.prototype.isSameOrAfter=function(S,A){return this.isSame(S,A)||this.isAfter(S,A)}}})})(Q1);var RO=Q1.exports;const OO=aa(RO);var W1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){x.prototype.isSameOrBefore=function(S,A){return this.isSame(S,A)||this.isBefore(S,A)}}})})(W1);var NO=W1.exports;const LO=aa(NO),Ph=Symbol(),jO=ei({...E1,type:{type:Pr(String),default:"date"}}),VO=["date","dates","year","years","month","months","week","range"],qm=ei({disabledDate:{type:Pr(Function)},date:{type:Pr(Object),required:!0},minDate:{type:Pr(Object)},maxDate:{type:Pr(Object)},parsedValue:{type:Pr([Object,Array])},rangeState:{type:Pr(Object),default:()=>({endDate:null,selecting:!1})}}),$1=ei({type:{type:Pr(String),required:!0,values:K4},dateFormat:String,timeFormat:String}),eA=ei({unlinkPanels:Boolean,parsedValue:{type:Pr(Array)}}),tA=N=>({type:String,values:VO,default:N}),UO=ei({...$1,parsedValue:{type:Pr([Object,Array])},visible:{type:Boolean},format:{type:String,default:""}}),HO=ei({...qm,cellClassName:{type:Pr(Function)},showWeekNumber:Boolean,selectionMode:tA("date")}),zO=["changerange","pick","select"],hc=N=>{if(!bi(N))return!1;const[Q,a]=N;return Ir.isDayjs(Q)&&Ir.isDayjs(a)&&Q.isSameOrBefore(a)},rA=(N,{lang:Q,unit:a,unlinkPanels:x})=>{let S;if(bi(N)){let[A,h]=N.map(d=>Ir(d).locale(Q));return x||(h=A.add(1,a)),[A,h]}else N?S=Ir(N):S=Ir();return S=S.locale(Q),[S,S.add(1,a)]},GO=(N,Q,{columnIndexOffset:a,startDate:x,nextEndDate:S,now:A,unit:h,relativeDateGetter:d,setCellMetadata:u,setRowMetadata:l})=>{for(let c=0;c<N.row;c++){const f=Q[c];for(let p=0;p<N.column;p++){let m=f[p+a];m||(m={row:c,column:p,type:"normal",inRange:!1,start:!1,end:!1});const v=c*N.column+p,_=d(v);m.dayjs=_,m.date=_.toDate(),m.timestamp=_.valueOf(),m.type="normal",m.inRange=!!(x&&_.isSameOrAfter(x,h)&&S&&_.isSameOrBefore(S,h))||!!(x&&_.isSameOrBefore(x,h)&&S&&_.isSameOrAfter(S,h)),x!=null&&x.isSameOrAfter(S)?(m.start=!!S&&_.isSame(S,h),m.end=x&&_.isSame(x,h)):(m.start=!!x&&_.isSame(x,h),m.end=!!S&&_.isSame(S,h)),_.isSame(A,h)&&(m.type="today"),u==null||u(m,{rowIndex:c,columnIndex:p}),f[p+a]=m}l==null||l(f)}},iA=(N="")=>["normal","today"].includes(N),QO=(N,Q)=>{const{lang:a}=es(),x=s.ref(),S=s.ref(),A=s.ref(),h=s.ref(),d=s.ref([[],[],[],[],[],[]]);let u=!1;const l=N.date.$locale().weekStart||7,c=N.date.locale("en").localeData().weekdaysShort().map(D=>D.toLowerCase()),f=s.computed(()=>l>3?7-l:-l),p=s.computed(()=>{const D=N.date.startOf("month");return D.subtract(D.day()||7,"day")}),m=s.computed(()=>c.concat(c).slice(l,l+7)),v=s.computed(()=>Nb(s.unref(T)).some(D=>D.isCurrent)),_=s.computed(()=>{const D=N.date.startOf("month"),X=D.day()||7,ee=D.daysInMonth(),q=D.subtract(1,"month").daysInMonth();return{startOfMonthDay:X,dateCountOfMonth:ee,dateCountOfLastMonth:q}}),b=s.computed(()=>N.selectionMode==="dates"?Is(N.parsedValue):[]),w=(D,{count:X,rowIndex:ee,columnIndex:q})=>{const{startOfMonthDay:ne,dateCountOfMonth:oe,dateCountOfLastMonth:he}=s.unref(_),te=s.unref(f);if(ee>=0&&ee<=1){const de=ne+te<0?7+ne+te:ne+te;if(q+ee*7>=de)return D.text=X,!0;D.text=he-(de-q%7)+1+ee*7,D.type="prev-month"}else return X<=oe?D.text=X:(D.text=X-oe,D.type="next-month"),!0;return!1},C=(D,{columnIndex:X,rowIndex:ee},q)=>{const{disabledDate:ne,cellClassName:oe}=N,he=s.unref(b),te=w(D,{count:q,rowIndex:ee,columnIndex:X}),de=D.dayjs.toDate();return D.selected=he.find(se=>se.isSame(D.dayjs,"day")),D.isSelected=!!D.selected,D.isCurrent=U(D),D.disabled=ne==null?void 0:ne(de),D.customClass=oe==null?void 0:oe(de),te},k=D=>{if(N.selectionMode==="week"){const[X,ee]=N.showWeekNumber?[1,7]:[0,6],q=V(D[X+1]);D[X].inRange=q,D[X].start=q,D[ee].inRange=q,D[ee].end=q}},T=s.computed(()=>{const{minDate:D,maxDate:X,rangeState:ee,showWeekNumber:q}=N,ne=s.unref(f),oe=s.unref(d),he="day";let te=1;if(q)for(let de=0;de<6;de++)oe[de][0]||(oe[de][0]={type:"week",text:s.unref(p).add(de*7+1,he).week()});return GO({row:6,column:7},oe,{startDate:D,columnIndexOffset:q?1:0,nextEndDate:ee.endDate||X||ee.selecting&&D||null,now:Ir().locale(s.unref(a)).startOf(he),unit:he,relativeDateGetter:de=>s.unref(p).add(de-ne,he),setCellMetadata:(...de)=>{C(...de,te)&&(te+=1)},setRowMetadata:k}),oe});s.watch(()=>N.date,async()=>{var D;(D=s.unref(x))!=null&&D.contains(document.activeElement)&&(await s.nextTick(),await R())});const R=async()=>{var D;return(D=s.unref(S))==null?void 0:D.focus()},U=D=>N.selectionMode==="date"&&iA(D.type)&&G(D,N.parsedValue),G=(D,X)=>X?Ir(X).locale(s.unref(a)).isSame(N.date.date(Number(D.text)),"day"):!1,j=(D,X)=>{const ee=D*7+(X-(N.showWeekNumber?1:0))-s.unref(f);return s.unref(p).add(ee,"day")},H=D=>{var X;if(!N.rangeState.selecting)return;let ee=D.target;if(ee.tagName==="SPAN"&&(ee=(X=ee.parentNode)==null?void 0:X.parentNode),ee.tagName==="DIV"&&(ee=ee.parentNode),ee.tagName!=="TD")return;const q=ee.parentNode.rowIndex-1,ne=ee.cellIndex;s.unref(T)[q][ne].disabled||(q!==s.unref(A)||ne!==s.unref(h))&&(A.value=q,h.value=ne,Q("changerange",{selecting:!0,endDate:j(q,ne)}))},W=D=>!s.unref(v)&&(D==null?void 0:D.text)===1&&D.type==="normal"||D.isCurrent,K=D=>{u||s.unref(v)||N.selectionMode!=="date"||F(D,!0)},$=D=>{D.target.closest("td")&&(u=!0)},O=D=>{D.target.closest("td")&&(u=!1)},L=D=>{!N.rangeState.selecting||!N.minDate?(Q("pick",{minDate:D,maxDate:null}),Q("select",!0)):(D>=N.minDate?Q("pick",{minDate:N.minDate,maxDate:D}):Q("pick",{minDate:D,maxDate:N.minDate}),Q("select",!1))},M=D=>{const X=D.week(),ee=`${D.year()}w${X}`;Q("pick",{year:D.year(),week:X,value:ee,date:D.startOf("week")})},I=(D,X)=>{const ee=X?Is(N.parsedValue).filter(q=>(q==null?void 0:q.valueOf())!==D.valueOf()):Is(N.parsedValue).concat([D]);Q("pick",ee)},F=(D,X=!1)=>{const ee=D.target.closest("td");if(!ee)return;const q=ee.parentNode.rowIndex-1,ne=ee.cellIndex,oe=s.unref(T)[q][ne];if(oe.disabled||oe.type==="week")return;const he=j(q,ne);switch(N.selectionMode){case"range":{L(he);break}case"date":{Q("pick",he,X);break}case"week":{M(he);break}case"dates":{I(he,!!oe.selected);break}}},V=D=>{if(N.selectionMode!=="week")return!1;let X=N.date.startOf("day");if(D.type==="prev-month"&&(X=X.subtract(1,"month")),D.type==="next-month"&&(X=X.add(1,"month")),X=X.date(Number.parseInt(D.text,10)),N.parsedValue&&!Array.isArray(N.parsedValue)){const ee=(N.parsedValue.day()-l+7)%7-1;return N.parsedValue.subtract(ee,"day").isSame(X,"day")}return!1};return{WEEKS:m,rows:T,tbodyRef:x,currentCellRef:S,focus:R,isCurrent:U,isWeekActive:V,isSelectedCell:W,handlePickDate:F,handleMouseUp:O,handleMouseDown:$,handleMouseMove:H,handleFocus:K}},WO=(N,{isCurrent:Q,isWeekActive:a})=>{const x=Jr("date-table"),{t:S}=es(),A=s.computed(()=>[x.b(),{"is-week-mode":N.selectionMode==="week"}]),h=s.computed(()=>S("el.datepicker.dateTablePrompt")),d=s.computed(()=>S("el.datepicker.week"));return{tableKls:A,tableLabel:h,weekLabel:d,getCellClasses:c=>{const f=[];return iA(c.type)&&!c.disabled?(f.push("available"),c.type==="today"&&f.push("today")):f.push(c.type),Q(c)&&f.push("current"),c.inRange&&(iA(c.type)||N.selectionMode==="week")&&(f.push("in-range"),c.start&&f.push("start-date"),c.end&&f.push("end-date")),c.disabled&&f.push("disabled"),c.selected&&f.push("selected"),c.customClass&&f.push(c.customClass),f.join(" ")},getRowKls:c=>[x.e("row"),{current:a(c)}],t:S}},$O=ei({cell:{type:Pr(Object)}});var nA=s.defineComponent({name:"ElDatePickerCell",props:$O,setup(N){const Q=Jr("date-table-cell"),{slots:a}=s.inject(Ph);return()=>{const{cell:x}=N;return s.renderSlot(a,"default",{...x},()=>{var S;return[s.createVNode("div",{class:Q.b()},[s.createVNode("span",{class:Q.e("text")},[(S=x==null?void 0:x.renderText)!=null?S:x==null?void 0:x.text])])]})}}}),sA=si(s.defineComponent({__name:"basic-date-table",props:HO,emits:zO,setup(N,{expose:Q,emit:a}){const x=N,{WEEKS:S,rows:A,tbodyRef:h,currentCellRef:d,focus:u,isCurrent:l,isWeekActive:c,isSelectedCell:f,handlePickDate:p,handleMouseUp:m,handleMouseDown:v,handleMouseMove:_,handleFocus:b}=QO(x,a),{tableLabel:w,tableKls:C,weekLabel:k,getCellClasses:T,getRowKls:R,t:U}=WO(x,{isCurrent:l,isWeekActive:c});return Q({focus:u}),(G,j)=>(s.openBlock(),s.createElementBlock("table",{"aria-label":s.unref(w),class:s.normalizeClass(s.unref(C)),cellspacing:"0",cellpadding:"0",role:"grid",onClick:s.unref(p),onMousemove:s.unref(_),onMousedown:s.withModifiers(s.unref(v),["prevent"]),onMouseup:s.unref(m)},[s.createElementVNode("tbody",{ref_key:"tbodyRef",ref:h},[s.createElementVNode("tr",null,[G.showWeekNumber?(s.openBlock(),s.createElementBlock("th",{key:0,scope:"col"},s.toDisplayString(s.unref(k)),1)):s.createCommentVNode("v-if",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(S),(H,W)=>(s.openBlock(),s.createElementBlock("th",{key:W,"aria-label":s.unref(U)("el.datepicker.weeksFull."+H),scope:"col"},s.toDisplayString(s.unref(U)("el.datepicker.weeks."+H)),9,["aria-label"]))),128))]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(A),(H,W)=>(s.openBlock(),s.createElementBlock("tr",{key:W,class:s.normalizeClass(s.unref(R)(H[1]))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(H,(K,$)=>(s.openBlock(),s.createElementBlock("td",{key:`${W}.${$}`,ref_for:!0,ref:O=>s.unref(f)(K)&&(d.value=O),class:s.normalizeClass(s.unref(T)(K)),"aria-current":K.isCurrent?"date":void 0,"aria-selected":K.isCurrent,tabindex:s.unref(f)(K)?0:-1,onFocus:s.unref(b)},[s.createVNode(s.unref(nA),{cell:K},null,8,["cell"])],42,["aria-current","aria-selected","tabindex","onFocus"]))),128))],2))),128))],512)],42,["aria-label","onClick","onMousemove","onMousedown","onMouseup"]))}}),[["__file","basic-date-table.vue"]]);const KO=ei({...qm,selectionMode:tA("month")});var oA=si(s.defineComponent({__name:"basic-month-table",props:KO,emits:["changerange","pick","select"],setup(N,{expose:Q,emit:a}){const x=N,S=(T,R,U)=>{const G=Ir().locale(U).startOf("month").month(R).year(T),j=G.daysInMonth();return g1(j).map(H=>G.add(H,"day").toDate())},A=Jr("month-table"),{t:h,lang:d}=es(),u=s.ref(),l=s.ref(),c=s.ref(x.date.locale("en").localeData().monthsShort().map(T=>T.toLowerCase())),f=s.ref([[],[],[]]),p=s.ref(),m=s.ref(),v=s.computed(()=>{var T,R;const U=f.value,G=Ir().locale(d.value).startOf("month");for(let j=0;j<3;j++){const H=U[j];for(let W=0;W<4;W++){const K=H[W]||(H[W]={row:j,column:W,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1});K.type="normal";const $=j*4+W,O=x.date.startOf("year").month($),L=x.rangeState.endDate||x.maxDate||x.rangeState.selecting&&x.minDate||null;K.inRange=!!(x.minDate&&O.isSameOrAfter(x.minDate,"month")&&L&&O.isSameOrBefore(L,"month"))||!!(x.minDate&&O.isSameOrBefore(x.minDate,"month")&&L&&O.isSameOrAfter(L,"month")),(T=x.minDate)!=null&&T.isSameOrAfter(L)?(K.start=!!(L&&O.isSame(L,"month")),K.end=x.minDate&&O.isSame(x.minDate,"month")):(K.start=!!(x.minDate&&O.isSame(x.minDate,"month")),K.end=!!(L&&O.isSame(L,"month"))),G.isSame(O)&&(K.type="today"),K.text=$,K.disabled=((R=x.disabledDate)==null?void 0:R.call(x,O.toDate()))||!1}}return U}),_=()=>{var T;(T=l.value)==null||T.focus()},b=T=>{const R={},U=x.date.year(),G=new Date,j=T.text;return R.disabled=x.disabledDate?S(U,j,d.value).every(x.disabledDate):!1,R.current=Is(x.parsedValue).findIndex(H=>Ir.isDayjs(H)&&H.year()===U&&H.month()===j)>=0,R.today=G.getFullYear()===U&&G.getMonth()===j,T.inRange&&(R["in-range"]=!0,T.start&&(R["start-date"]=!0),T.end&&(R["end-date"]=!0)),R},w=T=>{const R=x.date.year(),U=T.text;return Is(x.date).findIndex(G=>G.year()===R&&G.month()===U)>=0},C=T=>{var R;if(!x.rangeState.selecting)return;let U=T.target;if(U.tagName==="SPAN"&&(U=(R=U.parentNode)==null?void 0:R.parentNode),U.tagName==="DIV"&&(U=U.parentNode),U.tagName!=="TD")return;const G=U.parentNode.rowIndex,j=U.cellIndex;v.value[G][j].disabled||(G!==p.value||j!==m.value)&&(p.value=G,m.value=j,a("changerange",{selecting:!0,endDate:x.date.startOf("year").month(G*4+j)}))},k=T=>{var R;const U=(R=T.target)==null?void 0:R.closest("td");if((U==null?void 0:U.tagName)!=="TD"||uh(U,"disabled"))return;const G=U.cellIndex,H=U.parentNode.rowIndex*4+G,W=x.date.startOf("year").month(H);if(x.selectionMode==="months"){if(T.type==="keydown"){a("pick",Is(x.parsedValue),!1);return}const K=x.date.startOf("month").month(H),$=uh(U,"current")?Is(x.parsedValue).filter(O=>Number(O)!==Number(K)):Is(x.parsedValue).concat([Ir(K)]);a("pick",$)}else x.selectionMode==="range"?x.rangeState.selecting?(x.minDate&&W>=x.minDate?a("pick",{minDate:x.minDate,maxDate:W}):a("pick",{minDate:W,maxDate:x.minDate}),a("select",!1)):(a("pick",{minDate:W,maxDate:null}),a("select",!0)):a("pick",H)};return s.watch(()=>x.date,async()=>{var T,R;(T=u.value)!=null&&T.contains(document.activeElement)&&(await s.nextTick(),(R=l.value)==null||R.focus())}),Q({focus:_}),(T,R)=>(s.openBlock(),s.createElementBlock("table",{role:"grid","aria-label":s.unref(h)("el.datepicker.monthTablePrompt"),class:s.normalizeClass(s.unref(A).b()),onClick:k,onMousemove:C},[s.createElementVNode("tbody",{ref_key:"tbodyRef",ref:u},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(v),(U,G)=>(s.openBlock(),s.createElementBlock("tr",{key:G},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U,(j,H)=>(s.openBlock(),s.createElementBlock("td",{key:H,ref_for:!0,ref:W=>w(j)&&(l.value=W),class:s.normalizeClass(b(j)),"aria-selected":`${w(j)}`,"aria-label":s.unref(h)(`el.datepicker.month${+j.text+1}`),tabindex:w(j)?0:-1,onKeydown:[s.withKeys(s.withModifiers(k,["prevent","stop"]),["space"]),s.withKeys(s.withModifiers(k,["prevent","stop"]),["enter"])]},[s.createVNode(s.unref(nA),{cell:{...j,renderText:s.unref(h)("el.datepicker.months."+c.value[j.text])}},null,8,["cell"])],42,["aria-selected","aria-label","tabindex","onKeydown"]))),128))]))),128))],512)],42,["aria-label"]))}}),[["__file","basic-month-table.vue"]]);const XO=ei({...qm,selectionMode:tA("year")});var aA=si(s.defineComponent({__name:"basic-year-table",props:XO,emits:["changerange","pick","select"],setup(N,{expose:Q,emit:a}){const x=N,S=(T,R)=>{const U=Ir(String(T)).locale(R).startOf("year"),j=U.endOf("year").dayOfYear();return g1(j).map(H=>U.add(H,"day").toDate())},A=Jr("year-table"),{t:h,lang:d}=es(),u=s.ref(),l=s.ref(),c=s.computed(()=>Math.floor(x.date.year()/10)*10),f=s.ref([[],[],[]]),p=s.ref(),m=s.ref(),v=s.computed(()=>{var T;const R=f.value,U=Ir().locale(d.value).startOf("year");for(let G=0;G<3;G++){const j=R[G];for(let H=0;H<4&&!(G*4+H>=10);H++){let W=j[H];W||(W={row:G,column:H,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1}),W.type="normal";const K=G*4+H+c.value,$=Ir().year(K),O=x.rangeState.endDate||x.maxDate||x.rangeState.selecting&&x.minDate||null;W.inRange=!!(x.minDate&&$.isSameOrAfter(x.minDate,"year")&&O&&$.isSameOrBefore(O,"year"))||!!(x.minDate&&$.isSameOrBefore(x.minDate,"year")&&O&&$.isSameOrAfter(O,"year")),(T=x.minDate)!=null&&T.isSameOrAfter(O)?(W.start=!!(O&&$.isSame(O,"year")),W.end=!!(x.minDate&&$.isSame(x.minDate,"year"))):(W.start=!!(x.minDate&&$.isSame(x.minDate,"year")),W.end=!!(O&&$.isSame(O,"year"))),U.isSame($)&&(W.type="today"),W.text=K;const M=$.toDate();W.disabled=x.disabledDate&&x.disabledDate(M)||!1,j[H]=W}}return R}),_=()=>{var T;(T=l.value)==null||T.focus()},b=T=>{const R={},U=Ir().locale(d.value),G=T.text;return R.disabled=x.disabledDate?S(G,d.value).every(x.disabledDate):!1,R.today=U.year()===G,R.current=Is(x.parsedValue).findIndex(j=>j.year()===G)>=0,T.inRange&&(R["in-range"]=!0,T.start&&(R["start-date"]=!0),T.end&&(R["end-date"]=!0)),R},w=T=>{const R=T.text;return Is(x.date).findIndex(U=>U.year()===R)>=0},C=T=>{var R;const U=(R=T.target)==null?void 0:R.closest("td");if(!U||!U.textContent||uh(U,"disabled"))return;const G=U.cellIndex,H=U.parentNode.rowIndex*4+G+c.value,W=Ir().year(H);if(x.selectionMode==="range")x.rangeState.selecting?(x.minDate&&W>=x.minDate?a("pick",{minDate:x.minDate,maxDate:W}):a("pick",{minDate:W,maxDate:x.minDate}),a("select",!1)):(a("pick",{minDate:W,maxDate:null}),a("select",!0));else if(x.selectionMode==="years"){if(T.type==="keydown"){a("pick",Is(x.parsedValue),!1);return}const K=uh(U,"current")?Is(x.parsedValue).filter($=>($==null?void 0:$.year())!==H):Is(x.parsedValue).concat([W]);a("pick",K)}else a("pick",H)},k=T=>{var R;if(!x.rangeState.selecting)return;const U=(R=T.target)==null?void 0:R.closest("td");if(!U)return;const G=U.parentNode.rowIndex,j=U.cellIndex;v.value[G][j].disabled||(G!==p.value||j!==m.value)&&(p.value=G,m.value=j,a("changerange",{selecting:!0,endDate:Ir().year(c.value).add(G*4+j,"year")}))};return s.watch(()=>x.date,async()=>{var T,R;(T=u.value)!=null&&T.contains(document.activeElement)&&(await s.nextTick(),(R=l.value)==null||R.focus())}),Q({focus:_}),(T,R)=>(s.openBlock(),s.createElementBlock("table",{role:"grid","aria-label":s.unref(h)("el.datepicker.yearTablePrompt"),class:s.normalizeClass(s.unref(A).b()),onClick:C,onMousemove:k},[s.createElementVNode("tbody",{ref_key:"tbodyRef",ref:u},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(v),(U,G)=>(s.openBlock(),s.createElementBlock("tr",{key:G},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U,(j,H)=>(s.openBlock(),s.createElementBlock("td",{key:`${G}_${H}`,ref_for:!0,ref:W=>w(j)&&(l.value=W),class:s.normalizeClass(["available",b(j)]),"aria-selected":w(j),"aria-label":String(j.text),tabindex:w(j)?0:-1,onKeydown:[s.withKeys(s.withModifiers(C,["prevent","stop"]),["space"]),s.withKeys(s.withModifiers(C,["prevent","stop"]),["enter"])]},[s.createVNode(s.unref(nA),{cell:j},null,8,["cell"])],42,["aria-selected","aria-label","tabindex","onKeydown"]))),128))]))),128))],512)],42,["aria-label"]))}}),[["__file","basic-year-table.vue"]]),YO=si(s.defineComponent({__name:"panel-date-pick",props:UO,emits:["pick","set-picker-option","panel-change"],setup(N,{emit:Q}){const a=N,x=(Xe,dt,at)=>!0,S=Jr("picker-panel"),A=Jr("date-picker"),h=s.useAttrs(),d=s.useSlots(),{t:u,lang:l}=es(),c=s.inject("EP_PICKER_BASE"),f=s.inject(_h),{shortcuts:p,disabledDate:m,cellClassName:v,defaultTime:_}=c.props,b=s.toRef(c.props,"defaultValue"),w=s.ref(),C=s.ref(Ir().locale(l.value)),k=s.ref(!1);let T=!1;const R=s.computed(()=>Ir(_).locale(l.value)),U=s.computed(()=>C.value.month()),G=s.computed(()=>C.value.year()),j=s.ref([]),H=s.ref(null),W=s.ref(null),K=Xe=>j.value.length>0?x(Xe,j.value,a.format||"HH:mm:ss"):!0,$=Xe=>_&&!B.value&&!k.value&&!T?R.value.year(Xe.year()).month(Xe.month()).date(Xe.date()):de.value?Xe.millisecond(0):Xe.startOf("day"),O=(Xe,...dt)=>{if(!Xe)Q("pick",Xe,...dt);else if(bi(Xe)){const at=Xe.map($);Q("pick",at,...dt)}else Q("pick",$(Xe),...dt);H.value=null,W.value=null,k.value=!1,T=!1},L=async(Xe,dt)=>{if(X.value==="date"){Xe=Xe;let at=a.parsedValue?a.parsedValue.year(Xe.year()).month(Xe.month()).date(Xe.date()):Xe;K(at)||(at=j.value[0][0].year(Xe.year()).month(Xe.month()).date(Xe.date())),C.value=at,O(at,de.value||dt),a.type==="datetime"&&(await s.nextTick(),ct())}else X.value==="week"?O(Xe.date):X.value==="dates"&&O(Xe,!0)},M=Xe=>{const dt=Xe?"add":"subtract";C.value=C.value[dt](1,"month"),Ze("month")},I=Xe=>{const dt=C.value,at=Xe?"add":"subtract";C.value=F.value==="year"?dt[at](10,"year"):dt[at](1,"year"),Ze("year")},F=s.ref("date"),V=s.computed(()=>{const Xe=u("el.datepicker.year");if(F.value==="year"){const dt=Math.floor(G.value/10)*10;return Xe?`${dt} ${Xe} - ${dt+9} ${Xe}`:`${dt} - ${dt+9}`}return`${G.value} ${Xe}`}),D=Xe=>{const dt=mn(Xe.value)?Xe.value():Xe.value;if(dt){T=!0,O(Ir(dt).locale(l.value));return}Xe.onClick&&Xe.onClick({attrs:h,slots:d,emit:Q})},X=s.computed(()=>{const{type:Xe}=a;return["week","month","months","year","years","dates"].includes(Xe)?Xe:"date"}),ee=s.computed(()=>X.value==="dates"||X.value==="months"||X.value==="years"),q=s.computed(()=>X.value==="date"?F.value:X.value),ne=s.computed(()=>!!p.length),oe=async(Xe,dt)=>{X.value==="month"?(C.value=C.value.startOf("month").month(Xe),O(C.value,!1)):X.value==="months"?O(Xe,dt??!0):(C.value=C.value.startOf("month").month(Xe),F.value="date",["month","year","date","week"].includes(X.value)&&(O(C.value,!0),await s.nextTick(),ct())),Ze("month")},he=async(Xe,dt)=>{X.value==="year"?(C.value=C.value.startOf("year").year(Xe),O(C.value,!1)):X.value==="years"?O(Xe,dt??!0):(C.value=C.value.year(Xe),F.value="month",["month","year","date","week"].includes(X.value)&&(O(C.value,!0),await s.nextTick(),ct())),Ze("year")},te=async Xe=>{F.value=Xe,await s.nextTick(),ct()},de=s.computed(()=>a.type==="datetime"||a.type==="datetimerange"),se=s.computed(()=>{const Xe=de.value||X.value==="dates",dt=X.value==="years",at=X.value==="months",ze=F.value==="date",Ke=F.value==="year",ut=F.value==="month";return Xe&&ze||dt&&Ke||at&&ut}),re=s.computed(()=>m?a.parsedValue?bi(a.parsedValue)?m(a.parsedValue[0].toDate()):m(a.parsedValue.toDate()):!0:!1),ae=()=>{if(ee.value)O(a.parsedValue);else{let Xe=a.parsedValue;if(!Xe){const dt=Ir(_).locale(l.value),at=ot();Xe=dt.year(at.year()).month(at.month()).date(at.date())}C.value=Xe,O(Xe)}},Ce=s.computed(()=>m?m(Ir().locale(l.value).toDate()):!1),me=()=>{const dt=Ir().locale(l.value).toDate();k.value=!0,(!m||!m(dt))&&K(dt)&&(C.value=Ir().locale(l.value),O(C.value))},ce=s.computed(()=>a.timeFormat||y1(a.format)),pe=s.computed(()=>a.dateFormat||v1(a.format)),B=s.computed(()=>{if(W.value)return W.value;if(!(!a.parsedValue&&!b.value))return(a.parsedValue||C.value).format(ce.value)}),ke=s.computed(()=>{if(H.value)return H.value;if(!(!a.parsedValue&&!b.value))return(a.parsedValue||C.value).format(pe.value)}),Ee=s.ref(!1),ge=()=>{Ee.value=!0},Ae=()=>{Ee.value=!1},fe=Xe=>({hour:Xe.hour(),minute:Xe.minute(),second:Xe.second(),year:Xe.year(),month:Xe.month(),date:Xe.date()}),ue=(Xe,dt,at)=>{const{hour:ze,minute:Ke,second:ut}=fe(Xe),yt=a.parsedValue?a.parsedValue.hour(ze).minute(Ke).second(ut):Xe;C.value=yt,O(C.value,!0),at||(Ee.value=dt)},_e=Xe=>{const dt=Ir(Xe,ce.value).locale(l.value);if(dt.isValid()&&K(dt)){const{year:at,month:ze,date:Ke}=fe(C.value);C.value=dt.year(at).month(ze).date(Ke),W.value=null,Ee.value=!1,O(C.value,!0)}},be=Xe=>{const dt=Ir(Xe,pe.value).locale(l.value);if(dt.isValid()){if(m&&m(dt.toDate()))return;const{hour:at,minute:ze,second:Ke}=fe(C.value);C.value=dt.hour(at).minute(ze).second(Ke),H.value=null,O(C.value,!0)}},De=Xe=>Ir.isDayjs(Xe)&&Xe.isValid()&&(m?!m(Xe.toDate()):!0),Je=Xe=>bi(Xe)?Xe.map(dt=>dt.format(a.format)):Xe.format(a.format),Qe=Xe=>Ir(Xe,a.format).locale(l.value),ot=()=>{const Xe=Ir(b.value).locale(l.value);if(!b.value){const dt=R.value;return Ir().hour(dt.hour()).minute(dt.minute()).second(dt.second()).locale(l.value)}return Xe},ct=async()=>{var Xe;["week","month","year","date"].includes(X.value)&&((Xe=w.value)==null||Xe.focus(),X.value==="week"&&it(Ii.down))},ht=Xe=>{const{code:dt}=Xe;[Ii.up,Ii.down,Ii.left,Ii.right,Ii.home,Ii.end,Ii.pageUp,Ii.pageDown].includes(dt)&&(it(dt),Xe.stopPropagation(),Xe.preventDefault()),[Ii.enter,Ii.space,Ii.numpadEnter].includes(dt)&&H.value===null&&W.value===null&&(Xe.preventDefault(),O(C.value,!1))},it=Xe=>{var dt;const{up:at,down:ze,left:Ke,right:ut,home:yt,end:Ne,pageUp:tt,pageDown:Pt}=Ii,Rt={year:{[at]:-4,[ze]:4,[Ke]:-1,[ut]:1,offset:(zt,tr)=>zt.setFullYear(zt.getFullYear()+tr)},month:{[at]:-4,[ze]:4,[Ke]:-1,[ut]:1,offset:(zt,tr)=>zt.setMonth(zt.getMonth()+tr)},week:{[at]:-1,[ze]:1,[Ke]:-1,[ut]:1,offset:(zt,tr)=>zt.setDate(zt.getDate()+tr*7)},date:{[at]:-7,[ze]:7,[Ke]:-1,[ut]:1,[yt]:zt=>-zt.getDay(),[Ne]:zt=>-zt.getDay()+6,[tt]:zt=>-new Date(zt.getFullYear(),zt.getMonth(),0).getDate(),[Pt]:zt=>new Date(zt.getFullYear(),zt.getMonth()+1,0).getDate(),offset:(zt,tr)=>zt.setDate(zt.getDate()+tr)}},Ht=C.value.toDate();for(;Math.abs(C.value.diff(Ht,"year",!0))<1;){const zt=Rt[q.value];if(!zt)return;if(zt.offset(Ht,mn(zt[Xe])?zt[Xe](Ht):(dt=zt[Xe])!=null?dt:0),m&&m(Ht))break;const tr=Ir(Ht).locale(l.value);C.value=tr,Q("pick",tr,!0);break}},Ze=Xe=>{Q("panel-change",C.value.toDate(),Xe,F.value)};return s.watch(()=>X.value,Xe=>{if(["month","year"].includes(Xe)){F.value=Xe;return}else if(Xe==="years"){F.value="year";return}else if(Xe==="months"){F.value="month";return}F.value="date"},{immediate:!0}),s.watch(()=>F.value,()=>{f==null||f.updatePopper()}),s.watch(()=>b.value,Xe=>{Xe&&(C.value=ot())},{immediate:!0}),s.watch(()=>a.parsedValue,Xe=>{if(Xe){if(ee.value||Array.isArray(Xe))return;C.value=Xe}else C.value=ot()},{immediate:!0}),Q("set-picker-option",["isValidValue",De]),Q("set-picker-option",["formatToString",Je]),Q("set-picker-option",["parseUserInput",Qe]),Q("set-picker-option",["handleFocusPicker",ct]),(Xe,dt)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(S).b(),s.unref(A).b(),{"has-sidebar":Xe.$slots.sidebar||s.unref(ne),"has-time":s.unref(de)}])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("body-wrapper"))},[s.renderSlot(Xe.$slots,"sidebar",{class:s.normalizeClass(s.unref(S).e("sidebar"))}),s.unref(ne)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(S).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(p),(at,ze)=>(s.openBlock(),s.createElementBlock("button",{key:ze,type:"button",class:s.normalizeClass(s.unref(S).e("shortcut")),onClick:Ke=>D(at)},s.toDisplayString(at.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("body"))},[s.unref(de)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(A).e("time-header"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(A).e("editor-wrap"))},[s.createVNode(s.unref(Sn),{placeholder:s.unref(u)("el.datepicker.selectDate"),"model-value":s.unref(ke),size:"small","validate-event":!1,onInput:at=>H.value=at,onChange:be},null,8,["placeholder","model-value","onInput"])],2),s.withDirectives((s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(s.unref(A).e("editor-wrap"))},[s.createVNode(s.unref(Sn),{placeholder:s.unref(u)("el.datepicker.selectTime"),"model-value":s.unref(B),size:"small","validate-event":!1,onFocus:ge,onInput:at=>W.value=at,onChange:_e},null,8,["placeholder","model-value","onInput"]),s.createVNode(s.unref(Ym),{visible:Ee.value,format:s.unref(ce),"parsed-value":C.value,onPick:ue},null,8,["visible","format","parsed-value"])],2)),[[s.unref(Eh),Ae]])],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass([s.unref(A).e("header"),(F.value==="year"||F.value==="month")&&s.unref(A).e("header--bordered")])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(A).e("prev-btn"))},[s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.prevYear"),class:s.normalizeClass(["d-arrow-left",s.unref(S).e("icon-btn")]),onClick:at=>I(!1)},[s.renderSlot(Xe.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["aria-label","onClick"]),s.withDirectives(s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.prevMonth"),class:s.normalizeClass([s.unref(S).e("icon-btn"),"arrow-left"]),onClick:at=>M(!1)},[s.renderSlot(Xe.$slots,"prev-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowLeft))]),_:1})])],10,["aria-label","onClick"]),[[s.vShow,F.value==="date"]])],2),s.createElementVNode("span",{role:"button",class:s.normalizeClass(s.unref(A).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:s.withKeys(at=>te("year"),["enter"]),onClick:at=>te("year")},s.toDisplayString(s.unref(V)),43,["onKeydown","onClick"]),s.withDirectives(s.createElementVNode("span",{role:"button","aria-live":"polite",tabindex:"0",class:s.normalizeClass([s.unref(A).e("header-label"),{active:F.value==="month"}]),onKeydown:s.withKeys(at=>te("month"),["enter"]),onClick:at=>te("month")},s.toDisplayString(s.unref(u)(`el.datepicker.month${s.unref(U)+1}`)),43,["onKeydown","onClick"]),[[s.vShow,F.value==="date"]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(A).e("next-btn"))},[s.withDirectives(s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.nextMonth"),class:s.normalizeClass([s.unref(S).e("icon-btn"),"arrow-right"]),onClick:at=>M(!0)},[s.renderSlot(Xe.$slots,"next-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})])],10,["aria-label","onClick"]),[[s.vShow,F.value==="date"]]),s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.nextYear"),class:s.normalizeClass([s.unref(S).e("icon-btn"),"d-arrow-right"]),onClick:at=>I(!0)},[s.renderSlot(Xe.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["aria-label","onClick"])],2)],2),[[s.vShow,F.value!=="time"]]),s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("content")),onKeydown:ht},[F.value==="date"?(s.openBlock(),s.createBlock(sA,{key:0,ref_key:"currentViewRef",ref:w,"selection-mode":s.unref(X),date:C.value,"parsed-value":Xe.parsedValue,"disabled-date":s.unref(m),"cell-class-name":s.unref(v),onPick:L},null,8,["selection-mode","date","parsed-value","disabled-date","cell-class-name"])):s.createCommentVNode("v-if",!0),F.value==="year"?(s.openBlock(),s.createBlock(aA,{key:1,ref_key:"currentViewRef",ref:w,"selection-mode":s.unref(X),date:C.value,"disabled-date":s.unref(m),"parsed-value":Xe.parsedValue,onPick:he},null,8,["selection-mode","date","disabled-date","parsed-value"])):s.createCommentVNode("v-if",!0),F.value==="month"?(s.openBlock(),s.createBlock(oA,{key:2,ref_key:"currentViewRef",ref:w,"selection-mode":s.unref(X),date:C.value,"parsed-value":Xe.parsedValue,"disabled-date":s.unref(m),onPick:oe},null,8,["selection-mode","date","parsed-value","disabled-date"])):s.createCommentVNode("v-if",!0)],34)],2)],2),s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("footer"))},[s.withDirectives(s.createVNode(s.unref(Ch),{text:"",size:"small",class:s.normalizeClass(s.unref(S).e("link-btn")),disabled:s.unref(Ce),onClick:me},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(u)("el.datepicker.now")),1)]),_:1},8,["class","disabled"]),[[s.vShow,!s.unref(ee)]]),s.createVNode(s.unref(Ch),{plain:"",size:"small",class:s.normalizeClass(s.unref(S).e("link-btn")),disabled:s.unref(re),onClick:ae},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(u)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled"])],2),[[s.vShow,s.unref(se)]])],2))}}),[["__file","panel-date-pick.vue"]]);const JO=ei({...$1,...eA,visible:Boolean}),K1=N=>{const{emit:Q}=s.getCurrentInstance(),a=s.useAttrs(),x=s.useSlots();return A=>{const h=mn(A.value)?A.value():A.value;if(h){Q("pick",[Ir(h[0]).locale(N.value),Ir(h[1]).locale(N.value)]);return}A.onClick&&A.onClick({attrs:a,slots:x,emit:Q})}},X1=(N,{defaultValue:Q,leftDate:a,rightDate:x,unit:S,onParsedValueChanged:A})=>{const{emit:h}=s.getCurrentInstance(),{pickerNs:d}=s.inject(Ph),u=Jr("date-range-picker"),{t:l,lang:c}=es(),f=K1(c),p=s.ref(),m=s.ref(),v=s.ref({endDate:null,selecting:!1}),_=T=>{v.value=T},b=(T=!1)=>{const R=s.unref(p),U=s.unref(m);hc([R,U])&&h("pick",[R,U],T)},w=T=>{v.value.selecting=T,T||(v.value.endDate=null)},C=T=>{if(bi(T)&&T.length===2){const[R,U]=T;p.value=R,a.value=R,m.value=U,A(s.unref(p),s.unref(m))}else k()},k=()=>{const[T,R]=rA(s.unref(Q),{lang:s.unref(c),unit:S,unlinkPanels:N.unlinkPanels});p.value=void 0,m.value=void 0,a.value=T,x.value=R};return s.watch(Q,T=>{T&&k()},{immediate:!0}),s.watch(()=>N.parsedValue,C,{immediate:!0}),{minDate:p,maxDate:m,rangeState:v,lang:c,ppNs:d,drpNs:u,handleChangeRange:_,handleRangeConfirm:b,handleShortcutClick:f,onSelect:w,onReset:C,t:l}},Sh="month";var ZO=si(s.defineComponent({__name:"panel-date-range",props:JO,emits:["pick","set-picker-option","calendar-change","panel-change"],setup(N,{emit:Q}){const a=N,x=s.inject("EP_PICKER_BASE"),{disabledDate:S,cellClassName:A,defaultTime:h,clearable:d}=x.props,u=s.toRef(x.props,"format"),l=s.toRef(x.props,"shortcuts"),c=s.toRef(x.props,"defaultValue"),{lang:f}=es(),p=s.ref(Ir().locale(f.value)),m=s.ref(Ir().locale(f.value).add(1,Sh)),{minDate:v,maxDate:_,rangeState:b,ppNs:w,drpNs:C,handleChangeRange:k,handleRangeConfirm:T,handleShortcutClick:R,onSelect:U,onReset:G,t:j}=X1(a,{defaultValue:c,leftDate:p,rightDate:m,unit:Sh,onParsedValueChanged:dt});s.watch(()=>a.visible,at=>{!at&&b.value.selecting&&(G(a.parsedValue),U(!1))});const H=s.ref({min:null,max:null}),W=s.ref({min:null,max:null}),K=s.computed(()=>`${p.value.year()} ${j("el.datepicker.year")} ${j(`el.datepicker.month${p.value.month()+1}`)}`),$=s.computed(()=>`${m.value.year()} ${j("el.datepicker.year")} ${j(`el.datepicker.month${m.value.month()+1}`)}`),O=s.computed(()=>p.value.year()),L=s.computed(()=>p.value.month()),M=s.computed(()=>m.value.year()),I=s.computed(()=>m.value.month()),F=s.computed(()=>!!l.value.length),V=s.computed(()=>H.value.min!==null?H.value.min:v.value?v.value.format(ne.value):""),D=s.computed(()=>H.value.max!==null?H.value.max:_.value||v.value?(_.value||v.value).format(ne.value):""),X=s.computed(()=>W.value.min!==null?W.value.min:v.value?v.value.format(q.value):""),ee=s.computed(()=>W.value.max!==null?W.value.max:_.value||v.value?(_.value||v.value).format(q.value):""),q=s.computed(()=>a.timeFormat||y1(u.value)),ne=s.computed(()=>a.dateFormat||v1(u.value)),oe=at=>hc(at)&&(S?!S(at[0].toDate())&&!S(at[1].toDate()):!0),he=()=>{p.value=p.value.subtract(1,"year"),a.unlinkPanels||(m.value=p.value.add(1,"month")),ce("year")},te=()=>{p.value=p.value.subtract(1,"month"),a.unlinkPanels||(m.value=p.value.add(1,"month")),ce("month")},de=()=>{a.unlinkPanels?m.value=m.value.add(1,"year"):(p.value=p.value.add(1,"year"),m.value=p.value.add(1,"month")),ce("year")},se=()=>{a.unlinkPanels?m.value=m.value.add(1,"month"):(p.value=p.value.add(1,"month"),m.value=p.value.add(1,"month")),ce("month")},re=()=>{p.value=p.value.add(1,"year"),ce("year")},ae=()=>{p.value=p.value.add(1,"month"),ce("month")},Ce=()=>{m.value=m.value.subtract(1,"year"),ce("year")},me=()=>{m.value=m.value.subtract(1,"month"),ce("month")},ce=at=>{Q("panel-change",[p.value.toDate(),m.value.toDate()],at)},pe=s.computed(()=>{const at=(L.value+1)%12,ze=L.value+1>=12?1:0;return a.unlinkPanels&&new Date(O.value+ze,at)<new Date(M.value,I.value)}),B=s.computed(()=>a.unlinkPanels&&M.value*12+I.value-(O.value*12+L.value+1)>=12),ke=s.computed(()=>!(v.value&&_.value&&!b.value.selecting&&hc([v.value,_.value]))),Ee=s.computed(()=>a.type==="datetime"||a.type==="datetimerange"),ge=(at,ze)=>{if(at)return h?Ir(h[ze]||h).locale(f.value).year(at.year()).month(at.month()).date(at.date()):at},Ae=(at,ze=!0)=>{const Ke=at.minDate,ut=at.maxDate,yt=ge(Ke,0),Ne=ge(ut,1);_.value===Ne&&v.value===yt||(Q("calendar-change",[Ke.toDate(),ut&&ut.toDate()]),_.value=Ne,v.value=yt,!(!ze||Ee.value)&&T())},fe=s.ref(!1),ue=s.ref(!1),_e=()=>{fe.value=!1},be=()=>{ue.value=!1},De=(at,ze)=>{H.value[ze]=at;const Ke=Ir(at,ne.value).locale(f.value);if(Ke.isValid()){if(S&&S(Ke.toDate()))return;ze==="min"?(p.value=Ke,v.value=(v.value||p.value).year(Ke.year()).month(Ke.month()).date(Ke.date()),!a.unlinkPanels&&(!_.value||_.value.isBefore(v.value))&&(m.value=Ke.add(1,"month"),_.value=v.value.add(1,"month"))):(m.value=Ke,_.value=(_.value||m.value).year(Ke.year()).month(Ke.month()).date(Ke.date()),!a.unlinkPanels&&(!v.value||v.value.isAfter(_.value))&&(p.value=Ke.subtract(1,"month"),v.value=_.value.subtract(1,"month")))}},Je=(at,ze)=>{H.value[ze]=null},Qe=(at,ze)=>{W.value[ze]=at;const Ke=Ir(at,q.value).locale(f.value);Ke.isValid()&&(ze==="min"?(fe.value=!0,v.value=(v.value||p.value).hour(Ke.hour()).minute(Ke.minute()).second(Ke.second())):(ue.value=!0,_.value=(_.value||m.value).hour(Ke.hour()).minute(Ke.minute()).second(Ke.second()),m.value=_.value))},ot=(at,ze)=>{W.value[ze]=null,ze==="min"?(p.value=v.value,fe.value=!1,(!_.value||_.value.isBefore(v.value))&&(_.value=v.value)):(m.value=_.value,ue.value=!1,_.value&&_.value.isBefore(v.value)&&(v.value=_.value))},ct=(at,ze,Ke)=>{W.value.min||(at&&(p.value=at,v.value=(v.value||p.value).hour(at.hour()).minute(at.minute()).second(at.second())),Ke||(fe.value=ze),(!_.value||_.value.isBefore(v.value))&&(_.value=v.value,m.value=at))},ht=(at,ze,Ke)=>{W.value.max||(at&&(m.value=at,_.value=(_.value||m.value).hour(at.hour()).minute(at.minute()).second(at.second())),Ke||(ue.value=ze),_.value&&_.value.isBefore(v.value)&&(v.value=_.value))},it=()=>{p.value=rA(s.unref(c),{lang:s.unref(f),unit:"month",unlinkPanels:a.unlinkPanels})[0],m.value=p.value.add(1,"month"),_.value=void 0,v.value=void 0,Q("pick",null)},Ze=at=>bi(at)?at.map(ze=>ze.format(u.value)):at.format(u.value),Xe=at=>bi(at)?at.map(ze=>Ir(ze,u.value).locale(f.value)):Ir(at,u.value).locale(f.value);function dt(at,ze){if(a.unlinkPanels&&ze){const Ke=(at==null?void 0:at.year())||0,ut=(at==null?void 0:at.month())||0,yt=ze.year(),Ne=ze.month();m.value=Ke===yt&&ut===Ne?ze.add(1,Sh):ze}else m.value=p.value.add(1,Sh),ze&&(m.value=m.value.hour(ze.hour()).minute(ze.minute()).second(ze.second()))}return Q("set-picker-option",["isValidValue",oe]),Q("set-picker-option",["parseUserInput",Xe]),Q("set-picker-option",["formatToString",Ze]),Q("set-picker-option",["handleClear",it]),(at,ze)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(w).b(),s.unref(C).b(),{"has-sidebar":at.$slots.sidebar||s.unref(F),"has-time":s.unref(Ee)}])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(w).e("body-wrapper"))},[s.renderSlot(at.$slots,"sidebar",{class:s.normalizeClass(s.unref(w).e("sidebar"))}),s.unref(F)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(w).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(l),(Ke,ut)=>(s.openBlock(),s.createElementBlock("button",{key:ut,type:"button",class:s.normalizeClass(s.unref(w).e("shortcut")),onClick:yt=>s.unref(R)(Ke)},s.toDisplayString(Ke.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(w).e("body"))},[s.unref(Ee)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(C).e("time-header"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(C).e("editors-wrap"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.startDate"),class:s.normalizeClass(s.unref(C).e("editor")),"model-value":s.unref(V),"validate-event":!1,onInput:Ke=>De(Ke,"min"),onChange:Ke=>Je(Ke,"min")},null,8,["disabled","placeholder","class","model-value","onInput","onChange"])],2),s.withDirectives((s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",class:s.normalizeClass(s.unref(C).e("editor")),disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.startTime"),"model-value":s.unref(X),"validate-event":!1,onFocus:Ke=>fe.value=!0,onInput:Ke=>Qe(Ke,"min"),onChange:Ke=>ot(Ke,"min")},null,8,["class","disabled","placeholder","model-value","onFocus","onInput","onChange"]),s.createVNode(s.unref(Ym),{visible:fe.value,format:s.unref(q),"datetime-role":"start","parsed-value":p.value,onPick:ct},null,8,["visible","format","parsed-value"])],2)),[[s.unref(Eh),_e]])],2),s.createElementVNode("span",null,[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})]),s.createElementVNode("span",{class:s.normalizeClass([s.unref(C).e("editors-wrap"),"is-right"])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",class:s.normalizeClass(s.unref(C).e("editor")),disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.endDate"),"model-value":s.unref(D),readonly:!s.unref(v),"validate-event":!1,onInput:Ke=>De(Ke,"max"),onChange:Ke=>Je(Ke,"max")},null,8,["class","disabled","placeholder","model-value","readonly","onInput","onChange"])],2),s.withDirectives((s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",class:s.normalizeClass(s.unref(C).e("editor")),disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.endTime"),"model-value":s.unref(ee),readonly:!s.unref(v),"validate-event":!1,onFocus:Ke=>s.unref(v)&&(ue.value=!0),onInput:Ke=>Qe(Ke,"max"),onChange:Ke=>ot(Ke,"max")},null,8,["class","disabled","placeholder","model-value","readonly","onFocus","onInput","onChange"]),s.createVNode(s.unref(Ym),{"datetime-role":"end",visible:ue.value,format:s.unref(q),"parsed-value":m.value,onPick:ht},null,8,["visible","format","parsed-value"])],2)),[[s.unref(Eh),be]])],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass([[s.unref(w).e("content"),s.unref(C).e("content")],"is-left"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(C).e("header"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(w).e("icon-btn"),"d-arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevYear"),onClick:he},[s.renderSlot(at.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["aria-label"]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(w).e("icon-btn"),"arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevMonth"),onClick:te},[s.renderSlot(at.$slots,"prev-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowLeft))]),_:1})])],10,["aria-label"]),at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(B),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(B)}],"d-arrow-right"]),"aria-label":s.unref(j)("el.datepicker.nextYear"),onClick:re},[s.renderSlot(at.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",disabled:!s.unref(pe),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(pe)}],"arrow-right"]),"aria-label":s.unref(j)("el.datepicker.nextMonth"),onClick:ae},[s.renderSlot(at.$slots,"next-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",null,s.toDisplayString(s.unref(K)),1)],2),s.createVNode(sA,{"selection-mode":"range",date:p.value,"min-date":s.unref(v),"max-date":s.unref(_),"range-state":s.unref(b),"disabled-date":s.unref(S),"cell-class-name":s.unref(A),onChangerange:s.unref(k),onPick:Ae,onSelect:s.unref(U)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2),s.createElementVNode("div",{class:s.normalizeClass([[s.unref(w).e("content"),s.unref(C).e("content")],"is-right"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(C).e("header"))},[at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(B),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(B)}],"d-arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevYear"),onClick:Ce},[s.renderSlot(at.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",disabled:!s.unref(pe),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(pe)}],"arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevMonth"),onClick:me},[s.renderSlot(at.$slots,"prev-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowLeft))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button","aria-label":s.unref(j)("el.datepicker.nextYear"),class:s.normalizeClass([s.unref(w).e("icon-btn"),"d-arrow-right"]),onClick:de},[s.renderSlot(at.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["aria-label"]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(w).e("icon-btn"),"arrow-right"]),"aria-label":s.unref(j)("el.datepicker.nextMonth"),onClick:se},[s.renderSlot(at.$slots,"next-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})])],10,["aria-label"]),s.createElementVNode("div",null,s.toDisplayString(s.unref($)),1)],2),s.createVNode(sA,{"selection-mode":"range",date:m.value,"min-date":s.unref(v),"max-date":s.unref(_),"range-state":s.unref(b),"disabled-date":s.unref(S),"cell-class-name":s.unref(A),onChangerange:s.unref(k),onPick:Ae,onSelect:s.unref(U)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2)],2)],2),s.unref(Ee)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(w).e("footer"))},[s.unref(d)?(s.openBlock(),s.createBlock(s.unref(Ch),{key:0,text:"",size:"small",class:s.normalizeClass(s.unref(w).e("link-btn")),onClick:it},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(j)("el.datepicker.clear")),1)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(s.unref(Ch),{plain:"",size:"small",class:s.normalizeClass(s.unref(w).e("link-btn")),disabled:s.unref(ke),onClick:Ke=>s.unref(T)(!1)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(j)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled","onClick"])],2)):s.createCommentVNode("v-if",!0)],2))}}),[["__file","panel-date-range.vue"]]);const qO=ei({...eA}),eN=["pick","set-picker-option","calendar-change"],tN=({unlinkPanels:N,leftDate:Q,rightDate:a})=>{const{t:x}=es(),S=()=>{Q.value=Q.value.subtract(1,"year"),N.value||(a.value=a.value.subtract(1,"year"))},A=()=>{N.value||(Q.value=Q.value.add(1,"year")),a.value=a.value.add(1,"year")},h=()=>{Q.value=Q.value.add(1,"year")},d=()=>{a.value=a.value.subtract(1,"year")},u=s.computed(()=>`${Q.value.year()} ${x("el.datepicker.year")}`),l=s.computed(()=>`${a.value.year()} ${x("el.datepicker.year")}`),c=s.computed(()=>Q.value.year()),f=s.computed(()=>a.value.year()===Q.value.year()?Q.value.year()+1:a.value.year());return{leftPrevYear:S,rightNextYear:A,leftNextYear:h,rightPrevYear:d,leftLabel:u,rightLabel:l,leftYear:c,rightYear:f}},kh="year",rN=s.defineComponent({name:"DatePickerMonthRange"}),iN=s.defineComponent({...rN,props:qO,emits:eN,setup(N,{emit:Q}){const a=N,{lang:x}=es(),S=s.inject("EP_PICKER_BASE"),{shortcuts:A,disabledDate:h}=S.props,d=s.toRef(S.props,"format"),u=s.toRef(S.props,"defaultValue"),l=s.ref(Ir().locale(x.value)),c=s.ref(Ir().locale(x.value).add(1,kh)),{minDate:f,maxDate:p,rangeState:m,ppNs:v,drpNs:_,handleChangeRange:b,handleRangeConfirm:w,handleShortcutClick:C,onSelect:k}=X1(a,{defaultValue:u,leftDate:l,rightDate:c,unit:kh,onParsedValueChanged:V}),T=s.computed(()=>!!A.length),{leftPrevYear:R,rightNextYear:U,leftNextYear:G,rightPrevYear:j,leftLabel:H,rightLabel:W,leftYear:K,rightYear:$}=tN({unlinkPanels:s.toRef(a,"unlinkPanels"),leftDate:l,rightDate:c}),O=s.computed(()=>a.unlinkPanels&&$.value>K.value+1),L=(D,X=!0)=>{const ee=D.minDate,q=D.maxDate;p.value===q&&f.value===ee||(Q("calendar-change",[ee.toDate(),q&&q.toDate()]),p.value=q,f.value=ee,X&&w())},M=()=>{l.value=rA(s.unref(u),{lang:s.unref(x),unit:"year",unlinkPanels:a.unlinkPanels})[0],c.value=l.value.add(1,"year"),Q("pick",null)},I=D=>bi(D)?D.map(X=>X.format(d.value)):D.format(d.value),F=D=>bi(D)?D.map(X=>Ir(X,d.value).locale(x.value)):Ir(D,d.value).locale(x.value);function V(D,X){if(a.unlinkPanels&&X){const ee=(D==null?void 0:D.year())||0,q=X.year();c.value=ee===q?X.add(1,kh):X}else c.value=l.value.add(1,kh)}return Q("set-picker-option",["isValidValue",hc]),Q("set-picker-option",["formatToString",I]),Q("set-picker-option",["parseUserInput",F]),Q("set-picker-option",["handleClear",M]),(D,X)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(v).b(),s.unref(_).b(),{"has-sidebar":!!D.$slots.sidebar||s.unref(T)}])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(v).e("body-wrapper"))},[s.renderSlot(D.$slots,"sidebar",{class:s.normalizeClass(s.unref(v).e("sidebar"))}),s.unref(T)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(v).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(A),(ee,q)=>(s.openBlock(),s.createElementBlock("button",{key:q,type:"button",class:s.normalizeClass(s.unref(v).e("shortcut")),onClick:ne=>s.unref(C)(ee)},s.toDisplayString(ee.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(v).e("body"))},[s.createElementVNode("div",{class:s.normalizeClass([[s.unref(v).e("content"),s.unref(_).e("content")],"is-left"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(_).e("header"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(v).e("icon-btn"),"d-arrow-left"]),onClick:s.unref(R)},[s.renderSlot(D.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["onClick"]),D.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(O),class:s.normalizeClass([[s.unref(v).e("icon-btn"),{[s.unref(v).is("disabled")]:!s.unref(O)}],"d-arrow-right"]),onClick:s.unref(G)},[s.renderSlot(D.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",null,s.toDisplayString(s.unref(H)),1)],2),s.createVNode(oA,{"selection-mode":"range",date:l.value,"min-date":s.unref(f),"max-date":s.unref(p),"range-state":s.unref(m),"disabled-date":s.unref(h),onChangerange:s.unref(b),onPick:L,onSelect:s.unref(k)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2),s.createElementVNode("div",{class:s.normalizeClass([[s.unref(v).e("content"),s.unref(_).e("content")],"is-right"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(_).e("header"))},[D.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(O),class:s.normalizeClass([[s.unref(v).e("icon-btn"),{"is-disabled":!s.unref(O)}],"d-arrow-left"]),onClick:s.unref(j)},[s.renderSlot(D.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(v).e("icon-btn"),"d-arrow-right"]),onClick:s.unref(U)},[s.renderSlot(D.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["onClick"]),s.createElementVNode("div",null,s.toDisplayString(s.unref(W)),1)],2),s.createVNode(oA,{"selection-mode":"range",date:c.value,"min-date":s.unref(f),"max-date":s.unref(p),"range-state":s.unref(m),"disabled-date":s.unref(h),onChangerange:s.unref(b),onPick:L,onSelect:s.unref(k)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2)],2)],2)],2))}});var nN=si(iN,[["__file","panel-month-range.vue"]]);const sN=ei({...eA}),oN=["pick","set-picker-option","calendar-change"],aN=({unlinkPanels:N,leftDate:Q,rightDate:a})=>{const x=()=>{Q.value=Q.value.subtract(10,"year"),N.value||(a.value=a.value.subtract(10,"year"))},S=()=>{N.value||(Q.value=Q.value.add(10,"year")),a.value=a.value.add(10,"year")},A=()=>{Q.value=Q.value.add(10,"year")},h=()=>{a.value=a.value.subtract(10,"year")},d=s.computed(()=>{const f=Math.floor(Q.value.year()/10)*10;return`${f}-${f+9}`}),u=s.computed(()=>{const f=Math.floor(a.value.year()/10)*10;return`${f}-${f+9}`}),l=s.computed(()=>Math.floor(Q.value.year()/10)*10+9),c=s.computed(()=>Math.floor(a.value.year()/10)*10);return{leftPrevYear:x,rightNextYear:S,leftNextYear:A,rightPrevYear:h,leftLabel:d,rightLabel:u,leftYear:l,rightYear:c}},Y1="year",lN=s.defineComponent({name:"DatePickerYearRange"}),cN=s.defineComponent({...lN,props:sN,emits:oN,setup(N,{emit:Q}){const a=N,{lang:x}=es(),S=s.ref(Ir().locale(x.value)),A=s.ref(S.value.add(10,"year")),{pickerNs:h}=s.inject(Ph),d=Jr("date-range-picker"),u=s.computed(()=>!!L.length),l=s.computed(()=>[h.b(),d.b(),{"has-sidebar":!!s.useSlots().sidebar||u.value}]),c=s.computed(()=>({content:[h.e("content"),d.e("content"),"is-left"],arrowLeftBtn:[h.e("icon-btn"),"d-arrow-left"],arrowRightBtn:[h.e("icon-btn"),{[h.is("disabled")]:!R.value},"d-arrow-right"]})),f=s.computed(()=>({content:[h.e("content"),d.e("content"),"is-right"],arrowLeftBtn:[h.e("icon-btn"),{"is-disabled":!R.value},"d-arrow-left"],arrowRightBtn:[h.e("icon-btn"),"d-arrow-right"]})),p=K1(x),{leftPrevYear:m,rightNextYear:v,leftNextYear:_,rightPrevYear:b,leftLabel:w,rightLabel:C,leftYear:k,rightYear:T}=aN({unlinkPanels:s.toRef(a,"unlinkPanels"),leftDate:S,rightDate:A}),R=s.computed(()=>a.unlinkPanels&&T.value>k.value+1),U=s.ref(),G=s.ref(),j=s.ref({endDate:null,selecting:!1}),H=ne=>{j.value=ne},W=(ne,oe=!0)=>{const he=ne.minDate,te=ne.maxDate;G.value===te&&U.value===he||(Q("calendar-change",[he.toDate(),te&&te.toDate()]),G.value=te,U.value=he,oe&&K())},K=(ne=!1)=>{hc([U.value,G.value])&&Q("pick",[U.value,G.value],ne)},$=ne=>{j.value.selecting=ne,ne||(j.value.endDate=null)},O=s.inject("EP_PICKER_BASE"),{shortcuts:L,disabledDate:M}=O.props,I=s.toRef(O.props,"format"),F=s.toRef(O.props,"defaultValue"),V=()=>{let ne;if(bi(F.value)){const oe=Ir(F.value[0]);let he=Ir(F.value[1]);return a.unlinkPanels||(he=oe.add(10,Y1)),[oe,he]}else F.value?ne=Ir(F.value):ne=Ir();return ne=ne.locale(x.value),[ne,ne.add(10,Y1)]};s.watch(()=>F.value,ne=>{if(ne){const oe=V();S.value=oe[0],A.value=oe[1]}},{immediate:!0}),s.watch(()=>a.parsedValue,ne=>{if(ne&&ne.length===2)if(U.value=ne[0],G.value=ne[1],S.value=U.value,a.unlinkPanels&&G.value){const oe=U.value.year(),he=G.value.year();A.value=oe===he?G.value.add(10,"year"):G.value}else A.value=S.value.add(10,"year");else{const oe=V();U.value=void 0,G.value=void 0,S.value=oe[0],A.value=oe[1]}},{immediate:!0});const D=ne=>bi(ne)?ne.map(oe=>Ir(oe,I.value).locale(x.value)):Ir(ne,I.value).locale(x.value),X=ne=>bi(ne)?ne.map(oe=>oe.format(I.value)):ne.format(I.value),ee=ne=>hc(ne)&&(M?!M(ne[0].toDate())&&!M(ne[1].toDate()):!0),q=()=>{const ne=V();S.value=ne[0],A.value=ne[1],G.value=void 0,U.value=void 0,Q("pick",null)};return Q("set-picker-option",["isValidValue",ee]),Q("set-picker-option",["parseUserInput",D]),Q("set-picker-option",["formatToString",X]),Q("set-picker-option",["handleClear",q]),(ne,oe)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(l))},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(h).e("body-wrapper"))},[s.renderSlot(ne.$slots,"sidebar",{class:s.normalizeClass(s.unref(h).e("sidebar"))}),s.unref(u)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(h).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(L),(he,te)=>(s.openBlock(),s.createElementBlock("button",{key:te,type:"button",class:s.normalizeClass(s.unref(h).e("shortcut")),onClick:de=>s.unref(p)(he)},s.toDisplayString(he.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(h).e("body"))},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(c).content)},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(d).e("header"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(s.unref(c).arrowLeftBtn),onClick:s.unref(m)},[s.renderSlot(ne.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["onClick"]),ne.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(R),class:s.normalizeClass(s.unref(c).arrowRightBtn),onClick:s.unref(_)},[s.renderSlot(ne.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",null,s.toDisplayString(s.unref(w)),1)],2),s.createVNode(aA,{"selection-mode":"range",date:S.value,"min-date":U.value,"max-date":G.value,"range-state":j.value,"disabled-date":s.unref(M),onChangerange:H,onPick:W,onSelect:$},null,8,["date","min-date","max-date","range-state","disabled-date"])],2),s.createElementVNode("div",{class:s.normalizeClass(s.unref(f).content)},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(d).e("header"))},[ne.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(R),class:s.normalizeClass(s.unref(f).arrowLeftBtn),onClick:s.unref(b)},[s.renderSlot(ne.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass(s.unref(f).arrowRightBtn),onClick:s.unref(v)},[s.renderSlot(ne.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["onClick"]),s.createElementVNode("div",null,s.toDisplayString(s.unref(C)),1)],2),s.createVNode(aA,{"selection-mode":"range",date:A.value,"min-date":U.value,"max-date":G.value,"range-state":j.value,"disabled-date":s.unref(M),onChangerange:H,onPick:W,onSelect:$},null,8,["date","min-date","max-date","range-state","disabled-date"])],2)],2)],2)],2))}});var uN=si(cN,[["__file","panel-year-range.vue"]]);const dN=function(N){switch(N){case"daterange":case"datetimerange":return ZO;case"monthrange":return nN;case"yearrange":return uN;default:return YO}};Ir.extend(QR),Ir.extend(SO),Ir.extend(MR),Ir.extend(MO),Ir.extend(IO),Ir.extend(FO),Ir.extend(OO),Ir.extend(LO);var hN=s.defineComponent({name:"ElDatePicker",install:null,props:jO,emits:["update:modelValue"],setup(N,{expose:Q,emit:a,slots:x}){const S=Jr("picker-panel");s.provide("ElPopperOptions",s.reactive(s.toRef(N,"popperOptions"))),s.provide(Ph,{slots:x,pickerNs:S});const A=s.ref();Q({focus:(u=!0)=>{var l;(l=A.value)==null||l.focus(u)},handleOpen:()=>{var u;(u=A.value)==null||u.handleOpen()},handleClose:()=>{var u;(u=A.value)==null||u.handleClose()}});const d=u=>{a("update:modelValue",u)};return()=>{var u;const l=(u=N.format)!=null?u:TR[N.type]||uc,c=dN(N.type);return s.createVNode(RR,s.mergeProps(N,{format:l,type:N.type,ref:A,"onUpdate:modelValue":d}),{default:f=>s.createVNode(c,f,{"prev-month":x["prev-month"],"next-month":x["next-month"],"prev-year":x["prev-year"],"next-year":x["next-year"]}),"range-separator":x["range-separator"]})}}});const fc=Gn(hN),fN=ei({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:po,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:N=>N===null||Ri(N)||["min","max"].includes(N),default:null},name:String,placeholder:String,precision:{type:Number,validator:N=>N>=0&&N===Number.parseInt(`${N}`,10)},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),pN={[Mo]:(N,Q)=>Q!==N,blur:N=>N instanceof FocusEvent,focus:N=>N instanceof FocusEvent,[To]:N=>Ri(N)||ko(N),[Wi]:N=>Ri(N)||ko(N)},mN=s.defineComponent({name:"ElInputNumber"}),AN=s.defineComponent({...mN,props:fN,emits:pN,setup(N,{expose:Q,emit:a}){const x=N,{t:S}=es(),A=Jr("input-number"),h=s.ref(),d=s.reactive({currentValue:x.modelValue,userInput:null}),{formItem:u}=Ao(),l=s.computed(()=>Ri(x.modelValue)&&x.modelValue<=x.min),c=s.computed(()=>Ri(x.modelValue)&&x.modelValue>=x.max),f=s.computed(()=>{const M=w(x.step);return Ts(x.precision)?Math.max(w(x.modelValue),M):(M>x.precision&&Ki("InputNumber","precision should not be less than the decimal places of step"),x.precision)}),p=s.computed(()=>x.controls&&x.controlsPosition==="right"),m=mo(),v=gl(),_=s.computed(()=>{if(d.userInput!==null)return d.userInput;let M=d.currentValue;if(ko(M))return"";if(Ri(M)){if(Number.isNaN(M))return"";Ts(x.precision)||(M=M.toFixed(x.precision))}return M}),b=(M,I)=>{if(Ts(I)&&(I=f.value),I===0)return Math.round(M);let F=String(M);const V=F.indexOf(".");if(V===-1||!F.replace(".","").split("")[V+I])return M;const ee=F.length;return F.charAt(ee-1)==="5"&&(F=`${F.slice(0,Math.max(0,ee-1))}6`),Number.parseFloat(Number(F).toFixed(I))},w=M=>{if(ko(M))return 0;const I=M.toString(),F=I.indexOf(".");let V=0;return F!==-1&&(V=I.length-F-1),V},C=(M,I=1)=>Ri(M)?b(M+x.step*I):d.currentValue,k=()=>{if(x.readonly||v.value||c.value)return;const M=Number(_.value)||0,I=C(M);U(I),a(To,d.currentValue),O()},T=()=>{if(x.readonly||v.value||l.value)return;const M=Number(_.value)||0,I=C(M,-1);U(I),a(To,d.currentValue),O()},R=(M,I)=>{const{max:F,min:V,step:D,precision:X,stepStrictly:ee,valueOnClear:q}=x;F<V&&ch("InputNumber","min should not be greater than max.");let ne=Number(M);if(ko(M)||Number.isNaN(ne))return null;if(M===""){if(q===null)return null;ne=Dn(q)?{min:V,max:F}[q]:q}return ee&&(ne=b(Math.round(ne/D)*D,X)),Ts(X)||(ne=b(ne,X)),(ne>F||ne<V)&&(ne=ne>F?F:V,I&&a(Wi,ne)),ne},U=(M,I=!0)=>{var F;const V=d.currentValue,D=R(M);if(!I){a(Wi,D);return}V===D&&M||(d.userInput=null,a(Wi,D),V!==D&&a(Mo,D,V),x.validateEvent&&((F=u==null?void 0:u.validate)==null||F.call(u,"change").catch(X=>Ki(X))),d.currentValue=D)},G=M=>{d.userInput=M;const I=M===""?null:Number(M);a(To,I),U(I,!1)},j=M=>{const I=M!==""?Number(M):"";(Ri(I)&&!Number.isNaN(I)||M==="")&&U(I),O(),d.userInput=null},H=()=>{var M,I;(I=(M=h.value)==null?void 0:M.focus)==null||I.call(M)},W=()=>{var M,I;(I=(M=h.value)==null?void 0:M.blur)==null||I.call(M)},K=M=>{a("focus",M)},$=M=>{var I;d.userInput=null,a("blur",M),x.validateEvent&&((I=u==null?void 0:u.validate)==null||I.call(u,"blur").catch(F=>Ki(F)))},O=()=>{d.currentValue!==x.modelValue&&(d.currentValue=x.modelValue)},L=M=>{document.activeElement===M.target&&M.preventDefault()};return s.watch(()=>x.modelValue,(M,I)=>{const F=R(M,!0);d.userInput===null&&F!==I&&(d.currentValue=F)},{immediate:!0}),s.onMounted(()=>{var M;const{min:I,max:F,modelValue:V}=x,D=(M=h.value)==null?void 0:M.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(F)?D.setAttribute("aria-valuemax",String(F)):D.removeAttribute("aria-valuemax"),Number.isFinite(I)?D.setAttribute("aria-valuemin",String(I)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",d.currentValue||d.currentValue===0?String(d.currentValue):""),D.setAttribute("aria-disabled",String(v.value)),!Ri(V)&&V!=null){let X=Number(V);Number.isNaN(X)&&(X=null),a(Wi,X)}D.addEventListener("wheel",L,{passive:!1})}),s.onUpdated(()=>{var M,I;const F=(M=h.value)==null?void 0:M.input;F==null||F.setAttribute("aria-valuenow",`${(I=d.currentValue)!=null?I:""}`)}),Q({focus:H,blur:W}),(M,I)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(A).b(),s.unref(A).m(s.unref(m)),s.unref(A).is("disabled",s.unref(v)),s.unref(A).is("without-controls",!M.controls),s.unref(A).is("controls-right",s.unref(p))]),onDragstart:s.withModifiers(()=>{},["prevent"])},[M.controls?s.withDirectives((s.openBlock(),s.createElementBlock("span",{key:0,role:"button","aria-label":s.unref(S)("el.inputNumber.decrease"),class:s.normalizeClass([s.unref(A).e("decrease"),s.unref(A).is("disabled",s.unref(l))]),onKeydown:s.withKeys(T,["enter"])},[s.renderSlot(M.$slots,"decrease-icon",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.unref(p)?(s.openBlock(),s.createBlock(s.unref(ui.ArrowDown),{key:0})):(s.openBlock(),s.createBlock(s.unref(ui.Minus),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[s.unref(Bh),T]]):s.createCommentVNode("v-if",!0),M.controls?s.withDirectives((s.openBlock(),s.createElementBlock("span",{key:1,role:"button","aria-label":s.unref(S)("el.inputNumber.increase"),class:s.normalizeClass([s.unref(A).e("increase"),s.unref(A).is("disabled",s.unref(c))]),onKeydown:s.withKeys(k,["enter"])},[s.renderSlot(M.$slots,"increase-icon",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.unref(p)?(s.openBlock(),s.createBlock(s.unref(ui.ArrowUp),{key:0})):(s.openBlock(),s.createBlock(s.unref(ui.Plus),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[s.unref(Bh),k]]):s.createCommentVNode("v-if",!0),s.createVNode(s.unref(Sn),{id:M.id,ref_key:"input",ref:h,type:"number",step:M.step,"model-value":s.unref(_),placeholder:M.placeholder,readonly:M.readonly,disabled:s.unref(v),size:s.unref(m),max:M.max,min:M.min,name:M.name,"aria-label":M.ariaLabel,"validate-event":!1,onKeydown:[s.withKeys(s.withModifiers(k,["prevent"]),["up"]),s.withKeys(s.withModifiers(T,["prevent"]),["down"])],onBlur:$,onFocus:K,onInput:G,onChange:j},null,8,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var gN=si(AN,[["__file","input-number.vue"]]);const vN=Gn(gN),J1=Symbol("ElSelectGroup"),Mu=Symbol("ElSelect");function yN(N,Q){const a=s.inject(Mu),x=s.inject(J1,{disabled:!1}),S=s.computed(()=>c(Ia(a.props.modelValue),N.value)),A=s.computed(()=>{var m;if(a.props.multiple){const v=Ia((m=a.props.modelValue)!=null?m:[]);return!S.value&&v.length>=a.props.multipleLimit&&a.props.multipleLimit>0}else return!1}),h=s.computed(()=>N.label||(qn(N.value)?"":N.value)),d=s.computed(()=>N.value||N.label||""),u=s.computed(()=>N.disabled||Q.groupDisabled||A.value),l=s.getCurrentInstance(),c=(m=[],v)=>{if(qn(N.value)){const _=a.props.valueKey;return m&&m.some(b=>s.toRaw(ia(b,_))===ia(v,_))}else return m&&m.includes(v)},f=()=>{!N.disabled&&!x.disabled&&(a.states.hoveringIndex=a.optionsArray.indexOf(l.proxy))},p=m=>{const v=new RegExp(H4(m),"i");Q.visible=v.test(h.value)||N.created};return s.watch(()=>h.value,()=>{!N.created&&!a.props.remote&&a.setSelected()}),s.watch(()=>N.value,(m,v)=>{const{remote:_,valueKey:b}=a.props;if(m!==v&&(a.onOptionDestroy(v,l.proxy),a.onOptionCreate(l.proxy)),!N.created&&!_){if(b&&qn(m)&&qn(v)&&m[b]===v[b])return;a.setSelected()}}),s.watch(()=>x.disabled,()=>{Q.groupDisabled=x.disabled},{immediate:!0}),{select:a,currentLabel:h,currentValue:d,itemSelected:S,isDisabled:u,hoverItem:f,updateOption:p}}const bN=s.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(N){const Q=Jr("select"),a=Pu(),x=s.computed(()=>[Q.be("dropdown","item"),Q.is("disabled",s.unref(d)),Q.is("selected",s.unref(h)),Q.is("hovering",s.unref(p))]),S=s.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:A,itemSelected:h,isDisabled:d,select:u,hoverItem:l,updateOption:c}=yN(N,S),{visible:f,hover:p}=s.toRefs(S),m=s.getCurrentInstance().proxy;u.onOptionCreate(m),s.onBeforeUnmount(()=>{const _=m.value,{selected:b}=u.states,C=(u.props.multiple?b:[b]).some(k=>k.value===m.value);s.nextTick(()=>{u.states.cachedOptions.get(_)===m&&!C&&u.states.cachedOptions.delete(_)}),u.onOptionDestroy(_,m)});function v(){d.value||u.handleOptionSelect(m)}return{ns:Q,id:a,containerKls:x,currentLabel:A,itemSelected:h,isDisabled:d,select:u,hoverItem:l,updateOption:c,visible:f,hover:p,selectOptionClick:v,states:S}}});function _N(N,Q,a,x,S,A){return s.withDirectives((s.openBlock(),s.createElementBlock("li",{id:N.id,class:s.normalizeClass(N.containerKls),role:"option","aria-disabled":N.isDisabled||void 0,"aria-selected":N.itemSelected,onMouseenter:N.hoverItem,onClick:s.withModifiers(N.selectOptionClick,["stop"])},[s.renderSlot(N.$slots,"default",{},()=>[s.createElementVNode("span",null,s.toDisplayString(N.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[s.vShow,N.visible]])}var lA=si(bN,[["render",_N],["__file","option.vue"]]);const wN=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const N=s.inject(Mu),Q=Jr("select"),a=s.computed(()=>N.props.popperClass),x=s.computed(()=>N.props.multiple),S=s.computed(()=>N.props.fitInputWidth),A=s.ref("");function h(){var d;A.value=`${(d=N.selectRef)==null?void 0:d.offsetWidth}px`}return s.onMounted(()=>{h(),ea(N.selectRef,h)}),{ns:Q,minWidth:A,popperClass:a,isMultiple:x,isFitInputWidth:S}}});function xN(N,Q,a,x,S,A){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([N.ns.b("dropdown"),N.ns.is("multiple",N.isMultiple),N.popperClass]),style:s.normalizeStyle({[N.isFitInputWidth?"width":"minWidth"]:N.minWidth})},[N.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.ns.be("dropdown","header"))},[s.renderSlot(N.$slots,"header")],2)):s.createCommentVNode("v-if",!0),s.renderSlot(N.$slots,"default"),N.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(N.ns.be("dropdown","footer"))},[s.renderSlot(N.$slots,"footer")],2)):s.createCommentVNode("v-if",!0)],6)}var CN=si(wN,[["render",xN],["__file","select-dropdown.vue"]]);const EN=11,BN=(N,Q)=>{const{t:a}=es(),x=Pu(),S=Jr("select"),A=Jr("input"),h=s.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:N.multiple?[]:{},selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),d=s.ref(null),u=s.ref(null),l=s.ref(null),c=s.ref(null),f=s.ref(null),p=s.ref(null),m=s.ref(null),v=s.ref(null),_=s.ref(null),b=s.ref(null),w=s.ref(null),C=s.ref(null),{isComposing:k,handleCompositionStart:T,handleCompositionUpdate:R,handleCompositionEnd:U}=L_({afterComposition:xt=>ct(xt)}),{wrapperRef:G,isFocused:j,handleBlur:H}=N_(f,{afterFocus(){N.automaticDropdown&&!W.value&&(W.value=!0,h.menuVisibleOnFocus=!0)},beforeBlur(xt){var Qt,$t;return((Qt=l.value)==null?void 0:Qt.isFocusInsideContent(xt))||(($t=c.value)==null?void 0:$t.isFocusInsideContent(xt))},afterBlur(){W.value=!1,h.menuVisibleOnFocus=!1}}),W=s.ref(!1),K=s.ref(),{form:$,formItem:O}=Ao(),{inputId:L}=vl(N,{formItemContext:O}),{valueOnClear:M,isEmptyValue:I}=V_(N),F=s.computed(()=>N.disabled||($==null?void 0:$.disabled)),V=s.computed(()=>bi(N.modelValue)?N.modelValue.length>0:!I(N.modelValue)),D=s.computed(()=>N.clearable&&!F.value&&h.inputHovering&&V.value),X=s.computed(()=>N.remote&&N.filterable&&!N.remoteShowSuffix?"":N.suffixIcon),ee=s.computed(()=>S.is("reverse",X.value&&W.value)),q=s.computed(()=>(O==null?void 0:O.validateState)||""),ne=s.computed(()=>s_[q.value]),oe=s.computed(()=>N.remote?300:0),he=s.computed(()=>N.loading?N.loadingText||a("el.select.loading"):N.remote&&!h.inputValue&&h.options.size===0?!1:N.filterable&&h.inputValue&&h.options.size>0&&te.value===0?N.noMatchText||a("el.select.noMatch"):h.options.size===0?N.noDataText||a("el.select.noData"):null),te=s.computed(()=>de.value.filter(xt=>xt.visible).length),de=s.computed(()=>{const xt=Array.from(h.options.values()),Qt=[];return h.optionValues.forEach($t=>{const nr=xt.findIndex(Er=>Er.value===$t);nr>-1&&Qt.push(xt[nr])}),Qt.length>=xt.length?Qt:xt}),se=s.computed(()=>Array.from(h.cachedOptions.values())),re=s.computed(()=>{const xt=de.value.filter(Qt=>!Qt.created).some(Qt=>Qt.currentLabel===h.inputValue);return N.filterable&&N.allowCreate&&h.inputValue!==""&&!xt}),ae=()=>{N.filterable&&mn(N.filterMethod)||N.filterable&&N.remote&&mn(N.remoteMethod)||de.value.forEach(xt=>{var Qt;(Qt=xt.updateOption)==null||Qt.call(xt,h.inputValue)})},Ce=mo(),me=s.computed(()=>["small"].includes(Ce.value)?"small":"default"),ce=s.computed({get(){return W.value&&he.value!==!1},set(xt){W.value=xt}}),pe=s.computed(()=>{if(N.multiple&&!Ts(N.modelValue))return Ia(N.modelValue).length===0&&!h.inputValue;const xt=bi(N.modelValue)?N.modelValue[0]:N.modelValue;return N.filterable||Ts(xt)?!h.inputValue:!0}),B=s.computed(()=>{var xt;const Qt=(xt=N.placeholder)!=null?xt:a("el.select.placeholder");return N.multiple||!V.value?Qt:h.selectedLabel}),ke=s.computed(()=>em?null:"mouseenter");s.watch(()=>N.modelValue,(xt,Qt)=>{N.multiple&&N.filterable&&!N.reserveKeyword&&(h.inputValue="",Ee("")),Ae(),!vu(xt,Qt)&&N.validateEvent&&(O==null||O.validate("change").catch($t=>Ki($t)))},{flush:"post",deep:!0}),s.watch(()=>W.value,xt=>{xt?Ee(h.inputValue):(h.inputValue="",h.previousQuery=null,h.isBeforeHide=!0),Q("visible-change",xt)}),s.watch(()=>h.options.entries(),()=>{var xt;if(!Ln)return;const Qt=((xt=d.value)==null?void 0:xt.querySelectorAll("input"))||[];(!N.filterable&&!N.defaultFirstOption&&!Ts(N.modelValue)||!Array.from(Qt).includes(document.activeElement))&&Ae(),N.defaultFirstOption&&(N.filterable||N.remote)&&te.value&&ge()},{flush:"post"}),s.watch(()=>h.hoveringIndex,xt=>{Ri(xt)&&xt>-1?K.value=de.value[xt]||{}:K.value={},de.value.forEach(Qt=>{Qt.hover=K.value===Qt})}),s.watchEffect(()=>{h.isBeforeHide||ae()});const Ee=xt=>{h.previousQuery===xt||k.value||(h.previousQuery=xt,N.filterable&&mn(N.filterMethod)?N.filterMethod(xt):N.filterable&&N.remote&&mn(N.remoteMethod)&&N.remoteMethod(xt),N.defaultFirstOption&&(N.filterable||N.remote)&&te.value?s.nextTick(ge):s.nextTick(ue))},ge=()=>{const xt=de.value.filter(nr=>nr.visible&&!nr.disabled&&!nr.states.groupDisabled),Qt=xt.find(nr=>nr.created),$t=xt[0];h.hoveringIndex=Ke(de.value,Qt||$t)},Ae=()=>{if(N.multiple)h.selectedLabel="";else{const Qt=bi(N.modelValue)?N.modelValue[0]:N.modelValue,$t=fe(Qt);h.selectedLabel=$t.currentLabel,h.selected=$t;return}const xt=[];Ts(N.modelValue)||Ia(N.modelValue).forEach(Qt=>{xt.push(fe(Qt))}),h.selected=xt},fe=xt=>{let Qt;const $t=tm(xt).toLowerCase()==="object",nr=tm(xt).toLowerCase()==="null",Er=tm(xt).toLowerCase()==="undefined";for(let Ue=h.cachedOptions.size-1;Ue>=0;Ue--){const Ge=se.value[Ue];if($t?ia(Ge.value,N.valueKey)===ia(xt,N.valueKey):Ge.value===xt){Qt={value:xt,currentLabel:Ge.currentLabel,get isDisabled(){return Ge.isDisabled}};break}}if(Qt)return Qt;const Ie=$t?xt.label:!nr&&!Er?xt:"";return{value:xt,currentLabel:Ie}},ue=()=>{N.multiple?h.hoveringIndex=de.value.findIndex(xt=>h.selected.some(Qt=>rr(Qt)===rr(xt))):h.hoveringIndex=de.value.findIndex(xt=>rr(xt)===rr(h.selected))},_e=()=>{h.selectionWidth=u.value.getBoundingClientRect().width},be=()=>{h.calculatorWidth=p.value.getBoundingClientRect().width},De=()=>{h.collapseItemWidth=w.value.getBoundingClientRect().width},Je=()=>{var xt,Qt;(Qt=(xt=l.value)==null?void 0:xt.updatePopper)==null||Qt.call(xt)},Qe=()=>{var xt,Qt;(Qt=(xt=c.value)==null?void 0:xt.updatePopper)==null||Qt.call(xt)},ot=()=>{h.inputValue.length>0&&!W.value&&(W.value=!0),Ee(h.inputValue)},ct=xt=>{if(h.inputValue=xt.target.value,N.remote)ht();else return ot()},ht=ah(()=>{ot()},oe.value),it=xt=>{vu(N.modelValue,xt)||Q(Mo,xt)},Ze=xt=>O4(xt,Qt=>!h.disabledOptions.has(Qt)),Xe=xt=>{if(N.multiple&&xt.code!==Ii.delete&&xt.target.value.length<=0){const Qt=Ia(N.modelValue).slice(),$t=Ze(Qt);if($t<0)return;const nr=Qt[$t];Qt.splice($t,1),Q(Wi,Qt),it(Qt),Q("remove-tag",nr)}},dt=(xt,Qt)=>{const $t=h.selected.indexOf(Qt);if($t>-1&&!F.value){const nr=Ia(N.modelValue).slice();nr.splice($t,1),Q(Wi,nr),it(nr),Q("remove-tag",Qt.value)}xt.stopPropagation(),Rt()},at=xt=>{xt.stopPropagation();const Qt=N.multiple?[]:M.value;if(N.multiple)for(const $t of h.selected)$t.isDisabled&&Qt.push($t.value);Q(Wi,Qt),it(Qt),h.hoveringIndex=-1,W.value=!1,Q("clear"),Rt()},ze=xt=>{var Qt;if(N.multiple){const $t=Ia((Qt=N.modelValue)!=null?Qt:[]).slice(),nr=Ke($t,xt.value);nr>-1?$t.splice(nr,1):(N.multipleLimit<=0||$t.length<N.multipleLimit)&&$t.push(xt.value),Q(Wi,$t),it($t),xt.created&&Ee(""),N.filterable&&!N.reserveKeyword&&(h.inputValue="")}else Q(Wi,xt.value),it(xt.value),W.value=!1;Rt(),!W.value&&s.nextTick(()=>{ut(xt)})},Ke=(xt=[],Qt)=>{if(!qn(Qt))return xt.indexOf(Qt);const $t=N.valueKey;let nr=-1;return xt.some((Er,Ie)=>s.toRaw(ia(Er,$t))===ia(Qt,$t)?(nr=Ie,!0):!1),nr},ut=xt=>{var Qt,$t,nr,Er,Ie;const Le=bi(xt)?xt[0]:xt;let Ue=null;if(Le!=null&&Le.value){const Ge=de.value.filter(Ye=>Ye.value===Le.value);Ge.length>0&&(Ue=Ge[0].$el)}if(l.value&&Ue){const Ge=(Er=(nr=($t=(Qt=l.value)==null?void 0:Qt.popperRef)==null?void 0:$t.contentRef)==null?void 0:nr.querySelector)==null?void 0:Er.call(nr,`.${S.be("dropdown","wrap")}`);Ge&&W4(Ge,Ue)}(Ie=C.value)==null||Ie.handleScroll()},yt=xt=>{h.options.set(xt.value,xt),h.cachedOptions.set(xt.value,xt),xt.disabled&&h.disabledOptions.set(xt.value,xt)},Ne=(xt,Qt)=>{h.options.get(xt)===Qt&&h.options.delete(xt)},tt=s.computed(()=>{var xt,Qt;return(Qt=(xt=l.value)==null?void 0:xt.popperRef)==null?void 0:Qt.contentRef}),Pt=()=>{h.isBeforeHide=!1,s.nextTick(()=>ut(h.selected))},Rt=()=>{var xt;(xt=f.value)==null||xt.focus()},Ht=()=>{tr()},zt=xt=>{at(xt)},tr=xt=>{if(W.value=!1,j.value){const Qt=new FocusEvent("focus",xt);s.nextTick(()=>H(Qt))}},qt=()=>{h.inputValue.length>0?h.inputValue="":W.value=!1},er=()=>{F.value||(em&&(h.inputHovering=!0),h.menuVisibleOnFocus?h.menuVisibleOnFocus=!1:W.value=!W.value)},Dt=()=>{W.value?de.value[h.hoveringIndex]&&ze(de.value[h.hoveringIndex]):er()},rr=xt=>qn(xt.value)?ia(xt.value,N.valueKey):xt.value,_r=s.computed(()=>de.value.filter(xt=>xt.visible).every(xt=>xt.disabled)),pr=s.computed(()=>N.multiple?N.collapseTags?h.selected.slice(0,N.maxCollapseTags):h.selected:[]),xr=s.computed(()=>N.multiple?N.collapseTags?h.selected.slice(N.maxCollapseTags):[]:[]),Ct=xt=>{if(!W.value){W.value=!0;return}if(!(h.options.size===0||h.filteredOptionsCount===0||k.value)&&!_r.value){xt==="next"?(h.hoveringIndex++,h.hoveringIndex===h.options.size&&(h.hoveringIndex=0)):xt==="prev"&&(h.hoveringIndex--,h.hoveringIndex<0&&(h.hoveringIndex=h.options.size-1));const Qt=de.value[h.hoveringIndex];(Qt.disabled===!0||Qt.states.groupDisabled===!0||!Qt.visible)&&Ct(xt),s.nextTick(()=>ut(K.value))}},Et=()=>{if(!u.value)return 0;const xt=window.getComputedStyle(u.value);return Number.parseFloat(xt.gap||"6px")},Lt=s.computed(()=>{const xt=Et();return{maxWidth:`${w.value&&N.maxCollapseTags===1?h.selectionWidth-h.collapseItemWidth-xt:h.selectionWidth}px`}}),Kt=s.computed(()=>({maxWidth:`${h.selectionWidth}px`})),Ar=s.computed(()=>({width:`${Math.max(h.calculatorWidth,EN)}px`}));return ea(u,_e),ea(p,be),ea(_,Je),ea(G,Je),ea(b,Qe),ea(w,De),s.onMounted(()=>{Ae()}),{inputId:L,contentId:x,nsSelect:S,nsInput:A,states:h,isFocused:j,expanded:W,optionsArray:de,hoverOption:K,selectSize:Ce,filteredOptionsCount:te,resetCalculatorWidth:be,updateTooltip:Je,updateTagTooltip:Qe,debouncedOnInputChange:ht,onInput:ct,deletePrevTag:Xe,deleteTag:dt,deleteSelected:at,handleOptionSelect:ze,scrollToOption:ut,hasModelValue:V,shouldShowPlaceholder:pe,currentPlaceholder:B,mouseEnterEventName:ke,showClose:D,iconComponent:X,iconReverse:ee,validateState:q,validateIcon:ne,showNewOption:re,updateOptions:ae,collapseTagSize:me,setSelected:Ae,selectDisabled:F,emptyText:he,handleCompositionStart:T,handleCompositionUpdate:R,handleCompositionEnd:U,onOptionCreate:yt,onOptionDestroy:Ne,handleMenuEnter:Pt,focus:Rt,blur:Ht,handleClearClick:zt,handleClickOutside:tr,handleEsc:qt,toggleMenu:er,selectOption:Dt,getValueKey:rr,navigateOptions:Ct,dropdownMenuVisible:ce,showTagList:pr,collapseTagList:xr,tagStyle:Lt,collapseTagStyle:Kt,inputStyle:Ar,popperRef:tt,inputRef:f,tooltipRef:l,tagTooltipRef:c,calculatorRef:p,prefixRef:m,suffixRef:v,selectRef:d,wrapperRef:G,selectionRef:u,scrollbarRef:C,menuRef:_,tagMenuRef:b,collapseItemRef:w}};var PN=s.defineComponent({name:"ElOptions",setup(N,{slots:Q}){const a=s.inject(Mu);let x=[];return()=>{var S,A;const h=(S=Q.default)==null?void 0:S.call(Q),d=[];function u(l){bi(l)&&l.forEach(c=>{var f,p,m,v;const _=(f=(c==null?void 0:c.type)||{})==null?void 0:f.name;_==="ElOptionGroup"?u(!Dn(c.children)&&!bi(c.children)&&mn((p=c.children)==null?void 0:p.default)?(m=c.children)==null?void 0:m.default():c.children):_==="ElOption"?d.push((v=c.props)==null?void 0:v.value):bi(c.children)&&u(c.children)})}return h.length&&u((A=h[0])==null?void 0:A.children),vu(d,x)||(x=d,a&&(a.states.optionValues=d)),h}}});const SN=ei({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:po,effect:{type:Pr(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Pr(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:Um.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ho,default:ui.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:ho,default:ui.ArrowDown},tagType:{...Zm.type,default:"info"},tagEffect:{...Zm.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Pr(String),values:rc,default:"bottom-start"},fallbackPlacements:{type:Pr(Array),default:["bottom-start","top-start","right","left"]},...j_,...Ys(["ariaLabel"])}),Z1="ElSelect",kN=s.defineComponent({name:Z1,componentName:Z1,components:{ElSelectMenu:CN,ElOption:lA,ElOptions:PN,ElTag:wO,ElScrollbar:yn,ElTooltip:ku,ElIcon:ni},directives:{ClickOutside:Eh},props:SN,emits:[Wi,Mo,"remove-tag","clear","visible-change","focus","blur"],setup(N,{emit:Q}){const a=BN(N,Q);return s.provide(Mu,s.reactive({props:N,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a}}});function MN(N,Q,a,x,S,A){const h=s.resolveComponent("el-tag"),d=s.resolveComponent("el-tooltip"),u=s.resolveComponent("el-icon"),l=s.resolveComponent("el-option"),c=s.resolveComponent("el-options"),f=s.resolveComponent("el-scrollbar"),p=s.resolveComponent("el-select-menu"),m=s.resolveDirective("click-outside");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"selectRef",class:s.normalizeClass([N.nsSelect.b(),N.nsSelect.m(N.selectSize)]),[s.toHandlerKey(N.mouseEnterEventName)]:v=>N.states.inputHovering=!0,onMouseleave:v=>N.states.inputHovering=!1},[s.createVNode(d,{ref:"tooltipRef",visible:N.dropdownMenuVisible,placement:N.placement,teleported:N.teleported,"popper-class":[N.nsSelect.e("popper"),N.popperClass],"popper-options":N.popperOptions,"fallback-placements":N.fallbackPlacements,effect:N.effect,pure:"",trigger:"click",transition:`${N.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:N.persistent,onBeforeShow:N.handleMenuEnter,onHide:v=>N.states.isBeforeHide=!1},{default:s.withCtx(()=>{var v;return[s.createElementVNode("div",{ref:"wrapperRef",class:s.normalizeClass([N.nsSelect.e("wrapper"),N.nsSelect.is("focused",N.isFocused),N.nsSelect.is("hovering",N.states.inputHovering),N.nsSelect.is("filterable",N.filterable),N.nsSelect.is("disabled",N.selectDisabled)]),onClick:s.withModifiers(N.toggleMenu,["prevent","stop"])},[N.$slots.prefix?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"prefixRef",class:s.normalizeClass(N.nsSelect.e("prefix"))},[s.renderSlot(N.$slots,"prefix")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref:"selectionRef",class:s.normalizeClass([N.nsSelect.e("selection"),N.nsSelect.is("near",N.multiple&&!N.$slots.prefix&&!!N.states.selected.length)])},[N.multiple?s.renderSlot(N.$slots,"tag",{key:0},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.showTagList,_=>(s.openBlock(),s.createElementBlock("div",{key:N.getValueKey(_),class:s.normalizeClass(N.nsSelect.e("selected-item"))},[s.createVNode(h,{closable:!N.selectDisabled&&!_.isDisabled,size:N.collapseTagSize,type:N.tagType,effect:N.tagEffect,"disable-transitions":"",style:s.normalizeStyle(N.tagStyle),onClose:b=>N.deleteTag(b,_)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(N.nsSelect.e("tags-text"))},[s.renderSlot(N.$slots,"label",{label:_.currentLabel,value:_.value},()=>[s.createTextVNode(s.toDisplayString(_.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),N.collapseTags&&N.states.selected.length>N.maxCollapseTags?(s.openBlock(),s.createBlock(d,{key:0,ref:"tagTooltipRef",disabled:N.dropdownMenuVisible||!N.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:N.effect,placement:"bottom",teleported:N.teleported},{default:s.withCtx(()=>[s.createElementVNode("div",{ref:"collapseItemRef",class:s.normalizeClass(N.nsSelect.e("selected-item"))},[s.createVNode(h,{closable:!1,size:N.collapseTagSize,type:N.tagType,effect:N.tagEffect,"disable-transitions":"",style:s.normalizeStyle(N.collapseTagStyle)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(N.nsSelect.e("tags-text"))}," + "+s.toDisplayString(N.states.selected.length-N.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:s.withCtx(()=>[s.createElementVNode("div",{ref:"tagMenuRef",class:s.normalizeClass(N.nsSelect.e("selection"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.collapseTagList,_=>(s.openBlock(),s.createElementBlock("div",{key:N.getValueKey(_),class:s.normalizeClass(N.nsSelect.e("selected-item"))},[s.createVNode(h,{class:"in-tooltip",closable:!N.selectDisabled&&!_.isDisabled,size:N.collapseTagSize,type:N.tagType,effect:N.tagEffect,"disable-transitions":"",onClose:b=>N.deleteTag(b,_)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(N.nsSelect.e("tags-text"))},[s.renderSlot(N.$slots,"label",{label:_.currentLabel,value:_.value},()=>[s.createTextVNode(s.toDisplayString(_.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):s.createCommentVNode("v-if",!0)]):s.createCommentVNode("v-if",!0),N.selectDisabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass([N.nsSelect.e("selected-item"),N.nsSelect.e("input-wrapper"),N.nsSelect.is("hidden",!N.filterable)])},[s.withDirectives(s.createElementVNode("input",{id:N.inputId,ref:"inputRef","onUpdate:modelValue":_=>N.states.inputValue=_,type:"text",name:N.name,class:s.normalizeClass([N.nsSelect.e("input"),N.nsSelect.is(N.selectSize)]),disabled:N.selectDisabled,autocomplete:N.autocomplete,style:s.normalizeStyle(N.inputStyle),role:"combobox",readonly:!N.filterable,spellcheck:"false","aria-activedescendant":((v=N.hoverOption)==null?void 0:v.id)||"","aria-controls":N.contentId,"aria-expanded":N.dropdownMenuVisible,"aria-label":N.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[s.withKeys(s.withModifiers(_=>N.navigateOptions("next"),["stop","prevent"]),["down"]),s.withKeys(s.withModifiers(_=>N.navigateOptions("prev"),["stop","prevent"]),["up"]),s.withKeys(s.withModifiers(N.handleEsc,["stop","prevent"]),["esc"]),s.withKeys(s.withModifiers(N.selectOption,["stop","prevent"]),["enter"]),s.withKeys(s.withModifiers(N.deletePrevTag,["stop"]),["delete"])],onCompositionstart:N.handleCompositionStart,onCompositionupdate:N.handleCompositionUpdate,onCompositionend:N.handleCompositionEnd,onInput:N.onInput,onClick:s.withModifiers(N.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[s.vModelText,N.states.inputValue]]),N.filterable?(s.openBlock(),s.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:s.normalizeClass(N.nsSelect.e("input-calculator")),textContent:s.toDisplayString(N.states.inputValue)},null,10,["textContent"])):s.createCommentVNode("v-if",!0)],2)),N.shouldShowPlaceholder?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass([N.nsSelect.e("selected-item"),N.nsSelect.e("placeholder"),N.nsSelect.is("transparent",!N.hasModelValue||N.expanded&&!N.states.inputValue)])},[N.hasModelValue?s.renderSlot(N.$slots,"label",{key:0,label:N.currentPlaceholder,value:N.modelValue},()=>[s.createElementVNode("span",null,s.toDisplayString(N.currentPlaceholder),1)]):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(N.currentPlaceholder),1))],2)):s.createCommentVNode("v-if",!0)],2),s.createElementVNode("div",{ref:"suffixRef",class:s.normalizeClass(N.nsSelect.e("suffix"))},[N.iconComponent&&!N.showClose?(s.openBlock(),s.createBlock(u,{key:0,class:s.normalizeClass([N.nsSelect.e("caret"),N.nsSelect.e("icon"),N.iconReverse])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.iconComponent)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),N.showClose&&N.clearIcon?(s.openBlock(),s.createBlock(u,{key:1,class:s.normalizeClass([N.nsSelect.e("caret"),N.nsSelect.e("icon")]),onClick:N.handleClearClick},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),N.validateState&&N.validateIcon?(s.openBlock(),s.createBlock(u,{key:2,class:s.normalizeClass([N.nsInput.e("icon"),N.nsInput.e("validateIcon")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.validateIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:s.withCtx(()=>[s.createVNode(p,{ref:"menuRef"},{default:s.withCtx(()=>[N.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.nsSelect.be("dropdown","header")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(N.$slots,"header")],10,["onClick"])):s.createCommentVNode("v-if",!0),s.withDirectives(s.createVNode(f,{id:N.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":N.nsSelect.be("dropdown","wrap"),"view-class":N.nsSelect.be("dropdown","list"),class:s.normalizeClass([N.nsSelect.is("empty",N.filteredOptionsCount===0)]),role:"listbox","aria-label":N.ariaLabel,"aria-orientation":"vertical"},{default:s.withCtx(()=>[N.showNewOption?(s.openBlock(),s.createBlock(l,{key:0,value:N.states.inputValue,created:!0},null,8,["value"])):s.createCommentVNode("v-if",!0),s.createVNode(c,null,{default:s.withCtx(()=>[s.renderSlot(N.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[s.vShow,N.states.options.size>0&&!N.loading]]),N.$slots.loading&&N.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(N.nsSelect.be("dropdown","loading"))},[s.renderSlot(N.$slots,"loading")],2)):N.loading||N.filteredOptionsCount===0?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(N.nsSelect.be("dropdown","empty"))},[s.renderSlot(N.$slots,"empty",{},()=>[s.createElementVNode("span",null,s.toDisplayString(N.emptyText),1)])],2)):s.createCommentVNode("v-if",!0),N.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:3,class:s.normalizeClass(N.nsSelect.be("dropdown","footer")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(N.$slots,"footer")],10,["onClick"])):s.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","onBeforeShow","onHide"])],16,["onMouseleave"])),[[m,N.handleClickOutside,N.popperRef]])}var TN=si(kN,[["render",MN],["__file","select.vue"]]);const IN=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(N){const Q=Jr("select"),a=s.ref(null),x=s.getCurrentInstance(),S=s.ref([]);s.provide(J1,s.reactive({...s.toRefs(N)}));const A=s.computed(()=>S.value.some(l=>l.visible===!0)),h=l=>{var c,f;return((c=l.type)==null?void 0:c.name)==="ElOption"&&!!((f=l.component)!=null&&f.proxy)},d=l=>{const c=Ia(l),f=[];return c.forEach(p=>{var m,v;h(p)?f.push(p.component.proxy):(m=p.children)!=null&&m.length?f.push(...d(p.children)):(v=p.component)!=null&&v.subTree&&f.push(...d(p.component.subTree))}),f},u=()=>{S.value=d(x.subTree)};return s.onMounted(()=>{u()}),Uk(a,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:a,visible:A,ns:Q}}});function DN(N,Q,a,x,S,A){return s.withDirectives((s.openBlock(),s.createElementBlock("ul",{ref:"groupRef",class:s.normalizeClass(N.ns.be("group","wrap"))},[s.createElementVNode("li",{class:s.normalizeClass(N.ns.be("group","title"))},s.toDisplayString(N.label),3),s.createElementVNode("li",null,[s.createElementVNode("ul",{class:s.normalizeClass(N.ns.b("group"))},[s.renderSlot(N.$slots,"default")],2)])],2)),[[s.vShow,N.visible]])}var q1=si(IN,[["render",DN],["__file","option-group.vue"]]);const Tu=Gn(TN,{Option:lA,OptionGroup:q1}),Iu=pl(lA);pl(q1);const ew=Symbol("sliderContextKey"),FN=ei({modelValue:{type:Pr([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:po,inputSize:po,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Pr(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Pr(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:rc,default:"top"},marks:{type:Pr(Object)},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),cA=N=>Ri(N)||bi(N)&&N.every(Ri),RN={[Wi]:cA,[To]:cA,[Mo]:cA},ON=(N,Q,a)=>{const x=s.ref();return s.onMounted(async()=>{N.range?(Array.isArray(N.modelValue)?(Q.firstValue=Math.max(N.min,N.modelValue[0]),Q.secondValue=Math.min(N.max,N.modelValue[1])):(Q.firstValue=N.min,Q.secondValue=N.max),Q.oldValue=[Q.firstValue,Q.secondValue]):(typeof N.modelValue!="number"||Number.isNaN(N.modelValue)?Q.firstValue=N.min:Q.firstValue=Math.min(N.max,Math.max(N.min,N.modelValue)),Q.oldValue=Q.firstValue),Zn(window,"resize",a),await s.nextTick(),a()}),{sliderWrapper:x}},NN=N=>s.computed(()=>N.marks?Object.keys(N.marks).map(Number.parseFloat).sort((a,x)=>a-x).filter(a=>a<=N.max&&a>=N.min).map(a=>({point:a,position:(a-N.min)*100/(N.max-N.min),mark:N.marks[a]})):[]),LN=(N,Q,a)=>{const{form:x,formItem:S}=Ao(),A=s.shallowRef(),h=s.ref(),d=s.ref(),u={firstButton:h,secondButton:d},l=s.computed(()=>N.disabled||(x==null?void 0:x.disabled)||!1),c=s.computed(()=>Math.min(Q.firstValue,Q.secondValue)),f=s.computed(()=>Math.max(Q.firstValue,Q.secondValue)),p=s.computed(()=>N.range?`${100*(f.value-c.value)/(N.max-N.min)}%`:`${100*(Q.firstValue-N.min)/(N.max-N.min)}%`),m=s.computed(()=>N.range?`${100*(c.value-N.min)/(N.max-N.min)}%`:"0%"),v=s.computed(()=>N.vertical?{height:N.height}:{}),_=s.computed(()=>N.vertical?{height:p.value,bottom:m.value}:{width:p.value,left:m.value}),b=()=>{A.value&&(Q.sliderSize=A.value[`client${N.vertical?"Height":"Width"}`])},w=$=>{const O=N.min+$*(N.max-N.min)/100;if(!N.range)return h;let L;return Math.abs(c.value-O)<Math.abs(f.value-O)?L=Q.firstValue<Q.secondValue?"firstButton":"secondButton":L=Q.firstValue>Q.secondValue?"firstButton":"secondButton",u[L]},C=$=>{const O=w($);return O.value.setPosition($),O},k=$=>{Q.firstValue=$??N.min,R(N.range?[c.value,f.value]:$??N.min)},T=$=>{Q.secondValue=$,N.range&&R([c.value,f.value])},R=$=>{a(Wi,$),a(To,$)},U=async()=>{await s.nextTick(),a(Mo,N.range?[c.value,f.value]:N.modelValue)},G=$=>{var O,L,M,I,F,V;if(l.value||Q.dragging)return;b();let D=0;if(N.vertical){const X=(M=(L=(O=$.touches)==null?void 0:O.item(0))==null?void 0:L.clientY)!=null?M:$.clientY;D=(A.value.getBoundingClientRect().bottom-X)/Q.sliderSize*100}else{const X=(V=(F=(I=$.touches)==null?void 0:I.item(0))==null?void 0:F.clientX)!=null?V:$.clientX,ee=A.value.getBoundingClientRect().left;D=(X-ee)/Q.sliderSize*100}if(!(D<0||D>100))return C(D)};return{elFormItem:S,slider:A,firstButton:h,secondButton:d,sliderDisabled:l,minValue:c,maxValue:f,runwayStyle:v,barStyle:_,resetSize:b,setPosition:C,emitChange:U,onSliderWrapperPrevent:$=>{var O,L;((O=u.firstButton.value)!=null&&O.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&$.preventDefault()},onSliderClick:$=>{G($)&&U()},onSliderDown:async $=>{const O=G($);O&&(await s.nextTick(),O.value.onButtonDown($))},onSliderMarkerDown:$=>{l.value||Q.dragging||C($)},setFirstValue:k,setSecondValue:T}},{left:jN,down:VN,right:UN,up:HN,home:zN,end:GN,pageUp:QN,pageDown:WN}=Ii,$N=(N,Q,a)=>{const x=s.ref(),S=s.ref(!1),A=s.computed(()=>Q.value instanceof Function),h=s.computed(()=>A.value&&Q.value(N.modelValue)||N.modelValue),d=ah(()=>{a.value&&(S.value=!0)},50),u=ah(()=>{a.value&&(S.value=!1)},50);return{tooltip:x,tooltipVisible:S,formatValue:h,displayTooltip:d,hideTooltip:u}},KN=(N,Q,a)=>{const{disabled:x,min:S,max:A,step:h,showTooltip:d,precision:u,sliderSize:l,formatTooltip:c,emitChange:f,resetSize:p,updateDragging:m}=s.inject(ew),{tooltip:v,tooltipVisible:_,formatValue:b,displayTooltip:w,hideTooltip:C}=$N(N,c,d),k=s.ref(),T=s.computed(()=>`${(N.modelValue-S.value)/(A.value-S.value)*100}%`),R=s.computed(()=>N.vertical?{bottom:T.value}:{left:T.value}),U=()=>{Q.hovering=!0,w()},G=()=>{Q.hovering=!1,Q.dragging||C()},j=q=>{x.value||(q.preventDefault(),V(q),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",X),window.addEventListener("touchend",X),window.addEventListener("contextmenu",X),k.value.focus())},H=q=>{x.value||(Q.newPosition=Number.parseFloat(T.value)+q/(A.value-S.value)*100,ee(Q.newPosition),f())},W=()=>{H(-h.value)},K=()=>{H(h.value)},$=()=>{H(-h.value*4)},O=()=>{H(h.value*4)},L=()=>{x.value||(ee(0),f())},M=()=>{x.value||(ee(100),f())},I=q=>{let ne=!0;[jN,VN].includes(q.key)?W():[UN,HN].includes(q.key)?K():q.key===zN?L():q.key===GN?M():q.key===WN?$():q.key===QN?O():ne=!1,ne&&q.preventDefault()},F=q=>{let ne,oe;return q.type.startsWith("touch")?(oe=q.touches[0].clientY,ne=q.touches[0].clientX):(oe=q.clientY,ne=q.clientX),{clientX:ne,clientY:oe}},V=q=>{Q.dragging=!0,Q.isClick=!0;const{clientX:ne,clientY:oe}=F(q);N.vertical?Q.startY=oe:Q.startX=ne,Q.startPosition=Number.parseFloat(T.value),Q.newPosition=Q.startPosition},D=q=>{if(Q.dragging){Q.isClick=!1,w(),p();let ne;const{clientX:oe,clientY:he}=F(q);N.vertical?(Q.currentY=he,ne=(Q.startY-Q.currentY)/l.value*100):(Q.currentX=oe,ne=(Q.currentX-Q.startX)/l.value*100),Q.newPosition=Q.startPosition+ne,ee(Q.newPosition)}},X=()=>{Q.dragging&&(setTimeout(()=>{Q.dragging=!1,Q.hovering||C(),Q.isClick||ee(Q.newPosition),f()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",X),window.removeEventListener("touchend",X),window.removeEventListener("contextmenu",X))},ee=async q=>{if(q===null||Number.isNaN(+q))return;q<0?q=0:q>100&&(q=100);const ne=100/((A.value-S.value)/h.value);let he=Math.round(q/ne)*ne*(A.value-S.value)*.01+S.value;he=Number.parseFloat(he.toFixed(u.value)),he!==N.modelValue&&a(Wi,he),!Q.dragging&&N.modelValue!==Q.oldValue&&(Q.oldValue=N.modelValue),await s.nextTick(),Q.dragging&&w(),v.value.updatePopper()};return s.watch(()=>Q.dragging,q=>{m(q)}),Zn(k,"touchstart",j,{passive:!1}),{disabled:x,button:k,tooltip:v,tooltipVisible:_,showTooltip:d,wrapperStyle:R,formatValue:b,handleMouseEnter:U,handleMouseLeave:G,onButtonDown:j,onKeyDown:I,setPosition:ee}},XN=(N,Q,a,x)=>({stops:s.computed(()=>{if(!N.showStops||N.min>N.max)return[];if(N.step===0)return Ki("ElSlider","step should not be 0."),[];const h=(N.max-N.min)/N.step,d=100*N.step/(N.max-N.min),u=Array.from({length:h-1}).map((l,c)=>(c+1)*d);return N.range?u.filter(l=>l<100*(a.value-N.min)/(N.max-N.min)||l>100*(x.value-N.min)/(N.max-N.min)):u.filter(l=>l>100*(Q.firstValue-N.min)/(N.max-N.min))}),getStopStyle:h=>N.vertical?{bottom:`${h}%`}:{left:`${h}%`}}),YN=(N,Q,a,x,S,A)=>{const h=l=>{S(Wi,l),S(To,l)},d=()=>N.range?![a.value,x.value].every((l,c)=>l===Q.oldValue[c]):N.modelValue!==Q.oldValue,u=()=>{var l,c;N.min>N.max&&ch("Slider","min should not be greater than max.");const f=N.modelValue;N.range&&Array.isArray(f)?f[1]<N.min?h([N.min,N.min]):f[0]>N.max?h([N.max,N.max]):f[0]<N.min?h([N.min,f[1]]):f[1]>N.max?h([f[0],N.max]):(Q.firstValue=f[0],Q.secondValue=f[1],d()&&(N.validateEvent&&((l=A==null?void 0:A.validate)==null||l.call(A,"change").catch(p=>Ki(p))),Q.oldValue=f.slice())):!N.range&&typeof f=="number"&&!Number.isNaN(f)&&(f<N.min?h(N.min):f>N.max?h(N.max):(Q.firstValue=f,d()&&(N.validateEvent&&((c=A==null?void 0:A.validate)==null||c.call(A,"change").catch(p=>Ki(p))),Q.oldValue=f)))};u(),s.watch(()=>Q.dragging,l=>{l||u()}),s.watch(()=>N.modelValue,(l,c)=>{Q.dragging||Array.isArray(l)&&Array.isArray(c)&&l.every((f,p)=>f===c[p])&&Q.firstValue===l[0]&&Q.secondValue===l[1]||u()},{deep:!0}),s.watch(()=>[N.min,N.max],()=>{u()})},JN=ei({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:rc,default:"top"}}),ZN={[Wi]:N=>Ri(N)},qN=s.defineComponent({name:"ElSliderButton"}),eL=s.defineComponent({...qN,props:JN,emits:ZN,setup(N,{expose:Q,emit:a}){const x=N,S=Jr("slider"),A=s.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:x.modelValue}),{disabled:h,button:d,tooltip:u,showTooltip:l,tooltipVisible:c,wrapperStyle:f,formatValue:p,handleMouseEnter:m,handleMouseLeave:v,onButtonDown:_,onKeyDown:b,setPosition:w}=KN(x,A,a),{hovering:C,dragging:k}=s.toRefs(A);return Q({onButtonDown:_,onKeyDown:b,setPosition:w,hovering:C,dragging:k}),(T,R)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"button",ref:d,class:s.normalizeClass([s.unref(S).e("button-wrapper"),{hover:s.unref(C),dragging:s.unref(k)}]),style:s.normalizeStyle(s.unref(f)),tabindex:s.unref(h)?-1:0,onMouseenter:s.unref(m),onMouseleave:s.unref(v),onMousedown:s.unref(_),onFocus:s.unref(m),onBlur:s.unref(v),onKeydown:s.unref(b)},[s.createVNode(s.unref(ku),{ref_key:"tooltip",ref:u,visible:s.unref(c),placement:T.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":T.tooltipClass,disabled:!s.unref(l),persistent:""},{content:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(s.unref(p)),1)]),default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass([s.unref(S).e("button"),{hover:s.unref(C),dragging:s.unref(k)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var tw=si(eL,[["__file","button.vue"]]);const tL=ei({mark:{type:Pr([String,Object]),default:void 0}});var rL=s.defineComponent({name:"ElSliderMarker",props:tL,setup(N){const Q=Jr("slider"),a=s.computed(()=>Dn(N.mark)?N.mark:N.mark.label),x=s.computed(()=>Dn(N.mark)?void 0:N.mark.style);return()=>s.h("div",{class:Q.e("marks-text"),style:x.value},a.value)}});const iL=s.defineComponent({name:"ElSlider"}),nL=s.defineComponent({...iL,props:FN,emits:RN,setup(N,{expose:Q,emit:a}){const x=N,S=Jr("slider"),{t:A}=es(),h=s.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:d,slider:u,firstButton:l,secondButton:c,sliderDisabled:f,minValue:p,maxValue:m,runwayStyle:v,barStyle:_,resetSize:b,emitChange:w,onSliderWrapperPrevent:C,onSliderClick:k,onSliderDown:T,onSliderMarkerDown:R,setFirstValue:U,setSecondValue:G}=LN(x,h,a),{stops:j,getStopStyle:H}=XN(x,h,p,m),{inputId:W,isLabeledByFormItem:K}=vl(x,{formItemContext:d}),$=mo(),O=s.computed(()=>x.inputSize||$.value),L=s.computed(()=>x.ariaLabel||A("el.slider.defaultLabel",{min:x.min,max:x.max})),M=s.computed(()=>x.range?x.rangeStartLabel||A("el.slider.defaultRangeStartLabel"):L.value),I=s.computed(()=>x.formatValueText?x.formatValueText(ne.value):`${ne.value}`),F=s.computed(()=>x.rangeEndLabel||A("el.slider.defaultRangeEndLabel")),V=s.computed(()=>x.formatValueText?x.formatValueText(oe.value):`${oe.value}`),D=s.computed(()=>[S.b(),S.m($.value),S.is("vertical",x.vertical),{[S.m("with-input")]:x.showInput}]),X=NN(x);YN(x,h,p,m,a,d);const ee=s.computed(()=>{const de=[x.min,x.max,x.step].map(se=>{const re=`${se}`.split(".")[1];return re?re.length:0});return Math.max.apply(null,de)}),{sliderWrapper:q}=ON(x,h,b),{firstValue:ne,secondValue:oe,sliderSize:he}=s.toRefs(h),te=de=>{h.dragging=de};return Zn(q,"touchstart",C,{passive:!1}),Zn(q,"touchmove",C,{passive:!1}),s.provide(ew,{...s.toRefs(x),sliderSize:he,disabled:f,precision:ee,emitChange:w,resetSize:b,updateDragging:te}),Q({onSliderClick:k}),(de,se)=>{var re,ae;return s.openBlock(),s.createElementBlock("div",{id:de.range?s.unref(W):void 0,ref_key:"sliderWrapper",ref:q,class:s.normalizeClass(s.unref(D)),role:de.range?"group":void 0,"aria-label":de.range&&!s.unref(K)?s.unref(L):void 0,"aria-labelledby":de.range&&s.unref(K)?(re=s.unref(d))==null?void 0:re.labelId:void 0},[s.createElementVNode("div",{ref_key:"slider",ref:u,class:s.normalizeClass([s.unref(S).e("runway"),{"show-input":de.showInput&&!de.range},s.unref(S).is("disabled",s.unref(f))]),style:s.normalizeStyle(s.unref(v)),onMousedown:s.unref(T),onTouchstartPassive:s.unref(T)},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("bar")),style:s.normalizeStyle(s.unref(_))},null,6),s.createVNode(tw,{id:de.range?void 0:s.unref(W),ref_key:"firstButton",ref:l,"model-value":s.unref(ne),vertical:de.vertical,"tooltip-class":de.tooltipClass,placement:de.placement,role:"slider","aria-label":de.range||!s.unref(K)?s.unref(M):void 0,"aria-labelledby":!de.range&&s.unref(K)?(ae=s.unref(d))==null?void 0:ae.labelId:void 0,"aria-valuemin":de.min,"aria-valuemax":de.range?s.unref(oe):de.max,"aria-valuenow":s.unref(ne),"aria-valuetext":s.unref(I),"aria-orientation":de.vertical?"vertical":"horizontal","aria-disabled":s.unref(f),"onUpdate:modelValue":s.unref(U)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),de.range?(s.openBlock(),s.createBlock(tw,{key:0,ref_key:"secondButton",ref:c,"model-value":s.unref(oe),vertical:de.vertical,"tooltip-class":de.tooltipClass,placement:de.placement,role:"slider","aria-label":s.unref(F),"aria-valuemin":s.unref(ne),"aria-valuemax":de.max,"aria-valuenow":s.unref(oe),"aria-valuetext":s.unref(V),"aria-orientation":de.vertical?"vertical":"horizontal","aria-disabled":s.unref(f),"onUpdate:modelValue":s.unref(G)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):s.createCommentVNode("v-if",!0),de.showStops?(s.openBlock(),s.createElementBlock("div",{key:1},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(j),(Ce,me)=>(s.openBlock(),s.createElementBlock("div",{key:me,class:s.normalizeClass(s.unref(S).e("stop")),style:s.normalizeStyle(s.unref(H)(Ce))},null,6))),128))])):s.createCommentVNode("v-if",!0),s.unref(X).length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("div",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(X),(Ce,me)=>(s.openBlock(),s.createElementBlock("div",{key:me,style:s.normalizeStyle(s.unref(H)(Ce.position)),class:s.normalizeClass([s.unref(S).e("stop"),s.unref(S).e("marks-stop")])},null,6))),128))]),s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("marks"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(X),(Ce,me)=>(s.openBlock(),s.createBlock(s.unref(rL),{key:me,mark:Ce.mark,style:s.normalizeStyle(s.unref(H)(Ce.position)),onMousedown:s.withModifiers(ce=>s.unref(R)(Ce.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):s.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),de.showInput&&!de.range?(s.openBlock(),s.createBlock(s.unref(vN),{key:0,ref:"input","model-value":s.unref(ne),class:s.normalizeClass(s.unref(S).e("input")),step:de.step,disabled:s.unref(f),controls:de.showInputControls,min:de.min,max:de.max,precision:s.unref(ee),debounce:de.debounce,size:s.unref(O),"onUpdate:modelValue":s.unref(U),onChange:s.unref(w)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):s.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var sL=si(nL,[["__file","slider.vue"]]);const rw=Gn(sL),oL=ei({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:X4},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:ho},activeActionIcon:{type:ho},activeIcon:{type:ho},inactiveIcon:{type:ho},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:Pr(Function)},id:String,tabindex:{type:[String,Number]},...Ys(["ariaLabel"])}),aL={[Wi]:N=>uo(N)||Dn(N)||Ri(N),[Mo]:N=>uo(N)||Dn(N)||Ri(N),[To]:N=>uo(N)||Dn(N)||Ri(N)},uA="ElSwitch",lL=s.defineComponent({name:uA}),cL=s.defineComponent({...lL,props:oL,emits:aL,setup(N,{expose:Q,emit:a}){const x=N,{formItem:S}=Ao(),A=mo(),h=Jr("switch"),{inputId:d}=vl(x,{formItemContext:S}),u=gl(s.computed(()=>x.loading)),l=s.ref(x.modelValue!==!1),c=s.ref(),f=s.ref(),p=s.computed(()=>[h.b(),h.m(A.value),h.is("disabled",u.value),h.is("checked",w.value)]),m=s.computed(()=>[h.e("label"),h.em("label","left"),h.is("active",!w.value)]),v=s.computed(()=>[h.e("label"),h.em("label","right"),h.is("active",w.value)]),_=s.computed(()=>({width:dh(x.width)}));s.watch(()=>x.modelValue,()=>{l.value=!0});const b=s.computed(()=>l.value?x.modelValue:!1),w=s.computed(()=>b.value===x.activeValue);[x.activeValue,x.inactiveValue].includes(b.value)||(a(Wi,x.inactiveValue),a(Mo,x.inactiveValue),a(To,x.inactiveValue)),s.watch(w,R=>{var U;c.value.checked=R,x.validateEvent&&((U=S==null?void 0:S.validate)==null||U.call(S,"change").catch(G=>Ki(G)))});const C=()=>{const R=w.value?x.inactiveValue:x.activeValue;a(Wi,R),a(Mo,R),a(To,R),s.nextTick(()=>{c.value.checked=w.value})},k=()=>{if(u.value)return;const{beforeChange:R}=x;if(!R){C();return}const U=R();[db(U),uo(U)].includes(!0)||ch(uA,"beforeChange must return type `Promise<boolean>` or `boolean`"),db(U)?U.then(j=>{j&&C()}).catch(j=>{Ki(uA,`some error occurred: ${j}`)}):U&&C()},T=()=>{var R,U;(U=(R=c.value)==null?void 0:R.focus)==null||U.call(R)};return s.onMounted(()=>{c.value.checked=w.value}),Q({focus:T,checked:w}),(R,U)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(p)),onClick:s.withModifiers(k,["prevent"])},[s.createElementVNode("input",{id:s.unref(d),ref_key:"input",ref:c,class:s.normalizeClass(s.unref(h).e("input")),type:"checkbox",role:"switch","aria-checked":s.unref(w),"aria-disabled":s.unref(u),"aria-label":R.ariaLabel,name:R.name,"true-value":R.activeValue,"false-value":R.inactiveValue,disabled:s.unref(u),tabindex:R.tabindex,onChange:C,onKeydown:s.withKeys(k,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!R.inlinePrompt&&(R.inactiveIcon||R.inactiveText)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(m))},[R.inactiveIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.inactiveIcon)))]),_:1})):s.createCommentVNode("v-if",!0),!R.inactiveIcon&&R.inactiveText?(s.openBlock(),s.createElementBlock("span",{key:1,"aria-hidden":s.unref(w)},s.toDisplayString(R.inactiveText),9,["aria-hidden"])):s.createCommentVNode("v-if",!0)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("span",{ref_key:"core",ref:f,class:s.normalizeClass(s.unref(h).e("core")),style:s.normalizeStyle(s.unref(_))},[R.inlinePrompt?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(h).e("inner"))},[R.activeIcon||R.inactiveIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(h).is("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(w)?R.activeIcon:R.inactiveIcon)))]),_:1},8,["class"])):R.activeText||R.inactiveText?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(h).is("text")),"aria-hidden":!s.unref(w)},s.toDisplayString(s.unref(w)?R.activeText:R.inactiveText),11,["aria-hidden"])):s.createCommentVNode("v-if",!0)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(h).e("action"))},[R.loading?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(h).is("loading"))},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.Loading))]),_:1},8,["class"])):s.unref(w)?s.renderSlot(R.$slots,"active-action",{key:1},()=>[R.activeActionIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.activeActionIcon)))]),_:1})):s.createCommentVNode("v-if",!0)]):s.unref(w)?s.createCommentVNode("v-if",!0):s.renderSlot(R.$slots,"inactive-action",{key:2},()=>[R.inactiveActionIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.inactiveActionIcon)))]),_:1})):s.createCommentVNode("v-if",!0)])],2)],6),!R.inlinePrompt&&(R.activeIcon||R.activeText)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(v))},[R.activeIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.activeIcon)))]),_:1})):s.createCommentVNode("v-if",!0),!R.activeIcon&&R.activeText?(s.openBlock(),s.createElementBlock("span",{key:1,"aria-hidden":!s.unref(w)},s.toDisplayString(R.activeText),9,["aria-hidden"])):s.createCommentVNode("v-if",!0)],2)):s.createCommentVNode("v-if",!0)],10,["onClick"]))}});var uL=si(cL,[["__file","switch.vue"]]);const dL=Gn(uL),pc="$treeNodeId",iw=function(N,Q){!Q||Q[pc]||Object.defineProperty(Q,pc,{value:N.id,enumerable:!1,configurable:!1,writable:!1})},dA=function(N,Q){return N?Q[N]:Q[pc]},hA=(N,Q,a)=>{const x=N.value.currentNode;a();const S=N.value.currentNode;x!==S&&Q("current-change",S?S.data:null,S)},fA=N=>{let Q=!0,a=!0,x=!0;for(let S=0,A=N.length;S<A;S++){const h=N[S];(h.checked!==!0||h.indeterminate)&&(Q=!1,h.disabled||(x=!1)),(h.checked!==!1||h.indeterminate)&&(a=!1)}return{all:Q,none:a,allWithoutDisable:x,half:!Q&&!a}},Du=function(N){if(N.childNodes.length===0||N.loading)return;const{all:Q,none:a,half:x}=fA(N.childNodes);Q?(N.checked=!0,N.indeterminate=!1):x?(N.checked=!1,N.indeterminate=!0):a&&(N.checked=!1,N.indeterminate=!1);const S=N.parent;!S||S.level===0||N.store.checkStrictly||Du(S)},Mh=function(N,Q){const a=N.store.props,x=N.data||{},S=a[Q];if(typeof S=="function")return S(x,N);if(typeof S=="string")return x[S];if(typeof S>"u"){const A=x[Q];return A===void 0?"":A}};let hL=0,pA=class Yp{constructor(Q){this.id=hL++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const a in Q)hu(Q,a)&&(this[a]=Q[a]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const Q=this.store;if(!Q)throw new Error("[Node]store is required!");Q.registerNode(this);const a=Q.props;if(a&&typeof a.isLeaf<"u"){const A=Mh(this,"isLeaf");typeof A=="boolean"&&(this.isLeafByUser=A)}if(Q.lazy!==!0&&this.data?(this.setData(this.data),Q.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&Q.lazy&&Q.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||iw(this,this.data),!this.data)return;const x=Q.defaultExpandedKeys,S=Q.key;S&&x&&x.includes(this.key)&&this.expand(null,Q.autoExpandParent),S&&Q.currentNodeKey!==void 0&&this.key===Q.currentNodeKey&&(Q.currentNode=this,Q.currentNode.isCurrent=!0),Q.lazy&&Q._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(Q){Array.isArray(Q)||iw(this,Q),this.data=Q,this.childNodes=[];let a;this.level===0&&Array.isArray(this.data)?a=this.data:a=Mh(this,"children")||[];for(let x=0,S=a.length;x<S;x++)this.insertChild({data:a[x]})}get label(){return Mh(this,"label")}get key(){const Q=this.store.key;return this.data?this.data[Q]:null}get disabled(){return Mh(this,"disabled")}get nextSibling(){const Q=this.parent;if(Q){const a=Q.childNodes.indexOf(this);if(a>-1)return Q.childNodes[a+1]}return null}get previousSibling(){const Q=this.parent;if(Q){const a=Q.childNodes.indexOf(this);if(a>-1)return a>0?Q.childNodes[a-1]:null}return null}contains(Q,a=!0){return(this.childNodes||[]).some(x=>x===Q||a&&x.contains(Q))}remove(){const Q=this.parent;Q&&Q.removeChild(this)}insertChild(Q,a,x){if(!Q)throw new Error("InsertChild error: child is required.");if(!(Q instanceof Yp)){if(!x){const S=this.getChildren(!0);S.includes(Q.data)||(typeof a>"u"||a<0?S.push(Q.data):S.splice(a,0,Q.data))}Object.assign(Q,{parent:this,store:this.store}),Q=s.reactive(new Yp(Q)),Q instanceof Yp&&Q.initialize()}Q.level=this.level+1,typeof a>"u"||a<0?this.childNodes.push(Q):this.childNodes.splice(a,0,Q),this.updateLeafState()}insertBefore(Q,a){let x;a&&(x=this.childNodes.indexOf(a)),this.insertChild(Q,x)}insertAfter(Q,a){let x;a&&(x=this.childNodes.indexOf(a),x!==-1&&(x+=1)),this.insertChild(Q,x)}removeChild(Q){const a=this.getChildren()||[],x=a.indexOf(Q.data);x>-1&&a.splice(x,1);const S=this.childNodes.indexOf(Q);S>-1&&(this.store&&this.store.deregisterNode(Q),Q.parent=null,this.childNodes.splice(S,1)),this.updateLeafState()}removeChildByData(Q){let a=null;for(let x=0;x<this.childNodes.length;x++)if(this.childNodes[x].data===Q){a=this.childNodes[x];break}a&&this.removeChild(a)}expand(Q,a){const x=()=>{if(a){let S=this.parent;for(;S.level>0;)S.expanded=!0,S=S.parent}this.expanded=!0,Q&&Q(),this.childNodes.forEach(S=>{S.canFocus=!0})};this.shouldLoadData()?this.loadData(S=>{Array.isArray(S)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||Du(this),x())}):x()}doCreateChildren(Q,a={}){Q.forEach(x=>{this.insertChild(Object.assign({data:x},a),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(Q=>{Q.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const Q=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!Q||Q.length===0;return}this.isLeaf=!1}setChecked(Q,a,x,S){if(this.indeterminate=Q==="half",this.checked=Q===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:h,allWithoutDisable:d}=fA(this.childNodes);!this.isLeaf&&!h&&d&&(this.checked=!1,Q=!1);const u=()=>{if(a){const l=this.childNodes;for(let p=0,m=l.length;p<m;p++){const v=l[p];S=S||Q!==!1;const _=v.disabled?v.checked:S;v.setChecked(_,a,!0,S)}const{half:c,all:f}=fA(l);f||(this.checked=f,this.indeterminate=c)}};if(this.shouldLoadData()){this.loadData(()=>{u(),Du(this)},{checked:Q!==!1});return}else u()}const A=this.parent;!A||A.level===0||x||Du(A)}getChildren(Q=!1){if(this.level===0)return this.data;const a=this.data;if(!a)return null;const x=this.store.props;let S="children";return x&&(S=x.children||"children"),a[S]===void 0&&(a[S]=null),Q&&!a[S]&&(a[S]=[]),a[S]}updateChildren(){const Q=this.getChildren()||[],a=this.childNodes.map(A=>A.data),x={},S=[];Q.forEach((A,h)=>{const d=A[pc];!!d&&a.findIndex(l=>l[pc]===d)>=0?x[d]={index:h,data:A}:S.push({index:h,data:A})}),this.store.lazy||a.forEach(A=>{x[A[pc]]||this.removeChildByData(A)}),S.forEach(({index:A,data:h})=>{this.insertChild({data:h},A)}),this.updateLeafState()}loadData(Q,a={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(a).length)){this.loading=!0;const x=A=>{this.childNodes=[],this.doCreateChildren(A,a),this.loaded=!0,this.loading=!1,this.updateLeafState(),Q&&Q.call(this,A)},S=()=>{this.loading=!1};this.store.load(this,x,S)}else Q&&Q.call(this)}eachNode(Q){const a=[this];for(;a.length;){const x=a.shift();a.unshift(...x.childNodes),Q(x)}}reInitChecked(){this.store.checkStrictly||Du(this)}};class fL{constructor(Q){this.currentNode=null,this.currentNodeKey=null;for(const a in Q)hu(Q,a)&&(this[a]=Q[a]);this.nodesMap={}}initialize(){if(this.root=new pA({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const Q=this.load;Q(this.root,a=>{this.root.doCreateChildren(a),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(Q){const a=this.filterNodeMethod,x=this.lazy,S=function(A){const h=A.root?A.root.childNodes:A.childNodes;if(h.forEach(d=>{d.visible=a.call(d,Q,d.data,d),S(d)}),!A.visible&&h.length){let d=!0;d=!h.some(u=>u.visible),A.root?A.root.visible=d===!1:A.visible=d===!1}Q&&A.visible&&!A.isLeaf&&(!x||A.loaded)&&A.expand()};S(this)}setData(Q){Q!==this.root.data?(this.root.setData(Q),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(Q){if(Q instanceof pA)return Q;const a=qn(Q)?dA(this.key,Q):Q;return this.nodesMap[a]||null}insertBefore(Q,a){const x=this.getNode(a);x.parent.insertBefore({data:Q},x)}insertAfter(Q,a){const x=this.getNode(a);x.parent.insertAfter({data:Q},x)}remove(Q){const a=this.getNode(Q);a&&a.parent&&(a===this.currentNode&&(this.currentNode=null),a.parent.removeChild(a))}append(Q,a){const x=ec(a)?this.root:this.getNode(a);x&&x.insertChild({data:Q})}_initDefaultCheckedNodes(){const Q=this.defaultCheckedKeys||[],a=this.nodesMap;Q.forEach(x=>{const S=a[x];S&&S.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(Q){(this.defaultCheckedKeys||[]).includes(Q.key)&&Q.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(Q){Q!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=Q,this._initDefaultCheckedNodes())}registerNode(Q){const a=this.key;!Q||!Q.data||(a?Q.key!==void 0&&(this.nodesMap[Q.key]=Q):this.nodesMap[Q.id]=Q)}deregisterNode(Q){!this.key||!Q||!Q.data||(Q.childNodes.forEach(x=>{this.deregisterNode(x)}),delete this.nodesMap[Q.key])}getCheckedNodes(Q=!1,a=!1){const x=[],S=function(A){(A.root?A.root.childNodes:A.childNodes).forEach(d=>{(d.checked||a&&d.indeterminate)&&(!Q||Q&&d.isLeaf)&&x.push(d.data),S(d)})};return S(this),x}getCheckedKeys(Q=!1){return this.getCheckedNodes(Q).map(a=>(a||{})[this.key])}getHalfCheckedNodes(){const Q=[],a=function(x){(x.root?x.root.childNodes:x.childNodes).forEach(A=>{A.indeterminate&&Q.push(A.data),a(A)})};return a(this),Q}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(Q=>(Q||{})[this.key])}_getAllNodes(){const Q=[],a=this.nodesMap;for(const x in a)hu(a,x)&&Q.push(a[x]);return Q}updateChildren(Q,a){const x=this.nodesMap[Q];if(!x)return;const S=x.childNodes;for(let A=S.length-1;A>=0;A--){const h=S[A];this.remove(h.data)}for(let A=0,h=a.length;A<h;A++){const d=a[A];this.append(d,x.data)}}_setCheckedKeys(Q,a=!1,x){const S=this._getAllNodes().sort((u,l)=>u.level-l.level),A=Object.create(null),h=Object.keys(x);S.forEach(u=>u.setChecked(!1,!1));const d=u=>{u.childNodes.forEach(l=>{var c;A[l.data[Q]]=!0,(c=l.childNodes)!=null&&c.length&&d(l)})};for(let u=0,l=S.length;u<l;u++){const c=S[u],f=c.data[Q].toString();if(!h.includes(f)){c.checked&&!A[f]&&c.setChecked(!1,!1);continue}if(c.childNodes.length&&d(c),c.isLeaf||this.checkStrictly){c.setChecked(!0,!1);continue}if(c.setChecked(!0,!0),a){c.setChecked(!1,!1);const m=function(v){v.childNodes.forEach(b=>{b.isLeaf||b.setChecked(!1,!1),m(b)})};m(c)}}}setCheckedNodes(Q,a=!1){const x=this.key,S={};Q.forEach(A=>{S[(A||{})[x]]=!0}),this._setCheckedKeys(x,a,S)}setCheckedKeys(Q,a=!1){this.defaultCheckedKeys=Q;const x=this.key,S={};Q.forEach(A=>{S[A]=!0}),this._setCheckedKeys(x,a,S)}setDefaultExpandedKeys(Q){Q=Q||[],this.defaultExpandedKeys=Q,Q.forEach(a=>{const x=this.getNode(a);x&&x.expand(null,this.autoExpandParent)})}setChecked(Q,a,x){const S=this.getNode(Q);S&&S.setChecked(!!a,x)}getCurrentNode(){return this.currentNode}setCurrentNode(Q){const a=this.currentNode;a&&(a.isCurrent=!1),this.currentNode=Q,this.currentNode.isCurrent=!0}setUserCurrentNode(Q,a=!0){const x=Q[this.key],S=this.nodesMap[x];this.setCurrentNode(S),a&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(Q,a=!0){if(Q==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const x=this.getNode(Q);x&&(this.setCurrentNode(x),a&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const pL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(N){const Q=Jr("tree"),a=s.inject("NodeInstance"),x=s.inject("RootTree");return()=>{const S=N.node,{data:A,store:h}=S;return N.renderContent?N.renderContent(s.h,{_self:a,node:S,data:A,store:h}):s.renderSlot(x.ctx.slots,"default",{node:S,data:A},()=>[s.h("span",{class:Q.be("node","label")},[S.label])])}}});var mL=si(pL,[["__file","tree-node-content.vue"]]);function nw(N){const Q=s.inject("TreeNodeMap",null),a={treeNodeExpand:x=>{N.node!==x&&N.node.collapse()},children:[]};return Q&&Q.children.push(a),s.provide("TreeNodeMap",a),{broadcastExpanded:x=>{if(N.accordion)for(const S of a.children)S.treeNodeExpand(x)}}}const sw=Symbol("dragEvents");function AL({props:N,ctx:Q,el$:a,dropIndicator$:x,store:S}){const A=Jr("tree"),h=s.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),d=({event:c,treeNode:f})=>{if(typeof N.allowDrag=="function"&&!N.allowDrag(f.node))return c.preventDefault(),!1;c.dataTransfer.effectAllowed="move";try{c.dataTransfer.setData("text/plain","")}catch{}h.value.draggingNode=f,Q.emit("node-drag-start",f.node,c)},u=({event:c,treeNode:f})=>{const p=f,m=h.value.dropNode;m&&m.node.id!==p.node.id&&vm(m.$el,A.is("drop-inner"));const v=h.value.draggingNode;if(!v||!p)return;let _=!0,b=!0,w=!0,C=!0;typeof N.allowDrop=="function"&&(_=N.allowDrop(v.node,p.node,"prev"),C=b=N.allowDrop(v.node,p.node,"inner"),w=N.allowDrop(v.node,p.node,"next")),c.dataTransfer.dropEffect=b||_||w?"move":"none",(_||b||w)&&(m==null?void 0:m.node.id)!==p.node.id&&(m&&Q.emit("node-drag-leave",v.node,m.node,c),Q.emit("node-drag-enter",v.node,p.node,c)),_||b||w?h.value.dropNode=p:h.value.dropNode=null,p.node.nextSibling===v.node&&(w=!1),p.node.previousSibling===v.node&&(_=!1),p.node.contains(v.node,!1)&&(b=!1),(v.node===p.node||v.node.contains(p.node))&&(_=!1,b=!1,w=!1);const k=p.$el.querySelector(`.${A.be("node","content")}`).getBoundingClientRect(),T=a.value.getBoundingClientRect();let R;const U=_?b?.25:w?.45:1:-1,G=w?b?.75:_?.55:0:1;let j=-9999;const H=c.clientY-k.top;H<k.height*U?R="before":H>k.height*G?R="after":b?R="inner":R="none";const W=p.$el.querySelector(`.${A.be("node","expand-icon")}`).getBoundingClientRect(),K=x.value;R==="before"?j=W.top-T.top:R==="after"&&(j=W.bottom-T.top),K.style.top=`${j}px`,K.style.left=`${W.right-T.left}px`,R==="inner"?G4(p.$el,A.is("drop-inner")):vm(p.$el,A.is("drop-inner")),h.value.showDropIndicator=R==="before"||R==="after",h.value.allowDrop=h.value.showDropIndicator||C,h.value.dropType=R,Q.emit("node-drag-over",v.node,p.node,c)},l=c=>{const{draggingNode:f,dropType:p,dropNode:m}=h.value;if(c.preventDefault(),c.dataTransfer.dropEffect="move",f&&m){const v={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?m.node.parent.insertBefore(v,m.node):p==="after"?m.node.parent.insertAfter(v,m.node):p==="inner"&&m.node.insertChild(v),p!=="none"&&(S.value.registerNode(v),S.value.key&&f.node.eachNode(_=>{var b;(b=S.value.nodesMap[_.data[S.value.key]])==null||b.setChecked(_.checked,!S.value.checkStrictly)})),vm(m.$el,A.is("drop-inner")),Q.emit("node-drag-end",f.node,m.node,p,c),p!=="none"&&Q.emit("node-drop",f.node,m.node,p,c)}f&&!m&&Q.emit("node-drag-end",f.node,null,p,c),h.value.showDropIndicator=!1,h.value.draggingNode=null,h.value.dropNode=null,h.value.allowDrop=!0};return s.provide(sw,{treeNodeDragStart:d,treeNodeDragOver:u,treeNodeDragEnd:l}),{dragState:h}}const gL=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:BO,ElCheckbox:Jm,NodeContent:mL,ElIcon:ni,Loading:ui.Loading},props:{node:{type:pA,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(N,Q){const a=Jr("tree"),{broadcastExpanded:x}=nw(N),S=s.inject("RootTree"),A=s.ref(!1),h=s.ref(!1),d=s.ref(null),u=s.ref(null),l=s.ref(null),c=s.inject(sw),f=s.getCurrentInstance();s.provide("NodeInstance",f),S||Ki("Tree","Can not find node's tree."),N.node.expanded&&(A.value=!0,h.value=!0);const p=S.props.props.children||"children";s.watch(()=>{const H=N.node.data[p];return H&&[...H]},()=>{N.node.updateChildren()}),s.watch(()=>N.node.indeterminate,H=>{_(N.node.checked,H)}),s.watch(()=>N.node.checked,H=>{_(H,N.node.indeterminate)}),s.watch(()=>N.node.childNodes.length,()=>N.node.reInitChecked()),s.watch(()=>N.node.expanded,H=>{s.nextTick(()=>A.value=H),H&&(h.value=!0)});const m=H=>dA(S.props.nodeKey,H.data),v=H=>{const W=N.props.class;if(!W)return{};let K;if(mn(W)){const{data:$}=H;K=W($,H)}else K=W;return Dn(K)?{[K]:!0}:K},_=(H,W)=>{(d.value!==H||u.value!==W)&&S.ctx.emit("check-change",N.node.data,H,W),d.value=H,u.value=W},b=H=>{hA(S.store,S.ctx.emit,()=>S.store.value.setCurrentNode(N.node)),S.currentNode.value=N.node,S.props.expandOnClickNode&&C(),S.props.checkOnClickNode&&!N.node.disabled&&k(null,{target:{checked:!N.node.checked}}),S.ctx.emit("node-click",N.node.data,N.node,f,H)},w=H=>{S.instance.vnode.props.onNodeContextmenu&&(H.stopPropagation(),H.preventDefault()),S.ctx.emit("node-contextmenu",H,N.node.data,N.node,f)},C=()=>{N.node.isLeaf||(A.value?(S.ctx.emit("node-collapse",N.node.data,N.node,f),N.node.collapse()):(N.node.expand(),Q.emit("node-expand",N.node.data,N.node,f)))},k=(H,W)=>{N.node.setChecked(W.target.checked,!S.props.checkStrictly),s.nextTick(()=>{const K=S.store.value;S.ctx.emit("check",N.node.data,{checkedNodes:K.getCheckedNodes(),checkedKeys:K.getCheckedKeys(),halfCheckedNodes:K.getHalfCheckedNodes(),halfCheckedKeys:K.getHalfCheckedKeys()})})};return{ns:a,node$:l,tree:S,expanded:A,childNodeRendered:h,oldChecked:d,oldIndeterminate:u,getNodeKey:m,getNodeClass:v,handleSelectChange:_,handleClick:b,handleContextMenu:w,handleExpandIconClick:C,handleCheckChange:k,handleChildNodeExpand:(H,W,K)=>{x(W),S.ctx.emit("node-expand",H,W,K)},handleDragStart:H=>{S.props.draggable&&c.treeNodeDragStart({event:H,treeNode:N})},handleDragOver:H=>{H.preventDefault(),S.props.draggable&&c.treeNodeDragOver({event:H,treeNode:{$el:l.value,node:N.node}})},handleDrop:H=>{H.preventDefault()},handleDragEnd:H=>{S.props.draggable&&c.treeNodeDragEnd(H)},CaretRight:ui.CaretRight}}});function vL(N,Q,a,x,S,A){const h=s.resolveComponent("el-icon"),d=s.resolveComponent("el-checkbox"),u=s.resolveComponent("loading"),l=s.resolveComponent("node-content"),c=s.resolveComponent("el-tree-node"),f=s.resolveComponent("el-collapse-transition");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"node$",class:s.normalizeClass([N.ns.b("node"),N.ns.is("expanded",N.expanded),N.ns.is("current",N.node.isCurrent),N.ns.is("hidden",!N.node.visible),N.ns.is("focusable",!N.node.disabled),N.ns.is("checked",!N.node.disabled&&N.node.checked),N.getNodeClass(N.node)]),role:"treeitem",tabindex:"-1","aria-expanded":N.expanded,"aria-disabled":N.node.disabled,"aria-checked":N.node.checked,draggable:N.tree.props.draggable,"data-key":N.getNodeKey(N.node),onClick:s.withModifiers(N.handleClick,["stop"]),onContextmenu:N.handleContextMenu,onDragstart:s.withModifiers(N.handleDragStart,["stop"]),onDragover:s.withModifiers(N.handleDragOver,["stop"]),onDragend:s.withModifiers(N.handleDragEnd,["stop"]),onDrop:s.withModifiers(N.handleDrop,["stop"])},[s.createElementVNode("div",{class:s.normalizeClass(N.ns.be("node","content")),style:s.normalizeStyle({paddingLeft:(N.node.level-1)*N.tree.props.indent+"px"})},[N.tree.props.icon||N.CaretRight?(s.openBlock(),s.createBlock(h,{key:0,class:s.normalizeClass([N.ns.be("node","expand-icon"),N.ns.is("leaf",N.node.isLeaf),{expanded:!N.node.isLeaf&&N.expanded}]),onClick:s.withModifiers(N.handleExpandIconClick,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.tree.props.icon||N.CaretRight)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),N.showCheckbox?(s.openBlock(),s.createBlock(d,{key:1,"model-value":N.node.checked,indeterminate:N.node.indeterminate,disabled:!!N.node.disabled,onClick:s.withModifiers(()=>{},["stop"]),onChange:N.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):s.createCommentVNode("v-if",!0),N.node.loading?(s.openBlock(),s.createBlock(h,{key:2,class:s.normalizeClass([N.ns.be("node","loading-icon"),N.ns.is("loading")])},{default:s.withCtx(()=>[s.createVNode(u)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(l,{node:N.node,"render-content":N.renderContent},null,8,["node","render-content"])],6),s.createVNode(f,null,{default:s.withCtx(()=>[!N.renderAfterExpand||N.childNodeRendered?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.ns.be("node","children")),role:"group","aria-expanded":N.expanded},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.node.childNodes,p=>(s.openBlock(),s.createBlock(c,{key:N.getNodeKey(p),"render-content":N.renderContent,"render-after-expand":N.renderAfterExpand,"show-checkbox":N.showCheckbox,node:p,accordion:N.accordion,props:N.props,onNodeExpand:N.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[s.vShow,N.expanded]]):s.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[s.vShow,N.node.visible]])}var yL=si(gL,[["render",vL],["__file","tree-node.vue"]]);function bL({el$:N},Q){const a=Jr("tree"),x=s.shallowRef([]),S=s.shallowRef([]);s.onMounted(()=>{h()}),s.onUpdated(()=>{x.value=Array.from(N.value.querySelectorAll("[role=treeitem]")),S.value=Array.from(N.value.querySelectorAll("input[type=checkbox]"))}),s.watch(S,d=>{d.forEach(u=>{u.setAttribute("tabindex","-1")})}),Zn(N,"keydown",d=>{const u=d.target;if(!u.className.includes(a.b("node")))return;const l=d.code;x.value=Array.from(N.value.querySelectorAll(`.${a.is("focusable")}[role=treeitem]`));const c=x.value.indexOf(u);let f;if([Ii.up,Ii.down].includes(l)){if(d.preventDefault(),l===Ii.up){f=c===-1?0:c!==0?c-1:x.value.length-1;const m=f;for(;!Q.value.getNode(x.value[f].dataset.key).canFocus;){if(f--,f===m){f=-1;break}f<0&&(f=x.value.length-1)}}else{f=c===-1?0:c<x.value.length-1?c+1:0;const m=f;for(;!Q.value.getNode(x.value[f].dataset.key).canFocus;){if(f++,f===m){f=-1;break}f>=x.value.length&&(f=0)}}f!==-1&&x.value[f].focus()}[Ii.left,Ii.right].includes(l)&&(d.preventDefault(),u.click());const p=u.querySelector('[type="checkbox"]');[Ii.enter,Ii.space].includes(l)&&p&&(d.preventDefault(),p.click())});const h=()=>{var d;x.value=Array.from(N.value.querySelectorAll(`.${a.is("focusable")}[role=treeitem]`)),S.value=Array.from(N.value.querySelectorAll("input[type=checkbox]"));const u=N.value.querySelectorAll(`.${a.is("checked")}[role=treeitem]`);if(u.length){u[0].setAttribute("tabindex","0");return}(d=x.value[0])==null||d.setAttribute("tabindex","0")}}const _L=s.defineComponent({name:"ElTree",components:{ElTreeNode:yL},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:ho}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(N,Q){const{t:a}=es(),x=Jr("tree"),S=s.inject(Mu,null),A=s.ref(new fL({key:N.nodeKey,data:N.data,lazy:N.lazy,props:N.props,load:N.load,currentNodeKey:N.currentNodeKey,checkStrictly:N.checkStrictly,checkDescendants:N.checkDescendants,defaultCheckedKeys:N.defaultCheckedKeys,defaultExpandedKeys:N.defaultExpandedKeys,autoExpandParent:N.autoExpandParent,defaultExpandAll:N.defaultExpandAll,filterNodeMethod:N.filterNodeMethod}));A.value.initialize();const h=s.ref(A.value.root),d=s.ref(null),u=s.ref(null),l=s.ref(null),{broadcastExpanded:c}=nw(N),{dragState:f}=AL({props:N,ctx:Q,el$:u,dropIndicator$:l,store:A});bL({el$:u},A);const p=s.computed(()=>{const{childNodes:V}=h.value,D=S?S.hasFilteredOptions!==0:!1;return(!V||V.length===0||V.every(({visible:X})=>!X))&&!D});s.watch(()=>N.currentNodeKey,V=>{A.value.setCurrentNodeKey(V)}),s.watch(()=>N.defaultCheckedKeys,V=>{A.value.setDefaultCheckedKey(V)}),s.watch(()=>N.defaultExpandedKeys,V=>{A.value.setDefaultExpandedKeys(V)}),s.watch(()=>N.data,V=>{A.value.setData(V)},{deep:!0}),s.watch(()=>N.checkStrictly,V=>{A.value.checkStrictly=V});const m=V=>{if(!N.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");A.value.filter(V)},v=V=>dA(N.nodeKey,V.data),_=V=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const D=A.value.getNode(V);if(!D)return[];const X=[D.data];let ee=D.parent;for(;ee&&ee!==h.value;)X.push(ee.data),ee=ee.parent;return X.reverse()},b=(V,D)=>A.value.getCheckedNodes(V,D),w=V=>A.value.getCheckedKeys(V),C=()=>{const V=A.value.getCurrentNode();return V?V.data:null},k=()=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const V=C();return V?V[N.nodeKey]:null},T=(V,D)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");A.value.setCheckedNodes(V,D)},R=(V,D)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");A.value.setCheckedKeys(V,D)},U=(V,D,X)=>{A.value.setChecked(V,D,X)},G=()=>A.value.getHalfCheckedNodes(),j=()=>A.value.getHalfCheckedKeys(),H=(V,D=!0)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");hA(A,Q.emit,()=>{c(V),A.value.setUserCurrentNode(V,D)})},W=(V,D=!0)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");hA(A,Q.emit,()=>{c(),A.value.setCurrentNodeKey(V,D)})},K=V=>A.value.getNode(V),$=V=>{A.value.remove(V)},O=(V,D)=>{A.value.append(V,D)},L=(V,D)=>{A.value.insertBefore(V,D)},M=(V,D)=>{A.value.insertAfter(V,D)},I=(V,D,X)=>{c(D),Q.emit("node-expand",V,D,X)},F=(V,D)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");A.value.updateChildren(V,D)};return s.provide("RootTree",{ctx:Q,props:N,store:A,root:h,currentNode:d,instance:s.getCurrentInstance()}),s.provide(Su,void 0),{ns:x,store:A,root:h,currentNode:d,dragState:f,el$:u,dropIndicator$:l,isEmpty:p,filter:m,getNodeKey:v,getNodePath:_,getCheckedNodes:b,getCheckedKeys:w,getCurrentNode:C,getCurrentKey:k,setCheckedNodes:T,setCheckedKeys:R,setChecked:U,getHalfCheckedNodes:G,getHalfCheckedKeys:j,setCurrentNode:H,setCurrentKey:W,t:a,getNode:K,remove:$,append:O,insertBefore:L,insertAfter:M,handleNodeExpand:I,updateKeyChildren:F}}});function wL(N,Q,a,x,S,A){const h=s.resolveComponent("el-tree-node");return s.openBlock(),s.createElementBlock("div",{ref:"el$",class:s.normalizeClass([N.ns.b(),N.ns.is("dragging",!!N.dragState.draggingNode),N.ns.is("drop-not-allow",!N.dragState.allowDrop),N.ns.is("drop-inner",N.dragState.dropType==="inner"),{[N.ns.m("highlight-current")]:N.highlightCurrent}]),role:"tree"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.root.childNodes,d=>(s.openBlock(),s.createBlock(h,{key:N.getNodeKey(d),node:d,props:N.props,accordion:N.accordion,"render-after-expand":N.renderAfterExpand,"show-checkbox":N.showCheckbox,"render-content":N.renderContent,onNodeExpand:N.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),N.isEmpty?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.ns.e("empty-block"))},[s.renderSlot(N.$slots,"empty",{},()=>{var d;return[s.createElementVNode("span",{class:s.normalizeClass(N.ns.e("empty-text"))},s.toDisplayString((d=N.emptyText)!=null?d:N.t("el.tree.emptyText")),3)]})],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{ref:"dropIndicator$",class:s.normalizeClass(N.ns.e("drop-indicator"))},null,2),[[s.vShow,N.dragState.showDropIndicator]])],2)}var xL=si(_L,[["render",wL],["__file","tree.vue"]]);const CL=Gn(xL);or.on("ThemeConfig",()=>{br.ConfigViewer()});class br{static ConfigViewer(){if(Br.BIMX_CONFIGS.themeColor&&br.setTheme(Vt("themeColor")),Br.BIMX_CONFIGS.isMobile&&(br.setProperty("--annotation-marker-size","32px"),br.setProperty("--annotation-marker-img-size","18px")),Br.BIMX_CONFIGS.topHeight||Br.BIMX_CONFIGS.bottomHeight){const Q=parseInt(Vt("topHeight"));if(Vt("isMobile"))br.setProperty("--mobile-top-height",`${(8+Q).toString()}px`);else{const a=parseInt(Vt("bottomHeight")),x=Q+a;br.setProperty("--tall-panel-height",`calc(100% - ${x.toString()}px)`),br.setProperty("--operate-item-top",`${(14+Q).toString()}px`),br.setProperty("--left-toggle-top",`${(14+Q).toString()}px`)}br.setProperty("--alert-box-top",`${(40+Q).toString()}px`)}if(Br.BIMX_CONFIGS.annotationPos){const Q=Vt("annotationPos").pos,a=Vt("annotationPos").posNum;Q.includes("top")&&br.setProperty("--annotation-panel-triangle-border","0 6px 6px "),Q.includes("bottom")&&br.setProperty("--annotation-panel-triangle-border"," 6px 6px 0"),Q.includes("-")?(br.setProperty("--annotation-panel-width","unset"),Q.includes("left")?br.setProperty("--annotation-panel-left",a[0].toString()+"px"):br.setProperty("--annotation-panel-left","unset"),Q.includes("right")?br.setProperty("--annotation-panel-right",a[0].toString()+"px"):br.setProperty("--annotation-panel-right","unset"),Q.includes("bottom")?br.setProperty("--annotation-panel-bottom",a[1].toString()+"px"):br.setProperty("--annotation-panel-bottom","unset"),Q.includes("top")?br.setProperty("--annotation-panel-top",a[1].toString()+"px"):br.setProperty("--annotation-panel-top","unset")):(Q.includes("bottom")&&br.setProperty("--annotation-panel-right","calc(50% - 136px)"),br.setProperty("--annotation-panel-"+Q,a[0].toString()+"px"))}if(Br.BIMX_CONFIGS.commentPos){const Q=Vt("commentPos").pos,a=Vt("commentPos").posNum;Q.includes("top")&&(br.setProperty("--comment-panel-triangle-display","unset"),br.setProperty("--comment-panel-triangle-border","0 6px 6px "),br.setProperty("--comment-color-panel-top","46px"),br.setProperty("--comment-color-panel-left","-9px"),br.setProperty("--comment-color-edit-tips-bottom","48px")),Q.includes("bottom")&&br.setProperty("--comment-panel-triangle-border"," 6px 6px 0"),Q.includes("-")?(br.setProperty("--comment-panel-width","unset"),Q.includes("left")?br.setProperty("--comment-panel-left",a[0].toString()+"px"):br.setProperty("--comment-panel-left","unset"),Q.includes("right")?br.setProperty("--comment-panel-right",a[0].toString()+"px"):br.setProperty("--comment-panel-right","unset"),Q.includes("bottom")?br.setProperty("--comment-panel-bottom",a[1].toString()+"px"):br.setProperty("--comment-panel-bottom","unset"),Q.includes("top")?br.setProperty("--comment-panel-top",a[1].toString()+"px"):br.setProperty("--comment-panel-top","unset")):((Q.includes("top")||Q.includes("bottom"))&&(br.setProperty("--comment-panel-wrapper-width","100%"),br.setProperty("--comment-panel-left","0"),br.setProperty("--comment-panel-right","0")),br.setProperty("--comment-panel-"+Q,a[0].toString()+"px"))}if(Br.BIMX_CONFIGS.roamPos){const Q=Vt("roamPos").pos,a=parseInt(Vt("topHeight")),x=parseInt(Vt("bottomHeight"));Q.includes("top")&&(br.setProperty("--roam-toolbar-top",`${(30+a).toString()}px`),br.setProperty("--roam-toolbar-bottom","unset")),Q.includes("bottom")&&(br.setProperty("--roam-toolbar-top","unset"),br.setProperty("--roam-toolbar-bottom",`${(14+x).toString()}px`))}}static get currentTheme(){return document.documentElement.getAttribute("data-theme")}static setTheme(Q){document.documentElement.setAttribute("data-theme",Q)}static setProperty(Q,a){document.body.style.setProperty(Q,a)}static getProperty(Q){return document.body.style.getPropertyValue(Q)}}const Th=(N,Q)=>{let a=0,x=0;return Vt("navCubePos").pos.includes("left")?a+=parseInt(Vt("leftWidth")):Vt("navCubePos").pos.includes("right")&&(a+=parseInt(Vt("rightWidth"))),Vt("navCubePos").pos.includes("top")?x+=parseInt(Vt("topHeight")):Vt("navCubePos").pos.includes("bottom")&&(x+=parseInt(Vt("bottomHeight"))),[N?a+Q:a,x]},EL={class:"unfold_btn"},BL=["onClick"],PL={key:0,class:"tctwins_btn"},SL=["src"],kL=["src"],ML=["src"],TL={key:1,class:"left_button_group"},IL=["src"],DL={key:2,class:"right_button_group"},FL={key:0,class:"cooperate_btn mobile_toggle"},RL=["src"],OL={key:1,class:"bcf_btn mobile_toggle"},NL=["src"],LL={key:3,class:"exit_fullscreen"},jL=["src"],VL={class:"click_events"},UL=s.defineComponent({__name:"AppToolbar",props:["visibleTools"],emits:["emitHandler"],setup(N,{emit:Q}){const a=pi(),x=ji(),S=s.ref(Br.BIMX_CONFIGS.enableTree),A=s.ref(Br.BIMX_CONFIGS.showInspector),h=s.computed(()=>j=>j=="tree"?S.value:j=="inspector"?A.value:!0),d=()=>{const{eventTrigger:j}=window.bimViewer;j.on("treeAllReady",H=>{Bi("enableTree",!0),S.value=!0}),j.on("metaLoaded",H=>{Bi("showInspector",!0),A.value=!0})};or.on("BimViewer",d);const u=x.tools.filter(j=>j.id<14||j.id==17);s.onMounted(()=>{S.value&&x.setToolActiveStatusBykey("tree",!0)});const l=Q,c=j=>{l("emitHandler",j)},f=j=>{v.value=j,R.value=!0,U.value=!0,k.value.enable()};or.on("hideToolbar",f);const p=s.ref(!1),m=j=>{p.value=j,br.setProperty("--toolbar-tool-bottom",`${p.value?"3.8":"1.44"}rem`)};or.on("expandMenu",m),s.onBeforeUnmount(()=>{or.off("hideToolbar",f),or.off("expandMenu",m),or.off("BimViewer",d)});const v=s.ref(!1),_=s.ref(!1),b=j=>{const H=x.getToolByKey(j);H&&(H.isActive?(j!=="reset"&&(R.value=!0,U.value=!0,k.value.enable(),j==="mouse"?T.value=x.isToolActiveBykey("navigate"):T.value=!1),v.value=!1):(j!=="reset"&&j!=="fullscreen"&&j!=="cooperate"&&j!=="mouse"&&(x.setAllToolClose(["fullscreen","mouse"].map(W=>{var K;return(K=x.getToolByKey(W))==null?void 0:K.id}).filter(Boolean)),Ci.SetAllClose()),j!=="reset"&&j!=="navigate"&&j!=="enjoy"&&j!=="share"&&j!=="mouse"&&(R.value=!1,U.value=!1,k.value.disable(),x.setToolActiveStatusBykey("mouse",!1)),j!=="reset"&&(T.value=j==="navigate"),j==="mouse"&&(T.value=x.isToolActiveBykey("navigate")),(j==="comment"||j==="tree"||j==="inspector"||j==="section")&&(v.value=!0),j==="navigate"&&(R.value=!0,U.value=!0,k.value.enable(),T.value=!0)),j==="fullscreen"&&(H.isActive?_.value=!1:_.value=!0),w(H))},w=j=>{var H;j.key!=="fullscreen"&&Ci.SetToolActiveByKey(j.key),x.setToolActiveStatus(j.id),c({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:j.id,toolKey:j.key,status:(H=x.getToolById(j.id))==null?void 0:H.isActive}})},C=()=>{c({isTool:!1,event_target:"ToolBar",event_name:"exitViewer",content:{}})},k=s.ref(),T=s.ref(!1),R=s.ref(!0),U=s.ref(!0),G=()=>{k.value.reset(),window.bimViewer.setAllObjectsVisible(!0),window.bimViewer.setAllObjectsXRayed(!1),window.bimViewer.setAllObjectsSelected(!1),window.bimViewer.setAllObjectsHighlighted(!1),window.bimViewer.setAllObjectsEdges(window.bimViewer.edgesActive)};return(j,H)=>{var $,O,L,M,I,F,V,D,X,ee;const W=yn,K=Tk;return s.openBlock(),s.createElementBlock(s.Fragment,null,[!_.value&&!v.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:"mobile_toolbar",style:s.normalizeStyle({height:p.value?"3.8rem":"unset"})},[s.createElementVNode("div",EL,[s.createElementVNode("div",{class:"unfold_wrapper",onClick:H[0]||(H[0]=q=>m(!p.value))},H[6]||(H[6]=[s.createElementVNode("div",null,null,-1)]))]),s.createVNode(W,null,{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["tctwins_toolbar",{tctwins_toolbar_expend:p.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.visibleTools,q=>(s.openBlock(),s.createElementBlock("div",{key:q.id,class:"tctwins_btn_group",onClick:ne=>b(q.key)},[s.unref(u).includes(q)&&h.value(q.key)?(s.openBlock(),s.createElementBlock("div",PL,[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bar/new-icons/bimkk-mobile-toolbar-${q.isActive?q.imgActive:q.img}.svg`},null,8,SL),s.createElementVNode("span",{class:s.normalizeClass(q.hasActiveState&&s.unref(x).isToolActive(q.id)?"tool_name_active":"tool_name")},s.toDisplayString(s.unref(x).isToolActive(q.id)&&q.key==="fullscreen"?s.unref(a)("toolbar.exitFullscreen"):s.unref(a)(q.name)),3)])):s.createCommentVNode("",!0)],8,BL))),128))],2)]),_:1}),U.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["mouse_btn",{mouse_higher:T.value}])},[s.createElementVNode("div",{class:"mouse",onClick:H[1]||(H[1]=q=>b("mouse"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/industry-viewer/action-bar/${($=s.unref(x).getToolByKey("mouse"))!=null&&$.isActive?(O=s.unref(x).getToolByKey("mouse"))==null?void 0:O.imgActive:(L=s.unref(x).getToolByKey("mouse"))==null?void 0:L.img}.svg`},null,8,kL),s.createElementVNode("span",{style:s.normalizeStyle({color:(M=s.unref(x).getToolByKey("mouse"))!=null&&M.isActive?"#1457F7":"#262626"})},s.toDisplayString(s.unref(a)("toolbar.virtualMouse")),5)]),s.createElementVNode("div",{class:"reset",onClick:G},[s.createElementVNode("img",{src:`${s.unref(Ft)}/industry-viewer/reset.svg`},null,8,ML),s.createElementVNode("span",null,s.toDisplayString(s.unref(a)("common.reset")),1)])],2)):s.createCommentVNode("",!0)],4)):s.createCommentVNode("",!0),_.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",TL,[s.unref(Vt)("backButton")?(s.openBlock(),s.createElementBlock("div",{key:0,class:"back mobile_toggle",onClick:H[2]||(H[2]=q=>C())},[s.createElementVNode("img",{src:s.unref(Ft)+"/bim-viewer/close_black.png"},null,8,IL)])):s.createCommentVNode("",!0)])),_.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",DL,[N.visibleTools&&s.unref(x).isToolEnableBykey("cooperate")?(s.openBlock(),s.createElementBlock("div",FL,[s.createElementVNode("div",{class:s.normalizeClass(["tctwins_btn",{tctwins_btn_active:s.unref(x).isToolActiveBykey("cooperate")&&(((I=s.unref(x).getToolByKey("cooperate"))==null?void 0:I.hasActiveState)??!1)}]),onClick:H[3]||(H[3]=q=>b("cooperate"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/bim-viewer/action-bar/${s.unref(x).isToolActiveBykey("cooperate")?(V=s.unref(x).getToolByKey("cooperate"))==null?void 0:V.imgActive:(F=s.unref(x).getToolByKey("cooperate"))==null?void 0:F.img}.svg`},null,8,RL)],2)])):s.createCommentVNode("",!0),N.visibleTools&&s.unref(x).isToolEnableBykey("bcf")?(s.openBlock(),s.createElementBlock("div",OL,[s.createElementVNode("div",{class:s.normalizeClass(["tctwins_btn",{tctwins_btn_active:s.unref(x).isToolActiveBykey("bcf")&&(((D=s.unref(x).getToolByKey("bcf"))==null?void 0:D.hasActiveState)??!1)}]),onClick:H[4]||(H[4]=q=>b("bcf"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/bim-viewer/action-bar/${s.unref(x).isToolActiveBykey("bcf")?(ee=s.unref(x).getToolByKey("bcf"))==null?void 0:ee.imgActive:(X=s.unref(x).getToolByKey("bcf"))==null?void 0:X.img}.svg`},null,8,NL)],2)])):s.createCommentVNode("",!0)])),_.value?(s.openBlock(),s.createElementBlock("div",LL,[s.createElementVNode("div",{class:"exit_full_btn",onClick:H[5]||(H[5]=q=>b("fullscreen"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/industry-viewer/action-bar/fullscreen-active.svg`},null,8,jL)])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",VL,[s.createVNode(K,{ref_key:"clickEventRef",ref:k},null,512)],512),[[s.vShow,R.value]])],64)}}}),ti=(N,Q)=>{const a=N.__vccOpts||N;for(const[x,S]of Q)a[x]=S;return a},HL=ti(UL,[["__scopeId","data-v-eef618d2"]]),zL={class:"bimx-tools-wrapper"},GL={class:"left_buttons"},QL=["onClick"],WL=["src"],$L={class:"tctwins_toolbar_wrapper"},KL={class:"tctwins_toolbar"},XL=["onClick"],YL=["src"],JL={key:1,class:"splitLine"},ZL={class:"right_buttons"},qL=["onClick"],e5=["src"],t5=ti(s.defineComponent({__name:"Toolbar",props:["visibleTools"],emits:["emitHandler"],setup(N,{emit:Q}){const a=pi(),x=s.ref(Br.BIMX_CONFIGS.enableTree),S=s.ref(Br.BIMX_CONFIGS.showInspector),A=()=>{const{eventTrigger:w}=window.bimViewer;w.on("treeAllReady",C=>{Bi("enableTree",!0),x.value=!0}),w.on("metaLoaded",C=>{Bi("showInspector",!0),S.value=!0})};or.on("BimViewer",A),s.onMounted(()=>{Br.BIMX_CONFIGS.enableTree&&(x.value=!0)}),s.onUnmounted(()=>{or.off("BimViewer",A)});const h=s.computed(()=>w=>w=="tree"?x.value:!0),d=s.computed(()=>w=>w=="inspector"?S.value:!0);Ma.BIMX_CONFIGS.Toolbar||(or.on("BIMX_CONFIGS",()=>{Br.BIMX_CONFIGS.enableTree&&(x.value=!0)}),Ma.BIMX_CONFIGS.Toolbar=!0);const u=Q,l=w=>{u("emitHandler",w)},c=ji(),f=c.tools.filter(w=>w.position==1),p=c.tools.filter(w=>w.position==2),m=w=>{c.isToolActive(w.id)||w.id!=10&&w.id!=1&&(c.setAllToolClose([0,14]),Ci.SetAllClose()),b(w)},v=w=>{c.isToolActive(w.id)||(w.key=="bcf"?(c.setAllToolClose([7,8,9,11]),Ci.SetAllClose()):c.setToolActiveStatusBykey("bcf",!1)),b(w)},_=w=>{c.isToolActive(w.id)||w.key=="enjoy"&&(c.setAllToolClose(),Ci.SetAllClose()),b(w)},b=w=>{Ci.SetToolActiveByKey(w.key),c.setToolActiveStatus(w.id),l({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:w.id,toolKey:w.key,status:w.isActive}})};return(w,C)=>{const k=ku;return s.openBlock(),s.createElementBlock("div",zL,[s.createElementVNode("div",GL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(f),(T,R)=>(s.openBlock(),s.createElementBlock("div",{key:T.id,onClick:U=>v(T)},[T.position==1&&s.unref(c).isToolEnable(T.id)&&h.value(T.key)?(s.openBlock(),s.createBlock(k,{key:0,content:s.unref(a)(T.name),placement:"right",effect:"light"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["toggle_btn",{tctwins_btn_active:T.isActive&&T.hasActiveState}])},[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bars/${T.isActive?T.imgActive:T.img}.svg`,alt:""},null,8,WL)],2)]),_:2},1032,["content"])):s.createCommentVNode("",!0)],8,QL))),128))]),s.createElementVNode("div",$L,[s.createElementVNode("div",KL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.visibleTools,(T,R)=>(s.openBlock(),s.createElementBlock("div",{key:T.id,class:"tctwins_btn-group",onClick:U=>m(T)},[d.value(T.key)?(s.openBlock(),s.createBlock(k,{key:0,content:s.unref(a)(T.name),placement:"top",effect:"light"},{default:s.withCtx(()=>[T.position==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["tctwins_btn",{tctwins_btn_active:T.isActive&&T.hasActiveState}])},[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bars/${T.isActive?T.imgActive:T.img}.svg`,alt:""},null,8,YL)],2)):s.createCommentVNode("",!0)]),_:2},1032,["content"])):s.createCommentVNode("",!0),T.isShowDelimiter&&R!=N.visibleTools.length-1?(s.openBlock(),s.createElementBlock("div",JL)):s.createCommentVNode("",!0)],8,XL))),128))])]),s.createElementVNode("div",ZL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(p),(T,R)=>(s.openBlock(),s.createElementBlock("div",{key:T.id,onClick:U=>_(T)},[T.position==2&&s.unref(c).isToolEnable(T.id)?(s.openBlock(),s.createBlock(k,{key:0,content:s.unref(a)(T.name),placement:"left",effect:"light"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["toggle_btn",{tctwins_btn_active:T.isActive&&T.hasActiveState}])},[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bars/${T.isActive?T.imgActive:T.img}.svg`,alt:""},null,8,e5)],2)]),_:2},1032,["content"])):s.createCommentVNode("",!0)],8,qL))),128))])])}}}),[["__scopeId","data-v-e4035baa"]]),r5="0.1.31";async function i5(){try{return(await Yl.get(`${qS}/oss/sts`)).data.data}catch(N){throw console.error("Error fetching data:",N),N}}async function ow(){try{const N=await i5();return new XS({region:"oss-cn-beijing",accessKeyId:N.accessKeyId,accessKeySecret:N.accessKeySecret,stsToken:N.securityToken,bucket:N.bucketName})}catch(N){console.log("getSTStoken() throw an error: ",N)}}class ja{static async getBuffer(Q,a,x){try{const A=await(await ow()).get(Q);a(A.content.buffer)}catch(S){x&&x(S)}}static async requestFileFromOSS(Q,a,x,S){try{const A=await ow();if(a){const h=await A.get(`${Q}/metadata.json`);x(JSON.parse(h.content))}else{const h=await A.get(`${Q}/index.json`);x(JSON.parse(h.content))}}catch(A){console.error("请求文件失败:",A),S(A)}}static async downloadFile(Q){try{const a=await fetch(Q);if(!a.ok)throw new Error(`Failed to fetch file: ${a.status} ${a.statusText}`);return await a.arrayBuffer()}catch(a){throw console.error("Error fetching file:",a),a}}}const Ih=N=>{if(!N)return"";const Q=N.split("?")[0],a=Q.lastIndexOf("/");if(Q.lastIndexOf(".")===-1)return Q.slice(a+1);const S=Q.slice(a+1),A=S.lastIndexOf(".");return A===-1?S:S.slice(0,A)},mc=N=>{const Q=N.lastIndexOf(".");let a=[];return Q!==-1&&(a=[N.slice(0,Q),N.slice(Q+1)]),a[0]},aw=[];function n5(N){const{viewer:Q}=window.bimViewer,{scene:a}=Q,x=a.models[N];if(!x){console.error("没有找到正确的模型,无法检测构建异常");return}s5({points:o5(x.aabbs),epsilon:100,min_samples:a.numObjects/4>=1?a.numObjects/4:1},S=>{if(S.noise.length>0){const{noise:A}=S;for(const h in A)aw.push(a.objectIds[A[h]]);window.bimViewer.updateAABB(aw,()=>{Q.cameraFlight.jumpTo({aabb:Q.scene.aabb})})}if(S.labels_count>1){const{labels:A}=S;let h;const d=S.change_indices,u=[];for(let l=0;l<d.length;l++)h=d[l],l==d.length-1?u.push(a.objectIds.slice(h,A.length)):u.push(a.objectIds.slice(h,d[l+1]));window.bimViewer.setPartialObjectIds(u)}})}function s5(N,Q){console.log("start dbscan..."),fetch(`${ek}/dbscan/convert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)}).then(a=>(a.ok,a.json())).then(a=>{if(a&&a.error)throw new Error(a.error);a.noise.length>0||a.labels_count>1?(Q(a),console.log("DBSCAN Result:",`noise:${a.noise}`,`labels_count:${a.labels_count}`)):(console.log("DBSCAN Result:",a),console.log("DBSCAN Result: no outlier"))}).catch(a=>{console.error("DBSCAN failed:",a)})}function o5(N){const Q=[];for(let a=0;a<N.length;a++){const x=N[a],S=[(x[0]+x[3])/2,(x[1]+x[4])/2,(x[2]+x[5])/2];Q.push(S)}return Q}let lw=!1;function a5(N,Q,a,x,S){const A=new Date().getTime();window.bimViewer.loadModel(N,a,()=>{x&&x({code:200,result:N+"模型加载完成!"})},h=>{x&&x({code:-1,result:N+"模型加载失败!",msg:h})},{modelType:Q,...S||{}}),lw||(lw=!0,window.bimViewer.modelsExplorer.on("modelLoaded",()=>{window.bimViewer.setAllObjectsEdges(!1);const d=new Date().getTime()-A;console.log(`加载时长: ${d/1e3} s`),Vt("multiModel")?console.log("集成模式下不进行离群点检测"):Vt("outliersDetect")&&n5(N)}))}var cw={"./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"(N,Q,a){a.r(Q),a.d(Q,{AlphaFormat:()=>nx,AmbientLight:()=>kA,AngleMeasurementsControl:()=>cs,AngleMeasurementsMouseControl:()=>mi,AngleMeasurementsPlugin:()=>Zi,AngleMeasurementsSimulateMouseControl:()=>wc,AngleMeasurementsTouchControl:()=>Ru,AnnotationsPlugin:()=>Aq,AxisGizmoPlugin:()=>rte,BCFViewpointsPlugin:()=>_se,Bitmap:()=>zx,ByteType:()=>Kw,CameraMemento:()=>wC,CameraPath:()=>Mse,CameraPathAnimation:()=>od,Canvas:()=>Sw,ClampToEdgeWrapping:()=>xs,Component:()=>$e,CompressedMediaType:()=>_ee,Configs:()=>sf,CubicBezierCurve:()=>Vse,Curve:()=>sd,DefaultLoadingManager:()=>$2,DepthFormat:()=>lx,DepthStencilFormat:()=>cx,DirLight:()=>_o,DistanceMeasurementsControl:()=>gf,DistanceMeasurementsMouseControl:()=>lC,DistanceMeasurementsPlugin:()=>Ese,DistanceMeasurementsSimulateMouseControl:()=>Pse,DistanceMeasurementsTouchControl:()=>Bse,EdgeMaterial:()=>Gh,EmphasisMaterial:()=>Hi,FloatType:()=>qw,Fresnel:()=>dte,Frustum:()=>us,FrustumPlane:()=>Cl,GIFMediaType:()=>vee,GLTFDefaultDataSource:()=>fC,GLTFLoaderPlugin:()=>mve,HalfFloatType:()=>ex,ImagePlane:()=>Dse,IntType:()=>Jw,JPEGMediaType:()=>yee,KTX2TextureTranscoder:()=>Rc,LASLoaderPlugin:()=>p0e,LambertMaterial:()=>nte,LightMap:()=>Nse,LineSet:()=>aC,LinearEncoding:()=>Os,LinearFilter:()=>ns,LinearMipMapLinearFilter:()=>kc,LinearMipMapNearestFilter:()=>ju,LinearMipmapLinearFilter:()=>Pl,LinearMipmapNearestFilter:()=>gee,Loader:()=>K2,LoadingManager:()=>W2,LocaleService:()=>pC,LuminanceAlphaFormat:()=>ax,LuminanceFormat:()=>ox,Map:()=>Ae,Marker:()=>Mr,Mesh:()=>Yt,MetallicMaterial:()=>ate,MirroredRepeatWrapping:()=>da,ModelMemento:()=>jse,NavCubePlugin:()=>gve,NearestFilter:()=>Bl,NearestMipMapLinearFilter:()=>Sc,NearestMipMapNearestFilter:()=>Lu,NearestMipmapLinearFilter:()=>$w,NearestMipmapNearestFilter:()=>Ww,Node:()=>pa,ObjectEditPlugin:()=>n0e,ObjectsKdTree3:()=>ge,ObjectsMemento:()=>xC,PNGMediaType:()=>bee,Path:()=>Use,PerformanceModel:()=>zse,PhongMaterial:()=>oi,Plugin:()=>Ye,PointLight:()=>Fse,PointerLens:()=>se,QuadraticBezierCurve:()=>Hse,Queue:()=>fe,RGBAFormat:()=>Vu,RGBAIntegerFormat:()=>px,RGBA_ASTC_10x10_Format:()=>KA,RGBA_ASTC_10x5_Format:()=>QA,RGBA_ASTC_10x6_Format:()=>WA,RGBA_ASTC_10x8_Format:()=>$A,RGBA_ASTC_12x10_Format:()=>XA,RGBA_ASTC_12x12_Format:()=>YA,RGBA_ASTC_4x4_Format:()=>Jh,RGBA_ASTC_5x4_Format:()=>LA,RGBA_ASTC_5x5_Format:()=>jA,RGBA_ASTC_6x5_Format:()=>VA,RGBA_ASTC_6x6_Format:()=>UA,RGBA_ASTC_8x5_Format:()=>HA,RGBA_ASTC_8x6_Format:()=>zA,RGBA_ASTC_8x8_Format:()=>GA,RGBA_BPTC_Format:()=>Zh,RGBA_ETC2_EAC_Format:()=>Yh,RGBA_PVRTC_2BPPV1_Format:()=>OA,RGBA_PVRTC_4BPPV1_Format:()=>Kh,RGBA_S3TC_DXT1_Format:()=>Qh,RGBA_S3TC_DXT3_Format:()=>Wh,RGBA_S3TC_DXT5_Format:()=>Hu,RGBFormat:()=>sx,RGB_ETC1_Format:()=>NA,RGB_ETC2_Format:()=>Xh,RGB_PVRTC_2BPPV1_Format:()=>RA,RGB_PVRTC_4BPPV1_Format:()=>$h,RGB_S3TC_DXT1_Format:()=>Uu,RGFormat:()=>hx,RGIntegerFormat:()=>fx,ReadableGeometry:()=>Gr,RedFormat:()=>ux,RedIntegerFormat:()=>dx,ReflectionMap:()=>Ose,Renderer:()=>Rw,RepeatWrapping:()=>nn,Scene:()=>Nu,SceneModel:()=>Il,SceneModelMesh:()=>Qx,SceneModelTransform:()=>eC,SectionBox:()=>jg,SectionPlane:()=>ef,SectionPlanesPlugin:()=>Fve,ShortType:()=>Xw,Skybox:()=>Vg,SkyboxesPlugin:()=>jve,SpecularMaterial:()=>ute,SplineCurve:()=>_f,SpriteMarker:()=>Lse,StoreyViewsPlugin:()=>Lve,Texture:()=>Mc,TextureTranscoder:()=>Gse,TreeViewPlugin:()=>Vve,UnsignedByteType:()=>FA,UnsignedInt248Type:()=>ix,UnsignedIntType:()=>Zw,UnsignedShort4444Type:()=>tx,UnsignedShort5551Type:()=>rx,UnsignedShortType:()=>Yw,VBOGeometry:()=>Vx,ViewCullPlugin:()=>Gve,Viewer:()=>$de,WebIFCLoaderPlugin:()=>r0e,WorkerPool:()=>Y2,XTCDefaultDataSource:()=>xS,XTCLoaderPlugin:()=>Zve,buildBoxGeometry:()=>Pc,buildBoxLinesGeometry:()=>tf,buildCylinderGeometry:()=>Rn,buildGridGeometry:()=>Ux,buildLineGeometry:()=>mte,buildPlaneGeometry:()=>ng,buildPolylineGeometry:()=>Hx,buildPolylineGeometryFromCurve:()=>pte,buildSphereGeometry:()=>kl,buildTorusGeometry:()=>Zs,buildVectorTextGeometry:()=>qh,createRTCViewMat:()=>et,frustumIntersectsAABB3:()=>Bw,getKTX2TextureTranscoder:()=>J2,getPlaneRTCPos:()=>Bt,load3DSGeometry:()=>hte,loadOBJGeometry:()=>fte,math:()=>B,rtcToWorldPos:()=>It,sRGBEncoding:()=>Yi,setFrustum:()=>Ew,stats:()=>ue,utils:()=>Dt,worldToRTCPos:()=>lt,worldToRTCPositions:()=>vt});var x=d().mark(yP),S=d().mark(sy);function A(g,i){var t=Object.keys(g);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(g);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(g,r).enumerable})),t.push.apply(t,e)}return t}function h(g){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?A(Object(t),!0).forEach(function(e){M(g,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach(function(e){Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(t,e))})}return g}function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return i};var g,i={},t=Object.prototype,e=t.hasOwnProperty,r=Object.defineProperty||function(At,bt,wt){At[bt]=wt.value},o=typeof Symbol=="function"?Symbol:{},n=o.iterator||"@@iterator",y=o.asyncIterator||"@@asyncIterator",E=o.toStringTag||"@@toStringTag";function P(At,bt,wt){return Object.defineProperty(At,bt,{value:wt,enumerable:!0,configurable:!0,writable:!0}),At[bt]}try{P({},"")}catch{P=function(wt,Ot,Wt){return wt[Ot]=Wt}}function z(At,bt,wt,Ot){var Wt=bt&&bt.prototype instanceof we?bt:we,jt=Object.create(Wt.prototype),ar=new st(Ot||[]);return r(jt,"_invoke",{value:qe(At,wt,ar)}),jt}function Y(At,bt,wt){try{return{type:"normal",arg:At.call(bt,wt)}}catch(Ot){return{type:"throw",arg:Ot}}}i.wrap=z;var J="suspendedStart",ie="suspendedYield",le="executing",Z="completed",ye={};function we(){}function Be(){}function xe(){}var Se={};P(Se,n,function(){return this});var Te=Object.getPrototypeOf,Me=Te&&Te(Te(ft([])));Me&&Me!==t&&e.call(Me,n)&&(Se=Me);var Fe=xe.prototype=we.prototype=Object.create(Se);function Re(At){["next","throw","return"].forEach(function(bt){P(At,bt,function(wt){return this._invoke(bt,wt)})})}function He(At,bt){function wt(Wt,jt,ar,Nr){var Fr=Y(At[Wt],At,jt);if(Fr.type!=="throw"){var kr=Fr.arg,$r=kr.value;return $r&&I($r)=="object"&&e.call($r,"__await")?bt.resolve($r.__await).then(function(dr){wt("next",dr,ar,Nr)},function(dr){wt("throw",dr,ar,Nr)}):bt.resolve($r).then(function(dr){kr.value=dr,ar(kr)},function(dr){return wt("throw",dr,ar,Nr)})}Nr(Fr.arg)}var Ot;r(this,"_invoke",{value:function(jt,ar){function Nr(){return new bt(function(Fr,kr){wt(jt,ar,Fr,kr)})}return Ot=Ot?Ot.then(Nr,Nr):Nr()}})}function qe(At,bt,wt){var Ot=J;return function(Wt,jt){if(Ot===le)throw Error("Generator is already running");if(Ot===Z){if(Wt==="throw")throw jt;return{value:g,done:!0}}for(wt.method=Wt,wt.arg=jt;;){var ar=wt.delegate;if(ar){var Nr=rt(ar,wt);if(Nr){if(Nr===ye)continue;return Nr}}if(wt.method==="next")wt.sent=wt._sent=wt.arg;else if(wt.method==="throw"){if(Ot===J)throw Ot=Z,wt.arg;wt.dispatchException(wt.arg)}else wt.method==="return"&&wt.abrupt("return",wt.arg);Ot=le;var Fr=Y(At,bt,wt);if(Fr.type==="normal"){if(Ot=wt.done?Z:ie,Fr.arg===ye)continue;return{value:Fr.arg,done:wt.done}}Fr.type==="throw"&&(Ot=Z,wt.method="throw",wt.arg=Fr.arg)}}}function rt(At,bt){var wt=bt.method,Ot=At.iterator[wt];if(Ot===g)return bt.delegate=null,wt==="throw"&&At.iterator.return&&(bt.method="return",bt.arg=g,rt(At,bt),bt.method==="throw")||wt!=="return"&&(bt.method="throw",bt.arg=new TypeError("The iterator does not provide a '"+wt+"' method")),ye;var Wt=Y(Ot,At.iterator,bt.arg);if(Wt.type==="throw")return bt.method="throw",bt.arg=Wt.arg,bt.delegate=null,ye;var jt=Wt.arg;return jt?jt.done?(bt[At.resultName]=jt.value,bt.next=At.nextLoc,bt.method!=="return"&&(bt.method="next",bt.arg=g),bt.delegate=null,ye):jt:(bt.method="throw",bt.arg=new TypeError("iterator result is not an object"),bt.delegate=null,ye)}function je(At){var bt={tryLoc:At[0]};1 in At&&(bt.catchLoc=At[1]),2 in At&&(bt.finallyLoc=At[2],bt.afterLoc=At[3]),this.tryEntries.push(bt)}function Oe(At){var bt=At.completion||{};bt.type="normal",delete bt.arg,At.completion=bt}function st(At){this.tryEntries=[{tryLoc:"root"}],At.forEach(je,this),this.reset(!0)}function ft(At){if(At||At===""){var bt=At[n];if(bt)return bt.call(At);if(typeof At.next=="function")return At;if(!isNaN(At.length)){var wt=-1,Ot=function Wt(){for(;++wt<At.length;)if(e.call(At,wt))return Wt.value=At[wt],Wt.done=!1,Wt;return Wt.value=g,Wt.done=!0,Wt};return Ot.next=Ot}}throw new TypeError(I(At)+" is not iterable")}return Be.prototype=xe,r(Fe,"constructor",{value:xe,configurable:!0}),r(xe,"constructor",{value:Be,configurable:!0}),Be.displayName=P(xe,E,"GeneratorFunction"),i.isGeneratorFunction=function(At){var bt=typeof At=="function"&&At.constructor;return!!bt&&(bt===Be||(bt.displayName||bt.name)==="GeneratorFunction")},i.mark=function(At){return Object.setPrototypeOf?Object.setPrototypeOf(At,xe):(At.__proto__=xe,P(At,E,"GeneratorFunction")),At.prototype=Object.create(Fe),At},i.awrap=function(At){return{__await:At}},Re(He.prototype),P(He.prototype,y,function(){return this}),i.AsyncIterator=He,i.async=function(At,bt,wt,Ot,Wt){Wt===void 0&&(Wt=Promise);var jt=new He(z(At,bt,wt,Ot),Wt);return i.isGeneratorFunction(bt)?jt:jt.next().then(function(ar){return ar.done?ar.value:jt.next()})},Re(Fe),P(Fe,E,"Generator"),P(Fe,n,function(){return this}),P(Fe,"toString",function(){return"[object Generator]"}),i.keys=function(At){var bt=Object(At),wt=[];for(var Ot in bt)wt.push(Ot);return wt.reverse(),function Wt(){for(;wt.length;){var jt=wt.pop();if(jt in bt)return Wt.value=jt,Wt.done=!1,Wt}return Wt.done=!0,Wt}},i.values=ft,st.prototype={constructor:st,reset:function(bt){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(Oe),!bt)for(var wt in this)wt.charAt(0)==="t"&&e.call(this,wt)&&!isNaN(+wt.slice(1))&&(this[wt]=g)},stop:function(){this.done=!0;var bt=this.tryEntries[0].completion;if(bt.type==="throw")throw bt.arg;return this.rval},dispatchException:function(bt){if(this.done)throw bt;var wt=this;function Ot(kr,$r){return ar.type="throw",ar.arg=bt,wt.next=kr,$r&&(wt.method="next",wt.arg=g),!!$r}for(var Wt=this.tryEntries.length-1;Wt>=0;--Wt){var jt=this.tryEntries[Wt],ar=jt.completion;if(jt.tryLoc==="root")return Ot("end");if(jt.tryLoc<=this.prev){var Nr=e.call(jt,"catchLoc"),Fr=e.call(jt,"finallyLoc");if(Nr&&Fr){if(this.prev<jt.catchLoc)return Ot(jt.catchLoc,!0);if(this.prev<jt.finallyLoc)return Ot(jt.finallyLoc)}else if(Nr){if(this.prev<jt.catchLoc)return Ot(jt.catchLoc,!0)}else{if(!Fr)throw Error("try statement without catch or finally");if(this.prev<jt.finallyLoc)return Ot(jt.finallyLoc)}}}},abrupt:function(bt,wt){for(var Ot=this.tryEntries.length-1;Ot>=0;--Ot){var Wt=this.tryEntries[Ot];if(Wt.tryLoc<=this.prev&&e.call(Wt,"finallyLoc")&&this.prev<Wt.finallyLoc){var jt=Wt;break}}jt&&(bt==="break"||bt==="continue")&&jt.tryLoc<=wt&&wt<=jt.finallyLoc&&(jt=null);var ar=jt?jt.completion:{};return ar.type=bt,ar.arg=wt,jt?(this.method="next",this.next=jt.finallyLoc,ye):this.complete(ar)},complete:function(bt,wt){if(bt.type==="throw")throw bt.arg;return bt.type==="break"||bt.type==="continue"?this.next=bt.arg:bt.type==="return"?(this.rval=this.arg=bt.arg,this.method="return",this.next="end"):bt.type==="normal"&&wt&&(this.next=wt),ye},finish:function(bt){for(var wt=this.tryEntries.length-1;wt>=0;--wt){var Ot=this.tryEntries[wt];if(Ot.finallyLoc===bt)return this.complete(Ot.completion,Ot.afterLoc),Oe(Ot),ye}},catch:function(bt){for(var wt=this.tryEntries.length-1;wt>=0;--wt){var Ot=this.tryEntries[wt];if(Ot.tryLoc===bt){var Wt=Ot.completion;if(Wt.type==="throw"){var jt=Wt.arg;Oe(Ot)}return jt}}throw Error("illegal catch attempt")},delegateYield:function(bt,wt,Ot){return this.delegate={iterator:ft(bt),resultName:wt,nextLoc:Ot},this.method==="next"&&(this.arg=g),ye}},i}function u(g,i,t,e,r,o,n){try{var y=g[o](n),E=y.value}catch(P){return void t(P)}y.done?i(E):Promise.resolve(E).then(e,r)}function l(g){return function(){var i=this,t=arguments;return new Promise(function(e,r){var o=g.apply(i,t);function n(E){u(o,e,r,n,y,"next",E)}function y(E){u(o,e,r,n,y,"throw",E)}n(void 0)})}}function c(g){return m(g)||p(g)||w(g)||f()}function f(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
20
+ `,VD=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function UD(N){const Q=window.getComputedStyle(N),a=Q.getPropertyValue("box-sizing"),x=Number.parseFloat(Q.getPropertyValue("padding-bottom"))+Number.parseFloat(Q.getPropertyValue("padding-top")),S=Number.parseFloat(Q.getPropertyValue("border-bottom-width"))+Number.parseFloat(Q.getPropertyValue("border-top-width"));return{contextStyle:VD.map(h=>`${h}:${Q.getPropertyValue(h)}`).join(";"),paddingSize:x,borderSize:S,boxSizing:a}}function H_(N,Q=1,a){var x;go||(go=document.createElement("textarea"),document.body.appendChild(go));const{paddingSize:S,borderSize:A,boxSizing:h,contextStyle:d}=UD(N);go.setAttribute("style",`${d};${jD}`),go.value=N.value||N.placeholder||"";let u=go.scrollHeight;const l={};h==="border-box"?u=u+A:h==="content-box"&&(u=u-S),go.value="";const c=go.scrollHeight-S;if(Ri(Q)){let f=c*Q;h==="border-box"&&(f=f+S+A),u=Math.max(f,u),l.minHeight=`${f}px`}if(Ri(a)){let f=c*a;h==="border-box"&&(f=f+S+A),u=Math.min(f,u)}return l.height=`${u}px`,(x=go.parentNode)==null||x.removeChild(go),go=void 0,l}const HD=ei({id:{type:String,default:void 0},size:po,disabled:Boolean,modelValue:{type:Pr([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Pr([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:ho},prefixIcon:{type:ho},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Pr([Object,Array,String]),default:()=>J4({})},autofocus:Boolean,rows:{type:Number,default:2},...Ys(["ariaLabel"])}),zD={[Wi]:N=>Dn(N),input:N=>Dn(N),change:N=>Dn(N),focus:N=>N instanceof FocusEvent,blur:N=>N instanceof FocusEvent,clear:()=>!0,mouseleave:N=>N instanceof MouseEvent,mouseenter:N=>N instanceof MouseEvent,keydown:N=>N instanceof Event,compositionstart:N=>N instanceof CompositionEvent,compositionupdate:N=>N instanceof CompositionEvent,compositionend:N=>N instanceof CompositionEvent},GD=s.defineComponent({name:"ElInput",inheritAttrs:!1}),QD=s.defineComponent({...GD,props:HD,emits:zD,setup(N,{expose:Q,emit:a}){const x=N,S=s.useAttrs(),A=s.useSlots(),h=s.computed(()=>{const be={};return x.containerRole==="combobox"&&(be["aria-haspopup"]=S["aria-haspopup"],be["aria-owns"]=S["aria-owns"],be["aria-expanded"]=S["aria-expanded"]),be}),d=s.computed(()=>[x.type==="textarea"?b.b():_.b(),_.m(m.value),_.is("disabled",v.value),_.is("exceed",ee.value),{[_.b("group")]:A.prepend||A.append,[_.m("prefix")]:A.prefix||x.prefixIcon,[_.m("suffix")]:A.suffix||x.suffixIcon||x.clearable||x.showPassword,[_.bm("suffix","password-clear")]:F.value&&V.value,[_.b("hidden")]:x.type==="hidden"},S.class]),u=s.computed(()=>[_.e("wrapper"),_.is("focus",H.value)]),l=eI({excludeKeys:s.computed(()=>Object.keys(h.value))}),{form:c,formItem:f}=Ao(),{inputId:p}=vl(x,{formItemContext:f}),m=mo(),v=gl(),_=Jr("input"),b=Jr("textarea"),w=s.shallowRef(),C=s.shallowRef(),k=s.ref(!1),T=s.ref(!1),R=s.ref(),U=s.shallowRef(x.inputStyle),G=s.computed(()=>w.value||C.value),{wrapperRef:j,isFocused:H}=N_(G,{afterBlur(){var be;x.validateEvent&&((be=f==null?void 0:f.validate)==null||be.call(f,"blur").catch(De=>Ki(De)))}}),W=s.computed(()=>{var be;return(be=c==null?void 0:c.statusIcon)!=null?be:!1}),K=s.computed(()=>(f==null?void 0:f.validateState)||""),$=s.computed(()=>K.value&&s_[K.value]),O=s.computed(()=>T.value?ui.View:ui.Hide),L=s.computed(()=>[S.style]),M=s.computed(()=>[x.inputStyle,U.value,{resize:x.resize}]),I=s.computed(()=>ko(x.modelValue)?"":String(x.modelValue)),F=s.computed(()=>x.clearable&&!v.value&&!x.readonly&&!!I.value&&(H.value||k.value)),V=s.computed(()=>x.showPassword&&!v.value&&!x.readonly&&!!I.value&&(!!I.value||H.value)),D=s.computed(()=>x.showWordLimit&&!!x.maxlength&&(x.type==="text"||x.type==="textarea")&&!v.value&&!x.readonly&&!x.showPassword),X=s.computed(()=>I.value.length),ee=s.computed(()=>!!D.value&&X.value>Number(x.maxlength)),q=s.computed(()=>!!A.suffix||!!x.suffixIcon||F.value||x.showPassword||D.value||!!K.value&&W.value),[ne,oe]=ED(w);ea(C,be=>{if(de(),!D.value||x.resize!=="both")return;const De=be[0],{width:Je}=De.contentRect;R.value={right:`calc(100% - ${Je+15+6}px)`}});const he=()=>{const{type:be,autosize:De}=x;if(!(!Ln||be!=="textarea"||!C.value))if(De){const Je=qn(De)?De.minRows:void 0,Qe=qn(De)?De.maxRows:void 0,ot=H_(C.value,Je,Qe);U.value={overflowY:"hidden",...ot},s.nextTick(()=>{C.value.offsetHeight,U.value=ot})}else U.value={minHeight:H_(C.value).minHeight}},de=(be=>{let De=!1;return()=>{var Je;if(De||!x.autosize)return;((Je=C.value)==null?void 0:Je.offsetParent)===null||(be(),De=!0)}})(he),se=()=>{const be=G.value,De=x.formatter?x.formatter(I.value):I.value;!be||be.value===De||(be.value=De)},re=async be=>{ne();let{value:De}=be.target;if(x.formatter&&(De=x.parser?x.parser(De):De),!Ce.value){if(De===I.value){se();return}a(Wi,De),a("input",De),await s.nextTick(),se(),oe()}},ae=be=>{a("change",be.target.value)},{isComposing:Ce,handleCompositionStart:me,handleCompositionUpdate:ce,handleCompositionEnd:pe}=L_({emit:a,afterComposition:re}),B=()=>{T.value=!T.value,ke()},ke=async()=>{var be;await s.nextTick(),(be=G.value)==null||be.focus()},Ee=()=>{var be;return(be=G.value)==null?void 0:be.blur()},ge=be=>{k.value=!1,a("mouseleave",be)},Ae=be=>{k.value=!0,a("mouseenter",be)},fe=be=>{a("keydown",be)},ue=()=>{var be;(be=G.value)==null||be.select()},_e=()=>{a(Wi,""),a("change",""),a("clear"),a("input","")};return s.watch(()=>x.modelValue,()=>{var be;s.nextTick(()=>he()),x.validateEvent&&((be=f==null?void 0:f.validate)==null||be.call(f,"change").catch(De=>Ki(De)))}),s.watch(I,()=>se()),s.watch(()=>x.type,async()=>{await s.nextTick(),se(),he()}),s.onMounted(()=>{!x.formatter&&x.parser&&Ki("ElInput","If you set the parser, you also need to set the formatter."),se(),s.nextTick(he)}),Q({input:w,textarea:C,ref:G,textareaStyle:M,autosize:s.toRef(x,"autosize"),isComposing:Ce,focus:ke,blur:Ee,select:ue,clear:_e,resizeTextarea:he}),(be,De)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps(s.unref(h),{class:[s.unref(d),{[s.unref(_).bm("group","append")]:be.$slots.append,[s.unref(_).bm("group","prepend")]:be.$slots.prepend}],style:s.unref(L),role:be.containerRole,onMouseenter:Ae,onMouseleave:ge}),[s.createCommentVNode(" input "),be.type!=="textarea"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createCommentVNode(" prepend slot "),be.$slots.prepend?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(_).be("group","prepend"))},[s.renderSlot(be.$slots,"prepend")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref_key:"wrapperRef",ref:j,class:s.normalizeClass(s.unref(u))},[s.createCommentVNode(" prefix slot "),be.$slots.prefix||be.prefixIcon?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(_).e("prefix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(_).e("prefix-inner"))},[s.renderSlot(be.$slots,"prefix"),be.prefixIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(_).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(be.prefixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("input",s.mergeProps({id:s.unref(p),ref_key:"input",ref:w,class:s.unref(_).e("inner")},s.unref(l),{minlength:be.minlength,maxlength:be.maxlength,type:be.showPassword?T.value?"text":"password":be.type,disabled:s.unref(v),readonly:be.readonly,autocomplete:be.autocomplete,tabindex:be.tabindex,"aria-label":be.ariaLabel,placeholder:be.placeholder,style:be.inputStyle,form:be.form,autofocus:be.autofocus,onCompositionstart:s.unref(me),onCompositionupdate:s.unref(ce),onCompositionend:s.unref(pe),onInput:re,onChange:ae,onKeydown:fe}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),s.createCommentVNode(" suffix slot "),s.unref(q)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(_).e("suffix"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(_).e("suffix-inner"))},[!s.unref(F)||!s.unref(V)||!s.unref(D)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(be.$slots,"suffix"),be.suffixIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(_).e("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(be.suffixIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],64)):s.createCommentVNode("v-if",!0),s.unref(F)?(s.openBlock(),s.createBlock(s.unref(ni),{key:1,class:s.normalizeClass([s.unref(_).e("icon"),s.unref(_).e("clear")]),onMousedown:s.withModifiers(s.unref(du),["prevent"]),onClick:_e},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.CircleClose))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.unref(V)?(s.openBlock(),s.createBlock(s.unref(ni),{key:2,class:s.normalizeClass([s.unref(_).e("icon"),s.unref(_).e("password")]),onClick:B},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(O))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.unref(D)?(s.openBlock(),s.createElementBlock("span",{key:3,class:s.normalizeClass(s.unref(_).e("count"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(_).e("count-inner"))},s.toDisplayString(s.unref(X))+" / "+s.toDisplayString(be.maxlength),3)],2)):s.createCommentVNode("v-if",!0),s.unref(K)&&s.unref($)&&s.unref(W)?(s.openBlock(),s.createBlock(s.unref(ni),{key:4,class:s.normalizeClass([s.unref(_).e("icon"),s.unref(_).e("validateIcon"),s.unref(_).is("loading",s.unref(K)==="validating")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref($))))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0)],2),s.createCommentVNode(" append slot "),be.$slots.append?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(s.unref(_).be("group","append"))},[s.renderSlot(be.$slots,"append")],2)):s.createCommentVNode("v-if",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createCommentVNode(" textarea "),s.createElementVNode("textarea",s.mergeProps({id:s.unref(p),ref_key:"textarea",ref:C,class:[s.unref(b).e("inner"),s.unref(_).is("focus",s.unref(H))]},s.unref(l),{minlength:be.minlength,maxlength:be.maxlength,tabindex:be.tabindex,disabled:s.unref(v),readonly:be.readonly,autocomplete:be.autocomplete,style:s.unref(M),"aria-label":be.ariaLabel,placeholder:be.placeholder,form:be.form,autofocus:be.autofocus,rows:be.rows,onCompositionstart:s.unref(me),onCompositionupdate:s.unref(ce),onCompositionend:s.unref(pe),onInput:re,onChange:ae,onKeydown:fe}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend"]),s.unref(D)?(s.openBlock(),s.createElementBlock("span",{key:0,style:s.normalizeStyle(R.value),class:s.normalizeClass(s.unref(_).e("count"))},s.toDisplayString(s.unref(X))+" / "+s.toDisplayString(be.maxlength),7)):s.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var WD=si(QD,[["__file","input.vue"]]);const Sn=Gn(WD),lc=4,$D={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},KD=({move:N,size:Q,bar:a})=>({[a.size]:Q,transform:`translate${a.axis}(${N}%)`}),Dm=Symbol("scrollbarContextKey"),XD=ei({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),YD="Thumb";var z_=si(s.defineComponent({__name:"thumb",props:XD,setup(N){const Q=N,a=s.inject(Dm),x=Jr("scrollbar");a||ch(YD,"can not inject scrollbar context");const S=s.ref(),A=s.ref(),h=s.ref({}),d=s.ref(!1);let u=!1,l=!1,c=Ln?document.onselectstart:null;const f=s.computed(()=>$D[Q.vertical?"vertical":"horizontal"]),p=s.computed(()=>KD({size:Q.size,move:Q.move,bar:f.value})),m=s.computed(()=>S.value[f.value.offset]**2/a.wrapElement[f.value.scrollSize]/Q.ratio/A.value[f.value.offset]),v=U=>{var G;if(U.stopPropagation(),U.ctrlKey||[1,2].includes(U.button))return;(G=window.getSelection())==null||G.removeAllRanges(),b(U);const j=U.currentTarget;j&&(h.value[f.value.axis]=j[f.value.offset]-(U[f.value.client]-j.getBoundingClientRect()[f.value.direction]))},_=U=>{if(!A.value||!S.value||!a.wrapElement)return;const G=Math.abs(U.target.getBoundingClientRect()[f.value.direction]-U[f.value.client]),j=A.value[f.value.offset]/2,H=(G-j)*100*m.value/S.value[f.value.offset];a.wrapElement[f.value.scroll]=H*a.wrapElement[f.value.scrollSize]/100},b=U=>{U.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),c=document.onselectstart,document.onselectstart=()=>!1},w=U=>{if(!S.value||!A.value||u===!1)return;const G=h.value[f.value.axis];if(!G)return;const j=(S.value.getBoundingClientRect()[f.value.direction]-U[f.value.client])*-1,H=A.value[f.value.offset]-G,W=(j-H)*100*m.value/S.value[f.value.offset];a.wrapElement[f.value.scroll]=W*a.wrapElement[f.value.scrollSize]/100},C=()=>{u=!1,h.value[f.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),R(),l&&(d.value=!1)},k=()=>{l=!1,d.value=!!Q.size},T=()=>{l=!0,d.value=u};s.onBeforeUnmount(()=>{R(),document.removeEventListener("mouseup",C)});const R=()=>{document.onselectstart!==c&&(document.onselectstart=c)};return Zn(s.toRef(a,"scrollbarElement"),"mousemove",k),Zn(s.toRef(a,"scrollbarElement"),"mouseleave",T),(U,G)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(x).b("fade"),persisted:""},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{ref_key:"instance",ref:S,class:s.normalizeClass([s.unref(x).e("bar"),s.unref(x).is(s.unref(f).key)]),onMousedown:_},[s.createElementVNode("div",{ref_key:"thumb",ref:A,class:s.normalizeClass(s.unref(x).e("thumb")),style:s.normalizeStyle(s.unref(p)),onMousedown:v},null,38)],34),[[s.vShow,U.always||d.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const JD=ei({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var ZD=si(s.defineComponent({__name:"bar",props:JD,setup(N,{expose:Q}){const a=N,x=s.inject(Dm),S=s.ref(0),A=s.ref(0),h=s.ref(""),d=s.ref(""),u=s.ref(1),l=s.ref(1);return Q({handleScroll:p=>{if(p){const m=p.offsetHeight-lc,v=p.offsetWidth-lc;A.value=p.scrollTop*100/m*u.value,S.value=p.scrollLeft*100/v*l.value}},update:()=>{const p=x==null?void 0:x.wrapElement;if(!p)return;const m=p.offsetHeight-lc,v=p.offsetWidth-lc,_=m**2/p.scrollHeight,b=v**2/p.scrollWidth,w=Math.max(_,a.minSize),C=Math.max(b,a.minSize);u.value=_/(m-_)/(w/(m-w)),l.value=b/(v-b)/(C/(v-C)),d.value=w+lc<m?`${w}px`:"",h.value=C+lc<v?`${C}px`:""}}),(p,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(z_,{move:S.value,ratio:l.value,size:h.value,always:p.always},null,8,["move","ratio","size","always"]),s.createVNode(z_,{move:A.value,ratio:u.value,size:d.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const qD=ei({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Pr([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,...Ys(["ariaLabel","ariaOrientation"])}),eF={scroll:({scrollTop:N,scrollLeft:Q})=>[N,Q].every(Ri)},Fm="ElScrollbar",tF=s.defineComponent({name:Fm}),rF=s.defineComponent({...tF,props:qD,emits:eF,setup(N,{expose:Q,emit:a}){const x=N,S=Jr("scrollbar");let A,h,d=0,u=0;const l=s.ref(),c=s.ref(),f=s.ref(),p=s.ref(),m=s.computed(()=>{const R={};return x.height&&(R.height=dh(x.height)),x.maxHeight&&(R.maxHeight=dh(x.maxHeight)),[x.wrapStyle,R]}),v=s.computed(()=>[x.wrapClass,S.e("wrap"),{[S.em("wrap","hidden-default")]:!x.native}]),_=s.computed(()=>[S.e("view"),x.viewClass]),b=()=>{var R;c.value&&((R=p.value)==null||R.handleScroll(c.value),d=c.value.scrollTop,u=c.value.scrollLeft,a("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function w(R,U){qn(R)?c.value.scrollTo(R):Ri(R)&&Ri(U)&&c.value.scrollTo(R,U)}const C=R=>{if(!Ri(R)){Ki(Fm,"value must be a number");return}c.value.scrollTop=R},k=R=>{if(!Ri(R)){Ki(Fm,"value must be a number");return}c.value.scrollLeft=R},T=()=>{var R;(R=p.value)==null||R.update()};return s.watch(()=>x.noresize,R=>{R?(A==null||A(),h==null||h()):({stop:A}=ea(f,T),h=Zn("resize",T))},{immediate:!0}),s.watch(()=>[x.maxHeight,x.height],()=>{x.native||s.nextTick(()=>{var R;T(),c.value&&((R=p.value)==null||R.handleScroll(c.value))})}),s.provide(Dm,s.reactive({scrollbarElement:l,wrapElement:c})),s.onActivated(()=>{c.value.scrollTop=d,c.value.scrollLeft=u}),s.onMounted(()=>{x.native||s.nextTick(()=>{T()})}),s.onUpdated(()=>T()),Q({wrapRef:c,update:T,scrollTo:w,setScrollTop:C,setScrollLeft:k,handleScroll:b}),(R,U)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:s.normalizeClass(s.unref(S).b())},[s.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:s.normalizeClass(s.unref(v)),style:s.normalizeStyle(s.unref(m)),onScroll:b},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.tag),{id:R.id,ref_key:"resizeRef",ref:f,class:s.normalizeClass(s.unref(_)),style:s.normalizeStyle(R.viewStyle),role:R.role,"aria-label":R.ariaLabel,"aria-orientation":R.ariaOrientation},{default:s.withCtx(()=>[s.renderSlot(R.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),R.native?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(ZD,{key:0,ref_key:"barRef",ref:p,always:R.always,"min-size":R.minSize},null,8,["always","min-size"]))],2))}});var iF=si(rF,[["__file","scrollbar.vue"]]);const yn=Gn(iF),Rm=Symbol("popper"),G_=Symbol("popperContent"),Q_=ei({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),nF=s.defineComponent({name:"ElPopper",inheritAttrs:!1}),sF=s.defineComponent({...nF,props:Q_,setup(N,{expose:Q}){const a=N,x=s.ref(),S=s.ref(),A=s.ref(),h=s.ref(),d=s.computed(()=>a.role),u={triggerRef:x,popperInstanceRef:S,contentRef:A,referenceRef:h,role:d};return Q(u),s.provide(Rm,u),(l,c)=>s.renderSlot(l.$slots,"default")}});var oF=si(sF,[["__file","popper.vue"]]);const W_=ei({arrowOffset:{type:Number,default:5}}),aF=s.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),lF=s.defineComponent({...aF,props:W_,setup(N,{expose:Q}){const a=N,x=Jr("popper"),{arrowOffset:S,arrowRef:A,arrowStyle:h}=s.inject(G_,void 0);return s.watch(()=>a.arrowOffset,d=>{S.value=d}),s.onBeforeUnmount(()=>{A.value=void 0}),Q({arrowRef:A}),(d,u)=>(s.openBlock(),s.createElementBlock("span",{ref_key:"arrowRef",ref:A,class:s.normalizeClass(s.unref(x).e("arrow")),style:s.normalizeStyle(s.unref(h)),"data-popper-arrow":""},null,6))}});var cF=si(lF,[["__file","arrow.vue"]]);const Om="ElOnlyChild",uF=s.defineComponent({name:Om,setup(N,{slots:Q,attrs:a}){var x;const S=s.inject(D_),A=_D((x=S==null?void 0:S.setForwardRef)!=null?x:du);return()=>{var h;const d=(h=Q.default)==null?void 0:h.call(Q,a);if(!d)return null;if(d.length>1)return Ki(Om,"requires exact only one valid child."),null;const u=$_(d);return u?s.withDirectives(s.cloneVNode(u,a),[[A]]):(Ki(Om,"no valid child node found"),null)}}});function $_(N){if(!N)return null;const Q=N;for(const a of Q){if(qn(a))switch(a.type){case s.Comment:continue;case s.Text:case"svg":return K_(a);case s.Fragment:return $_(a.children);default:return a}return K_(a)}return null}function K_(N){const Q=Jr("only-child");return s.createVNode("span",{class:Q.e("content")},[N])}const X_=ei({virtualRef:{type:Pr(Object)},virtualTriggering:Boolean,onMouseenter:{type:Pr(Function)},onMouseleave:{type:Pr(Function)},onClick:{type:Pr(Function)},onKeydown:{type:Pr(Function)},onFocus:{type:Pr(Function)},onBlur:{type:Pr(Function)},onContextmenu:{type:Pr(Function)},id:String,open:Boolean}),dF=s.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),hF=s.defineComponent({...dF,props:X_,setup(N,{expose:Q}){const a=N,{role:x,triggerRef:S}=s.inject(Rm,void 0);bD(S);const A=s.computed(()=>d.value?a.id:void 0),h=s.computed(()=>{if(x&&x.value==="tooltip")return a.open&&a.id?a.id:void 0}),d=s.computed(()=>{if(x&&x.value!=="tooltip")return x.value}),u=s.computed(()=>d.value?`${a.open}`:void 0);let l;const c=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return s.onMounted(()=>{s.watch(()=>a.virtualRef,f=>{f&&(S.value=qo(f))},{immediate:!0}),s.watch(S,(f,p)=>{l==null||l(),l=void 0,fl(f)&&(c.forEach(m=>{var v;const _=a[m];_&&(f.addEventListener(m.slice(2).toLowerCase(),_),(v=p==null?void 0:p.removeEventListener)==null||v.call(p,m.slice(2).toLowerCase(),_))}),l=s.watch([A,h,d,u],m=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((v,_)=>{ko(m[_])?f.removeAttribute(v):f.setAttribute(v,m[_])})},{immediate:!0})),fl(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(m=>p.removeAttribute(m))},{immediate:!0})}),s.onBeforeUnmount(()=>{if(l==null||l(),l=void 0,S.value&&fl(S.value)){const f=S.value;c.forEach(p=>{const m=a[p];m&&f.removeEventListener(p.slice(2).toLowerCase(),m)}),S.value=void 0}}),Q({triggerRef:S}),(f,p)=>f.virtualTriggering?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createBlock(s.unref(uF),s.mergeProps({key:0},f.$attrs,{"aria-controls":s.unref(A),"aria-describedby":s.unref(h),"aria-expanded":s.unref(u),"aria-haspopup":s.unref(d)}),{default:s.withCtx(()=>[s.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var fF=si(hF,[["__file","trigger.vue"]]);const Nm="focus-trap.focus-after-trapped",Lm="focus-trap.focus-after-released",pF="focus-trap.focusout-prevented",Y_={cancelable:!0,bubbles:!1},mF={cancelable:!0,bubbles:!1},J_="focusAfterTrapped",Z_="focusAfterReleased",AF=Symbol("elFocusTrap"),jm=s.ref(),gh=s.ref(0),Vm=s.ref(0);let vh=0;const q_=N=>{const Q=[],a=document.createTreeWalker(N,NodeFilter.SHOW_ELEMENT,{acceptNode:x=>{const S=x.tagName==="INPUT"&&x.type==="hidden";return x.disabled||x.hidden||S?NodeFilter.FILTER_SKIP:x.tabIndex>=0||x===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)Q.push(a.currentNode);return Q},e1=(N,Q)=>{for(const a of N)if(!gF(a,Q))return a},gF=(N,Q)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(N).visibility==="hidden")return!0;for(;N;){if(Q&&N===Q)return!1;if(getComputedStyle(N).display==="none")return!0;N=N.parentElement}return!1},vF=N=>{const Q=q_(N),a=e1(Q,N),x=e1(Q.reverse(),N);return[a,x]},yF=N=>N instanceof HTMLInputElement&&"select"in N,Ra=(N,Q)=>{if(N&&N.focus){const a=document.activeElement;N.focus({preventScroll:!0}),Vm.value=window.performance.now(),N!==a&&yF(N)&&Q&&N.select()}};function t1(N,Q){const a=[...N],x=N.indexOf(Q);return x!==-1&&a.splice(x,1),a}const bF=()=>{let N=[];return{push:x=>{const S=N[0];S&&x!==S&&S.pause(),N=t1(N,x),N.unshift(x)},remove:x=>{var S,A;N=t1(N,x),(A=(S=N[0])==null?void 0:S.resume)==null||A.call(S)}}},_F=(N,Q=!1)=>{const a=document.activeElement;for(const x of N)if(Ra(x,Q),document.activeElement!==a)return},r1=bF(),wF=()=>gh.value>Vm.value,yh=()=>{jm.value="pointer",gh.value=window.performance.now()},i1=()=>{jm.value="keyboard",gh.value=window.performance.now()},xF=()=>(s.onMounted(()=>{vh===0&&(document.addEventListener("mousedown",yh),document.addEventListener("touchstart",yh),document.addEventListener("keydown",i1)),vh++}),s.onBeforeUnmount(()=>{vh--,vh<=0&&(document.removeEventListener("mousedown",yh),document.removeEventListener("touchstart",yh),document.removeEventListener("keydown",i1))}),{focusReason:jm,lastUserFocusTimestamp:gh,lastAutomatedFocusTimestamp:Vm}),bh=N=>new CustomEvent(pF,{...mF,detail:N}),CF=s.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[J_,Z_,"focusin","focusout","focusout-prevented","release-requested"],setup(N,{emit:Q}){const a=s.ref();let x,S;const{focusReason:A}=xF();mD(v=>{N.trapped&&!h.paused&&Q("release-requested",v)});const h={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},d=v=>{if(!N.loop&&!N.trapped||h.paused)return;const{key:_,altKey:b,ctrlKey:w,metaKey:C,currentTarget:k,shiftKey:T}=v,{loop:R}=N,U=_===Ii.tab&&!b&&!w&&!C,G=document.activeElement;if(U&&G){const j=k,[H,W]=vF(j);if(H&&W){if(!T&&G===W){const $=bh({focusReason:A.value});Q("focusout-prevented",$),$.defaultPrevented||(v.preventDefault(),R&&Ra(H,!0))}else if(T&&[H,j].includes(G)){const $=bh({focusReason:A.value});Q("focusout-prevented",$),$.defaultPrevented||(v.preventDefault(),R&&Ra(W,!0))}}else if(G===j){const $=bh({focusReason:A.value});Q("focusout-prevented",$),$.defaultPrevented||v.preventDefault()}}};s.provide(AF,{focusTrapRef:a,onKeydown:d}),s.watch(()=>N.focusTrapEl,v=>{v&&(a.value=v)},{immediate:!0}),s.watch([a],([v],[_])=>{v&&(v.addEventListener("keydown",d),v.addEventListener("focusin",c),v.addEventListener("focusout",f)),_&&(_.removeEventListener("keydown",d),_.removeEventListener("focusin",c),_.removeEventListener("focusout",f))});const u=v=>{Q(J_,v)},l=v=>Q(Z_,v),c=v=>{const _=s.unref(a);if(!_)return;const b=v.target,w=v.relatedTarget,C=b&&_.contains(b);N.trapped||w&&_.contains(w)||(x=w),C&&Q("focusin",v),!h.paused&&N.trapped&&(C?S=b:Ra(S,!0))},f=v=>{const _=s.unref(a);if(!(h.paused||!_))if(N.trapped){const b=v.relatedTarget;!ko(b)&&!_.contains(b)&&setTimeout(()=>{if(!h.paused&&N.trapped){const w=bh({focusReason:A.value});Q("focusout-prevented",w),w.defaultPrevented||Ra(S,!0)}},0)}else{const b=v.target;b&&_.contains(b)||Q("focusout",v)}};async function p(){await s.nextTick();const v=s.unref(a);if(v){r1.push(h);const _=v.contains(document.activeElement)?x:document.activeElement;if(x=_,!v.contains(_)){const w=new Event(Nm,Y_);v.addEventListener(Nm,u),v.dispatchEvent(w),w.defaultPrevented||s.nextTick(()=>{let C=N.focusStartEl;Dn(C)||(Ra(C),document.activeElement!==C&&(C="first")),C==="first"&&_F(q_(v),!0),(document.activeElement===_||C==="container")&&Ra(v)})}}}function m(){const v=s.unref(a);if(v){v.removeEventListener(Nm,u);const _=new CustomEvent(Lm,{...Y_,detail:{focusReason:A.value}});v.addEventListener(Lm,l),v.dispatchEvent(_),!_.defaultPrevented&&(A.value=="keyboard"||!wF()||v.contains(document.activeElement))&&Ra(x??document.body),v.removeEventListener(Lm,l),r1.remove(h)}}return s.onMounted(()=>{N.trapped&&p(),s.watch(()=>N.trapped,v=>{v?p():m()})}),s.onBeforeUnmount(()=>{N.trapped&&m(),a.value&&(a.value.removeEventListener("keydown",d),a.value.removeEventListener("focusin",c),a.value.removeEventListener("focusout",f),a.value=void 0)}),{onKeydown:d}}});function EF(N,Q,a,x,S,A){return s.renderSlot(N.$slots,"default",{handleKeydown:N.onKeydown})}var BF=si(CF,[["render",EF],["__file","focus-trap.vue"]]);const PF=["fixed","absolute"],SF=ei({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Pr(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:rc,default:"bottom"},popperOptions:{type:Pr(Object),default:()=>({})},strategy:{type:String,values:PF,default:"absolute"}}),n1=ei({...SF,id:String,style:{type:Pr([String,Array,Object])},className:{type:Pr([String,Array,Object])},effect:{type:Pr(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Pr([String,Array,Object])},popperStyle:{type:Pr([String,Array,Object])},referenceEl:{type:Pr(Object)},triggerTargetEl:{type:Pr(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Ys(["ariaLabel"])}),kF={mouseenter:N=>N instanceof MouseEvent,mouseleave:N=>N instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},MF=(N,Q=[])=>{const{placement:a,strategy:x,popperOptions:S}=N,A={placement:a,strategy:x,...S,modifiers:[...IF(N),...Q]};return DF(A,S==null?void 0:S.modifiers),A},TF=N=>{if(Ln)return qo(N)};function IF(N){const{offset:Q,gpuAcceleration:a,fallbackPlacements:x}=N;return[{name:"offset",options:{offset:[0,Q??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:x}},{name:"computeStyles",options:{gpuAcceleration:a}}]}function DF(N,Q){Q&&(N.modifiers=[...N.modifiers,...Q??[]])}const FF=0,RF=N=>{const{popperInstanceRef:Q,contentRef:a,triggerRef:x,role:S}=s.inject(Rm,void 0),A=s.ref(),h=s.ref(),d=s.computed(()=>({name:"eventListeners",enabled:!!N.visible})),u=s.computed(()=>{var w;const C=s.unref(A),k=(w=s.unref(h))!=null?w:FF;return{name:"arrow",enabled:!N4(C),options:{element:C,padding:k}}}),l=s.computed(()=>({onFirstUpdate:()=>{v()},...MF(N,[s.unref(u),s.unref(d)])})),c=s.computed(()=>TF(N.referenceEl)||s.unref(x)),{attributes:f,state:p,styles:m,update:v,forceUpdate:_,instanceRef:b}=hD(c,a,l);return s.watch(b,w=>Q.value=w),s.onMounted(()=>{s.watch(()=>{var w;return(w=s.unref(c))==null?void 0:w.getBoundingClientRect()},()=>{v()})}),{attributes:f,arrowRef:A,contentRef:a,instanceRef:b,state:p,styles:m,role:S,forceUpdate:_,update:v}},OF=(N,{attributes:Q,styles:a,role:x})=>{const{nextZIndex:S}=CD(),A=Jr("popper"),h=s.computed(()=>s.unref(Q).popper),d=s.ref(Ri(N.zIndex)?N.zIndex:S()),u=s.computed(()=>[A.b(),A.is("pure",N.pure),A.is(N.effect),N.popperClass]),l=s.computed(()=>[{zIndex:s.unref(d)},s.unref(a).popper,N.popperStyle||{}]),c=s.computed(()=>x.value==="dialog"?"false":void 0),f=s.computed(()=>s.unref(a).arrow||{});return{ariaModal:c,arrowStyle:f,contentAttrs:h,contentClass:u,contentStyle:l,contentZIndex:d,updateZIndex:()=>{d.value=Ri(N.zIndex)?N.zIndex:S()}}},NF=(N,Q)=>{const a=s.ref(!1),x=s.ref();return{focusStartRef:x,trapped:a,onFocusAfterReleased:l=>{var c;((c=l.detail)==null?void 0:c.focusReason)!=="pointer"&&(x.value="first",Q("blur"))},onFocusAfterTrapped:()=>{Q("focus")},onFocusInTrap:l=>{N.visible&&!a.value&&(l.target&&(x.value=l.target),a.value=!0)},onFocusoutPrevented:l=>{N.trapping||(l.detail.focusReason==="pointer"&&l.preventDefault(),a.value=!1)},onReleaseRequested:()=>{a.value=!1,Q("close")}}},LF=s.defineComponent({name:"ElPopperContent"}),jF=s.defineComponent({...LF,props:n1,emits:kF,setup(N,{expose:Q,emit:a}){const x=N,{focusStartRef:S,trapped:A,onFocusAfterReleased:h,onFocusAfterTrapped:d,onFocusInTrap:u,onFocusoutPrevented:l,onReleaseRequested:c}=NF(x,a),{attributes:f,arrowRef:p,contentRef:m,styles:v,instanceRef:_,role:b,update:w}=RF(x),{ariaModal:C,arrowStyle:k,contentAttrs:T,contentClass:R,contentStyle:U,updateZIndex:G}=OF(x,{styles:v,attributes:f,role:b}),j=s.inject(Su,void 0),H=s.ref();s.provide(G_,{arrowStyle:k,arrowRef:p,arrowOffset:H}),j&&s.provide(Su,{...j,addInputId:du,removeInputId:du});let W;const K=(O=!0)=>{w(),O&&G()},$=()=>{K(!1),x.visible&&x.focusOnShow?A.value=!0:x.visible===!1&&(A.value=!1)};return s.onMounted(()=>{s.watch(()=>x.triggerTargetEl,(O,L)=>{W==null||W(),W=void 0;const M=s.unref(O||m.value),I=s.unref(L||m.value);fl(M)&&(W=s.watch([b,()=>x.ariaLabel,C,()=>x.id],F=>{["role","aria-label","aria-modal","id"].forEach((V,D)=>{ko(F[D])?M.removeAttribute(V):M.setAttribute(V,F[D])})},{immediate:!0})),I!==M&&fl(I)&&["role","aria-label","aria-modal","id"].forEach(F=>{I.removeAttribute(F)})},{immediate:!0}),s.watch(()=>x.visible,$,{immediate:!0})}),s.onBeforeUnmount(()=>{W==null||W(),W=void 0}),Q({popperContentRef:m,popperInstanceRef:_,updatePopper:K,contentStyle:U}),(O,L)=>(s.openBlock(),s.createElementBlock("div",s.mergeProps({ref_key:"contentRef",ref:m},s.unref(T),{style:s.unref(U),class:s.unref(R),tabindex:"-1",onMouseenter:M=>O.$emit("mouseenter",M),onMouseleave:M=>O.$emit("mouseleave",M)}),[s.createVNode(s.unref(BF),{trapped:s.unref(A),"trap-on-focus-in":!0,"focus-trap-el":s.unref(m),"focus-start-el":s.unref(S),onFocusAfterTrapped:s.unref(d),onFocusAfterReleased:s.unref(h),onFocusin:s.unref(u),onFocusoutPrevented:s.unref(l),onReleaseRequested:s.unref(c)},{default:s.withCtx(()=>[s.renderSlot(O.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var VF=si(jF,[["__file","content.vue"]]);const UF=Gn(oF),_h=Symbol("elTooltip"),Um=ei({...vD,...n1,appendTo:{type:Pr([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Pr(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Ys(["ariaLabel"])}),s1=ei({...X_,disabled:Boolean,trigger:{type:Pr([String,Array]),default:"hover"},triggerKeys:{type:Pr(Array),default:()=>[Ii.enter,Ii.space]}}),{useModelToggleProps:HF,useModelToggleEmits:zF,useModelToggle:GF}=o_("visible"),QF=ei({...Q_,...HF,...Um,...s1,...W_,showArrow:{type:Boolean,default:!0}}),WF=[...zF,"before-show","before-hide","show","hide","open","close"],$F=(N,Q)=>bi(N)?N.includes(Q):N===Q,cc=(N,Q,a)=>x=>{$F(s.unref(N),Q)&&a(x)},KF=s.defineComponent({name:"ElTooltipTrigger"}),XF=s.defineComponent({...KF,props:s1,setup(N,{expose:Q}){const a=N,x=Jr("tooltip"),{controlled:S,id:A,open:h,onOpen:d,onClose:u,onToggle:l}=s.inject(_h,void 0),c=s.ref(null),f=()=>{if(s.unref(S)||a.disabled)return!0},p=s.toRef(a,"trigger"),m=Zo(f,cc(p,"hover",d)),v=Zo(f,cc(p,"hover",u)),_=Zo(f,cc(p,"click",T=>{T.button===0&&l(T)})),b=Zo(f,cc(p,"focus",d)),w=Zo(f,cc(p,"focus",u)),C=Zo(f,cc(p,"contextmenu",T=>{T.preventDefault(),l(T)})),k=Zo(f,T=>{const{code:R}=T;a.triggerKeys.includes(R)&&(T.preventDefault(),l(T))});return Q({triggerRef:c}),(T,R)=>(s.openBlock(),s.createBlock(s.unref(fF),{id:s.unref(A),"virtual-ref":T.virtualRef,open:s.unref(h),"virtual-triggering":T.virtualTriggering,class:s.normalizeClass(s.unref(x).e("trigger")),onBlur:s.unref(w),onClick:s.unref(_),onContextmenu:s.unref(C),onFocus:s.unref(b),onMouseenter:s.unref(m),onMouseleave:s.unref(v),onKeydown:s.unref(k)},{default:s.withCtx(()=>[s.renderSlot(T.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var YF=si(XF,[["__file","trigger.vue"]]);const JF=ei({to:{type:Pr([String,Object]),required:!0},disabled:Boolean});var ZF=si(s.defineComponent({__name:"teleport",props:JF,setup(N){return(Q,a)=>Q.disabled?s.renderSlot(Q.$slots,"default",{key:0}):(s.openBlock(),s.createBlock(s.Teleport,{key:1,to:Q.to},[s.renderSlot(Q.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const qF=Gn(ZF),eR=s.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),tR=s.defineComponent({...eR,props:Um,setup(N,{expose:Q}){const a=N,{selector:x}=I_(),S=Jr("tooltip"),A=s.ref(null);let h;const{controlled:d,id:u,open:l,trigger:c,onClose:f,onOpen:p,onShow:m,onHide:v,onBeforeShow:_,onBeforeHide:b}=s.inject(_h,void 0),w=s.computed(()=>a.transition||`${S.namespace.value}-fade-in-linear`),C=s.computed(()=>process.env.NODE_ENV==="test"?!0:a.persistent);s.onBeforeUnmount(()=>{h==null||h()});const k=s.computed(()=>s.unref(C)?!0:s.unref(l)),T=s.computed(()=>a.disabled?!1:s.unref(l)),R=s.computed(()=>a.appendTo||x.value),U=s.computed(()=>{var I;return(I=a.style)!=null?I:{}}),G=s.computed(()=>!s.unref(l)),j=()=>{v()},H=()=>{if(s.unref(d))return!0},W=Zo(H,()=>{a.enterable&&s.unref(c)==="hover"&&p()}),K=Zo(H,()=>{s.unref(c)==="hover"&&f()}),$=()=>{var I,F;(F=(I=A.value)==null?void 0:I.updatePopper)==null||F.call(I),_==null||_()},O=()=>{b==null||b()},L=()=>{m(),h=tb(s.computed(()=>{var I;return(I=A.value)==null?void 0:I.popperContentRef}),()=>{if(s.unref(d))return;s.unref(c)!=="hover"&&f()})},M=()=>{a.virtualTriggering||f()};return s.watch(()=>s.unref(l),I=>{I||h==null||h()},{flush:"post"}),s.watch(()=>a.content,()=>{var I,F;(F=(I=A.value)==null?void 0:I.updatePopper)==null||F.call(I)}),Q({contentRef:A}),(I,F)=>(s.openBlock(),s.createBlock(s.unref(qF),{disabled:!I.teleported,to:s.unref(R)},{default:s.withCtx(()=>[s.createVNode(s.Transition,{name:s.unref(w),onAfterLeave:j,onBeforeEnter:$,onAfterEnter:L,onBeforeLeave:O},{default:s.withCtx(()=>[s.unref(k)?s.withDirectives((s.openBlock(),s.createBlock(s.unref(VF),s.mergeProps({key:0,id:s.unref(u),ref_key:"contentRef",ref:A},I.$attrs,{"aria-label":I.ariaLabel,"aria-hidden":s.unref(G),"boundaries-padding":I.boundariesPadding,"fallback-placements":I.fallbackPlacements,"gpu-acceleration":I.gpuAcceleration,offset:I.offset,placement:I.placement,"popper-options":I.popperOptions,strategy:I.strategy,effect:I.effect,enterable:I.enterable,pure:I.pure,"popper-class":I.popperClass,"popper-style":[I.popperStyle,s.unref(U)],"reference-el":I.referenceEl,"trigger-target-el":I.triggerTargetEl,visible:s.unref(T),"z-index":I.zIndex,onMouseenter:s.unref(W),onMouseleave:s.unref(K),onBlur:M,onClose:s.unref(f)}),{default:s.withCtx(()=>[s.renderSlot(I.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[s.vShow,s.unref(T)]]):s.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var rR=si(tR,[["__file","content.vue"]]);const iR=s.defineComponent({name:"ElTooltip"}),nR=s.defineComponent({...iR,props:QF,emits:WF,setup(N,{expose:Q,emit:a}){const x=N;gD();const S=Pu(),A=s.ref(),h=s.ref(),d=()=>{var w;const C=s.unref(A);C&&((w=C.popperInstanceRef)==null||w.update())},u=s.ref(!1),l=s.ref(),{show:c,hide:f,hasUpdateHandler:p}=GF({indicator:u,toggleReason:l}),{onOpen:m,onClose:v}=yD({showAfter:s.toRef(x,"showAfter"),hideAfter:s.toRef(x,"hideAfter"),autoClose:s.toRef(x,"autoClose"),open:c,close:f}),_=s.computed(()=>uo(x.visible)&&!p.value);s.provide(_h,{controlled:_,id:S,open:s.readonly(u),trigger:s.toRef(x,"trigger"),onOpen:w=>{m(w)},onClose:w=>{v(w)},onToggle:w=>{s.unref(u)?v(w):m(w)},onShow:()=>{a("show",l.value)},onHide:()=>{a("hide",l.value)},onBeforeShow:()=>{a("before-show",l.value)},onBeforeHide:()=>{a("before-hide",l.value)},updatePopper:d}),s.watch(()=>x.disabled,w=>{w&&u.value&&(u.value=!1)});const b=w=>{var C,k;const T=(k=(C=h.value)==null?void 0:C.contentRef)==null?void 0:k.popperContentRef,R=(w==null?void 0:w.relatedTarget)||document.activeElement;return T&&T.contains(R)};return s.onDeactivated(()=>u.value&&f()),Q({popperRef:A,contentRef:h,isFocusInsideContent:b,updatePopper:d,onOpen:m,onClose:v,hide:f}),(w,C)=>(s.openBlock(),s.createBlock(s.unref(UF),{ref_key:"popperRef",ref:A,role:w.role},{default:s.withCtx(()=>[s.createVNode(YF,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:s.withCtx(()=>[w.$slots.default?s.renderSlot(w.$slots,"default",{key:0}):s.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),s.createVNode(rR,{ref_key:"contentRef",ref:h,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":w.popperClass,"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:s.withCtx(()=>[s.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(s.openBlock(),s.createElementBlock("span",{key:0,innerHTML:w.content},null,8,["innerHTML"])):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(w.content),1))]),w.showArrow?(s.openBlock(),s.createBlock(s.unref(cF),{key:0,"arrow-offset":w.arrowOffset},null,8,["arrow-offset"])):s.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var sR=si(nR,[["__file","tooltip.vue"]]);const ku=Gn(sR),o1=Symbol("buttonGroupContextKey"),oR=(N,Q)=>{yu({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},s.computed(()=>N.type==="text"));const a=s.inject(o1,void 0),x=FD("button"),{form:S}=Ao(),A=mo(s.computed(()=>a==null?void 0:a.size)),h=gl(),d=s.ref(),u=s.useSlots(),l=s.computed(()=>N.type||(a==null?void 0:a.type)||""),c=s.computed(()=>{var v,_,b;return(b=(_=N.autoInsertSpace)!=null?_:(v=x.value)==null?void 0:v.autoInsertSpace)!=null?b:!1}),f=s.computed(()=>N.tag==="button"?{ariaDisabled:h.value||N.loading,disabled:h.value||N.loading,autofocus:N.autofocus,type:N.nativeType}:{}),p=s.computed(()=>{var v;const _=(v=u.default)==null?void 0:v.call(u);if(c.value&&(_==null?void 0:_.length)===1){const b=_[0];if((b==null?void 0:b.type)===s.Text){const w=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(w.trim())}}return!1});return{_disabled:h,_size:A,_type:l,_ref:d,_props:f,shouldAddSpace:p,handleClick:v=>{N.nativeType==="reset"&&(S==null||S.resetFields()),Q("click",v)}}},Hm=ei({size:po,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:ho},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:ho,default:()=>ui.Loading},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Pr([String,Object]),default:"button"}}),aR={click:N=>N instanceof MouseEvent};function Qn(N,Q){lR(N)&&(N="100%");var a=cR(N);return N=Q===360?N:Math.min(Q,Math.max(0,parseFloat(N))),a&&(N=parseInt(String(N*Q),10)/100),Math.abs(N-Q)<1e-6?1:(Q===360?N=(N<0?N%Q+Q:N%Q)/parseFloat(String(Q)):N=N%Q/parseFloat(String(Q)),N)}function wh(N){return Math.min(1,Math.max(0,N))}function lR(N){return typeof N=="string"&&N.indexOf(".")!==-1&&parseFloat(N)===1}function cR(N){return typeof N=="string"&&N.indexOf("%")!==-1}function a1(N){return N=parseFloat(N),(isNaN(N)||N<0||N>1)&&(N=1),N}function xh(N){return N<=1?"".concat(Number(N)*100,"%"):N}function yl(N){return N.length===1?"0"+N:String(N)}function uR(N,Q,a){return{r:Qn(N,255)*255,g:Qn(Q,255)*255,b:Qn(a,255)*255}}function l1(N,Q,a){N=Qn(N,255),Q=Qn(Q,255),a=Qn(a,255);var x=Math.max(N,Q,a),S=Math.min(N,Q,a),A=0,h=0,d=(x+S)/2;if(x===S)h=0,A=0;else{var u=x-S;switch(h=d>.5?u/(2-x-S):u/(x+S),x){case N:A=(Q-a)/u+(Q<a?6:0);break;case Q:A=(a-N)/u+2;break;case a:A=(N-Q)/u+4;break}A/=6}return{h:A,s:h,l:d}}function zm(N,Q,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?N+(Q-N)*(6*a):a<1/2?Q:a<2/3?N+(Q-N)*(2/3-a)*6:N}function dR(N,Q,a){var x,S,A;if(N=Qn(N,360),Q=Qn(Q,100),a=Qn(a,100),Q===0)S=a,A=a,x=a;else{var h=a<.5?a*(1+Q):a+Q-a*Q,d=2*a-h;x=zm(d,h,N+1/3),S=zm(d,h,N),A=zm(d,h,N-1/3)}return{r:x*255,g:S*255,b:A*255}}function c1(N,Q,a){N=Qn(N,255),Q=Qn(Q,255),a=Qn(a,255);var x=Math.max(N,Q,a),S=Math.min(N,Q,a),A=0,h=x,d=x-S,u=x===0?0:d/x;if(x===S)A=0;else{switch(x){case N:A=(Q-a)/d+(Q<a?6:0);break;case Q:A=(a-N)/d+2;break;case a:A=(N-Q)/d+4;break}A/=6}return{h:A,s:u,v:h}}function hR(N,Q,a){N=Qn(N,360)*6,Q=Qn(Q,100),a=Qn(a,100);var x=Math.floor(N),S=N-x,A=a*(1-Q),h=a*(1-S*Q),d=a*(1-(1-S)*Q),u=x%6,l=[a,h,A,A,d,a][u],c=[d,a,a,h,A,A][u],f=[A,A,d,a,a,h][u];return{r:l*255,g:c*255,b:f*255}}function u1(N,Q,a,x){var S=[yl(Math.round(N).toString(16)),yl(Math.round(Q).toString(16)),yl(Math.round(a).toString(16))];return x&&S[0].startsWith(S[0].charAt(1))&&S[1].startsWith(S[1].charAt(1))&&S[2].startsWith(S[2].charAt(1))?S[0].charAt(0)+S[1].charAt(0)+S[2].charAt(0):S.join("")}function fR(N,Q,a,x,S){var A=[yl(Math.round(N).toString(16)),yl(Math.round(Q).toString(16)),yl(Math.round(a).toString(16)),yl(pR(x))];return S&&A[0].startsWith(A[0].charAt(1))&&A[1].startsWith(A[1].charAt(1))&&A[2].startsWith(A[2].charAt(1))&&A[3].startsWith(A[3].charAt(1))?A[0].charAt(0)+A[1].charAt(0)+A[2].charAt(0)+A[3].charAt(0):A.join("")}function pR(N){return Math.round(parseFloat(N)*255).toString(16)}function d1(N){return Ds(N)/255}function Ds(N){return parseInt(N,16)}function mR(N){return{r:N>>16,g:(N&65280)>>8,b:N&255}}var Gm={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function AR(N){var Q={r:0,g:0,b:0},a=1,x=null,S=null,A=null,h=!1,d=!1;return typeof N=="string"&&(N=yR(N)),typeof N=="object"&&(oa(N.r)&&oa(N.g)&&oa(N.b)?(Q=uR(N.r,N.g,N.b),h=!0,d=String(N.r).substr(-1)==="%"?"prgb":"rgb"):oa(N.h)&&oa(N.s)&&oa(N.v)?(x=xh(N.s),S=xh(N.v),Q=hR(N.h,x,S),h=!0,d="hsv"):oa(N.h)&&oa(N.s)&&oa(N.l)&&(x=xh(N.s),A=xh(N.l),Q=dR(N.h,x,A),h=!0,d="hsl"),Object.prototype.hasOwnProperty.call(N,"a")&&(a=N.a)),a=a1(a),{ok:h,format:N.format||d,r:Math.min(255,Math.max(Q.r,0)),g:Math.min(255,Math.max(Q.g,0)),b:Math.min(255,Math.max(Q.b,0)),a}}var gR="[-\\+]?\\d+%?",vR="[-\\+]?\\d*\\.\\d+%?",Oa="(?:".concat(vR,")|(?:").concat(gR,")"),Qm="[\\s|\\(]+(".concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")\\s*\\)?"),Wm="[\\s|\\(]+(".concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")[,|\\s]+(").concat(Oa,")\\s*\\)?"),vo={CSS_UNIT:new RegExp(Oa),rgb:new RegExp("rgb"+Qm),rgba:new RegExp("rgba"+Wm),hsl:new RegExp("hsl"+Qm),hsla:new RegExp("hsla"+Wm),hsv:new RegExp("hsv"+Qm),hsva:new RegExp("hsva"+Wm),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function yR(N){if(N=N.trim().toLowerCase(),N.length===0)return!1;var Q=!1;if(Gm[N])N=Gm[N],Q=!0;else if(N==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var a=vo.rgb.exec(N);return a?{r:a[1],g:a[2],b:a[3]}:(a=vo.rgba.exec(N),a?{r:a[1],g:a[2],b:a[3],a:a[4]}:(a=vo.hsl.exec(N),a?{h:a[1],s:a[2],l:a[3]}:(a=vo.hsla.exec(N),a?{h:a[1],s:a[2],l:a[3],a:a[4]}:(a=vo.hsv.exec(N),a?{h:a[1],s:a[2],v:a[3]}:(a=vo.hsva.exec(N),a?{h:a[1],s:a[2],v:a[3],a:a[4]}:(a=vo.hex8.exec(N),a?{r:Ds(a[1]),g:Ds(a[2]),b:Ds(a[3]),a:d1(a[4]),format:Q?"name":"hex8"}:(a=vo.hex6.exec(N),a?{r:Ds(a[1]),g:Ds(a[2]),b:Ds(a[3]),format:Q?"name":"hex"}:(a=vo.hex4.exec(N),a?{r:Ds(a[1]+a[1]),g:Ds(a[2]+a[2]),b:Ds(a[3]+a[3]),a:d1(a[4]+a[4]),format:Q?"name":"hex8"}:(a=vo.hex3.exec(N),a?{r:Ds(a[1]+a[1]),g:Ds(a[2]+a[2]),b:Ds(a[3]+a[3]),format:Q?"name":"hex"}:!1)))))))))}function oa(N){return!!vo.CSS_UNIT.exec(String(N))}var bR=function(){function N(Q,a){Q===void 0&&(Q=""),a===void 0&&(a={});var x;if(Q instanceof N)return Q;typeof Q=="number"&&(Q=mR(Q)),this.originalInput=Q;var S=AR(Q);this.originalInput=Q,this.r=S.r,this.g=S.g,this.b=S.b,this.a=S.a,this.roundA=Math.round(100*this.a)/100,this.format=(x=a.format)!==null&&x!==void 0?x:S.format,this.gradientType=a.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=S.ok}return N.prototype.isDark=function(){return this.getBrightness()<128},N.prototype.isLight=function(){return!this.isDark()},N.prototype.getBrightness=function(){var Q=this.toRgb();return(Q.r*299+Q.g*587+Q.b*114)/1e3},N.prototype.getLuminance=function(){var Q=this.toRgb(),a,x,S,A=Q.r/255,h=Q.g/255,d=Q.b/255;return A<=.03928?a=A/12.92:a=Math.pow((A+.055)/1.055,2.4),h<=.03928?x=h/12.92:x=Math.pow((h+.055)/1.055,2.4),d<=.03928?S=d/12.92:S=Math.pow((d+.055)/1.055,2.4),.2126*a+.7152*x+.0722*S},N.prototype.getAlpha=function(){return this.a},N.prototype.setAlpha=function(Q){return this.a=a1(Q),this.roundA=Math.round(100*this.a)/100,this},N.prototype.isMonochrome=function(){var Q=this.toHsl().s;return Q===0},N.prototype.toHsv=function(){var Q=c1(this.r,this.g,this.b);return{h:Q.h*360,s:Q.s,v:Q.v,a:this.a}},N.prototype.toHsvString=function(){var Q=c1(this.r,this.g,this.b),a=Math.round(Q.h*360),x=Math.round(Q.s*100),S=Math.round(Q.v*100);return this.a===1?"hsv(".concat(a,", ").concat(x,"%, ").concat(S,"%)"):"hsva(".concat(a,", ").concat(x,"%, ").concat(S,"%, ").concat(this.roundA,")")},N.prototype.toHsl=function(){var Q=l1(this.r,this.g,this.b);return{h:Q.h*360,s:Q.s,l:Q.l,a:this.a}},N.prototype.toHslString=function(){var Q=l1(this.r,this.g,this.b),a=Math.round(Q.h*360),x=Math.round(Q.s*100),S=Math.round(Q.l*100);return this.a===1?"hsl(".concat(a,", ").concat(x,"%, ").concat(S,"%)"):"hsla(".concat(a,", ").concat(x,"%, ").concat(S,"%, ").concat(this.roundA,")")},N.prototype.toHex=function(Q){return Q===void 0&&(Q=!1),u1(this.r,this.g,this.b,Q)},N.prototype.toHexString=function(Q){return Q===void 0&&(Q=!1),"#"+this.toHex(Q)},N.prototype.toHex8=function(Q){return Q===void 0&&(Q=!1),fR(this.r,this.g,this.b,this.a,Q)},N.prototype.toHex8String=function(Q){return Q===void 0&&(Q=!1),"#"+this.toHex8(Q)},N.prototype.toHexShortString=function(Q){return Q===void 0&&(Q=!1),this.a===1?this.toHexString(Q):this.toHex8String(Q)},N.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},N.prototype.toRgbString=function(){var Q=Math.round(this.r),a=Math.round(this.g),x=Math.round(this.b);return this.a===1?"rgb(".concat(Q,", ").concat(a,", ").concat(x,")"):"rgba(".concat(Q,", ").concat(a,", ").concat(x,", ").concat(this.roundA,")")},N.prototype.toPercentageRgb=function(){var Q=function(a){return"".concat(Math.round(Qn(a,255)*100),"%")};return{r:Q(this.r),g:Q(this.g),b:Q(this.b),a:this.a}},N.prototype.toPercentageRgbString=function(){var Q=function(a){return Math.round(Qn(a,255)*100)};return this.a===1?"rgb(".concat(Q(this.r),"%, ").concat(Q(this.g),"%, ").concat(Q(this.b),"%)"):"rgba(".concat(Q(this.r),"%, ").concat(Q(this.g),"%, ").concat(Q(this.b),"%, ").concat(this.roundA,")")},N.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var Q="#"+u1(this.r,this.g,this.b,!1),a=0,x=Object.entries(Gm);a<x.length;a++){var S=x[a],A=S[0],h=S[1];if(Q===h)return A}return!1},N.prototype.toString=function(Q){var a=!!Q;Q=Q??this.format;var x=!1,S=this.a<1&&this.a>=0,A=!a&&S&&(Q.startsWith("hex")||Q==="name");return A?Q==="name"&&this.a===0?this.toName():this.toRgbString():(Q==="rgb"&&(x=this.toRgbString()),Q==="prgb"&&(x=this.toPercentageRgbString()),(Q==="hex"||Q==="hex6")&&(x=this.toHexString()),Q==="hex3"&&(x=this.toHexString(!0)),Q==="hex4"&&(x=this.toHex8String(!0)),Q==="hex8"&&(x=this.toHex8String()),Q==="name"&&(x=this.toName()),Q==="hsl"&&(x=this.toHslString()),Q==="hsv"&&(x=this.toHsvString()),x||this.toHexString())},N.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},N.prototype.clone=function(){return new N(this.toString())},N.prototype.lighten=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.l+=Q/100,a.l=wh(a.l),new N(a)},N.prototype.brighten=function(Q){Q===void 0&&(Q=10);var a=this.toRgb();return a.r=Math.max(0,Math.min(255,a.r-Math.round(255*-(Q/100)))),a.g=Math.max(0,Math.min(255,a.g-Math.round(255*-(Q/100)))),a.b=Math.max(0,Math.min(255,a.b-Math.round(255*-(Q/100)))),new N(a)},N.prototype.darken=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.l-=Q/100,a.l=wh(a.l),new N(a)},N.prototype.tint=function(Q){return Q===void 0&&(Q=10),this.mix("white",Q)},N.prototype.shade=function(Q){return Q===void 0&&(Q=10),this.mix("black",Q)},N.prototype.desaturate=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.s-=Q/100,a.s=wh(a.s),new N(a)},N.prototype.saturate=function(Q){Q===void 0&&(Q=10);var a=this.toHsl();return a.s+=Q/100,a.s=wh(a.s),new N(a)},N.prototype.greyscale=function(){return this.desaturate(100)},N.prototype.spin=function(Q){var a=this.toHsl(),x=(a.h+Q)%360;return a.h=x<0?360+x:x,new N(a)},N.prototype.mix=function(Q,a){a===void 0&&(a=50);var x=this.toRgb(),S=new N(Q).toRgb(),A=a/100,h={r:(S.r-x.r)*A+x.r,g:(S.g-x.g)*A+x.g,b:(S.b-x.b)*A+x.b,a:(S.a-x.a)*A+x.a};return new N(h)},N.prototype.analogous=function(Q,a){Q===void 0&&(Q=6),a===void 0&&(a=30);var x=this.toHsl(),S=360/a,A=[this];for(x.h=(x.h-(S*Q>>1)+720)%360;--Q;)x.h=(x.h+S)%360,A.push(new N(x));return A},N.prototype.complement=function(){var Q=this.toHsl();return Q.h=(Q.h+180)%360,new N(Q)},N.prototype.monochromatic=function(Q){Q===void 0&&(Q=6);for(var a=this.toHsv(),x=a.h,S=a.s,A=a.v,h=[],d=1/Q;Q--;)h.push(new N({h:x,s:S,v:A})),A=(A+d)%1;return h},N.prototype.splitcomplement=function(){var Q=this.toHsl(),a=Q.h;return[this,new N({h:(a+72)%360,s:Q.s,l:Q.l}),new N({h:(a+216)%360,s:Q.s,l:Q.l})]},N.prototype.onBackground=function(Q){var a=this.toRgb(),x=new N(Q).toRgb(),S=a.a+x.a*(1-a.a);return new N({r:(a.r*a.a+x.r*x.a*(1-a.a))/S,g:(a.g*a.a+x.g*x.a*(1-a.a))/S,b:(a.b*a.a+x.b*x.a*(1-a.a))/S,a:S})},N.prototype.triad=function(){return this.polyad(3)},N.prototype.tetrad=function(){return this.polyad(4)},N.prototype.polyad=function(Q){for(var a=this.toHsl(),x=a.h,S=[this],A=360/Q,h=1;h<Q;h++)S.push(new N({h:(x+h*A)%360,s:a.s,l:a.l}));return S},N.prototype.equals=function(Q){return this.toRgbString()===new N(Q).toRgbString()},N}();function Na(N,Q=20){return N.mix("#141414",Q).toString()}function _R(N){const Q=gl(),a=Jr("button");return s.computed(()=>{let x={},S=N.color;if(S){const A=S.match(/var\((.*?)\)/);A&&(S=window.getComputedStyle(window.document.documentElement).getPropertyValue(A[1]));const h=new bR(S),d=N.dark?h.tint(20).toString():Na(h,20);if(N.plain)x=a.cssVarBlock({"bg-color":N.dark?Na(h,90):h.tint(90).toString(),"text-color":S,"border-color":N.dark?Na(h,50):h.tint(50).toString(),"hover-text-color":`var(${a.cssVarName("color-white")})`,"hover-bg-color":S,"hover-border-color":S,"active-bg-color":d,"active-text-color":`var(${a.cssVarName("color-white")})`,"active-border-color":d}),Q.value&&(x[a.cssVarBlockName("disabled-bg-color")]=N.dark?Na(h,90):h.tint(90).toString(),x[a.cssVarBlockName("disabled-text-color")]=N.dark?Na(h,50):h.tint(50).toString(),x[a.cssVarBlockName("disabled-border-color")]=N.dark?Na(h,80):h.tint(80).toString());else{const u=N.dark?Na(h,30):h.tint(30).toString(),l=h.isDark()?`var(${a.cssVarName("color-white")})`:`var(${a.cssVarName("color-black")})`;if(x=a.cssVarBlock({"bg-color":S,"text-color":l,"border-color":S,"hover-bg-color":u,"hover-text-color":l,"hover-border-color":u,"active-bg-color":d,"active-border-color":d}),Q.value){const c=N.dark?Na(h,50):h.tint(50).toString();x[a.cssVarBlockName("disabled-bg-color")]=c,x[a.cssVarBlockName("disabled-text-color")]=N.dark?"rgba(255, 255, 255, 0.5)":`var(${a.cssVarName("color-white")})`,x[a.cssVarBlockName("disabled-border-color")]=c}}}return x})}const wR=s.defineComponent({name:"ElButton"}),xR=s.defineComponent({...wR,props:Hm,emits:aR,setup(N,{expose:Q,emit:a}){const x=N,S=_R(x),A=Jr("button"),{_ref:h,_size:d,_type:u,_disabled:l,_props:c,shouldAddSpace:f,handleClick:p}=oR(x,a),m=s.computed(()=>[A.b(),A.m(u.value),A.m(d.value),A.is("disabled",l.value),A.is("loading",x.loading),A.is("plain",x.plain),A.is("round",x.round),A.is("circle",x.circle),A.is("text",x.text),A.is("link",x.link),A.is("has-bg",x.bg)]);return Q({ref:h,size:d,type:u,disabled:l,shouldAddSpace:f}),(v,_)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.tag),s.mergeProps({ref_key:"_ref",ref:h},s.unref(c),{class:s.unref(m),style:s.unref(S),onClick:s.unref(p)}),{default:s.withCtx(()=>[v.loading?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[v.$slots.loading?s.renderSlot(v.$slots,"loading",{key:0}):(s.openBlock(),s.createBlock(s.unref(ni),{key:1,class:s.normalizeClass(s.unref(A).is("loading"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.loadingIcon)))]),_:1},8,["class"]))],64)):v.icon||v.$slots.icon?(s.openBlock(),s.createBlock(s.unref(ni),{key:1},{default:s.withCtx(()=>[v.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(v.icon),{key:0})):s.renderSlot(v.$slots,"icon",{key:1})]),_:3})):s.createCommentVNode("v-if",!0),v.$slots.default?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass({[s.unref(A).em("text","expand")]:s.unref(f)})},[s.renderSlot(v.$slots,"default")],2)):s.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var CR=si(xR,[["__file","button.vue"]]);const ER={size:Hm.size,type:Hm.type},BR=s.defineComponent({name:"ElButtonGroup"}),PR=s.defineComponent({...BR,props:ER,setup(N){const Q=N;s.provide(o1,s.reactive({size:s.toRef(Q,"size"),type:s.toRef(Q,"type")}));const a=Jr("button");return(x,S)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(a).b("group"))},[s.renderSlot(x.$slots,"default")],2))}});var h1=si(PR,[["__file","button-group.vue"]]);const Ch=Gn(CR,{ButtonGroup:h1});pl(h1);var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aa(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var f1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){var a=1e3,x=6e4,S=36e5,A="millisecond",h="second",d="minute",u="hour",l="day",c="week",f="month",p="quarter",m="year",v="date",_="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var M=["th","st","nd","rd"],I=L%100;return"["+L+(M[(I-20)%10]||M[I]||M[0])+"]"}},k=function(L,M,I){var F=String(L);return!F||F.length>=M?L:""+Array(M+1-F.length).join(I)+L},T={s:k,z:function(L){var M=-L.utcOffset(),I=Math.abs(M),F=Math.floor(I/60),V=I%60;return(M<=0?"+":"-")+k(F,2,"0")+":"+k(V,2,"0")},m:function L(M,I){if(M.date()<I.date())return-L(I,M);var F=12*(I.year()-M.year())+(I.month()-M.month()),V=M.clone().add(F,f),D=I-V<0,X=M.clone().add(F+(D?-1:1),f);return+(-(F+(I-V)/(D?V-X:X-V))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:f,y:m,w:c,d:l,D:v,h:u,m:d,s:h,ms:A,Q:p}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},R="en",U={};U[R]=C;var G="$isDayjsObject",j=function(L){return L instanceof $||!(!L||!L[G])},H=function L(M,I,F){var V;if(!M)return R;if(typeof M=="string"){var D=M.toLowerCase();U[D]&&(V=D),I&&(U[D]=I,V=D);var X=M.split("-");if(!V&&X.length>1)return L(X[0])}else{var ee=M.name;U[ee]=M,V=ee}return!F&&V&&(R=V),V||!F&&R},W=function(L,M){if(j(L))return L.clone();var I=typeof M=="object"?M:{};return I.date=L,I.args=arguments,new $(I)},K=T;K.l=H,K.i=j,K.w=function(L,M){return W(L,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var $=function(){function L(I){this.$L=H(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[G]=!0}var M=L.prototype;return M.parse=function(I){this.$d=function(F){var V=F.date,D=F.utc;if(V===null)return new Date(NaN);if(K.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var X=V.match(b);if(X){var ee=X[2]-1||0,q=(X[7]||"0").substring(0,3);return D?new Date(Date.UTC(X[1],ee,X[3]||1,X[4]||0,X[5]||0,X[6]||0,q)):new Date(X[1],ee,X[3]||1,X[4]||0,X[5]||0,X[6]||0,q)}}return new Date(V)}(I),this.init()},M.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},M.$utils=function(){return K},M.isValid=function(){return this.$d.toString()!==_},M.isSame=function(I,F){var V=W(I);return this.startOf(F)<=V&&V<=this.endOf(F)},M.isAfter=function(I,F){return W(I)<this.startOf(F)},M.isBefore=function(I,F){return this.endOf(F)<W(I)},M.$g=function(I,F,V){return K.u(I)?this[F]:this.set(V,I)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(I,F){var V=this,D=!!K.u(F)||F,X=K.p(I),ee=function(re,ae){var Ce=K.w(V.$u?Date.UTC(V.$y,ae,re):new Date(V.$y,ae,re),V);return D?Ce:Ce.endOf(l)},q=function(re,ae){return K.w(V.toDate()[re].apply(V.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(ae)),V)},ne=this.$W,oe=this.$M,he=this.$D,te="set"+(this.$u?"UTC":"");switch(X){case m:return D?ee(1,0):ee(31,11);case f:return D?ee(1,oe):ee(0,oe+1);case c:var de=this.$locale().weekStart||0,se=(ne<de?ne+7:ne)-de;return ee(D?he-se:he+(6-se),oe);case l:case v:return q(te+"Hours",0);case u:return q(te+"Minutes",1);case d:return q(te+"Seconds",2);case h:return q(te+"Milliseconds",3);default:return this.clone()}},M.endOf=function(I){return this.startOf(I,!1)},M.$set=function(I,F){var V,D=K.p(I),X="set"+(this.$u?"UTC":""),ee=(V={},V[l]=X+"Date",V[v]=X+"Date",V[f]=X+"Month",V[m]=X+"FullYear",V[u]=X+"Hours",V[d]=X+"Minutes",V[h]=X+"Seconds",V[A]=X+"Milliseconds",V)[D],q=D===l?this.$D+(F-this.$W):F;if(D===f||D===m){var ne=this.clone().set(v,1);ne.$d[ee](q),ne.init(),this.$d=ne.set(v,Math.min(this.$D,ne.daysInMonth())).$d}else ee&&this.$d[ee](q);return this.init(),this},M.set=function(I,F){return this.clone().$set(I,F)},M.get=function(I){return this[K.p(I)]()},M.add=function(I,F){var V,D=this;I=Number(I);var X=K.p(F),ee=function(oe){var he=W(D);return K.w(he.date(he.date()+Math.round(oe*I)),D)};if(X===f)return this.set(f,this.$M+I);if(X===m)return this.set(m,this.$y+I);if(X===l)return ee(1);if(X===c)return ee(7);var q=(V={},V[d]=x,V[u]=S,V[h]=a,V)[X]||1,ne=this.$d.getTime()+I*q;return K.w(ne,this)},M.subtract=function(I,F){return this.add(-1*I,F)},M.format=function(I){var F=this,V=this.$locale();if(!this.isValid())return V.invalidDate||_;var D=I||"YYYY-MM-DDTHH:mm:ssZ",X=K.z(this),ee=this.$H,q=this.$m,ne=this.$M,oe=V.weekdays,he=V.months,te=V.meridiem,de=function(ae,Ce,me,ce){return ae&&(ae[Ce]||ae(F,D))||me[Ce].slice(0,ce)},se=function(ae){return K.s(ee%12||12,ae,"0")},re=te||function(ae,Ce,me){var ce=ae<12?"AM":"PM";return me?ce.toLowerCase():ce};return D.replace(w,function(ae,Ce){return Ce||function(me){switch(me){case"YY":return String(F.$y).slice(-2);case"YYYY":return K.s(F.$y,4,"0");case"M":return ne+1;case"MM":return K.s(ne+1,2,"0");case"MMM":return de(V.monthsShort,ne,he,3);case"MMMM":return de(he,ne);case"D":return F.$D;case"DD":return K.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return de(V.weekdaysMin,F.$W,oe,2);case"ddd":return de(V.weekdaysShort,F.$W,oe,3);case"dddd":return oe[F.$W];case"H":return String(ee);case"HH":return K.s(ee,2,"0");case"h":return se(1);case"hh":return se(2);case"a":return re(ee,q,!0);case"A":return re(ee,q,!1);case"m":return String(q);case"mm":return K.s(q,2,"0");case"s":return String(F.$s);case"ss":return K.s(F.$s,2,"0");case"SSS":return K.s(F.$ms,3,"0");case"Z":return X}return null}(ae)||X.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(I,F,V){var D,X=this,ee=K.p(F),q=W(I),ne=(q.utcOffset()-this.utcOffset())*x,oe=this-q,he=function(){return K.m(X,q)};switch(ee){case m:D=he()/12;break;case f:D=he();break;case p:D=he()/3;break;case c:D=(oe-ne)/6048e5;break;case l:D=(oe-ne)/864e5;break;case u:D=oe/S;break;case d:D=oe/x;break;case h:D=oe/a;break;default:D=oe}return V?D:K.a(D)},M.daysInMonth=function(){return this.endOf(f).$D},M.$locale=function(){return U[this.$L]},M.locale=function(I,F){if(!I)return this.$L;var V=this.clone(),D=H(I,F,!0);return D&&(V.$L=D),V},M.clone=function(){return K.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},L}(),O=$.prototype;return W.prototype=O,[["$ms",A],["$s",h],["$m",d],["$H",u],["$W",l],["$M",f],["$y",m],["$D",v]].forEach(function(L){O[L[1]]=function(M){return this.$g(M,L[0],L[1])}}),W.extend=function(L,M){return L.$i||(L(M,$,W),L.$i=!0),W},W.locale=H,W.isDayjs=j,W.unix=function(L){return W(1e3*L)},W.en=U[R],W.Ls=U,W.p={},W})})(f1);var SR=f1.exports;const Ir=aa(SR);var p1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){var a={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},x=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,S=/\d\d/,A=/\d\d?/,h=/\d*[^-_:/,()\s\d]+/,d={},u=function(_){return(_=+_)+(_>68?1900:2e3)},l=function(_){return function(b){this[_]=+b}},c=[/[+-]\d\d:?(\d\d)?|Z/,function(_){(this.zone||(this.zone={})).offset=function(b){if(!b||b==="Z")return 0;var w=b.match(/([+-]|\d\d)/g),C=60*w[1]+(+w[2]||0);return C===0?0:w[0]==="+"?-C:C}(_)}],f=function(_){var b=d[_];return b&&(b.indexOf?b:b.s.concat(b.f))},p=function(_,b){var w,C=d.meridiem;if(C){for(var k=1;k<=24;k+=1)if(_.indexOf(C(k,0,b))>-1){w=k>12;break}}else w=_===(b?"pm":"PM");return w},m={A:[h,function(_){this.afternoon=p(_,!1)}],a:[h,function(_){this.afternoon=p(_,!0)}],S:[/\d/,function(_){this.milliseconds=100*+_}],SS:[S,function(_){this.milliseconds=10*+_}],SSS:[/\d{3}/,function(_){this.milliseconds=+_}],s:[A,l("seconds")],ss:[A,l("seconds")],m:[A,l("minutes")],mm:[A,l("minutes")],H:[A,l("hours")],h:[A,l("hours")],HH:[A,l("hours")],hh:[A,l("hours")],D:[A,l("day")],DD:[S,l("day")],Do:[h,function(_){var b=d.ordinal,w=_.match(/\d+/);if(this.day=w[0],b)for(var C=1;C<=31;C+=1)b(C).replace(/\[|\]/g,"")===_&&(this.day=C)}],M:[A,l("month")],MM:[S,l("month")],MMM:[h,function(_){var b=f("months"),w=(f("monthsShort")||b.map(function(C){return C.slice(0,3)})).indexOf(_)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[h,function(_){var b=f("months").indexOf(_)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,l("year")],YY:[S,function(_){this.year=u(_)}],YYYY:[/\d{4}/,l("year")],Z:c,ZZ:c};function v(_){var b,w;b=_,w=d&&d.formats;for(var C=(_=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(H,W,K){var $=K&&K.toUpperCase();return W||w[K]||a[K]||w[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,L,M){return L||M.slice(1)})})).match(x),k=C.length,T=0;T<k;T+=1){var R=C[T],U=m[R],G=U&&U[0],j=U&&U[1];C[T]=j?{regex:G,parser:j}:R.replace(/^\[|\]$/g,"")}return function(H){for(var W={},K=0,$=0;K<k;K+=1){var O=C[K];if(typeof O=="string")$+=O.length;else{var L=O.regex,M=O.parser,I=H.slice($),F=L.exec(I)[0];M.call(W,F),H=H.replace(F,"")}}return function(V){var D=V.afternoon;if(D!==void 0){var X=V.hours;D?X<12&&(V.hours+=12):X===12&&(V.hours=0),delete V.afternoon}}(W),W}}return function(_,b,w){w.p.customParseFormat=!0,_&&_.parseTwoDigitYear&&(u=_.parseTwoDigitYear);var C=b.prototype,k=C.parse;C.parse=function(T){var R=T.date,U=T.utc,G=T.args;this.$u=U;var j=G[1];if(typeof j=="string"){var H=G[2]===!0,W=G[3]===!0,K=H||W,$=G[2];W&&($=G[2]),d=this.$locale(),!H&&$&&(d=w.Ls[$]),this.$d=function(I,F,V){try{if(["x","X"].indexOf(F)>-1)return new Date((F==="X"?1e3:1)*I);var D=v(F)(I),X=D.year,ee=D.month,q=D.day,ne=D.hours,oe=D.minutes,he=D.seconds,te=D.milliseconds,de=D.zone,se=new Date,re=q||(X||ee?1:se.getDate()),ae=X||se.getFullYear(),Ce=0;X&&!ee||(Ce=ee>0?ee-1:se.getMonth());var me=ne||0,ce=oe||0,pe=he||0,B=te||0;return de?new Date(Date.UTC(ae,Ce,re,me,ce,pe,B+60*de.offset*1e3)):V?new Date(Date.UTC(ae,Ce,re,me,ce,pe,B)):new Date(ae,Ce,re,me,ce,pe,B)}catch{return new Date("")}}(R,j,U),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),K&&R!=this.format(j)&&(this.$d=new Date("")),d={}}else if(j instanceof Array)for(var O=j.length,L=1;L<=O;L+=1){G[1]=j[L-1];var M=w.apply(this,G);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}L===O&&(this.$d=new Date(""))}else k.call(this,T)}}})})(p1);var kR=p1.exports;const MR=aa(kR),m1=["hours","minutes","seconds"],A1="HH:mm:ss",uc="YYYY-MM-DD",TR={date:uc,dates:uc,week:"gggg[w]ww",year:"YYYY",years:"YYYY",month:"YYYY-MM",months:"YYYY-MM",datetime:`${uc} ${A1}`,monthrange:"YYYY-MM",yearrange:"YYYY",daterange:uc,datetimerange:`${uc} ${A1}`},$m=(N,Q)=>[N>0?N-1:void 0,N,N<Q?N+1:void 0],g1=N=>Array.from(Array.from({length:N}).keys()),v1=N=>N.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim(),y1=N=>N.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g,"").trim(),b1=function(N,Q){const a=ub(N),x=ub(Q);return a&&x?N.getTime()===Q.getTime():!a&&!x?N===Q:!1},_1=function(N,Q){const a=bi(N),x=bi(Q);return a&&x?N.length!==Q.length?!1:N.every((S,A)=>b1(S,Q[A])):!a&&!x?b1(N,Q):!1},w1=function(N,Q,a){const x=t_(Q)||Q==="x"?Ir(N).locale(a):Ir(N,Q).locale(a);return x.isValid()?x:void 0},x1=function(N,Q,a){return t_(Q)?N:Q==="x"?+N:Ir(N).locale(a).format(Q)},Km=(N,Q)=>{var a;const x=[],S=Q==null?void 0:Q();for(let A=0;A<N;A++)x.push((a=S==null?void 0:S.includes(A))!=null?a:!1);return x},C1=ei({disabledHours:{type:Pr(Function)},disabledMinutes:{type:Pr(Function)},disabledSeconds:{type:Pr(Function)}}),IR=ei({visible:Boolean,actualVisible:{type:Boolean,default:void 0},format:{type:String,default:""}}),E1=ei({id:{type:Pr([Array,String])},name:{type:Pr([Array,String]),default:""},popperClass:{type:String,default:""},format:String,valueFormat:String,dateFormat:String,timeFormat:String,type:{type:String,default:""},clearable:{type:Boolean,default:!0},clearIcon:{type:Pr([String,Object]),default:ui.CircleClose},editable:{type:Boolean,default:!0},prefixIcon:{type:Pr([String,Object]),default:""},size:po,readonly:Boolean,disabled:Boolean,placeholder:{type:String,default:""},popperOptions:{type:Pr(Object),default:()=>({})},modelValue:{type:Pr([Date,Array,String,Number]),default:""},rangeSeparator:{type:String,default:"-"},startPlaceholder:String,endPlaceholder:String,defaultValue:{type:Pr([Date,Array])},defaultTime:{type:Pr([Date,Array])},isRange:Boolean,...C1,disabledDate:{type:Function},cellClassName:{type:Function},shortcuts:{type:Array,default:()=>[]},arrowControl:Boolean,tabindex:{type:Pr([String,Number]),default:0},validateEvent:{type:Boolean,default:!0},unlinkPanels:Boolean,...j_,...Ys(["ariaLabel"])}),DR=s.defineComponent({name:"Picker"}),FR=s.defineComponent({...DR,props:E1,emits:["update:modelValue","change","focus","blur","clear","calendar-change","panel-change","visible-change","keydown"],setup(N,{expose:Q,emit:a}){const x=N,S=s.useAttrs(),{lang:A}=es(),h=Jr("date"),d=Jr("input"),u=Jr("range"),{form:l,formItem:c}=Ao(),f=s.inject("ElPopperOptions",{}),{valueOnClear:p}=V_(x,null),m=s.ref(),v=s.ref(),_=s.ref(!1),b=s.ref(!1),w=s.ref(null);let C=!1,k=!1;const T=s.computed(()=>[h.b("editor"),h.bm("editor",x.type),d.e("wrapper"),h.is("disabled",ne.value),h.is("active",_.value),u.b("editor"),fe?u.bm("editor",fe.value):"",S.class]),R=s.computed(()=>[d.e("icon"),u.e("close-icon"),me.value?"":u.e("close-icon--hidden")]);s.watch(_,Ne=>{Ne?s.nextTick(()=>{Ne&&(w.value=x.modelValue)}):(De.value=null,s.nextTick(()=>{U(x.modelValue)}))});const U=(Ne,tt)=>{(tt||!_1(Ne,w.value))&&(a("change",Ne),x.validateEvent&&(c==null||c.validate("change").catch(Pt=>Ki(Pt))))},G=Ne=>{if(!_1(x.modelValue,Ne)){let tt;bi(Ne)?tt=Ne.map(Pt=>x1(Pt,x.valueFormat,A.value)):Ne&&(tt=x1(Ne,x.valueFormat,A.value)),a("update:modelValue",Ne&&tt,A.value)}},j=Ne=>{a("keydown",Ne)},H=s.computed(()=>{if(v.value){const Ne=Ae.value?v.value:v.value.$el;return Array.from(Ne.querySelectorAll("input"))}return[]}),W=(Ne,tt,Pt)=>{const Rt=H.value;Rt.length&&(!Pt||Pt==="min"?(Rt[0].setSelectionRange(Ne,tt),Rt[0].focus()):Pt==="max"&&(Rt[1].setSelectionRange(Ne,tt),Rt[1].focus()))},K=()=>{D(!0,!0),s.nextTick(()=>{k=!1})},$=(Ne="",tt=!1)=>{tt||(k=!0),_.value=tt;let Pt;bi(Ne)?Pt=Ne.map(Rt=>Rt.toDate()):Pt=Ne&&Ne.toDate(),De.value=null,G(Pt)},O=()=>{b.value=!0},L=()=>{a("visible-change",!0)},M=Ne=>{(Ne==null?void 0:Ne.key)===Ii.esc&&D(!0,!0)},I=()=>{b.value=!1,_.value=!1,k=!1,a("visible-change",!1)},F=()=>{_.value=!0},V=()=>{_.value=!1},D=(Ne=!0,tt=!1)=>{k=tt;const[Pt,Rt]=s.unref(H);let Ht=Pt;!Ne&&Ae.value&&(Ht=Rt),Ht&&Ht.focus()},X=Ne=>{x.readonly||ne.value||_.value||k||(_.value=!0,a("focus",Ne))};let ee;const q=Ne=>{const tt=async()=>{setTimeout(()=>{var Pt;ee===tt&&(!((Pt=m.value)!=null&&Pt.isFocusInsideContent()&&!C)&&H.value.filter(Rt=>Rt.contains(document.activeElement)).length===0&&(Je(),_.value=!1,a("blur",Ne),x.validateEvent&&(c==null||c.validate("blur").catch(Rt=>Ki(Rt)))),C=!1)},0)};ee=tt,tt()},ne=s.computed(()=>x.disabled||(l==null?void 0:l.disabled)),oe=s.computed(()=>{let Ne;if(pe.value?ze.value.getDefaultValue&&(Ne=ze.value.getDefaultValue()):bi(x.modelValue)?Ne=x.modelValue.map(tt=>w1(tt,x.valueFormat,A.value)):Ne=w1(x.modelValue,x.valueFormat,A.value),ze.value.getRangeAvailableTime){const tt=ze.value.getRangeAvailableTime(Ne);vu(tt,Ne)||(Ne=tt,G(bi(Ne)?Ne.map(Pt=>Pt.toDate()):Ne.toDate()))}return bi(Ne)&&Ne.some(tt=>!tt)&&(Ne=[]),Ne}),he=s.computed(()=>{if(!ze.value.panelReady)return"";const Ne=ot(oe.value);return bi(De.value)?[De.value[0]||Ne&&Ne[0]||"",De.value[1]||Ne&&Ne[1]||""]:De.value!==null?De.value:!de.value&&pe.value||!_.value&&pe.value?"":Ne?se.value||re.value||ae.value?Ne.join(", "):Ne:""}),te=s.computed(()=>x.type.includes("time")),de=s.computed(()=>x.type.startsWith("time")),se=s.computed(()=>x.type==="dates"),re=s.computed(()=>x.type==="months"),ae=s.computed(()=>x.type==="years"),Ce=s.computed(()=>x.prefixIcon||(te.value?ui.Clock:ui.Calendar)),me=s.ref(!1),ce=Ne=>{x.readonly||ne.value||(me.value&&(Ne.stopPropagation(),K(),ze.value.handleClear?ze.value.handleClear():G(p.value),U(p.value,!0),me.value=!1,_.value=!1),a("clear"))},pe=s.computed(()=>{const{modelValue:Ne}=x;return!Ne||bi(Ne)&&!Ne.filter(Boolean).length}),B=async Ne=>{var tt;x.readonly||ne.value||(((tt=Ne.target)==null?void 0:tt.tagName)!=="INPUT"||H.value.includes(document.activeElement))&&(_.value=!0)},ke=()=>{x.readonly||ne.value||!pe.value&&x.clearable&&(me.value=!0)},Ee=()=>{me.value=!1},ge=Ne=>{var tt;x.readonly||ne.value||(((tt=Ne.touches[0].target)==null?void 0:tt.tagName)!=="INPUT"||H.value.includes(document.activeElement))&&(_.value=!0)},Ae=s.computed(()=>x.type.includes("range")),fe=mo(),ue=s.computed(()=>{var Ne,tt;return(tt=(Ne=s.unref(m))==null?void 0:Ne.popperRef)==null?void 0:tt.contentRef}),_e=s.computed(()=>{var Ne;return s.unref(Ae)?s.unref(v):(Ne=s.unref(v))==null?void 0:Ne.$el}),be=tb(_e,Ne=>{const tt=s.unref(ue),Pt=s.unref(_e);tt&&(Ne.target===tt||Ne.composedPath().includes(tt))||Ne.target===Pt||Ne.composedPath().includes(Pt)||(_.value=!1)});s.onBeforeUnmount(()=>{be==null||be()});const De=s.ref(null),Je=()=>{if(De.value){const Ne=Qe(he.value);Ne&&ct(Ne)&&(G(bi(Ne)?Ne.map(tt=>tt.toDate()):Ne.toDate()),De.value=null)}De.value===""&&(G(p.value),U(p.value),De.value=null)},Qe=Ne=>Ne?ze.value.parseUserInput(Ne):null,ot=Ne=>Ne?ze.value.formatToString(Ne):null,ct=Ne=>ze.value.isValidValue(Ne),ht=async Ne=>{if(x.readonly||ne.value)return;const{code:tt}=Ne;if(j(Ne),tt===Ii.esc){_.value===!0&&(_.value=!1,Ne.preventDefault(),Ne.stopPropagation());return}if(tt===Ii.down&&(ze.value.handleFocusPicker&&(Ne.preventDefault(),Ne.stopPropagation()),_.value===!1&&(_.value=!0,await s.nextTick()),ze.value.handleFocusPicker)){ze.value.handleFocusPicker();return}if(tt===Ii.tab){C=!0;return}if(tt===Ii.enter||tt===Ii.numpadEnter){(De.value===null||De.value===""||ct(Qe(he.value)))&&(Je(),_.value=!1),Ne.stopPropagation();return}if(De.value){Ne.stopPropagation();return}ze.value.handleKeydownInput&&ze.value.handleKeydownInput(Ne)},it=Ne=>{De.value=Ne,_.value||(_.value=!0)},Ze=Ne=>{const tt=Ne.target;De.value?De.value=[tt.value,De.value[1]]:De.value=[tt.value,null]},Xe=Ne=>{const tt=Ne.target;De.value?De.value=[De.value[0],tt.value]:De.value=[null,tt.value]},dt=()=>{var Ne;const tt=De.value,Pt=Qe(tt&&tt[0]),Rt=s.unref(oe);if(Pt&&Pt.isValid()){De.value=[ot(Pt),((Ne=he.value)==null?void 0:Ne[1])||null];const Ht=[Pt,Rt&&(Rt[1]||null)];ct(Ht)&&(G(Ht),De.value=null)}},at=()=>{var Ne;const tt=s.unref(De),Pt=Qe(tt&&tt[1]),Rt=s.unref(oe);if(Pt&&Pt.isValid()){De.value=[((Ne=s.unref(he))==null?void 0:Ne[0])||null,ot(Pt)];const Ht=[Rt&&Rt[0],Pt];ct(Ht)&&(G(Ht),De.value=null)}},ze=s.ref({}),Ke=Ne=>{ze.value[Ne[0]]=Ne[1],ze.value.panelReady=!0},ut=Ne=>{a("calendar-change",Ne)},yt=(Ne,tt,Pt)=>{a("panel-change",Ne,tt,Pt)};return s.provide("EP_PICKER_BASE",{props:x}),Q({focus:D,handleFocusInput:X,handleBlurInput:q,handleOpen:F,handleClose:V,onPick:$}),(Ne,tt)=>(s.openBlock(),s.createBlock(s.unref(ku),s.mergeProps({ref_key:"refPopper",ref:m,visible:_.value,effect:"light",pure:"",trigger:"click"},Ne.$attrs,{role:"dialog",teleported:"",transition:`${s.unref(h).namespace.value}-zoom-in-top`,"popper-class":[`${s.unref(h).namespace.value}-picker__popper`,Ne.popperClass],"popper-options":s.unref(f),"fallback-placements":["bottom","top","right","left"],"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"hide-after":0,persistent:"",onBeforeShow:O,onShow:L,onHide:I}),{default:s.withCtx(()=>[s.unref(Ae)?(s.openBlock(),s.createElementBlock("div",{key:1,ref_key:"inputRef",ref:v,class:s.normalizeClass(s.unref(T)),style:s.normalizeStyle(Ne.$attrs.style),onClick:X,onMouseenter:ke,onMouseleave:Ee,onTouchstartPassive:ge,onKeydown:ht},[s.unref(Ce)?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass([s.unref(d).e("icon"),s.unref(u).e("icon")]),onMousedown:s.withModifiers(B,["prevent"]),onTouchstartPassive:ge},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(Ce))))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0),s.createElementVNode("input",{id:Ne.id&&Ne.id[0],autocomplete:"off",name:Ne.name&&Ne.name[0],placeholder:Ne.startPlaceholder,value:s.unref(he)&&s.unref(he)[0],disabled:s.unref(ne),readonly:!Ne.editable||Ne.readonly,class:s.normalizeClass(s.unref(u).b("input")),onMousedown:B,onInput:Ze,onChange:dt,onFocus:X,onBlur:q},null,42,["id","name","placeholder","value","disabled","readonly"]),s.renderSlot(Ne.$slots,"range-separator",{},()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(u).b("separator"))},s.toDisplayString(Ne.rangeSeparator),3)]),s.createElementVNode("input",{id:Ne.id&&Ne.id[1],autocomplete:"off",name:Ne.name&&Ne.name[1],placeholder:Ne.endPlaceholder,value:s.unref(he)&&s.unref(he)[1],disabled:s.unref(ne),readonly:!Ne.editable||Ne.readonly,class:s.normalizeClass(s.unref(u).b("input")),onMousedown:B,onFocus:X,onBlur:q,onInput:Xe,onChange:at},null,42,["id","name","placeholder","value","disabled","readonly"]),Ne.clearIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:1,class:s.normalizeClass(s.unref(R)),onClick:ce},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(Ne.clearIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],38)):(s.openBlock(),s.createBlock(s.unref(Sn),{key:0,id:Ne.id,ref_key:"inputRef",ref:v,"container-role":"combobox","model-value":s.unref(he),name:Ne.name,size:s.unref(fe),disabled:s.unref(ne),placeholder:Ne.placeholder,class:s.normalizeClass([s.unref(h).b("editor"),s.unref(h).bm("editor",Ne.type),Ne.$attrs.class]),style:s.normalizeStyle(Ne.$attrs.style),readonly:!Ne.editable||Ne.readonly||s.unref(se)||s.unref(re)||s.unref(ae)||Ne.type==="week","aria-label":Ne.ariaLabel,tabindex:Ne.tabindex,"validate-event":!1,onInput:it,onFocus:X,onBlur:q,onKeydown:ht,onChange:Je,onMousedown:B,onMouseenter:ke,onMouseleave:Ee,onTouchstartPassive:ge,onClick:s.withModifiers(()=>{},["stop"])},{prefix:s.withCtx(()=>[s.unref(Ce)?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(d).e("icon")),onMousedown:s.withModifiers(B,["prevent"]),onTouchstartPassive:ge},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(Ce))))]),_:1},8,["class","onMousedown"])):s.createCommentVNode("v-if",!0)]),suffix:s.withCtx(()=>[me.value&&Ne.clearIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(`${s.unref(d).e("icon")} clear-icon`),onClick:s.withModifiers(ce,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(Ne.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)]),_:1},8,["id","model-value","name","size","disabled","placeholder","class","style","readonly","aria-label","tabindex","onKeydown","onClick"]))]),content:s.withCtx(()=>[s.renderSlot(Ne.$slots,"default",{visible:_.value,actualVisible:b.value,parsedValue:s.unref(oe),format:Ne.format,dateFormat:Ne.dateFormat,timeFormat:Ne.timeFormat,unlinkPanels:Ne.unlinkPanels,type:Ne.type,defaultValue:Ne.defaultValue,onPick:$,onSelectRange:W,onSetPickerOption:Ke,onCalendarChange:ut,onPanelChange:yt,onKeydown:M,onMousedown:s.withModifiers(()=>{},["stop"])})]),_:3},16,["visible","transition","popper-class","popper-options"]))}});var RR=si(FR,[["__file","picker.vue"]]);const OR=ei({...IR,datetimeRole:String,parsedValue:{type:Pr(Object)}}),NR=({getAvailableHours:N,getAvailableMinutes:Q,getAvailableSeconds:a})=>{const x=(h,d,u,l)=>{const c={hour:N,minute:Q,second:a};let f=h;return["hour","minute","second"].forEach(p=>{if(c[p]){let m;const v=c[p];switch(p){case"minute":{m=v(f.hour(),d,l);break}case"second":{m=v(f.hour(),f.minute(),d,l);break}default:{m=v(d,l);break}}if(m!=null&&m.length&&!m.includes(f[p]())){const _=u?0:m.length-1;f=f[p](m[_])}}}),f},S={};return{timePickerOptions:S,getAvailableTime:x,onSetOption:([h,d])=>{S[h]=d}}},Xm=N=>{const Q=(x,S)=>x||S,a=x=>x!==!0;return N.map(Q).filter(a)},B1=(N,Q,a)=>({getHoursList:(h,d)=>Km(24,N&&(()=>N==null?void 0:N(h,d))),getMinutesList:(h,d,u)=>Km(60,Q&&(()=>Q==null?void 0:Q(h,d,u))),getSecondsList:(h,d,u,l)=>Km(60,a&&(()=>a==null?void 0:a(h,d,u,l)))}),LR=(N,Q,a)=>{const{getHoursList:x,getMinutesList:S,getSecondsList:A}=B1(N,Q,a);return{getAvailableHours:(l,c)=>Xm(x(l,c)),getAvailableMinutes:(l,c,f)=>Xm(S(l,c,f)),getAvailableSeconds:(l,c,f,p)=>Xm(A(l,c,f,p))}},jR=N=>{const Q=s.ref(N.parsedValue);return s.watch(()=>N.visible,a=>{a||(Q.value=N.parsedValue)}),Q},La=new Map;if(Ln){let N;document.addEventListener("mousedown",Q=>N=Q),document.addEventListener("mouseup",Q=>{if(N){for(const a of La.values())for(const{documentHandler:x}of a)x(Q,N);N=void 0}})}function P1(N,Q){let a=[];return Array.isArray(Q.arg)?a=Q.arg:fl(Q.arg)&&a.push(Q.arg),function(x,S){const A=Q.instance.popperRef,h=x.target,d=S==null?void 0:S.target,u=!Q||!Q.instance,l=!h||!d,c=N.contains(h)||N.contains(d),f=N===h,p=a.length&&a.some(v=>v==null?void 0:v.contains(h))||a.length&&a.includes(d),m=A&&(A.contains(h)||A.contains(d));u||l||c||f||p||m||Q.value(x,S)}}const Eh={beforeMount(N,Q){La.has(N)||La.set(N,[]),La.get(N).push({documentHandler:P1(N,Q),bindingFn:Q.value})},updated(N,Q){La.has(N)||La.set(N,[]);const a=La.get(N),x=a.findIndex(A=>A.bindingFn===Q.oldValue),S={documentHandler:P1(N,Q),bindingFn:Q.value};x>=0?a.splice(x,1,S):a.push(S)},unmounted(N){La.delete(N)}},VR=100,UR=600,Bh={beforeMount(N,Q){const a=Q.value,{interval:x=VR,delay:S=UR}=mn(a)?{}:a;let A,h;const d=()=>mn(a)?a():a.handler(),u=()=>{h&&(clearTimeout(h),h=void 0),A&&(clearInterval(A),A=void 0)};N.addEventListener("mousedown",l=>{l.button===0&&(u(),d(),document.addEventListener("mouseup",()=>u(),{once:!0}),h=setTimeout(()=>{A=setInterval(()=>{d()},x)},S))})}},HR=ei({role:{type:String,required:!0},spinnerDate:{type:Pr(Object),required:!0},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:Pr(String),default:""},...C1});var zR=si(s.defineComponent({__name:"basic-time-spinner",props:HR,emits:["change","select-range","set-option"],setup(N,{emit:Q}){const a=N,x=Jr("time"),{getHoursList:S,getMinutesList:A,getSecondsList:h}=B1(a.disabledHours,a.disabledMinutes,a.disabledSeconds);let d=!1;const u=s.ref(),l=s.ref(),c=s.ref(),f=s.ref(),p={hours:l,minutes:c,seconds:f},m=s.computed(()=>a.showSeconds?m1:m1.slice(0,2)),v=s.computed(()=>{const{spinnerDate:D}=a,X=D.hour(),ee=D.minute(),q=D.second();return{hours:X,minutes:ee,seconds:q}}),_=s.computed(()=>{const{hours:D,minutes:X}=s.unref(v);return{hours:S(a.role),minutes:A(D,a.role),seconds:h(D,X,a.role)}}),b=s.computed(()=>{const{hours:D,minutes:X,seconds:ee}=s.unref(v);return{hours:$m(D,23),minutes:$m(X,59),seconds:$m(ee,59)}}),w=ah(D=>{d=!1,T(D)},200),C=D=>{if(!!!a.amPmMode)return"";const ee=a.amPmMode==="A";let q=D<12?" am":" pm";return ee&&(q=q.toUpperCase()),q},k=D=>{let X;switch(D){case"hours":X=[0,2];break;case"minutes":X=[3,5];break;case"seconds":X=[6,8];break}const[ee,q]=X;Q("select-range",ee,q),u.value=D},T=D=>{G(D,s.unref(v)[D])},R=()=>{T("hours"),T("minutes"),T("seconds")},U=D=>D.querySelector(`.${x.namespace.value}-scrollbar__wrap`),G=(D,X)=>{if(a.arrowControl)return;const ee=s.unref(p[D]);ee&&ee.$el&&(U(ee.$el).scrollTop=Math.max(0,X*j(D)))},j=D=>{const X=s.unref(p[D]),ee=X==null?void 0:X.$el.querySelector("li");return ee&&Number.parseFloat(Q4(ee,"height"))||0},H=()=>{K(1)},W=()=>{K(-1)},K=D=>{u.value||k("hours");const X=u.value,ee=s.unref(v)[X],q=u.value==="hours"?24:60,ne=$(X,ee,D,q);O(X,ne),G(X,ne),s.nextTick(()=>k(X))},$=(D,X,ee,q)=>{let ne=(X+ee+q)%q;const oe=s.unref(_)[D];for(;oe[ne]&&ne!==X;)ne=(ne+ee+q)%q;return ne},O=(D,X)=>{if(s.unref(_)[D][X])return;const{hours:ne,minutes:oe,seconds:he}=s.unref(v);let te;switch(D){case"hours":te=a.spinnerDate.hour(X).minute(oe).second(he);break;case"minutes":te=a.spinnerDate.hour(ne).minute(X).second(he);break;case"seconds":te=a.spinnerDate.hour(ne).minute(oe).second(X);break}Q("change",te)},L=(D,{value:X,disabled:ee})=>{ee||(O(D,X),k(D),G(D,X))},M=D=>{d=!0,w(D);const X=Math.min(Math.round((U(s.unref(p[D]).$el).scrollTop-(I(D)*.5-10)/j(D)+3)/j(D)),D==="hours"?23:59);O(D,X)},I=D=>s.unref(p[D]).$el.offsetHeight,F=()=>{const D=X=>{const ee=s.unref(p[X]);ee&&ee.$el&&(U(ee.$el).onscroll=()=>{M(X)})};D("hours"),D("minutes"),D("seconds")};s.onMounted(()=>{s.nextTick(()=>{!a.arrowControl&&F(),R(),a.role==="start"&&k("hours")})});const V=(D,X)=>{p[X].value=D};return Q("set-option",[`${a.role}_scrollDown`,K]),Q("set-option",[`${a.role}_emitSelectRange`,k]),s.watch(()=>a.spinnerDate,()=>{d||R()}),(D,X)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(x).b("spinner"),{"has-seconds":D.showSeconds}])},[D.arrowControl?s.createCommentVNode("v-if",!0):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(s.unref(m),ee=>(s.openBlock(),s.createBlock(s.unref(yn),{key:ee,ref_for:!0,ref:q=>V(q,ee),class:s.normalizeClass(s.unref(x).be("spinner","wrapper")),"wrap-style":"max-height: inherit;","view-class":s.unref(x).be("spinner","list"),noresize:"",tag:"ul",onMouseenter:q=>k(ee),onMousemove:q=>T(ee)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(_)[ee],(q,ne)=>(s.openBlock(),s.createElementBlock("li",{key:ne,class:s.normalizeClass([s.unref(x).be("spinner","item"),s.unref(x).is("active",ne===s.unref(v)[ee]),s.unref(x).is("disabled",q)]),onClick:oe=>L(ee,{value:ne,disabled:q})},[ee==="hours"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(("0"+(D.amPmMode?ne%12||12:ne)).slice(-2))+s.toDisplayString(C(ne)),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(("0"+ne).slice(-2)),1)],64))],10,["onClick"]))),128))]),_:2},1032,["class","view-class","onMouseenter","onMousemove"]))),128)),D.arrowControl?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(s.unref(m),ee=>(s.openBlock(),s.createElementBlock("div",{key:ee,class:s.normalizeClass([s.unref(x).be("spinner","wrapper"),s.unref(x).is("arrow")]),onMouseenter:q=>k(ee)},[s.withDirectives((s.openBlock(),s.createBlock(s.unref(ni),{class:s.normalizeClass(["arrow-up",s.unref(x).be("spinner","arrow")])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowUp))]),_:1},8,["class"])),[[s.unref(Bh),W]]),s.withDirectives((s.openBlock(),s.createBlock(s.unref(ni),{class:s.normalizeClass(["arrow-down",s.unref(x).be("spinner","arrow")])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowDown))]),_:1},8,["class"])),[[s.unref(Bh),H]]),s.createElementVNode("ul",{class:s.normalizeClass(s.unref(x).be("spinner","list"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(b)[ee],(q,ne)=>(s.openBlock(),s.createElementBlock("li",{key:ne,class:s.normalizeClass([s.unref(x).be("spinner","item"),s.unref(x).is("active",q===s.unref(v)[ee]),s.unref(x).is("disabled",s.unref(_)[ee][q])])},[typeof q=="number"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[ee==="hours"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(("0"+(D.amPmMode?q%12||12:q)).slice(-2))+s.toDisplayString(C(q)),1)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(("0"+q).slice(-2)),1)],64))],64)):s.createCommentVNode("v-if",!0)],2))),128))],2)],42,["onMouseenter"]))),128)):s.createCommentVNode("v-if",!0)],2))}}),[["__file","basic-time-spinner.vue"]]),Ym=si(s.defineComponent({__name:"panel-time-pick",props:OR,emits:["pick","select-range","set-picker-option"],setup(N,{emit:Q}){const a=N,x=s.inject("EP_PICKER_BASE"),{arrowControl:S,disabledHours:A,disabledMinutes:h,disabledSeconds:d,defaultValue:u}=x.props,{getAvailableHours:l,getAvailableMinutes:c,getAvailableSeconds:f}=LR(A,h,d),p=Jr("time"),{t:m,lang:v}=es(),_=s.ref([0,2]),b=jR(a),w=s.computed(()=>Ts(a.actualVisible)?`${p.namespace.value}-zoom-in-top`:""),C=s.computed(()=>a.format.includes("ss")),k=s.computed(()=>a.format.includes("A")?"A":a.format.includes("a")?"a":""),T=V=>{const D=Ir(V).locale(v.value),X=L(D);return D.isSame(X)},R=()=>{Q("pick",b.value,!1)},U=(V=!1,D=!1)=>{D||Q("pick",a.parsedValue,V)},G=V=>{if(!a.visible)return;const D=L(V).millisecond(0);Q("pick",D,!0)},j=(V,D)=>{Q("select-range",V,D),_.value=[V,D]},H=V=>{const D=[0,3].concat(C.value?[6]:[]),X=["hours","minutes"].concat(C.value?["seconds"]:[]),q=(D.indexOf(_.value[0])+V+D.length)%D.length;K.start_emitSelectRange(X[q])},W=V=>{const D=V.code,{left:X,right:ee,up:q,down:ne}=Ii;if([X,ee].includes(D)){H(D===X?-1:1),V.preventDefault();return}if([q,ne].includes(D)){const oe=D===q?-1:1;K.start_scrollDown(oe),V.preventDefault();return}},{timePickerOptions:K,onSetOption:$,getAvailableTime:O}=NR({getAvailableHours:l,getAvailableMinutes:c,getAvailableSeconds:f}),L=V=>O(V,a.datetimeRole||"",!0),M=V=>V?Ir(V,a.format).locale(v.value):null,I=V=>V?V.format(a.format):null,F=()=>Ir(u).locale(v.value);return Q("set-picker-option",["isValidValue",T]),Q("set-picker-option",["formatToString",I]),Q("set-picker-option",["parseUserInput",M]),Q("set-picker-option",["handleKeydownInput",W]),Q("set-picker-option",["getRangeAvailableTime",L]),Q("set-picker-option",["getDefaultValue",F]),(V,D)=>(s.openBlock(),s.createBlock(s.Transition,{name:s.unref(w)},{default:s.withCtx(()=>[V.actualVisible||V.visible?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(p).b("panel"))},[s.createElementVNode("div",{class:s.normalizeClass([s.unref(p).be("panel","content"),{"has-seconds":s.unref(C)}])},[s.createVNode(zR,{ref:"spinner",role:V.datetimeRole||"start","arrow-control":s.unref(S),"show-seconds":s.unref(C),"am-pm-mode":s.unref(k),"spinner-date":V.parsedValue,"disabled-hours":s.unref(A),"disabled-minutes":s.unref(h),"disabled-seconds":s.unref(d),onChange:G,onSetOption:s.unref($),onSelectRange:j},null,8,["role","arrow-control","show-seconds","am-pm-mode","spinner-date","disabled-hours","disabled-minutes","disabled-seconds","onSetOption"])],2),s.createElementVNode("div",{class:s.normalizeClass(s.unref(p).be("panel","footer"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(p).be("panel","btn"),"cancel"]),onClick:R},s.toDisplayString(s.unref(m)("el.datepicker.cancel")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(p).be("panel","btn"),"confirm"]),onClick:X=>U()},s.toDisplayString(s.unref(m)("el.datepicker.confirm")),11,["onClick"])],2)],2)):s.createCommentVNode("v-if",!0)]),_:1},8,["name"]))}}),[["__file","panel-time-pick.vue"]]),S1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x,S){var A=x.prototype,h=function(f){return f&&(f.indexOf?f:f.s)},d=function(f,p,m,v,_){var b=f.name?f:f.$locale(),w=h(b[p]),C=h(b[m]),k=w||C.map(function(R){return R.slice(0,v)});if(!_)return k;var T=b.weekStart;return k.map(function(R,U){return k[(U+(T||0))%7]})},u=function(){return S.Ls[S.locale()]},l=function(f,p){return f.formats[p]||function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(v,_,b){return _||b.slice(1)})}(f.formats[p.toUpperCase()])},c=function(){var f=this;return{months:function(p){return p?p.format("MMMM"):d(f,"months")},monthsShort:function(p){return p?p.format("MMM"):d(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(p){return p?p.format("dddd"):d(f,"weekdays")},weekdaysMin:function(p){return p?p.format("dd"):d(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(p){return p?p.format("ddd"):d(f,"weekdaysShort","weekdays",3)},longDateFormat:function(p){return l(f.$locale(),p)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};A.localeData=function(){return c.bind(this)()},S.localeData=function(){var f=u();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return S.weekdays()},weekdaysShort:function(){return S.weekdaysShort()},weekdaysMin:function(){return S.weekdaysMin()},months:function(){return S.months()},monthsShort:function(){return S.monthsShort()},longDateFormat:function(p){return l(f,p)},meridiem:f.meridiem,ordinal:f.ordinal}},S.months=function(){return d(u(),"months")},S.monthsShort=function(){return d(u(),"monthsShort","months",3)},S.weekdays=function(f){return d(u(),"weekdays",null,null,f)},S.weekdaysShort=function(f){return d(u(),"weekdaysShort","weekdays",3,f)},S.weekdaysMin=function(f){return d(u(),"weekdaysMin","weekdays",2,f)}}})})(S1);var GR=S1.exports;const QR=aa(GR),k1={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:po,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Ys(["ariaControls"])},M1={[Wi]:N=>Dn(N)||Ri(N)||uo(N),change:N=>Dn(N)||Ri(N)||uo(N)},dc=Symbol("checkboxGroupContextKey"),WR=({model:N,isChecked:Q})=>{const a=s.inject(dc,void 0),x=s.computed(()=>{var A,h;const d=(A=a==null?void 0:a.max)==null?void 0:A.value,u=(h=a==null?void 0:a.min)==null?void 0:h.value;return!Ts(d)&&N.value.length>=d&&!Q.value||!Ts(u)&&N.value.length<=u&&Q.value});return{isDisabled:gl(s.computed(()=>(a==null?void 0:a.disabled.value)||x.value)),isLimitDisabled:x}},$R=(N,{model:Q,isLimitExceeded:a,hasOwnLabel:x,isDisabled:S,isLabeledByFormItem:A})=>{const h=s.inject(dc,void 0),{formItem:d}=Ao(),{emit:u}=s.getCurrentInstance();function l(v){var _,b,w,C;return[!0,N.trueValue,N.trueLabel].includes(v)?(b=(_=N.trueValue)!=null?_:N.trueLabel)!=null?b:!0:(C=(w=N.falseValue)!=null?w:N.falseLabel)!=null?C:!1}function c(v,_){u("change",l(v),_)}function f(v){if(a.value)return;const _=v.target;u("change",l(_.checked),v)}async function p(v){a.value||!x.value&&!S.value&&A.value&&(v.composedPath().some(w=>w.tagName==="LABEL")||(Q.value=l([!1,N.falseValue,N.falseLabel].includes(Q.value)),await s.nextTick(),c(Q.value,v)))}const m=s.computed(()=>(h==null?void 0:h.validateEvent)||N.validateEvent);return s.watch(()=>N.modelValue,()=>{m.value&&(d==null||d.validate("change").catch(v=>Ki(v)))}),{handleChange:f,onClickRoot:p}},KR=N=>{const Q=s.ref(!1),{emit:a}=s.getCurrentInstance(),x=s.inject(dc,void 0),S=s.computed(()=>Ts(x)===!1),A=s.ref(!1),h=s.computed({get(){var d,u;return S.value?(d=x==null?void 0:x.modelValue)==null?void 0:d.value:(u=N.modelValue)!=null?u:Q.value},set(d){var u,l;S.value&&bi(d)?(A.value=((u=x==null?void 0:x.max)==null?void 0:u.value)!==void 0&&d.length>(x==null?void 0:x.max.value)&&d.length>h.value.length,A.value===!1&&((l=x==null?void 0:x.changeEvent)==null||l.call(x,d))):(a(Wi,d),Q.value=d)}});return{model:h,isGroup:S,isLimitExceeded:A}},XR=(N,Q,{model:a})=>{const x=s.inject(dc,void 0),S=s.ref(!1),A=s.computed(()=>ec(N.value)?N.label:N.value),h=s.computed(()=>{const c=a.value;return uo(c)?c:bi(c)?qn(A.value)?c.map(s.toRaw).some(f=>vu(f,A.value)):c.map(s.toRaw).includes(A.value):c!=null?c===N.trueValue||c===N.trueLabel:!!c}),d=mo(s.computed(()=>{var c;return(c=x==null?void 0:x.size)==null?void 0:c.value}),{prop:!0}),u=mo(s.computed(()=>{var c;return(c=x==null?void 0:x.size)==null?void 0:c.value})),l=s.computed(()=>!!Q.default||!ec(A.value));return{checkboxButtonSize:d,isChecked:h,isFocused:S,checkboxSize:u,hasOwnLabel:l,actualValue:A}},T1=(N,Q)=>{const{formItem:a}=Ao(),{model:x,isGroup:S,isLimitExceeded:A}=KR(N),{isFocused:h,isChecked:d,checkboxButtonSize:u,checkboxSize:l,hasOwnLabel:c,actualValue:f}=XR(N,Q,{model:x}),{isDisabled:p}=WR({model:x,isChecked:d}),{inputId:m,isLabeledByFormItem:v}=vl(N,{formItemContext:a,disableIdGeneration:c,disableIdManagement:S}),{handleChange:_,onClickRoot:b}=$R(N,{model:x,isLimitExceeded:A,hasOwnLabel:c,isDisabled:p,isLabeledByFormItem:v});return(()=>{function C(){var k,T;bi(x.value)&&!x.value.includes(f.value)?x.value.push(f.value):x.value=(T=(k=N.trueValue)!=null?k:N.trueLabel)!=null?T:!0}N.checked&&C()})(),yu({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>S.value&&ec(N.value))),yu({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!N.trueLabel)),yu({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},s.computed(()=>!!N.falseLabel)),{inputId:m,isLabeledByFormItem:v,isChecked:d,isDisabled:p,isFocused:h,checkboxButtonSize:u,checkboxSize:l,hasOwnLabel:c,model:x,actualValue:f,handleChange:_,onClickRoot:b}},YR=s.defineComponent({name:"ElCheckbox"}),JR=s.defineComponent({...YR,props:k1,emits:M1,setup(N){const Q=N,a=s.useSlots(),{inputId:x,isLabeledByFormItem:S,isChecked:A,isDisabled:h,isFocused:d,checkboxSize:u,hasOwnLabel:l,model:c,actualValue:f,handleChange:p,onClickRoot:m}=T1(Q,a),v=Jr("checkbox"),_=s.computed(()=>[v.b(),v.m(u.value),v.is("disabled",h.value),v.is("bordered",Q.border),v.is("checked",A.value)]),b=s.computed(()=>[v.e("input"),v.is("disabled",h.value),v.is("checked",A.value),v.is("indeterminate",Q.indeterminate),v.is("focus",d.value)]);return(w,C)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(!s.unref(l)&&s.unref(S)?"span":"label"),{class:s.normalizeClass(s.unref(_)),"aria-controls":w.indeterminate?w.ariaControls:null,onClick:s.unref(m)},{default:s.withCtx(()=>{var k,T;return[s.createElementVNode("span",{class:s.normalizeClass(s.unref(b))},[w.trueValue||w.falseValue||w.trueLabel||w.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,id:s.unref(x),"onUpdate:modelValue":R=>s.isRef(c)?c.value=R:null,class:s.normalizeClass(s.unref(v).e("original")),type:"checkbox",indeterminate:w.indeterminate,name:w.name,tabindex:w.tabindex,disabled:s.unref(h),"true-value":(k=w.trueValue)!=null?k:w.trueLabel,"false-value":(T=w.falseValue)!=null?T:w.falseLabel,onChange:s.unref(p),onFocus:R=>d.value=!0,onBlur:R=>d.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(c)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,id:s.unref(x),"onUpdate:modelValue":R=>s.isRef(c)?c.value=R:null,class:s.normalizeClass(s.unref(v).e("original")),type:"checkbox",indeterminate:w.indeterminate,disabled:s.unref(h),value:s.unref(f),name:w.name,tabindex:w.tabindex,onChange:s.unref(p),onFocus:R=>d.value=!0,onBlur:R=>d.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(c)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(v).e("inner"))},null,2)],2),s.unref(l)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(v).e("label"))},[s.renderSlot(w.$slots,"default"),w.$slots.default?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(w.label),1)],64))],2)):s.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var ZR=si(JR,[["__file","checkbox.vue"]]);const qR=s.defineComponent({name:"ElCheckboxButton"}),eO=s.defineComponent({...qR,props:k1,emits:M1,setup(N){const Q=N,a=s.useSlots(),{isFocused:x,isChecked:S,isDisabled:A,checkboxButtonSize:h,model:d,actualValue:u,handleChange:l}=T1(Q,a),c=s.inject(dc,void 0),f=Jr("checkbox"),p=s.computed(()=>{var v,_,b,w;const C=(_=(v=c==null?void 0:c.fill)==null?void 0:v.value)!=null?_:"";return{backgroundColor:C,borderColor:C,color:(w=(b=c==null?void 0:c.textColor)==null?void 0:b.value)!=null?w:"",boxShadow:C?`-1px 0 0 0 ${C}`:void 0}}),m=s.computed(()=>[f.b("button"),f.bm("button",h.value),f.is("disabled",A.value),f.is("checked",S.value),f.is("focus",x.value)]);return(v,_)=>{var b,w;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass(s.unref(m))},[v.trueValue||v.falseValue||v.trueLabel||v.falseLabel?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>s.isRef(d)?d.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:s.unref(A),"true-value":(b=v.trueValue)!=null?b:v.trueLabel,"false-value":(w=v.falseValue)!=null?w:v.falseLabel,onChange:s.unref(l),onFocus:C=>x.value=!0,onBlur:C=>x.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]):s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>s.isRef(d)?d.value=C:null,class:s.normalizeClass(s.unref(f).be("button","original")),type:"checkbox",name:v.name,tabindex:v.tabindex,disabled:s.unref(A),value:s.unref(u),onChange:s.unref(l),onFocus:C=>x.value=!0,onBlur:C=>x.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[s.vModelCheckbox,s.unref(d)]]),v.$slots.default||v.label?(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(s.unref(f).be("button","inner")),style:s.normalizeStyle(s.unref(S)?s.unref(p):void 0)},[s.renderSlot(v.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(v.label),1)])],6)):s.createCommentVNode("v-if",!0)],2)}}});var I1=si(eO,[["__file","checkbox-button.vue"]]);const tO=ei({modelValue:{type:Pr(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:po,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),rO={[Wi]:N=>bi(N),change:N=>bi(N)},iO=s.defineComponent({name:"ElCheckboxGroup"}),nO=s.defineComponent({...iO,props:tO,emits:rO,setup(N,{emit:Q}){const a=N,x=Jr("checkbox"),{formItem:S}=Ao(),{inputId:A,isLabeledByFormItem:h}=vl(a,{formItemContext:S}),d=async l=>{Q(Wi,l),await s.nextTick(),Q("change",l)},u=s.computed({get(){return a.modelValue},set(l){d(l)}});return s.provide(dc,{...e_(s.toRefs(a),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:d}),s.watch(()=>a.modelValue,()=>{a.validateEvent&&(S==null||S.validate("change").catch(l=>Ki(l)))}),(l,c)=>{var f;return s.openBlock(),s.createBlock(s.resolveDynamicComponent(l.tag),{id:s.unref(A),class:s.normalizeClass(s.unref(x).b("group")),role:"group","aria-label":s.unref(h)?void 0:l.ariaLabel||"checkbox-group","aria-labelledby":s.unref(h)?(f=s.unref(S))==null?void 0:f.labelId:void 0},{default:s.withCtx(()=>[s.renderSlot(l.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var D1=si(nO,[["__file","checkbox-group.vue"]]);const Jm=Gn(ZR,{CheckboxButton:I1,CheckboxGroup:D1});pl(I1);const F1=pl(D1),R1=ei({modelValue:{type:[String,Number,Boolean],default:void 0},size:po,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),sO=ei({...R1,border:Boolean}),O1={[Wi]:N=>Dn(N)||Ri(N)||uo(N),[Mo]:N=>Dn(N)||Ri(N)||uo(N)},N1=Symbol("radioGroupKey"),L1=(N,Q)=>{const a=s.ref(),x=s.inject(N1,void 0),S=s.computed(()=>!!x),A=s.computed(()=>ec(N.value)?N.label:N.value),h=s.computed({get(){return S.value?x.modelValue:N.modelValue},set(f){S.value?x.changeEvent(f):Q&&Q(Wi,f),a.value.checked=N.modelValue===A.value}}),d=mo(s.computed(()=>x==null?void 0:x.size)),u=gl(s.computed(()=>x==null?void 0:x.disabled)),l=s.ref(!1),c=s.computed(()=>u.value||S.value&&h.value!==A.value?-1:0);return yu({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},s.computed(()=>S.value&&ec(N.value))),{radioRef:a,isGroup:S,radioGroup:x,focus:l,size:d,disabled:u,tabIndex:c,modelValue:h,actualValue:A}},oO=s.defineComponent({name:"ElRadio"}),aO=s.defineComponent({...oO,props:sO,emits:O1,setup(N,{emit:Q}){const a=N,x=Jr("radio"),{radioRef:S,radioGroup:A,focus:h,size:d,disabled:u,modelValue:l,actualValue:c}=L1(a,Q);function f(){s.nextTick(()=>Q("change",l.value))}return(p,m)=>{var v;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass([s.unref(x).b(),s.unref(x).is("disabled",s.unref(u)),s.unref(x).is("focus",s.unref(h)),s.unref(x).is("bordered",p.border),s.unref(x).is("checked",s.unref(l)===s.unref(c)),s.unref(x).m(s.unref(d))])},[s.createElementVNode("span",{class:s.normalizeClass([s.unref(x).e("input"),s.unref(x).is("disabled",s.unref(u)),s.unref(x).is("checked",s.unref(l)===s.unref(c))])},[s.withDirectives(s.createElementVNode("input",{ref_key:"radioRef",ref:S,"onUpdate:modelValue":_=>s.isRef(l)?l.value=_:null,class:s.normalizeClass(s.unref(x).e("original")),value:s.unref(c),name:p.name||((v=s.unref(A))==null?void 0:v.name),disabled:s.unref(u),checked:s.unref(l)===s.unref(c),type:"radio",onFocus:_=>h.value=!0,onBlur:_=>h.value=!1,onChange:f,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[s.vModelRadio,s.unref(l)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(x).e("inner"))},null,2)],2),s.createElementVNode("span",{class:s.normalizeClass(s.unref(x).e("label")),onKeydown:s.withModifiers(()=>{},["stop"])},[s.renderSlot(p.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var lO=si(aO,[["__file","radio.vue"]]);const cO=ei({...R1}),uO=s.defineComponent({name:"ElRadioButton"}),dO=s.defineComponent({...uO,props:cO,setup(N){const Q=N,a=Jr("radio"),{radioRef:x,focus:S,size:A,disabled:h,modelValue:d,radioGroup:u,actualValue:l}=L1(Q),c=s.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(f,p)=>{var m;return s.openBlock(),s.createElementBlock("label",{class:s.normalizeClass([s.unref(a).b("button"),s.unref(a).is("active",s.unref(d)===s.unref(l)),s.unref(a).is("disabled",s.unref(h)),s.unref(a).is("focus",s.unref(S)),s.unref(a).bm("button",s.unref(A))])},[s.withDirectives(s.createElementVNode("input",{ref_key:"radioRef",ref:x,"onUpdate:modelValue":v=>s.isRef(d)?d.value=v:null,class:s.normalizeClass(s.unref(a).be("button","original-radio")),value:s.unref(l),type:"radio",name:f.name||((m=s.unref(u))==null?void 0:m.name),disabled:s.unref(h),onFocus:v=>S.value=!0,onBlur:v=>S.value=!1,onClick:s.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[s.vModelRadio,s.unref(d)]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(a).be("button","inner")),style:s.normalizeStyle(s.unref(d)===s.unref(l)?s.unref(c):{}),onKeydown:s.withModifiers(()=>{},["stop"])},[s.renderSlot(f.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(f.label),1)])],46,["onKeydown"])],2)}}});var j1=si(dO,[["__file","radio-button.vue"]]);const hO=ei({id:{type:String,default:void 0},size:po,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),fO=O1,pO=s.defineComponent({name:"ElRadioGroup"}),mO=s.defineComponent({...pO,props:hO,emits:fO,setup(N,{emit:Q}){const a=N,x=Jr("radio"),S=Pu(),A=s.ref(),{formItem:h}=Ao(),{inputId:d,isLabeledByFormItem:u}=vl(a,{formItemContext:h}),l=f=>{Q(Wi,f),s.nextTick(()=>Q("change",f))};s.onMounted(()=>{const f=A.value.querySelectorAll("[type=radio]"),p=f[0];!Array.from(f).some(m=>m.checked)&&p&&(p.tabIndex=0)});const c=s.computed(()=>a.name||S.value);return s.provide(N1,s.reactive({...s.toRefs(a),changeEvent:l,name:c})),s.watch(()=>a.modelValue,()=>{a.validateEvent&&(h==null||h.validate("change").catch(f=>Ki(f)))}),(f,p)=>(s.openBlock(),s.createElementBlock("div",{id:s.unref(d),ref_key:"radioGroupRef",ref:A,class:s.normalizeClass(s.unref(x).b("group")),role:"radiogroup","aria-label":s.unref(u)?void 0:f.ariaLabel||"radio-group","aria-labelledby":s.unref(u)?s.unref(h).labelId:void 0},[s.renderSlot(f.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var V1=si(mO,[["__file","radio-group.vue"]]);const AO=Gn(lO,{RadioButton:j1,RadioGroup:V1}),gO=pl(V1);pl(j1);const Zm=ei({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:ym},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),vO={close:N=>N instanceof MouseEvent,click:N=>N instanceof MouseEvent},yO=s.defineComponent({name:"ElTag"}),bO=s.defineComponent({...yO,props:Zm,emits:vO,setup(N,{emit:Q}){const a=N,x=mo(),S=Jr("tag"),A=s.computed(()=>{const{type:u,hit:l,effect:c,closable:f,round:p}=a;return[S.b(),S.is("closable",f),S.m(u||"primary"),S.m(x.value),S.m(c),S.is("hit",l),S.is("round",p)]}),h=u=>{Q("close",u)},d=u=>{Q("click",u)};return(u,l)=>u.disableTransitions?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(A)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:d},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(S).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(S).e("close")),onClick:s.withModifiers(h,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)):(s.openBlock(),s.createBlock(s.Transition,{key:1,name:`${s.unref(S).namespace.value}-zoom-in-center`,appear:""},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(s.unref(A)),style:s.normalizeStyle({backgroundColor:u.color}),onClick:d},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(S).e("content"))},[s.renderSlot(u.$slots,"default")],2),u.closable?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(S).e("close")),onClick:s.withModifiers(h,["stop"])},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.Close))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var _O=si(bO,[["__file","tag.vue"]]);const wO=Gn(_O),xO=s.defineComponent({name:"ElCollapseTransition"}),CO=s.defineComponent({...xO,setup(N){const Q=Jr("collapse-transition"),a=S=>{S.style.maxHeight="",S.style.overflow=S.dataset.oldOverflow,S.style.paddingTop=S.dataset.oldPaddingTop,S.style.paddingBottom=S.dataset.oldPaddingBottom},x={beforeEnter(S){S.dataset||(S.dataset={}),S.dataset.oldPaddingTop=S.style.paddingTop,S.dataset.oldPaddingBottom=S.style.paddingBottom,S.style.height&&(S.dataset.elExistsHeight=S.style.height),S.style.maxHeight=0,S.style.paddingTop=0,S.style.paddingBottom=0},enter(S){requestAnimationFrame(()=>{S.dataset.oldOverflow=S.style.overflow,S.dataset.elExistsHeight?S.style.maxHeight=S.dataset.elExistsHeight:S.scrollHeight!==0?S.style.maxHeight=`${S.scrollHeight}px`:S.style.maxHeight=0,S.style.paddingTop=S.dataset.oldPaddingTop,S.style.paddingBottom=S.dataset.oldPaddingBottom,S.style.overflow="hidden"})},afterEnter(S){S.style.maxHeight="",S.style.overflow=S.dataset.oldOverflow},enterCancelled(S){a(S)},beforeLeave(S){S.dataset||(S.dataset={}),S.dataset.oldPaddingTop=S.style.paddingTop,S.dataset.oldPaddingBottom=S.style.paddingBottom,S.dataset.oldOverflow=S.style.overflow,S.style.maxHeight=`${S.scrollHeight}px`,S.style.overflow="hidden"},leave(S){S.scrollHeight!==0&&(S.style.maxHeight=0,S.style.paddingTop=0,S.style.paddingBottom=0)},afterLeave(S){a(S)},leaveCancelled(S){a(S)}};return(S,A)=>(s.openBlock(),s.createBlock(s.Transition,s.mergeProps({name:s.unref(Q).b()},s.toHandlers(x)),{default:s.withCtx(()=>[s.renderSlot(S.$slots,"default")]),_:3},16,["name"]))}});var EO=si(CO,[["__file","collapse-transition.vue"]]);const BO=Gn(EO);var U1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){var S=x.prototype,A=S.format;S.format=function(h){var d=this,u=this.$locale();if(!this.isValid())return A.bind(this)(h);var l=this.$utils(),c=(h||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(f){switch(f){case"Q":return Math.ceil((d.$M+1)/3);case"Do":return u.ordinal(d.$D);case"gggg":return d.weekYear();case"GGGG":return d.isoWeekYear();case"wo":return u.ordinal(d.week(),"W");case"w":case"ww":return l.s(d.week(),f==="w"?1:2,"0");case"W":case"WW":return l.s(d.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return l.s(String(d.$H===0?24:d.$H),f==="k"?1:2,"0");case"X":return Math.floor(d.$d.getTime()/1e3);case"x":return d.$d.getTime();case"z":return"["+d.offsetName()+"]";case"zzz":return"["+d.offsetName("long")+"]";default:return f}});return A.bind(this)(c)}}})})(U1);var PO=U1.exports;const SO=aa(PO);var H1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){var a="week",x="year";return function(S,A,h){var d=A.prototype;d.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var l=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var c=h(this).startOf(x).add(1,x).date(l),f=h(this).endOf(a);if(c.isBefore(f))return 1}var p=h(this).startOf(x).date(l).startOf(a).subtract(1,"millisecond"),m=this.diff(p,a,!0);return m<0?h(this).startOf("week").week():Math.ceil(m)},d.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}})})(H1);var kO=H1.exports;const MO=aa(kO);var z1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){x.prototype.weekYear=function(){var S=this.month(),A=this.week(),h=this.year();return A===1&&S===11?h+1:S===0&&A>=52?h-1:h}}})})(z1);var TO=z1.exports;const IO=aa(TO);var G1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x,S){x.prototype.dayOfYear=function(A){var h=Math.round((S(this).startOf("day")-S(this).startOf("year"))/864e5)+1;return A==null?h:this.add(A-h,"day")}}})})(G1);var DO=G1.exports;const FO=aa(DO);var Q1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){x.prototype.isSameOrAfter=function(S,A){return this.isSame(S,A)||this.isAfter(S,A)}}})})(Q1);var RO=Q1.exports;const OO=aa(RO);var W1={exports:{}};(function(N,Q){(function(a,x){N.exports=x()})(Zr,function(){return function(a,x){x.prototype.isSameOrBefore=function(S,A){return this.isSame(S,A)||this.isBefore(S,A)}}})})(W1);var NO=W1.exports;const LO=aa(NO),Ph=Symbol(),jO=ei({...E1,type:{type:Pr(String),default:"date"}}),VO=["date","dates","year","years","month","months","week","range"],qm=ei({disabledDate:{type:Pr(Function)},date:{type:Pr(Object),required:!0},minDate:{type:Pr(Object)},maxDate:{type:Pr(Object)},parsedValue:{type:Pr([Object,Array])},rangeState:{type:Pr(Object),default:()=>({endDate:null,selecting:!1})}}),$1=ei({type:{type:Pr(String),required:!0,values:K4},dateFormat:String,timeFormat:String}),eA=ei({unlinkPanels:Boolean,parsedValue:{type:Pr(Array)}}),tA=N=>({type:String,values:VO,default:N}),UO=ei({...$1,parsedValue:{type:Pr([Object,Array])},visible:{type:Boolean},format:{type:String,default:""}}),HO=ei({...qm,cellClassName:{type:Pr(Function)},showWeekNumber:Boolean,selectionMode:tA("date")}),zO=["changerange","pick","select"],hc=N=>{if(!bi(N))return!1;const[Q,a]=N;return Ir.isDayjs(Q)&&Ir.isDayjs(a)&&Q.isSameOrBefore(a)},rA=(N,{lang:Q,unit:a,unlinkPanels:x})=>{let S;if(bi(N)){let[A,h]=N.map(d=>Ir(d).locale(Q));return x||(h=A.add(1,a)),[A,h]}else N?S=Ir(N):S=Ir();return S=S.locale(Q),[S,S.add(1,a)]},GO=(N,Q,{columnIndexOffset:a,startDate:x,nextEndDate:S,now:A,unit:h,relativeDateGetter:d,setCellMetadata:u,setRowMetadata:l})=>{for(let c=0;c<N.row;c++){const f=Q[c];for(let p=0;p<N.column;p++){let m=f[p+a];m||(m={row:c,column:p,type:"normal",inRange:!1,start:!1,end:!1});const v=c*N.column+p,_=d(v);m.dayjs=_,m.date=_.toDate(),m.timestamp=_.valueOf(),m.type="normal",m.inRange=!!(x&&_.isSameOrAfter(x,h)&&S&&_.isSameOrBefore(S,h))||!!(x&&_.isSameOrBefore(x,h)&&S&&_.isSameOrAfter(S,h)),x!=null&&x.isSameOrAfter(S)?(m.start=!!S&&_.isSame(S,h),m.end=x&&_.isSame(x,h)):(m.start=!!x&&_.isSame(x,h),m.end=!!S&&_.isSame(S,h)),_.isSame(A,h)&&(m.type="today"),u==null||u(m,{rowIndex:c,columnIndex:p}),f[p+a]=m}l==null||l(f)}},iA=(N="")=>["normal","today"].includes(N),QO=(N,Q)=>{const{lang:a}=es(),x=s.ref(),S=s.ref(),A=s.ref(),h=s.ref(),d=s.ref([[],[],[],[],[],[]]);let u=!1;const l=N.date.$locale().weekStart||7,c=N.date.locale("en").localeData().weekdaysShort().map(D=>D.toLowerCase()),f=s.computed(()=>l>3?7-l:-l),p=s.computed(()=>{const D=N.date.startOf("month");return D.subtract(D.day()||7,"day")}),m=s.computed(()=>c.concat(c).slice(l,l+7)),v=s.computed(()=>Nb(s.unref(T)).some(D=>D.isCurrent)),_=s.computed(()=>{const D=N.date.startOf("month"),X=D.day()||7,ee=D.daysInMonth(),q=D.subtract(1,"month").daysInMonth();return{startOfMonthDay:X,dateCountOfMonth:ee,dateCountOfLastMonth:q}}),b=s.computed(()=>N.selectionMode==="dates"?Is(N.parsedValue):[]),w=(D,{count:X,rowIndex:ee,columnIndex:q})=>{const{startOfMonthDay:ne,dateCountOfMonth:oe,dateCountOfLastMonth:he}=s.unref(_),te=s.unref(f);if(ee>=0&&ee<=1){const de=ne+te<0?7+ne+te:ne+te;if(q+ee*7>=de)return D.text=X,!0;D.text=he-(de-q%7)+1+ee*7,D.type="prev-month"}else return X<=oe?D.text=X:(D.text=X-oe,D.type="next-month"),!0;return!1},C=(D,{columnIndex:X,rowIndex:ee},q)=>{const{disabledDate:ne,cellClassName:oe}=N,he=s.unref(b),te=w(D,{count:q,rowIndex:ee,columnIndex:X}),de=D.dayjs.toDate();return D.selected=he.find(se=>se.isSame(D.dayjs,"day")),D.isSelected=!!D.selected,D.isCurrent=U(D),D.disabled=ne==null?void 0:ne(de),D.customClass=oe==null?void 0:oe(de),te},k=D=>{if(N.selectionMode==="week"){const[X,ee]=N.showWeekNumber?[1,7]:[0,6],q=V(D[X+1]);D[X].inRange=q,D[X].start=q,D[ee].inRange=q,D[ee].end=q}},T=s.computed(()=>{const{minDate:D,maxDate:X,rangeState:ee,showWeekNumber:q}=N,ne=s.unref(f),oe=s.unref(d),he="day";let te=1;if(q)for(let de=0;de<6;de++)oe[de][0]||(oe[de][0]={type:"week",text:s.unref(p).add(de*7+1,he).week()});return GO({row:6,column:7},oe,{startDate:D,columnIndexOffset:q?1:0,nextEndDate:ee.endDate||X||ee.selecting&&D||null,now:Ir().locale(s.unref(a)).startOf(he),unit:he,relativeDateGetter:de=>s.unref(p).add(de-ne,he),setCellMetadata:(...de)=>{C(...de,te)&&(te+=1)},setRowMetadata:k}),oe});s.watch(()=>N.date,async()=>{var D;(D=s.unref(x))!=null&&D.contains(document.activeElement)&&(await s.nextTick(),await R())});const R=async()=>{var D;return(D=s.unref(S))==null?void 0:D.focus()},U=D=>N.selectionMode==="date"&&iA(D.type)&&G(D,N.parsedValue),G=(D,X)=>X?Ir(X).locale(s.unref(a)).isSame(N.date.date(Number(D.text)),"day"):!1,j=(D,X)=>{const ee=D*7+(X-(N.showWeekNumber?1:0))-s.unref(f);return s.unref(p).add(ee,"day")},H=D=>{var X;if(!N.rangeState.selecting)return;let ee=D.target;if(ee.tagName==="SPAN"&&(ee=(X=ee.parentNode)==null?void 0:X.parentNode),ee.tagName==="DIV"&&(ee=ee.parentNode),ee.tagName!=="TD")return;const q=ee.parentNode.rowIndex-1,ne=ee.cellIndex;s.unref(T)[q][ne].disabled||(q!==s.unref(A)||ne!==s.unref(h))&&(A.value=q,h.value=ne,Q("changerange",{selecting:!0,endDate:j(q,ne)}))},W=D=>!s.unref(v)&&(D==null?void 0:D.text)===1&&D.type==="normal"||D.isCurrent,K=D=>{u||s.unref(v)||N.selectionMode!=="date"||F(D,!0)},$=D=>{D.target.closest("td")&&(u=!0)},O=D=>{D.target.closest("td")&&(u=!1)},L=D=>{!N.rangeState.selecting||!N.minDate?(Q("pick",{minDate:D,maxDate:null}),Q("select",!0)):(D>=N.minDate?Q("pick",{minDate:N.minDate,maxDate:D}):Q("pick",{minDate:D,maxDate:N.minDate}),Q("select",!1))},M=D=>{const X=D.week(),ee=`${D.year()}w${X}`;Q("pick",{year:D.year(),week:X,value:ee,date:D.startOf("week")})},I=(D,X)=>{const ee=X?Is(N.parsedValue).filter(q=>(q==null?void 0:q.valueOf())!==D.valueOf()):Is(N.parsedValue).concat([D]);Q("pick",ee)},F=(D,X=!1)=>{const ee=D.target.closest("td");if(!ee)return;const q=ee.parentNode.rowIndex-1,ne=ee.cellIndex,oe=s.unref(T)[q][ne];if(oe.disabled||oe.type==="week")return;const he=j(q,ne);switch(N.selectionMode){case"range":{L(he);break}case"date":{Q("pick",he,X);break}case"week":{M(he);break}case"dates":{I(he,!!oe.selected);break}}},V=D=>{if(N.selectionMode!=="week")return!1;let X=N.date.startOf("day");if(D.type==="prev-month"&&(X=X.subtract(1,"month")),D.type==="next-month"&&(X=X.add(1,"month")),X=X.date(Number.parseInt(D.text,10)),N.parsedValue&&!Array.isArray(N.parsedValue)){const ee=(N.parsedValue.day()-l+7)%7-1;return N.parsedValue.subtract(ee,"day").isSame(X,"day")}return!1};return{WEEKS:m,rows:T,tbodyRef:x,currentCellRef:S,focus:R,isCurrent:U,isWeekActive:V,isSelectedCell:W,handlePickDate:F,handleMouseUp:O,handleMouseDown:$,handleMouseMove:H,handleFocus:K}},WO=(N,{isCurrent:Q,isWeekActive:a})=>{const x=Jr("date-table"),{t:S}=es(),A=s.computed(()=>[x.b(),{"is-week-mode":N.selectionMode==="week"}]),h=s.computed(()=>S("el.datepicker.dateTablePrompt")),d=s.computed(()=>S("el.datepicker.week"));return{tableKls:A,tableLabel:h,weekLabel:d,getCellClasses:c=>{const f=[];return iA(c.type)&&!c.disabled?(f.push("available"),c.type==="today"&&f.push("today")):f.push(c.type),Q(c)&&f.push("current"),c.inRange&&(iA(c.type)||N.selectionMode==="week")&&(f.push("in-range"),c.start&&f.push("start-date"),c.end&&f.push("end-date")),c.disabled&&f.push("disabled"),c.selected&&f.push("selected"),c.customClass&&f.push(c.customClass),f.join(" ")},getRowKls:c=>[x.e("row"),{current:a(c)}],t:S}},$O=ei({cell:{type:Pr(Object)}});var nA=s.defineComponent({name:"ElDatePickerCell",props:$O,setup(N){const Q=Jr("date-table-cell"),{slots:a}=s.inject(Ph);return()=>{const{cell:x}=N;return s.renderSlot(a,"default",{...x},()=>{var S;return[s.createVNode("div",{class:Q.b()},[s.createVNode("span",{class:Q.e("text")},[(S=x==null?void 0:x.renderText)!=null?S:x==null?void 0:x.text])])]})}}}),sA=si(s.defineComponent({__name:"basic-date-table",props:HO,emits:zO,setup(N,{expose:Q,emit:a}){const x=N,{WEEKS:S,rows:A,tbodyRef:h,currentCellRef:d,focus:u,isCurrent:l,isWeekActive:c,isSelectedCell:f,handlePickDate:p,handleMouseUp:m,handleMouseDown:v,handleMouseMove:_,handleFocus:b}=QO(x,a),{tableLabel:w,tableKls:C,weekLabel:k,getCellClasses:T,getRowKls:R,t:U}=WO(x,{isCurrent:l,isWeekActive:c});return Q({focus:u}),(G,j)=>(s.openBlock(),s.createElementBlock("table",{"aria-label":s.unref(w),class:s.normalizeClass(s.unref(C)),cellspacing:"0",cellpadding:"0",role:"grid",onClick:s.unref(p),onMousemove:s.unref(_),onMousedown:s.withModifiers(s.unref(v),["prevent"]),onMouseup:s.unref(m)},[s.createElementVNode("tbody",{ref_key:"tbodyRef",ref:h},[s.createElementVNode("tr",null,[G.showWeekNumber?(s.openBlock(),s.createElementBlock("th",{key:0,scope:"col"},s.toDisplayString(s.unref(k)),1)):s.createCommentVNode("v-if",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(S),(H,W)=>(s.openBlock(),s.createElementBlock("th",{key:W,"aria-label":s.unref(U)("el.datepicker.weeksFull."+H),scope:"col"},s.toDisplayString(s.unref(U)("el.datepicker.weeks."+H)),9,["aria-label"]))),128))]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(A),(H,W)=>(s.openBlock(),s.createElementBlock("tr",{key:W,class:s.normalizeClass(s.unref(R)(H[1]))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(H,(K,$)=>(s.openBlock(),s.createElementBlock("td",{key:`${W}.${$}`,ref_for:!0,ref:O=>s.unref(f)(K)&&(d.value=O),class:s.normalizeClass(s.unref(T)(K)),"aria-current":K.isCurrent?"date":void 0,"aria-selected":K.isCurrent,tabindex:s.unref(f)(K)?0:-1,onFocus:s.unref(b)},[s.createVNode(s.unref(nA),{cell:K},null,8,["cell"])],42,["aria-current","aria-selected","tabindex","onFocus"]))),128))],2))),128))],512)],42,["aria-label","onClick","onMousemove","onMousedown","onMouseup"]))}}),[["__file","basic-date-table.vue"]]);const KO=ei({...qm,selectionMode:tA("month")});var oA=si(s.defineComponent({__name:"basic-month-table",props:KO,emits:["changerange","pick","select"],setup(N,{expose:Q,emit:a}){const x=N,S=(T,R,U)=>{const G=Ir().locale(U).startOf("month").month(R).year(T),j=G.daysInMonth();return g1(j).map(H=>G.add(H,"day").toDate())},A=Jr("month-table"),{t:h,lang:d}=es(),u=s.ref(),l=s.ref(),c=s.ref(x.date.locale("en").localeData().monthsShort().map(T=>T.toLowerCase())),f=s.ref([[],[],[]]),p=s.ref(),m=s.ref(),v=s.computed(()=>{var T,R;const U=f.value,G=Ir().locale(d.value).startOf("month");for(let j=0;j<3;j++){const H=U[j];for(let W=0;W<4;W++){const K=H[W]||(H[W]={row:j,column:W,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1});K.type="normal";const $=j*4+W,O=x.date.startOf("year").month($),L=x.rangeState.endDate||x.maxDate||x.rangeState.selecting&&x.minDate||null;K.inRange=!!(x.minDate&&O.isSameOrAfter(x.minDate,"month")&&L&&O.isSameOrBefore(L,"month"))||!!(x.minDate&&O.isSameOrBefore(x.minDate,"month")&&L&&O.isSameOrAfter(L,"month")),(T=x.minDate)!=null&&T.isSameOrAfter(L)?(K.start=!!(L&&O.isSame(L,"month")),K.end=x.minDate&&O.isSame(x.minDate,"month")):(K.start=!!(x.minDate&&O.isSame(x.minDate,"month")),K.end=!!(L&&O.isSame(L,"month"))),G.isSame(O)&&(K.type="today"),K.text=$,K.disabled=((R=x.disabledDate)==null?void 0:R.call(x,O.toDate()))||!1}}return U}),_=()=>{var T;(T=l.value)==null||T.focus()},b=T=>{const R={},U=x.date.year(),G=new Date,j=T.text;return R.disabled=x.disabledDate?S(U,j,d.value).every(x.disabledDate):!1,R.current=Is(x.parsedValue).findIndex(H=>Ir.isDayjs(H)&&H.year()===U&&H.month()===j)>=0,R.today=G.getFullYear()===U&&G.getMonth()===j,T.inRange&&(R["in-range"]=!0,T.start&&(R["start-date"]=!0),T.end&&(R["end-date"]=!0)),R},w=T=>{const R=x.date.year(),U=T.text;return Is(x.date).findIndex(G=>G.year()===R&&G.month()===U)>=0},C=T=>{var R;if(!x.rangeState.selecting)return;let U=T.target;if(U.tagName==="SPAN"&&(U=(R=U.parentNode)==null?void 0:R.parentNode),U.tagName==="DIV"&&(U=U.parentNode),U.tagName!=="TD")return;const G=U.parentNode.rowIndex,j=U.cellIndex;v.value[G][j].disabled||(G!==p.value||j!==m.value)&&(p.value=G,m.value=j,a("changerange",{selecting:!0,endDate:x.date.startOf("year").month(G*4+j)}))},k=T=>{var R;const U=(R=T.target)==null?void 0:R.closest("td");if((U==null?void 0:U.tagName)!=="TD"||uh(U,"disabled"))return;const G=U.cellIndex,H=U.parentNode.rowIndex*4+G,W=x.date.startOf("year").month(H);if(x.selectionMode==="months"){if(T.type==="keydown"){a("pick",Is(x.parsedValue),!1);return}const K=x.date.startOf("month").month(H),$=uh(U,"current")?Is(x.parsedValue).filter(O=>Number(O)!==Number(K)):Is(x.parsedValue).concat([Ir(K)]);a("pick",$)}else x.selectionMode==="range"?x.rangeState.selecting?(x.minDate&&W>=x.minDate?a("pick",{minDate:x.minDate,maxDate:W}):a("pick",{minDate:W,maxDate:x.minDate}),a("select",!1)):(a("pick",{minDate:W,maxDate:null}),a("select",!0)):a("pick",H)};return s.watch(()=>x.date,async()=>{var T,R;(T=u.value)!=null&&T.contains(document.activeElement)&&(await s.nextTick(),(R=l.value)==null||R.focus())}),Q({focus:_}),(T,R)=>(s.openBlock(),s.createElementBlock("table",{role:"grid","aria-label":s.unref(h)("el.datepicker.monthTablePrompt"),class:s.normalizeClass(s.unref(A).b()),onClick:k,onMousemove:C},[s.createElementVNode("tbody",{ref_key:"tbodyRef",ref:u},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(v),(U,G)=>(s.openBlock(),s.createElementBlock("tr",{key:G},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U,(j,H)=>(s.openBlock(),s.createElementBlock("td",{key:H,ref_for:!0,ref:W=>w(j)&&(l.value=W),class:s.normalizeClass(b(j)),"aria-selected":`${w(j)}`,"aria-label":s.unref(h)(`el.datepicker.month${+j.text+1}`),tabindex:w(j)?0:-1,onKeydown:[s.withKeys(s.withModifiers(k,["prevent","stop"]),["space"]),s.withKeys(s.withModifiers(k,["prevent","stop"]),["enter"])]},[s.createVNode(s.unref(nA),{cell:{...j,renderText:s.unref(h)("el.datepicker.months."+c.value[j.text])}},null,8,["cell"])],42,["aria-selected","aria-label","tabindex","onKeydown"]))),128))]))),128))],512)],42,["aria-label"]))}}),[["__file","basic-month-table.vue"]]);const XO=ei({...qm,selectionMode:tA("year")});var aA=si(s.defineComponent({__name:"basic-year-table",props:XO,emits:["changerange","pick","select"],setup(N,{expose:Q,emit:a}){const x=N,S=(T,R)=>{const U=Ir(String(T)).locale(R).startOf("year"),j=U.endOf("year").dayOfYear();return g1(j).map(H=>U.add(H,"day").toDate())},A=Jr("year-table"),{t:h,lang:d}=es(),u=s.ref(),l=s.ref(),c=s.computed(()=>Math.floor(x.date.year()/10)*10),f=s.ref([[],[],[]]),p=s.ref(),m=s.ref(),v=s.computed(()=>{var T;const R=f.value,U=Ir().locale(d.value).startOf("year");for(let G=0;G<3;G++){const j=R[G];for(let H=0;H<4&&!(G*4+H>=10);H++){let W=j[H];W||(W={row:G,column:H,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1}),W.type="normal";const K=G*4+H+c.value,$=Ir().year(K),O=x.rangeState.endDate||x.maxDate||x.rangeState.selecting&&x.minDate||null;W.inRange=!!(x.minDate&&$.isSameOrAfter(x.minDate,"year")&&O&&$.isSameOrBefore(O,"year"))||!!(x.minDate&&$.isSameOrBefore(x.minDate,"year")&&O&&$.isSameOrAfter(O,"year")),(T=x.minDate)!=null&&T.isSameOrAfter(O)?(W.start=!!(O&&$.isSame(O,"year")),W.end=!!(x.minDate&&$.isSame(x.minDate,"year"))):(W.start=!!(x.minDate&&$.isSame(x.minDate,"year")),W.end=!!(O&&$.isSame(O,"year"))),U.isSame($)&&(W.type="today"),W.text=K;const M=$.toDate();W.disabled=x.disabledDate&&x.disabledDate(M)||!1,j[H]=W}}return R}),_=()=>{var T;(T=l.value)==null||T.focus()},b=T=>{const R={},U=Ir().locale(d.value),G=T.text;return R.disabled=x.disabledDate?S(G,d.value).every(x.disabledDate):!1,R.today=U.year()===G,R.current=Is(x.parsedValue).findIndex(j=>j.year()===G)>=0,T.inRange&&(R["in-range"]=!0,T.start&&(R["start-date"]=!0),T.end&&(R["end-date"]=!0)),R},w=T=>{const R=T.text;return Is(x.date).findIndex(U=>U.year()===R)>=0},C=T=>{var R;const U=(R=T.target)==null?void 0:R.closest("td");if(!U||!U.textContent||uh(U,"disabled"))return;const G=U.cellIndex,H=U.parentNode.rowIndex*4+G+c.value,W=Ir().year(H);if(x.selectionMode==="range")x.rangeState.selecting?(x.minDate&&W>=x.minDate?a("pick",{minDate:x.minDate,maxDate:W}):a("pick",{minDate:W,maxDate:x.minDate}),a("select",!1)):(a("pick",{minDate:W,maxDate:null}),a("select",!0));else if(x.selectionMode==="years"){if(T.type==="keydown"){a("pick",Is(x.parsedValue),!1);return}const K=uh(U,"current")?Is(x.parsedValue).filter($=>($==null?void 0:$.year())!==H):Is(x.parsedValue).concat([W]);a("pick",K)}else a("pick",H)},k=T=>{var R;if(!x.rangeState.selecting)return;const U=(R=T.target)==null?void 0:R.closest("td");if(!U)return;const G=U.parentNode.rowIndex,j=U.cellIndex;v.value[G][j].disabled||(G!==p.value||j!==m.value)&&(p.value=G,m.value=j,a("changerange",{selecting:!0,endDate:Ir().year(c.value).add(G*4+j,"year")}))};return s.watch(()=>x.date,async()=>{var T,R;(T=u.value)!=null&&T.contains(document.activeElement)&&(await s.nextTick(),(R=l.value)==null||R.focus())}),Q({focus:_}),(T,R)=>(s.openBlock(),s.createElementBlock("table",{role:"grid","aria-label":s.unref(h)("el.datepicker.yearTablePrompt"),class:s.normalizeClass(s.unref(A).b()),onClick:C,onMousemove:k},[s.createElementVNode("tbody",{ref_key:"tbodyRef",ref:u},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(v),(U,G)=>(s.openBlock(),s.createElementBlock("tr",{key:G},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U,(j,H)=>(s.openBlock(),s.createElementBlock("td",{key:`${G}_${H}`,ref_for:!0,ref:W=>w(j)&&(l.value=W),class:s.normalizeClass(["available",b(j)]),"aria-selected":w(j),"aria-label":String(j.text),tabindex:w(j)?0:-1,onKeydown:[s.withKeys(s.withModifiers(C,["prevent","stop"]),["space"]),s.withKeys(s.withModifiers(C,["prevent","stop"]),["enter"])]},[s.createVNode(s.unref(nA),{cell:j},null,8,["cell"])],42,["aria-selected","aria-label","tabindex","onKeydown"]))),128))]))),128))],512)],42,["aria-label"]))}}),[["__file","basic-year-table.vue"]]),YO=si(s.defineComponent({__name:"panel-date-pick",props:UO,emits:["pick","set-picker-option","panel-change"],setup(N,{emit:Q}){const a=N,x=(Xe,dt,at)=>!0,S=Jr("picker-panel"),A=Jr("date-picker"),h=s.useAttrs(),d=s.useSlots(),{t:u,lang:l}=es(),c=s.inject("EP_PICKER_BASE"),f=s.inject(_h),{shortcuts:p,disabledDate:m,cellClassName:v,defaultTime:_}=c.props,b=s.toRef(c.props,"defaultValue"),w=s.ref(),C=s.ref(Ir().locale(l.value)),k=s.ref(!1);let T=!1;const R=s.computed(()=>Ir(_).locale(l.value)),U=s.computed(()=>C.value.month()),G=s.computed(()=>C.value.year()),j=s.ref([]),H=s.ref(null),W=s.ref(null),K=Xe=>j.value.length>0?x(Xe,j.value,a.format||"HH:mm:ss"):!0,$=Xe=>_&&!B.value&&!k.value&&!T?R.value.year(Xe.year()).month(Xe.month()).date(Xe.date()):de.value?Xe.millisecond(0):Xe.startOf("day"),O=(Xe,...dt)=>{if(!Xe)Q("pick",Xe,...dt);else if(bi(Xe)){const at=Xe.map($);Q("pick",at,...dt)}else Q("pick",$(Xe),...dt);H.value=null,W.value=null,k.value=!1,T=!1},L=async(Xe,dt)=>{if(X.value==="date"){Xe=Xe;let at=a.parsedValue?a.parsedValue.year(Xe.year()).month(Xe.month()).date(Xe.date()):Xe;K(at)||(at=j.value[0][0].year(Xe.year()).month(Xe.month()).date(Xe.date())),C.value=at,O(at,de.value||dt),a.type==="datetime"&&(await s.nextTick(),ct())}else X.value==="week"?O(Xe.date):X.value==="dates"&&O(Xe,!0)},M=Xe=>{const dt=Xe?"add":"subtract";C.value=C.value[dt](1,"month"),Ze("month")},I=Xe=>{const dt=C.value,at=Xe?"add":"subtract";C.value=F.value==="year"?dt[at](10,"year"):dt[at](1,"year"),Ze("year")},F=s.ref("date"),V=s.computed(()=>{const Xe=u("el.datepicker.year");if(F.value==="year"){const dt=Math.floor(G.value/10)*10;return Xe?`${dt} ${Xe} - ${dt+9} ${Xe}`:`${dt} - ${dt+9}`}return`${G.value} ${Xe}`}),D=Xe=>{const dt=mn(Xe.value)?Xe.value():Xe.value;if(dt){T=!0,O(Ir(dt).locale(l.value));return}Xe.onClick&&Xe.onClick({attrs:h,slots:d,emit:Q})},X=s.computed(()=>{const{type:Xe}=a;return["week","month","months","year","years","dates"].includes(Xe)?Xe:"date"}),ee=s.computed(()=>X.value==="dates"||X.value==="months"||X.value==="years"),q=s.computed(()=>X.value==="date"?F.value:X.value),ne=s.computed(()=>!!p.length),oe=async(Xe,dt)=>{X.value==="month"?(C.value=C.value.startOf("month").month(Xe),O(C.value,!1)):X.value==="months"?O(Xe,dt??!0):(C.value=C.value.startOf("month").month(Xe),F.value="date",["month","year","date","week"].includes(X.value)&&(O(C.value,!0),await s.nextTick(),ct())),Ze("month")},he=async(Xe,dt)=>{X.value==="year"?(C.value=C.value.startOf("year").year(Xe),O(C.value,!1)):X.value==="years"?O(Xe,dt??!0):(C.value=C.value.year(Xe),F.value="month",["month","year","date","week"].includes(X.value)&&(O(C.value,!0),await s.nextTick(),ct())),Ze("year")},te=async Xe=>{F.value=Xe,await s.nextTick(),ct()},de=s.computed(()=>a.type==="datetime"||a.type==="datetimerange"),se=s.computed(()=>{const Xe=de.value||X.value==="dates",dt=X.value==="years",at=X.value==="months",ze=F.value==="date",Ke=F.value==="year",ut=F.value==="month";return Xe&&ze||dt&&Ke||at&&ut}),re=s.computed(()=>m?a.parsedValue?bi(a.parsedValue)?m(a.parsedValue[0].toDate()):m(a.parsedValue.toDate()):!0:!1),ae=()=>{if(ee.value)O(a.parsedValue);else{let Xe=a.parsedValue;if(!Xe){const dt=Ir(_).locale(l.value),at=ot();Xe=dt.year(at.year()).month(at.month()).date(at.date())}C.value=Xe,O(Xe)}},Ce=s.computed(()=>m?m(Ir().locale(l.value).toDate()):!1),me=()=>{const dt=Ir().locale(l.value).toDate();k.value=!0,(!m||!m(dt))&&K(dt)&&(C.value=Ir().locale(l.value),O(C.value))},ce=s.computed(()=>a.timeFormat||y1(a.format)),pe=s.computed(()=>a.dateFormat||v1(a.format)),B=s.computed(()=>{if(W.value)return W.value;if(!(!a.parsedValue&&!b.value))return(a.parsedValue||C.value).format(ce.value)}),ke=s.computed(()=>{if(H.value)return H.value;if(!(!a.parsedValue&&!b.value))return(a.parsedValue||C.value).format(pe.value)}),Ee=s.ref(!1),ge=()=>{Ee.value=!0},Ae=()=>{Ee.value=!1},fe=Xe=>({hour:Xe.hour(),minute:Xe.minute(),second:Xe.second(),year:Xe.year(),month:Xe.month(),date:Xe.date()}),ue=(Xe,dt,at)=>{const{hour:ze,minute:Ke,second:ut}=fe(Xe),yt=a.parsedValue?a.parsedValue.hour(ze).minute(Ke).second(ut):Xe;C.value=yt,O(C.value,!0),at||(Ee.value=dt)},_e=Xe=>{const dt=Ir(Xe,ce.value).locale(l.value);if(dt.isValid()&&K(dt)){const{year:at,month:ze,date:Ke}=fe(C.value);C.value=dt.year(at).month(ze).date(Ke),W.value=null,Ee.value=!1,O(C.value,!0)}},be=Xe=>{const dt=Ir(Xe,pe.value).locale(l.value);if(dt.isValid()){if(m&&m(dt.toDate()))return;const{hour:at,minute:ze,second:Ke}=fe(C.value);C.value=dt.hour(at).minute(ze).second(Ke),H.value=null,O(C.value,!0)}},De=Xe=>Ir.isDayjs(Xe)&&Xe.isValid()&&(m?!m(Xe.toDate()):!0),Je=Xe=>bi(Xe)?Xe.map(dt=>dt.format(a.format)):Xe.format(a.format),Qe=Xe=>Ir(Xe,a.format).locale(l.value),ot=()=>{const Xe=Ir(b.value).locale(l.value);if(!b.value){const dt=R.value;return Ir().hour(dt.hour()).minute(dt.minute()).second(dt.second()).locale(l.value)}return Xe},ct=async()=>{var Xe;["week","month","year","date"].includes(X.value)&&((Xe=w.value)==null||Xe.focus(),X.value==="week"&&it(Ii.down))},ht=Xe=>{const{code:dt}=Xe;[Ii.up,Ii.down,Ii.left,Ii.right,Ii.home,Ii.end,Ii.pageUp,Ii.pageDown].includes(dt)&&(it(dt),Xe.stopPropagation(),Xe.preventDefault()),[Ii.enter,Ii.space,Ii.numpadEnter].includes(dt)&&H.value===null&&W.value===null&&(Xe.preventDefault(),O(C.value,!1))},it=Xe=>{var dt;const{up:at,down:ze,left:Ke,right:ut,home:yt,end:Ne,pageUp:tt,pageDown:Pt}=Ii,Rt={year:{[at]:-4,[ze]:4,[Ke]:-1,[ut]:1,offset:(zt,tr)=>zt.setFullYear(zt.getFullYear()+tr)},month:{[at]:-4,[ze]:4,[Ke]:-1,[ut]:1,offset:(zt,tr)=>zt.setMonth(zt.getMonth()+tr)},week:{[at]:-1,[ze]:1,[Ke]:-1,[ut]:1,offset:(zt,tr)=>zt.setDate(zt.getDate()+tr*7)},date:{[at]:-7,[ze]:7,[Ke]:-1,[ut]:1,[yt]:zt=>-zt.getDay(),[Ne]:zt=>-zt.getDay()+6,[tt]:zt=>-new Date(zt.getFullYear(),zt.getMonth(),0).getDate(),[Pt]:zt=>new Date(zt.getFullYear(),zt.getMonth()+1,0).getDate(),offset:(zt,tr)=>zt.setDate(zt.getDate()+tr)}},Ht=C.value.toDate();for(;Math.abs(C.value.diff(Ht,"year",!0))<1;){const zt=Rt[q.value];if(!zt)return;if(zt.offset(Ht,mn(zt[Xe])?zt[Xe](Ht):(dt=zt[Xe])!=null?dt:0),m&&m(Ht))break;const tr=Ir(Ht).locale(l.value);C.value=tr,Q("pick",tr,!0);break}},Ze=Xe=>{Q("panel-change",C.value.toDate(),Xe,F.value)};return s.watch(()=>X.value,Xe=>{if(["month","year"].includes(Xe)){F.value=Xe;return}else if(Xe==="years"){F.value="year";return}else if(Xe==="months"){F.value="month";return}F.value="date"},{immediate:!0}),s.watch(()=>F.value,()=>{f==null||f.updatePopper()}),s.watch(()=>b.value,Xe=>{Xe&&(C.value=ot())},{immediate:!0}),s.watch(()=>a.parsedValue,Xe=>{if(Xe){if(ee.value||Array.isArray(Xe))return;C.value=Xe}else C.value=ot()},{immediate:!0}),Q("set-picker-option",["isValidValue",De]),Q("set-picker-option",["formatToString",Je]),Q("set-picker-option",["parseUserInput",Qe]),Q("set-picker-option",["handleFocusPicker",ct]),(Xe,dt)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(S).b(),s.unref(A).b(),{"has-sidebar":Xe.$slots.sidebar||s.unref(ne),"has-time":s.unref(de)}])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("body-wrapper"))},[s.renderSlot(Xe.$slots,"sidebar",{class:s.normalizeClass(s.unref(S).e("sidebar"))}),s.unref(ne)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(S).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(p),(at,ze)=>(s.openBlock(),s.createElementBlock("button",{key:ze,type:"button",class:s.normalizeClass(s.unref(S).e("shortcut")),onClick:Ke=>D(at)},s.toDisplayString(at.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("body"))},[s.unref(de)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(A).e("time-header"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(A).e("editor-wrap"))},[s.createVNode(s.unref(Sn),{placeholder:s.unref(u)("el.datepicker.selectDate"),"model-value":s.unref(ke),size:"small","validate-event":!1,onInput:at=>H.value=at,onChange:be},null,8,["placeholder","model-value","onInput"])],2),s.withDirectives((s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(s.unref(A).e("editor-wrap"))},[s.createVNode(s.unref(Sn),{placeholder:s.unref(u)("el.datepicker.selectTime"),"model-value":s.unref(B),size:"small","validate-event":!1,onFocus:ge,onInput:at=>W.value=at,onChange:_e},null,8,["placeholder","model-value","onInput"]),s.createVNode(s.unref(Ym),{visible:Ee.value,format:s.unref(ce),"parsed-value":C.value,onPick:ue},null,8,["visible","format","parsed-value"])],2)),[[s.unref(Eh),Ae]])],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass([s.unref(A).e("header"),(F.value==="year"||F.value==="month")&&s.unref(A).e("header--bordered")])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(A).e("prev-btn"))},[s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.prevYear"),class:s.normalizeClass(["d-arrow-left",s.unref(S).e("icon-btn")]),onClick:at=>I(!1)},[s.renderSlot(Xe.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["aria-label","onClick"]),s.withDirectives(s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.prevMonth"),class:s.normalizeClass([s.unref(S).e("icon-btn"),"arrow-left"]),onClick:at=>M(!1)},[s.renderSlot(Xe.$slots,"prev-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowLeft))]),_:1})])],10,["aria-label","onClick"]),[[s.vShow,F.value==="date"]])],2),s.createElementVNode("span",{role:"button",class:s.normalizeClass(s.unref(A).e("header-label")),"aria-live":"polite",tabindex:"0",onKeydown:s.withKeys(at=>te("year"),["enter"]),onClick:at=>te("year")},s.toDisplayString(s.unref(V)),43,["onKeydown","onClick"]),s.withDirectives(s.createElementVNode("span",{role:"button","aria-live":"polite",tabindex:"0",class:s.normalizeClass([s.unref(A).e("header-label"),{active:F.value==="month"}]),onKeydown:s.withKeys(at=>te("month"),["enter"]),onClick:at=>te("month")},s.toDisplayString(s.unref(u)(`el.datepicker.month${s.unref(U)+1}`)),43,["onKeydown","onClick"]),[[s.vShow,F.value==="date"]]),s.createElementVNode("span",{class:s.normalizeClass(s.unref(A).e("next-btn"))},[s.withDirectives(s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.nextMonth"),class:s.normalizeClass([s.unref(S).e("icon-btn"),"arrow-right"]),onClick:at=>M(!0)},[s.renderSlot(Xe.$slots,"next-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})])],10,["aria-label","onClick"]),[[s.vShow,F.value==="date"]]),s.createElementVNode("button",{type:"button","aria-label":s.unref(u)("el.datepicker.nextYear"),class:s.normalizeClass([s.unref(S).e("icon-btn"),"d-arrow-right"]),onClick:at=>I(!0)},[s.renderSlot(Xe.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["aria-label","onClick"])],2)],2),[[s.vShow,F.value!=="time"]]),s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("content")),onKeydown:ht},[F.value==="date"?(s.openBlock(),s.createBlock(sA,{key:0,ref_key:"currentViewRef",ref:w,"selection-mode":s.unref(X),date:C.value,"parsed-value":Xe.parsedValue,"disabled-date":s.unref(m),"cell-class-name":s.unref(v),onPick:L},null,8,["selection-mode","date","parsed-value","disabled-date","cell-class-name"])):s.createCommentVNode("v-if",!0),F.value==="year"?(s.openBlock(),s.createBlock(aA,{key:1,ref_key:"currentViewRef",ref:w,"selection-mode":s.unref(X),date:C.value,"disabled-date":s.unref(m),"parsed-value":Xe.parsedValue,onPick:he},null,8,["selection-mode","date","disabled-date","parsed-value"])):s.createCommentVNode("v-if",!0),F.value==="month"?(s.openBlock(),s.createBlock(oA,{key:2,ref_key:"currentViewRef",ref:w,"selection-mode":s.unref(X),date:C.value,"parsed-value":Xe.parsedValue,"disabled-date":s.unref(m),onPick:oe},null,8,["selection-mode","date","parsed-value","disabled-date"])):s.createCommentVNode("v-if",!0)],34)],2)],2),s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("footer"))},[s.withDirectives(s.createVNode(s.unref(Ch),{text:"",size:"small",class:s.normalizeClass(s.unref(S).e("link-btn")),disabled:s.unref(Ce),onClick:me},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(u)("el.datepicker.now")),1)]),_:1},8,["class","disabled"]),[[s.vShow,!s.unref(ee)]]),s.createVNode(s.unref(Ch),{plain:"",size:"small",class:s.normalizeClass(s.unref(S).e("link-btn")),disabled:s.unref(re),onClick:ae},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(u)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled"])],2),[[s.vShow,s.unref(se)]])],2))}}),[["__file","panel-date-pick.vue"]]);const JO=ei({...$1,...eA,visible:Boolean}),K1=N=>{const{emit:Q}=s.getCurrentInstance(),a=s.useAttrs(),x=s.useSlots();return A=>{const h=mn(A.value)?A.value():A.value;if(h){Q("pick",[Ir(h[0]).locale(N.value),Ir(h[1]).locale(N.value)]);return}A.onClick&&A.onClick({attrs:a,slots:x,emit:Q})}},X1=(N,{defaultValue:Q,leftDate:a,rightDate:x,unit:S,onParsedValueChanged:A})=>{const{emit:h}=s.getCurrentInstance(),{pickerNs:d}=s.inject(Ph),u=Jr("date-range-picker"),{t:l,lang:c}=es(),f=K1(c),p=s.ref(),m=s.ref(),v=s.ref({endDate:null,selecting:!1}),_=T=>{v.value=T},b=(T=!1)=>{const R=s.unref(p),U=s.unref(m);hc([R,U])&&h("pick",[R,U],T)},w=T=>{v.value.selecting=T,T||(v.value.endDate=null)},C=T=>{if(bi(T)&&T.length===2){const[R,U]=T;p.value=R,a.value=R,m.value=U,A(s.unref(p),s.unref(m))}else k()},k=()=>{const[T,R]=rA(s.unref(Q),{lang:s.unref(c),unit:S,unlinkPanels:N.unlinkPanels});p.value=void 0,m.value=void 0,a.value=T,x.value=R};return s.watch(Q,T=>{T&&k()},{immediate:!0}),s.watch(()=>N.parsedValue,C,{immediate:!0}),{minDate:p,maxDate:m,rangeState:v,lang:c,ppNs:d,drpNs:u,handleChangeRange:_,handleRangeConfirm:b,handleShortcutClick:f,onSelect:w,onReset:C,t:l}},Sh="month";var ZO=si(s.defineComponent({__name:"panel-date-range",props:JO,emits:["pick","set-picker-option","calendar-change","panel-change"],setup(N,{emit:Q}){const a=N,x=s.inject("EP_PICKER_BASE"),{disabledDate:S,cellClassName:A,defaultTime:h,clearable:d}=x.props,u=s.toRef(x.props,"format"),l=s.toRef(x.props,"shortcuts"),c=s.toRef(x.props,"defaultValue"),{lang:f}=es(),p=s.ref(Ir().locale(f.value)),m=s.ref(Ir().locale(f.value).add(1,Sh)),{minDate:v,maxDate:_,rangeState:b,ppNs:w,drpNs:C,handleChangeRange:k,handleRangeConfirm:T,handleShortcutClick:R,onSelect:U,onReset:G,t:j}=X1(a,{defaultValue:c,leftDate:p,rightDate:m,unit:Sh,onParsedValueChanged:dt});s.watch(()=>a.visible,at=>{!at&&b.value.selecting&&(G(a.parsedValue),U(!1))});const H=s.ref({min:null,max:null}),W=s.ref({min:null,max:null}),K=s.computed(()=>`${p.value.year()} ${j("el.datepicker.year")} ${j(`el.datepicker.month${p.value.month()+1}`)}`),$=s.computed(()=>`${m.value.year()} ${j("el.datepicker.year")} ${j(`el.datepicker.month${m.value.month()+1}`)}`),O=s.computed(()=>p.value.year()),L=s.computed(()=>p.value.month()),M=s.computed(()=>m.value.year()),I=s.computed(()=>m.value.month()),F=s.computed(()=>!!l.value.length),V=s.computed(()=>H.value.min!==null?H.value.min:v.value?v.value.format(ne.value):""),D=s.computed(()=>H.value.max!==null?H.value.max:_.value||v.value?(_.value||v.value).format(ne.value):""),X=s.computed(()=>W.value.min!==null?W.value.min:v.value?v.value.format(q.value):""),ee=s.computed(()=>W.value.max!==null?W.value.max:_.value||v.value?(_.value||v.value).format(q.value):""),q=s.computed(()=>a.timeFormat||y1(u.value)),ne=s.computed(()=>a.dateFormat||v1(u.value)),oe=at=>hc(at)&&(S?!S(at[0].toDate())&&!S(at[1].toDate()):!0),he=()=>{p.value=p.value.subtract(1,"year"),a.unlinkPanels||(m.value=p.value.add(1,"month")),ce("year")},te=()=>{p.value=p.value.subtract(1,"month"),a.unlinkPanels||(m.value=p.value.add(1,"month")),ce("month")},de=()=>{a.unlinkPanels?m.value=m.value.add(1,"year"):(p.value=p.value.add(1,"year"),m.value=p.value.add(1,"month")),ce("year")},se=()=>{a.unlinkPanels?m.value=m.value.add(1,"month"):(p.value=p.value.add(1,"month"),m.value=p.value.add(1,"month")),ce("month")},re=()=>{p.value=p.value.add(1,"year"),ce("year")},ae=()=>{p.value=p.value.add(1,"month"),ce("month")},Ce=()=>{m.value=m.value.subtract(1,"year"),ce("year")},me=()=>{m.value=m.value.subtract(1,"month"),ce("month")},ce=at=>{Q("panel-change",[p.value.toDate(),m.value.toDate()],at)},pe=s.computed(()=>{const at=(L.value+1)%12,ze=L.value+1>=12?1:0;return a.unlinkPanels&&new Date(O.value+ze,at)<new Date(M.value,I.value)}),B=s.computed(()=>a.unlinkPanels&&M.value*12+I.value-(O.value*12+L.value+1)>=12),ke=s.computed(()=>!(v.value&&_.value&&!b.value.selecting&&hc([v.value,_.value]))),Ee=s.computed(()=>a.type==="datetime"||a.type==="datetimerange"),ge=(at,ze)=>{if(at)return h?Ir(h[ze]||h).locale(f.value).year(at.year()).month(at.month()).date(at.date()):at},Ae=(at,ze=!0)=>{const Ke=at.minDate,ut=at.maxDate,yt=ge(Ke,0),Ne=ge(ut,1);_.value===Ne&&v.value===yt||(Q("calendar-change",[Ke.toDate(),ut&&ut.toDate()]),_.value=Ne,v.value=yt,!(!ze||Ee.value)&&T())},fe=s.ref(!1),ue=s.ref(!1),_e=()=>{fe.value=!1},be=()=>{ue.value=!1},De=(at,ze)=>{H.value[ze]=at;const Ke=Ir(at,ne.value).locale(f.value);if(Ke.isValid()){if(S&&S(Ke.toDate()))return;ze==="min"?(p.value=Ke,v.value=(v.value||p.value).year(Ke.year()).month(Ke.month()).date(Ke.date()),!a.unlinkPanels&&(!_.value||_.value.isBefore(v.value))&&(m.value=Ke.add(1,"month"),_.value=v.value.add(1,"month"))):(m.value=Ke,_.value=(_.value||m.value).year(Ke.year()).month(Ke.month()).date(Ke.date()),!a.unlinkPanels&&(!v.value||v.value.isAfter(_.value))&&(p.value=Ke.subtract(1,"month"),v.value=_.value.subtract(1,"month")))}},Je=(at,ze)=>{H.value[ze]=null},Qe=(at,ze)=>{W.value[ze]=at;const Ke=Ir(at,q.value).locale(f.value);Ke.isValid()&&(ze==="min"?(fe.value=!0,v.value=(v.value||p.value).hour(Ke.hour()).minute(Ke.minute()).second(Ke.second())):(ue.value=!0,_.value=(_.value||m.value).hour(Ke.hour()).minute(Ke.minute()).second(Ke.second()),m.value=_.value))},ot=(at,ze)=>{W.value[ze]=null,ze==="min"?(p.value=v.value,fe.value=!1,(!_.value||_.value.isBefore(v.value))&&(_.value=v.value)):(m.value=_.value,ue.value=!1,_.value&&_.value.isBefore(v.value)&&(v.value=_.value))},ct=(at,ze,Ke)=>{W.value.min||(at&&(p.value=at,v.value=(v.value||p.value).hour(at.hour()).minute(at.minute()).second(at.second())),Ke||(fe.value=ze),(!_.value||_.value.isBefore(v.value))&&(_.value=v.value,m.value=at))},ht=(at,ze,Ke)=>{W.value.max||(at&&(m.value=at,_.value=(_.value||m.value).hour(at.hour()).minute(at.minute()).second(at.second())),Ke||(ue.value=ze),_.value&&_.value.isBefore(v.value)&&(v.value=_.value))},it=()=>{p.value=rA(s.unref(c),{lang:s.unref(f),unit:"month",unlinkPanels:a.unlinkPanels})[0],m.value=p.value.add(1,"month"),_.value=void 0,v.value=void 0,Q("pick",null)},Ze=at=>bi(at)?at.map(ze=>ze.format(u.value)):at.format(u.value),Xe=at=>bi(at)?at.map(ze=>Ir(ze,u.value).locale(f.value)):Ir(at,u.value).locale(f.value);function dt(at,ze){if(a.unlinkPanels&&ze){const Ke=(at==null?void 0:at.year())||0,ut=(at==null?void 0:at.month())||0,yt=ze.year(),Ne=ze.month();m.value=Ke===yt&&ut===Ne?ze.add(1,Sh):ze}else m.value=p.value.add(1,Sh),ze&&(m.value=m.value.hour(ze.hour()).minute(ze.minute()).second(ze.second()))}return Q("set-picker-option",["isValidValue",oe]),Q("set-picker-option",["parseUserInput",Xe]),Q("set-picker-option",["formatToString",Ze]),Q("set-picker-option",["handleClear",it]),(at,ze)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(w).b(),s.unref(C).b(),{"has-sidebar":at.$slots.sidebar||s.unref(F),"has-time":s.unref(Ee)}])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(w).e("body-wrapper"))},[s.renderSlot(at.$slots,"sidebar",{class:s.normalizeClass(s.unref(w).e("sidebar"))}),s.unref(F)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(w).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(l),(Ke,ut)=>(s.openBlock(),s.createElementBlock("button",{key:ut,type:"button",class:s.normalizeClass(s.unref(w).e("shortcut")),onClick:yt=>s.unref(R)(Ke)},s.toDisplayString(Ke.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(w).e("body"))},[s.unref(Ee)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(C).e("time-header"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(C).e("editors-wrap"))},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.startDate"),class:s.normalizeClass(s.unref(C).e("editor")),"model-value":s.unref(V),"validate-event":!1,onInput:Ke=>De(Ke,"min"),onChange:Ke=>Je(Ke,"min")},null,8,["disabled","placeholder","class","model-value","onInput","onChange"])],2),s.withDirectives((s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",class:s.normalizeClass(s.unref(C).e("editor")),disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.startTime"),"model-value":s.unref(X),"validate-event":!1,onFocus:Ke=>fe.value=!0,onInput:Ke=>Qe(Ke,"min"),onChange:Ke=>ot(Ke,"min")},null,8,["class","disabled","placeholder","model-value","onFocus","onInput","onChange"]),s.createVNode(s.unref(Ym),{visible:fe.value,format:s.unref(q),"datetime-role":"start","parsed-value":p.value,onPick:ct},null,8,["visible","format","parsed-value"])],2)),[[s.unref(Eh),_e]])],2),s.createElementVNode("span",null,[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})]),s.createElementVNode("span",{class:s.normalizeClass([s.unref(C).e("editors-wrap"),"is-right"])},[s.createElementVNode("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",class:s.normalizeClass(s.unref(C).e("editor")),disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.endDate"),"model-value":s.unref(D),readonly:!s.unref(v),"validate-event":!1,onInput:Ke=>De(Ke,"max"),onChange:Ke=>Je(Ke,"max")},null,8,["class","disabled","placeholder","model-value","readonly","onInput","onChange"])],2),s.withDirectives((s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(s.unref(C).e("time-picker-wrap"))},[s.createVNode(s.unref(Sn),{size:"small",class:s.normalizeClass(s.unref(C).e("editor")),disabled:s.unref(b).selecting,placeholder:s.unref(j)("el.datepicker.endTime"),"model-value":s.unref(ee),readonly:!s.unref(v),"validate-event":!1,onFocus:Ke=>s.unref(v)&&(ue.value=!0),onInput:Ke=>Qe(Ke,"max"),onChange:Ke=>ot(Ke,"max")},null,8,["class","disabled","placeholder","model-value","readonly","onFocus","onInput","onChange"]),s.createVNode(s.unref(Ym),{"datetime-role":"end",visible:ue.value,format:s.unref(q),"parsed-value":m.value,onPick:ht},null,8,["visible","format","parsed-value"])],2)),[[s.unref(Eh),be]])],2)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass([[s.unref(w).e("content"),s.unref(C).e("content")],"is-left"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(C).e("header"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(w).e("icon-btn"),"d-arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevYear"),onClick:he},[s.renderSlot(at.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["aria-label"]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(w).e("icon-btn"),"arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevMonth"),onClick:te},[s.renderSlot(at.$slots,"prev-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowLeft))]),_:1})])],10,["aria-label"]),at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(B),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(B)}],"d-arrow-right"]),"aria-label":s.unref(j)("el.datepicker.nextYear"),onClick:re},[s.renderSlot(at.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",disabled:!s.unref(pe),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(pe)}],"arrow-right"]),"aria-label":s.unref(j)("el.datepicker.nextMonth"),onClick:ae},[s.renderSlot(at.$slots,"next-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",null,s.toDisplayString(s.unref(K)),1)],2),s.createVNode(sA,{"selection-mode":"range",date:p.value,"min-date":s.unref(v),"max-date":s.unref(_),"range-state":s.unref(b),"disabled-date":s.unref(S),"cell-class-name":s.unref(A),onChangerange:s.unref(k),onPick:Ae,onSelect:s.unref(U)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2),s.createElementVNode("div",{class:s.normalizeClass([[s.unref(w).e("content"),s.unref(C).e("content")],"is-right"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(C).e("header"))},[at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(B),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(B)}],"d-arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevYear"),onClick:Ce},[s.renderSlot(at.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),at.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",disabled:!s.unref(pe),class:s.normalizeClass([[s.unref(w).e("icon-btn"),{"is-disabled":!s.unref(pe)}],"arrow-left"]),"aria-label":s.unref(j)("el.datepicker.prevMonth"),onClick:me},[s.renderSlot(at.$slots,"prev-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowLeft))]),_:1})])],10,["disabled","aria-label"])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button","aria-label":s.unref(j)("el.datepicker.nextYear"),class:s.normalizeClass([s.unref(w).e("icon-btn"),"d-arrow-right"]),onClick:de},[s.renderSlot(at.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["aria-label"]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(w).e("icon-btn"),"arrow-right"]),"aria-label":s.unref(j)("el.datepicker.nextMonth"),onClick:se},[s.renderSlot(at.$slots,"next-month",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.ArrowRight))]),_:1})])],10,["aria-label"]),s.createElementVNode("div",null,s.toDisplayString(s.unref($)),1)],2),s.createVNode(sA,{"selection-mode":"range",date:m.value,"min-date":s.unref(v),"max-date":s.unref(_),"range-state":s.unref(b),"disabled-date":s.unref(S),"cell-class-name":s.unref(A),onChangerange:s.unref(k),onPick:Ae,onSelect:s.unref(U)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","onChangerange","onSelect"])],2)],2)],2),s.unref(Ee)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(w).e("footer"))},[s.unref(d)?(s.openBlock(),s.createBlock(s.unref(Ch),{key:0,text:"",size:"small",class:s.normalizeClass(s.unref(w).e("link-btn")),onClick:it},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(j)("el.datepicker.clear")),1)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(s.unref(Ch),{plain:"",size:"small",class:s.normalizeClass(s.unref(w).e("link-btn")),disabled:s.unref(ke),onClick:Ke=>s.unref(T)(!1)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(s.unref(j)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled","onClick"])],2)):s.createCommentVNode("v-if",!0)],2))}}),[["__file","panel-date-range.vue"]]);const qO=ei({...eA}),eN=["pick","set-picker-option","calendar-change"],tN=({unlinkPanels:N,leftDate:Q,rightDate:a})=>{const{t:x}=es(),S=()=>{Q.value=Q.value.subtract(1,"year"),N.value||(a.value=a.value.subtract(1,"year"))},A=()=>{N.value||(Q.value=Q.value.add(1,"year")),a.value=a.value.add(1,"year")},h=()=>{Q.value=Q.value.add(1,"year")},d=()=>{a.value=a.value.subtract(1,"year")},u=s.computed(()=>`${Q.value.year()} ${x("el.datepicker.year")}`),l=s.computed(()=>`${a.value.year()} ${x("el.datepicker.year")}`),c=s.computed(()=>Q.value.year()),f=s.computed(()=>a.value.year()===Q.value.year()?Q.value.year()+1:a.value.year());return{leftPrevYear:S,rightNextYear:A,leftNextYear:h,rightPrevYear:d,leftLabel:u,rightLabel:l,leftYear:c,rightYear:f}},kh="year",rN=s.defineComponent({name:"DatePickerMonthRange"}),iN=s.defineComponent({...rN,props:qO,emits:eN,setup(N,{emit:Q}){const a=N,{lang:x}=es(),S=s.inject("EP_PICKER_BASE"),{shortcuts:A,disabledDate:h}=S.props,d=s.toRef(S.props,"format"),u=s.toRef(S.props,"defaultValue"),l=s.ref(Ir().locale(x.value)),c=s.ref(Ir().locale(x.value).add(1,kh)),{minDate:f,maxDate:p,rangeState:m,ppNs:v,drpNs:_,handleChangeRange:b,handleRangeConfirm:w,handleShortcutClick:C,onSelect:k}=X1(a,{defaultValue:u,leftDate:l,rightDate:c,unit:kh,onParsedValueChanged:V}),T=s.computed(()=>!!A.length),{leftPrevYear:R,rightNextYear:U,leftNextYear:G,rightPrevYear:j,leftLabel:H,rightLabel:W,leftYear:K,rightYear:$}=tN({unlinkPanels:s.toRef(a,"unlinkPanels"),leftDate:l,rightDate:c}),O=s.computed(()=>a.unlinkPanels&&$.value>K.value+1),L=(D,X=!0)=>{const ee=D.minDate,q=D.maxDate;p.value===q&&f.value===ee||(Q("calendar-change",[ee.toDate(),q&&q.toDate()]),p.value=q,f.value=ee,X&&w())},M=()=>{l.value=rA(s.unref(u),{lang:s.unref(x),unit:"year",unlinkPanels:a.unlinkPanels})[0],c.value=l.value.add(1,"year"),Q("pick",null)},I=D=>bi(D)?D.map(X=>X.format(d.value)):D.format(d.value),F=D=>bi(D)?D.map(X=>Ir(X,d.value).locale(x.value)):Ir(D,d.value).locale(x.value);function V(D,X){if(a.unlinkPanels&&X){const ee=(D==null?void 0:D.year())||0,q=X.year();c.value=ee===q?X.add(1,kh):X}else c.value=l.value.add(1,kh)}return Q("set-picker-option",["isValidValue",hc]),Q("set-picker-option",["formatToString",I]),Q("set-picker-option",["parseUserInput",F]),Q("set-picker-option",["handleClear",M]),(D,X)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(v).b(),s.unref(_).b(),{"has-sidebar":!!D.$slots.sidebar||s.unref(T)}])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(v).e("body-wrapper"))},[s.renderSlot(D.$slots,"sidebar",{class:s.normalizeClass(s.unref(v).e("sidebar"))}),s.unref(T)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(v).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(A),(ee,q)=>(s.openBlock(),s.createElementBlock("button",{key:q,type:"button",class:s.normalizeClass(s.unref(v).e("shortcut")),onClick:ne=>s.unref(C)(ee)},s.toDisplayString(ee.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(v).e("body"))},[s.createElementVNode("div",{class:s.normalizeClass([[s.unref(v).e("content"),s.unref(_).e("content")],"is-left"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(_).e("header"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(v).e("icon-btn"),"d-arrow-left"]),onClick:s.unref(R)},[s.renderSlot(D.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["onClick"]),D.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(O),class:s.normalizeClass([[s.unref(v).e("icon-btn"),{[s.unref(v).is("disabled")]:!s.unref(O)}],"d-arrow-right"]),onClick:s.unref(G)},[s.renderSlot(D.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",null,s.toDisplayString(s.unref(H)),1)],2),s.createVNode(oA,{"selection-mode":"range",date:l.value,"min-date":s.unref(f),"max-date":s.unref(p),"range-state":s.unref(m),"disabled-date":s.unref(h),onChangerange:s.unref(b),onPick:L,onSelect:s.unref(k)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2),s.createElementVNode("div",{class:s.normalizeClass([[s.unref(v).e("content"),s.unref(_).e("content")],"is-right"])},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(_).e("header"))},[D.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(O),class:s.normalizeClass([[s.unref(v).e("icon-btn"),{"is-disabled":!s.unref(O)}],"d-arrow-left"]),onClick:s.unref(j)},[s.renderSlot(D.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass([s.unref(v).e("icon-btn"),"d-arrow-right"]),onClick:s.unref(U)},[s.renderSlot(D.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["onClick"]),s.createElementVNode("div",null,s.toDisplayString(s.unref(W)),1)],2),s.createVNode(oA,{"selection-mode":"range",date:c.value,"min-date":s.unref(f),"max-date":s.unref(p),"range-state":s.unref(m),"disabled-date":s.unref(h),onChangerange:s.unref(b),onPick:L,onSelect:s.unref(k)},null,8,["date","min-date","max-date","range-state","disabled-date","onChangerange","onSelect"])],2)],2)],2)],2))}});var nN=si(iN,[["__file","panel-month-range.vue"]]);const sN=ei({...eA}),oN=["pick","set-picker-option","calendar-change"],aN=({unlinkPanels:N,leftDate:Q,rightDate:a})=>{const x=()=>{Q.value=Q.value.subtract(10,"year"),N.value||(a.value=a.value.subtract(10,"year"))},S=()=>{N.value||(Q.value=Q.value.add(10,"year")),a.value=a.value.add(10,"year")},A=()=>{Q.value=Q.value.add(10,"year")},h=()=>{a.value=a.value.subtract(10,"year")},d=s.computed(()=>{const f=Math.floor(Q.value.year()/10)*10;return`${f}-${f+9}`}),u=s.computed(()=>{const f=Math.floor(a.value.year()/10)*10;return`${f}-${f+9}`}),l=s.computed(()=>Math.floor(Q.value.year()/10)*10+9),c=s.computed(()=>Math.floor(a.value.year()/10)*10);return{leftPrevYear:x,rightNextYear:S,leftNextYear:A,rightPrevYear:h,leftLabel:d,rightLabel:u,leftYear:l,rightYear:c}},Y1="year",lN=s.defineComponent({name:"DatePickerYearRange"}),cN=s.defineComponent({...lN,props:sN,emits:oN,setup(N,{emit:Q}){const a=N,{lang:x}=es(),S=s.ref(Ir().locale(x.value)),A=s.ref(S.value.add(10,"year")),{pickerNs:h}=s.inject(Ph),d=Jr("date-range-picker"),u=s.computed(()=>!!L.length),l=s.computed(()=>[h.b(),d.b(),{"has-sidebar":!!s.useSlots().sidebar||u.value}]),c=s.computed(()=>({content:[h.e("content"),d.e("content"),"is-left"],arrowLeftBtn:[h.e("icon-btn"),"d-arrow-left"],arrowRightBtn:[h.e("icon-btn"),{[h.is("disabled")]:!R.value},"d-arrow-right"]})),f=s.computed(()=>({content:[h.e("content"),d.e("content"),"is-right"],arrowLeftBtn:[h.e("icon-btn"),{"is-disabled":!R.value},"d-arrow-left"],arrowRightBtn:[h.e("icon-btn"),"d-arrow-right"]})),p=K1(x),{leftPrevYear:m,rightNextYear:v,leftNextYear:_,rightPrevYear:b,leftLabel:w,rightLabel:C,leftYear:k,rightYear:T}=aN({unlinkPanels:s.toRef(a,"unlinkPanels"),leftDate:S,rightDate:A}),R=s.computed(()=>a.unlinkPanels&&T.value>k.value+1),U=s.ref(),G=s.ref(),j=s.ref({endDate:null,selecting:!1}),H=ne=>{j.value=ne},W=(ne,oe=!0)=>{const he=ne.minDate,te=ne.maxDate;G.value===te&&U.value===he||(Q("calendar-change",[he.toDate(),te&&te.toDate()]),G.value=te,U.value=he,oe&&K())},K=(ne=!1)=>{hc([U.value,G.value])&&Q("pick",[U.value,G.value],ne)},$=ne=>{j.value.selecting=ne,ne||(j.value.endDate=null)},O=s.inject("EP_PICKER_BASE"),{shortcuts:L,disabledDate:M}=O.props,I=s.toRef(O.props,"format"),F=s.toRef(O.props,"defaultValue"),V=()=>{let ne;if(bi(F.value)){const oe=Ir(F.value[0]);let he=Ir(F.value[1]);return a.unlinkPanels||(he=oe.add(10,Y1)),[oe,he]}else F.value?ne=Ir(F.value):ne=Ir();return ne=ne.locale(x.value),[ne,ne.add(10,Y1)]};s.watch(()=>F.value,ne=>{if(ne){const oe=V();S.value=oe[0],A.value=oe[1]}},{immediate:!0}),s.watch(()=>a.parsedValue,ne=>{if(ne&&ne.length===2)if(U.value=ne[0],G.value=ne[1],S.value=U.value,a.unlinkPanels&&G.value){const oe=U.value.year(),he=G.value.year();A.value=oe===he?G.value.add(10,"year"):G.value}else A.value=S.value.add(10,"year");else{const oe=V();U.value=void 0,G.value=void 0,S.value=oe[0],A.value=oe[1]}},{immediate:!0});const D=ne=>bi(ne)?ne.map(oe=>Ir(oe,I.value).locale(x.value)):Ir(ne,I.value).locale(x.value),X=ne=>bi(ne)?ne.map(oe=>oe.format(I.value)):ne.format(I.value),ee=ne=>hc(ne)&&(M?!M(ne[0].toDate())&&!M(ne[1].toDate()):!0),q=()=>{const ne=V();S.value=ne[0],A.value=ne[1],G.value=void 0,U.value=void 0,Q("pick",null)};return Q("set-picker-option",["isValidValue",ee]),Q("set-picker-option",["parseUserInput",D]),Q("set-picker-option",["formatToString",X]),Q("set-picker-option",["handleClear",q]),(ne,oe)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(l))},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(h).e("body-wrapper"))},[s.renderSlot(ne.$slots,"sidebar",{class:s.normalizeClass(s.unref(h).e("sidebar"))}),s.unref(u)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(h).e("sidebar"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(L),(he,te)=>(s.openBlock(),s.createElementBlock("button",{key:te,type:"button",class:s.normalizeClass(s.unref(h).e("shortcut")),onClick:de=>s.unref(p)(he)},s.toDisplayString(he.text),11,["onClick"]))),128))],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(h).e("body"))},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(c).content)},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(d).e("header"))},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(s.unref(c).arrowLeftBtn),onClick:s.unref(m)},[s.renderSlot(ne.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["onClick"]),ne.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(R),class:s.normalizeClass(s.unref(c).arrowRightBtn),onClick:s.unref(_)},[s.renderSlot(ne.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("div",null,s.toDisplayString(s.unref(w)),1)],2),s.createVNode(aA,{"selection-mode":"range",date:S.value,"min-date":U.value,"max-date":G.value,"range-state":j.value,"disabled-date":s.unref(M),onChangerange:H,onPick:W,onSelect:$},null,8,["date","min-date","max-date","range-state","disabled-date"])],2),s.createElementVNode("div",{class:s.normalizeClass(s.unref(f).content)},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(d).e("header"))},[ne.unlinkPanels?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",disabled:!s.unref(R),class:s.normalizeClass(s.unref(f).arrowLeftBtn),onClick:s.unref(b)},[s.renderSlot(ne.$slots,"prev-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowLeft))]),_:1})])],10,["disabled","onClick"])):s.createCommentVNode("v-if",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass(s.unref(f).arrowRightBtn),onClick:s.unref(v)},[s.renderSlot(ne.$slots,"next-year",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.createVNode(s.unref(ui.DArrowRight))]),_:1})])],10,["onClick"]),s.createElementVNode("div",null,s.toDisplayString(s.unref(C)),1)],2),s.createVNode(aA,{"selection-mode":"range",date:A.value,"min-date":U.value,"max-date":G.value,"range-state":j.value,"disabled-date":s.unref(M),onChangerange:H,onPick:W,onSelect:$},null,8,["date","min-date","max-date","range-state","disabled-date"])],2)],2)],2)],2))}});var uN=si(cN,[["__file","panel-year-range.vue"]]);const dN=function(N){switch(N){case"daterange":case"datetimerange":return ZO;case"monthrange":return nN;case"yearrange":return uN;default:return YO}};Ir.extend(QR),Ir.extend(SO),Ir.extend(MR),Ir.extend(MO),Ir.extend(IO),Ir.extend(FO),Ir.extend(OO),Ir.extend(LO);var hN=s.defineComponent({name:"ElDatePicker",install:null,props:jO,emits:["update:modelValue"],setup(N,{expose:Q,emit:a,slots:x}){const S=Jr("picker-panel");s.provide("ElPopperOptions",s.reactive(s.toRef(N,"popperOptions"))),s.provide(Ph,{slots:x,pickerNs:S});const A=s.ref();Q({focus:(u=!0)=>{var l;(l=A.value)==null||l.focus(u)},handleOpen:()=>{var u;(u=A.value)==null||u.handleOpen()},handleClose:()=>{var u;(u=A.value)==null||u.handleClose()}});const d=u=>{a("update:modelValue",u)};return()=>{var u;const l=(u=N.format)!=null?u:TR[N.type]||uc,c=dN(N.type);return s.createVNode(RR,s.mergeProps(N,{format:l,type:N.type,ref:A,"onUpdate:modelValue":d}),{default:f=>s.createVNode(c,f,{"prev-month":x["prev-month"],"next-month":x["next-month"],"prev-year":x["prev-year"],"next-year":x["next-year"]}),"range-separator":x["range-separator"]})}}});const fc=Gn(hN),fN=ei({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:po,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:N=>N===null||Ri(N)||["min","max"].includes(N),default:null},name:String,placeholder:String,precision:{type:Number,validator:N=>N>=0&&N===Number.parseInt(`${N}`,10)},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),pN={[Mo]:(N,Q)=>Q!==N,blur:N=>N instanceof FocusEvent,focus:N=>N instanceof FocusEvent,[To]:N=>Ri(N)||ko(N),[Wi]:N=>Ri(N)||ko(N)},mN=s.defineComponent({name:"ElInputNumber"}),AN=s.defineComponent({...mN,props:fN,emits:pN,setup(N,{expose:Q,emit:a}){const x=N,{t:S}=es(),A=Jr("input-number"),h=s.ref(),d=s.reactive({currentValue:x.modelValue,userInput:null}),{formItem:u}=Ao(),l=s.computed(()=>Ri(x.modelValue)&&x.modelValue<=x.min),c=s.computed(()=>Ri(x.modelValue)&&x.modelValue>=x.max),f=s.computed(()=>{const M=w(x.step);return Ts(x.precision)?Math.max(w(x.modelValue),M):(M>x.precision&&Ki("InputNumber","precision should not be less than the decimal places of step"),x.precision)}),p=s.computed(()=>x.controls&&x.controlsPosition==="right"),m=mo(),v=gl(),_=s.computed(()=>{if(d.userInput!==null)return d.userInput;let M=d.currentValue;if(ko(M))return"";if(Ri(M)){if(Number.isNaN(M))return"";Ts(x.precision)||(M=M.toFixed(x.precision))}return M}),b=(M,I)=>{if(Ts(I)&&(I=f.value),I===0)return Math.round(M);let F=String(M);const V=F.indexOf(".");if(V===-1||!F.replace(".","").split("")[V+I])return M;const ee=F.length;return F.charAt(ee-1)==="5"&&(F=`${F.slice(0,Math.max(0,ee-1))}6`),Number.parseFloat(Number(F).toFixed(I))},w=M=>{if(ko(M))return 0;const I=M.toString(),F=I.indexOf(".");let V=0;return F!==-1&&(V=I.length-F-1),V},C=(M,I=1)=>Ri(M)?b(M+x.step*I):d.currentValue,k=()=>{if(x.readonly||v.value||c.value)return;const M=Number(_.value)||0,I=C(M);U(I),a(To,d.currentValue),O()},T=()=>{if(x.readonly||v.value||l.value)return;const M=Number(_.value)||0,I=C(M,-1);U(I),a(To,d.currentValue),O()},R=(M,I)=>{const{max:F,min:V,step:D,precision:X,stepStrictly:ee,valueOnClear:q}=x;F<V&&ch("InputNumber","min should not be greater than max.");let ne=Number(M);if(ko(M)||Number.isNaN(ne))return null;if(M===""){if(q===null)return null;ne=Dn(q)?{min:V,max:F}[q]:q}return ee&&(ne=b(Math.round(ne/D)*D,X)),Ts(X)||(ne=b(ne,X)),(ne>F||ne<V)&&(ne=ne>F?F:V,I&&a(Wi,ne)),ne},U=(M,I=!0)=>{var F;const V=d.currentValue,D=R(M);if(!I){a(Wi,D);return}V===D&&M||(d.userInput=null,a(Wi,D),V!==D&&a(Mo,D,V),x.validateEvent&&((F=u==null?void 0:u.validate)==null||F.call(u,"change").catch(X=>Ki(X))),d.currentValue=D)},G=M=>{d.userInput=M;const I=M===""?null:Number(M);a(To,I),U(I,!1)},j=M=>{const I=M!==""?Number(M):"";(Ri(I)&&!Number.isNaN(I)||M==="")&&U(I),O(),d.userInput=null},H=()=>{var M,I;(I=(M=h.value)==null?void 0:M.focus)==null||I.call(M)},W=()=>{var M,I;(I=(M=h.value)==null?void 0:M.blur)==null||I.call(M)},K=M=>{a("focus",M)},$=M=>{var I;d.userInput=null,a("blur",M),x.validateEvent&&((I=u==null?void 0:u.validate)==null||I.call(u,"blur").catch(F=>Ki(F)))},O=()=>{d.currentValue!==x.modelValue&&(d.currentValue=x.modelValue)},L=M=>{document.activeElement===M.target&&M.preventDefault()};return s.watch(()=>x.modelValue,(M,I)=>{const F=R(M,!0);d.userInput===null&&F!==I&&(d.currentValue=F)},{immediate:!0}),s.onMounted(()=>{var M;const{min:I,max:F,modelValue:V}=x,D=(M=h.value)==null?void 0:M.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(F)?D.setAttribute("aria-valuemax",String(F)):D.removeAttribute("aria-valuemax"),Number.isFinite(I)?D.setAttribute("aria-valuemin",String(I)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",d.currentValue||d.currentValue===0?String(d.currentValue):""),D.setAttribute("aria-disabled",String(v.value)),!Ri(V)&&V!=null){let X=Number(V);Number.isNaN(X)&&(X=null),a(Wi,X)}D.addEventListener("wheel",L,{passive:!1})}),s.onUpdated(()=>{var M,I;const F=(M=h.value)==null?void 0:M.input;F==null||F.setAttribute("aria-valuenow",`${(I=d.currentValue)!=null?I:""}`)}),Q({focus:H,blur:W}),(M,I)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([s.unref(A).b(),s.unref(A).m(s.unref(m)),s.unref(A).is("disabled",s.unref(v)),s.unref(A).is("without-controls",!M.controls),s.unref(A).is("controls-right",s.unref(p))]),onDragstart:s.withModifiers(()=>{},["prevent"])},[M.controls?s.withDirectives((s.openBlock(),s.createElementBlock("span",{key:0,role:"button","aria-label":s.unref(S)("el.inputNumber.decrease"),class:s.normalizeClass([s.unref(A).e("decrease"),s.unref(A).is("disabled",s.unref(l))]),onKeydown:s.withKeys(T,["enter"])},[s.renderSlot(M.$slots,"decrease-icon",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.unref(p)?(s.openBlock(),s.createBlock(s.unref(ui.ArrowDown),{key:0})):(s.openBlock(),s.createBlock(s.unref(ui.Minus),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[s.unref(Bh),T]]):s.createCommentVNode("v-if",!0),M.controls?s.withDirectives((s.openBlock(),s.createElementBlock("span",{key:1,role:"button","aria-label":s.unref(S)("el.inputNumber.increase"),class:s.normalizeClass([s.unref(A).e("increase"),s.unref(A).is("disabled",s.unref(c))]),onKeydown:s.withKeys(k,["enter"])},[s.renderSlot(M.$slots,"increase-icon",{},()=>[s.createVNode(s.unref(ni),null,{default:s.withCtx(()=>[s.unref(p)?(s.openBlock(),s.createBlock(s.unref(ui.ArrowUp),{key:0})):(s.openBlock(),s.createBlock(s.unref(ui.Plus),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[s.unref(Bh),k]]):s.createCommentVNode("v-if",!0),s.createVNode(s.unref(Sn),{id:M.id,ref_key:"input",ref:h,type:"number",step:M.step,"model-value":s.unref(_),placeholder:M.placeholder,readonly:M.readonly,disabled:s.unref(v),size:s.unref(m),max:M.max,min:M.min,name:M.name,"aria-label":M.ariaLabel,"validate-event":!1,onKeydown:[s.withKeys(s.withModifiers(k,["prevent"]),["up"]),s.withKeys(s.withModifiers(T,["prevent"]),["down"])],onBlur:$,onFocus:K,onInput:G,onChange:j},null,8,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var gN=si(AN,[["__file","input-number.vue"]]);const vN=Gn(gN),J1=Symbol("ElSelectGroup"),Mu=Symbol("ElSelect");function yN(N,Q){const a=s.inject(Mu),x=s.inject(J1,{disabled:!1}),S=s.computed(()=>c(Ia(a.props.modelValue),N.value)),A=s.computed(()=>{var m;if(a.props.multiple){const v=Ia((m=a.props.modelValue)!=null?m:[]);return!S.value&&v.length>=a.props.multipleLimit&&a.props.multipleLimit>0}else return!1}),h=s.computed(()=>N.label||(qn(N.value)?"":N.value)),d=s.computed(()=>N.value||N.label||""),u=s.computed(()=>N.disabled||Q.groupDisabled||A.value),l=s.getCurrentInstance(),c=(m=[],v)=>{if(qn(N.value)){const _=a.props.valueKey;return m&&m.some(b=>s.toRaw(ia(b,_))===ia(v,_))}else return m&&m.includes(v)},f=()=>{!N.disabled&&!x.disabled&&(a.states.hoveringIndex=a.optionsArray.indexOf(l.proxy))},p=m=>{const v=new RegExp(H4(m),"i");Q.visible=v.test(h.value)||N.created};return s.watch(()=>h.value,()=>{!N.created&&!a.props.remote&&a.setSelected()}),s.watch(()=>N.value,(m,v)=>{const{remote:_,valueKey:b}=a.props;if(m!==v&&(a.onOptionDestroy(v,l.proxy),a.onOptionCreate(l.proxy)),!N.created&&!_){if(b&&qn(m)&&qn(v)&&m[b]===v[b])return;a.setSelected()}}),s.watch(()=>x.disabled,()=>{Q.groupDisabled=x.disabled},{immediate:!0}),{select:a,currentLabel:h,currentValue:d,itemSelected:S,isDisabled:u,hoverItem:f,updateOption:p}}const bN=s.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(N){const Q=Jr("select"),a=Pu(),x=s.computed(()=>[Q.be("dropdown","item"),Q.is("disabled",s.unref(d)),Q.is("selected",s.unref(h)),Q.is("hovering",s.unref(p))]),S=s.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:A,itemSelected:h,isDisabled:d,select:u,hoverItem:l,updateOption:c}=yN(N,S),{visible:f,hover:p}=s.toRefs(S),m=s.getCurrentInstance().proxy;u.onOptionCreate(m),s.onBeforeUnmount(()=>{const _=m.value,{selected:b}=u.states,C=(u.props.multiple?b:[b]).some(k=>k.value===m.value);s.nextTick(()=>{u.states.cachedOptions.get(_)===m&&!C&&u.states.cachedOptions.delete(_)}),u.onOptionDestroy(_,m)});function v(){d.value||u.handleOptionSelect(m)}return{ns:Q,id:a,containerKls:x,currentLabel:A,itemSelected:h,isDisabled:d,select:u,hoverItem:l,updateOption:c,visible:f,hover:p,selectOptionClick:v,states:S}}});function _N(N,Q,a,x,S,A){return s.withDirectives((s.openBlock(),s.createElementBlock("li",{id:N.id,class:s.normalizeClass(N.containerKls),role:"option","aria-disabled":N.isDisabled||void 0,"aria-selected":N.itemSelected,onMouseenter:N.hoverItem,onClick:s.withModifiers(N.selectOptionClick,["stop"])},[s.renderSlot(N.$slots,"default",{},()=>[s.createElementVNode("span",null,s.toDisplayString(N.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[s.vShow,N.visible]])}var lA=si(bN,[["render",_N],["__file","option.vue"]]);const wN=s.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const N=s.inject(Mu),Q=Jr("select"),a=s.computed(()=>N.props.popperClass),x=s.computed(()=>N.props.multiple),S=s.computed(()=>N.props.fitInputWidth),A=s.ref("");function h(){var d;A.value=`${(d=N.selectRef)==null?void 0:d.offsetWidth}px`}return s.onMounted(()=>{h(),ea(N.selectRef,h)}),{ns:Q,minWidth:A,popperClass:a,isMultiple:x,isFitInputWidth:S}}});function xN(N,Q,a,x,S,A){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([N.ns.b("dropdown"),N.ns.is("multiple",N.isMultiple),N.popperClass]),style:s.normalizeStyle({[N.isFitInputWidth?"width":"minWidth"]:N.minWidth})},[N.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.ns.be("dropdown","header"))},[s.renderSlot(N.$slots,"header")],2)):s.createCommentVNode("v-if",!0),s.renderSlot(N.$slots,"default"),N.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(N.ns.be("dropdown","footer"))},[s.renderSlot(N.$slots,"footer")],2)):s.createCommentVNode("v-if",!0)],6)}var CN=si(wN,[["render",xN],["__file","select-dropdown.vue"]]);const EN=11,BN=(N,Q)=>{const{t:a}=es(),x=Pu(),S=Jr("select"),A=Jr("input"),h=s.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:N.multiple?[]:{},selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),d=s.ref(null),u=s.ref(null),l=s.ref(null),c=s.ref(null),f=s.ref(null),p=s.ref(null),m=s.ref(null),v=s.ref(null),_=s.ref(null),b=s.ref(null),w=s.ref(null),C=s.ref(null),{isComposing:k,handleCompositionStart:T,handleCompositionUpdate:R,handleCompositionEnd:U}=L_({afterComposition:xt=>ct(xt)}),{wrapperRef:G,isFocused:j,handleBlur:H}=N_(f,{afterFocus(){N.automaticDropdown&&!W.value&&(W.value=!0,h.menuVisibleOnFocus=!0)},beforeBlur(xt){var Qt,$t;return((Qt=l.value)==null?void 0:Qt.isFocusInsideContent(xt))||(($t=c.value)==null?void 0:$t.isFocusInsideContent(xt))},afterBlur(){W.value=!1,h.menuVisibleOnFocus=!1}}),W=s.ref(!1),K=s.ref(),{form:$,formItem:O}=Ao(),{inputId:L}=vl(N,{formItemContext:O}),{valueOnClear:M,isEmptyValue:I}=V_(N),F=s.computed(()=>N.disabled||($==null?void 0:$.disabled)),V=s.computed(()=>bi(N.modelValue)?N.modelValue.length>0:!I(N.modelValue)),D=s.computed(()=>N.clearable&&!F.value&&h.inputHovering&&V.value),X=s.computed(()=>N.remote&&N.filterable&&!N.remoteShowSuffix?"":N.suffixIcon),ee=s.computed(()=>S.is("reverse",X.value&&W.value)),q=s.computed(()=>(O==null?void 0:O.validateState)||""),ne=s.computed(()=>s_[q.value]),oe=s.computed(()=>N.remote?300:0),he=s.computed(()=>N.loading?N.loadingText||a("el.select.loading"):N.remote&&!h.inputValue&&h.options.size===0?!1:N.filterable&&h.inputValue&&h.options.size>0&&te.value===0?N.noMatchText||a("el.select.noMatch"):h.options.size===0?N.noDataText||a("el.select.noData"):null),te=s.computed(()=>de.value.filter(xt=>xt.visible).length),de=s.computed(()=>{const xt=Array.from(h.options.values()),Qt=[];return h.optionValues.forEach($t=>{const nr=xt.findIndex(Er=>Er.value===$t);nr>-1&&Qt.push(xt[nr])}),Qt.length>=xt.length?Qt:xt}),se=s.computed(()=>Array.from(h.cachedOptions.values())),re=s.computed(()=>{const xt=de.value.filter(Qt=>!Qt.created).some(Qt=>Qt.currentLabel===h.inputValue);return N.filterable&&N.allowCreate&&h.inputValue!==""&&!xt}),ae=()=>{N.filterable&&mn(N.filterMethod)||N.filterable&&N.remote&&mn(N.remoteMethod)||de.value.forEach(xt=>{var Qt;(Qt=xt.updateOption)==null||Qt.call(xt,h.inputValue)})},Ce=mo(),me=s.computed(()=>["small"].includes(Ce.value)?"small":"default"),ce=s.computed({get(){return W.value&&he.value!==!1},set(xt){W.value=xt}}),pe=s.computed(()=>{if(N.multiple&&!Ts(N.modelValue))return Ia(N.modelValue).length===0&&!h.inputValue;const xt=bi(N.modelValue)?N.modelValue[0]:N.modelValue;return N.filterable||Ts(xt)?!h.inputValue:!0}),B=s.computed(()=>{var xt;const Qt=(xt=N.placeholder)!=null?xt:a("el.select.placeholder");return N.multiple||!V.value?Qt:h.selectedLabel}),ke=s.computed(()=>em?null:"mouseenter");s.watch(()=>N.modelValue,(xt,Qt)=>{N.multiple&&N.filterable&&!N.reserveKeyword&&(h.inputValue="",Ee("")),Ae(),!vu(xt,Qt)&&N.validateEvent&&(O==null||O.validate("change").catch($t=>Ki($t)))},{flush:"post",deep:!0}),s.watch(()=>W.value,xt=>{xt?Ee(h.inputValue):(h.inputValue="",h.previousQuery=null,h.isBeforeHide=!0),Q("visible-change",xt)}),s.watch(()=>h.options.entries(),()=>{var xt;if(!Ln)return;const Qt=((xt=d.value)==null?void 0:xt.querySelectorAll("input"))||[];(!N.filterable&&!N.defaultFirstOption&&!Ts(N.modelValue)||!Array.from(Qt).includes(document.activeElement))&&Ae(),N.defaultFirstOption&&(N.filterable||N.remote)&&te.value&&ge()},{flush:"post"}),s.watch(()=>h.hoveringIndex,xt=>{Ri(xt)&&xt>-1?K.value=de.value[xt]||{}:K.value={},de.value.forEach(Qt=>{Qt.hover=K.value===Qt})}),s.watchEffect(()=>{h.isBeforeHide||ae()});const Ee=xt=>{h.previousQuery===xt||k.value||(h.previousQuery=xt,N.filterable&&mn(N.filterMethod)?N.filterMethod(xt):N.filterable&&N.remote&&mn(N.remoteMethod)&&N.remoteMethod(xt),N.defaultFirstOption&&(N.filterable||N.remote)&&te.value?s.nextTick(ge):s.nextTick(ue))},ge=()=>{const xt=de.value.filter(nr=>nr.visible&&!nr.disabled&&!nr.states.groupDisabled),Qt=xt.find(nr=>nr.created),$t=xt[0];h.hoveringIndex=Ke(de.value,Qt||$t)},Ae=()=>{if(N.multiple)h.selectedLabel="";else{const Qt=bi(N.modelValue)?N.modelValue[0]:N.modelValue,$t=fe(Qt);h.selectedLabel=$t.currentLabel,h.selected=$t;return}const xt=[];Ts(N.modelValue)||Ia(N.modelValue).forEach(Qt=>{xt.push(fe(Qt))}),h.selected=xt},fe=xt=>{let Qt;const $t=tm(xt).toLowerCase()==="object",nr=tm(xt).toLowerCase()==="null",Er=tm(xt).toLowerCase()==="undefined";for(let Ue=h.cachedOptions.size-1;Ue>=0;Ue--){const Ge=se.value[Ue];if($t?ia(Ge.value,N.valueKey)===ia(xt,N.valueKey):Ge.value===xt){Qt={value:xt,currentLabel:Ge.currentLabel,get isDisabled(){return Ge.isDisabled}};break}}if(Qt)return Qt;const Ie=$t?xt.label:!nr&&!Er?xt:"";return{value:xt,currentLabel:Ie}},ue=()=>{N.multiple?h.hoveringIndex=de.value.findIndex(xt=>h.selected.some(Qt=>rr(Qt)===rr(xt))):h.hoveringIndex=de.value.findIndex(xt=>rr(xt)===rr(h.selected))},_e=()=>{h.selectionWidth=u.value.getBoundingClientRect().width},be=()=>{h.calculatorWidth=p.value.getBoundingClientRect().width},De=()=>{h.collapseItemWidth=w.value.getBoundingClientRect().width},Je=()=>{var xt,Qt;(Qt=(xt=l.value)==null?void 0:xt.updatePopper)==null||Qt.call(xt)},Qe=()=>{var xt,Qt;(Qt=(xt=c.value)==null?void 0:xt.updatePopper)==null||Qt.call(xt)},ot=()=>{h.inputValue.length>0&&!W.value&&(W.value=!0),Ee(h.inputValue)},ct=xt=>{if(h.inputValue=xt.target.value,N.remote)ht();else return ot()},ht=ah(()=>{ot()},oe.value),it=xt=>{vu(N.modelValue,xt)||Q(Mo,xt)},Ze=xt=>O4(xt,Qt=>!h.disabledOptions.has(Qt)),Xe=xt=>{if(N.multiple&&xt.code!==Ii.delete&&xt.target.value.length<=0){const Qt=Ia(N.modelValue).slice(),$t=Ze(Qt);if($t<0)return;const nr=Qt[$t];Qt.splice($t,1),Q(Wi,Qt),it(Qt),Q("remove-tag",nr)}},dt=(xt,Qt)=>{const $t=h.selected.indexOf(Qt);if($t>-1&&!F.value){const nr=Ia(N.modelValue).slice();nr.splice($t,1),Q(Wi,nr),it(nr),Q("remove-tag",Qt.value)}xt.stopPropagation(),Rt()},at=xt=>{xt.stopPropagation();const Qt=N.multiple?[]:M.value;if(N.multiple)for(const $t of h.selected)$t.isDisabled&&Qt.push($t.value);Q(Wi,Qt),it(Qt),h.hoveringIndex=-1,W.value=!1,Q("clear"),Rt()},ze=xt=>{var Qt;if(N.multiple){const $t=Ia((Qt=N.modelValue)!=null?Qt:[]).slice(),nr=Ke($t,xt.value);nr>-1?$t.splice(nr,1):(N.multipleLimit<=0||$t.length<N.multipleLimit)&&$t.push(xt.value),Q(Wi,$t),it($t),xt.created&&Ee(""),N.filterable&&!N.reserveKeyword&&(h.inputValue="")}else Q(Wi,xt.value),it(xt.value),W.value=!1;Rt(),!W.value&&s.nextTick(()=>{ut(xt)})},Ke=(xt=[],Qt)=>{if(!qn(Qt))return xt.indexOf(Qt);const $t=N.valueKey;let nr=-1;return xt.some((Er,Ie)=>s.toRaw(ia(Er,$t))===ia(Qt,$t)?(nr=Ie,!0):!1),nr},ut=xt=>{var Qt,$t,nr,Er,Ie;const Le=bi(xt)?xt[0]:xt;let Ue=null;if(Le!=null&&Le.value){const Ge=de.value.filter(Ye=>Ye.value===Le.value);Ge.length>0&&(Ue=Ge[0].$el)}if(l.value&&Ue){const Ge=(Er=(nr=($t=(Qt=l.value)==null?void 0:Qt.popperRef)==null?void 0:$t.contentRef)==null?void 0:nr.querySelector)==null?void 0:Er.call(nr,`.${S.be("dropdown","wrap")}`);Ge&&W4(Ge,Ue)}(Ie=C.value)==null||Ie.handleScroll()},yt=xt=>{h.options.set(xt.value,xt),h.cachedOptions.set(xt.value,xt),xt.disabled&&h.disabledOptions.set(xt.value,xt)},Ne=(xt,Qt)=>{h.options.get(xt)===Qt&&h.options.delete(xt)},tt=s.computed(()=>{var xt,Qt;return(Qt=(xt=l.value)==null?void 0:xt.popperRef)==null?void 0:Qt.contentRef}),Pt=()=>{h.isBeforeHide=!1,s.nextTick(()=>ut(h.selected))},Rt=()=>{var xt;(xt=f.value)==null||xt.focus()},Ht=()=>{tr()},zt=xt=>{at(xt)},tr=xt=>{if(W.value=!1,j.value){const Qt=new FocusEvent("focus",xt);s.nextTick(()=>H(Qt))}},qt=()=>{h.inputValue.length>0?h.inputValue="":W.value=!1},er=()=>{F.value||(em&&(h.inputHovering=!0),h.menuVisibleOnFocus?h.menuVisibleOnFocus=!1:W.value=!W.value)},Dt=()=>{W.value?de.value[h.hoveringIndex]&&ze(de.value[h.hoveringIndex]):er()},rr=xt=>qn(xt.value)?ia(xt.value,N.valueKey):xt.value,_r=s.computed(()=>de.value.filter(xt=>xt.visible).every(xt=>xt.disabled)),pr=s.computed(()=>N.multiple?N.collapseTags?h.selected.slice(0,N.maxCollapseTags):h.selected:[]),xr=s.computed(()=>N.multiple?N.collapseTags?h.selected.slice(N.maxCollapseTags):[]:[]),Ct=xt=>{if(!W.value){W.value=!0;return}if(!(h.options.size===0||h.filteredOptionsCount===0||k.value)&&!_r.value){xt==="next"?(h.hoveringIndex++,h.hoveringIndex===h.options.size&&(h.hoveringIndex=0)):xt==="prev"&&(h.hoveringIndex--,h.hoveringIndex<0&&(h.hoveringIndex=h.options.size-1));const Qt=de.value[h.hoveringIndex];(Qt.disabled===!0||Qt.states.groupDisabled===!0||!Qt.visible)&&Ct(xt),s.nextTick(()=>ut(K.value))}},Et=()=>{if(!u.value)return 0;const xt=window.getComputedStyle(u.value);return Number.parseFloat(xt.gap||"6px")},Lt=s.computed(()=>{const xt=Et();return{maxWidth:`${w.value&&N.maxCollapseTags===1?h.selectionWidth-h.collapseItemWidth-xt:h.selectionWidth}px`}}),Kt=s.computed(()=>({maxWidth:`${h.selectionWidth}px`})),Ar=s.computed(()=>({width:`${Math.max(h.calculatorWidth,EN)}px`}));return ea(u,_e),ea(p,be),ea(_,Je),ea(G,Je),ea(b,Qe),ea(w,De),s.onMounted(()=>{Ae()}),{inputId:L,contentId:x,nsSelect:S,nsInput:A,states:h,isFocused:j,expanded:W,optionsArray:de,hoverOption:K,selectSize:Ce,filteredOptionsCount:te,resetCalculatorWidth:be,updateTooltip:Je,updateTagTooltip:Qe,debouncedOnInputChange:ht,onInput:ct,deletePrevTag:Xe,deleteTag:dt,deleteSelected:at,handleOptionSelect:ze,scrollToOption:ut,hasModelValue:V,shouldShowPlaceholder:pe,currentPlaceholder:B,mouseEnterEventName:ke,showClose:D,iconComponent:X,iconReverse:ee,validateState:q,validateIcon:ne,showNewOption:re,updateOptions:ae,collapseTagSize:me,setSelected:Ae,selectDisabled:F,emptyText:he,handleCompositionStart:T,handleCompositionUpdate:R,handleCompositionEnd:U,onOptionCreate:yt,onOptionDestroy:Ne,handleMenuEnter:Pt,focus:Rt,blur:Ht,handleClearClick:zt,handleClickOutside:tr,handleEsc:qt,toggleMenu:er,selectOption:Dt,getValueKey:rr,navigateOptions:Ct,dropdownMenuVisible:ce,showTagList:pr,collapseTagList:xr,tagStyle:Lt,collapseTagStyle:Kt,inputStyle:Ar,popperRef:tt,inputRef:f,tooltipRef:l,tagTooltipRef:c,calculatorRef:p,prefixRef:m,suffixRef:v,selectRef:d,wrapperRef:G,selectionRef:u,scrollbarRef:C,menuRef:_,tagMenuRef:b,collapseItemRef:w}};var PN=s.defineComponent({name:"ElOptions",setup(N,{slots:Q}){const a=s.inject(Mu);let x=[];return()=>{var S,A;const h=(S=Q.default)==null?void 0:S.call(Q),d=[];function u(l){bi(l)&&l.forEach(c=>{var f,p,m,v;const _=(f=(c==null?void 0:c.type)||{})==null?void 0:f.name;_==="ElOptionGroup"?u(!Dn(c.children)&&!bi(c.children)&&mn((p=c.children)==null?void 0:p.default)?(m=c.children)==null?void 0:m.default():c.children):_==="ElOption"?d.push((v=c.props)==null?void 0:v.value):bi(c.children)&&u(c.children)})}return h.length&&u((A=h[0])==null?void 0:A.children),vu(d,x)||(x=d,a&&(a.states.optionValues=d)),h}}});const SN=ei({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:po,effect:{type:Pr(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Pr(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:Um.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ho,default:ui.CircleClose},fitInputWidth:Boolean,suffixIcon:{type:ho,default:ui.ArrowDown},tagType:{...Zm.type,default:"info"},tagEffect:{...Zm.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Pr(String),values:rc,default:"bottom-start"},fallbackPlacements:{type:Pr(Array),default:["bottom-start","top-start","right","left"]},...j_,...Ys(["ariaLabel"])}),Z1="ElSelect",kN=s.defineComponent({name:Z1,componentName:Z1,components:{ElSelectMenu:CN,ElOption:lA,ElOptions:PN,ElTag:wO,ElScrollbar:yn,ElTooltip:ku,ElIcon:ni},directives:{ClickOutside:Eh},props:SN,emits:[Wi,Mo,"remove-tag","clear","visible-change","focus","blur"],setup(N,{emit:Q}){const a=BN(N,Q);return s.provide(Mu,s.reactive({props:N,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a}}});function MN(N,Q,a,x,S,A){const h=s.resolveComponent("el-tag"),d=s.resolveComponent("el-tooltip"),u=s.resolveComponent("el-icon"),l=s.resolveComponent("el-option"),c=s.resolveComponent("el-options"),f=s.resolveComponent("el-scrollbar"),p=s.resolveComponent("el-select-menu"),m=s.resolveDirective("click-outside");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"selectRef",class:s.normalizeClass([N.nsSelect.b(),N.nsSelect.m(N.selectSize)]),[s.toHandlerKey(N.mouseEnterEventName)]:v=>N.states.inputHovering=!0,onMouseleave:v=>N.states.inputHovering=!1},[s.createVNode(d,{ref:"tooltipRef",visible:N.dropdownMenuVisible,placement:N.placement,teleported:N.teleported,"popper-class":[N.nsSelect.e("popper"),N.popperClass],"popper-options":N.popperOptions,"fallback-placements":N.fallbackPlacements,effect:N.effect,pure:"",trigger:"click",transition:`${N.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:N.persistent,onBeforeShow:N.handleMenuEnter,onHide:v=>N.states.isBeforeHide=!1},{default:s.withCtx(()=>{var v;return[s.createElementVNode("div",{ref:"wrapperRef",class:s.normalizeClass([N.nsSelect.e("wrapper"),N.nsSelect.is("focused",N.isFocused),N.nsSelect.is("hovering",N.states.inputHovering),N.nsSelect.is("filterable",N.filterable),N.nsSelect.is("disabled",N.selectDisabled)]),onClick:s.withModifiers(N.toggleMenu,["prevent","stop"])},[N.$slots.prefix?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"prefixRef",class:s.normalizeClass(N.nsSelect.e("prefix"))},[s.renderSlot(N.$slots,"prefix")],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{ref:"selectionRef",class:s.normalizeClass([N.nsSelect.e("selection"),N.nsSelect.is("near",N.multiple&&!N.$slots.prefix&&!!N.states.selected.length)])},[N.multiple?s.renderSlot(N.$slots,"tag",{key:0},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.showTagList,_=>(s.openBlock(),s.createElementBlock("div",{key:N.getValueKey(_),class:s.normalizeClass(N.nsSelect.e("selected-item"))},[s.createVNode(h,{closable:!N.selectDisabled&&!_.isDisabled,size:N.collapseTagSize,type:N.tagType,effect:N.tagEffect,"disable-transitions":"",style:s.normalizeStyle(N.tagStyle),onClose:b=>N.deleteTag(b,_)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(N.nsSelect.e("tags-text"))},[s.renderSlot(N.$slots,"label",{label:_.currentLabel,value:_.value},()=>[s.createTextVNode(s.toDisplayString(_.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),N.collapseTags&&N.states.selected.length>N.maxCollapseTags?(s.openBlock(),s.createBlock(d,{key:0,ref:"tagTooltipRef",disabled:N.dropdownMenuVisible||!N.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:N.effect,placement:"bottom",teleported:N.teleported},{default:s.withCtx(()=>[s.createElementVNode("div",{ref:"collapseItemRef",class:s.normalizeClass(N.nsSelect.e("selected-item"))},[s.createVNode(h,{closable:!1,size:N.collapseTagSize,type:N.tagType,effect:N.tagEffect,"disable-transitions":"",style:s.normalizeStyle(N.collapseTagStyle)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(N.nsSelect.e("tags-text"))}," + "+s.toDisplayString(N.states.selected.length-N.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:s.withCtx(()=>[s.createElementVNode("div",{ref:"tagMenuRef",class:s.normalizeClass(N.nsSelect.e("selection"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.collapseTagList,_=>(s.openBlock(),s.createElementBlock("div",{key:N.getValueKey(_),class:s.normalizeClass(N.nsSelect.e("selected-item"))},[s.createVNode(h,{class:"in-tooltip",closable:!N.selectDisabled&&!_.isDisabled,size:N.collapseTagSize,type:N.tagType,effect:N.tagEffect,"disable-transitions":"",onClose:b=>N.deleteTag(b,_)},{default:s.withCtx(()=>[s.createElementVNode("span",{class:s.normalizeClass(N.nsSelect.e("tags-text"))},[s.renderSlot(N.$slots,"label",{label:_.currentLabel,value:_.value},()=>[s.createTextVNode(s.toDisplayString(_.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):s.createCommentVNode("v-if",!0)]):s.createCommentVNode("v-if",!0),N.selectDisabled?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass([N.nsSelect.e("selected-item"),N.nsSelect.e("input-wrapper"),N.nsSelect.is("hidden",!N.filterable)])},[s.withDirectives(s.createElementVNode("input",{id:N.inputId,ref:"inputRef","onUpdate:modelValue":_=>N.states.inputValue=_,type:"text",name:N.name,class:s.normalizeClass([N.nsSelect.e("input"),N.nsSelect.is(N.selectSize)]),disabled:N.selectDisabled,autocomplete:N.autocomplete,style:s.normalizeStyle(N.inputStyle),role:"combobox",readonly:!N.filterable,spellcheck:"false","aria-activedescendant":((v=N.hoverOption)==null?void 0:v.id)||"","aria-controls":N.contentId,"aria-expanded":N.dropdownMenuVisible,"aria-label":N.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[s.withKeys(s.withModifiers(_=>N.navigateOptions("next"),["stop","prevent"]),["down"]),s.withKeys(s.withModifiers(_=>N.navigateOptions("prev"),["stop","prevent"]),["up"]),s.withKeys(s.withModifiers(N.handleEsc,["stop","prevent"]),["esc"]),s.withKeys(s.withModifiers(N.selectOption,["stop","prevent"]),["enter"]),s.withKeys(s.withModifiers(N.deletePrevTag,["stop"]),["delete"])],onCompositionstart:N.handleCompositionStart,onCompositionupdate:N.handleCompositionUpdate,onCompositionend:N.handleCompositionEnd,onInput:N.onInput,onClick:s.withModifiers(N.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[s.vModelText,N.states.inputValue]]),N.filterable?(s.openBlock(),s.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:s.normalizeClass(N.nsSelect.e("input-calculator")),textContent:s.toDisplayString(N.states.inputValue)},null,10,["textContent"])):s.createCommentVNode("v-if",!0)],2)),N.shouldShowPlaceholder?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass([N.nsSelect.e("selected-item"),N.nsSelect.e("placeholder"),N.nsSelect.is("transparent",!N.hasModelValue||N.expanded&&!N.states.inputValue)])},[N.hasModelValue?s.renderSlot(N.$slots,"label",{key:0,label:N.currentPlaceholder,value:N.modelValue},()=>[s.createElementVNode("span",null,s.toDisplayString(N.currentPlaceholder),1)]):(s.openBlock(),s.createElementBlock("span",{key:1},s.toDisplayString(N.currentPlaceholder),1))],2)):s.createCommentVNode("v-if",!0)],2),s.createElementVNode("div",{ref:"suffixRef",class:s.normalizeClass(N.nsSelect.e("suffix"))},[N.iconComponent&&!N.showClose?(s.openBlock(),s.createBlock(u,{key:0,class:s.normalizeClass([N.nsSelect.e("caret"),N.nsSelect.e("icon"),N.iconReverse])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.iconComponent)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),N.showClose&&N.clearIcon?(s.openBlock(),s.createBlock(u,{key:1,class:s.normalizeClass([N.nsSelect.e("caret"),N.nsSelect.e("icon")]),onClick:N.handleClearClick},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.clearIcon)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),N.validateState&&N.validateIcon?(s.openBlock(),s.createBlock(u,{key:2,class:s.normalizeClass([N.nsInput.e("icon"),N.nsInput.e("validateIcon")])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.validateIcon)))]),_:1},8,["class"])):s.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:s.withCtx(()=>[s.createVNode(p,{ref:"menuRef"},{default:s.withCtx(()=>[N.$slots.header?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.nsSelect.be("dropdown","header")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(N.$slots,"header")],10,["onClick"])):s.createCommentVNode("v-if",!0),s.withDirectives(s.createVNode(f,{id:N.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":N.nsSelect.be("dropdown","wrap"),"view-class":N.nsSelect.be("dropdown","list"),class:s.normalizeClass([N.nsSelect.is("empty",N.filteredOptionsCount===0)]),role:"listbox","aria-label":N.ariaLabel,"aria-orientation":"vertical"},{default:s.withCtx(()=>[N.showNewOption?(s.openBlock(),s.createBlock(l,{key:0,value:N.states.inputValue,created:!0},null,8,["value"])):s.createCommentVNode("v-if",!0),s.createVNode(c,null,{default:s.withCtx(()=>[s.renderSlot(N.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[s.vShow,N.states.options.size>0&&!N.loading]]),N.$slots.loading&&N.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(N.nsSelect.be("dropdown","loading"))},[s.renderSlot(N.$slots,"loading")],2)):N.loading||N.filteredOptionsCount===0?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(N.nsSelect.be("dropdown","empty"))},[s.renderSlot(N.$slots,"empty",{},()=>[s.createElementVNode("span",null,s.toDisplayString(N.emptyText),1)])],2)):s.createCommentVNode("v-if",!0),N.$slots.footer?(s.openBlock(),s.createElementBlock("div",{key:3,class:s.normalizeClass(N.nsSelect.be("dropdown","footer")),onClick:s.withModifiers(()=>{},["stop"])},[s.renderSlot(N.$slots,"footer")],10,["onClick"])):s.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","onBeforeShow","onHide"])],16,["onMouseleave"])),[[m,N.handleClickOutside,N.popperRef]])}var TN=si(kN,[["render",MN],["__file","select.vue"]]);const IN=s.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(N){const Q=Jr("select"),a=s.ref(null),x=s.getCurrentInstance(),S=s.ref([]);s.provide(J1,s.reactive({...s.toRefs(N)}));const A=s.computed(()=>S.value.some(l=>l.visible===!0)),h=l=>{var c,f;return((c=l.type)==null?void 0:c.name)==="ElOption"&&!!((f=l.component)!=null&&f.proxy)},d=l=>{const c=Ia(l),f=[];return c.forEach(p=>{var m,v;h(p)?f.push(p.component.proxy):(m=p.children)!=null&&m.length?f.push(...d(p.children)):(v=p.component)!=null&&v.subTree&&f.push(...d(p.component.subTree))}),f},u=()=>{S.value=d(x.subTree)};return s.onMounted(()=>{u()}),Uk(a,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:a,visible:A,ns:Q}}});function DN(N,Q,a,x,S,A){return s.withDirectives((s.openBlock(),s.createElementBlock("ul",{ref:"groupRef",class:s.normalizeClass(N.ns.be("group","wrap"))},[s.createElementVNode("li",{class:s.normalizeClass(N.ns.be("group","title"))},s.toDisplayString(N.label),3),s.createElementVNode("li",null,[s.createElementVNode("ul",{class:s.normalizeClass(N.ns.b("group"))},[s.renderSlot(N.$slots,"default")],2)])],2)),[[s.vShow,N.visible]])}var q1=si(IN,[["render",DN],["__file","option-group.vue"]]);const Tu=Gn(TN,{Option:lA,OptionGroup:q1}),Iu=pl(lA);pl(q1);const ew=Symbol("sliderContextKey"),FN=ei({modelValue:{type:Pr([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:po,inputSize:po,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Pr(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Pr(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:rc,default:"top"},marks:{type:Pr(Object)},validateEvent:{type:Boolean,default:!0},...Ys(["ariaLabel"])}),cA=N=>Ri(N)||bi(N)&&N.every(Ri),RN={[Wi]:cA,[To]:cA,[Mo]:cA},ON=(N,Q,a)=>{const x=s.ref();return s.onMounted(async()=>{N.range?(Array.isArray(N.modelValue)?(Q.firstValue=Math.max(N.min,N.modelValue[0]),Q.secondValue=Math.min(N.max,N.modelValue[1])):(Q.firstValue=N.min,Q.secondValue=N.max),Q.oldValue=[Q.firstValue,Q.secondValue]):(typeof N.modelValue!="number"||Number.isNaN(N.modelValue)?Q.firstValue=N.min:Q.firstValue=Math.min(N.max,Math.max(N.min,N.modelValue)),Q.oldValue=Q.firstValue),Zn(window,"resize",a),await s.nextTick(),a()}),{sliderWrapper:x}},NN=N=>s.computed(()=>N.marks?Object.keys(N.marks).map(Number.parseFloat).sort((a,x)=>a-x).filter(a=>a<=N.max&&a>=N.min).map(a=>({point:a,position:(a-N.min)*100/(N.max-N.min),mark:N.marks[a]})):[]),LN=(N,Q,a)=>{const{form:x,formItem:S}=Ao(),A=s.shallowRef(),h=s.ref(),d=s.ref(),u={firstButton:h,secondButton:d},l=s.computed(()=>N.disabled||(x==null?void 0:x.disabled)||!1),c=s.computed(()=>Math.min(Q.firstValue,Q.secondValue)),f=s.computed(()=>Math.max(Q.firstValue,Q.secondValue)),p=s.computed(()=>N.range?`${100*(f.value-c.value)/(N.max-N.min)}%`:`${100*(Q.firstValue-N.min)/(N.max-N.min)}%`),m=s.computed(()=>N.range?`${100*(c.value-N.min)/(N.max-N.min)}%`:"0%"),v=s.computed(()=>N.vertical?{height:N.height}:{}),_=s.computed(()=>N.vertical?{height:p.value,bottom:m.value}:{width:p.value,left:m.value}),b=()=>{A.value&&(Q.sliderSize=A.value[`client${N.vertical?"Height":"Width"}`])},w=$=>{const O=N.min+$*(N.max-N.min)/100;if(!N.range)return h;let L;return Math.abs(c.value-O)<Math.abs(f.value-O)?L=Q.firstValue<Q.secondValue?"firstButton":"secondButton":L=Q.firstValue>Q.secondValue?"firstButton":"secondButton",u[L]},C=$=>{const O=w($);return O.value.setPosition($),O},k=$=>{Q.firstValue=$??N.min,R(N.range?[c.value,f.value]:$??N.min)},T=$=>{Q.secondValue=$,N.range&&R([c.value,f.value])},R=$=>{a(Wi,$),a(To,$)},U=async()=>{await s.nextTick(),a(Mo,N.range?[c.value,f.value]:N.modelValue)},G=$=>{var O,L,M,I,F,V;if(l.value||Q.dragging)return;b();let D=0;if(N.vertical){const X=(M=(L=(O=$.touches)==null?void 0:O.item(0))==null?void 0:L.clientY)!=null?M:$.clientY;D=(A.value.getBoundingClientRect().bottom-X)/Q.sliderSize*100}else{const X=(V=(F=(I=$.touches)==null?void 0:I.item(0))==null?void 0:F.clientX)!=null?V:$.clientX,ee=A.value.getBoundingClientRect().left;D=(X-ee)/Q.sliderSize*100}if(!(D<0||D>100))return C(D)};return{elFormItem:S,slider:A,firstButton:h,secondButton:d,sliderDisabled:l,minValue:c,maxValue:f,runwayStyle:v,barStyle:_,resetSize:b,setPosition:C,emitChange:U,onSliderWrapperPrevent:$=>{var O,L;((O=u.firstButton.value)!=null&&O.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&$.preventDefault()},onSliderClick:$=>{G($)&&U()},onSliderDown:async $=>{const O=G($);O&&(await s.nextTick(),O.value.onButtonDown($))},onSliderMarkerDown:$=>{l.value||Q.dragging||C($)},setFirstValue:k,setSecondValue:T}},{left:jN,down:VN,right:UN,up:HN,home:zN,end:GN,pageUp:QN,pageDown:WN}=Ii,$N=(N,Q,a)=>{const x=s.ref(),S=s.ref(!1),A=s.computed(()=>Q.value instanceof Function),h=s.computed(()=>A.value&&Q.value(N.modelValue)||N.modelValue),d=ah(()=>{a.value&&(S.value=!0)},50),u=ah(()=>{a.value&&(S.value=!1)},50);return{tooltip:x,tooltipVisible:S,formatValue:h,displayTooltip:d,hideTooltip:u}},KN=(N,Q,a)=>{const{disabled:x,min:S,max:A,step:h,showTooltip:d,precision:u,sliderSize:l,formatTooltip:c,emitChange:f,resetSize:p,updateDragging:m}=s.inject(ew),{tooltip:v,tooltipVisible:_,formatValue:b,displayTooltip:w,hideTooltip:C}=$N(N,c,d),k=s.ref(),T=s.computed(()=>`${(N.modelValue-S.value)/(A.value-S.value)*100}%`),R=s.computed(()=>N.vertical?{bottom:T.value}:{left:T.value}),U=()=>{Q.hovering=!0,w()},G=()=>{Q.hovering=!1,Q.dragging||C()},j=q=>{x.value||(q.preventDefault(),V(q),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",X),window.addEventListener("touchend",X),window.addEventListener("contextmenu",X),k.value.focus())},H=q=>{x.value||(Q.newPosition=Number.parseFloat(T.value)+q/(A.value-S.value)*100,ee(Q.newPosition),f())},W=()=>{H(-h.value)},K=()=>{H(h.value)},$=()=>{H(-h.value*4)},O=()=>{H(h.value*4)},L=()=>{x.value||(ee(0),f())},M=()=>{x.value||(ee(100),f())},I=q=>{let ne=!0;[jN,VN].includes(q.key)?W():[UN,HN].includes(q.key)?K():q.key===zN?L():q.key===GN?M():q.key===WN?$():q.key===QN?O():ne=!1,ne&&q.preventDefault()},F=q=>{let ne,oe;return q.type.startsWith("touch")?(oe=q.touches[0].clientY,ne=q.touches[0].clientX):(oe=q.clientY,ne=q.clientX),{clientX:ne,clientY:oe}},V=q=>{Q.dragging=!0,Q.isClick=!0;const{clientX:ne,clientY:oe}=F(q);N.vertical?Q.startY=oe:Q.startX=ne,Q.startPosition=Number.parseFloat(T.value),Q.newPosition=Q.startPosition},D=q=>{if(Q.dragging){Q.isClick=!1,w(),p();let ne;const{clientX:oe,clientY:he}=F(q);N.vertical?(Q.currentY=he,ne=(Q.startY-Q.currentY)/l.value*100):(Q.currentX=oe,ne=(Q.currentX-Q.startX)/l.value*100),Q.newPosition=Q.startPosition+ne,ee(Q.newPosition)}},X=()=>{Q.dragging&&(setTimeout(()=>{Q.dragging=!1,Q.hovering||C(),Q.isClick||ee(Q.newPosition),f()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",X),window.removeEventListener("touchend",X),window.removeEventListener("contextmenu",X))},ee=async q=>{if(q===null||Number.isNaN(+q))return;q<0?q=0:q>100&&(q=100);const ne=100/((A.value-S.value)/h.value);let he=Math.round(q/ne)*ne*(A.value-S.value)*.01+S.value;he=Number.parseFloat(he.toFixed(u.value)),he!==N.modelValue&&a(Wi,he),!Q.dragging&&N.modelValue!==Q.oldValue&&(Q.oldValue=N.modelValue),await s.nextTick(),Q.dragging&&w(),v.value.updatePopper()};return s.watch(()=>Q.dragging,q=>{m(q)}),Zn(k,"touchstart",j,{passive:!1}),{disabled:x,button:k,tooltip:v,tooltipVisible:_,showTooltip:d,wrapperStyle:R,formatValue:b,handleMouseEnter:U,handleMouseLeave:G,onButtonDown:j,onKeyDown:I,setPosition:ee}},XN=(N,Q,a,x)=>({stops:s.computed(()=>{if(!N.showStops||N.min>N.max)return[];if(N.step===0)return Ki("ElSlider","step should not be 0."),[];const h=(N.max-N.min)/N.step,d=100*N.step/(N.max-N.min),u=Array.from({length:h-1}).map((l,c)=>(c+1)*d);return N.range?u.filter(l=>l<100*(a.value-N.min)/(N.max-N.min)||l>100*(x.value-N.min)/(N.max-N.min)):u.filter(l=>l>100*(Q.firstValue-N.min)/(N.max-N.min))}),getStopStyle:h=>N.vertical?{bottom:`${h}%`}:{left:`${h}%`}}),YN=(N,Q,a,x,S,A)=>{const h=l=>{S(Wi,l),S(To,l)},d=()=>N.range?![a.value,x.value].every((l,c)=>l===Q.oldValue[c]):N.modelValue!==Q.oldValue,u=()=>{var l,c;N.min>N.max&&ch("Slider","min should not be greater than max.");const f=N.modelValue;N.range&&Array.isArray(f)?f[1]<N.min?h([N.min,N.min]):f[0]>N.max?h([N.max,N.max]):f[0]<N.min?h([N.min,f[1]]):f[1]>N.max?h([f[0],N.max]):(Q.firstValue=f[0],Q.secondValue=f[1],d()&&(N.validateEvent&&((l=A==null?void 0:A.validate)==null||l.call(A,"change").catch(p=>Ki(p))),Q.oldValue=f.slice())):!N.range&&typeof f=="number"&&!Number.isNaN(f)&&(f<N.min?h(N.min):f>N.max?h(N.max):(Q.firstValue=f,d()&&(N.validateEvent&&((c=A==null?void 0:A.validate)==null||c.call(A,"change").catch(p=>Ki(p))),Q.oldValue=f)))};u(),s.watch(()=>Q.dragging,l=>{l||u()}),s.watch(()=>N.modelValue,(l,c)=>{Q.dragging||Array.isArray(l)&&Array.isArray(c)&&l.every((f,p)=>f===c[p])&&Q.firstValue===l[0]&&Q.secondValue===l[1]||u()},{deep:!0}),s.watch(()=>[N.min,N.max],()=>{u()})},JN=ei({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:rc,default:"top"}}),ZN={[Wi]:N=>Ri(N)},qN=s.defineComponent({name:"ElSliderButton"}),eL=s.defineComponent({...qN,props:JN,emits:ZN,setup(N,{expose:Q,emit:a}){const x=N,S=Jr("slider"),A=s.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:x.modelValue}),{disabled:h,button:d,tooltip:u,showTooltip:l,tooltipVisible:c,wrapperStyle:f,formatValue:p,handleMouseEnter:m,handleMouseLeave:v,onButtonDown:_,onKeyDown:b,setPosition:w}=KN(x,A,a),{hovering:C,dragging:k}=s.toRefs(A);return Q({onButtonDown:_,onKeyDown:b,setPosition:w,hovering:C,dragging:k}),(T,R)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"button",ref:d,class:s.normalizeClass([s.unref(S).e("button-wrapper"),{hover:s.unref(C),dragging:s.unref(k)}]),style:s.normalizeStyle(s.unref(f)),tabindex:s.unref(h)?-1:0,onMouseenter:s.unref(m),onMouseleave:s.unref(v),onMousedown:s.unref(_),onFocus:s.unref(m),onBlur:s.unref(v),onKeydown:s.unref(b)},[s.createVNode(s.unref(ku),{ref_key:"tooltip",ref:u,visible:s.unref(c),placement:T.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":T.tooltipClass,disabled:!s.unref(l),persistent:""},{content:s.withCtx(()=>[s.createElementVNode("span",null,s.toDisplayString(s.unref(p)),1)]),default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass([s.unref(S).e("button"),{hover:s.unref(C),dragging:s.unref(k)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var tw=si(eL,[["__file","button.vue"]]);const tL=ei({mark:{type:Pr([String,Object]),default:void 0}});var rL=s.defineComponent({name:"ElSliderMarker",props:tL,setup(N){const Q=Jr("slider"),a=s.computed(()=>Dn(N.mark)?N.mark:N.mark.label),x=s.computed(()=>Dn(N.mark)?void 0:N.mark.style);return()=>s.h("div",{class:Q.e("marks-text"),style:x.value},a.value)}});const iL=s.defineComponent({name:"ElSlider"}),nL=s.defineComponent({...iL,props:FN,emits:RN,setup(N,{expose:Q,emit:a}){const x=N,S=Jr("slider"),{t:A}=es(),h=s.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:d,slider:u,firstButton:l,secondButton:c,sliderDisabled:f,minValue:p,maxValue:m,runwayStyle:v,barStyle:_,resetSize:b,emitChange:w,onSliderWrapperPrevent:C,onSliderClick:k,onSliderDown:T,onSliderMarkerDown:R,setFirstValue:U,setSecondValue:G}=LN(x,h,a),{stops:j,getStopStyle:H}=XN(x,h,p,m),{inputId:W,isLabeledByFormItem:K}=vl(x,{formItemContext:d}),$=mo(),O=s.computed(()=>x.inputSize||$.value),L=s.computed(()=>x.ariaLabel||A("el.slider.defaultLabel",{min:x.min,max:x.max})),M=s.computed(()=>x.range?x.rangeStartLabel||A("el.slider.defaultRangeStartLabel"):L.value),I=s.computed(()=>x.formatValueText?x.formatValueText(ne.value):`${ne.value}`),F=s.computed(()=>x.rangeEndLabel||A("el.slider.defaultRangeEndLabel")),V=s.computed(()=>x.formatValueText?x.formatValueText(oe.value):`${oe.value}`),D=s.computed(()=>[S.b(),S.m($.value),S.is("vertical",x.vertical),{[S.m("with-input")]:x.showInput}]),X=NN(x);YN(x,h,p,m,a,d);const ee=s.computed(()=>{const de=[x.min,x.max,x.step].map(se=>{const re=`${se}`.split(".")[1];return re?re.length:0});return Math.max.apply(null,de)}),{sliderWrapper:q}=ON(x,h,b),{firstValue:ne,secondValue:oe,sliderSize:he}=s.toRefs(h),te=de=>{h.dragging=de};return Zn(q,"touchstart",C,{passive:!1}),Zn(q,"touchmove",C,{passive:!1}),s.provide(ew,{...s.toRefs(x),sliderSize:he,disabled:f,precision:ee,emitChange:w,resetSize:b,updateDragging:te}),Q({onSliderClick:k}),(de,se)=>{var re,ae;return s.openBlock(),s.createElementBlock("div",{id:de.range?s.unref(W):void 0,ref_key:"sliderWrapper",ref:q,class:s.normalizeClass(s.unref(D)),role:de.range?"group":void 0,"aria-label":de.range&&!s.unref(K)?s.unref(L):void 0,"aria-labelledby":de.range&&s.unref(K)?(re=s.unref(d))==null?void 0:re.labelId:void 0},[s.createElementVNode("div",{ref_key:"slider",ref:u,class:s.normalizeClass([s.unref(S).e("runway"),{"show-input":de.showInput&&!de.range},s.unref(S).is("disabled",s.unref(f))]),style:s.normalizeStyle(s.unref(v)),onMousedown:s.unref(T),onTouchstartPassive:s.unref(T)},[s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("bar")),style:s.normalizeStyle(s.unref(_))},null,6),s.createVNode(tw,{id:de.range?void 0:s.unref(W),ref_key:"firstButton",ref:l,"model-value":s.unref(ne),vertical:de.vertical,"tooltip-class":de.tooltipClass,placement:de.placement,role:"slider","aria-label":de.range||!s.unref(K)?s.unref(M):void 0,"aria-labelledby":!de.range&&s.unref(K)?(ae=s.unref(d))==null?void 0:ae.labelId:void 0,"aria-valuemin":de.min,"aria-valuemax":de.range?s.unref(oe):de.max,"aria-valuenow":s.unref(ne),"aria-valuetext":s.unref(I),"aria-orientation":de.vertical?"vertical":"horizontal","aria-disabled":s.unref(f),"onUpdate:modelValue":s.unref(U)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),de.range?(s.openBlock(),s.createBlock(tw,{key:0,ref_key:"secondButton",ref:c,"model-value":s.unref(oe),vertical:de.vertical,"tooltip-class":de.tooltipClass,placement:de.placement,role:"slider","aria-label":s.unref(F),"aria-valuemin":s.unref(ne),"aria-valuemax":de.max,"aria-valuenow":s.unref(oe),"aria-valuetext":s.unref(V),"aria-orientation":de.vertical?"vertical":"horizontal","aria-disabled":s.unref(f),"onUpdate:modelValue":s.unref(G)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):s.createCommentVNode("v-if",!0),de.showStops?(s.openBlock(),s.createElementBlock("div",{key:1},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(j),(Ce,me)=>(s.openBlock(),s.createElementBlock("div",{key:me,class:s.normalizeClass(s.unref(S).e("stop")),style:s.normalizeStyle(s.unref(H)(Ce))},null,6))),128))])):s.createCommentVNode("v-if",!0),s.unref(X).length>0?(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createElementVNode("div",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(X),(Ce,me)=>(s.openBlock(),s.createElementBlock("div",{key:me,style:s.normalizeStyle(s.unref(H)(Ce.position)),class:s.normalizeClass([s.unref(S).e("stop"),s.unref(S).e("marks-stop")])},null,6))),128))]),s.createElementVNode("div",{class:s.normalizeClass(s.unref(S).e("marks"))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(X),(Ce,me)=>(s.openBlock(),s.createBlock(s.unref(rL),{key:me,mark:Ce.mark,style:s.normalizeStyle(s.unref(H)(Ce.position)),onMousedown:s.withModifiers(ce=>s.unref(R)(Ce.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):s.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),de.showInput&&!de.range?(s.openBlock(),s.createBlock(s.unref(vN),{key:0,ref:"input","model-value":s.unref(ne),class:s.normalizeClass(s.unref(S).e("input")),step:de.step,disabled:s.unref(f),controls:de.showInputControls,min:de.min,max:de.max,precision:s.unref(ee),debounce:de.debounce,size:s.unref(O),"onUpdate:modelValue":s.unref(U),onChange:s.unref(w)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):s.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var sL=si(nL,[["__file","slider.vue"]]);const rw=Gn(sL),oL=ei({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:X4},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:ho},activeActionIcon:{type:ho},activeIcon:{type:ho},inactiveIcon:{type:ho},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:Pr(Function)},id:String,tabindex:{type:[String,Number]},...Ys(["ariaLabel"])}),aL={[Wi]:N=>uo(N)||Dn(N)||Ri(N),[Mo]:N=>uo(N)||Dn(N)||Ri(N),[To]:N=>uo(N)||Dn(N)||Ri(N)},uA="ElSwitch",lL=s.defineComponent({name:uA}),cL=s.defineComponent({...lL,props:oL,emits:aL,setup(N,{expose:Q,emit:a}){const x=N,{formItem:S}=Ao(),A=mo(),h=Jr("switch"),{inputId:d}=vl(x,{formItemContext:S}),u=gl(s.computed(()=>x.loading)),l=s.ref(x.modelValue!==!1),c=s.ref(),f=s.ref(),p=s.computed(()=>[h.b(),h.m(A.value),h.is("disabled",u.value),h.is("checked",w.value)]),m=s.computed(()=>[h.e("label"),h.em("label","left"),h.is("active",!w.value)]),v=s.computed(()=>[h.e("label"),h.em("label","right"),h.is("active",w.value)]),_=s.computed(()=>({width:dh(x.width)}));s.watch(()=>x.modelValue,()=>{l.value=!0});const b=s.computed(()=>l.value?x.modelValue:!1),w=s.computed(()=>b.value===x.activeValue);[x.activeValue,x.inactiveValue].includes(b.value)||(a(Wi,x.inactiveValue),a(Mo,x.inactiveValue),a(To,x.inactiveValue)),s.watch(w,R=>{var U;c.value.checked=R,x.validateEvent&&((U=S==null?void 0:S.validate)==null||U.call(S,"change").catch(G=>Ki(G)))});const C=()=>{const R=w.value?x.inactiveValue:x.activeValue;a(Wi,R),a(Mo,R),a(To,R),s.nextTick(()=>{c.value.checked=w.value})},k=()=>{if(u.value)return;const{beforeChange:R}=x;if(!R){C();return}const U=R();[db(U),uo(U)].includes(!0)||ch(uA,"beforeChange must return type `Promise<boolean>` or `boolean`"),db(U)?U.then(j=>{j&&C()}).catch(j=>{Ki(uA,`some error occurred: ${j}`)}):U&&C()},T=()=>{var R,U;(U=(R=c.value)==null?void 0:R.focus)==null||U.call(R)};return s.onMounted(()=>{c.value.checked=w.value}),Q({focus:T,checked:w}),(R,U)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(s.unref(p)),onClick:s.withModifiers(k,["prevent"])},[s.createElementVNode("input",{id:s.unref(d),ref_key:"input",ref:c,class:s.normalizeClass(s.unref(h).e("input")),type:"checkbox",role:"switch","aria-checked":s.unref(w),"aria-disabled":s.unref(u),"aria-label":R.ariaLabel,name:R.name,"true-value":R.activeValue,"false-value":R.inactiveValue,disabled:s.unref(u),tabindex:R.tabindex,onChange:C,onKeydown:s.withKeys(k,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!R.inlinePrompt&&(R.inactiveIcon||R.inactiveText)?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(s.unref(m))},[R.inactiveIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.inactiveIcon)))]),_:1})):s.createCommentVNode("v-if",!0),!R.inactiveIcon&&R.inactiveText?(s.openBlock(),s.createElementBlock("span",{key:1,"aria-hidden":s.unref(w)},s.toDisplayString(R.inactiveText),9,["aria-hidden"])):s.createCommentVNode("v-if",!0)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("span",{ref_key:"core",ref:f,class:s.normalizeClass(s.unref(h).e("core")),style:s.normalizeStyle(s.unref(_))},[R.inlinePrompt?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(s.unref(h).e("inner"))},[R.activeIcon||R.inactiveIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(h).is("icon"))},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(w)?R.activeIcon:R.inactiveIcon)))]),_:1},8,["class"])):R.activeText||R.inactiveText?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(h).is("text")),"aria-hidden":!s.unref(w)},s.toDisplayString(s.unref(w)?R.activeText:R.inactiveText),11,["aria-hidden"])):s.createCommentVNode("v-if",!0)],2)):s.createCommentVNode("v-if",!0),s.createElementVNode("div",{class:s.normalizeClass(s.unref(h).e("action"))},[R.loading?(s.openBlock(),s.createBlock(s.unref(ni),{key:0,class:s.normalizeClass(s.unref(h).is("loading"))},{default:s.withCtx(()=>[s.createVNode(s.unref(ui.Loading))]),_:1},8,["class"])):s.unref(w)?s.renderSlot(R.$slots,"active-action",{key:1},()=>[R.activeActionIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.activeActionIcon)))]),_:1})):s.createCommentVNode("v-if",!0)]):s.unref(w)?s.createCommentVNode("v-if",!0):s.renderSlot(R.$slots,"inactive-action",{key:2},()=>[R.inactiveActionIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.inactiveActionIcon)))]),_:1})):s.createCommentVNode("v-if",!0)])],2)],6),!R.inlinePrompt&&(R.activeIcon||R.activeText)?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(s.unref(v))},[R.activeIcon?(s.openBlock(),s.createBlock(s.unref(ni),{key:0},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(R.activeIcon)))]),_:1})):s.createCommentVNode("v-if",!0),!R.activeIcon&&R.activeText?(s.openBlock(),s.createElementBlock("span",{key:1,"aria-hidden":!s.unref(w)},s.toDisplayString(R.activeText),9,["aria-hidden"])):s.createCommentVNode("v-if",!0)],2)):s.createCommentVNode("v-if",!0)],10,["onClick"]))}});var uL=si(cL,[["__file","switch.vue"]]);const dL=Gn(uL),pc="$treeNodeId",iw=function(N,Q){!Q||Q[pc]||Object.defineProperty(Q,pc,{value:N.id,enumerable:!1,configurable:!1,writable:!1})},dA=function(N,Q){return N?Q[N]:Q[pc]},hA=(N,Q,a)=>{const x=N.value.currentNode;a();const S=N.value.currentNode;x!==S&&Q("current-change",S?S.data:null,S)},fA=N=>{let Q=!0,a=!0,x=!0;for(let S=0,A=N.length;S<A;S++){const h=N[S];(h.checked!==!0||h.indeterminate)&&(Q=!1,h.disabled||(x=!1)),(h.checked!==!1||h.indeterminate)&&(a=!1)}return{all:Q,none:a,allWithoutDisable:x,half:!Q&&!a}},Du=function(N){if(N.childNodes.length===0||N.loading)return;const{all:Q,none:a,half:x}=fA(N.childNodes);Q?(N.checked=!0,N.indeterminate=!1):x?(N.checked=!1,N.indeterminate=!0):a&&(N.checked=!1,N.indeterminate=!1);const S=N.parent;!S||S.level===0||N.store.checkStrictly||Du(S)},Mh=function(N,Q){const a=N.store.props,x=N.data||{},S=a[Q];if(typeof S=="function")return S(x,N);if(typeof S=="string")return x[S];if(typeof S>"u"){const A=x[Q];return A===void 0?"":A}};let hL=0,pA=class Yp{constructor(Q){this.id=hL++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const a in Q)hu(Q,a)&&(this[a]=Q[a]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const Q=this.store;if(!Q)throw new Error("[Node]store is required!");Q.registerNode(this);const a=Q.props;if(a&&typeof a.isLeaf<"u"){const A=Mh(this,"isLeaf");typeof A=="boolean"&&(this.isLeafByUser=A)}if(Q.lazy!==!0&&this.data?(this.setData(this.data),Q.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&Q.lazy&&Q.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||iw(this,this.data),!this.data)return;const x=Q.defaultExpandedKeys,S=Q.key;S&&x&&x.includes(this.key)&&this.expand(null,Q.autoExpandParent),S&&Q.currentNodeKey!==void 0&&this.key===Q.currentNodeKey&&(Q.currentNode=this,Q.currentNode.isCurrent=!0),Q.lazy&&Q._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(Q){Array.isArray(Q)||iw(this,Q),this.data=Q,this.childNodes=[];let a;this.level===0&&Array.isArray(this.data)?a=this.data:a=Mh(this,"children")||[];for(let x=0,S=a.length;x<S;x++)this.insertChild({data:a[x]})}get label(){return Mh(this,"label")}get key(){const Q=this.store.key;return this.data?this.data[Q]:null}get disabled(){return Mh(this,"disabled")}get nextSibling(){const Q=this.parent;if(Q){const a=Q.childNodes.indexOf(this);if(a>-1)return Q.childNodes[a+1]}return null}get previousSibling(){const Q=this.parent;if(Q){const a=Q.childNodes.indexOf(this);if(a>-1)return a>0?Q.childNodes[a-1]:null}return null}contains(Q,a=!0){return(this.childNodes||[]).some(x=>x===Q||a&&x.contains(Q))}remove(){const Q=this.parent;Q&&Q.removeChild(this)}insertChild(Q,a,x){if(!Q)throw new Error("InsertChild error: child is required.");if(!(Q instanceof Yp)){if(!x){const S=this.getChildren(!0);S.includes(Q.data)||(typeof a>"u"||a<0?S.push(Q.data):S.splice(a,0,Q.data))}Object.assign(Q,{parent:this,store:this.store}),Q=s.reactive(new Yp(Q)),Q instanceof Yp&&Q.initialize()}Q.level=this.level+1,typeof a>"u"||a<0?this.childNodes.push(Q):this.childNodes.splice(a,0,Q),this.updateLeafState()}insertBefore(Q,a){let x;a&&(x=this.childNodes.indexOf(a)),this.insertChild(Q,x)}insertAfter(Q,a){let x;a&&(x=this.childNodes.indexOf(a),x!==-1&&(x+=1)),this.insertChild(Q,x)}removeChild(Q){const a=this.getChildren()||[],x=a.indexOf(Q.data);x>-1&&a.splice(x,1);const S=this.childNodes.indexOf(Q);S>-1&&(this.store&&this.store.deregisterNode(Q),Q.parent=null,this.childNodes.splice(S,1)),this.updateLeafState()}removeChildByData(Q){let a=null;for(let x=0;x<this.childNodes.length;x++)if(this.childNodes[x].data===Q){a=this.childNodes[x];break}a&&this.removeChild(a)}expand(Q,a){const x=()=>{if(a){let S=this.parent;for(;S.level>0;)S.expanded=!0,S=S.parent}this.expanded=!0,Q&&Q(),this.childNodes.forEach(S=>{S.canFocus=!0})};this.shouldLoadData()?this.loadData(S=>{Array.isArray(S)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||Du(this),x())}):x()}doCreateChildren(Q,a={}){Q.forEach(x=>{this.insertChild(Object.assign({data:x},a),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(Q=>{Q.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const Q=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!Q||Q.length===0;return}this.isLeaf=!1}setChecked(Q,a,x,S){if(this.indeterminate=Q==="half",this.checked=Q===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:h,allWithoutDisable:d}=fA(this.childNodes);!this.isLeaf&&!h&&d&&(this.checked=!1,Q=!1);const u=()=>{if(a){const l=this.childNodes;for(let p=0,m=l.length;p<m;p++){const v=l[p];S=S||Q!==!1;const _=v.disabled?v.checked:S;v.setChecked(_,a,!0,S)}const{half:c,all:f}=fA(l);f||(this.checked=f,this.indeterminate=c)}};if(this.shouldLoadData()){this.loadData(()=>{u(),Du(this)},{checked:Q!==!1});return}else u()}const A=this.parent;!A||A.level===0||x||Du(A)}getChildren(Q=!1){if(this.level===0)return this.data;const a=this.data;if(!a)return null;const x=this.store.props;let S="children";return x&&(S=x.children||"children"),a[S]===void 0&&(a[S]=null),Q&&!a[S]&&(a[S]=[]),a[S]}updateChildren(){const Q=this.getChildren()||[],a=this.childNodes.map(A=>A.data),x={},S=[];Q.forEach((A,h)=>{const d=A[pc];!!d&&a.findIndex(l=>l[pc]===d)>=0?x[d]={index:h,data:A}:S.push({index:h,data:A})}),this.store.lazy||a.forEach(A=>{x[A[pc]]||this.removeChildByData(A)}),S.forEach(({index:A,data:h})=>{this.insertChild({data:h},A)}),this.updateLeafState()}loadData(Q,a={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(a).length)){this.loading=!0;const x=A=>{this.childNodes=[],this.doCreateChildren(A,a),this.loaded=!0,this.loading=!1,this.updateLeafState(),Q&&Q.call(this,A)},S=()=>{this.loading=!1};this.store.load(this,x,S)}else Q&&Q.call(this)}eachNode(Q){const a=[this];for(;a.length;){const x=a.shift();a.unshift(...x.childNodes),Q(x)}}reInitChecked(){this.store.checkStrictly||Du(this)}};class fL{constructor(Q){this.currentNode=null,this.currentNodeKey=null;for(const a in Q)hu(Q,a)&&(this[a]=Q[a]);this.nodesMap={}}initialize(){if(this.root=new pA({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const Q=this.load;Q(this.root,a=>{this.root.doCreateChildren(a),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(Q){const a=this.filterNodeMethod,x=this.lazy,S=function(A){const h=A.root?A.root.childNodes:A.childNodes;if(h.forEach(d=>{d.visible=a.call(d,Q,d.data,d),S(d)}),!A.visible&&h.length){let d=!0;d=!h.some(u=>u.visible),A.root?A.root.visible=d===!1:A.visible=d===!1}Q&&A.visible&&!A.isLeaf&&(!x||A.loaded)&&A.expand()};S(this)}setData(Q){Q!==this.root.data?(this.root.setData(Q),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(Q){if(Q instanceof pA)return Q;const a=qn(Q)?dA(this.key,Q):Q;return this.nodesMap[a]||null}insertBefore(Q,a){const x=this.getNode(a);x.parent.insertBefore({data:Q},x)}insertAfter(Q,a){const x=this.getNode(a);x.parent.insertAfter({data:Q},x)}remove(Q){const a=this.getNode(Q);a&&a.parent&&(a===this.currentNode&&(this.currentNode=null),a.parent.removeChild(a))}append(Q,a){const x=ec(a)?this.root:this.getNode(a);x&&x.insertChild({data:Q})}_initDefaultCheckedNodes(){const Q=this.defaultCheckedKeys||[],a=this.nodesMap;Q.forEach(x=>{const S=a[x];S&&S.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(Q){(this.defaultCheckedKeys||[]).includes(Q.key)&&Q.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(Q){Q!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=Q,this._initDefaultCheckedNodes())}registerNode(Q){const a=this.key;!Q||!Q.data||(a?Q.key!==void 0&&(this.nodesMap[Q.key]=Q):this.nodesMap[Q.id]=Q)}deregisterNode(Q){!this.key||!Q||!Q.data||(Q.childNodes.forEach(x=>{this.deregisterNode(x)}),delete this.nodesMap[Q.key])}getCheckedNodes(Q=!1,a=!1){const x=[],S=function(A){(A.root?A.root.childNodes:A.childNodes).forEach(d=>{(d.checked||a&&d.indeterminate)&&(!Q||Q&&d.isLeaf)&&x.push(d.data),S(d)})};return S(this),x}getCheckedKeys(Q=!1){return this.getCheckedNodes(Q).map(a=>(a||{})[this.key])}getHalfCheckedNodes(){const Q=[],a=function(x){(x.root?x.root.childNodes:x.childNodes).forEach(A=>{A.indeterminate&&Q.push(A.data),a(A)})};return a(this),Q}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(Q=>(Q||{})[this.key])}_getAllNodes(){const Q=[],a=this.nodesMap;for(const x in a)hu(a,x)&&Q.push(a[x]);return Q}updateChildren(Q,a){const x=this.nodesMap[Q];if(!x)return;const S=x.childNodes;for(let A=S.length-1;A>=0;A--){const h=S[A];this.remove(h.data)}for(let A=0,h=a.length;A<h;A++){const d=a[A];this.append(d,x.data)}}_setCheckedKeys(Q,a=!1,x){const S=this._getAllNodes().sort((u,l)=>u.level-l.level),A=Object.create(null),h=Object.keys(x);S.forEach(u=>u.setChecked(!1,!1));const d=u=>{u.childNodes.forEach(l=>{var c;A[l.data[Q]]=!0,(c=l.childNodes)!=null&&c.length&&d(l)})};for(let u=0,l=S.length;u<l;u++){const c=S[u],f=c.data[Q].toString();if(!h.includes(f)){c.checked&&!A[f]&&c.setChecked(!1,!1);continue}if(c.childNodes.length&&d(c),c.isLeaf||this.checkStrictly){c.setChecked(!0,!1);continue}if(c.setChecked(!0,!0),a){c.setChecked(!1,!1);const m=function(v){v.childNodes.forEach(b=>{b.isLeaf||b.setChecked(!1,!1),m(b)})};m(c)}}}setCheckedNodes(Q,a=!1){const x=this.key,S={};Q.forEach(A=>{S[(A||{})[x]]=!0}),this._setCheckedKeys(x,a,S)}setCheckedKeys(Q,a=!1){this.defaultCheckedKeys=Q;const x=this.key,S={};Q.forEach(A=>{S[A]=!0}),this._setCheckedKeys(x,a,S)}setDefaultExpandedKeys(Q){Q=Q||[],this.defaultExpandedKeys=Q,Q.forEach(a=>{const x=this.getNode(a);x&&x.expand(null,this.autoExpandParent)})}setChecked(Q,a,x){const S=this.getNode(Q);S&&S.setChecked(!!a,x)}getCurrentNode(){return this.currentNode}setCurrentNode(Q){const a=this.currentNode;a&&(a.isCurrent=!1),this.currentNode=Q,this.currentNode.isCurrent=!0}setUserCurrentNode(Q,a=!0){const x=Q[this.key],S=this.nodesMap[x];this.setCurrentNode(S),a&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(Q,a=!0){if(Q==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const x=this.getNode(Q);x&&(this.setCurrentNode(x),a&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const pL=s.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(N){const Q=Jr("tree"),a=s.inject("NodeInstance"),x=s.inject("RootTree");return()=>{const S=N.node,{data:A,store:h}=S;return N.renderContent?N.renderContent(s.h,{_self:a,node:S,data:A,store:h}):s.renderSlot(x.ctx.slots,"default",{node:S,data:A},()=>[s.h("span",{class:Q.be("node","label")},[S.label])])}}});var mL=si(pL,[["__file","tree-node-content.vue"]]);function nw(N){const Q=s.inject("TreeNodeMap",null),a={treeNodeExpand:x=>{N.node!==x&&N.node.collapse()},children:[]};return Q&&Q.children.push(a),s.provide("TreeNodeMap",a),{broadcastExpanded:x=>{if(N.accordion)for(const S of a.children)S.treeNodeExpand(x)}}}const sw=Symbol("dragEvents");function AL({props:N,ctx:Q,el$:a,dropIndicator$:x,store:S}){const A=Jr("tree"),h=s.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),d=({event:c,treeNode:f})=>{if(typeof N.allowDrag=="function"&&!N.allowDrag(f.node))return c.preventDefault(),!1;c.dataTransfer.effectAllowed="move";try{c.dataTransfer.setData("text/plain","")}catch{}h.value.draggingNode=f,Q.emit("node-drag-start",f.node,c)},u=({event:c,treeNode:f})=>{const p=f,m=h.value.dropNode;m&&m.node.id!==p.node.id&&vm(m.$el,A.is("drop-inner"));const v=h.value.draggingNode;if(!v||!p)return;let _=!0,b=!0,w=!0,C=!0;typeof N.allowDrop=="function"&&(_=N.allowDrop(v.node,p.node,"prev"),C=b=N.allowDrop(v.node,p.node,"inner"),w=N.allowDrop(v.node,p.node,"next")),c.dataTransfer.dropEffect=b||_||w?"move":"none",(_||b||w)&&(m==null?void 0:m.node.id)!==p.node.id&&(m&&Q.emit("node-drag-leave",v.node,m.node,c),Q.emit("node-drag-enter",v.node,p.node,c)),_||b||w?h.value.dropNode=p:h.value.dropNode=null,p.node.nextSibling===v.node&&(w=!1),p.node.previousSibling===v.node&&(_=!1),p.node.contains(v.node,!1)&&(b=!1),(v.node===p.node||v.node.contains(p.node))&&(_=!1,b=!1,w=!1);const k=p.$el.querySelector(`.${A.be("node","content")}`).getBoundingClientRect(),T=a.value.getBoundingClientRect();let R;const U=_?b?.25:w?.45:1:-1,G=w?b?.75:_?.55:0:1;let j=-9999;const H=c.clientY-k.top;H<k.height*U?R="before":H>k.height*G?R="after":b?R="inner":R="none";const W=p.$el.querySelector(`.${A.be("node","expand-icon")}`).getBoundingClientRect(),K=x.value;R==="before"?j=W.top-T.top:R==="after"&&(j=W.bottom-T.top),K.style.top=`${j}px`,K.style.left=`${W.right-T.left}px`,R==="inner"?G4(p.$el,A.is("drop-inner")):vm(p.$el,A.is("drop-inner")),h.value.showDropIndicator=R==="before"||R==="after",h.value.allowDrop=h.value.showDropIndicator||C,h.value.dropType=R,Q.emit("node-drag-over",v.node,p.node,c)},l=c=>{const{draggingNode:f,dropType:p,dropNode:m}=h.value;if(c.preventDefault(),c.dataTransfer.dropEffect="move",f&&m){const v={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?m.node.parent.insertBefore(v,m.node):p==="after"?m.node.parent.insertAfter(v,m.node):p==="inner"&&m.node.insertChild(v),p!=="none"&&(S.value.registerNode(v),S.value.key&&f.node.eachNode(_=>{var b;(b=S.value.nodesMap[_.data[S.value.key]])==null||b.setChecked(_.checked,!S.value.checkStrictly)})),vm(m.$el,A.is("drop-inner")),Q.emit("node-drag-end",f.node,m.node,p,c),p!=="none"&&Q.emit("node-drop",f.node,m.node,p,c)}f&&!m&&Q.emit("node-drag-end",f.node,null,p,c),h.value.showDropIndicator=!1,h.value.draggingNode=null,h.value.dropNode=null,h.value.allowDrop=!0};return s.provide(sw,{treeNodeDragStart:d,treeNodeDragOver:u,treeNodeDragEnd:l}),{dragState:h}}const gL=s.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:BO,ElCheckbox:Jm,NodeContent:mL,ElIcon:ni,Loading:ui.Loading},props:{node:{type:pA,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(N,Q){const a=Jr("tree"),{broadcastExpanded:x}=nw(N),S=s.inject("RootTree"),A=s.ref(!1),h=s.ref(!1),d=s.ref(null),u=s.ref(null),l=s.ref(null),c=s.inject(sw),f=s.getCurrentInstance();s.provide("NodeInstance",f),S||Ki("Tree","Can not find node's tree."),N.node.expanded&&(A.value=!0,h.value=!0);const p=S.props.props.children||"children";s.watch(()=>{const H=N.node.data[p];return H&&[...H]},()=>{N.node.updateChildren()}),s.watch(()=>N.node.indeterminate,H=>{_(N.node.checked,H)}),s.watch(()=>N.node.checked,H=>{_(H,N.node.indeterminate)}),s.watch(()=>N.node.childNodes.length,()=>N.node.reInitChecked()),s.watch(()=>N.node.expanded,H=>{s.nextTick(()=>A.value=H),H&&(h.value=!0)});const m=H=>dA(S.props.nodeKey,H.data),v=H=>{const W=N.props.class;if(!W)return{};let K;if(mn(W)){const{data:$}=H;K=W($,H)}else K=W;return Dn(K)?{[K]:!0}:K},_=(H,W)=>{(d.value!==H||u.value!==W)&&S.ctx.emit("check-change",N.node.data,H,W),d.value=H,u.value=W},b=H=>{hA(S.store,S.ctx.emit,()=>S.store.value.setCurrentNode(N.node)),S.currentNode.value=N.node,S.props.expandOnClickNode&&C(),S.props.checkOnClickNode&&!N.node.disabled&&k(null,{target:{checked:!N.node.checked}}),S.ctx.emit("node-click",N.node.data,N.node,f,H)},w=H=>{S.instance.vnode.props.onNodeContextmenu&&(H.stopPropagation(),H.preventDefault()),S.ctx.emit("node-contextmenu",H,N.node.data,N.node,f)},C=()=>{N.node.isLeaf||(A.value?(S.ctx.emit("node-collapse",N.node.data,N.node,f),N.node.collapse()):(N.node.expand(),Q.emit("node-expand",N.node.data,N.node,f)))},k=(H,W)=>{N.node.setChecked(W.target.checked,!S.props.checkStrictly),s.nextTick(()=>{const K=S.store.value;S.ctx.emit("check",N.node.data,{checkedNodes:K.getCheckedNodes(),checkedKeys:K.getCheckedKeys(),halfCheckedNodes:K.getHalfCheckedNodes(),halfCheckedKeys:K.getHalfCheckedKeys()})})};return{ns:a,node$:l,tree:S,expanded:A,childNodeRendered:h,oldChecked:d,oldIndeterminate:u,getNodeKey:m,getNodeClass:v,handleSelectChange:_,handleClick:b,handleContextMenu:w,handleExpandIconClick:C,handleCheckChange:k,handleChildNodeExpand:(H,W,K)=>{x(W),S.ctx.emit("node-expand",H,W,K)},handleDragStart:H=>{S.props.draggable&&c.treeNodeDragStart({event:H,treeNode:N})},handleDragOver:H=>{H.preventDefault(),S.props.draggable&&c.treeNodeDragOver({event:H,treeNode:{$el:l.value,node:N.node}})},handleDrop:H=>{H.preventDefault()},handleDragEnd:H=>{S.props.draggable&&c.treeNodeDragEnd(H)},CaretRight:ui.CaretRight}}});function vL(N,Q,a,x,S,A){const h=s.resolveComponent("el-icon"),d=s.resolveComponent("el-checkbox"),u=s.resolveComponent("loading"),l=s.resolveComponent("node-content"),c=s.resolveComponent("el-tree-node"),f=s.resolveComponent("el-collapse-transition");return s.withDirectives((s.openBlock(),s.createElementBlock("div",{ref:"node$",class:s.normalizeClass([N.ns.b("node"),N.ns.is("expanded",N.expanded),N.ns.is("current",N.node.isCurrent),N.ns.is("hidden",!N.node.visible),N.ns.is("focusable",!N.node.disabled),N.ns.is("checked",!N.node.disabled&&N.node.checked),N.getNodeClass(N.node)]),role:"treeitem",tabindex:"-1","aria-expanded":N.expanded,"aria-disabled":N.node.disabled,"aria-checked":N.node.checked,draggable:N.tree.props.draggable,"data-key":N.getNodeKey(N.node),onClick:s.withModifiers(N.handleClick,["stop"]),onContextmenu:N.handleContextMenu,onDragstart:s.withModifiers(N.handleDragStart,["stop"]),onDragover:s.withModifiers(N.handleDragOver,["stop"]),onDragend:s.withModifiers(N.handleDragEnd,["stop"]),onDrop:s.withModifiers(N.handleDrop,["stop"])},[s.createElementVNode("div",{class:s.normalizeClass(N.ns.be("node","content")),style:s.normalizeStyle({paddingLeft:(N.node.level-1)*N.tree.props.indent+"px"})},[N.tree.props.icon||N.CaretRight?(s.openBlock(),s.createBlock(h,{key:0,class:s.normalizeClass([N.ns.be("node","expand-icon"),N.ns.is("leaf",N.node.isLeaf),{expanded:!N.node.isLeaf&&N.expanded}]),onClick:s.withModifiers(N.handleExpandIconClick,["stop"])},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(N.tree.props.icon||N.CaretRight)))]),_:1},8,["class","onClick"])):s.createCommentVNode("v-if",!0),N.showCheckbox?(s.openBlock(),s.createBlock(d,{key:1,"model-value":N.node.checked,indeterminate:N.node.indeterminate,disabled:!!N.node.disabled,onClick:s.withModifiers(()=>{},["stop"]),onChange:N.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):s.createCommentVNode("v-if",!0),N.node.loading?(s.openBlock(),s.createBlock(h,{key:2,class:s.normalizeClass([N.ns.be("node","loading-icon"),N.ns.is("loading")])},{default:s.withCtx(()=>[s.createVNode(u)]),_:1},8,["class"])):s.createCommentVNode("v-if",!0),s.createVNode(l,{node:N.node,"render-content":N.renderContent},null,8,["node","render-content"])],6),s.createVNode(f,null,{default:s.withCtx(()=>[!N.renderAfterExpand||N.childNodeRendered?s.withDirectives((s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.ns.be("node","children")),role:"group","aria-expanded":N.expanded},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.node.childNodes,p=>(s.openBlock(),s.createBlock(c,{key:N.getNodeKey(p),"render-content":N.renderContent,"render-after-expand":N.renderAfterExpand,"show-checkbox":N.showCheckbox,node:p,accordion:N.accordion,props:N.props,onNodeExpand:N.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[s.vShow,N.expanded]]):s.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[s.vShow,N.node.visible]])}var yL=si(gL,[["render",vL],["__file","tree-node.vue"]]);function bL({el$:N},Q){const a=Jr("tree"),x=s.shallowRef([]),S=s.shallowRef([]);s.onMounted(()=>{h()}),s.onUpdated(()=>{x.value=Array.from(N.value.querySelectorAll("[role=treeitem]")),S.value=Array.from(N.value.querySelectorAll("input[type=checkbox]"))}),s.watch(S,d=>{d.forEach(u=>{u.setAttribute("tabindex","-1")})}),Zn(N,"keydown",d=>{const u=d.target;if(!u.className.includes(a.b("node")))return;const l=d.code;x.value=Array.from(N.value.querySelectorAll(`.${a.is("focusable")}[role=treeitem]`));const c=x.value.indexOf(u);let f;if([Ii.up,Ii.down].includes(l)){if(d.preventDefault(),l===Ii.up){f=c===-1?0:c!==0?c-1:x.value.length-1;const m=f;for(;!Q.value.getNode(x.value[f].dataset.key).canFocus;){if(f--,f===m){f=-1;break}f<0&&(f=x.value.length-1)}}else{f=c===-1?0:c<x.value.length-1?c+1:0;const m=f;for(;!Q.value.getNode(x.value[f].dataset.key).canFocus;){if(f++,f===m){f=-1;break}f>=x.value.length&&(f=0)}}f!==-1&&x.value[f].focus()}[Ii.left,Ii.right].includes(l)&&(d.preventDefault(),u.click());const p=u.querySelector('[type="checkbox"]');[Ii.enter,Ii.space].includes(l)&&p&&(d.preventDefault(),p.click())});const h=()=>{var d;x.value=Array.from(N.value.querySelectorAll(`.${a.is("focusable")}[role=treeitem]`)),S.value=Array.from(N.value.querySelectorAll("input[type=checkbox]"));const u=N.value.querySelectorAll(`.${a.is("checked")}[role=treeitem]`);if(u.length){u[0].setAttribute("tabindex","0");return}(d=x.value[0])==null||d.setAttribute("tabindex","0")}}const _L=s.defineComponent({name:"ElTree",components:{ElTreeNode:yL},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:ho}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(N,Q){const{t:a}=es(),x=Jr("tree"),S=s.inject(Mu,null),A=s.ref(new fL({key:N.nodeKey,data:N.data,lazy:N.lazy,props:N.props,load:N.load,currentNodeKey:N.currentNodeKey,checkStrictly:N.checkStrictly,checkDescendants:N.checkDescendants,defaultCheckedKeys:N.defaultCheckedKeys,defaultExpandedKeys:N.defaultExpandedKeys,autoExpandParent:N.autoExpandParent,defaultExpandAll:N.defaultExpandAll,filterNodeMethod:N.filterNodeMethod}));A.value.initialize();const h=s.ref(A.value.root),d=s.ref(null),u=s.ref(null),l=s.ref(null),{broadcastExpanded:c}=nw(N),{dragState:f}=AL({props:N,ctx:Q,el$:u,dropIndicator$:l,store:A});bL({el$:u},A);const p=s.computed(()=>{const{childNodes:V}=h.value,D=S?S.hasFilteredOptions!==0:!1;return(!V||V.length===0||V.every(({visible:X})=>!X))&&!D});s.watch(()=>N.currentNodeKey,V=>{A.value.setCurrentNodeKey(V)}),s.watch(()=>N.defaultCheckedKeys,V=>{A.value.setDefaultCheckedKey(V)}),s.watch(()=>N.defaultExpandedKeys,V=>{A.value.setDefaultExpandedKeys(V)}),s.watch(()=>N.data,V=>{A.value.setData(V)},{deep:!0}),s.watch(()=>N.checkStrictly,V=>{A.value.checkStrictly=V});const m=V=>{if(!N.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");A.value.filter(V)},v=V=>dA(N.nodeKey,V.data),_=V=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const D=A.value.getNode(V);if(!D)return[];const X=[D.data];let ee=D.parent;for(;ee&&ee!==h.value;)X.push(ee.data),ee=ee.parent;return X.reverse()},b=(V,D)=>A.value.getCheckedNodes(V,D),w=V=>A.value.getCheckedKeys(V),C=()=>{const V=A.value.getCurrentNode();return V?V.data:null},k=()=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const V=C();return V?V[N.nodeKey]:null},T=(V,D)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");A.value.setCheckedNodes(V,D)},R=(V,D)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");A.value.setCheckedKeys(V,D)},U=(V,D,X)=>{A.value.setChecked(V,D,X)},G=()=>A.value.getHalfCheckedNodes(),j=()=>A.value.getHalfCheckedKeys(),H=(V,D=!0)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");hA(A,Q.emit,()=>{c(V),A.value.setUserCurrentNode(V,D)})},W=(V,D=!0)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");hA(A,Q.emit,()=>{c(),A.value.setCurrentNodeKey(V,D)})},K=V=>A.value.getNode(V),$=V=>{A.value.remove(V)},O=(V,D)=>{A.value.append(V,D)},L=(V,D)=>{A.value.insertBefore(V,D)},M=(V,D)=>{A.value.insertAfter(V,D)},I=(V,D,X)=>{c(D),Q.emit("node-expand",V,D,X)},F=(V,D)=>{if(!N.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");A.value.updateChildren(V,D)};return s.provide("RootTree",{ctx:Q,props:N,store:A,root:h,currentNode:d,instance:s.getCurrentInstance()}),s.provide(Su,void 0),{ns:x,store:A,root:h,currentNode:d,dragState:f,el$:u,dropIndicator$:l,isEmpty:p,filter:m,getNodeKey:v,getNodePath:_,getCheckedNodes:b,getCheckedKeys:w,getCurrentNode:C,getCurrentKey:k,setCheckedNodes:T,setCheckedKeys:R,setChecked:U,getHalfCheckedNodes:G,getHalfCheckedKeys:j,setCurrentNode:H,setCurrentKey:W,t:a,getNode:K,remove:$,append:O,insertBefore:L,insertAfter:M,handleNodeExpand:I,updateKeyChildren:F}}});function wL(N,Q,a,x,S,A){const h=s.resolveComponent("el-tree-node");return s.openBlock(),s.createElementBlock("div",{ref:"el$",class:s.normalizeClass([N.ns.b(),N.ns.is("dragging",!!N.dragState.draggingNode),N.ns.is("drop-not-allow",!N.dragState.allowDrop),N.ns.is("drop-inner",N.dragState.dropType==="inner"),{[N.ns.m("highlight-current")]:N.highlightCurrent}]),role:"tree"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.root.childNodes,d=>(s.openBlock(),s.createBlock(h,{key:N.getNodeKey(d),node:d,props:N.props,accordion:N.accordion,"render-after-expand":N.renderAfterExpand,"show-checkbox":N.showCheckbox,"render-content":N.renderContent,onNodeExpand:N.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),N.isEmpty?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(N.ns.e("empty-block"))},[s.renderSlot(N.$slots,"empty",{},()=>{var d;return[s.createElementVNode("span",{class:s.normalizeClass(N.ns.e("empty-text"))},s.toDisplayString((d=N.emptyText)!=null?d:N.t("el.tree.emptyText")),3)]})],2)):s.createCommentVNode("v-if",!0),s.withDirectives(s.createElementVNode("div",{ref:"dropIndicator$",class:s.normalizeClass(N.ns.e("drop-indicator"))},null,2),[[s.vShow,N.dragState.showDropIndicator]])],2)}var xL=si(_L,[["render",wL],["__file","tree.vue"]]);const CL=Gn(xL);or.on("ThemeConfig",()=>{br.ConfigViewer()});class br{static ConfigViewer(){if(Br.BIMX_CONFIGS.themeColor&&br.setTheme(Vt("themeColor")),Br.BIMX_CONFIGS.isMobile&&(br.setProperty("--annotation-marker-size","32px"),br.setProperty("--annotation-marker-img-size","18px")),Br.BIMX_CONFIGS.topHeight||Br.BIMX_CONFIGS.bottomHeight){const Q=parseInt(Vt("topHeight"));if(Vt("isMobile"))br.setProperty("--mobile-top-height",`${(8+Q).toString()}px`);else{const a=parseInt(Vt("bottomHeight")),x=Q+a;br.setProperty("--tall-panel-height",`calc(100% - ${x.toString()}px)`),br.setProperty("--operate-item-top",`${(14+Q).toString()}px`),br.setProperty("--left-toggle-top",`${(14+Q).toString()}px`)}br.setProperty("--alert-box-top",`${(40+Q).toString()}px`)}if(Br.BIMX_CONFIGS.annotationPos){const Q=Vt("annotationPos").pos,a=Vt("annotationPos").posNum;Q.includes("top")&&br.setProperty("--annotation-panel-triangle-border","0 6px 6px "),Q.includes("bottom")&&br.setProperty("--annotation-panel-triangle-border"," 6px 6px 0"),Q.includes("-")?(br.setProperty("--annotation-panel-width","unset"),Q.includes("left")?br.setProperty("--annotation-panel-left",a[0].toString()+"px"):br.setProperty("--annotation-panel-left","unset"),Q.includes("right")?br.setProperty("--annotation-panel-right",a[0].toString()+"px"):br.setProperty("--annotation-panel-right","unset"),Q.includes("bottom")?br.setProperty("--annotation-panel-bottom",a[1].toString()+"px"):br.setProperty("--annotation-panel-bottom","unset"),Q.includes("top")?br.setProperty("--annotation-panel-top",a[1].toString()+"px"):br.setProperty("--annotation-panel-top","unset")):(Q.includes("bottom")&&br.setProperty("--annotation-panel-right","calc(50% - 136px)"),br.setProperty("--annotation-panel-"+Q,a[0].toString()+"px"))}if(Br.BIMX_CONFIGS.commentPos){const Q=Vt("commentPos").pos,a=Vt("commentPos").posNum;Q.includes("top")&&(br.setProperty("--comment-panel-triangle-display","unset"),br.setProperty("--comment-panel-triangle-border","0 6px 6px "),br.setProperty("--comment-color-panel-top","46px"),br.setProperty("--comment-color-panel-left","-9px"),br.setProperty("--comment-color-edit-tips-bottom","48px")),Q.includes("bottom")&&br.setProperty("--comment-panel-triangle-border"," 6px 6px 0"),Q.includes("-")?(br.setProperty("--comment-panel-width","unset"),Q.includes("left")?br.setProperty("--comment-panel-left",a[0].toString()+"px"):br.setProperty("--comment-panel-left","unset"),Q.includes("right")?br.setProperty("--comment-panel-right",a[0].toString()+"px"):br.setProperty("--comment-panel-right","unset"),Q.includes("bottom")?br.setProperty("--comment-panel-bottom",a[1].toString()+"px"):br.setProperty("--comment-panel-bottom","unset"),Q.includes("top")?br.setProperty("--comment-panel-top",a[1].toString()+"px"):br.setProperty("--comment-panel-top","unset")):((Q.includes("top")||Q.includes("bottom"))&&(br.setProperty("--comment-panel-wrapper-width","100%"),br.setProperty("--comment-panel-left","0"),br.setProperty("--comment-panel-right","0")),br.setProperty("--comment-panel-"+Q,a[0].toString()+"px"))}if(Br.BIMX_CONFIGS.roamPos){const Q=Vt("roamPos").pos,a=parseInt(Vt("topHeight")),x=parseInt(Vt("bottomHeight"));Q.includes("top")&&(br.setProperty("--roam-toolbar-top",`${(30+a).toString()}px`),br.setProperty("--roam-toolbar-bottom","unset")),Q.includes("bottom")&&(br.setProperty("--roam-toolbar-top","unset"),br.setProperty("--roam-toolbar-bottom",`${(14+x).toString()}px`))}}static get currentTheme(){return document.documentElement.getAttribute("data-theme")}static setTheme(Q){document.documentElement.setAttribute("data-theme",Q)}static setProperty(Q,a){document.body.style.setProperty(Q,a)}static getProperty(Q){return document.body.style.getPropertyValue(Q)}}const Th=(N,Q)=>{let a=0,x=0;return Vt("navCubePos").pos.includes("left")?a+=parseInt(Vt("leftWidth")):Vt("navCubePos").pos.includes("right")&&(a+=parseInt(Vt("rightWidth"))),Vt("navCubePos").pos.includes("top")?x+=parseInt(Vt("topHeight")):Vt("navCubePos").pos.includes("bottom")&&(x+=parseInt(Vt("bottomHeight"))),[N?a+Q:a,x]},EL={class:"unfold_btn"},BL=["onClick"],PL={key:0,class:"tctwins_btn"},SL=["src"],kL=["src"],ML=["src"],TL={key:1,class:"left_button_group"},IL=["src"],DL={key:2,class:"right_button_group"},FL={key:0,class:"cooperate_btn mobile_toggle"},RL=["src"],OL={key:1,class:"bcf_btn mobile_toggle"},NL=["src"],LL={key:3,class:"exit_fullscreen"},jL=["src"],VL={class:"click_events"},UL=s.defineComponent({__name:"AppToolbar",props:["visibleTools"],emits:["emitHandler"],setup(N,{emit:Q}){const a=pi(),x=ji(),S=s.ref(Br.BIMX_CONFIGS.enableTree),A=s.ref(Br.BIMX_CONFIGS.showInspector),h=s.computed(()=>j=>j=="tree"?S.value:j=="inspector"?A.value:!0),d=()=>{const{eventTrigger:j}=window.bimViewer;j.on("treeAllReady",H=>{Bi("enableTree",!0),S.value=!0}),j.on("metaLoaded",H=>{Bi("showInspector",!0),A.value=!0})};or.on("BimViewer",d);const u=x.tools.filter(j=>j.id<14||j.id==17);s.onMounted(()=>{S.value&&x.setToolActiveStatusBykey("tree",!0)});const l=Q,c=j=>{l("emitHandler",j)},f=j=>{v.value=j,R.value=!0,U.value=!0,k.value.enable()};or.on("hideToolbar",f);const p=s.ref(!1),m=j=>{p.value=j,br.setProperty("--toolbar-tool-bottom",`${p.value?"3.8":"1.44"}rem`)};or.on("expandMenu",m),s.onBeforeUnmount(()=>{or.off("hideToolbar",f),or.off("expandMenu",m),or.off("BimViewer",d)});const v=s.ref(!1),_=s.ref(!1),b=j=>{const H=x.getToolByKey(j);H&&(H.isActive?(j!=="reset"&&(R.value=!0,U.value=!0,k.value.enable(),j==="mouse"?T.value=x.isToolActiveBykey("navigate"):T.value=!1),v.value=!1):(j!=="reset"&&j!=="fullscreen"&&j!=="cooperate"&&j!=="mouse"&&(x.setAllToolClose(["fullscreen","mouse"].map(W=>{var K;return(K=x.getToolByKey(W))==null?void 0:K.id}).filter(Boolean)),Ci.SetAllClose()),j!=="reset"&&j!=="navigate"&&j!=="enjoy"&&j!=="share"&&j!=="mouse"&&(R.value=!1,U.value=!1,k.value.disable(),x.setToolActiveStatusBykey("mouse",!1)),j!=="reset"&&(T.value=j==="navigate"),j==="mouse"&&(T.value=x.isToolActiveBykey("navigate")),(j==="comment"||j==="tree"||j==="inspector"||j==="section")&&(v.value=!0),j==="navigate"&&(R.value=!0,U.value=!0,k.value.enable(),T.value=!0)),j==="fullscreen"&&(H.isActive?_.value=!1:_.value=!0),w(H))},w=j=>{var H;j.key!=="fullscreen"&&Ci.SetToolActiveByKey(j.key),x.setToolActiveStatus(j.id),c({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:j.id,toolKey:j.key,status:(H=x.getToolById(j.id))==null?void 0:H.isActive}})},C=()=>{c({isTool:!1,event_target:"ToolBar",event_name:"exitViewer",content:{}})},k=s.ref(),T=s.ref(!1),R=s.ref(!0),U=s.ref(!0),G=()=>{k.value.reset(),window.bimViewer.setAllObjectsVisible(!0),window.bimViewer.setAllObjectsXRayed(!1),window.bimViewer.setAllObjectsSelected(!1),window.bimViewer.setAllObjectsHighlighted(!1),window.bimViewer.setAllObjectsEdges(window.bimViewer.edgesActive)};return(j,H)=>{var $,O,L,M,I,F,V,D,X,ee;const W=yn,K=Tk;return s.openBlock(),s.createElementBlock(s.Fragment,null,[!_.value&&!v.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:"mobile_toolbar",style:s.normalizeStyle({height:p.value?"3.8rem":"unset"})},[s.createElementVNode("div",EL,[s.createElementVNode("div",{class:"unfold_wrapper",onClick:H[0]||(H[0]=q=>m(!p.value))},H[6]||(H[6]=[s.createElementVNode("div",null,null,-1)]))]),s.createVNode(W,null,{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["tctwins_toolbar",{tctwins_toolbar_expend:p.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.visibleTools,q=>(s.openBlock(),s.createElementBlock("div",{key:q.id,class:"tctwins_btn_group",onClick:ne=>b(q.key)},[s.unref(u).includes(q)&&h.value(q.key)?(s.openBlock(),s.createElementBlock("div",PL,[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bar/new-icons/bimkk-mobile-toolbar-${q.isActive?q.imgActive:q.img}.svg`},null,8,SL),s.createElementVNode("span",{class:s.normalizeClass(q.hasActiveState&&s.unref(x).isToolActive(q.id)?"tool_name_active":"tool_name")},s.toDisplayString(s.unref(x).isToolActive(q.id)&&q.key==="fullscreen"?s.unref(a)("toolbar.exitFullscreen"):s.unref(a)(q.name)),3)])):s.createCommentVNode("",!0)],8,BL))),128))],2)]),_:1}),U.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["mouse_btn",{mouse_higher:T.value}])},[s.createElementVNode("div",{class:"mouse",onClick:H[1]||(H[1]=q=>b("mouse"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/industry-viewer/action-bar/${($=s.unref(x).getToolByKey("mouse"))!=null&&$.isActive?(O=s.unref(x).getToolByKey("mouse"))==null?void 0:O.imgActive:(L=s.unref(x).getToolByKey("mouse"))==null?void 0:L.img}.svg`},null,8,kL),s.createElementVNode("span",{style:s.normalizeStyle({color:(M=s.unref(x).getToolByKey("mouse"))!=null&&M.isActive?"#1457F7":"#262626"})},s.toDisplayString(s.unref(a)("toolbar.virtualMouse")),5)]),s.createElementVNode("div",{class:"reset",onClick:G},[s.createElementVNode("img",{src:`${s.unref(Ft)}/industry-viewer/reset.svg`},null,8,ML),s.createElementVNode("span",null,s.toDisplayString(s.unref(a)("common.reset")),1)])],2)):s.createCommentVNode("",!0)],4)):s.createCommentVNode("",!0),_.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",TL,[s.unref(Vt)("backButton")?(s.openBlock(),s.createElementBlock("div",{key:0,class:"back mobile_toggle",onClick:H[2]||(H[2]=q=>C())},[s.createElementVNode("img",{src:s.unref(Ft)+"/bim-viewer/close_black.png"},null,8,IL)])):s.createCommentVNode("",!0)])),_.value?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",DL,[N.visibleTools&&s.unref(x).isToolEnableBykey("cooperate")?(s.openBlock(),s.createElementBlock("div",FL,[s.createElementVNode("div",{class:s.normalizeClass(["tctwins_btn",{tctwins_btn_active:s.unref(x).isToolActiveBykey("cooperate")&&(((I=s.unref(x).getToolByKey("cooperate"))==null?void 0:I.hasActiveState)??!1)}]),onClick:H[3]||(H[3]=q=>b("cooperate"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/bim-viewer/action-bar/${s.unref(x).isToolActiveBykey("cooperate")?(V=s.unref(x).getToolByKey("cooperate"))==null?void 0:V.imgActive:(F=s.unref(x).getToolByKey("cooperate"))==null?void 0:F.img}.svg`},null,8,RL)],2)])):s.createCommentVNode("",!0),N.visibleTools&&s.unref(x).isToolEnableBykey("bcf")?(s.openBlock(),s.createElementBlock("div",OL,[s.createElementVNode("div",{class:s.normalizeClass(["tctwins_btn",{tctwins_btn_active:s.unref(x).isToolActiveBykey("bcf")&&(((D=s.unref(x).getToolByKey("bcf"))==null?void 0:D.hasActiveState)??!1)}]),onClick:H[4]||(H[4]=q=>b("bcf"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/bim-viewer/action-bar/${s.unref(x).isToolActiveBykey("bcf")?(ee=s.unref(x).getToolByKey("bcf"))==null?void 0:ee.imgActive:(X=s.unref(x).getToolByKey("bcf"))==null?void 0:X.img}.svg`},null,8,NL)],2)])):s.createCommentVNode("",!0)])),_.value?(s.openBlock(),s.createElementBlock("div",LL,[s.createElementVNode("div",{class:"exit_full_btn",onClick:H[5]||(H[5]=q=>b("fullscreen"))},[s.createElementVNode("img",{src:`${s.unref(Ft)}/industry-viewer/action-bar/fullscreen-active.svg`},null,8,jL)])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",VL,[s.createVNode(K,{ref_key:"clickEventRef",ref:k},null,512)],512),[[s.vShow,R.value]])],64)}}}),ti=(N,Q)=>{const a=N.__vccOpts||N;for(const[x,S]of Q)a[x]=S;return a},HL=ti(UL,[["__scopeId","data-v-eef618d2"]]),zL={class:"bimx-tools-wrapper"},GL={class:"left_buttons"},QL=["onClick"],WL=["src"],$L={class:"tctwins_toolbar_wrapper"},KL={class:"tctwins_toolbar"},XL=["onClick"],YL=["src"],JL={key:1,class:"splitLine"},ZL={class:"right_buttons"},qL=["onClick"],e5=["src"],t5=ti(s.defineComponent({__name:"Toolbar",props:["visibleTools"],emits:["emitHandler"],setup(N,{emit:Q}){const a=pi(),x=s.ref(Br.BIMX_CONFIGS.enableTree),S=s.ref(Br.BIMX_CONFIGS.showInspector),A=()=>{const{eventTrigger:w}=window.bimViewer;w.on("treeAllReady",C=>{Bi("enableTree",!0),x.value=!0}),w.on("metaLoaded",C=>{Bi("showInspector",!0),S.value=!0})};or.on("BimViewer",A),s.onMounted(()=>{Br.BIMX_CONFIGS.enableTree&&(x.value=!0)}),s.onUnmounted(()=>{or.off("BimViewer",A)});const h=s.computed(()=>w=>w=="tree"?x.value:!0),d=s.computed(()=>w=>w=="inspector"?S.value:!0);Ma.BIMX_CONFIGS.Toolbar||(or.on("BIMX_CONFIGS",()=>{Br.BIMX_CONFIGS.enableTree&&(x.value=!0)}),Ma.BIMX_CONFIGS.Toolbar=!0);const u=Q,l=w=>{u("emitHandler",w)},c=ji(),f=c.tools.filter(w=>w.position==1),p=c.tools.filter(w=>w.position==2),m=w=>{c.isToolActive(w.id)||w.id!=10&&w.id!=1&&(c.setAllToolClose([0,14]),Ci.SetAllClose()),b(w)},v=w=>{c.isToolActive(w.id)||(w.key=="bcf"?(c.setAllToolClose([7,8,9,11]),Ci.SetAllClose()):c.setToolActiveStatusBykey("bcf",!1)),b(w)},_=w=>{c.isToolActive(w.id)||w.key=="enjoy"&&(c.setAllToolClose(),Ci.SetAllClose()),b(w)},b=w=>{Ci.SetToolActiveByKey(w.key),c.setToolActiveStatus(w.id),l({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:w.id,toolKey:w.key,status:w.isActive}})};return(w,C)=>{const k=ku;return s.openBlock(),s.createElementBlock("div",zL,[s.createElementVNode("div",GL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(f),(T,R)=>(s.openBlock(),s.createElementBlock("div",{key:T.id,onClick:U=>v(T)},[T.position==1&&s.unref(c).isToolEnable(T.id)&&h.value(T.key)?(s.openBlock(),s.createBlock(k,{key:0,content:s.unref(a)(T.name),placement:"right",effect:"light"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["toggle_btn",{tctwins_btn_active:T.isActive&&T.hasActiveState}])},[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bars/${T.isActive?T.imgActive:T.img}.svg`,alt:""},null,8,WL)],2)]),_:2},1032,["content"])):s.createCommentVNode("",!0)],8,QL))),128))]),s.createElementVNode("div",$L,[s.createElementVNode("div",KL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(N.visibleTools,(T,R)=>(s.openBlock(),s.createElementBlock("div",{key:T.id,class:"tctwins_btn-group",onClick:U=>m(T)},[d.value(T.key)?(s.openBlock(),s.createBlock(k,{key:0,content:s.unref(a)(T.name),placement:"top",effect:"light"},{default:s.withCtx(()=>[T.position==0?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["tctwins_btn",{tctwins_btn_active:T.isActive&&T.hasActiveState}])},[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bars/${T.isActive?T.imgActive:T.img}.svg`,alt:""},null,8,YL)],2)):s.createCommentVNode("",!0)]),_:2},1032,["content"])):s.createCommentVNode("",!0),T.isShowDelimiter&&R!=N.visibleTools.length-1?(s.openBlock(),s.createElementBlock("div",JL)):s.createCommentVNode("",!0)],8,XL))),128))])]),s.createElementVNode("div",ZL,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(p),(T,R)=>(s.openBlock(),s.createElementBlock("div",{key:T.id,onClick:U=>_(T)},[T.position==2&&s.unref(c).isToolEnable(T.id)?(s.openBlock(),s.createBlock(k,{key:0,content:s.unref(a)(T.name),placement:"left",effect:"light"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:s.normalizeClass(["toggle_btn",{tctwins_btn_active:T.isActive&&T.hasActiveState}])},[s.createElementVNode("img",{class:"img",src:`${s.unref(Ft)}/bim-viewer/action-bars/${T.isActive?T.imgActive:T.img}.svg`,alt:""},null,8,e5)],2)]),_:2},1032,["content"])):s.createCommentVNode("",!0)],8,qL))),128))])])}}}),[["__scopeId","data-v-e4035baa"]]),r5="1.1.0";async function i5(){try{return(await Yl.get(`${qS}/oss/sts`)).data.data}catch(N){throw console.error("Error fetching data:",N),N}}async function ow(){try{const N=await i5();return new XS({region:"oss-cn-beijing",accessKeyId:N.accessKeyId,accessKeySecret:N.accessKeySecret,stsToken:N.securityToken,bucket:N.bucketName})}catch(N){console.log("getSTStoken() throw an error: ",N)}}class ja{static async getBuffer(Q,a,x){try{const A=await(await ow()).get(Q);a(A.content.buffer)}catch(S){x&&x(S)}}static async requestFileFromOSS(Q,a,x,S){try{const A=await ow();if(a){const h=await A.get(`${Q}/metadata.json`);x(JSON.parse(h.content))}else{const h=await A.get(`${Q}/index.json`);x(JSON.parse(h.content))}}catch(A){console.error("请求文件失败:",A),S(A)}}static async downloadFile(Q){try{const a=await fetch(Q);if(!a.ok)throw new Error(`Failed to fetch file: ${a.status} ${a.statusText}`);return await a.arrayBuffer()}catch(a){throw console.error("Error fetching file:",a),a}}}const Ih=N=>{if(!N)return"";const Q=N.split("?")[0],a=Q.lastIndexOf("/");if(Q.lastIndexOf(".")===-1)return Q.slice(a+1);const S=Q.slice(a+1),A=S.lastIndexOf(".");return A===-1?S:S.slice(0,A)},mc=N=>{const Q=N.lastIndexOf(".");let a=[];return Q!==-1&&(a=[N.slice(0,Q),N.slice(Q+1)]),a[0]},aw=[];function n5(N){const{viewer:Q}=window.bimViewer,{scene:a}=Q,x=a.models[N];if(!x){console.error("没有找到正确的模型,无法检测构建异常");return}s5({points:o5(x.aabbs),epsilon:100,min_samples:a.numObjects/4>=1?a.numObjects/4:1},S=>{if(S.noise.length>0){const{noise:A}=S;for(const h in A)aw.push(a.objectIds[A[h]]);window.bimViewer.updateAABB(aw,()=>{Q.cameraFlight.jumpTo({aabb:Q.scene.aabb})})}if(S.labels_count>1){const{labels:A}=S;let h;const d=S.change_indices,u=[];for(let l=0;l<d.length;l++)h=d[l],l==d.length-1?u.push(a.objectIds.slice(h,A.length)):u.push(a.objectIds.slice(h,d[l+1]));window.bimViewer.setPartialObjectIds(u)}})}function s5(N,Q){console.log("start dbscan..."),fetch(`${ek}/dbscan/convert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)}).then(a=>(a.ok,a.json())).then(a=>{if(a&&a.error)throw new Error(a.error);a.noise.length>0||a.labels_count>1?(Q(a),console.log("DBSCAN Result:",`noise:${a.noise}`,`labels_count:${a.labels_count}`)):(console.log("DBSCAN Result:",a),console.log("DBSCAN Result: no outlier"))}).catch(a=>{console.error("DBSCAN failed:",a)})}function o5(N){const Q=[];for(let a=0;a<N.length;a++){const x=N[a],S=[(x[0]+x[3])/2,(x[1]+x[4])/2,(x[2]+x[5])/2];Q.push(S)}return Q}let lw=!1;function a5(N,Q,a,x,S){const A=new Date().getTime();window.bimViewer.loadModel(N,a,()=>{x&&x({code:200,result:N+"模型加载完成!"})},h=>{x&&x({code:-1,result:N+"模型加载失败!",msg:h})},{modelType:Q,...S||{}}),lw||(lw=!0,window.bimViewer.modelsExplorer.on("modelLoaded",()=>{window.bimViewer.setAllObjectsEdges(!1);const d=new Date().getTime()-A;console.log(`加载时长: ${d/1e3} s`),Vt("multiModel")?console.log("集成模式下不进行离群点检测"):Vt("outliersDetect")&&n5(N)}))}var cw={"./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"(N,Q,a){a.r(Q),a.d(Q,{AlphaFormat:()=>nx,AmbientLight:()=>kA,AngleMeasurementsControl:()=>cs,AngleMeasurementsMouseControl:()=>mi,AngleMeasurementsPlugin:()=>Zi,AngleMeasurementsSimulateMouseControl:()=>wc,AngleMeasurementsTouchControl:()=>Ru,AnnotationsPlugin:()=>Aq,AxisGizmoPlugin:()=>rte,BCFViewpointsPlugin:()=>_se,Bitmap:()=>zx,ByteType:()=>Kw,CameraMemento:()=>wC,CameraPath:()=>Mse,CameraPathAnimation:()=>od,Canvas:()=>Sw,ClampToEdgeWrapping:()=>xs,Component:()=>$e,CompressedMediaType:()=>_ee,Configs:()=>sf,CubicBezierCurve:()=>Vse,Curve:()=>sd,DefaultLoadingManager:()=>$2,DepthFormat:()=>lx,DepthStencilFormat:()=>cx,DirLight:()=>_o,DistanceMeasurementsControl:()=>gf,DistanceMeasurementsMouseControl:()=>lC,DistanceMeasurementsPlugin:()=>Ese,DistanceMeasurementsSimulateMouseControl:()=>Pse,DistanceMeasurementsTouchControl:()=>Bse,EdgeMaterial:()=>Gh,EmphasisMaterial:()=>Hi,FloatType:()=>qw,Fresnel:()=>dte,Frustum:()=>us,FrustumPlane:()=>Cl,GIFMediaType:()=>vee,GLTFDefaultDataSource:()=>fC,GLTFLoaderPlugin:()=>mve,HalfFloatType:()=>ex,ImagePlane:()=>Dse,IntType:()=>Jw,JPEGMediaType:()=>yee,KTX2TextureTranscoder:()=>Rc,LASLoaderPlugin:()=>p0e,LambertMaterial:()=>nte,LightMap:()=>Nse,LineSet:()=>aC,LinearEncoding:()=>Os,LinearFilter:()=>ns,LinearMipMapLinearFilter:()=>kc,LinearMipMapNearestFilter:()=>ju,LinearMipmapLinearFilter:()=>Pl,LinearMipmapNearestFilter:()=>gee,Loader:()=>K2,LoadingManager:()=>W2,LocaleService:()=>pC,LuminanceAlphaFormat:()=>ax,LuminanceFormat:()=>ox,Map:()=>Ae,Marker:()=>Mr,Mesh:()=>Yt,MetallicMaterial:()=>ate,MirroredRepeatWrapping:()=>da,ModelMemento:()=>jse,NavCubePlugin:()=>gve,NearestFilter:()=>Bl,NearestMipMapLinearFilter:()=>Sc,NearestMipMapNearestFilter:()=>Lu,NearestMipmapLinearFilter:()=>$w,NearestMipmapNearestFilter:()=>Ww,Node:()=>pa,ObjectEditPlugin:()=>n0e,ObjectsKdTree3:()=>ge,ObjectsMemento:()=>xC,PNGMediaType:()=>bee,Path:()=>Use,PerformanceModel:()=>zse,PhongMaterial:()=>oi,Plugin:()=>Ye,PointLight:()=>Fse,PointerLens:()=>se,QuadraticBezierCurve:()=>Hse,Queue:()=>fe,RGBAFormat:()=>Vu,RGBAIntegerFormat:()=>px,RGBA_ASTC_10x10_Format:()=>KA,RGBA_ASTC_10x5_Format:()=>QA,RGBA_ASTC_10x6_Format:()=>WA,RGBA_ASTC_10x8_Format:()=>$A,RGBA_ASTC_12x10_Format:()=>XA,RGBA_ASTC_12x12_Format:()=>YA,RGBA_ASTC_4x4_Format:()=>Jh,RGBA_ASTC_5x4_Format:()=>LA,RGBA_ASTC_5x5_Format:()=>jA,RGBA_ASTC_6x5_Format:()=>VA,RGBA_ASTC_6x6_Format:()=>UA,RGBA_ASTC_8x5_Format:()=>HA,RGBA_ASTC_8x6_Format:()=>zA,RGBA_ASTC_8x8_Format:()=>GA,RGBA_BPTC_Format:()=>Zh,RGBA_ETC2_EAC_Format:()=>Yh,RGBA_PVRTC_2BPPV1_Format:()=>OA,RGBA_PVRTC_4BPPV1_Format:()=>Kh,RGBA_S3TC_DXT1_Format:()=>Qh,RGBA_S3TC_DXT3_Format:()=>Wh,RGBA_S3TC_DXT5_Format:()=>Hu,RGBFormat:()=>sx,RGB_ETC1_Format:()=>NA,RGB_ETC2_Format:()=>Xh,RGB_PVRTC_2BPPV1_Format:()=>RA,RGB_PVRTC_4BPPV1_Format:()=>$h,RGB_S3TC_DXT1_Format:()=>Uu,RGFormat:()=>hx,RGIntegerFormat:()=>fx,ReadableGeometry:()=>Gr,RedFormat:()=>ux,RedIntegerFormat:()=>dx,ReflectionMap:()=>Ose,Renderer:()=>Rw,RepeatWrapping:()=>nn,Scene:()=>Nu,SceneModel:()=>Il,SceneModelMesh:()=>Qx,SceneModelTransform:()=>eC,SectionBox:()=>jg,SectionPlane:()=>ef,SectionPlanesPlugin:()=>Fve,ShortType:()=>Xw,Skybox:()=>Vg,SkyboxesPlugin:()=>jve,SpecularMaterial:()=>ute,SplineCurve:()=>_f,SpriteMarker:()=>Lse,StoreyViewsPlugin:()=>Lve,Texture:()=>Mc,TextureTranscoder:()=>Gse,TreeViewPlugin:()=>Vve,UnsignedByteType:()=>FA,UnsignedInt248Type:()=>ix,UnsignedIntType:()=>Zw,UnsignedShort4444Type:()=>tx,UnsignedShort5551Type:()=>rx,UnsignedShortType:()=>Yw,VBOGeometry:()=>Vx,ViewCullPlugin:()=>Gve,Viewer:()=>$de,WebIFCLoaderPlugin:()=>r0e,WorkerPool:()=>Y2,XTCDefaultDataSource:()=>xS,XTCLoaderPlugin:()=>Zve,buildBoxGeometry:()=>Pc,buildBoxLinesGeometry:()=>tf,buildCylinderGeometry:()=>Rn,buildGridGeometry:()=>Ux,buildLineGeometry:()=>mte,buildPlaneGeometry:()=>ng,buildPolylineGeometry:()=>Hx,buildPolylineGeometryFromCurve:()=>pte,buildSphereGeometry:()=>kl,buildTorusGeometry:()=>Zs,buildVectorTextGeometry:()=>qh,createRTCViewMat:()=>et,frustumIntersectsAABB3:()=>Bw,getKTX2TextureTranscoder:()=>J2,getPlaneRTCPos:()=>Bt,load3DSGeometry:()=>hte,loadOBJGeometry:()=>fte,math:()=>B,rtcToWorldPos:()=>It,sRGBEncoding:()=>Yi,setFrustum:()=>Ew,stats:()=>ue,utils:()=>Dt,worldToRTCPos:()=>lt,worldToRTCPositions:()=>vt});var x=d().mark(yP),S=d().mark(sy);function A(g,i){var t=Object.keys(g);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(g);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(g,r).enumerable})),t.push.apply(t,e)}return t}function h(g){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?A(Object(t),!0).forEach(function(e){M(g,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach(function(e){Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(t,e))})}return g}function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return i};var g,i={},t=Object.prototype,e=t.hasOwnProperty,r=Object.defineProperty||function(At,bt,wt){At[bt]=wt.value},o=typeof Symbol=="function"?Symbol:{},n=o.iterator||"@@iterator",y=o.asyncIterator||"@@asyncIterator",E=o.toStringTag||"@@toStringTag";function P(At,bt,wt){return Object.defineProperty(At,bt,{value:wt,enumerable:!0,configurable:!0,writable:!0}),At[bt]}try{P({},"")}catch{P=function(wt,Ot,Wt){return wt[Ot]=Wt}}function z(At,bt,wt,Ot){var Wt=bt&&bt.prototype instanceof we?bt:we,jt=Object.create(Wt.prototype),ar=new st(Ot||[]);return r(jt,"_invoke",{value:qe(At,wt,ar)}),jt}function Y(At,bt,wt){try{return{type:"normal",arg:At.call(bt,wt)}}catch(Ot){return{type:"throw",arg:Ot}}}i.wrap=z;var J="suspendedStart",ie="suspendedYield",le="executing",Z="completed",ye={};function we(){}function Be(){}function xe(){}var Se={};P(Se,n,function(){return this});var Te=Object.getPrototypeOf,Me=Te&&Te(Te(ft([])));Me&&Me!==t&&e.call(Me,n)&&(Se=Me);var Fe=xe.prototype=we.prototype=Object.create(Se);function Re(At){["next","throw","return"].forEach(function(bt){P(At,bt,function(wt){return this._invoke(bt,wt)})})}function He(At,bt){function wt(Wt,jt,ar,Nr){var Fr=Y(At[Wt],At,jt);if(Fr.type!=="throw"){var kr=Fr.arg,$r=kr.value;return $r&&I($r)=="object"&&e.call($r,"__await")?bt.resolve($r.__await).then(function(dr){wt("next",dr,ar,Nr)},function(dr){wt("throw",dr,ar,Nr)}):bt.resolve($r).then(function(dr){kr.value=dr,ar(kr)},function(dr){return wt("throw",dr,ar,Nr)})}Nr(Fr.arg)}var Ot;r(this,"_invoke",{value:function(jt,ar){function Nr(){return new bt(function(Fr,kr){wt(jt,ar,Fr,kr)})}return Ot=Ot?Ot.then(Nr,Nr):Nr()}})}function qe(At,bt,wt){var Ot=J;return function(Wt,jt){if(Ot===le)throw Error("Generator is already running");if(Ot===Z){if(Wt==="throw")throw jt;return{value:g,done:!0}}for(wt.method=Wt,wt.arg=jt;;){var ar=wt.delegate;if(ar){var Nr=rt(ar,wt);if(Nr){if(Nr===ye)continue;return Nr}}if(wt.method==="next")wt.sent=wt._sent=wt.arg;else if(wt.method==="throw"){if(Ot===J)throw Ot=Z,wt.arg;wt.dispatchException(wt.arg)}else wt.method==="return"&&wt.abrupt("return",wt.arg);Ot=le;var Fr=Y(At,bt,wt);if(Fr.type==="normal"){if(Ot=wt.done?Z:ie,Fr.arg===ye)continue;return{value:Fr.arg,done:wt.done}}Fr.type==="throw"&&(Ot=Z,wt.method="throw",wt.arg=Fr.arg)}}}function rt(At,bt){var wt=bt.method,Ot=At.iterator[wt];if(Ot===g)return bt.delegate=null,wt==="throw"&&At.iterator.return&&(bt.method="return",bt.arg=g,rt(At,bt),bt.method==="throw")||wt!=="return"&&(bt.method="throw",bt.arg=new TypeError("The iterator does not provide a '"+wt+"' method")),ye;var Wt=Y(Ot,At.iterator,bt.arg);if(Wt.type==="throw")return bt.method="throw",bt.arg=Wt.arg,bt.delegate=null,ye;var jt=Wt.arg;return jt?jt.done?(bt[At.resultName]=jt.value,bt.next=At.nextLoc,bt.method!=="return"&&(bt.method="next",bt.arg=g),bt.delegate=null,ye):jt:(bt.method="throw",bt.arg=new TypeError("iterator result is not an object"),bt.delegate=null,ye)}function je(At){var bt={tryLoc:At[0]};1 in At&&(bt.catchLoc=At[1]),2 in At&&(bt.finallyLoc=At[2],bt.afterLoc=At[3]),this.tryEntries.push(bt)}function Oe(At){var bt=At.completion||{};bt.type="normal",delete bt.arg,At.completion=bt}function st(At){this.tryEntries=[{tryLoc:"root"}],At.forEach(je,this),this.reset(!0)}function ft(At){if(At||At===""){var bt=At[n];if(bt)return bt.call(At);if(typeof At.next=="function")return At;if(!isNaN(At.length)){var wt=-1,Ot=function Wt(){for(;++wt<At.length;)if(e.call(At,wt))return Wt.value=At[wt],Wt.done=!1,Wt;return Wt.value=g,Wt.done=!0,Wt};return Ot.next=Ot}}throw new TypeError(I(At)+" is not iterable")}return Be.prototype=xe,r(Fe,"constructor",{value:xe,configurable:!0}),r(xe,"constructor",{value:Be,configurable:!0}),Be.displayName=P(xe,E,"GeneratorFunction"),i.isGeneratorFunction=function(At){var bt=typeof At=="function"&&At.constructor;return!!bt&&(bt===Be||(bt.displayName||bt.name)==="GeneratorFunction")},i.mark=function(At){return Object.setPrototypeOf?Object.setPrototypeOf(At,xe):(At.__proto__=xe,P(At,E,"GeneratorFunction")),At.prototype=Object.create(Fe),At},i.awrap=function(At){return{__await:At}},Re(He.prototype),P(He.prototype,y,function(){return this}),i.AsyncIterator=He,i.async=function(At,bt,wt,Ot,Wt){Wt===void 0&&(Wt=Promise);var jt=new He(z(At,bt,wt,Ot),Wt);return i.isGeneratorFunction(bt)?jt:jt.next().then(function(ar){return ar.done?ar.value:jt.next()})},Re(Fe),P(Fe,E,"Generator"),P(Fe,n,function(){return this}),P(Fe,"toString",function(){return"[object Generator]"}),i.keys=function(At){var bt=Object(At),wt=[];for(var Ot in bt)wt.push(Ot);return wt.reverse(),function Wt(){for(;wt.length;){var jt=wt.pop();if(jt in bt)return Wt.value=jt,Wt.done=!1,Wt}return Wt.done=!0,Wt}},i.values=ft,st.prototype={constructor:st,reset:function(bt){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(Oe),!bt)for(var wt in this)wt.charAt(0)==="t"&&e.call(this,wt)&&!isNaN(+wt.slice(1))&&(this[wt]=g)},stop:function(){this.done=!0;var bt=this.tryEntries[0].completion;if(bt.type==="throw")throw bt.arg;return this.rval},dispatchException:function(bt){if(this.done)throw bt;var wt=this;function Ot(kr,$r){return ar.type="throw",ar.arg=bt,wt.next=kr,$r&&(wt.method="next",wt.arg=g),!!$r}for(var Wt=this.tryEntries.length-1;Wt>=0;--Wt){var jt=this.tryEntries[Wt],ar=jt.completion;if(jt.tryLoc==="root")return Ot("end");if(jt.tryLoc<=this.prev){var Nr=e.call(jt,"catchLoc"),Fr=e.call(jt,"finallyLoc");if(Nr&&Fr){if(this.prev<jt.catchLoc)return Ot(jt.catchLoc,!0);if(this.prev<jt.finallyLoc)return Ot(jt.finallyLoc)}else if(Nr){if(this.prev<jt.catchLoc)return Ot(jt.catchLoc,!0)}else{if(!Fr)throw Error("try statement without catch or finally");if(this.prev<jt.finallyLoc)return Ot(jt.finallyLoc)}}}},abrupt:function(bt,wt){for(var Ot=this.tryEntries.length-1;Ot>=0;--Ot){var Wt=this.tryEntries[Ot];if(Wt.tryLoc<=this.prev&&e.call(Wt,"finallyLoc")&&this.prev<Wt.finallyLoc){var jt=Wt;break}}jt&&(bt==="break"||bt==="continue")&&jt.tryLoc<=wt&&wt<=jt.finallyLoc&&(jt=null);var ar=jt?jt.completion:{};return ar.type=bt,ar.arg=wt,jt?(this.method="next",this.next=jt.finallyLoc,ye):this.complete(ar)},complete:function(bt,wt){if(bt.type==="throw")throw bt.arg;return bt.type==="break"||bt.type==="continue"?this.next=bt.arg:bt.type==="return"?(this.rval=this.arg=bt.arg,this.method="return",this.next="end"):bt.type==="normal"&&wt&&(this.next=wt),ye},finish:function(bt){for(var wt=this.tryEntries.length-1;wt>=0;--wt){var Ot=this.tryEntries[wt];if(Ot.finallyLoc===bt)return this.complete(Ot.completion,Ot.afterLoc),Oe(Ot),ye}},catch:function(bt){for(var wt=this.tryEntries.length-1;wt>=0;--wt){var Ot=this.tryEntries[wt];if(Ot.tryLoc===bt){var Wt=Ot.completion;if(Wt.type==="throw"){var jt=Wt.arg;Oe(Ot)}return jt}}throw Error("illegal catch attempt")},delegateYield:function(bt,wt,Ot){return this.delegate={iterator:ft(bt),resultName:wt,nextLoc:Ot},this.method==="next"&&(this.arg=g),ye}},i}function u(g,i,t,e,r,o,n){try{var y=g[o](n),E=y.value}catch(P){return void t(P)}y.done?i(E):Promise.resolve(E).then(e,r)}function l(g){return function(){var i=this,t=arguments;return new Promise(function(e,r){var o=g.apply(i,t);function n(E){u(o,e,r,n,y,"next",E)}function y(E){u(o,e,r,n,y,"throw",E)}n(void 0)})}}function c(g){return m(g)||p(g)||w(g)||f()}function f(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
21
21
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p(g){if(typeof Symbol<"u"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}function m(g){if(Array.isArray(g))return C(g)}function v(g,i){var t=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!t){if(Array.isArray(g)||(t=w(g))||i){t&&(g=t);var e=0,r=function(){};return{s:r,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(P){throw P},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22
22
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,n=!0,y=!1;return{s:function(){t=t.call(g)},n:function(){var P=t.next();return n=P.done,P},e:function(P){y=!0,o=P},f:function(){try{n||t.return==null||t.return()}finally{if(y)throw o}}}}function _(g,i){return T(g)||k(g,i)||w(g,i)||b()}function b(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
23
23
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(g,i){if(g){if(typeof g=="string")return C(g,i);var t={}.toString.call(g).slice(8,-1);return t==="Object"&&g.constructor&&(t=g.constructor.name),t==="Map"||t==="Set"?Array.from(g):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?C(g,i):void 0}}function C(g,i){(i==null||i>g.length)&&(i=g.length);for(var t=0,e=Array(i);t<i;t++)e[t]=g[t];return e}function k(g,i){var t=g==null?null:typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(t!=null){var e,r,o,n,y=[],E=!0,P=!1;try{if(o=(t=t.call(g)).next,i===0){if(Object(t)!==t)return;E=!1}else for(;!(E=(e=o.call(t)).done)&&(y.push(e.value),y.length!==i);E=!0);}catch(z){P=!0,r=z}finally{try{if(!E&&t.return!=null&&(n=t.return(),Object(n)!==n))return}finally{if(P)throw r}}return y}}function T(g){if(Array.isArray(g))return g}function R(g,i,t){return i=$(i),U(g,j()?Reflect.construct(i,t||[],$(g).constructor):i.apply(g,t))}function U(g,i){if(i&&(I(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G(g)}function G(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function j(){try{var g=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(j=function(){return!!g})()}function H(g,i,t,e){var r=W($(g.prototype),i,t);return function(o){return r.apply(t,o)}}function W(){return W=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(g,i,t){var e=K(g,i);if(e){var r=Object.getOwnPropertyDescriptor(e,i);return r.get?r.get.call(arguments.length<3?g:t):r.value}},W.apply(null,arguments)}function K(g,i){for(;!{}.hasOwnProperty.call(g,i)&&(g=$(g))!==null;);return g}function $(g){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},$(g)}function O(g,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(i&&i.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),i&&L(g,i)}function L(g,i){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},L(g,i)}function M(g,i,t){return(i=X(i))in g?Object.defineProperty(g,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):g[i]=t,g}function I(g){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},I(g)}function F(g,i){if(!(g instanceof i))throw new TypeError("Cannot call a class as a function")}function V(g,i){for(var t=0;t<i.length;t++){var e=i[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(g,X(e.key),e)}}function D(g,i,t){return i&&V(g.prototype,i),t&&V(g,t),Object.defineProperty(g,"prototype",{writable:!1}),g}function X(g){var i=ee(g,"string");return I(i)=="symbol"?i:i+""}function ee(g,i){if(I(g)!="object"||!g)return g;var t=g[Symbol.toPrimitive];if(t!==void 0){var e=t.call(g,i||"default");if(I(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(g)}function q(g){return new he(g,0)}function ne(g){return function(){return new oe(g.apply(this,arguments))}}function oe(g){var i,t;function e(o,n){try{var y=g[o](n),E=y.value,P=E instanceof he;Promise.resolve(P?E.v:E).then(function(z){if(P){var Y=o==="return"?"return":"next";if(!E.k||z.done)return e(Y,z);z=g[Y](z).value}r(y.done?"return":"normal",z)},function(z){e("throw",z)})}catch(z){r("throw",z)}}function r(o,n){switch(o){case"return":i.resolve({value:n,done:!0});break;case"throw":i.reject(n);break;default:i.resolve({value:n,done:!1})}(i=i.next)?e(i.key,i.arg):t=null}this._invoke=function(o,n){return new Promise(function(y,E){var P={key:o,arg:n,resolve:y,reject:E,next:null};t?t=t.next=P:(i=t=P,e(o,n))})},typeof g.return!="function"&&(this.return=void 0)}oe.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},oe.prototype.next=function(g){return this._invoke("next",g)},oe.prototype.throw=function(g){return this._invoke("throw",g)},oe.prototype.return=function(g){return this._invoke("return",g)};function he(g,i){this.v=g,this.k=i}function te(g){var i,t,e,r=2;for(typeof Symbol<"u"&&(t=Symbol.asyncIterator,e=Symbol.iterator);r--;){if(t&&(i=g[t])!=null)return i.call(g);if(e&&(i=g[e])!=null)return new de(i.call(g));t="@@asyncIterator",e="@@iterator"}throw new TypeError("Object is not async iterable")}function de(g){function i(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(r){return{value:r,done:e}})}return de=function(e){this.s=e,this.n=e.next},de.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return r===void 0?Promise.resolve({value:e,done:!0}):i(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return r===void 0?Promise.reject(e):i(r.apply(this.s,arguments))}},new de(g)}var se=function(){function g(i){var t=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};F(this,g),this.viewer=i,this.scene=this.viewer.scene,this._lensCursorDiv=document.createElement("div"),this._lensCursorDiv.setAttribute("class","pointerLensCursor"),document.body.append(this._lensCursorDiv),this._lensCursorDiv.style.background="pink",this._lensCursorDiv.style.border="2px solid red",this._lensCursorDiv.style.borderRadius="20px",this._lensCursorDiv.style.width="10px",this._lensCursorDiv.style.height="10px",this._lensCursorDiv.style.margin="-200px -200px",this._lensCursorDiv.style.zIndex="100000",this._lensCursorDiv.style.position="absolute",this._lensCursorDiv.style.pointerEvents="none",this._lensContainer=document.createElement("div"),this._lensContainer.setAttribute("class","pointerLens"),this._lensContainer.style.border="1px solid black",this._lensContainer.style.background="white",this._lensContainer.style.borderRadius="50%",this._lensContainer.style.width="300px",this._lensContainer.style.height="300px",this._lensContainer.style.marginTop="85px",this._lensContainer.style.marginLeft="25px",this._lensContainer.style.zIndex="15000",this._lensContainer.style.position="absolute",this._lensContainer.style.pointerEvents="none",this._lensContainer.style.visibility="hidden",this._lensCanvas=document.createElement("canvas"),this._lensCanvas.style.borderRadius="50%",this._lensCanvas.style.width="300px",this._lensCanvas.style.height="300px",this._lensCanvas.style.zIndex="15000",this._lensCanvas.style.pointerEvents="none",document.body.appendChild(this._lensContainer),this._lensContainer.appendChild(this._lensCanvas),this._lensCanvasContext=this._lensCanvas.getContext("2d"),this._canvasElement=this.viewer.scene.canvas.canvas,this._canvasPos=null,this._snappedCanvasPos=null,this._lensPosToggle=!0,this._zoomLevel=e.zoomFactor!==void 0?e.zoomFactor:2,this._active=e.active!==!1,this._visible=!1,this._snapped=!1,this._onViewerRendering=this.viewer.scene.on("rendering",function(){t._active&&t._visible&&t.update()})}return D(g,[{key:"update",value:function(){if(!(!this._active||!this._visible)&&this._canvasPos){var t=this._lensContainer.getBoundingClientRect(),e=this._canvasElement.getBoundingClientRect(),r=this._canvasPos[0]<t.right&&this._canvasPos[0]>t.left&&this._canvasPos[1]<t.bottom&&this._canvasPos[1]>t.top;this._lensContainer.style.marginLeft="25px",r&&(this._lensPosToggle?this._lensContainer.style.marginTop="".concat(e.bottom-e.top-this._lensCanvas.height-85,"px"):this._lensContainer.style.marginTop="85px",this._lensPosToggle=!this._lensPosToggle),this._lensCanvasContext.clearRect(0,0,this._lensCanvas.width,this._lensCanvas.height);var o=Math.max(this._lensCanvas.width,this._lensCanvas.height)/this._zoomLevel;this._lensCanvasContext.drawImage(this._canvasElement,this._canvasPos[0]-o/2,this._canvasPos[1]-o/2,o,o,0,0,this._lensCanvas.width,this._lensCanvas.height);var n=[(t.left+t.right)/2,(t.top+t.bottom)/2];if(this._snappedCanvasPos){var y=this._snappedCanvasPos[0]-this._canvasPos[0],E=this._snappedCanvasPos[1]-this._canvasPos[1];this._lensCursorDiv.style.marginLeft="".concat(n[0]+y*this._zoomLevel-10,"px"),this._lensCursorDiv.style.marginTop="".concat(n[1]+E*this._zoomLevel-10,"px")}else this._lensCursorDiv.style.marginLeft="".concat(n[0]-10,"px"),this._lensCursorDiv.style.marginTop="".concat(n[1]-10,"px")}}},{key:"zoomFactor",get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,this.update()}},{key:"canvasPos",get:function(){return this._canvasPos},set:function(t){this._canvasPos=t,this.update()}},{key:"snappedCanvasPos",get:function(){return this._snappedCanvasPos},set:function(t){this._snappedCanvasPos=t,this.update()}},{key:"snapped",get:function(){return this._snapped},set:function(t){this._snapped=t,t?(this._lensCursorDiv.style.background="greenyellow",this._lensCursorDiv.style.border="2px solid green"):(this._lensCursorDiv.style.background="pink",this._lensCursorDiv.style.border="2px solid red")}},{key:"active",get:function(){return this._active},set:function(t){this._active=t,this._lensContainer.style.visibility=t&&this._visible?"visible":"hidden",(!t||!this._visible)&&(this._lensCursorDiv.style.marginLeft="-100px",this._lensCursorDiv.style.marginTop="-100px"),this.update()}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible=t,this._lensContainer.style.visibility=t&&this._active?"visible":"hidden",(!t||!this._active)&&(this._lensCursorDiv.style.marginLeft="-100px",this._lensCursorDiv.style.marginTop="-100px"),this.update()}},{key:"destroy",value:function(){this._destroyed||(this.viewer.scene.off(this._onViewerRendering),this._lensContainer.removeChild(this._lensCanvas),document.body.removeChild(this._lensContainer),this._destroyed=!0)}}])}(),re=!0,ae=re?Float64Array:Float32Array,Ce=new ae(3),me=new ae(16),ce=new ae(16),pe=new ae(4),B={setDoublePrecisionEnabled:function(i){re=i,ae=re?Float64Array:Float32Array},getDoublePrecisionEnabled:function(){return re},MIN_DOUBLE:-Number.MAX_SAFE_INTEGER,MAX_DOUBLE:Number.MAX_SAFE_INTEGER,MAX_INT:1e7,DEGTORAD:.0174532925,RADTODEG:57.295779513,unglobalizeObjectId:function(i,t){var e=t.indexOf("#");return e===i.length&&t.startsWith(i)?t.substring(e+1):t},globalizeObjectId:function(i,t){return i+"#"+t},safeInv:function(i){var t=1/i;return isNaN(t)||!isFinite(t)?1:t},vec2:function(i){return new ae(i||2)},vec3:function(i){return new ae(i||3)},vec4:function(i){return new ae(i||4)},mat3:function(i){return new ae(i||9)},mat3ToMat4:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new ae(16);return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=0,t[4]=i[3],t[5]=i[4],t[6]=i[5],t[7]=0,t[8]=i[6],t[9]=i[7],t[10]=i[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},mat4:function(i){return new ae(i||16)},mat4ToMat3:function(i,t){},doublesToFloats:function(i,t,e){for(var r=new ae(2),o=0,n=i.length;o<n;o++)B.splitDouble(i[o],r),t[o]=r[0],e[o]=r[1]},splitDouble:function(i,t){var e=ae.from([i])[0],r=i-e;t[0]=e,t[1]=r},createUUID:function(){for(var g=[],i=0;i<256;i++)g[i]=(i<16?"0":"")+i.toString(16);return function(){var t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,r=Math.random()*4294967295|0,o=Math.random()*4294967295|0;return"".concat(g[t&255]+g[t>>8&255]+g[t>>16&255]+g[t>>24&255],"-").concat(g[e&255]).concat(g[e>>8&255],"-").concat(g[e>>16&15|64]).concat(g[e>>24&255],"-").concat(g[r&63|128]).concat(g[r>>8&255],"-").concat(g[r>>16&255]).concat(g[r>>24&255]).concat(g[o&255]).concat(g[o>>8&255]).concat(g[o>>16&255]).concat(g[o>>24&255])}}(),clamp:function(i,t,e){return Math.max(t,Math.min(e,i))},fmod:function(i,t){if(i<t)return console.error("math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring"),i;for(;t<=i;)i-=t;return i},compareVec3:function(i,t){return i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]},negateVec3:function(i,t){return t||(t=i),t[0]=-i[0],t[1]=-i[1],t[2]=-i[2],t},negateVec4:function(i,t){return t||(t=i),t[0]=-i[0],t[1]=-i[1],t[2]=-i[2],t[3]=-i[3],t},addVec4:function(i,t,e){return e||(e=i),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e[3]=i[3]+t[3],e},addVec4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]+t,e[1]=i[1]+t,e[2]=i[2]+t,e[3]=i[3]+t,e},addVec3:function(i,t,e){return e||(e=i),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e},addVec3Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]+t,e[1]=i[1]+t,e[2]=i[2]+t,e},subVec4:function(i,t,e){return e||(e=i),e[0]=i[0]-t[0],e[1]=i[1]-t[1],e[2]=i[2]-t[2],e[3]=i[3]-t[3],e},subVec3:function(i,t,e){return e||(e=i),e[0]=i[0]-t[0],e[1]=i[1]-t[1],e[2]=i[2]-t[2],e},subVec2:function(i,t,e){return e||(e=i),e[0]=i[0]-t[0],e[1]=i[1]-t[1],e},geometricMeanVec2:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];for(var r=new ae(t[0]),o=1;o<t.length;o++)r[0]+=t[o][0],r[1]+=t[o][1];return r[0]/=t.length,r[1]/=t.length,r},subVec4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]-t,e[1]=i[1]-t,e[2]=i[2]-t,e[3]=i[3]-t,e},subScalarVec4:function(i,t,e){return e||(e=i),e[0]=t-i[0],e[1]=t-i[1],e[2]=t-i[2],e[3]=t-i[3],e},mulVec3:function(i,t,e){return e||(e=i),e[0]=i[0]*t[0],e[1]=i[1]*t[1],e[2]=i[2]*t[2],e},mulVec4:function(i,t,e){return e||(e=i),e[0]=i[0]*t[0],e[1]=i[1]*t[1],e[2]=i[2]*t[2],e[3]=i[3]*t[3],e},mulVec4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]*t,e[1]=i[1]*t,e[2]=i[2]*t,e[3]=i[3]*t,e},mulVec3Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]*t,e[1]=i[1]*t,e[2]=i[2]*t,e},mulVec2Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]*t,e[1]=i[1]*t,e},divVec3:function(i,t,e){return e||(e=i),e[0]=i[0]/t[0],e[1]=i[1]/t[1],e[2]=i[2]/t[2],e},divVec4:function(i,t,e){return e||(e=i),e[0]=i[0]/t[0],e[1]=i[1]/t[1],e[2]=i[2]/t[2],e[3]=i[3]/t[3],e},divScalarVec3:function(i,t,e){return e||(e=t),e[0]=i/t[0],e[1]=i/t[1],e[2]=i/t[2],e},divVec3Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]/t,e[1]=i[1]/t,e[2]=i[2]/t,e},divVec4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]/t,e[1]=i[1]/t,e[2]=i[2]/t,e[3]=i[3]/t,e},divScalarVec4:function(i,t,e){return e||(e=t),e[0]=i/t[0],e[1]=i/t[1],e[2]=i/t[2],e[3]=i/t[3],e},dotVec4:function(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]*t[3]},cross3Vec4:function(i,t){var e=i[0],r=i[1],o=i[2],n=t[0],y=t[1],E=t[2];return[r*E-o*y,o*n-e*E,e*y-r*n,0]},cross3Vec3:function(i,t,e){e||(e=i);var r=i[0],o=i[1],n=i[2],y=t[0],E=t[1],P=t[2];return e[0]=o*P-n*E,e[1]=n*y-r*P,e[2]=r*E-o*y,e},sqLenVec4:function(i){return B.dotVec4(i,i)},lenVec4:function(i){return Math.sqrt(B.sqLenVec4(i))},dotVec3:function(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]},dotVec2:function(i,t){return i[0]*t[0]+i[1]*t[1]},sqLenVec3:function(i){return B.dotVec3(i,i)},sqLenVec2:function(i){return B.dotVec2(i,i)},lenVec3:function(i){return Math.sqrt(B.sqLenVec3(i))},distVec3:function(){var g=new ae(3);return function(i,t){return B.lenVec3(B.subVec3(i,t,g))}}(),lenVec2:function(i){return Math.sqrt(B.sqLenVec2(i))},distVec2:function(){var g=new ae(2);return function(i,t){return B.lenVec2(B.subVec2(i,t,g))}}(),rcpVec3:function(i,t){return B.divScalarVec3(1,i,t)},normalizeVec4:function(i,t){var e=1/B.lenVec4(i);return B.mulVec4Scalar(i,e,t)},normalizeVec3:function(i,t){var e=1/B.lenVec3(i);return B.mulVec3Scalar(i,e,t)},normalizeVec2:function(i,t){var e=1/B.lenVec2(i);return B.mulVec2Scalar(i,e,t)},angleVec3:function(i,t){var e=B.dotVec3(i,t)/Math.sqrt(B.sqLenVec3(i)*B.sqLenVec3(t));return e=e<-1?-1:e>1?1:e,Math.acos(e)},vec3FromMat4Scale:function(){var g=new ae(3);return function(i,t){return g[0]=i[0],g[1]=i[1],g[2]=i[2],t[0]=B.lenVec3(g),g[0]=i[4],g[1]=i[5],g[2]=i[6],t[1]=B.lenVec3(g),g[0]=i[8],g[1]=i[9],g[2]=i[10],t[2]=B.lenVec3(g),t}}(),vecToArray:function(){function g(i){return Math.round(i*1e5)/1e5}return function(i){i=Array.prototype.slice.call(i);for(var t=0,e=i.length;t<e;t++)i[t]=g(i[t]);return i}}(),xyzArrayToObject:function(i){return{x:i[0],y:i[1],z:i[2]}},xyzObjectToArray:function(i,t){return t=t||B.vec3(),t[0]=i.x,t[1]=i.y,t[2]=i.z,t},dupMat4:function(i){return i.slice(0,16)},mat4To3:function(i){return[i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]]},m4s:function(i){return[i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i]},setMat4ToZeroes:function(){return B.m4s(0)},setMat4ToOnes:function(){return B.m4s(1)},diagonalMat4v:function(i){return new ae([i[0],0,0,0,0,i[1],0,0,0,0,i[2],0,0,0,0,i[3]])},diagonalMat4c:function(i,t,e,r){return B.diagonalMat4v([i,t,e,r])},diagonalMat4s:function(i){return B.diagonalMat4c(i,i,i,i)},identityMat4:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new ae(16);return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},identityMat3:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new ae(9);return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=1,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i},isIdentityMat4:function(i){return!(i[0]!==1||i[1]!==0||i[2]!==0||i[3]!==0||i[4]!==0||i[5]!==1||i[6]!==0||i[7]!==0||i[8]!==0||i[9]!==0||i[10]!==1||i[11]!==0||i[12]!==0||i[13]!==0||i[14]!==0||i[15]!==1)},negateMat4:function(i,t){return t||(t=i),t[0]=-i[0],t[1]=-i[1],t[2]=-i[2],t[3]=-i[3],t[4]=-i[4],t[5]=-i[5],t[6]=-i[6],t[7]=-i[7],t[8]=-i[8],t[9]=-i[9],t[10]=-i[10],t[11]=-i[11],t[12]=-i[12],t[13]=-i[13],t[14]=-i[14],t[15]=-i[15],t},addMat4:function(i,t,e){return e||(e=i),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e[3]=i[3]+t[3],e[4]=i[4]+t[4],e[5]=i[5]+t[5],e[6]=i[6]+t[6],e[7]=i[7]+t[7],e[8]=i[8]+t[8],e[9]=i[9]+t[9],e[10]=i[10]+t[10],e[11]=i[11]+t[11],e[12]=i[12]+t[12],e[13]=i[13]+t[13],e[14]=i[14]+t[14],e[15]=i[15]+t[15],e},addMat4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]+t,e[1]=i[1]+t,e[2]=i[2]+t,e[3]=i[3]+t,e[4]=i[4]+t,e[5]=i[5]+t,e[6]=i[6]+t,e[7]=i[7]+t,e[8]=i[8]+t,e[9]=i[9]+t,e[10]=i[10]+t,e[11]=i[11]+t,e[12]=i[12]+t,e[13]=i[13]+t,e[14]=i[14]+t,e[15]=i[15]+t,e},addScalarMat4:function(i,t,e){return B.addMat4Scalar(t,i,e)},subMat4:function(i,t,e){return e||(e=i),e[0]=i[0]-t[0],e[1]=i[1]-t[1],e[2]=i[2]-t[2],e[3]=i[3]-t[3],e[4]=i[4]-t[4],e[5]=i[5]-t[5],e[6]=i[6]-t[6],e[7]=i[7]-t[7],e[8]=i[8]-t[8],e[9]=i[9]-t[9],e[10]=i[10]-t[10],e[11]=i[11]-t[11],e[12]=i[12]-t[12],e[13]=i[13]-t[13],e[14]=i[14]-t[14],e[15]=i[15]-t[15],e},subMat4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]-t,e[1]=i[1]-t,e[2]=i[2]-t,e[3]=i[3]-t,e[4]=i[4]-t,e[5]=i[5]-t,e[6]=i[6]-t,e[7]=i[7]-t,e[8]=i[8]-t,e[9]=i[9]-t,e[10]=i[10]-t,e[11]=i[11]-t,e[12]=i[12]-t,e[13]=i[13]-t,e[14]=i[14]-t,e[15]=i[15]-t,e},subScalarMat4:function(i,t,e){return e||(e=t),e[0]=i-t[0],e[1]=i-t[1],e[2]=i-t[2],e[3]=i-t[3],e[4]=i-t[4],e[5]=i-t[5],e[6]=i-t[6],e[7]=i-t[7],e[8]=i-t[8],e[9]=i-t[9],e[10]=i-t[10],e[11]=i-t[11],e[12]=i-t[12],e[13]=i-t[13],e[14]=i-t[14],e[15]=i-t[15],e},mulMat4:function(i,t,e){e||(e=i);var r=i[0],o=i[1],n=i[2],y=i[3],E=i[4],P=i[5],z=i[6],Y=i[7],J=i[8],ie=i[9],le=i[10],Z=i[11],ye=i[12],we=i[13],Be=i[14],xe=i[15],Se=t[0],Te=t[1],Me=t[2],Fe=t[3],Re=t[4],He=t[5],qe=t[6],rt=t[7],je=t[8],Oe=t[9],st=t[10],ft=t[11],At=t[12],bt=t[13],wt=t[14],Ot=t[15];return e[0]=Se*r+Te*E+Me*J+Fe*ye,e[1]=Se*o+Te*P+Me*ie+Fe*we,e[2]=Se*n+Te*z+Me*le+Fe*Be,e[3]=Se*y+Te*Y+Me*Z+Fe*xe,e[4]=Re*r+He*E+qe*J+rt*ye,e[5]=Re*o+He*P+qe*ie+rt*we,e[6]=Re*n+He*z+qe*le+rt*Be,e[7]=Re*y+He*Y+qe*Z+rt*xe,e[8]=je*r+Oe*E+st*J+ft*ye,e[9]=je*o+Oe*P+st*ie+ft*we,e[10]=je*n+Oe*z+st*le+ft*Be,e[11]=je*y+Oe*Y+st*Z+ft*xe,e[12]=At*r+bt*E+wt*J+Ot*ye,e[13]=At*o+bt*P+wt*ie+Ot*we,e[14]=At*n+bt*z+wt*le+Ot*Be,e[15]=At*y+bt*Y+wt*Z+Ot*xe,e},mulMat3:function(i,t,e){e||(e=new ae(9));var r=i[0],o=i[3],n=i[6],y=i[1],E=i[4],P=i[7],z=i[2],Y=i[5],J=i[8],ie=t[0],le=t[3],Z=t[6],ye=t[1],we=t[4],Be=t[7],xe=t[2],Se=t[5],Te=t[8];return e[0]=r*ie+o*ye+n*xe,e[3]=r*le+o*we+n*Se,e[6]=r*Z+o*Be+n*Te,e[1]=y*ie+E*ye+P*xe,e[4]=y*le+E*we+P*Se,e[7]=y*Z+E*Be+P*Te,e[2]=z*ie+Y*ye+J*xe,e[5]=z*le+Y*we+J*Se,e[8]=z*Z+Y*Be+J*Te,e},mulMat4Scalar:function(i,t,e){return e||(e=i),e[0]=i[0]*t,e[1]=i[1]*t,e[2]=i[2]*t,e[3]=i[3]*t,e[4]=i[4]*t,e[5]=i[5]*t,e[6]=i[6]*t,e[7]=i[7]*t,e[8]=i[8]*t,e[9]=i[9]*t,e[10]=i[10]*t,e[11]=i[11]*t,e[12]=i[12]*t,e[13]=i[13]*t,e[14]=i[14]*t,e[15]=i[15]*t,e},mulMat4v4:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec4(),r=t[0],o=t[1],n=t[2],y=t[3];return e[0]=i[0]*r+i[4]*o+i[8]*n+i[12]*y,e[1]=i[1]*r+i[5]*o+i[9]*n+i[13]*y,e[2]=i[2]*r+i[6]*o+i[10]*n+i[14]*y,e[3]=i[3]*r+i[7]*o+i[11]*n+i[15]*y,e},transposeMat4:function(i,t){var e=i[4],r=i[14],o=i[8],n=i[13],y=i[12],E=i[9];if(!t||i===t){var P=i[1],z=i[2],Y=i[3],J=i[6],ie=i[7],le=i[11];return i[1]=e,i[2]=o,i[3]=y,i[4]=P,i[6]=E,i[7]=n,i[8]=z,i[9]=J,i[11]=r,i[12]=Y,i[13]=ie,i[14]=le,i}return t[0]=i[0],t[1]=e,t[2]=o,t[3]=y,t[4]=i[1],t[5]=i[5],t[6]=E,t[7]=n,t[8]=i[2],t[9]=i[6],t[10]=i[10],t[11]=r,t[12]=i[3],t[13]=i[7],t[14]=i[11],t[15]=i[15],t},transposeMat3:function(i,t){if(t===i){var e=i[1],r=i[2],o=i[5];t[1]=i[3],t[2]=i[6],t[3]=e,t[5]=i[7],t[6]=r,t[7]=o}else t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8];return t},determinantMat4:function(i){var t=i[0],e=i[1],r=i[2],o=i[3],n=i[4],y=i[5],E=i[6],P=i[7],z=i[8],Y=i[9],J=i[10],ie=i[11],le=i[12],Z=i[13],ye=i[14],we=i[15];return le*Y*E*o-z*Z*E*o-le*y*J*o+n*Z*J*o+z*y*ye*o-n*Y*ye*o-le*Y*r*P+z*Z*r*P+le*e*J*P-t*Z*J*P-z*e*ye*P+t*Y*ye*P+le*y*r*ie-n*Z*r*ie-le*e*E*ie+t*Z*E*ie+n*e*ye*ie-t*y*ye*ie-z*y*r*we+n*Y*r*we+z*e*E*we-t*Y*E*we-n*e*J*we+t*y*J*we},inverseMat4:function(i,t){t||(t=i);var e=i[0],r=i[1],o=i[2],n=i[3],y=i[4],E=i[5],P=i[6],z=i[7],Y=i[8],J=i[9],ie=i[10],le=i[11],Z=i[12],ye=i[13],we=i[14],Be=i[15],xe=e*E-r*y,Se=e*P-o*y,Te=e*z-n*y,Me=r*P-o*E,Fe=r*z-n*E,Re=o*z-n*P,He=Y*ye-J*Z,qe=Y*we-ie*Z,rt=Y*Be-le*Z,je=J*we-ie*ye,Oe=J*Be-le*ye,st=ie*Be-le*we,ft=1/(xe*st-Se*Oe+Te*je+Me*rt-Fe*qe+Re*He);return t[0]=(E*st-P*Oe+z*je)*ft,t[1]=(-r*st+o*Oe-n*je)*ft,t[2]=(ye*Re-we*Fe+Be*Me)*ft,t[3]=(-J*Re+ie*Fe-le*Me)*ft,t[4]=(-y*st+P*rt-z*qe)*ft,t[5]=(e*st-o*rt+n*qe)*ft,t[6]=(-Z*Re+we*Te-Be*Se)*ft,t[7]=(Y*Re-ie*Te+le*Se)*ft,t[8]=(y*Oe-E*rt+z*He)*ft,t[9]=(-e*Oe+r*rt-n*He)*ft,t[10]=(Z*Fe-ye*Te+Be*xe)*ft,t[11]=(-Y*Fe+J*Te-le*xe)*ft,t[12]=(-y*je+E*qe-P*He)*ft,t[13]=(e*je-r*qe+o*He)*ft,t[14]=(-Z*Me+ye*Se-we*xe)*ft,t[15]=(Y*Me-J*Se+ie*xe)*ft,t},traceMat4:function(i){return i[0]+i[5]+i[10]+i[15]},translationMat4v:function(i,t){var e=t||B.identityMat4();return e[12]=i[0],e[13]=i[1],e[14]=i[2],e},translationMat3v:function(i,t){var e=t||B.identityMat3();return e[6]=i[0],e[7]=i[1],e},translationMat4c:function(){var g=new ae(3);return function(i,t,e,r){return g[0]=i,g[1]=t,g[2]=e,B.translationMat4v(g,r)}}(),translationMat4s:function(i,t){return B.translationMat4c(i,i,i,t)},translateMat4v:function(i,t){return B.translateMat4c(i[0],i[1],i[2],t)},translateMat4c:function(i,t,e,r){var o=r[3];r[0]+=o*i,r[1]+=o*t,r[2]+=o*e;var n=r[7];r[4]+=n*i,r[5]+=n*t,r[6]+=n*e;var y=r[11];r[8]+=y*i,r[9]+=y*t,r[10]+=y*e;var E=r[15];return r[12]+=E*i,r[13]+=E*t,r[14]+=E*e,r},setMat4Translation:function(i,t,e){return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=i[15],e},rotationMat4v:function(i,t,e){var r=B.normalizeVec4([t[0],t[1],t[2],0],[]),o=Math.sin(i),n=Math.cos(i),y=1-n,E=r[0],P=r[1],z=r[2],Y,J,ie,le,Z,ye;return Y=E*P,J=P*z,ie=z*E,le=E*o,Z=P*o,ye=z*o,e=e||B.mat4(),e[0]=y*E*E+n,e[1]=y*Y+ye,e[2]=y*ie-Z,e[3]=0,e[4]=y*Y-ye,e[5]=y*P*P+n,e[6]=y*J+le,e[7]=0,e[8]=y*ie+Z,e[9]=y*J-le,e[10]=y*z*z+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},rotationMat4c:function(i,t,e,r,o){return B.rotationMat4v(i,[t,e,r],o)},scalingMat4v:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.identityMat4();return t[0]=i[0],t[5]=i[1],t[10]=i[2],t},scalingMat3v:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.identityMat3();return t[0]=i[0],t[4]=i[1],t},scalingMat4c:function(){var g=new ae(3);return function(i,t,e,r){return g[0]=i,g[1]=t,g[2]=e,B.scalingMat4v(g,r)}}(),scaleMat4c:function(i,t,e,r){return r[0]*=i,r[4]*=t,r[8]*=e,r[1]*=i,r[5]*=t,r[9]*=e,r[2]*=i,r[6]*=t,r[10]*=e,r[3]*=i,r[7]*=t,r[11]*=e,r},scaleMat4v:function(i,t){var e=i[0],r=i[1],o=i[2];return t[0]*=e,t[4]*=r,t[8]*=o,t[1]*=e,t[5]*=r,t[9]*=o,t[2]*=e,t[6]*=r,t[10]*=o,t[3]*=e,t[7]*=r,t[11]*=o,t},scalingMat4s:function(i){return B.scalingMat4c(i,i,i)},rotationTranslationMat4:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.mat4(),r=i[0],o=i[1],n=i[2],y=i[3],E=r+r,P=o+o,z=n+n,Y=r*E,J=r*P,ie=r*z,le=o*P,Z=o*z,ye=n*z,we=y*E,Be=y*P,xe=y*z;return e[0]=1-(le+ye),e[1]=J+xe,e[2]=ie-Be,e[3]=0,e[4]=J-xe,e[5]=1-(Y+ye),e[6]=Z+we,e[7]=0,e[8]=ie+Be,e[9]=Z-we,e[10]=1-(Y+le),e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},mat4ToEuler:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec4(),r=B.clamp,o=i[0],n=i[4],y=i[8],E=i[1],P=i[5],z=i[9],Y=i[2],J=i[6],ie=i[10];return t==="XYZ"?(e[1]=Math.asin(r(y,-1,1)),Math.abs(y)<.99999?(e[0]=Math.atan2(-z,ie),e[2]=Math.atan2(-n,o)):(e[0]=Math.atan2(J,P),e[2]=0)):t==="YXZ"?(e[0]=Math.asin(-r(z,-1,1)),Math.abs(z)<.99999?(e[1]=Math.atan2(y,ie),e[2]=Math.atan2(E,P)):(e[1]=Math.atan2(-Y,o),e[2]=0)):t==="ZXY"?(e[0]=Math.asin(r(J,-1,1)),Math.abs(J)<.99999?(e[1]=Math.atan2(-Y,ie),e[2]=Math.atan2(-n,P)):(e[1]=0,e[2]=Math.atan2(E,o))):t==="ZYX"?(e[1]=Math.asin(-r(Y,-1,1)),Math.abs(Y)<.99999?(e[0]=Math.atan2(J,ie),e[2]=Math.atan2(E,o)):(e[0]=0,e[2]=Math.atan2(-n,P))):t==="YZX"?(e[2]=Math.asin(r(E,-1,1)),Math.abs(E)<.99999?(e[0]=Math.atan2(-z,P),e[1]=Math.atan2(-Y,o)):(e[0]=0,e[1]=Math.atan2(y,ie))):t==="XZY"&&(e[2]=Math.asin(-r(n,-1,1)),Math.abs(n)<.99999?(e[0]=Math.atan2(J,P),e[1]=Math.atan2(y,o)):(e[0]=Math.atan2(-z,ie),e[1]=0)),e},composeMat4:function(i,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:B.mat4();return B.quaternionToRotationMat4(t,r),B.scaleMat4v(e,r),B.translateMat4v(i,r),r},decomposeMat4:function(){var g=new ae(3),i=new ae(16);return function(e,r,o,n){g[0]=e[0],g[1]=e[1],g[2]=e[2];var y=B.lenVec3(g);g[0]=e[4],g[1]=e[5],g[2]=e[6];var E=B.lenVec3(g);g[8]=e[8],g[9]=e[9],g[10]=e[10];var P=B.lenVec3(g),z=B.determinantMat4(e);z<0&&(y=-y),r[0]=e[12],r[1]=e[13],r[2]=e[14],i.set(e);var Y=1/y,J=1/E,ie=1/P;return i[0]*=Y,i[1]*=Y,i[2]*=Y,i[4]*=J,i[5]*=J,i[6]*=J,i[8]*=ie,i[9]*=ie,i[10]*=ie,B.mat4ToQuaternion(i,o),n[0]=y,n[1]=E,n[2]=P,this}}(),getColMat4:function(i,t){var e=t*4;return[i[e],i[e+1],i[e+2],i[e+3]]},setRowMat4:function(i,t,e){i[t]=e[0],i[t+4]=e[1],i[t+8]=e[2],i[t+12]=e[3]},lookAtMat4v:function(i,t,e,r){r||(r=B.mat4());var o=i[0],n=i[1],y=i[2],E=e[0],P=e[1],z=e[2],Y=t[0],J=t[1],ie=t[2];if(o===Y&&n===J&&y===ie)return B.identityMat4();var le,Z,ye,we,Be,xe,Se,Te,Me,Fe;return le=o-Y,Z=n-J,ye=y-ie,Fe=1/Math.sqrt(le*le+Z*Z+ye*ye),le*=Fe,Z*=Fe,ye*=Fe,we=P*ye-z*Z,Be=z*le-E*ye,xe=E*Z-P*le,Fe=Math.sqrt(we*we+Be*Be+xe*xe),Fe?(Fe=1/Fe,we*=Fe,Be*=Fe,xe*=Fe):(we=0,Be=0,xe=0),Se=Z*xe-ye*Be,Te=ye*we-le*xe,Me=le*Be-Z*we,Fe=Math.sqrt(Se*Se+Te*Te+Me*Me),Fe?(Fe=1/Fe,Se*=Fe,Te*=Fe,Me*=Fe):(Se=0,Te=0,Me=0),r[0]=we,r[1]=Se,r[2]=le,r[3]=0,r[4]=Be,r[5]=Te,r[6]=Z,r[7]=0,r[8]=xe,r[9]=Me,r[10]=ye,r[11]=0,r[12]=-(we*o+Be*n+xe*y),r[13]=-(Se*o+Te*n+Me*y),r[14]=-(le*o+Z*n+ye*y),r[15]=1,r},lookAtMat4c:function(i,t,e,r,o,n,y,E,P){return B.lookAtMat4v([i,t,e],[r,o,n],[y,E,P],[])},orthoMat4c:function(i,t,e,r,o,n,y){y||(y=B.mat4());var E=t-i,P=r-e,z=n-o;return y[0]=2/E,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=2/P,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=-2/z,y[11]=0,y[12]=-(i+t)/E,y[13]=-(r+e)/P,y[14]=-(n+o)/z,y[15]=1,y},frustumMat4v:function(i,t,e){e||(e=B.mat4());var r=[i[0],i[1],i[2],0],o=[t[0],t[1],t[2],0];B.addVec4(o,r,me),B.subVec4(o,r,ce);var n=2*r[2],y=ce[0],E=ce[1],P=ce[2];return e[0]=n/y,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n/E,e[6]=0,e[7]=0,e[8]=me[0]/y,e[9]=me[1]/E,e[10]=-me[2]/P,e[11]=-1,e[12]=0,e[13]=0,e[14]=-n*o[2]/P,e[15]=0,e},frustumMat4:function(i,t,e,r,o,n,y){y||(y=B.mat4());var E=t-i,P=r-e,z=n-o;return y[0]=o*2/E,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=o*2/P,y[6]=0,y[7]=0,y[8]=(t+i)/E,y[9]=(r+e)/P,y[10]=-(n+o)/z,y[11]=-1,y[12]=0,y[13]=0,y[14]=-(n*o*2)/z,y[15]=0,y},perspectiveMat4:function(i,t,e,r,o){var n=[],y=[];return n[2]=e,y[2]=r,y[1]=n[2]*Math.tan(i/2),n[1]=-y[1],y[0]=y[1]*t,n[0]=-y[0],B.frustumMat4v(n,y,o)},compareMat4:function(i,t){return i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]&&i[3]===t[3]&&i[4]===t[4]&&i[5]===t[5]&&i[6]===t[6]&&i[7]===t[7]&&i[8]===t[8]&&i[9]===t[9]&&i[10]===t[10]&&i[11]===t[11]&&i[12]===t[12]&&i[13]===t[13]&&i[14]===t[14]&&i[15]===t[15]},transformPoint3:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec3(),r=t[0],o=t[1],n=t[2];return e[0]=i[0]*r+i[4]*o+i[8]*n+i[12],e[1]=i[1]*r+i[5]*o+i[9]*n+i[13],e[2]=i[2]*r+i[6]*o+i[10]*n+i[14],e},transformPoint4:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec4();return e[0]=i[0]*t[0]+i[4]*t[1]+i[8]*t[2]+i[12]*t[3],e[1]=i[1]*t[0]+i[5]*t[1]+i[9]*t[2]+i[13]*t[3],e[2]=i[2]*t[0]+i[6]*t[1]+i[10]*t[2]+i[14]*t[3],e[3]=i[3]*t[0]+i[7]*t[1]+i[11]*t[2]+i[15]*t[3],e},transformPoints3:function(i,t,e){for(var r=e||[],o=t.length,n,y,E,P,z=i[0],Y=i[1],J=i[2],ie=i[3],le=i[4],Z=i[5],ye=i[6],we=i[7],Be=i[8],xe=i[9],Se=i[10],Te=i[11],Me=i[12],Fe=i[13],Re=i[14],He=i[15],qe,rt=0;rt<o;++rt)P=t[rt],n=P[0],y=P[1],E=P[2],qe=r[rt]||(r[rt]=[0,0,0]),qe[0]=z*n+le*y+Be*E+Me,qe[1]=Y*n+Z*y+xe*E+Fe,qe[2]=J*n+ye*y+Se*E+Re,qe[3]=ie*n+we*y+Te*E+He;return r.length=o,r},transformPositions3:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r,o=t.length,n,y,E,P=i[0],z=i[1],Y=i[2];i[3];var J=i[4],ie=i[5],le=i[6];i[7];var Z=i[8],ye=i[9],we=i[10];i[11];var Be=i[12],xe=i[13],Se=i[14];for(i[15],r=0;r<o;r+=3)n=t[r+0],y=t[r+1],E=t[r+2],e[r+0]=P*n+J*y+Z*E+Be,e[r+1]=z*n+ie*y+ye*E+xe,e[r+2]=Y*n+le*y+we*E+Se;return e},transformPositions4:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r,o=t.length,n,y,E,P=i[0],z=i[1],Y=i[2],J=i[3],ie=i[4],le=i[5],Z=i[6],ye=i[7],we=i[8],Be=i[9],xe=i[10],Se=i[11],Te=i[12],Me=i[13],Fe=i[14],Re=i[15];for(r=0;r<o;r+=4)n=t[r+0],y=t[r+1],E=t[r+2],e[r+0]=P*n+ie*y+we*E+Te,e[r+1]=z*n+le*y+Be*E+Me,e[r+2]=Y*n+Z*y+xe*E+Fe,e[r+3]=J*n+ye*y+Se*E+Re;return e},transformVec3:function(i,t,e){var r=t[0],o=t[1],n=t[2];return e=e||this.vec3(),e[0]=i[0]*r+i[4]*o+i[8]*n,e[1]=i[1]*r+i[5]*o+i[9]*n,e[2]=i[2]*r+i[6]*o+i[10]*n,e},transformVec4:function(i,t,e){var r=t[0],o=t[1],n=t[2],y=t[3];return e=e||B.vec4(),e[0]=i[0]*r+i[4]*o+i[8]*n+i[12]*y,e[1]=i[1]*r+i[5]*o+i[9]*n+i[13]*y,e[2]=i[2]*r+i[6]*o+i[10]*n+i[14]*y,e[3]=i[3]*r+i[7]*o+i[11]*n+i[15]*y,e},rotateVec2:function(i,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i,o=Math.cos(e),n=Math.sin(e),y=i[0]-t[0],E=i[1]-t[1];return r[0]=y*o-E*n+t[0],r[1]=y*n+E*o+t[1],i},rotateVec3X:function(i,t,e,r){var o=[],n=[];return o[0]=i[0]-t[0],o[1]=i[1]-t[1],o[2]=i[2]-t[2],n[0]=o[0],n[1]=o[1]*Math.cos(e)-o[2]*Math.sin(e),n[2]=o[1]*Math.sin(e)+o[2]*Math.cos(e),r[0]=n[0]+t[0],r[1]=n[1]+t[1],r[2]=n[2]+t[2],r},rotateVec3Y:function(i,t,e,r){var o=[],n=[];return o[0]=i[0]-t[0],o[1]=i[1]-t[1],o[2]=i[2]-t[2],n[0]=o[2]*Math.sin(e)+o[0]*Math.cos(e),n[1]=o[1],n[2]=o[2]*Math.cos(e)-o[0]*Math.sin(e),r[0]=n[0]+t[0],r[1]=n[1]+t[1],r[2]=n[2]+t[2],r},rotateVec3Z:function(i,t,e,r){var o=[],n=[];return o[0]=i[0]-t[0],o[1]=i[1]-t[1],o[2]=i[2]-t[2],n[0]=o[0]*Math.cos(e)-o[1]*Math.sin(e),n[1]=o[0]*Math.sin(e)+o[1]*Math.cos(e),n[2]=o[2],r[0]=n[0]+t[0],r[1]=n[1]+t[1],r[2]=n[2]+t[2],r},projectVec4:function(i,t){var e=1/i[3];return t=t||B.vec2(),t[0]=i[0]*e,t[1]=i[1]*e,t},unprojectVec3:function(){var g=new ae(16),i=new ae(16),t=new ae(16);return function(e,r,o,n){return this.transformVec3(this.mulMat4(this.inverseMat4(r,g),this.inverseMat4(o,i),t),e,n)}}(),lerpVec3:function(i,t,e,r,o,n){var y=n||B.vec3(),E=(i-t)/(e-t);return y[0]=r[0]+E*(o[0]-r[0]),y[1]=r[1]+E*(o[1]-r[1]),y[2]=r[2]+E*(o[2]-r[2]),y},lerpMat4:function(i,t,e,r,o,n){var y=n||B.mat4(),E=(i-t)/(e-t);return y[0]=r[0]+E*(o[0]-r[0]),y[1]=r[1]+E*(o[1]-r[1]),y[2]=r[2]+E*(o[2]-r[2]),y[3]=r[3]+E*(o[3]-r[3]),y[4]=r[4]+E*(o[4]-r[4]),y[5]=r[5]+E*(o[5]-r[5]),y[6]=r[6]+E*(o[6]-r[6]),y[7]=r[7]+E*(o[7]-r[7]),y[8]=r[8]+E*(o[8]-r[8]),y[9]=r[9]+E*(o[9]-r[9]),y[10]=r[10]+E*(o[10]-r[10]),y[11]=r[11]+E*(o[11]-r[11]),y[12]=r[12]+E*(o[12]-r[12]),y[13]=r[13]+E*(o[13]-r[13]),y[14]=r[14]+E*(o[14]-r[14]),y[15]=r[15]+E*(o[15]-r[15]),y},flatten:function(i){var t=[],e,r,o,n,y;for(e=0,r=i.length;e<r;e++)for(y=i[e],o=0,n=y.length;o<n;o++)t.push(y[o]);return t},identityQuaternion:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.vec4();return i[0]=0,i[1]=0,i[2]=0,i[3]=1,i},eulerToQuaternion:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec4(),r=i[0]*B.DEGTORAD/2,o=i[1]*B.DEGTORAD/2,n=i[2]*B.DEGTORAD/2,y=Math.cos(r),E=Math.cos(o),P=Math.cos(n),z=Math.sin(r),Y=Math.sin(o),J=Math.sin(n);return t==="XYZ"?(e[0]=z*E*P+y*Y*J,e[1]=y*Y*P-z*E*J,e[2]=y*E*J+z*Y*P,e[3]=y*E*P-z*Y*J):t==="YXZ"?(e[0]=z*E*P+y*Y*J,e[1]=y*Y*P-z*E*J,e[2]=y*E*J-z*Y*P,e[3]=y*E*P+z*Y*J):t==="ZXY"?(e[0]=z*E*P-y*Y*J,e[1]=y*Y*P+z*E*J,e[2]=y*E*J+z*Y*P,e[3]=y*E*P-z*Y*J):t==="ZYX"?(e[0]=z*E*P-y*Y*J,e[1]=y*Y*P+z*E*J,e[2]=y*E*J-z*Y*P,e[3]=y*E*P+z*Y*J):t==="YZX"?(e[0]=z*E*P+y*Y*J,e[1]=y*Y*P+z*E*J,e[2]=y*E*J-z*Y*P,e[3]=y*E*P-z*Y*J):t==="XZY"&&(e[0]=z*E*P-y*Y*J,e[1]=y*Y*P-z*E*J,e[2]=y*E*J+z*Y*P,e[3]=y*E*P+z*Y*J),e},mat4ToQuaternion:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.vec4(),e=i[0],r=i[4],o=i[8],n=i[1],y=i[5],E=i[9],P=i[2],z=i[6],Y=i[10],J,ie=e+y+Y;return ie>0?(J=.5/Math.sqrt(ie+1),t[3]=.25/J,t[0]=(z-E)*J,t[1]=(o-P)*J,t[2]=(n-r)*J):e>y&&e>Y?(J=2*Math.sqrt(1+e-y-Y),t[3]=(z-E)/J,t[0]=.25*J,t[1]=(r+n)/J,t[2]=(o+P)/J):y>Y?(J=2*Math.sqrt(1+y-e-Y),t[3]=(o-P)/J,t[0]=(r+n)/J,t[1]=.25*J,t[2]=(E+z)/J):(J=2*Math.sqrt(1+Y-e-y),t[3]=(n-r)/J,t[0]=(o+P)/J,t[1]=(E+z)/J,t[2]=.25*J),t},vec3PairToQuaternion:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec4(),r=Math.sqrt(B.dotVec3(i,i)*B.dotVec3(t,t)),o=r+B.dotVec3(i,t);return o<1e-8*r?(o=0,Math.abs(i[0])>Math.abs(i[2])?(e[0]=-i[1],e[1]=i[0],e[2]=0):(e[0]=0,e[1]=-i[2],e[2]=i[1])):B.cross3Vec3(i,t,e),e[3]=o,B.normalizeQuaternion(e)},angleAxisToQuaternion:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.vec4(),e=i[3]/2,r=Math.sin(e);return t[0]=r*i[0],t[1]=r*i[1],t[2]=r*i[2],t[3]=Math.cos(e),t},quaternionToEuler:function(){var g=new ae(16);return function(i,t,e){return e=e||B.vec3(),B.quaternionToRotationMat4(i,g),B.mat4ToEuler(g,t,e),e}}(),mulQuaternions:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec4(),r=i[0],o=i[1],n=i[2],y=i[3],E=t[0],P=t[1],z=t[2],Y=t[3];return e[0]=y*E+r*Y+o*z-n*P,e[1]=y*P+o*Y+n*E-r*z,e[2]=y*z+n*Y+r*P-o*E,e[3]=y*Y-r*E-o*P-n*z,e},vec3ApplyQuaternion:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:B.vec3(),r=t[0],o=t[1],n=t[2],y=i[0],E=i[1],P=i[2],z=i[3],Y=z*r+E*n-P*o,J=z*o+P*r-y*n,ie=z*n+y*o-E*r,le=-y*r-E*o-P*n;return e[0]=Y*z+le*-y+J*-P-ie*-E,e[1]=J*z+le*-E+ie*-y-Y*-P,e[2]=ie*z+le*-P+Y*-E-J*-y,e},quaternionToMat4:function(i,t){t=B.identityMat4(t);var e=i[0],r=i[1],o=i[2],n=i[3],y=2*e,E=2*r,P=2*o,z=y*n,Y=E*n,J=P*n,ie=y*e,le=E*e,Z=P*e,ye=E*r,we=P*r,Be=P*o;return t[0]=1-(ye+Be),t[1]=le+J,t[2]=Z-Y,t[4]=le-J,t[5]=1-(ie+Be),t[6]=we+z,t[8]=Z+Y,t[9]=we-z,t[10]=1-(ie+ye),t},quaternionToRotationMat4:function(i,t){var e=i[0],r=i[1],o=i[2],n=i[3],y=e+e,E=r+r,P=o+o,z=e*y,Y=e*E,J=e*P,ie=r*E,le=r*P,Z=o*P,ye=n*y,we=n*E,Be=n*P;return t[0]=1-(ie+Z),t[4]=Y-Be,t[8]=J+we,t[1]=Y+Be,t[5]=1-(z+Z),t[9]=le-ye,t[2]=J-we,t[6]=le+ye,t[10]=1-(z+ie),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},normalizeQuaternion:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,e=B.lenVec4([i[0],i[1],i[2],i[3]]);return t[0]=i[0]/e,t[1]=i[1]/e,t[2]=i[2]/e,t[3]=i[3]/e,t},conjugateQuaternion:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return t[0]=-i[0],t[1]=-i[1],t[2]=-i[2],t[3]=i[3],t},inverseQuaternion:function(i,t){return B.normalizeQuaternion(B.conjugateQuaternion(i,t))},quaternionToAngleAxis:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.vec4();i=B.normalizeQuaternion(i,pe);var e=i[3],r=2*Math.acos(e),o=Math.sqrt(1-e*e);return o<.001?(t[0]=i[0],t[1]=i[1],t[2]=i[2]):(t[0]=i[0]/o,t[1]=i[1]/o,t[2]=i[2]/o),t[3]=r,t},AABB3:function(i){return new ae(i||6)},AABB2:function(i){return new ae(i||4)},OBB3:function(i){return new ae(i||32)},OBB2:function(i){return new ae(i||16)},Sphere3:function(i,t,e,r){return new ae([i,t,e,r])},transformOBB3:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t,r,o=t.length,n,y,E,P=i[0],z=i[1],Y=i[2],J=i[3],ie=i[4],le=i[5],Z=i[6],ye=i[7],we=i[8],Be=i[9],xe=i[10],Se=i[11],Te=i[12],Me=i[13],Fe=i[14],Re=i[15];for(r=0;r<o;r+=4)n=t[r+0],y=t[r+1],E=t[r+2],e[r+0]=P*n+ie*y+we*E+Te,e[r+1]=z*n+le*y+Be*E+Me,e[r+2]=Y*n+Z*y+xe*E+Fe,e[r+3]=J*n+ye*y+Se*E+Re;return e},containsAABB3:function(i,t){var e=i[0]<=t[0]&&t[3]<=i[3]&&i[1]<=t[1]&&t[4]<=i[4]&&i[2]<=t[2]&&t[5]<=i[5];return e},getAABB3Diag:function(){var g=new ae(3),i=new ae(3),t=new ae(3);return function(e){return g[0]=e[0],g[1]=e[1],g[2]=e[2],i[0]=e[3],i[1]=e[4],i[2]=e[5],B.subVec3(i,g,t),Math.abs(B.lenVec3(t))}}(),getAABB3DiagPoint:function(){var g=new ae(3),i=new ae(3),t=new ae(3);return function(e,r){g[0]=e[0],g[1]=e[1],g[2]=e[2],i[0]=e[3],i[1]=e[4],i[2]=e[5];var o=B.subVec3(i,g,t),n=r[0]-e[0],y=e[3]-r[0],E=r[1]-e[1],P=e[4]-r[1],z=r[2]-e[2],Y=e[5]-r[2];return o[0]+=n>y?n:y,o[1]+=E>P?E:P,o[2]+=z>Y?z:Y,Math.abs(B.lenVec3(o))}}(),getAABB3Area:function(i){var t=i[3]-i[0],e=i[4]-i[1],r=i[5]-i[2];return t*e*r},getAABB3Center:function(i,t){var e=t||B.vec3();return e[0]=(i[0]+i[3])/2,e[1]=(i[1]+i[4])/2,e[2]=(i[2]+i[5])/2,e},getAABB2Center:function(i,t){var e=t||B.vec2();return e[0]=(i[2]+i[0])/2,e[1]=(i[3]+i[1])/2,e},collapseAABB3:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.AABB3();return i[0]=B.MAX_DOUBLE,i[1]=B.MAX_DOUBLE,i[2]=B.MAX_DOUBLE,i[3]=B.MIN_DOUBLE,i[4]=B.MIN_DOUBLE,i[5]=B.MIN_DOUBLE,i},AABB3ToOBB3:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.OBB3();return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=1,t[4]=i[3],t[5]=i[1],t[6]=i[2],t[7]=1,t[8]=i[3],t[9]=i[4],t[10]=i[2],t[11]=1,t[12]=i[0],t[13]=i[4],t[14]=i[2],t[15]=1,t[16]=i[0],t[17]=i[1],t[18]=i[5],t[19]=1,t[20]=i[3],t[21]=i[1],t[22]=i[5],t[23]=1,t[24]=i[3],t[25]=i[4],t[26]=i[5],t[27]=1,t[28]=i[0],t[29]=i[4],t[30]=i[5],t[31]=1,t},positions3ToAABB3:function(){var g=new ae(3);return function(i,t,e){t=t||B.AABB3();for(var r=B.MAX_DOUBLE,o=B.MAX_DOUBLE,n=B.MAX_DOUBLE,y=B.MIN_DOUBLE,E=B.MIN_DOUBLE,P=B.MIN_DOUBLE,z,Y,J,ie=0,le=i.length;ie<le;ie+=3)e?(g[0]=i[ie+0],g[1]=i[ie+1],g[2]=i[ie+2],B.decompressPosition(g,e,g),z=g[0],Y=g[1],J=g[2]):(z=i[ie+0],Y=i[ie+1],J=i[ie+2]),z<r&&(r=z),Y<o&&(o=Y),J<n&&(n=J),z>y&&(y=z),Y>E&&(E=Y),J>P&&(P=J);return t[0]=r,t[1]=o,t[2]=n,t[3]=y,t[4]=E,t[5]=P,t}}(),OBB3ToAABB3:function(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.AABB3(),e=B.MAX_DOUBLE,r=B.MAX_DOUBLE,o=B.MAX_DOUBLE,n=B.MIN_DOUBLE,y=B.MIN_DOUBLE,E=B.MIN_DOUBLE,P,z,Y,J=0,ie=i.length;J<ie;J+=4)P=i[J+0],z=i[J+1],Y=i[J+2],P<e&&(e=P),z<r&&(r=z),Y<o&&(o=Y),P>n&&(n=P),z>y&&(y=z),Y>E&&(E=Y);return t[0]=e,t[1]=r,t[2]=o,t[3]=n,t[4]=y,t[5]=E,t},points3ToAABB3:function(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.AABB3(),e=B.MAX_DOUBLE,r=B.MAX_DOUBLE,o=B.MAX_DOUBLE,n=B.MIN_DOUBLE,y=B.MIN_DOUBLE,E=B.MIN_DOUBLE,P,z,Y,J=0,ie=i.length;J<ie;J++)P=i[J][0],z=i[J][1],Y=i[J][2],P<e&&(e=P),z<r&&(r=z),Y<o&&(o=Y),P>n&&(n=P),z>y&&(y=z),Y>E&&(E=Y);return t[0]=e,t[1]=r,t[2]=o,t[3]=n,t[4]=y,t[5]=E,t},points3ToSphere3:function(){var g=new ae(3);return function(i,t){t=t||B.vec4();var e=0,r=0,o=0,n,y=i.length;for(n=0;n<y;n++)e+=i[n][0],r+=i[n][1],o+=i[n][2];t[0]=e/y,t[1]=r/y,t[2]=o/y;var E=0,P;for(n=0;n<y;n++)P=Math.abs(B.lenVec3(B.subVec3(i[n],t,g))),P>E&&(E=P);return t[3]=E,t}}(),positions3ToSphere3:function(){var g=new ae(3),i=new ae(3);return function(t,e){e=e||B.vec4();var r=0,o=0,n=0,y,E=t.length,P=0;for(y=0;y<E;y+=3)r+=t[y],o+=t[y+1],n+=t[y+2];var z=E/3;e[0]=r/z,e[1]=o/z,e[2]=n/z;var Y;for(y=0;y<E;y+=3)g[0]=t[y],g[1]=t[y+1],g[2]=t[y+2],Y=Math.abs(B.lenVec3(B.subVec3(g,e,i))),Y>P&&(P=Y);return e[3]=P,e}}(),OBB3ToSphere3:function(){var g=new ae(3),i=new ae(3);return function(t,e){e=e||B.vec4();var r=0,o=0,n=0,y,E=t.length,P=E/4;for(y=0;y<E;y+=4)r+=t[y+0],o+=t[y+1],n+=t[y+2];e[0]=r/P,e[1]=o/P,e[2]=n/P;var z=0,Y;for(y=0;y<E;y+=4)g[0]=t[y+0],g[1]=t[y+1],g[2]=t[y+2],Y=Math.abs(B.lenVec3(B.subVec3(g,e,i))),Y>z&&(z=Y);return e[3]=z,e}}(),getSphere3Center:function(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.vec3();return t[0]=i[0],t[1]=i[1],t[2]=i[2],t},getPositionsCenter:function(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.vec3(),e=0,r=0,o=0,n=0,y=i.length;n<y;n+=3)e+=i[n+0],r+=i[n+1],o+=i[n+2];var E=i.length/3;return t[0]=e/E,t[1]=r/E,t[2]=o/E,t},expandAABB3:function(i,t){return i[0]>t[0]&&(i[0]=t[0]),i[1]>t[1]&&(i[1]=t[1]),i[2]>t[2]&&(i[2]=t[2]),i[3]<t[3]&&(i[3]=t[3]),i[4]<t[4]&&(i[4]=t[4]),i[5]<t[5]&&(i[5]=t[5]),i},expandAABB3Point3:function(i,t){return i[0]>t[0]&&(i[0]=t[0]),i[1]>t[1]&&(i[1]=t[1]),i[2]>t[2]&&(i[2]=t[2]),i[3]<t[0]&&(i[3]=t[0]),i[4]<t[1]&&(i[4]=t[1]),i[5]<t[2]&&(i[5]=t[2]),i},expandAABB3Points3:function(i,t){for(var e,r,o,n=0,y=t.length;n<y;n+=3)e=t[n],r=t[n+1],o=t[n+2],i[0]>e&&(i[0]=e),i[1]>r&&(i[1]=r),i[2]>o&&(i[2]=o),i[3]<e&&(i[3]=e),i[4]<r&&(i[4]=r),i[5]<o&&(i[5]=o);return i},collapseAABB2:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B.AABB2();return i[0]=B.MAX_DOUBLE,i[1]=B.MAX_DOUBLE,i[2]=B.MIN_DOUBLE,i[3]=B.MIN_DOUBLE,i},point3AABB3Intersect:function(i,t){return i[0]>t[0]||i[3]<t[0]||i[1]>t[1]||i[4]<t[1]||i[2]>t[2]||i[5]<t[2]},point3AABB3AbsoluteIntersect:function(i,t){return i[0]<=t[0]&&i[3]>=t[0]&&i[1]<=t[1]&&i[4]>=t[1]&&i[2]<=t[2]&&i[5]>=t[2]},planeAABB3Intersect:function(i,t,e){var r,o;i[0]>0?(r=i[0]*e[0],o=i[0]*e[3]):(r=i[0]*e[3],o=i[0]*e[0]),i[1]>0?(r+=i[1]*e[1],o+=i[1]*e[4]):(r+=i[1]*e[4],o+=i[1]*e[1]),i[2]>0?(r+=i[2]*e[2],o+=i[2]*e[5]):(r+=i[2]*e[5],o+=i[2]*e[2]);var n=r<=-t&&o<=-t;if(n)return-1;var y=r>=-t&&o>=-t;return y?1:0},OBB3ToAABB2:function(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.AABB2(),e=B.MAX_DOUBLE,r=B.MAX_DOUBLE,o=B.MIN_DOUBLE,n=B.MIN_DOUBLE,y,E,P,z,Y=0,J=i.length;Y<J;Y+=4)y=i[Y+0],E=i[Y+1],P=i[Y+3]||1,z=1/P,y*=z,E*=z,y<e&&(e=y),E<r&&(r=E),y>o&&(o=y),E>n&&(n=E);return t[0]=e,t[1]=r,t[2]=o,t[3]=n,t},expandAABB2:function(i,t){return i[0]>t[0]&&(i[0]=t[0]),i[1]>t[1]&&(i[1]=t[1]),i[2]<t[2]&&(i[2]=t[2]),i[3]<t[3]&&(i[3]=t[3]),i},expandAABB2Point2:function(i,t){return i[0]>t[0]&&(i[0]=t[0]),i[1]>t[1]&&(i[1]=t[1]),i[2]<t[0]&&(i[2]=t[0]),i[3]<t[1]&&(i[3]=t[1]),i},AABB2ToCanvas:function(i,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i,o=(i[0]+1)*.5,n=(i[1]+1)*.5,y=(i[2]+1)*.5,E=(i[3]+1)*.5;return r[0]=Math.floor(o*t),r[1]=e-Math.floor(E*e),r[2]=Math.floor(y*t),r[3]=e-Math.floor(n*e),r},tangentQuadraticBezier:function(i,t,e,r){return 2*(1-i)*(e-t)+2*i*(r-e)},tangentQuadraticBezier3:function(i,t,e,r,o){return-3*t*(1-i)*(1-i)+3*e*(1-i)*(1-i)-6*i*e*(1-i)+6*i*r*(1-i)-3*i*i*r+3*i*i*o},tangentSpline:function(i){var t=6*i*i-6*i,e=3*i*i-4*i+1,r=-6*i*i+6*i,o=3*i*i-2*i;return t+e+r+o},catmullRomInterpolate:function(i,t,e,r,o){var n=(e-i)*.5,y=(r-t)*.5,E=o*o,P=o*E;return(2*t-2*e+n+y)*P+(-3*t+3*e-2*n-y)*E+n*o+t},b2p0:function(i,t){var e=1-i;return e*e*t},b2p1:function(i,t){return 2*(1-i)*i*t},b2p2:function(i,t){return i*i*t},b2:function(i,t,e,r){return this.b2p0(i,t)+this.b2p1(i,e)+this.b2p2(i,r)},b3p0:function(i,t){var e=1-i;return e*e*e*t},b3p1:function(i,t){var e=1-i;return 3*e*e*i*t},b3p2:function(i,t){var e=1-i;return 3*e*i*i*t},b3p3:function(i,t){return i*i*i*t},b3:function(i,t,e,r,o){return this.b3p0(i,t)+this.b3p1(i,e)+this.b3p2(i,r)+this.b3p3(i,o)},triangleNormal:function(i,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:B.vec3(),o=t[0]-i[0],n=t[1]-i[1],y=t[2]-i[2],E=e[0]-i[0],P=e[1]-i[1],z=e[2]-i[2],Y=n*z-y*P,J=y*E-o*z,ie=o*P-n*E,le=Math.sqrt(Y*Y+J*J+ie*ie);return le===0?(r[0]=0,r[1]=0,r[2]=0):(r[0]=Y/le,r[1]=J/le,r[2]=ie/le),r},rayTriangleIntersect:function(){var g=new ae(3),i=new ae(3),t=new ae(3),e=new ae(3),r=new ae(3);return function(o,n,y,E,P,z){z=z||B.vec3();var Y=1e-6,J=B.subVec3(E,y,g),ie=B.subVec3(P,y,i),le=B.cross3Vec3(n,ie,t),Z=B.dotVec3(J,le);if(Z<Y)return null;var ye=B.subVec3(o,y,e),we=B.dotVec3(ye,le);if(we<0||we>Z)return null;var Be=B.cross3Vec3(ye,J,r),xe=B.dotVec3(n,Be);if(xe<0||we+xe>Z)return null;var Se=B.dotVec3(ie,Be)/Z;return z[0]=o[0]+Se*n[0],z[1]=o[1]+Se*n[1],z[2]=o[2]+Se*n[2],z}}(),rayPlaneIntersect:function(){var g=new ae(3),i=new ae(3),t=new ae(3),e=new ae(3);return function(r,o,n,y,E,P){P=P||B.vec3(),o=B.normalizeVec3(o,g);var z=B.subVec3(y,n,i),Y=B.subVec3(E,n,t),J=B.cross3Vec3(z,Y,e);B.normalizeVec3(J,J);var ie=-B.dotVec3(n,J),le=-(B.dotVec3(r,J)+ie)/B.dotVec3(o,J);return P[0]=r[0]+le*o[0],P[1]=r[1]+le*o[1],P[2]=r[2]+le*o[2],P}}(),cartesianToBarycentric:function(){var g=new ae(3),i=new ae(3),t=new ae(3);return function(e,r,o,n,y){var E=B.subVec3(n,r,g),P=B.subVec3(o,r,i),z=B.subVec3(e,r,t),Y=B.dotVec3(E,E),J=B.dotVec3(E,P),ie=B.dotVec3(E,z),le=B.dotVec3(P,P),Z=B.dotVec3(P,z),ye=Y*le-J*J;if(ye===0)return null;var we=1/ye,Be=(le*ie-J*Z)*we,xe=(Y*Z-J*ie)*we;return y[0]=1-Be-xe,y[1]=xe,y[2]=Be,y}}(),barycentricInsideTriangle:function(i){var t=i[1],e=i[2];return e>=0&&t>=0&&e+t<1},barycentricToCartesian:function(i,t,e,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:B.vec3(),n=i[0],y=i[1],E=i[2];return o[0]=t[0]*n+e[0]*y+r[0]*E,o[1]=t[1]*n+e[1]*y+r[1]*E,o[2]=t[2]*n+e[2]*y+r[2]*E,o},mergeVertices:function(i,t,e,r){var o={},n=[],y=[],E=t?[]:null,P=e?[]:null,z=[],Y,J,ie,le,Z=4,ye=Math.pow(10,Z),we,Be,xe=0;for(we=0,Be=i.length;we<Be;we+=3)Y=i[we],J=i[we+1],ie=i[we+2],le="".concat(Math.round(Y*ye),"_").concat(Math.round(J*ye),"_").concat(Math.round(ie*ye)),o[le]===void 0&&(o[le]=y.length/3,y.push(Y),y.push(J),y.push(ie),t&&(E.push(t[we]),E.push(t[we+1]),E.push(t[we+2])),e&&(P.push(e[xe]),P.push(e[xe+1]))),n[we/3]=o[le],xe+=2;for(we=0,Be=r.length;we<Be;we++)z[we]=n[r[we]];var Se={positions:y,indices:z};return E&&(Se.normals=E),P&&(Se.uv=P),Se},buildNormals:function(){var g=new ae(3),i=new ae(3),t=new ae(3),e=new ae(3),r=new ae(3),o=new ae(3);return function(n,y,E){var P,z,Y=new Array(n.length/3),J,ie,le;for(P=0,z=y.length;P<z;P+=3){J=y[P],ie=y[P+1],le=y[P+2],g[0]=n[J*3],g[1]=n[J*3+1],g[2]=n[J*3+2],i[0]=n[ie*3],i[1]=n[ie*3+1],i[2]=n[ie*3+2],t[0]=n[le*3],t[1]=n[le*3+1],t[2]=n[le*3+2],B.subVec3(i,g,e),B.subVec3(t,g,r);var Z=B.vec3();B.normalizeVec3(B.cross3Vec3(e,r,o),Z),Y[J]||(Y[J]=[]),Y[ie]||(Y[ie]=[]),Y[le]||(Y[le]=[]),Y[J].push(Z),Y[ie].push(Z),Y[le].push(Z)}E=E&&E.length===n.length?E:new Float32Array(n.length);var ye,we,Be,xe;for(P=0,z=Y.length;P<z;P++){ye=Y[P].length,we=0,Be=0,xe=0;for(var Se=0;Se<ye;Se++)we+=Y[P][Se][0],Be+=Y[P][Se][1],xe+=Y[P][Se][2];E[P*3]=we/ye,E[P*3+1]=Be/ye,E[P*3+2]=xe/ye}return E}}(),buildTangents:function(){var g=new ae(3),i=new ae(3),t=new ae(3),e=new ae(3),r=new ae(3),o=new ae(3),n=new ae(3);return function(y,E,P){for(var z=new Float32Array(y.length),Y=0;Y<E.length;Y+=3){var J=E[Y],ie=y.subarray(J*3,J*3+3),le=P.subarray(J*2,J*2+2);J=E[Y+1];var Z=y.subarray(J*3,J*3+3),ye=P.subarray(J*2,J*2+2);J=E[Y+2];for(var we=y.subarray(J*3,J*3+3),Be=P.subarray(J*2,J*2+2),xe=B.subVec3(Z,ie,g),Se=B.subVec3(we,ie,i),Te=B.subVec2(ye,le,t),Me=B.subVec2(Be,le,e),Fe=1/(Te[0]*Me[1]-Te[1]*Me[0]),Re=B.mulVec3Scalar(B.subVec3(B.mulVec3Scalar(xe,Me[1],r),B.mulVec3Scalar(Se,Te[1],o),n),Fe,o),He=void 0,qe=0;qe<3;qe++)He=E[Y+qe]*3,z[He]+=Re[0],z[He+1]+=Re[1],z[He+2]+=Re[2]}return z}}(),buildPickTriangles:function(i,t,e){for(var r=t.length,o=e?new Uint16Array(r*9):new Float32Array(r*9),n=new Uint8Array(r*12),y=0,E,P=0,z=0,Y,J,ie,le,Z,ye=0;ye<r;ye+=3)Z=y>>24&255,le=y>>16&255,ie=y>>8&255,J=y&255,Y=t[ye],E=Y*3,o[P++]=i[E],o[P++]=i[E+1],o[P++]=i[E+2],n[z++]=J,n[z++]=ie,n[z++]=le,n[z++]=Z,Y=t[ye+1],E=Y*3,o[P++]=i[E],o[P++]=i[E+1],o[P++]=i[E+2],n[z++]=J,n[z++]=ie,n[z++]=le,n[z++]=Z,Y=t[ye+2],E=Y*3,o[P++]=i[E],o[P++]=i[E+1],o[P++]=i[E+2],n[z++]=J,n[z++]=ie,n[z++]=le,n[z++]=Z,y++;return{positions:o,colors:n}},faceToVertexNormals:function(i,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.smoothNormalsAngleThreshold||20,o={},n=[],y={},E,P,z,Y,J,ie=4,le=Math.pow(10,ie),Z,ye,we,Be,xe,Se;for(ye=0,Be=i.length;ye<Be;ye+=3){Z=ye/3,P=i[ye],z=i[ye+1],Y=i[ye+2],J="".concat(Math.round(P*le),"_").concat(Math.round(z*le),"_").concat(Math.round(Y*le)),o[J]===void 0?o[J]=[Z]:o[J].push(Z);var Te=B.normalizeVec3([t[ye],t[ye+1],t[ye+2]]);n[Z]=Te,E=B.vec4([Te[0],Te[1],Te[2],1]),y[Z]=E}for(J in o)if(o.hasOwnProperty(J)){var Me=o[J],Fe=Me.length;for(ye=0;ye<Fe;ye++){var Re=Me[ye];for(E=y[Re],we=0;we<Fe;we++)if(ye!==we){var He=Me[we];xe=n[Re],Se=n[He];var qe=Math.abs(B.angleVec3(xe,Se)/B.DEGTORAD);qe<r&&(E[0]+=Se[0],E[1]+=Se[1],E[2]+=Se[2],E[3]+=1)}}}for(ye=0,Be=t.length;ye<Be;ye+=3)E=y[ye/3],t[ye+0]=E[0]/E[3],t[ye+1]=E[1]/E[3],t[ye+2]=E[2]/E[3]},transformRay:function(){var g=new ae(4),i=new ae(4);return function(t,e,r,o,n){g[0]=e[0],g[1]=e[1],g[2]=e[2],g[3]=1,B.transformVec4(t,g,i),o[0]=i[0],o[1]=i[1],o[2]=i[2],g[0]=r[0],g[1]=r[1],g[2]=r[2],B.transformVec3(t,g,i),B.normalizeVec3(i),n[0]=i[0],n[1]=i[1],n[2]=i[2]}}(),canvasPosToWorldRay:function(){var g=new ae(16),i=new ae(4),t=new ae(4),e=function(o,n,y,E,P){P[0]=o,P[1]=n,P[2]=y,P[3]=1,B.transformVec4(g,P,P),E||B.mulVec4Scalar(P,1/P[3])};return function(r,o,n,y,E,P,z){var Y=y==="ortho";B.mulMat4(n,o,g),B.inverseMat4(g,g);var J=2*E[0]/r.width-1,ie=1-2*E[1]/r.height;e(J,ie,-1,Y,i),e(J,ie,1,Y,t),P[0]=i[0],P[1]=i[1],P[2]=i[2],B.subVec3(t,i,z),B.normalizeVec3(z)}}(),canvasPosToLocalRay:function(){var g=new ae(3),i=new ae(3);return function(t,e,r,o,n,y,E,P){B.canvasPosToWorldRay(t,e,r,o,y,g,i),B.worldRayToLocalRay(n,g,i,E,P)}}(),worldRayToLocalRay:function(){var g=new ae(16),i=new ae(4),t=new ae(4);return function(e,r,o,n,y){var E=B.inverseMat4(e,g);i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=1,B.transformVec4(E,i,t),n[0]=t[0],n[1]=t[1],n[2]=t[2],B.transformVec3(E,o,y)}}(),buildKDTree:function(){var g=10,i=20,t=new Float32Array;function e(r,o,n,y){var E=new ae(6),P={triangles:null,left:null,right:null,leaf:!1,splitDim:0,aabb:E};E[0]=E[1]=E[2]=Number.POSITIVE_INFINITY,E[3]=E[4]=E[5]=Number.NEGATIVE_INFINITY;var z,Y;for(z=0,Y=r.length;z<Y;++z)for(var J=r[z]*3,ie=0;ie<3;++ie){var le=o[J+ie]*3;n[le]<E[0]&&(E[0]=n[le]),n[le]>E[3]&&(E[3]=n[le]),n[le+1]<E[1]&&(E[1]=n[le+1]),n[le+1]>E[4]&&(E[4]=n[le+1]),n[le+2]<E[2]&&(E[2]=n[le+2]),n[le+2]>E[5]&&(E[5]=n[le+2])}if(r.length<i||y>g)return P.triangles=r,P.leaf=!0,P;t[0]=E[3]-E[0],t[1]=E[4]-E[1],t[2]=E[5]-E[2];var Z=0;t[1]>t[Z]&&(Z=1),t[2]>t[Z]&&(Z=2),P.splitDim=Z;var ye=(E[Z]+E[Z+3])/2,we=new Array(r.length),Be=0,xe=new Array(r.length),Se=0;for(z=0,Y=r.length;z<Y;++z){var J=r[z]*3,Te=o[J],Me=o[J+1],Fe=o[J+2],Re=Te*3,He=Me*3,qe=Fe*3;n[Re+Z]<=ye||n[He+Z]<=ye||n[qe+Z]<=ye?we[Be++]=r[z]:xe[Se++]=r[z]}return we.length=Be,xe.length=Se,P.left=e(we,o,n,y+1),P.right=e(xe,o,n,y+1),P}return function(r,o){for(var n=r.length/3,y=new Array(n),E=0;E<n;++E)y[E]=E;return e(y,r,o,0)}}(),decompressPosition:function(i,t,e){e=e||i,e[0]=i[0]*t[0]+t[12],e[1]=i[1]*t[5]+t[13],e[2]=i[2]*t[10]+t[14]},decompressPositions:function(i,t){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Float32Array(i.length),r=0,o=i.length;r<o;r+=3)e[r+0]=i[r+0]*t[0]+t[12],e[r+1]=i[r+1]*t[5]+t[13],e[r+2]=i[r+2]*t[10]+t[14];return e},decompressUV:function(i,t,e){e[0]=i[0]*t[0]+t[6],e[1]=i[1]*t[4]+t[7]},decompressUVs:function(i,t){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Float32Array(i.length),r=0,o=i.length;r<o;r+=3)e[r+0]=i[r+0]*t[0]+t[6],e[r+1]=i[r+1]*t[4]+t[7];return e},octDecodeVec2:function(i,t){var e=i[0],r=i[1];e=(2*e+1)/255,r=(2*r+1)/255;var o=1-Math.abs(e)-Math.abs(r);o<0&&(e=(1-Math.abs(r))*(e>=0?1:-1),r=(1-Math.abs(e))*(r>=0?1:-1));var n=Math.sqrt(e*e+r*r+o*o);return t[0]=e/n,t[1]=r/n,t[2]=o/n,t},octDecodeVec2s:function(i,t){for(var e=0,r=0,o=i.length;e<o;e+=2){var n=i[e+0],y=i[e+1];n=(2*n+1)/255,y=(2*y+1)/255;var E=1-Math.abs(n)-Math.abs(y);E<0&&(n=(1-Math.abs(y))*(n>=0?1:-1),y=(1-Math.abs(n))*(y>=0?1:-1));var P=Math.sqrt(n*n+y*y+E*E);t[r+0]=n/P,t[r+1]=y/P,t[r+2]=E/P,r+=3}return t}};B.buildEdgeIndices=function(){var g=[],i=[],t=[],e=[],r=[],o=0,n=new Uint16Array(3),y=new Uint16Array(3),E=new Uint16Array(3),P=B.vec3(),z=B.vec3(),Y=B.vec3(),J=B.vec3(),ie=B.vec3(),le=B.vec3(),Z=B.vec3();function ye(Be,xe){var Se={},Te,Me,Fe,Re,He=4,qe=Math.pow(10,He),rt,je,Oe=0;for(rt=0,je=Be.length;rt<je;rt+=3)Te=Be[rt],Me=Be[rt+1],Fe=Be[rt+2],Re=Math.round(Te*qe)+"_"+Math.round(Me*qe)+"_"+Math.round(Fe*qe),Se[Re]===void 0&&(Se[Re]=Oe/3,g[Oe++]=Te,g[Oe++]=Me,g[Oe++]=Fe),i[rt/3]=Se[Re];for(rt=0,je=xe.length;rt<je;rt++)e[rt]=i[xe[rt]],t[e[rt]]=xe[rt]}function we(Be,xe){o=0;for(var Se=0,Te=Be;Se<Te;Se+=3){var Me=e[Se]*3,Fe=e[Se+1]*3,Re=e[Se+2]*3;xe?(n[0]=g[Me],n[1]=g[Me+1],n[2]=g[Me+2],y[0]=g[Fe],y[1]=g[Fe+1],y[2]=g[Fe+2],E[0]=g[Re],E[1]=g[Re+1],E[2]=g[Re+2],B.decompressPosition(n,xe,P),B.decompressPosition(y,xe,z),B.decompressPosition(E,xe,Y)):(P[0]=g[Me],P[1]=g[Me+1],P[2]=g[Me+2],z[0]=g[Fe],z[1]=g[Fe+1],z[2]=g[Fe+2],Y[0]=g[Re],Y[1]=g[Re+1],Y[2]=g[Re+2]),B.subVec3(Y,z,J),B.subVec3(P,z,ie),B.cross3Vec3(J,ie,le),B.normalizeVec3(le,Z);var He=r[o]||(r[o]={normal:B.vec3()});He.normal[0]=Z[0],He.normal[1]=Z[1],He.normal[2]=Z[2],o++}}return function(Be,xe,Se,Te){ye(Be,xe),we(xe.length,Se);for(var Me=[],Fe=Math.cos(B.DEGTORAD*Te),Re={},He,qe,rt,je,Oe,st=!1,ft,At,bt,wt,Ot,Wt,jt=0,ar=xe.length;jt<ar;jt+=3)for(var Nr=jt/3,Fr=0;Fr<3;Fr++)He=e[jt+Fr],qe=e[jt+(Fr+1)%3],rt=Math.min(He,qe),je=Math.max(He,qe),Oe=rt+","+je,Re[Oe]===void 0?Re[Oe]={index1:rt,index2:je,face1:Nr,face2:void 0}:Re[Oe].face2=Nr;for(Oe in Re)ft=Re[Oe],!(ft.face2!==void 0&&(At=r[ft.face1].normal,bt=r[ft.face2].normal,wt=B.dotVec3(At,bt),wt>Fe))&&(Ot=t[ft.index1],Wt=t[ft.index2],(!st&&Ot>65535||Wt>65535)&&(st=!0),Me.push(Ot),Me.push(Wt));return st?new Uint32Array(Me):new Uint16Array(Me)}}(),B.planeClipsPositions3=function(g,i,t){for(var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:3,r=0,o=t.length;r<o;r+=e){Ce[0]=t[r+0]-g[0],Ce[1]=t[r+1]-g[1],Ce[2]=t[r+2]-g[2];var n=Ce[0]*i[0]+Ce[1]*i[1]+Ce[2]*i[2];if(n<0)return!0}return!1};var ke=15,Ee=new Float32Array(3),ge=function(){function g(i){var t=this;if(F(this,g),!i)throw"Parameter expected: cfg";if(!i.viewer)throw"Parameter expected: cfg.viewer";this.viewer=i.viewer,this._maxTreeDepth=i.maxTreeDepth||ke,this._root=null,this._needsRebuild=!0,this._onModelLoaded=this.viewer.scene.on("modelLoaded",function(e){t._needsRebuild=!0}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",function(e){t._needsRebuild=!0}),this.viewer.scene.aabb.on("aabb",function(){t._needsRebuild=!0})}return D(g,[{key:"root",get:function(){return this._needsRebuild&&this._rebuild(),this._root}},{key:"_rebuild",value:function(){var t=this.viewer,e=t.scene,r=0;this._root={aabb:e.getAABB()};for(var o in e.objects){var n=e.objects[o];this._insertEntity(this._root,n,r+1)}this._needsRebuild=!1}},{key:"_insertEntity",value:function(t,e,r){var o=e.aabb;if(r>=this._maxTreeDepth){t.entities=t.entities||[],t.entities.push(e);return}if(t.left&&B.containsAABB3(t.left.aabb,o)){this._insertEntity(t.left,e,r+1);return}if(t.right&&B.containsAABB3(t.right.aabb,o)){this._insertEntity(t.right,e,r+1);return}var n=t.aabb;Ee[0]=n[3]-n[0],Ee[1]=n[4]-n[1],Ee[2]=n[5]-n[2];var y=0;if(Ee[1]>Ee[y]&&(y=1),Ee[2]>Ee[y]&&(y=2),!t.left){var E=n.slice();if(E[y+3]=(n[y]+n[y+3])/2,t.left={aabb:E},B.containsAABB3(E,o)){this._insertEntity(t.left,e,r+1);return}}if(!t.right){var P=n.slice();if(P[y]=(n[y]+n[y+3])/2,t.right={aabb:P},B.containsAABB3(P,o)){this._insertEntity(t.right,e,r+1);return}}t.entities=t.entities||[],t.entities.push(e)}},{key:"destroy",value:function(){var t=this.viewer.scene;t.off(this._onModelLoaded),t.off(this._onModelUnloaded),this._root=null,this._needsRebuild=!0}}])}(),Ae=function(){function g(i,t){F(this,g),this.items=i||[],this._lastUniqueId=(t||0)+1}return D(g,[{key:"addItem",value:function(){var t;if(arguments.length===2){var e=arguments[0];if(t=arguments[1],this.items[e])throw"ID clash: '"+e+"'";return this.items[e]=t,e}else for(t=arguments[0]||{};;){var r=this._lastUniqueId++;if(!this.items[r])return this.items[r]=t,r}}},{key:"removeItem",value:function(t){var e=this.items[t];return delete this.items[t],e}}])}(),fe=function(){function g(){F(this,g),this._head=[],this._headLength=0,this._tail=[],this._index=0,this._length=0}return D(g,[{key:"length",get:function(){return this._length}},{key:"shift",value:function(){if(this._index>=this._headLength){var t=this._head;if(t.length=0,this._head=this._tail,this._tail=t,this._index=0,this._headLength=this._head.length,!this._headLength)return}var e=this._head[this._index];return this._index<0?delete this._head[this._index++]:this._head[this._index++]=void 0,this._length--,e}},{key:"push",value:function(t){return this._length++,this._tail.push(t),this}},{key:"unshift",value:function(t){return this._head[--this._index]=t,this._length++,this}}])}(),ue={build:{version:"0.8"},client:{browser:navigator&&navigator.userAgent?navigator.userAgent:"n/a"},components:{scenes:0,models:0,meshes:0,objects:0},memory:{meshes:0,positions:0,colors:0,normals:0,uvs:0,indices:0,textures:0,transforms:0,materials:0,programs:0},frame:{frameCount:0,fps:0,useProgram:0,bindTexture:0,bindArray:0,drawElements:0,drawArrays:0,tasksRun:0,tasksScheduled:0}};function _e(g,i){if(g.nodeType===g.TEXT_NODE){var t=g.nodeValue;if(t.match(/^\s+$/)===null)return t}else if(g.nodeType===g.ELEMENT_NODE||g.nodeType===g.DOCUMENT_NODE){var e={type:g.nodeName,children:[]};if(g.nodeType===g.ELEMENT_NODE)for(var r=0;r<g.attributes.length;r++){var o=g.attributes[r],n=i[o.nodeName]||o.nodeName;e[n]=o.nodeValue}for(var y=0;y<g.childNodes.length;y++){var E=g.childNodes[y],r=_e(E,i);r&&e.children.push(r)}return e}}function be(g){return JSON.parse(JSON.stringify(g))}var De=[["0",10],["A",26],["a",26],["_",1],["$",1]].map(function(g){for(var i=[],t=g[0].charCodeAt(0),e=t+g[1],r=t;r<e;++r)i.push(r);return String.fromCharCode.apply(null,i)}).join("");function Je(g,i){var t=!i||i===4?[0,6,12,18]:[0,6];return t.map(function(e){return De.substr(parseInt(g/(1<<e))%64,1)}).reverse().join("")}function Qe(g){var i=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30].map(function(t){return parseInt(g.substr(t,2),16)});return Je(i[0],2)+[1,4,7,10,13].map(function(t){return Je((i[t]<<16)+(i[t+1]<<8)+i[t+2])}).join("")}function ot(g,i){var t=[],e=function(o){o.type===i&&t.push(o),(o.children||[]).forEach(function(n){e(n)})};return e(g),t}function ct(g){return new Promise(function(i,t){setTimeout(i,g)})}function ht(g){return new Promise(function(i,t){var e=new XMLHttpRequest;e.open(g.method||"GET",g.url,!0),e.onload=function(r){e.readyState===4&&(e.status===200?i(e.responseXML):t(e.statusText))},e.send(null)})}var it=function(){for(var g={},i=window.location.search.substring(1),t=i.split("&"),e=0;e<t.length;e++){var r=t[e].split("=");if(typeof g[r[0]]>"u")g[r[0]]=decodeURIComponent(r[1]);else if(typeof g[r[0]]=="string"){var o=[g[r[0]],decodeURIComponent(r[1])];g[r[0]]=o}else g[r[0]].push(decodeURIComponent(r[1]))}return g}();function Ze(g,i,t){var e=function(n){};i=i||e,t=t||e;var r=new XMLHttpRequest;r.overrideMimeType("application/json"),r.open("GET",g,!0),r.addEventListener("load",function(o){var n=o.target.response;if(this.status===200){var y;try{y=JSON.parse(n)}catch(E){t("utils.loadJSON(): Failed to parse JSON response - ".concat(E))}i(y)}else if(this.status===0){console.warn("loadFile: HTTP Status 0 received.");try{i(JSON.parse(n))}catch(E){t("utils.loadJSON(): Failed to parse JSON response - ".concat(E))}}else t(o)},!1),r.addEventListener("error",function(o){t(o)},!1),r.send(null)}function Xe(g,i,t){var e=function(ie){};i=i||e,t=t||e;var r=/^data:(.*?)(;base64)?,(.*)$/,o=g.match(r);if(o){var n=!!o[2],y=o[3];y=window.decodeURIComponent(y),n&&(y=window.atob(y));try{for(var E=new ArrayBuffer(y.length),P=new Uint8Array(E),z=0;z<y.length;z++)P[z]=y.charCodeAt(z);$t.scheduleTask(function(){i(E)})}catch(J){$t.scheduleTask(function(){t(J)})}}else{var Y=new XMLHttpRequest;Y.open("GET",g,!0),Y.responseType="arraybuffer",Y.onreadystatechange=function(){Y.readyState===4&&(Y.status===200?i(Y.response):t("loadArrayBuffer error : "+Y.response))},Y.send(null)}}function dt(g){return g&&!g.propertyIsEnumerable("length")&&I(g)==="object"&&typeof g.length=="number"}function at(g){return typeof g=="string"||g instanceof String}function ze(g){return!isNaN(parseFloat(g))&&isFinite(g)}function Ke(g){return Dt.isString(g)||Dt.isNumeric(g)}function ut(g,i){if(!g||!i)return!1;var t=Dt.isNumeric(g)||Dt.isString(g)?"".concat(g):g.id,e=Dt.isNumeric(i)||Dt.isString(i)?"".concat(i):i.id;return t===e}function yt(g){return typeof g=="function"}function Ne(g){var i={}.constructor;return!!g&&g.constructor===i}function tt(g){return Dt.apply(g,{})}function Pt(g,i){for(var t in g)g.hasOwnProperty(t)&&(i[t]=g[t]);return i}function Rt(g,i){for(var t in g)g.hasOwnProperty(t)&&g[t]!==void 0&&g[t]!==null&&(i[t]=g[t]);return i}function Ht(g,i){for(var t in g)g.hasOwnProperty(t)&&(i[t]===void 0||i[t]===null)&&(i[t]=g[t]);return i}function zt(g){for(var i in g)if(g.hasOwnProperty(i))return!1;return!0}function tr(g){return Dt.isNumeric(g)?"".concat(g):"'".concat(g,"'")}function qt(g,i){var t=new g.constructor(g.length+i.length);return t.set(g),t.set(i,g.length),t}function er(g){var i=[];function t(e){e.id=e.uuid,delete e.oid,i.push(e);var r=e.children;if(r)for(var o=0,n=r.length;o<n;o++){var y=r[o];y.parent=e.id,t(r[o])}e.children=[]}return t(g),i}var Dt={xmlToJson:_e,clone:be,compressGuid:Qe,findNodeOfType:ot,timeout:ct,httpRequest:ht,loadJSON:Ze,loadArraybuffer:Xe,queryString:it,isArray:dt,isString:at,isNumeric:ze,isID:Ke,isSameComponent:ut,isFunction:yt,isObject:Ne,copy:tt,apply:Pt,apply2:Rt,applyIf:Ht,isEmptyObject:zt,inQuotes:tr,concat:qt,flattenParentChildHierarchy:er},rr={},_r=new Ae,pr=new fe,xr={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},Ct=10,Et=[],Lt=30,Kt=0,Ar,xt=0;function Qt(){this.version="1.0.0",this.scenes={},this._superTypes={},this._addScene=function(g){if(g.id){if($t.scenes[g.id]){console.error("[ERROR] Scene ".concat(Dt.inQuotes(g.id)," already exists"));return}}else g.id=_r.addItem({});$t.scenes[g.id]=g;var i=g.ticksPerOcclusionTest,t=g.ticksPerRender;rr[g.id]={ticksPerOcclusionTest:i,ticksPerRender:t,renderCountdown:t},ue.components.scenes++,g.once("destroyed",function(){_r.removeItem(g.id),delete $t.scenes[g.id],delete rr[g.id],ue.components.scenes--})},this.clear=function(){var g;for(var i in $t.scenes)$t.scenes.hasOwnProperty(i)&&(g=$t.scenes[i],i==="default.scene"?g.clear():(g.destroy(),delete $t.scenes[g.id]))},this.scheduleTask=function(g){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;pr.push(g),pr.push(i)},this.runTasks=function(){for(var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,i=new Date().getTime(),t,e,r=0;pr.length>0&&(g<0||i<g);)t=pr.shift(),e=pr.shift(),e?t.call(e):t(),i=new Date().getTime(),r++;return r},this.getNumTasks=function(){return pr.length}}var $t=new Qt,nr=function(){var i=Date.now();if(Ar=i-Kt,Kt>0&&Ar>0){var t=1e3/Ar;xt+=t,Et.push(t),Et.length>=Lt&&(xt-=Et.shift()),ue.frame.fps=Math.round(xt/Et.length)}for(var e in $t.scenes)$t.scenes[e].compile();Le(i),Kt=i},Er=function(){function g(i,t){F(this,g),M(this,"worker",null);var e=new Blob(["setInterval(() => postMessage(0), ".concat(t,");")]),r=URL.createObjectURL(e);this.worker=new Worker(r),this.worker.onmessage=i}return D(g,[{key:"stop",value:function(){this.worker.terminate()}}])}();new Er(nr,100);var Ie=function(){var i=Date.now();if(Ar=i-Kt,Kt>0&&Ar>0){var t=1e3/Ar;xt+=t,Et.push(t),Et.length>=Lt&&(xt-=Et.shift()),ue.frame.fps=Math.round(xt/Et.length)}Le(i),Ue(i),Ge(),window.requestPostAnimationFrame!==void 0?window.requestPostAnimationFrame(nr):requestAnimationFrame(Ie)};Ie();function Le(g){var i=$t.runTasks(g+Ct),t=$t.getNumTasks();ue.frame.tasksRun=i,ue.frame.tasksScheduled=t,ue.frame.tasksBudget=Ct}function Ue(g){xr.time=g;for(var i in $t.scenes)if($t.scenes.hasOwnProperty(i)){var t=$t.scenes[i];xr.sceneId=i,xr.startTime=t.startTime,xr.deltaTime=xr.prevTime!=null?xr.time-xr.prevTime:0,t.fire("tick",xr,!0)}xr.prevTime=g}function Ge(){var g=$t.scenes,i=!1,t,e,r,o,n;for(n in g)g.hasOwnProperty(n)&&(t=g[n],e=rr[n],e||(e=rr[n]={}),r=t.ticksPerOcclusionTest,e.ticksPerOcclusionTest!==r&&(e.ticksPerOcclusionTest=r,e.renderCountdown=r),--t.occlusionTestCountdown<=0&&(t.doOcclusionTest(),t.occlusionTestCountdown=r),o=t.ticksPerRender,e.ticksPerRender!==o&&(e.ticksPerRender=o,e.renderCountdown=o),--e.renderCountdown===0&&(t.render(i),e.renderCountdown=o))}var Ye=function(){function g(i,t,e){F(this,g),this.id=e&&e.id?e.id:i,this.viewer=t,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._eventSubsNum=null,this._events=null,this._eventCallDepth=0,t.addPlugin(this)}return D(g,[{key:"scheduleTask",value:function(t){$t.scheduleTask(t,null)}},{key:"fire",value:function(t,e,r){this._events||(this._events={}),this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),r!==!0&&(this._events[t]=e||!0);var o=this._eventSubs[t],n;if(o)for(var y in o)o.hasOwnProperty(y)&&(n=o[y],this._eventCallDepth++,this._eventCallDepth<300?n.callback.call(n.scope,e):this.error("fire: potential stack overflow from recursive event '"+t+"' - dropping this event"),this._eventCallDepth--)}},{key:"on",value:function(t,e,r){this._events||(this._events={}),this._subIdMap||(this._subIdMap=new Ae),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={}),this._eventSubsNum||(this._eventSubsNum={});var o=this._eventSubs[t];o?this._eventSubsNum[t]++:(o={},this._eventSubs[t]=o,this._eventSubsNum[t]=1);var n=this._subIdMap.addItem();o[n]={callback:e,scope:r||this},this._subIdEvents[n]=t;var y=this._events[t];return y!==void 0&&e.call(r||this,y),n}},{key:"off",value:function(t){if(t!=null&&this._subIdEvents){var e=this._subIdEvents[t];if(e){delete this._subIdEvents[t];var r=this._eventSubs[e];r&&(delete r[t],this._eventSubsNum[e]--),this._subIdMap.removeItem(t)}}}},{key:"once",value:function(t,e,r){var o=this,n=this.on(t,function(y){o.off(n),e.call(r||this,y)},r)}},{key:"hasSubs",value:function(t){return this._eventSubsNum&&this._eventSubsNum[t]>0}},{key:"log",value:function(t){console.log("[xtctwins plugin ".concat(this.id,"]: ").concat(t))}},{key:"warn",value:function(t){console.warn("[xtctwins plugin ".concat(this.id,"]: ").concat(t))}},{key:"error",value:function(t){console.error("[xtctwins plugin ".concat(this.id,"]: ").concat(t))}},{key:"send",value:function(t,e){}},{key:"destroy",value:function(){this.viewer.removePlugin(this)}}])}(),$e=function(){function g(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(F(this,g),this.scene=null,this.type==="Scene")this.scene=this,this.viewer=t.viewer;else{if(i.type==="Scene")this.scene=i;else if(i instanceof g)this.scene=i.scene;else throw"Invalid param: owner must be a Component";this._owner=i}this._dontClear=!!t.dontClear,this._renderer=this.scene._renderer,this.meta=t.meta||{},this.id=t.id,this.destroyed=!1,this._attached={},this._attachments=null,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._eventSubsNum=null,this._events=null,this._eventCallDepth=0,this._ownedComponents=null,this!==this.scene&&this.scene._addComponent(this),this._updateScheduled=!1,i&&i._own(this)}return D(g,[{key:"type",get:function(){return"Component"}},{key:"isComponent",get:function(){return!0}},{key:"glRedraw",value:function(){this._renderer&&(this._renderer.imageDirty(),this.castsShadow&&this._renderer.shadowsDirty())}},{key:"glResort",value:function(){this._renderer&&this._renderer.needStateSort()}},{key:"owner",get:function(){return this._owner}},{key:"isType",value:function(t){return this.type===t}},{key:"fire",value:function(t,e,r){this._events||(this._events={}),this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),r!==!0&&(this._events[t]=e||!0);var o=this._eventSubs[t],n;if(o)for(var y in o)o.hasOwnProperty(y)&&(n=o[y],this._eventCallDepth++,this._eventCallDepth<300?n.callback.call(n.scope,e):this.error("fire: potential stack overflow from recursive event '"+t+"' - dropping this event"),this._eventCallDepth--)}},{key:"on",value:function(t,e,r){this._events||(this._events={}),this._subIdMap||(this._subIdMap=new Ae),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={}),this._eventSubsNum||(this._eventSubsNum={});var o=this._eventSubs[t];o?this._eventSubsNum[t]++:(o={},this._eventSubs[t]=o,this._eventSubsNum[t]=1);var n=this._subIdMap.addItem();o[n]={callback:e,scope:r||this},this._subIdEvents[n]=t;var y=this._events[t];return y!==void 0&&e.call(r||this,y),n}},{key:"off",value:function(t){if(t!=null&&this._subIdEvents){var e=this._subIdEvents[t];if(e){delete this._subIdEvents[t];var r=this._eventSubs[e];r&&(delete r[t],this._eventSubsNum[e]--),this._subIdMap.removeItem(t)}}}},{key:"once",value:function(t,e,r){var o=this,n=this.on(t,function(y){o.off(n),e.call(r||this,y)},r)}},{key:"hasSubs",value:function(t){return this._eventSubsNum&&this._eventSubsNum[t]>0}},{key:"log",value:function(t){t="[LOG]"+this._message(t),window.console.log(t),this.scene.fire("log",t)}},{key:"_message",value:function(t){return" ["+this.type+" "+Dt.inQuotes(this.id)+"]: "+t}},{key:"warn",value:function(t){t="[WARN]"+this._message(t),window.console.warn(t),this.scene.fire("warn",t)}},{key:"error",value:function(t){t="[ERROR]"+this._message(t),window.console.error(t),this.scene.fire("error",t)}},{key:"_attach",value:function(t){var e=t.name;if(!e){this.error("Component 'name' expected");return}var r=t.component,o=t.sceneDefault,n=t.sceneSingleton,y=t.type,E=t.on,P=t.recompiles!==!1,z=!1;if(r&&(Dt.isNumeric(r)||Dt.isString(r))){var Y=r;if(r=this.scene.components[Y],!r){this.error("Component not found: "+Dt.inQuotes(Y));return}}if(!r){if(n===!0){var J=this.scene.types[y];for(var ie in J)if(J.hasOwnProperty){r=J[ie];break}if(!r)return this.error("Scene has no default component for '"+e+"'"),null}else if(o===!0&&(r=this.scene[e],!r))return this.error("Scene has no default component for '"+e+"'"),null}if(r){if(r.scene.id!==this.scene.id){this.error("Not in same scene: "+r.type+" "+Dt.inQuotes(r.id));return}if(y&&!r.isType(y)){this.error("Expected a "+y+" type or subtype: "+r.type+" "+Dt.inQuotes(r.id));return}}this._attachments||(this._attachments={});var le=this._attached[e],Z,ye,we;if(le){if(r&&le.id===r.id)return;var Be=this._attachments[le.id];for(Z=Be.subs,ye=0,we=Z.length;ye<we;ye++)le.off(Z[ye]);delete this._attached[e],delete this._attachments[le.id];var xe=Be.params.onDetached;xe&&(Dt.isFunction(xe)?xe(le):xe.scope?xe.callback.call(xe.scope,le):xe.callback(le)),Be.managingLifecycle&&le.destroy()}if(r){var Se={params:t,component:r,subs:[],managingLifecycle:z};Se.subs.push(r.once("destroyed",function(){Se.params.component=null,this._attach(Se.params)},this)),P&&Se.subs.push(r.on("dirty",function(){this.fire("dirty",this)},this)),this._attached[e]=r,this._attachments[r.id]=Se;var Te=t.onAttached;if(Te&&(Dt.isFunction(Te)?Te(r):Te.scope?Te.callback.call(Te.scope,r):Te.callback(r)),E){var Me,Fe,Re,He;for(Me in E)if(E.hasOwnProperty(Me)){if(Fe=E[Me],Dt.isFunction(Fe)?(Re=Fe,He=null):(Re=Fe.callback,He=Fe.scope),!Re)continue;Se.subs.push(r.on(Me,Re,He))}}}return P&&this.fire("dirty",this),this.fire(e,r),r}},{key:"_checkComponent",value:function(t,e){if(!e.isComponent)if(Dt.isID(e)){var r=e;if(e=this.scene.components[r],!e){this.error("Component not found: "+r);return}}else{this.error("Expected a Component or ID");return}if(t!==e.type){this.error("Expected a "+t+" Component");return}if(e.scene.id!==this.scene.id){this.error("Not in same scene: "+e.type);return}return e}},{key:"_checkComponent2",value:function(t,e){if(!e.isComponent)if(Dt.isID(e)){var r=e;if(e=this.scene.components[r],!e){this.error("Component not found: "+r);return}}else{this.error("Expected a Component or ID");return}if(e.scene.id!==this.scene.id){this.error("Not in same scene: "+e.type);return}for(var o=0,n=t.length;o<n;o++)if(t[o]===e.type)return e;return this.error("Expected component types: "+t),null}},{key:"_own",value:function(t){var e=this;this._ownedComponents||(this._ownedComponents={}),this._ownedComponents[t.id]||(this._ownedComponents[t.id]=t),t.once("destroyed",function(){delete e._ownedComponents[t.id]},this)}},{key:"_needUpdate",value:function(t){this._updateScheduled||(this._updateScheduled=!0,t===0?this._doUpdate():$t.scheduleTask(this._doUpdate,this))}},{key:"_doUpdate",value:function(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}},{key:"scheduleTask",value:function(t){$t.scheduleTask(t,null)}},{key:"_update",value:function(){}},{key:"clear",value:function(){if(this._ownedComponents){for(var t in this._ownedComponents)if(this._ownedComponents.hasOwnProperty(t)){var e=this._ownedComponents[t];e.destroy(),delete this._ownedComponents[t]}}}},{key:"destroy",value:function(t){if(!this.destroyed){this.fire("destroyed",this.destroyed=!0);var e,r,o,n,y,E;if(this._attachments){for(e in this._attachments)if(this._attachments.hasOwnProperty(e)){for(r=this._attachments[e],o=r.component,n=r.subs,y=0,E=n.length;y<E;y++)o.off(n[y]);r.managingLifecycle&&o.destroy()}}if(this._ownedComponents)for(e in this._ownedComponents)this._ownedComponents.hasOwnProperty(e)&&(o=this._ownedComponents[e],o.destroy(),delete this._ownedComponents[e]);this.scene._removeComponent(this),this._attached={},this._attachments=null,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._ownedComponents=null,this._updateScheduled=!1}}}])}(),pt=B.vec3(),Ve=B.vec4(),et=function(){var g=new Float64Array(16),i=new Float64Array(4),t=new Float64Array(4);return function(e,r,o){return o=o||g,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=1,B.transformVec4(e,i,t),B.setMat4Translation(e,t,o),o.slice()}}();function lt(g,i,t){var e=Float32Array.from([g[0]])[0],r=g[0]-e,o=Float32Array.from([g[1]])[0],n=g[1]-o,y=Float32Array.from([g[2]])[0],E=g[2]-y;i[0]=e,i[1]=o,i[2]=y,t[0]=r,t[1]=n,t[2]=E}function vt(g,i,t){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e3,r=B.getPositionsCenter(g,pt),o=Math.round(r[0]/e)*e,n=Math.round(r[1]/e)*e,y=Math.round(r[2]/e)*e;t[0]=o,t[1]=n,t[2]=y;var E=t[0]!==0||t[1]!==0||t[2]!==0;if(E)for(var P=0,z=g.length;P<z;P+=3)i[P+0]=g[P+0]-o,i[P+1]=g[P+1]-n,i[P+2]=g[P+2]-y;return E}function It(g,i,t){return t[0]=g[0]+i[0],t[1]=g[1]+i[1],t[2]=g[2]+i[2],t}function Bt(g,i,t,e,r){var o=r?(Ve.set(t,0),Ve[3]=1,B.mulMat4v4(r,Ve,Ve)):t,n=B.dotVec3(i,o)+g,y=B.normalizeVec3(i,pt);return B.mulVec3Scalar(y,-n,e),e}var nt={VISIBLE:1,CULLED:4,PICKABLE:8,CLIPPABLE:16,COLLIDABLE:32,CAST_SHADOW:64,RECEIVE_SHADOW:128,XRAYED:256,HIGHLIGHTED:512,SELECTED:1024,EDGES:2048,BACKFACES:4096,TRANSPARENT:8192},wr=new Float32Array([0,0,0]),ur=new Uint16Array([0,0,0]);B.OBB3();var jr=function(){function g(i,t,e,r,o,n){F(this,g),this._isObject=t,this.scene=i.scene,this.model=i,this.meshes=r,this._numPrimitives=0;for(var y=0,E=this.meshes.length;y<E;y++){var P=this.meshes[y];P.parent=this,P.entity=this,this._numPrimitives+=P.numPrimitives}this.id=e,this.originalSystemId=B.unglobalizeObjectId(i.id,e),this._flags=o,this._aabb=B.AABB3(),this._aabbDirty=!0,this._offset=B.vec3(),this._colorizeUpdated=!1,this._opacityUpdated=!1,this._origin_opacity=-1,this._lodCullable=!!n,this._culled=!1,this._culledVFC=!1,this._culledLOD=!1,this._isObject&&i.scene._registerObject(this)}return D(g,[{key:"position",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.position:null},set:function(t){for(var e={},r=0,o=this.meshes.length;r<o;r++){var n=this.meshes[r];n.transform&&!e[n.transform.id]&&(e[n.transform.id]=!0,n.position=t)}}},{key:"matrix",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.matrix:null},set:function(t){for(var e={},r=0,o=this.meshes.length;r<o;r++){var n=this.meshes[r].transform;n&&!e[n.id]&&(e[n.id]=!0,n.matrix=t)}}},{key:"rotation",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.rotation:null},set:function(t){for(var e={},r=0,o=this.meshes.length;r<o;r++){var n=this.meshes[r].transform;n&&!e[n.id]&&(e[n.id]=!0,n.rotation=t)}}},{key:"quaternion",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.quaternion:null},set:function(t){for(var e={},r=0,o=this.meshes.length;r<o;r++){var n=this.meshes[r].transform;n&&!e[n.id]&&(e[n.id]=!0,n.quaternion=t)}}},{key:"scale",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.scale:null},set:function(t){for(var e={},r=0,o=this.meshes.length;r<o;r++){var n=this.meshes[r].transform;n&&!e[n.id]&&(e[n.id]=!0,n.scale=t)}}},{key:"_transformDirty",value:function(){this._aabbDirty=!0,this.model._transformDirty()}},{key:"_sceneModelDirty",value:function(){this._aabbDirty=!0;for(var t=0,e=this.meshes.length;t<e;t++)this.meshes[t]._sceneModelDirty()}},{key:"aabb",get:function(){if(this._aabbDirty){B.collapseAABB3(this._aabb);for(var t=0,e=this.meshes.length;t<e;t++)B.expandAABB3(this._aabb,this.meshes[t].aabb);this._aabbDirty=!1}return this._aabb}},{key:"isEntity",get:function(){return!0}},{key:"isModel",get:function(){return!1}},{key:"isObject",get:function(){return this._isObject}},{key:"numPrimitives",get:function(){return this._numPrimitives}},{key:"numTriangles",get:function(){return this._numPrimitives}},{key:"visible",get:function(){return this._getFlag(nt.VISIBLE)},set:function(t){if(!!(this._flags&nt.VISIBLE)!==t){t?this._flags=this._flags|nt.VISIBLE:this._flags=this._flags&~nt.VISIBLE;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setVisible(this._flags);this._isObject&&this.model.scene._objectVisibilityUpdated(this),this.model.glRedraw()}}},{key:"highlighted",get:function(){return this._getFlag(nt.HIGHLIGHTED)},set:function(t){if(!!(this._flags&nt.HIGHLIGHTED)!==t){t?this._flags=this._flags|nt.HIGHLIGHTED:this._flags=this._flags&~nt.HIGHLIGHTED;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setHighlighted(this._flags);this._isObject&&this.model.scene._objectHighlightedUpdated(this),this.model.glRedraw()}}},{key:"xrayed",get:function(){return this._getFlag(nt.XRAYED)},set:function(t){if(!!(this._flags&nt.XRAYED)!==t){t?this._flags=this._flags|nt.XRAYED:this._flags=this._flags&~nt.XRAYED;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setXRayed(this._flags);this._isObject&&this.model.scene._objectXRayedUpdated(this),this.model.glRedraw()}}},{key:"selected",get:function(){return this._getFlag(nt.SELECTED)},set:function(t){if(!!(this._flags&nt.SELECTED)!==t){t?this._flags=this._flags|nt.SELECTED:this._flags=this._flags&~nt.SELECTED;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setSelected(this._flags);this._isObject&&this.model.scene._objectSelectedUpdated(this),this.model.glRedraw()}}},{key:"edges",get:function(){return this._getFlag(nt.EDGES)},set:function(t){if(!!(this._flags&nt.EDGES)!==t){t?this._flags=this._flags|nt.EDGES:this._flags=this._flags&~nt.EDGES;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setEdges(this._flags);this._isObject&&this.model.scene._objectEdgedUpdated(this),this.model.glRedraw()}}},{key:"culledVFC",get:function(){return!!this._culledVFC},set:function(t){this._culledVFC=t,this._setCulled()}},{key:"culledLOD",get:function(){return!!this._culledLOD},set:function(t){this._culledLOD=t,this._setCulled()}},{key:"culled",get:function(){return!!this._culled},set:function(t){this._culled=t,this._setCulled()}},{key:"_setCulled",value:function(){var t=!!this._culled||!!(this._culledLOD&&this._lodCullable)||!!this._culledVFC;if(!!(this._flags&nt.CULLED)!==t){t?this._flags=this._flags|nt.CULLED:this._flags=this._flags&~nt.CULLED;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setCulled(this._flags);this.model.glRedraw()}}},{key:"clippable",get:function(){return this._getFlag(nt.CLIPPABLE)},set:function(t){if(!!(this._flags&nt.CLIPPABLE)!==t){t?this._flags=this._flags|nt.CLIPPABLE:this._flags=this._flags&~nt.CLIPPABLE;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setClippable(this._flags);this.model.glRedraw()}}},{key:"collidable",get:function(){return this._getFlag(nt.COLLIDABLE)},set:function(t){if(!!(this._flags&nt.COLLIDABLE)!==t){t?this._flags=this._flags|nt.COLLIDABLE:this._flags=this._flags&~nt.COLLIDABLE;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setCollidable(this._flags)}}},{key:"pickable",get:function(){return this._getFlag(nt.PICKABLE)},set:function(t){if(!!(this._flags&nt.PICKABLE)!==t){t?this._flags=this._flags|nt.PICKABLE:this._flags=this._flags&~nt.PICKABLE;for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setPickable(this._flags)}}},{key:"colorize",get:function(){if(this.meshes.length===0)return null;var t=this.meshes[0]._colorize;return wr[0]=t[0]/255,wr[1]=t[1]/255,wr[2]=t[2]/255,wr},set:function(t){if(t){ur[0]=Math.floor(t[0]*255),ur[1]=Math.floor(t[1]*255),ur[2]=Math.floor(t[2]*255);for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setColorize(ur)}else for(var o=0,n=this.meshes.length;o<n;o++)this.meshes[o]._setColorize(null);if(this._isObject){var y=!!t;this.scene._objectColorizeUpdated(this,y),this._colorizeUpdated=y}this.model.glRedraw()}},{key:"opacity",get:function(){return this.meshes.length>0?this.meshes[0]._colorize[3]/255:1},set:function(t){if(this.meshes.length!==0){var e=t!=null,r=this.meshes[0]._colorize[3],o=255;if(e){if(t<0?t=0:t>1&&(t=1),o=Math.floor(t*255),r===o)return}else if(o=255,r===o)return;for(var n=0,y=this.meshes.length;n<y;n++)this.meshes[n]._setOpacity(o,this._flags);this._isObject&&(this.scene._objectOpacityUpdated(this,e),this._opacityUpdated=e),this.model.glRedraw()}}},{key:"origin_opacity",get:function(){return this._origin_opacity==-1&&(this._origin_opacity=this.opacity),this._origin_opacity},set:function(t){this._origin_opacity=t}},{key:"offset",get:function(){return this._offset},set:function(t){t?(this._offset[0]=t[0],this._offset[1]=t[1],this._offset[2]=t[2]):(this._offset[0]=0,this._offset[1]=0,this._offset[2]=0);for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._setOffset(this._offset);this._aabbDirty=!0,this.model._aabbDirty=!0,this.scene._aabbDirty=!0,this.scene._objectOffsetUpdated(this,t),this.model.glRedraw()}},{key:"saoEnabled",get:function(){return this.model.saoEnabled}},{key:"getEachVertex",value:function(t){for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e].getEachVertex(t)}},{key:"_getFlag",value:function(t){return!!(this._flags&t)}},{key:"_finalize",value:function(){var t=this.model.scene;this._isObject&&(this.visible&&t._objectVisibilityUpdated(this),this.highlighted&&t._objectHighlightedUpdated(this),this.xrayed&&t._objectXRayedUpdated(this),this.selected&&t._objectSelectedUpdated(this));for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._finalize(this._flags)}},{key:"_finalize2",value:function(){for(var t=0,e=this.meshes.length;t<e;t++)this.meshes[t]._finalize2()}},{key:"_destroy",value:function(){var t=this.model.scene;this._isObject&&(t._deregisterObject(this),this.visible&&t._deRegisterVisibleObject(this),this.xrayed&&t._deRegisterXRayedObject(this),this.selected&&t._deRegisterSelectedObject(this),this.highlighted&&t._deRegisterHighlightedObject(this),this.edges&&t._deRegisterEdgesObject(this),this._colorizeUpdated&&this.scene._deRegisterColorizedObject(this),this._opacityUpdated&&this.scene._deRegisterOpacityObject(this),this._offset&&(this._offset[0]!==0||this._offset[1]!==0||this._offset[2]!==0)&&this.scene._deRegisterOffsetObject(this));for(var e=0,r=this.meshes.length;e<r;e++)this.meshes[e]._destroy();t._aabbDirty=!0}}])}(),gr=B.vec4(),qr=B.vec4(),Mr=function(g){function i(t,e){var r;return F(this,i),r=R(this,i,[t,e]),r.id=e.id,r._entity=null,r._visible=null,r._worldPos=B.vec3(),r._origin=B.vec3(),r._rtcPos=B.vec3(),r._viewPos=B.vec3(),r._canvasPos=B.vec2(),r._occludable=!1,r._onCameraViewMatrix=r.scene.camera.on("matrix",function(){r._viewPosDirty=!0,r._needUpdate()}),r._onCameraProjMatrix=r.scene.camera.on("projMatrix",function(){r._canvasPosDirty=!0,r._needUpdate()}),r._onEntityDestroyed=null,r._onEntityModelDestroyed=null,r._renderer.addMarker(r),r.entity=e.entity,r.worldPos=e.worldPos,r.occludable=e.occludable,r}return O(i,g),D(i,[{key:"_update",value:function(){if(this._viewPosDirty&&(B.transformPoint3(this.scene.camera.viewMatrix,this._worldPos,this._viewPos),this._viewPosDirty=!1,this._canvasPosDirty=!0,this.fire("viewPos",this._viewPos)),this._canvasPosDirty){gr.set(this._viewPos),gr[3]=1,B.transformPoint4(this.scene.camera.projMatrix,gr,qr);var e=this.scene.canvas.boundary;this._canvasPos[0]=Math.floor((1+qr[0]/qr[3])*e[2]/2),this._canvasPos[1]=Math.floor((1-qr[1]/qr[3])*e[3]/2),this._canvasPosDirty=!1,this.fire("canvasPos",this._canvasPos)}}},{key:"_setVisible",value:function(e){this._visible,this._visible=e,this.fire("visible",this._visible)}},{key:"entity",get:function(){return this._entity},set:function(e){var r=this;if(this._entity){if(this._entity===e)return;this._onEntityDestroyed!==null&&(this._entity.model?this._entity.model.off(this._onEntityDestroyed):this._entity.off(this._onEntityDestroyed),this._onEntityDestroyed=null),this._onEntityModelDestroyed!==null&&(this._entity.model&&this._entity.model.off(this._onEntityModelDestroyed),this._onEntityModelDestroyed=null)}this._entity=e,this._entity&&(this._entity instanceof jr?this._onEntityModelDestroyed=this._entity.model.on("destroyed",function(){r._entity=null,r._onEntityModelDestroyed=null}):this._onEntityDestroyed=this._entity.on("destroyed",function(){r._entity=null,r._onEntityDestroyed=null})),this.fire("entity",this._entity,!0)}},{key:"occludable",get:function(){return this._occludable},set:function(e){e=!!e,e!==this._occludable&&(this._occludable=e,this._occludable&&this._renderer.markerWorldPosUpdated(this))}},{key:"worldPos",get:function(){return this._worldPos},set:function(e){this._worldPos.set(e||[0,0,0]),lt(this._worldPos,this._origin,this._rtcPos),this._occludable&&this._renderer.markerWorldPosUpdated(this),this._viewPosDirty=!0,this.fire("worldPos",this._worldPos),this._needUpdate()}},{key:"origin",get:function(){return this._origin}},{key:"rtcPos",get:function(){return this._rtcPos}},{key:"viewPos",get:function(){return this._update(),this._viewPos}},{key:"canvasPos",get:function(){return this._update(),this._canvasPos}},{key:"visible",get:function(){return!!this._visible}},{key:"destroy",value:function(){this.fire("destroyed",!0),this.scene.camera.off(this._onCameraViewMatrix),this.scene.camera.off(this._onCameraProjMatrix),this._entity&&(this._onEntityDestroyed!==null&&this._entity.model.off(this._onEntityDestroyed),this._onEntityModelDestroyed!==null&&this._entity.model.off(this._onEntityModelDestroyed)),this._renderer.removeMarker(this),H(i,"destroy",this)([])}}])}($e),Wr=function(){function g(i){var t=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};F(this,g),this._color=e.color||"black",this._highlightClass="viewer-ruler-wire-highlighted",this._wire=document.createElement("div"),this._wire.className+=this._wire.className?" viewer-ruler-wire":"viewer-ruler-wire",this._wireClickable=document.createElement("div"),this._wireClickable.className+=this._wireClickable.className?" viewer-ruler-wire-clickable":"viewer-ruler-wire-clickable",this._thickness=e.thickness||1,this._thicknessClickable=e.thicknessClickable||6,this._visible=!0,this._culled=!1;var r=this._wire,o=r.style;o.border="solid "+this._thickness+"px "+this._color,o.position="absolute",o["z-index"]=e.zIndex===void 0?"2000001":e.zIndex,o.width="0px",o.height="0px",o.display="block",o.top="0px",o.left="0px",o["-webkit-transform-origin"]="0 0",o["-moz-transform-origin"]="0 0",o["-ms-transform-origin"]="0 0",o["-o-transform-origin"]="0 0",o["transform-origin"]="0 0",o["-webkit-transform"]="rotate(0deg)",o["-moz-transform"]="rotate(0deg)",o["-ms-transform"]="rotate(0deg)",o["-o-transform"]="rotate(0deg)",o.transform="rotate(0deg)",o.opacity=1,o["pointer-events"]="none",e.onContextMenu,i.appendChild(r);var n=this._wireClickable,y=n.style;y.border="solid "+this._thicknessClickable+"px "+this._color,y.position="absolute",y["z-index"]=e.zIndex===void 0?"2000002":e.zIndex+1,y.width="0px",y.height="0px",y.display="block",y.top="0px",y.left="0px",y["-webkit-transform-origin"]="0 0",y["-moz-transform-origin"]="0 0",y["-ms-transform-origin"]="0 0",y["-o-transform-origin"]="0 0",y["transform-origin"]="0 0",y["-webkit-transform"]="rotate(0deg)",y["-moz-transform"]="rotate(0deg)",y["-ms-transform"]="rotate(0deg)",y["-o-transform"]="rotate(0deg)",y.transform="rotate(0deg)",y.opacity=0,y["pointer-events"]="none",e.onContextMenu,i.appendChild(n),e.onMouseOver&&n.addEventListener("mouseover",function(E){e.onMouseOver(E,t)}),e.onMouseLeave&&n.addEventListener("mouseleave",function(E){e.onMouseLeave(E,t)}),e.onMouseWheel&&n.addEventListener("wheel",function(E){e.onMouseWheel(E,t)}),e.onMouseDown&&n.addEventListener("mousedown",function(E){e.onMouseDown(E,t)}),e.onMouseClick&&n.addEventListener("click",function(E){e.onMouseClick(E,t)}),e.onTouchStart&&n.addEventListener("touchstart",function(E){e.onTouchStart(E,t)}),e.onMouseUp&&n.addEventListener("mouseup",function(E){e.onMouseUp(E,t)}),e.onMouseMove&&n.addEventListener("mousemove",function(E){e.onMouseMove(E,t)}),e.onContextMenu&&n.addEventListener("contextmenu",function(E){e.onContextMenu(E,t),E.preventDefault()}),this._x1=0,this._y1=0,this._x2=0,this._y2=0,this._update()}return D(g,[{key:"visible",get:function(){return this._wire.style.display==="block"}},{key:"_update",value:function(){var t=Math.abs(Math.sqrt((this._x1-this._x2)*(this._x1-this._x2)+(this._y1-this._y2)*(this._y1-this._y2))),e=Math.atan2(this._y2-this._y1,this._x2-this._x1)*180/Math.PI,r=this._wire.style;r.width=Math.round(t)+"px",r.left=Math.round(this._x1)+"px",r.top=Math.round(this._y1)+"px",r["-webkit-transform"]="rotate("+e+"deg)",r["-moz-transform"]="rotate("+e+"deg)",r["-ms-transform"]="rotate("+e+"deg)",r["-o-transform"]="rotate("+e+"deg)",r.transform="rotate("+e+"deg)";var o=this._wireClickable.style;o.width=Math.round(t)+"px",o.left=Math.round(this._x1)+"px",o.top=Math.round(this._y1)+"px",o["-webkit-transform"]="rotate("+e+"deg)",o["-moz-transform"]="rotate("+e+"deg)",o["-ms-transform"]="rotate("+e+"deg)",o["-o-transform"]="rotate("+e+"deg)",o.transform="rotate("+e+"deg)"}},{key:"setStartAndEnd",value:function(t,e,r,o){this._x1=t,this._y1=e,this._x2=r,this._y2=o,this._update()}},{key:"setColor",value:function(t){this._color=t||"black",this._wire.style.border="solid "+this._thickness+"px "+this._color}},{key:"setOpacity",value:function(t){this._wire.style.opacity=t}},{key:"setVisible",value:function(t){this._visible!==t&&(this._visible=!!t,this._wire.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setCulled",value:function(t){this._culled!==t&&(this._culled=!!t,this._wire.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setClickable",value:function(t){this._wireClickable.style["pointer-events"]=t?"all":"none"}},{key:"setHighlighted",value:function(t){this._highlighted!==t&&(this._highlighted=!!t,this._highlighted?this._wire.classList.add(this._highlightClass):this._wire.classList.remove(this._highlightClass))}},{key:"destroy",value:function(t){this._wire.parentElement&&this._wire.parentElement.removeChild(this._wire),this._wireClickable.parentElement&&this._wireClickable.parentElement.removeChild(this._wireClickable)}}])}(),ki=function(){function g(i){var t=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};F(this,g),this._highlightClass="viewer-ruler-dot-highlighted",this._x=0,this._y=0,this._visible=!0,this._dot=document.createElement("div"),this._dot.className+=this._dot.className?" viewer-ruler-dot":"viewer-ruler-dot",this._dotClickable=document.createElement("div"),this._dotClickable.className+=this._dotClickable.className?" viewer-ruler-dot-clickable":"viewer-ruler-dot-clickable",this._visible=!0,this._culled=!1;var r=this._dot,o=r.style;o["border-radius"]="25px",o.border="solid 2px white",o.background="lightgreen",o.position="absolute",o["z-index"]=e.zIndex===void 0?"40000005":e.zIndex,o.width="10px",o.height="10px",o.display=e.visible!==!1?"block":"none",o.top="0px",o.left="0px",o["box-shadow"]="0 2px 5px 0 #182A3D;",o.opacity=1,o["pointer-events"]="none",e.onContextMenu,i.appendChild(r);var n=this._dotClickable,y=n.style;y["border-radius"]="35px",y.border="solid 10px white",y.position="absolute",y["z-index"]=e.zIndex===void 0?"40000007":e.zIndex+1,y.width="10px",y.height="10px",y.display="block",y.top="0px",y.left="0px",y.opacity=0,y["pointer-events"]="none",e.onContextMenu,i.appendChild(n),n.addEventListener("click",function(E){i.dispatchEvent(new MouseEvent("mouseover",E))}),e.onMouseOver&&n.addEventListener("mouseover",function(E){e.onMouseOver(E,t),i.dispatchEvent(new MouseEvent("mouseover",E))}),e.onMouseLeave&&n.addEventListener("mouseleave",function(E){e.onMouseLeave(E,t)}),e.onMouseWheel&&n.addEventListener("wheel",function(E){e.onMouseWheel(E,t)}),e.onMouseDown&&n.addEventListener("mousedown",function(E){e.onMouseDown(E,t)}),e.onMouseClick&&n.addEventListener("click",function(E){e.onMouseClick(E,t)}),e.onTouchStart&&n.addEventListener("touchstart",function(E){e.onTouchStart(E,t)}),e.onMouseUp&&n.addEventListener("mouseup",function(E){e.onMouseUp(E,t)}),e.onMouseMove&&n.addEventListener("mousemove",function(E){e.onMouseMove(E,t)}),e.onContextMenu&&n.addEventListener("contextmenu",function(E){e.onContextMenu(E,t),E.preventDefault()}),this.setPos(e.x||0,e.y||0),this.setFillColor(e.fillColor),this.setBorderColor(e.borderColor)}return D(g,[{key:"setPos",value:function(t,e){this._x=t,this._y=e;var r=this._dot.style;r.left=Math.round(t)-7+"px",r.top=Math.round(e)-7+"px";var o=this._dotClickable.style;o.left=Math.round(t)-9+"px",o.top=Math.round(e)-9+"px"}},{key:"setFillColor",value:function(t){this._dot.style.background=t||"lightgreen"}},{key:"setBorderColor",value:function(t){this._dot.style.border="solid 2px"+(t||"black")}},{key:"setOpacity",value:function(t){this._dot.style.opacity=t}},{key:"setVisible",value:function(t){this._visible!==t&&(this._visible=!!t,this._dot.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setCulled",value:function(t){this._culled!==t&&(this._culled=!!t,this._dot.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setClickable",value:function(t){this._dotClickable.style["pointer-events"]=t?"all":"none"}},{key:"setHighlighted",value:function(t){this._highlighted!==t&&(this._highlighted=!!t,this._highlighted?this._dot.classList.add(this._highlightClass):this._dot.classList.remove(this._highlightClass))}},{key:"destroy",value:function(){this.setVisible(!1),this._dot.parentElement&&this._dot.parentElement.removeChild(this._dot),this._dotClickable.parentElement&&this._dotClickable.parentElement.removeChild(this._dotClickable)}}])}(),Mi=function(){function g(i){var t=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};F(this,g),this._highlightClass="viewer-ruler-label-highlighted",this._prefix=e.prefix||"",this._x=0,this._y=0,this._visible=!0,this._culled=!1,this._label=document.createElement("div"),this._label.className+=this._label.className?" viewer-ruler-label":"viewer-ruler-label";var r=this._label,o=r.style;o["border-radius"]="5px",o.color="white",o.padding="4px",o.border="solid 1px",o.borderRadius="20px",o.background="lightgreen",o.position="absolute",o["z-index"]=e.zIndex===void 0?"5000005":e.zIndex,o.width="auto",o.height="auto",o.fontSize="14px",o.display="block",o.top="0px",o.left="0px",o["pointer-events"]="all",o.opacity=1,e.onContextMenu,r.innerText="",i.appendChild(r),this.setPos(e.x||0,e.y||0),this.setFillColor(e.fillColor),this.setBorderColor(e.fillColor),this.setText(e.text),e.onMouseOver&&r.addEventListener("mouseover",function(n){e.onMouseOver(n,t),n.preventDefault()}),e.onMouseLeave&&r.addEventListener("mouseleave",function(n){e.onMouseLeave(n,t),n.preventDefault()}),e.onMouseWheel&&r.addEventListener("wheel",function(n){e.onMouseWheel(n,t)}),e.onMouseDown&&r.addEventListener("mousedown",function(n){e.onMouseDown(n,t)}),e.onMouseClick&&r.addEventListener("click",function(n){e.onMouseClick(n,t)}),e.onTouchStart&&r.addEventListener("touchstart",function(n){e.onTouchStart(n,t)}),e.onMouseUp&&r.addEventListener("mouseup",function(n){e.onMouseUp(n,t)}),e.onMouseMove&&r.addEventListener("mousemove",function(n){e.onMouseMove(n,t)}),e.onContextMenu&&r.addEventListener("contextmenu",function(n){e.onContextMenu(n,t),n.preventDefault()})}return D(g,[{key:"setPos",value:function(t,e){this._x=t,this._y=e;var r=this._label.style;r.left=Math.round(t)-20+"px",r.top=Math.round(e)-12+"px"}},{key:"setPosOnWire",value:function(t,e,r,o){var n=t+(r-t)*.5,y=e+(o-e)*.5,E=this._label.style;E.left=Math.round(n)-20+"px",E.top=Math.round(y)-12+"px"}},{key:"setPosBetweenWires",value:function(t,e,r,o,n,y){var E=(t+r+n)/3,P=(e+o+y)/3,z=this._label.style;z.left=Math.round(E)-20+"px",z.top=Math.round(P)-12+"px"}},{key:"setText",value:function(t){this._label.innerHTML=this._prefix+(t||"")}},{key:"setFillColor",value:function(t){this._fillColor=t||"lightgreen",this._label.style.background=this._fillColor}},{key:"setBorderColor",value:function(t){this._borderColor=t||"white",this._label.style.border="solid 1px "+this._borderColor}},{key:"setOpacity",value:function(t){this._label.style.opacity=t}},{key:"setVisible",value:function(t){this._visible!==t&&(this._visible=!!t,this._label.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setCulled",value:function(t){this._culled!==t&&(this._culled=!!t,this._label.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setHighlighted",value:function(t){this._highlighted!==t&&(this._highlighted=!!t,this._highlighted?this._label.classList.add(this._highlightClass):this._label.classList.remove(this._highlightClass))}},{key:"setClickable",value:function(t){this._label.style["pointer-events"]=t?"all":"none"}},{key:"destroy",value:function(){this._label.parentElement&&this._label.parentElement.removeChild(this._label)}}])}(),rn=B.vec3(),An=B.vec3(),ls=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(F(this,i),e=R(this,i,[t.viewer.scene,r]),e.plugin=t,e._container=r.container,!e._container)throw"config missing: container";e._color=r.color?r.color:t.defaultColor,e._borderColor=t.defaultColor?t.defaultColor:"white";var o=e.plugin.viewer.scene;e._originMarker=new Mr(o,r.origin),e._cornerMarker=new Mr(o,r.corner),e._targetMarker=new Mr(o,r.target),e._originWorld=B.vec3(),e._cornerWorld=B.vec3(),e._targetWorld=B.vec3(),e._wp=new Float64Array(12),e._vp=new Float64Array(12),e._pp=new Float64Array(12),e._cp=new Int16Array(6);var n=r.onMouseOver?function(Z){r.onMouseOver(Z,e),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseover",Z))}:null,y=r.onMouseLeave?function(Z){r.onMouseLeave(Z,e),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseleave",Z))}:null,E=r.onMouseClick?function(Z){r.onMouseClick(Z,e),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("click",Z))}:null,P=r.onTouchStart?function(Z){r.onTouchStart(Z,e),Z.preventDefault(),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("touchstart",Z))}:null,z=r.onContextMenu?function(Z){r.onContextMenu(Z,e)}:null,Y=function(ye){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",ye))},J=function(ye){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousedown",ye))},ie=function(ye){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseup",ye))},le=function(ye){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousemove",ye))};return e._originDot=new ki(e._container,{fillColor:e._color,borderColor:e._borderColor,zIndex:t.zIndex!==void 0?t.zIndex+2:void 0,onMouseOver:n,onMouseLeave:y,onMouseWheel:Y,onMouseDown:J,onMouseClick:E,onTouchStart:P,onMouseUp:ie,onMouseMove:le,onContextMenu:z}),e._cornerDot=new ki(e._container,{fillColor:e._color,borderColor:e._borderColor,zIndex:t.zIndex!==void 0?t.zIndex+2:void 0,onMouseOver:n,onMouseLeave:y,onMouseWheel:Y,onMouseDown:J,onMouseClick:E,onTouchStart:P,onMouseUp:ie,onMouseMove:le,onContextMenu:z}),e._targetDot=new ki(e._container,{fillColor:e._color,borderColor:e._borderColor,zIndex:t.zIndex!==void 0?t.zIndex+2:void 0,onMouseOver:n,onMouseLeave:y,onMouseWheel:Y,onMouseDown:J,onMouseClick:E,onTouchStart:P,onMouseUp:ie,onMouseMove:le,onContextMenu:z}),e._originWire=new Wr(e._container,{color:e._color||"#0065FC",thickness:1,zIndex:t.zIndex,onMouseOver:n,onMouseLeave:y,onMouseWheel:Y,onMouseDown:J,onMouseClick:E,onTouchStart:P,onMouseUp:ie,onMouseMove:le,onContextMenu:z}),e._targetWire=new Wr(e._container,{color:e._color||"red",thickness:1,zIndex:t.zIndex!==void 0?t.zIndex+1:void 0,onMouseOver:n,onMouseLeave:y,onMouseWheel:Y,onMouseDown:J,onMouseClick:E,onTouchStart:P,onMouseUp:ie,onMouseMove:le,onContextMenu:z}),e._angleLabel=new Mi(e._container,{fillColor:e._color||"#0065FC",borderColor:e._borderColor,prefix:"",text:"",zIndex:t.zIndex!==void 0?t.zIndex+2:void 0,onMouseOver:n,onMouseLeave:y,onMouseWheel:Y,onMouseDown:J,onMouseClick:E,onTouchStart:P,onMouseUp:ie,onMouseMove:le,onContextMenu:z}),e._wpDirty=!1,e._vpDirty=!1,e._cpDirty=!1,e._visible=!1,e._originVisible=!1,e._cornerVisible=!1,e._targetVisible=!1,e._originWireVisible=!1,e._targetWireVisible=!1,e._angleVisible=!1,e._labelsVisible=!1,e._clickable=!1,e._originMarker.on("worldPos",function(Z){e._originWorld.set(Z||[0,0,0]),e._wpDirty=!0,e._needUpdate(0)}),e._cornerMarker.on("worldPos",function(Z){e._cornerWorld.set(Z||[0,0,0]),e._wpDirty=!0,e._needUpdate(0)}),e._targetMarker.on("worldPos",function(Z){e._targetWorld.set(Z||[0,0,0]),e._wpDirty=!0,e._needUpdate(0)}),e._onViewMatrix=o.camera.on("viewMatrix",function(){e._vpDirty=!0,e._needUpdate(0)}),e._onProjMatrix=o.camera.on("projMatrix",function(){e._cpDirty=!0,e._needUpdate()}),e._onCanvasBoundary=o.canvas.on("boundary",function(){e._cpDirty=!0,e._needUpdate(0)}),e._onSectionPlaneUpdated=o.on("sectionPlaneUpdated",function(){e._sectionPlanesDirty=!0,e._needUpdate()}),e.precision=r.precision!==void 0?r.precision:2,e.approximate=r.approximate,e.visible=r.visible,e.originVisible=r.originVisible,e.cornerVisible=r.cornerVisible,e.targetVisible=r.targetVisible,e.originWireVisible=r.originWireVisible,e.targetWireVisible=r.targetWireVisible,e.angleVisible=r.angleVisible,e.labelsVisible=r.labelsVisible,e}return O(i,g),D(i,[{key:"_update",value:function(){if(this._visible){var e=this.plugin.viewer.scene;if(this._wpDirty&&(this._wp[0]=this._originWorld[0],this._wp[1]=this._originWorld[1],this._wp[2]=this._originWorld[2],this._wp[3]=1,this._wp[4]=this._cornerWorld[0],this._wp[5]=this._cornerWorld[1],this._wp[6]=this._cornerWorld[2],this._wp[7]=1,this._wp[8]=this._targetWorld[0],this._wp[9]=this._targetWorld[1],this._wp[10]=this._targetWorld[2],this._wp[11]=1,this._wpDirty=!1,this._vpDirty=!0),this._vpDirty&&(B.transformPositions4(e.camera.viewMatrix,this._wp,this._vp),this._vp[3]=1,this._vp[7]=1,this._vp[11]=1,this._vpDirty=!1,this._cpDirty=!0),this._sectionPlanesDirty){if(this._isSliced(this._wp)){this._angleLabel.setCulled(!0),this._originWire.setCulled(!0),this._targetWire.setCulled(!0),this._originDot.setCulled(!0),this._cornerDot.setCulled(!0),this._targetDot.setCulled(!0);return}else this._angleLabel.setCulled(!1),this._originWire.setCulled(!1),this._targetWire.setCulled(!1),this._originDot.setCulled(!1),this._cornerDot.setCulled(!1),this._targetDot.setCulled(!1);this._sectionPlanesDirty=!0}if(this._cpDirty){var r=-.3,o=this._originMarker.viewPos[2],n=this._cornerMarker.viewPos[2],y=this._targetMarker.viewPos[2];if(o>r||n>r||y>r){this._originDot.setVisible(!1),this._cornerDot.setVisible(!1),this._targetDot.setVisible(!1),this._originWire.setVisible(!1),this._targetWire.setVisible(!1),this._angleLabel.setCulled(!0);return}B.transformPositions4(e.camera.project.matrix,this._vp,this._pp);for(var E=this._pp,P=this._cp,z=e.canvas.canvas,Y=z.getBoundingClientRect(),J=this._container.getBoundingClientRect(),ie=Y.top-J.top,le=Y.left-J.left,Z=e.canvas.boundary,ye=Z[2],we=Z[3],Be=0,xe=0,Se=E.length;xe<Se;xe+=4)P[Be]=le+Math.floor((1+E[xe+0]/E[xe+3])*ye/2),P[Be+1]=ie+Math.floor((1-E[xe+1]/E[xe+3])*we/2),Be+=2;this._originDot.setPos(P[0],P[1]),this._cornerDot.setPos(P[2],P[3]),this._targetDot.setPos(P[4],P[5]),this._originWire.setStartAndEnd(P[0],P[1],P[2],P[3]),this._targetWire.setStartAndEnd(P[2],P[3],P[4],P[5]),this._angleLabel.setPosBetweenWires(P[0],P[1],P[2],P[3],P[4],P[5]),B.subVec3(this._originWorld,this._cornerWorld,rn),B.subVec3(this._targetWorld,this._cornerWorld,An);var Te=(rn[0]!==0||rn[1]!==0||rn[2]!==0)&&(An[0]!==0||An[1]!==0||An[2]!==0);if(Te){var Me=this._approximate?" ":" = ";B.normalizeVec3(rn),B.normalizeVec3(An);var Fe=Math.abs(B.angleVec3(rn,An));this._angle=Fe/B.DEGTORAD,this._angleLabel.setText(Me+this._angle.toFixed(this._precision)+"°")}else this._angleLabel.setText("");this._originDot.setVisible(this._visible&&this._originVisible),this._cornerDot.setVisible(this._visible&&this._cornerVisible),this._targetDot.setVisible(this._visible&&this._targetVisible),this._originWire.setVisible(this._visible&&this._originWireVisible),this._targetWire.setVisible(this._visible&&this._targetWireVisible),this._angleLabel.setCulled(!(this._visible&&this._angleVisible&&this.labelsVisible)),this._cpDirty=!1}}}},{key:"_isSliced",value:function(e){for(var r=this.scene._sectionPlanesState.sectionPlanes,o=0,n=r.length;o<n;o++){var y=r[o];if(B.planeClipsPositions3(y.pos,y.dir,e,4))return!0}return!1}},{key:"approximate",get:function(){return this._approximate},set:function(e){e=e!==!1,this._approximate!==e&&(this._approximate=e,this._cpDirty=!0,this._needUpdate(0))}},{key:"precision",get:function(){return this._precision},set:function(e){this._precision!==e&&(this._precision=e,this._cpDirty=!0,this._needUpdate(0))}},{key:"origin",get:function(){return this._originMarker}},{key:"corner",get:function(){return this._cornerMarker}},{key:"target",get:function(){return this._targetMarker}},{key:"angle",get:function(){return this._update(),this._angle}},{key:"color",get:function(){return this._color},set:function(e){this._originDot.setFillColor(e),this._cornerDot.setFillColor(e),this._targetDot.setFillColor(e),this._originWire.setColor(e||"blue"),this._targetWire.setColor(e||"red"),this._angleLabel.setFillColor(e||"#0065FC"),this._color=e}},{key:"visible",get:function(){return this._visible},set:function(e){e=e!==!1,this._visible=e,this._originDot.setVisible(this._visible&&this._originVisible),this._cornerDot.setVisible(this._visible&&this._cornerVisible),this._targetDot.setVisible(this._visible&&this._targetVisible),this._originWire.setVisible(this._visible&&this._originWireVisible),this._targetWire.setVisible(this._visible&&this._targetWireVisible),this._angleLabel.setVisible(this._visible&&this._angleVisible),this._cpDirty=!0,this._needUpdate()}},{key:"originVisible",get:function(){return this._originVisible},set:function(e){e=e!==!1,this._originVisible=e,this._originDot.setVisible(this._visible&&this._originVisible),this._cpDirty=!0,this._needUpdate()}},{key:"cornerVisible",get:function(){return this._cornerVisible},set:function(e){e=e!==!1,this._cornerVisible=e,this._cornerDot.setVisible(this._visible&&this._cornerVisible),this._cpDirty=!0,this._needUpdate()}},{key:"targetVisible",get:function(){return this._targetVisible},set:function(e){e=e!==!1,this._targetVisible=e,this._targetDot.setVisible(this._visible&&this._targetVisible),this._cpDirty=!0,this._needUpdate()}},{key:"originWireVisible",get:function(){return this._originWireVisible},set:function(e){e=e!==!1,this._originWireVisible=e,this._originWire.setVisible(this._visible&&this._originWireVisible),this._cpDirty=!0,this._needUpdate()}},{key:"targetWireVisible",get:function(){return this._targetWireVisible},set:function(e){e=e!==!1,this._targetWireVisible=e,this._targetWire.setVisible(this._visible&&this._targetWireVisible),this._cpDirty=!0,this._needUpdate()}},{key:"angleVisible",get:function(){return this._angleVisible},set:function(e){e=e!==!1,this._angleVisible=e,this._angleLabel.setVisible(this._visible&&this._angleVisible),this._cpDirty=!0,this._needUpdate()}},{key:"labelsVisible",get:function(){return this._labelsVisible},set:function(e){e=e!==void 0?!!e:this.plugin.defaultLabelsVisible,this._labelsVisible=e;var r=this._visible&&this._labelsVisible;this._angleLabel.setVisible(r),this._cpDirty=!0,this._needUpdate()}},{key:"setHighlighted",value:function(e){this._originDot.setHighlighted(e),this._cornerDot.setHighlighted(e),this._targetDot.setHighlighted(e),this._originWire.setHighlighted(e),this._targetWire.setHighlighted(e),this._angleLabel.setHighlighted(e)}},{key:"clickable",get:function(){return this._clickable},set:function(e){e=!!e,this._clickable=e,this._originDot.setClickable(this._clickable),this._cornerDot.setClickable(this._clickable),this._targetDot.setClickable(this._clickable),this._originWire.setClickable(this._clickable),this._targetWire.setClickable(this._clickable),this._angleLabel.setClickable(this._clickable)}},{key:"destroy",value:function(){var e=this.plugin.viewer.scene;this._onViewMatrix&&e.camera.off(this._onViewMatrix),this._onProjMatrix&&e.camera.off(this._onProjMatrix),this._onCanvasBoundary&&e.canvas.off(this._onCanvasBoundary),this._onSectionPlaneUpdated&&e.off(this._onSectionPlaneUpdated),this._originDot.destroy(),this._cornerDot.destroy(),this._targetDot.destroy(),this._originWire.destroy(),this._targetWire.destroy(),this._angleLabel.destroy(),H(i,"destroy",this)([])}}])}($e),cs=function(g){function i(){return F(this,i),R(this,i,arguments)}return O(i,g),D(i,[{key:"active",get:function(){},set:function(e){}},{key:"snapping",get:function(){return!0},set:function(e){}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){}},{key:"reset",value:function(){}},{key:"destroy",value:function(){}}])}($e),Xi=0,ts=1,gi=2,mi=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F(this,i),e=R(this,i,[t.viewer.scene]),e.cfg=r,e._canvasToPagePos=r.canvasToPagePos,e.pointerLens=r.pointerLens,e._active=!1,e._activate=!1,e._mouseState=Xi,e._currentAngleMeasurement=null,e._initMarkerDiv(),e._onInputMouseDown=null,e._onInputMouseUp=null,e._snapping=!!r.snapping,e._mouseState=Xi,e._attachPlugin(t,r),e._offsetX=r._offsetX|0,e._offsetY=r._offsetY|0,e}return O(i,g),D(i,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myAnglePivotMarker");var r=this.scene.canvas.canvas;r.parentNode.insertBefore(e,r),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex="100",e.style.position="absolute",e.style.pointerEvents="none",this.markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this.markerDiv&&(this.markerDiv.parentNode.removeChild(this.markerDiv),this.markerDiv=null)}},{key:"_attachPlugin",value:function(e){this.angleMeasurementsPlugin=e,this.plugin=e}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){this._snapping=e}},{key:"mouseState",get:function(){return this._mouseState},set:function(e){this._mouseState=e}},{key:"activate",value:function(){var e=this;if(!this._activate){this.markerDiv||this._initMarkerDiv();var r=this.angleMeasurementsPlugin,o=!1;r.on("mouseOver",function(xe){o=!0}),r.on("mouseLeave",function(xe){o=!1}),r.on("measureDelete",function(xe){o=!1});var n=this.scene,y=n.canvas.canvas,E=20,P=r.viewer.cameraControl,z=this.pointerLens,Y=!1,J=null,ie=0,le=0,Z=B.vec3(),ye=B.vec2();this._currentAngleMeasurement=null;var we=function(Se){if(e._active&&!o){Se.snappedToVertex||Se.snappedToEdge?(z&&(z.visible=!0,z.canvasPos=Se.canvasPos,z.snappedCanvasPos=Se.snappedCanvasPos||Se.canvasPos,z.snapped=!0),e.markerDiv.style.background="greenyellow",e.markerDiv.style.border="2px solid green"):(z&&(z.visible=!0,z.canvasPos=Se.canvasPos,z.snappedCanvasPos=Se.canvasPos,z.snapped=!1),e.markerDiv.style.background="pink",e.markerDiv.style.border="2px solid red");var Te=Se.snappedCanvasPos||Se.canvasPos;switch(Y=!0,J=Se.entity,Z.set(Se.worldPos),ye.set(Te),y.style.cursor="pointer",e._mouseState){case Xi:var Me=document.documentElement.scrollLeft,Fe=document.documentElement.scrollTop,Re=Me,He=Fe;e.markerDiv.style.marginLeft="".concat(e._offsetX+Re+Te[0]-5,"px"),e.markerDiv.style.marginTop="".concat(e._offsetY+He+Te[1]-5,"px");break;case ts:e._currentAngleMeasurement&&(e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.angleVisible=!1,e._currentAngleMeasurement.corner.worldPos=Se.worldPos,e._currentAngleMeasurement.corner.entity=Se.entity),e.markerDiv.style.marginLeft="-10000px",e.markerDiv.style.marginTop="-10000px",y.style.cursor="pointer";break;case gi:e._currentAngleMeasurement&&(e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.target.worldPos=Se.worldPos,e._currentAngleMeasurement.target.entity=Se.entity),e.markerDiv.style.marginLeft="-10000px",e.markerDiv.style.marginTop="-10000px",y.style.cursor="pointer";break}}};this._onHoverSnapOrSurface=P.on("hoverSnapOrSurface",function(xe){e._snapping&&we(xe)}),this._onHoverSurface=P.on("hoverSurface",function(xe){e._snapping||we(xe)}),y.addEventListener("mousedown",this._onMouseDown=function(xe){e._active&&xe.which===1&&(ie=xe.clientX,le=xe.clientY)}),y.addEventListener("mouseup",this._onMouseUp=function(xe){if(e._active&&!o&&xe.which===1&&!(xe.clientX>ie+E||xe.clientX<ie-E||xe.clientY>le+E||xe.clientY<le-E))switch(e._mouseState){case Xi:Y&&(e._currentAngleMeasurement=r.createMeasurement({id:B.createUUID(),origin:{worldPos:Z,entity:J},corner:{worldPos:Z,entity:J},target:{worldPos:Z,entity:J},precision:r.precision,approximate:!0}),e._currentAngleMeasurement.clickable=!1,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.angleVisible=!1,e._currentAngleMeasurement.origin.entity=J,e._mouseState=ts,r.fire("measurementStart",e._currentAngleMeasurement));break;case ts:Y?(e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.corner.entity=J,e._mouseState=gi):e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null,J=null,e._mouseState=Xi,r.fire("measurementCancel",e._currentAngleMeasurement));break;case gi:Y?(e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.target.entity=J,e._currentAngleMeasurement.clickable=!0,J=null,r.fire("measurementEnd",e._currentAngleMeasurement),e._currentAngleMeasurement=null,e._mouseState=Xi):e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null,J=null,e._mouseState=Xi,r.fire("measurementCancel",e._currentAngleMeasurement));break}}),this.markerHidden=function(xe){e.markerDiv&&xe.target!==y&&(e.markerDiv.style.marginLeft="-100px",e.markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden);var Be=function(Se){if(e._active&&!o){if(Y=!1,z&&(z.visible=!0,z.pointerPos=Se.canvasPos,z.snappedCanvasPos=Se.snappedCanvasPos||Se.canvasPos,z.snapped=!1),e.markerDiv.style.marginLeft="-100px",e.markerDiv.style.marginTop="-100px",e._currentAngleMeasurement){switch(e._mouseState){case Xi:e._currentAngleMeasurement.originVisible=!1;break;case ts:e._currentAngleMeasurement.cornerVisible=!1,e._currentAngleMeasurement.originWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1;break;case gi:e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1;break}y.style.cursor="default"}y.style.cursor="default"}};this._onHoverSnapOrSurfaceOff=P.on("hoverSnapOrSurfaceOff",function(xe){e._snapping&&Be(xe)}),this._onHoverOff=P.on("hoverOff",function(xe){e._snapping||Be(xe)}),this._activate=!0}}},{key:"deactivate",value:function(){if(this._active){this.pointerLens&&(this.pointerLens.visible=!1),this.reset();var e=this.scene.canvas.canvas;e.removeEventListener("mousedown",this._onMouseDown),e.removeEventListener("mouseup",this._onMouseUp);var r=this.angleMeasurementsPlugin.viewer.cameraControl;r.off(this._onHoverSnapOrSurface),r.off(this._onHoverSurface),r.off(this._onHoverSnapOrSurfaceOff),r.off(this._onHoverOff),document.removeEventListener("mousemove",this.markerHidden),this._currentAngleMeasurement=null,this._active=!1}}},{key:"reset",value:function(){this._active&&(this._currentAngleMeasurement&&(this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement),this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null),this._mouseState=Xi)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),H(i,"destroy",this)([])}}])}(cs),Zi=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F(this,i),e=R(this,i,["AngleMeasurements",t]),e._container=r.container||t.viewerElement||document.body,e._defaultControl=null,e._measurements={},e.defaultColor=r.defaultColor!==void 0?r.defaultColor:"#0065fc",e.defaultLabelsVisible=r.defaultLabelsVisible!==!1,e.zIndex=r.zIndex||1e4,e.precision=r.precision!==void 0?r.precision:2,e._onMouseOver=function(o,n){e.fire("mouseOver",{plugin:e,angleMeasurement:n,measurement:n,event:o})},e._onMouseLeave=function(o,n){e.fire("mouseLeave",{plugin:e,angleMeasurement:n,measurement:n,event:o})},e._onMouseClick=function(o,n){e.fire("clickMeasure",{plugin:e,angleMeasurement:n,measurement:n,event:o})},e._onTouchStart=function(o,n){e.fire("touchMeasure",{plugin:e,angleMeasurement:n,measurement:n,event:o})},e._onContextMenu=function(o,n){e.fire("contextMenu",{plugin:e,angleMeasurement:n,measurement:n,event:o})},e}return O(i,g),D(i,[{key:"precision",get:function(){return this._precision},set:function(e){if(this._precision!=e&&(this._precision=e,this.measureNum>0))for(var r in this.measurements)this.measurements[r].precision=e}},{key:"measureNum",get:function(){return Object.keys(this.measurements).length}},{key:"getContainerElement",value:function(){return this._container}},{key:"send",value:function(e,r){}},{key:"control",get:function(){return this._defaultControl||(this._defaultControl=new mi(this,{})),this._defaultControl}},{key:"measurements",get:function(){return this._measurements}},{key:"createMeasurement",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.viewer.scene.components[r.id]&&(this.error("Viewer scene component with this ID already exists: "+r.id),delete r.id);var o=r.origin,n=r.corner,y=r.target,E=new ls(this,{id:r.id,plugin:this,container:this._container,origin:{entity:o.entity,worldPos:o.worldPos},corner:{entity:n.entity,worldPos:n.worldPos},target:{entity:y.entity,worldPos:y.worldPos},borderColor:r.borderColor,color:r.color,visible:r.visible,originVisible:!0,originWireVisible:!0,cornerVisible:!0,targetWireVisible:!0,targetVisible:!0,onMouseOver:this._onMouseOver,onMouseLeave:this._onMouseLeave,onMouseClick:this._onMouseClick,onTouchStart:this._onTouchStart,onContextMenu:this._onContextMenu,precision:this._precision});return this._measurements[E.id]=E,E.on("destroyed",function(){delete e._measurements[E.id]}),E.clickable=!0,this.fire("measurementCreated",E),E}},{key:"destroyMeasurement",value:function(e){var r=this._measurements[e];if(!r){this.log("AngleMeasurement not found: "+e);return}r.destroy(),this.fire("measurementDestroyed",r)}},{key:"setLabelsShown",value:function(e){for(var r=0,o=Object.entries(this.measurements);r<o.length;r++){var n=_(o[r],2);n[0];var y=n[1];y.labelShown=e}}},{key:"setMeasurementsShown",value:function(e){for(var r in this.measurements)this.measurements[r].visible=e}},{key:"clear",value:function(){for(var e=Object.keys(this._measurements),r=0,o=e.length;r<o;r++)this.destroyMeasurement(e[r])}},{key:"destroy",value:function(){this.clear(),H(i,"destroy",this)([])}}])}(Ye),xi=function(){function g(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};F(this,g),this.viewer=i,this.scene=this.viewer.scene,this._circleDiv=document.createElement("div"),this._circleDiv.id=t.id,this.viewer.scene.canvas.canvas.parentNode.insertBefore(this._circleDiv,this.viewer.scene.canvas.canvas),this._circleDiv.style.backgroundColor="transparent",this._circleDiv.style.border="2px solid green",this._circleDiv.style.borderRadius="50px",this._circleDiv.style.width="50px",this._circleDiv.style.height="50px",this._circleDiv.style.margin="-200px -200px",this._circleDiv.style.zIndex="100000",this._circleDiv.style.position="absolute",this._circleDiv.style.pointerEvents="none",this._circlePos=null,this._circleMaxRadius=200,this._circleMinRadius=2,this._active=t.active!==!1,this._visible=!1,this._running=!1,this._destroyed=!1}return D(g,[{key:"start",value:function(t){var e=this;if(!this._destroyed){this._circlePos=t,this._running=!1,this._circleRadius=this._circleMaxRadius,this._circleDiv.style.borderRadius="".concat(this._circleRadius,"px"),this._circleDiv.style.marginLeft="".concat(this._circlePos[0]-this._circleRadius,"px"),this._circleDiv.style.marginTop="".concat(this._circlePos[1]-this._circleRadius,"px");var r=this._circleMaxRadius,o=2,n,y=300,E=function(z){if(e._running){n||(n=z);var Y=z-n,J=Math.min(Y/y,1),ie=r+(o-r)*J;e._circleRadius=ie,e._circleDiv.style.width="".concat(e._circleRadius,"px"),e._circleDiv.style.height="".concat(e._circleRadius,"px"),e._circleDiv.style.marginLeft="".concat(e._circlePos[0]-e._circleRadius/2,"px"),e._circleDiv.style.marginTop="".concat(e._circlePos[1]-e._circleRadius/2,"px"),J<1&&requestAnimationFrame(E)}};this._running=!0,requestAnimationFrame(E),this._circleDiv.style.visibility="visible"}}},{key:"stop",value:function(){this._destroyed||(this._running=!1,this._circleRadius=this._circleMaxRadius,this._circleDiv.style.borderRadius="".concat(this._circleRadius,"px"),this._circleDiv.style.visibility="hidden")}},{key:"durationMs",get:function(){return this._durationMs},set:function(t){this.stop(),this._durationMs=t}},{key:"destroy",value:function(){this._destroyed||(this.stop(),this._circleDiv&&this._circleDiv.parentNode.removeChild(this._circleDiv),this._destroyed=!0)}}])}(),rs=0,is=1,_s=2,Fs=3,Va=4,ca=5,yo=6,bo=7,wl=8,Ua=7,Ru=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F(this,i),e=R(this,i,[t.viewer.scene]),e.pointerLens=r.pointerLens,e.pointerCircle=new xi(t.viewer,{id:"angleMeasure_Circle"}),e._active=!1,e._activate=!1,e._initMarkerDiv(),e._currentAngleMeasurement=null,e._onCanvasTouchStart=null,e._onCanvasTouchEnd=null,e._longTouchTimeoutMs=300,e._snapping=r.snapping!==!1,e._snapToEdge=r.snapping!==!1,e._snapToVertex=r.snapping!==!1,e._touchState=rs,e._attachPlugin(t,r),e._offsetX=r._offsetX|0,e._offsetY=r._offsetY|0,e}return O(i,g),D(i,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myAngleMeasureTouchMarker");var r=this.scene.canvas.canvas;r.parentNode.insertBefore(e,r),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex="100",e.style.position="absolute",e.style.pointerEvents="none",this.markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this.markerDiv&&(this.markerDiv.parentNode.removeChild(this.markerDiv),this.markerDiv=null)}},{key:"_attachPlugin",value:function(e){this.angleMeasurementsPlugin=e,this.plugin=e}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){e!==this._snapping?(this._snapping=e,this.deactivate(),this.activate()):this._snapping=e}},{key:"touchState",get:function(){return this._touchState},set:function(e){this._touchState=e}},{key:"activate",value:function(){var e=this;if(!this._activate){var r=this.plugin,o=this.scene,n=o.canvas.canvas;r.pointerLens;var y=B.vec3(),E=20,P=null;this._touchState=rs;var z=B.vec2(),Y=B.vec2(),J=B.vec2(),ie=null,le=function(){e.plugin.viewer.cameraControl.active=!1},Z=function(){e.plugin.viewer.cameraControl.active=!0},ye=function(){P&&(clearTimeout(P),P=null),e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),Z(),e._touchState=rs};n.addEventListener("touchstart",this._onCanvasTouchStart=function(we){if(e._active&&we.isTrusted){var Be=we.touches.length;if(Be!==1){P&&(clearTimeout(P),P=null);return}var xe=we.touches[0],Se=xe.clientX,Te=xe.clientY;switch(z.set([Se+e.offsetX,Te+e.offsetY]),Y.set([Se+e.offsetX,Te+e.offsetY]),e._touchState){case rs:if(Be!==1&&P!==null){ye();return}var Me=o.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping});if(Me&&Me.snapped)y.set(Me.worldPos),e.pointerCircle.start(Me.snappedCanvasPos);else{var Fe=o.pick({canvasPos:Y,pickSurface:!0});if(Fe&&Fe.worldPos)y.set(Fe.worldPos),e.pointerCircle.start(Fe.canvasPos);else return}P=setTimeout(function(){Be!==1||Y[0]>z[0]+E||Y[0]<z[0]-E||Y[1]>z[1]+E||Y[1]<z[1]-E||(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=z,e.pointerLens.cursorPos=z),e.pointerLens&&(e.pointerLens.canvasPos=Y,e.pointerLens.snapped=!1),e.pointerLens&&(e.pointerLens.cursorPos=Me.canvasPos,e.pointerLens.snapped=!0),e._currentAngleMeasurement?e._currentAngleMeasurement.origin.worldPos=y:(e._currentAngleMeasurement=r.createMeasurement({id:B.createUUID(),origin:{worldPos:Me.worldPos,entity:Me.entity},corner:{worldPos:Me.worldPos,entity:Me.entity},target:{worldPos:Me.worldPos,entity:Me.entity},precision:r.precision}),e._currentAngleMeasurement.clickable=!1,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!1,e._currentAngleMeasurement.cornerVisible=!1,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1),r.fire("measurementStart",e._currentAngleMeasurement),e._touchState=_s,le())},e._longTouchTimeoutMs),e._touchState=is,ie=xe.identifier;break;case Fs:if(Be!==1&&P!==null){clearTimeout(P),P=null;return}Be===1&&(P=setTimeout(function(){if(P=null,!(Be!==1||Y[0]>z[0]+E||Y[0]<z[0]-E||Y[1]>z[1]+E||Y[1]<z[1]-E)){e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=z,e.pointerLens.snapped=!1);var Re=o.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping});if(Re&&Re.snapped)e.pointerLens&&(e.pointerLens.cursorPos=Re.snappedCanvasPos,e.pointerLens.snapped=!0),e.pointerCircle.start(Re.snappedCanvasPos),y.set(Re.worldPos),e._currentAngleMeasurement.corner.worldPos=Re.worldPos,e._currentAngleMeasurement.corner.entity=Re.entity,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1,e.angleMeasurementsPlugin.fire("measurementStart",e._currentAngleMeasurement);else{var He=o.pick({canvasPos:Y,pickSurface:!0});He&&He.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=He.canvasPos,e.pointerLens.snapped=!1),e.pointerCircle.start(He.canvasPos),y.set(He.worldPos),e._currentAngleMeasurement.corner.worldPos=He.worldPos,e._currentAngleMeasurement.corner.entity=He.entity,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1,e.angleMeasurementsPlugin.fire("measurementStart",e._currentAngleMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)}e._touchState=ca,le()}},e._longTouchTimeoutMs),e._touchState=Va),ie=xe.identifier;break;case yo:if(Be!==1&&P!==null){clearTimeout(P),P=null;return}Be===1&&(P=setTimeout(function(){if(P=null,!(Be!==1||Y[0]>z[0]+E||Y[0]<z[0]-E||Y[1]>z[1]+E||Y[1]<z[1]-E)){e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=z,e.pointerLens.snapped=!1);var Re=o.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping});if(Re&&Re.snapped)e.pointerLens&&(e.pointerLens.cursorPos=Re.snappedCanvasPos,e.pointerLens.snapped=!0),e.pointerCircle.start(Re.snappedCanvasPos),y.set(Re.worldPos),e._currentAngleMeasurement.target.worldPos=Re.worldPos,e._currentAngleMeasurement.target.entity=Re.entity,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e.angleMeasurementsPlugin.fire("measurementStart",e._currentAngleMeasurement);else{var He=o.pick({canvasPos:Y,pickSurface:!0});He&&He.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=He.canvasPos,e.pointerLens.snapped=!1),e.pointerCircle.start(He.canvasPos),y.set(He.worldPos),e._currentAngleMeasurement.target.worldPos=He.worldPos,e._currentAngleMeasurement.target.entity=He.entity,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.angleVisible=!0,r.fire("measurementStart",e._currentAngleMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)}e._touchState=wl,le()}},e._longTouchTimeoutMs),e._touchState=bo),ie=xe.identifier;break;default:P!==null&&(clearTimeout(P),P=null),e._touchState=Ua;return}}},{passive:!0}),n.addEventListener("touchmove",function(we){if(e._active){e.pointerCircle.stop();var Be=we.touches.length;if(Be!==1||we.changedTouches.length!==1){P&&(clearTimeout(P),P=null);return}var xe=we.touches[0],Se=xe.clientX,Te=xe.clientY;if(xe.identifier===ie){Y.set([Se+e.offsetX,Te+e.offsetY]);var Me,Fe;switch(e._touchState){case _s:e.pointerLens&&(e.pointerLens.canvasPos=Y),Me=o.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping}),Me&&Me.snapped?(e.pointerLens&&(e.pointerLens.snappedCanvasPos=Me.snappedCanvasPos,e.pointerLens.snapped=!0),y.set(Me.worldPos),e._currentAngleMeasurement.origin.worldPos=Me.worldPos):(Fe=o.pick({canvasPos:Y,pickSurface:!0}),Fe&&Fe.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=Fe.canvasPos,e.pointerLens.snapped=!1),y.set(Fe.worldPos),e._currentAngleMeasurement.origin.worldPos=Fe.worldPos):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)),e._touchState=_s;break;case ca:if(Be!==1&&P!==null){clearTimeout(P),P=null,e.pointerLens&&(e.pointerLens.visible=!1),e._touchState=Ua;return}e.pointerLens&&(e.pointerLens.canvasPos=Y),Me=o.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping}),Me&&Me.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=Me.snappedCanvasPos,e.pointerLens.snapped=!0),e._currentAngleMeasurement.corner.worldPos=Me.worldPos,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1):(Fe=o.pick({canvasPos:Y,pickSurface:!0}),Fe&&Fe.worldPos&&(e.pointerLens&&(e.pointerLens.cursorPos=Fe.canvasPos,e.pointerLens.snapped=!1),e._currentAngleMeasurement.corner.worldPos=Fe.worldPos,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1)),e._touchState=ca;break;case wl:if(Be!==1&&P!==null){clearTimeout(P),P=null,e.pointerLens&&(e.pointerLens.visible=!1),e._touchState=Ua;return}e.pointerLens&&(e.pointerLens.canvasPos=Y),Me=o.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping}),Me&&Me.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=Me.snappedCanvasPos,e.pointerLens.snapped=!0),e._currentAngleMeasurement.target.worldPos=Me.worldPos,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.angleVisible=!0):(Fe=o.pick({canvasPos:Y,pickSurface:!0}),Fe&&Fe.worldPos&&(e.pointerLens&&(e.pointerLens.cursorPos=Fe.canvasPos,e.pointerLens.snapped=!1),e._currentAngleMeasurement.target.worldPos=Fe.worldPos,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.angleVisible=!0)),e._touchState=wl;break}}}},{passive:!0}),n.addEventListener("touchend",this._onCanvasTouchEnd=function(we){if(e._active){e.pointerCircle.stop();var Be=we.changedTouches.length;if(Be===1){var xe=we.changedTouches[0],Se=xe.clientX,Te=xe.clientY;if(xe.identifier===ie)switch(P&&(clearTimeout(P),P=null),J.set([Se,Te]),e._touchState){case is:{if(Be!==1||Se>z[0]+E||Se<z[0]-E||Te>z[1]+E||Te<z[1]-E){e._touchState=rs;return}var Me=o.pick({canvasPos:Y,pickSurface:!0});Me&&Me.worldPos?(e._currentAngleMeasurement=r.createMeasurement({id:B.createUUID(),origin:{worldPos:Me.worldPos},corner:{worldPos:Me.worldPos},target:{worldPos:Me.worldPos},precision:r.precision}),e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!1,e._currentAngleMeasurement.cornerVisible=!1,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1,e._touchState=Fs):(e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=rs)}Z();break;case _s:e.pointerLens&&(e.pointerLens.visible=!1),e._currentAngleMeasurement?e._touchState=Fs:(e.pointerLens&&(e.pointerLens.snapped=!1,e.pointerLens.visible=!1),e._touchState=rs),Z();break;case Va:{if(Be!==1||Se>z[0]+E||Se<z[0]-E||Te>z[1]+E||Te<z[1]-E){e._touchState=Fs;return}var Fe=o.pick({canvasPos:Y,pickSurface:!0});Fe&&Fe.worldPos?(e._currentAngleMeasurement.corner.worldPos=Fe.worldPos,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1,e._touchState=yo):(e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=rs)}Z();break;case ca:e.pointerLens&&(e.pointerLens.visible=!1),e._touchState=yo,Z();break;case bo:{if(Be!==1||Se>z[0]+E||Se<z[0]-E||Te>z[1]+E||Te<z[1]-E){e._touchState=yo;return}var Re=o.pick({canvasPos:Y,pickSurface:!0});Re&&Re.worldPos?(e._currentAngleMeasurement.target.worldPos=Re.worldPos,e._currentAngleMeasurement.originVisible=!0,e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.cornerWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.clickable=!0,e.angleMeasurementsPlugin.fire("measurementEnd",e._currentAngleMeasurement),e._currentAngleMeasurement=null):e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=rs}Z();break;case wl:e.pointerLens&&(e.pointerLens.visible=!1),!e._currentAngleMeasurement||!e._currentAngleMeasurement.targetVisible?(e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=rs):(e._currentAngleMeasurement.clickable=!0,e.angleMeasurementsPlugin.fire("measurementEnd",e._currentAngleMeasurement),e._currentAngleMeasurement=null,e._touchState=rs),Z();break}}}},{passive:!0}),n.addEventListener("touchcancel",this._onCanvasTouchEnd),this._activate=!0}}},{key:"deactivate",value:function(){if(this._active){this.plugin.pointerLens&&(this.plugin.pointerLens.visible=!1),this.reset();var e=this.plugin.viewer.scene.canvas.canvas;e.removeEventListener("touchstart",this._onCanvasTouchStart),e.removeEventListener("touchend",this._onCanvasTouchEnd),e.removeEventListener("touchcancel",this._onCanvasTouchEnd),this._currentAngleMeasurement&&(this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement),this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null),this._active=!1,this.plugin.viewer.cameraControl.active=!0}}},{key:"reset",value:function(){this._active&&this._currentAngleMeasurement&&(this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement),this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),this.pointerCircle&&this.pointerCircle.destroy(),H(i,"destroy",this)([])}}])}(cs),Rs=0,ua=1,xl=2,wc=function(g){function i(t){var e,r,o,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F(this,i),o=R(this,i,[t.viewer.scene]),o.cfg=n,o.snapRadius=n.snapRadius,o._active=!1,o._mouseState=Rs,o._currentAngleMeasurement=null,o.angleMeasurementsPlugin=t,o.plugin=t,o._initMarkerDiv(),o._snapping=n.snapping!==!1,o._offsetX=(e=n._offsetX)!==null&&e!==void 0?e:0,o._offsetY=(r=n._offsetY)!==null&&r!==void 0?r:0,o.hover=!1,o.angleMeasurementsPlugin.on("mouseOver",function(y){o.hover=!0}),o.angleMeasurementsPlugin.on("mouseLeave",function(y){o.hover=!1}),o.angleMeasurementsPlugin.on("measureDelete",function(y){o.hover=!1}),o}return O(i,g),D(i,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myAnglePivotMarker");var r=this.scene.canvas.canvas;r.parentNode.insertBefore(e,r),e.style.background="black",e.style.border="2px solid blue",e.style.borderRadius="10px",e.style.width="5px",e.style.height="5px",e.style.margin="-200px -200px",e.style.zIndex=this.plugin.zIndex?this.plugin.zIndex+3:"1000",e.style.position="absolute",e.style.pointerEvents="none",this._markerDiv=e}},{key:"_destroyMarkerDiv",value:function(){this._markerDiv&&(this._markerDiv.parentNode.removeChild(this._markerDiv),this._markerDiv=null)}},{key:"offsetX",get:function(){return this._offsetX},set:function(e){this._offsetX=e}},{key:"offsetY",get:function(){return this._offsetY},set:function(e){this._offsetY=e}},{key:"active",get:function(){return this._active},set:function(e){this._active=e}},{key:"snapping",get:function(){return this._snapping},set:function(e){this._snapping=e}},{key:"mouseState",get:function(){return this._mouseState},set:function(e){this._mouseState=e}},{key:"activate",value:function(){var e=this;this._markerDiv||this._initMarkerDiv(),this.canvas=this.scene.canvas.canvas,this.clickTolerance=20,this.mouseHovering=!1,this.hoveredEntity=null,this.lastMouseCanvasX=0,this.lastMouseCanvasY=0,this.pointerWorldPos=B.vec3(),this.pointerCanvasPos=B.vec2(),this._currentAngleMeasurement=null,this.markerHidden=function(r){e._markerDiv&&(e._markerDiv.style.marginLeft="-100px",e._markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden)}},{key:"onMousedown",value:function(e){this._active&&(this.hover||(this.mouseHovering?(this.lastMouseCanvasX=e[0],this.lastMouseCanvasY=e[1]):(this.lastMouseCanvasX=null,this.lastMouseCanvasY=null)))}},{key:"onMousemove",value:function(e){var r;if(this._active){this.pointerCanvasPos.set(e);var o=this.scene.pick({canvasPos:this.pointerCanvasPos,snapToVertex:!0,snapToEdge:!0,snapRadius:(r=this.snapRadius)!==null&&r!==void 0?r:20});if(o){this.mouseHovering=!0,this.hoveredEntity=o.entity,this.pointerWorldPos.set(o.worldPos);var n=document.documentElement.scrollLeft,y=document.documentElement.scrollTop,E=n,P=y;if(this._markerDiv.style.marginLeft="".concat(this._offsetX+E+e[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+P+e[1]-5,"px"),this._markerDiv.style.background="pink",this._markerDiv.style.border="2px solid orangered",o.snappedCanvasPos){var z=o.snappedCanvasPos;this._markerDiv.style.marginLeft="".concat(this._offsetX+E+z[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+P+z[1]-5,"px")}switch(o.snappedToVertex&&(this._markerDiv.style.background="greenyellow",this._markerDiv.style.border="2px solid forestgreen"),o.snappedToEdge&&(this._markerDiv.style.background="lightblue",this._markerDiv.style.border="2px solid royalblue"),this._mouseState){case Rs:case ua:this._currentAngleMeasurement&&(this._currentAngleMeasurement.originWireVisible=!0,this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.cornerVisible=!0,this._currentAngleMeasurement.angleVisible=!1,this._currentAngleMeasurement.corner.worldPos=o.worldPos,this._currentAngleMeasurement.corner.entity=o.entity);break;case xl:this._currentAngleMeasurement&&(this._currentAngleMeasurement.targetWireVisible=!0,this._currentAngleMeasurement.targetVisible=!0,this._currentAngleMeasurement.angleVisible=!0,this._currentAngleMeasurement.target.worldPos=o.worldPos,this._currentAngleMeasurement.target.entity=o.entity);break}}else if(this.mouseHovering=!0,this._markerDiv.style.marginLeft="-10000px",this._markerDiv.style.marginTop="-10000px",this._currentAngleMeasurement)switch(this._mouseState){case Rs:this._currentAngleMeasurement.originVisible=!1;break;case ua:this._currentAngleMeasurement.cornerVisible=!1,this._currentAngleMeasurement.originWireVisible=!1,this._currentAngleMeasurement.targetVisible=!1,this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.angleVisible=!1;break;case xl:this._currentAngleMeasurement.targetVisible=!1,this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.angleVisible=!1;break}}}},{key:"onMouseup",value:function(e){if(this._active&&!this.hover&&!(!this.lastMouseCanvasX&&!this.lastMouseCanvasY)&&!(e[0]>this.lastMouseCanvasX+this.clickTolerance||e[0]<this.lastMouseCanvasX-this.clickTolerance||e[1]>this.lastMouseCanvasY+this.clickTolerance||e[1]<this.lastMouseCanvasY-this.clickTolerance))switch(this._mouseState){case Rs:this.mouseHovering&&(this._currentAngleMeasurement=this.angleMeasurementsPlugin.createMeasurement({id:B.createUUID(),origin:{worldPos:this.pointerWorldPos,entity:this.hoveredEntity},corner:{worldPos:this.pointerWorldPos,entity:this.hoveredEntity},target:{worldPos:this.pointerWorldPos,entity:this.hoveredEntity},precision:this.angleMeasurementsPlugin.precision,approximate:!0}),this._currentAngleMeasurement.clickable=!1,this._currentAngleMeasurement.originVisible=!0,this._currentAngleMeasurement.originWireVisible=!0,this._currentAngleMeasurement.cornerVisible=!1,this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.targetVisible=!1,this._currentAngleMeasurement.angleVisible=!1,this._currentAngleMeasurement.origin.entity=this.hoveredEntity,this._mouseState=ua,this.angleMeasurementsPlugin.fire("measurementStart",this._currentAngleMeasurement));break;case ua:this.mouseHovering?(this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.targetVisible=!0,this._currentAngleMeasurement.angleVisible=!0,this._currentAngleMeasurement.corner.entity=this.hoveredEntity,this._mouseState=xl):this._currentAngleMeasurement&&(this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null,this.hoveredEntity=null,this._mouseState=Rs,this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement));break;case xl:this.mouseHovering?(this._currentAngleMeasurement.targetVisible=!0,this._currentAngleMeasurement.angleVisible=!0,this._currentAngleMeasurement.target.entity=this.hoveredEntity,this._currentAngleMeasurement.clickable=!0,this.hoveredEntity=null,this.angleMeasurementsPlugin.fire("measurementEnd",this._currentAngleMeasurement),this._currentAngleMeasurement=null,this._mouseState=Rs):this._currentAngleMeasurement&&(this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null,this.hoveredEntity=null,this._mouseState=Rs,this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement));break}}},{key:"deactivate",value:function(){this.reset(),document.removeEventListener("mousemove",this.markerHidden),this._currentAngleMeasurement=null,this._active=!1}},{key:"reset",value:function(){this._active&&(this._currentAngleMeasurement&&(this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement),this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null),this._mouseState=Rs)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),H(i,"destroy",this)([])}}])}(cs),xc=function(g){function i(t,e){var r;if(F(this,i),r=R(this,i,[t,e]),r.plugin=e.plugin,r._container=e.container,!r._container)throw"config missing: container";if(!e.markerElement&&!e.markerHTML)throw"config missing: need either markerElement or markerHTML";if(!e.labelElement&&!e.labelHTML)throw"config missing: need either labelElement or labelHTML";return r._htmlDirty=!1,e.markerElement?(r._marker=e.markerElement,r._marker.addEventListener("click",r._onMouseClickedExternalMarker=function(){r.plugin.fire("markerClicked",r)}),r._marker.addEventListener("dblclick",r._onMouseDblClickedExternalMarker=function(){r.plugin.fire("markerDoubleClicked",r)}),r._marker.addEventListener("mouseenter",r._onMouseEnterExternalMarker=function(){r.plugin.fire("markerMouseEnter",r)}),r._marker.addEventListener("mouseleave",r._onMouseLeaveExternalMarker=function(){r.plugin.fire("markerMouseLeave",r)}),r._markerExternal=!0):(r._markerHTML=e.markerHTML,r._htmlDirty=!0,r._markerExternal=!1),e.labelElement?(r._label=e.labelElement,r._labelExternal=!0):(r._labelHTML=e.labelHTML,r._htmlDirty=!0,r._labelExternal=!1),r._markerShown=!!e.markerShown,r._labelShown=!!e.labelShown,r._values=e.values||{},r._layoutDirty=!0,r._visibilityDirty=!0,r._buildHTML(),r._onTick=r.scene.on("tick",function(){r._htmlDirty&&(r._buildHTML(),r._htmlDirty=!1,r._layoutDirty=!0,r._visibilityDirty=!0),(r._layoutDirty||r._visibilityDirty)&&(r._markerShown||r._labelShown)&&(r._updatePosition(),r._layoutDirty=!1),r._visibilityDirty&&(r._marker.style.visibility=r.visible&&r._markerShown?"visible":"hidden",r._label.style.visibility=r.visible&&r._markerShown&&r._labelShown?"visible":"hidden",r._visibilityDirty=!1)}),r.on("canvasPos",function(){r._layoutDirty=!0}),r.on("visible",function(){r._visibilityDirty=!0}),r.setMarkerShown(e.markerShown!==!1),r.setLabelShown(e.labelShown),r.eye=e.eye?e.eye.slice():null,r.look=e.look?e.look.slice():null,r.up=e.up?e.up.slice():null,r.projection=e.projection,r}return O(i,g),D(i,[{key:"_buildHTML",value:function(){var e=this;if(!this._markerExternal){this._marker&&(this._container.removeChild(this._marker),this._marker=null);var r=this._markerHTML||"<p></p>";Dt.isArray(r)&&(r=r.join("")),r=this._renderTemplate(r.trim());var o=document.createRange().createContextualFragment(r);this._marker=o.firstChild,this._container.appendChild(this._marker),this._marker.style.visibility=this._markerShown?"visible":"hidden",this._marker.addEventListener("click",function(){e.plugin.fire("markerClicked",e)}),this._marker.addEventListener("dblclick",function(){e.plugin.fire("markerDoubleClicked",e)}),this._marker.addEventListener("mouseenter",function(){e.plugin.fire("markerMouseEnter",e)}),this._marker.addEventListener("mouseleave",function(){e.plugin.fire("markerMouseLeave",e)}),this._marker.addEventListener("wheel",function(E){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",E))})}if(!this._labelExternal){this._label&&(this._container.removeChild(this._label),this._label=null);var n=this._labelHTML||"<p></p>";Dt.isArray(n)&&(n=n.join("")),n=this._renderTemplate(n.trim());var y=document.createRange().createContextualFragment(n);this._label=y.firstChild,this._container.appendChild(this._label),this._label.style.visibility=this._markerShown&&this._labelShown?"visible":"hidden",this._label.addEventListener("wheel",function(E){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",E))})}}},{key:"_updatePosition",value:function(){var e=this.scene.canvas.boundary,r=e[0],o=e[1],n=this.canvasPos;this._marker.style.left=Math.floor(r+n[0])-12+"px",this._marker.style.top=Math.floor(o+n[1])-12+"px",this._marker.style["z-index"]=90005+Math.floor(this._viewPos[2])+1;var y=20,E=-17;this._label.style.left=20+Math.floor(r+n[0]+y)+"px",this._label.style.top=Math.floor(o+n[1]+E)+"px",this._label.style["z-index"]=90005+Math.floor(this._viewPos[2])+1}},{key:"_renderTemplate",value:function(e){for(var r in this._values)if(this._values.hasOwnProperty(r)){var o=this._values[r];e=e.replace(new RegExp("{{"+r+"}}","g"),o)}return e}},{key:"setMarkerShown",value:function(e){e=!!e,this._markerShown!==e&&(this._markerShown=e,this._visibilityDirty=!0)}},{key:"getMarkerShown",value:function(){return this._markerShown}},{key:"setLabelShown",value:function(e){e=!!e,this._labelShown!==e&&(this._labelShown=e,this._visibilityDirty=!0)}},{key:"getLabelShown",value:function(){return this._labelShown}},{key:"setField",value:function(e,r){this._values[e]=r||"",this._htmlDirty=!0}},{key:"getField",value:function(e){return this._values[e]}},{key:"setValues",value:function(e){for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];this.setField(r,o)}}},{key:"getValues",value:function(){return this._values}},{key:"destroy",value:function(){this._marker&&(this._markerExternal?(this._marker.removeEventListener("click",this._onMouseClickedExternalMarker),this._marker.removeEventListener("dblclick",this._onMouseDblClickedExternalMarker),this._marker.removeEventListener("mouseenter",this._onMouseEnterExternalMarker),this._marker.removeEventListener("mouseleave",this._onMouseLeaveExternalMarker),this._marker=null):this._marker.parentNode.removeChild(this._marker)),this._label&&(this._labelExternal||this._label.parentNode.removeChild(this._label),this._label=null),this.scene.off(this._onTick),H(i,"destroy",this)([])}}])}(Mr),fq=B.vec3(),pq=B.vec3(),mq=B.vec3(),Aq=function(g){function i(t,e){var r;return F(this,i),r=R(this,i,["Annotations",t]),r._labelHTML=e.labelHTML||"<div></div>",r._markerHTML=e.markerHTML||"<div></div>",r._container=e.container||document.body,r._values=e.values||{},r.annotations={},r.surfaceOffset=e.surfaceOffset,r}return O(i,g),D(i,[{key:"getContainerElement",value:function(){return this._container}},{key:"send",value:function(e,r){switch(e){case"clearAnnotations":this.clear();break}}},{key:"surfaceOffset",get:function(){return this._surfaceOffset},set:function(e){e==null&&(e=.3),this._surfaceOffset=e}},{key:"createAnnotation",value:function(e){var r=this;this.viewer.scene.components[e.id]&&(this.error("Viewer component with this ID already exists: "+e.id),delete e.id);var o,n;if(e.pickResult=e.pickResult||e.pickRecord,e.pickResult){var y=e.pickResult;if(!y.worldPos||!y.worldNormal)this.error("Param 'pickResult' does not have both worldPos and worldNormal");else{var E=B.normalizeVec3(y.worldNormal,fq),P=B.mulVec3Scalar(E,this._surfaceOffset,pq),z=B.addVec3(y.worldPos,P,mq);o=z,n=y.entity}}else o=e.worldPos,n=e.entity;var Y=null;e.markerElementId&&(Y=document.getElementById(e.markerElementId),Y||this.error("Can't find DOM element for 'markerElementId' value '"+e.markerElementId+"' - defaulting to internally-generated empty DIV"));var J=null;e.labelElementId&&(J=document.getElementById(e.labelElementId),J||this.error("Can't find DOM element for 'labelElementId' value '"+e.labelElementId+"' - defaulting to internally-generated empty DIV"));var ie=new xc(this.viewer.scene,{id:e.id,plugin:this,entity:n,worldPos:o,container:this._container,markerElement:Y,labelElement:J,markerHTML:e.markerHTML||this._markerHTML,labelHTML:e.labelHTML||this._labelHTML,occludable:e.occludable,values:Dt.apply(e.values,Dt.apply(this._values,{})),markerShown:e.markerShown,labelShown:e.labelShown,eye:e.eye,look:e.look,up:e.up,projection:e.projection,visible:e.visible!==!1});return this.annotations[ie.id]=ie,ie.on("destroyed",function(){delete r.annotations[ie.id],r.fire("annotationDestroyed",ie.id)}),this.fire("annotationCreated",ie.id),ie}},{key:"destroyAnnotation",value:function(e){var r=this.annotations[e];if(!r){this.log("Annotation not found: "+e);return}r.destroy()}},{key:"setAllVisible",value:function(e){for(var r in this.annotations)this.annotations[r].setMarkerShown(e)}},{key:"clear",value:function(){for(var e=Object.keys(this.annotations),r=0,o=e.length;r<o;r++)this.destroyAnnotation(e[r])}},{key:"destroy",value:function(){this.clear(),H(i,"destroy",this)([])}}])}(Ye),gq=B.vec3(),vq=B.vec3(),yq=B.mat4(),Cl=function(){function g(){F(this,g),this.normal=B.vec3(),this.offset=0,this.testVertex=B.vec3()}return D(g,[{key:"set",value:function(t,e,r,o){var n=1/Math.sqrt(t*t+e*e+r*r);this.normal[0]=t*n,this.normal[1]=e*n,this.normal[2]=r*n,this.offset=o*n,this.testVertex[0]=this.normal[0]>=0?1:0,this.testVertex[1]=this.normal[1]>=0?1:0,this.testVertex[2]=this.normal[2]>=0?1:0}}])}(),us=D(function g(){F(this,g),this.planes=[new Cl,new Cl,new Cl,new Cl,new Cl,new Cl]});us.INSIDE=0,us.INTERSECT=1,us.OUTSIDE=2;function Ew(g,i,t){var e=B.mulMat4(t,i,yq),r=e[0],o=e[1],n=e[2],y=e[3],E=e[4],P=e[5],z=e[6],Y=e[7],J=e[8],ie=e[9],le=e[10],Z=e[11],ye=e[12],we=e[13],Be=e[14],xe=e[15];g.planes[0].set(y-r,Y-E,Z-J,xe-ye),g.planes[1].set(y+r,Y+E,Z+J,xe+ye),g.planes[2].set(y-o,Y-P,Z-ie,xe-we),g.planes[3].set(y+o,Y+P,Z+ie,xe+we),g.planes[4].set(y-n,Y-z,Z-le,xe-Be),g.planes[5].set(y+n,Y+z,Z+le,xe+Be)}function Bw(g,i){var t=us.INSIDE,e=gq,r=vq;e[0]=i[0],e[1]=i[1],e[2]=i[2],r[0]=i[3],r[1]=i[4],r[2]=i[5];for(var o=[e,r],n=0;n<6;++n){var y=g.planes[n];if(y.normal[0]*o[y.testVertex[0]][0]+y.normal[1]*o[y.testVertex[1]][1]+y.normal[2]*o[y.testVertex[2]][2]+y.offset<0)return us.OUTSIDE;y.normal[0]*o[1-y.testVertex[0]][0]+y.normal[1]*o[1-y.testVertex[1]][1]+y.normal[2]*o[1-y.testVertex[2]][2]+y.offset<0&&(t=us.INTERSECT)}return t}var bq=function(){function g(i,t){F(this,g),this.primLODLevels=i,this.entitiesInLOD={},this.primCountInLOD={},this.targetFps=t,this.lodLevelIndex=0,this.consecutiveFramesWithTargetFps=0,this.consecutiveFramesWithoutTargetFps=0}return D(g,[{key:"initializeLodState",value:function(t){var e=Object.values(t.objects);if(e.length!==0){for(var r={},o={},n=0,y=e.length;n<y;n++){var E=e[n];E.numPrimitives,B.getAABB3Diag(E.aabb);var P=0,z=void 0;for(P=0,z=this.primLODLevels.length;P<z&&!(E.numPrimitives>=this.primLODLevels[P]);P++);var Y=this.primLODLevels[P]||0;Y in r||(r[Y]=[]),r[Y].push(E),Y in o||(o[Y]=0),o[Y]+=E.numPrimitives}this.entitiesInLOD=r,this.primCountInLOD=o}}}])}(),_q=function(){function g(i,t,e,r){F(this,g),this.id=t.id,this.scene=i,this.sceneModel=t,this.lodState=new bq(e,r),this.lodState.initializeLodState(t)}return D(g,[{key:"_increaseLODLevelIndex",value:function(){var t=this.lodState;if(t.lodLevelIndex===t.primLODLevels.length)return!1;for(var e=t.entitiesInLOD[t.primLODLevels[t.lodLevelIndex]]||[],r=0,o=e.length;r<o;r++)e[r].culledLOD=!0;return t.lodLevelIndex++,!0}},{key:"_decreaseLODLevelIndex",value:function(){var t=this.lodState;if(t.lodLevelIndex===0)return!1;for(var e=t.entitiesInLOD[t.primLODLevels[t.lodLevelIndex-1]]||[],r=0,o=e.length;r<o;r++)e[r].culledLOD=!1;return t.lodLevelIndex--,!0}},{key:"applyLodCulling",value:function(t){var e=this.lodState,r=!1;return t<e.targetFps?++e.consecutiveFramesWithoutTargetFps>0&&(e.consecutiveFramesWithoutTargetFps=0,r=this._increaseLODLevelIndex()):t>e.targetFps+4&&++e.consecutiveFramesWithTargetFps>1&&(e.consecutiveFramesWithTargetFps=0,r=this._decreaseLODLevelIndex()),r}},{key:"resetLodCulling",value:function(){var t=!1,e=!1;do t|=e=this._decreaseLODLevelIndex();while(e);return t}}])}(),wq=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F(this,i),e=R(this,i,[t,r]),e._scene=t,e._lodLevels=[2e3,600,150,80,20],e._lodManagers={},e._lodManagerList=[],e.enabled=r.enabled,e.targetFPS=r.targetFPS,e._init(),e}return O(i,g),D(i,[{key:"_init",value:function(){var e=this,r=4,o=new Array(r),n=0,y=-1,E=Date.now(),P=0,z=0,Y=z;this._scene.on("rendering",function(){if(y!==-1)for(var J=0,ie=e._lodManagerList.length;J<ie;J++)e._lodManagerList[J].applyLodCulling(y)}),this._scene.on("rendered",function(){E=Date.now(),window.requestAnimationFrame(function(){n++;var J=Date.now();P=J-E,E=J,o[n%r]=P;var ie=0;if(n>r){for(var le=0;le<r;le++)ie+=o[le];y=r/ie*1e3}})}),this._scene.camera.on("matrix",function(){Y=z}),this._scene.on("tick",function(){if(z-Y>3)for(var J=0,ie=e._lodManagerList.length;J<ie;J++)e._lodManagerList[J].resetLodCulling();z++})}},{key:"enabled",get:function(){return this._enabled},set:function(e){e=!!e,this._enabled!==e&&(this._enabled=e,this.glRedraw())}},{key:"targetFPS",get:function(){return this._targetFPS},set:function(e){e==null&&(e=30),this._targetFPS!==e&&(this._targetFPS=e,this.glRedraw())}},{key:"getLODManager",value:function(e){var r=new _q(this.scene,e,this._lodLevels,this._targetFPS);return this._lodManagers[r.id]=r,this._lodManagerList=Object.values(this._lodManagers),r}},{key:"putLODManager",value:function(e){delete this._lodManagers[e.id],this._lodManagerList=Object.values(this._lodManagers)}},{key:"destroy",value:function(){H(i,"destroy",this)([])}}])}($e),xq=".sk-fading-circle { background: transparent; margin: 20px auto; width: 50px; height:50px; position: relative; } .sk-fading-circle .sk-circle { width: 120%; height: 120%; position: absolute; left: 0; top: 0; } .sk-fading-circle .sk-circle:before { content: ''; display: block; margin: 0 auto; width: 15%; height: 15%; background-color: #66abdd; border-radius: 100%; -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; } .sk-fading-circle .sk-circle2 { -webkit-transform: rotate(30deg); -ms-transform: rotate(30deg); transform: rotate(30deg); } .sk-fading-circle .sk-circle3 { -webkit-transform: rotate(60deg); -ms-transform: rotate(60deg); transform: rotate(60deg); } .sk-fading-circle .sk-circle4 { -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .sk-fading-circle .sk-circle5 { -webkit-transform: rotate(120deg); -ms-transform: rotate(120deg); transform: rotate(120deg); } .sk-fading-circle .sk-circle6 { -webkit-transform: rotate(150deg); -ms-transform: rotate(150deg); transform: rotate(150deg); } .sk-fading-circle .sk-circle7 { -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .sk-fading-circle .sk-circle8 { -webkit-transform: rotate(210deg); -ms-transform: rotate(210deg); transform: rotate(210deg); } .sk-fading-circle .sk-circle9 { -webkit-transform: rotate(240deg); -ms-transform: rotate(240deg); transform: rotate(240deg); } .sk-fading-circle .sk-circle10 { -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .sk-fading-circle .sk-circle11 { -webkit-transform: rotate(300deg); -ms-transform: rotate(300deg); transform: rotate(300deg); } .sk-fading-circle .sk-circle12 { -webkit-transform: rotate(330deg); -ms-transform: rotate(330deg); transform: rotate(330deg); } .sk-fading-circle .sk-circle2:before { -webkit-animation-delay: -1.1s; animation-delay: -1.1s; } .sk-fading-circle .sk-circle3:before { -webkit-animation-delay: -1s; animation-delay: -1s; } .sk-fading-circle .sk-circle4:before { -webkit-animation-delay: -0.9s; animation-delay: -0.9s; } .sk-fading-circle .sk-circle5:before { -webkit-animation-delay: -0.8s; animation-delay: -0.8s; } .sk-fading-circle .sk-circle6:before { -webkit-animation-delay: -0.7s; animation-delay: -0.7s; } .sk-fading-circle .sk-circle7:before { -webkit-animation-delay: -0.6s; animation-delay: -0.6s; } .sk-fading-circle .sk-circle8:before { -webkit-animation-delay: -0.5s; animation-delay: -0.5s; } .sk-fading-circle .sk-circle9:before { -webkit-animation-delay: -0.4s; animation-delay: -0.4s; } .sk-fading-circle .sk-circle10:before { -webkit-animation-delay: -0.3s; animation-delay: -0.3s; } .sk-fading-circle .sk-circle11:before { -webkit-animation-delay: -0.2s; animation-delay: -0.2s; } .sk-fading-circle .sk-circle12:before { -webkit-animation-delay: -0.1s; animation-delay: -0.1s; } @-webkit-keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } } @keyframes sk-circleFadeDelay { 0%, 39%, 100% { opacity: 0; } 40% { opacity: 1; } }",Cq=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F(this,i),e=R(this,i,[t,r]),e._canvas=r.canvas,e._element=null,e._isCustom=!1,r.elementId?(e._element=document.getElementById(r.elementId),e._element?e._adjustPosition():e._createDefaultSpinner(r.elementId)):e._createDefaultSpinner("engine_spinner"),e.processes=0,e}return O(i,g),D(i,[{key:"type",get:function(){return"Spinner"}},{key:"visible",get:function(){return this._element.style.visibility==="visible"},set:function(e){e?this._element.style.visibility="visible":this._element.style.visibility="hidden"}},{key:"_createDefaultSpinner",value:function(e){this._injectDefaultCSS();var r=document.createElement("div");r.setAttribute("id",e);var o=r.style;if(o["z-index"]="9000",o.position="absolute",r.innerHTML='<div class="sk-fading-circle"> <div class="sk-circle1 sk-circle"></div> <div class="sk-circle2 sk-circle"></div> <div class="sk-circle3 sk-circle"></div> <div class="sk-circle4 sk-circle"></div> <div class="sk-circle5 sk-circle"></div> <div class="sk-circle6 sk-circle"></div> <div class="sk-circle7 sk-circle"></div> <div class="sk-circle8 sk-circle"></div> <div class="sk-circle9 sk-circle"></div> <div class="sk-circle10 sk-circle"></div> <div class="sk-circle11 sk-circle"></div> <div class="sk-circle12 sk-circle"></div> </div>',r.setAttribute("class","loading-circle"),this._canvas.parentElement)this._canvas.parentElement.appendChild(r);else{var n=document.getElementById("myViewer");n.appendChild(r)}this._element=r,this._isCustom=!1,this._adjustPosition()}},{key:"_injectDefaultCSS",value:function(){var e="tctwins-spinner-css";if(!document.getElementById(e)){var r=document.createElement("style");if(r.innerHTML=xq,r.id=e,this._canvas.parentElement)this._canvas.parentElement.appendChild(r);else{var o=document.getElementById("myViewer");o.appendChild(r)}}}},{key:"_adjustPosition",value:function(){if(!this._isCustom){var e=this._canvas,r=this._element,o=r.style;o.left=e.offsetLeft+e.clientWidth*.5-r.clientWidth*.5+"px",o.top=e.offsetTop+e.clientHeight*.5-r.clientHeight*.5+"px"}}},{key:"processes",get:function(){return this._processes},set:function(e){if(e=e||0,this._processes!==e&&!(e<0)){var r=this._processes;this._processes=e;var o=this._element;o&&(o.style.visibility=this._processes>0?"visible":"hidden"),this.fire("processes",this._processes),this._processes===0&&this._processes!==r&&this.fire("zeroProcesses",this._processes)}}},{key:"destroy",value:function(){this._element&&!this._isCustom&&(this._element.parentNode.removeChild(this._element),this._element=null);var e=document.getElementById("tctwins-spinner-css");e&&e.parentNode.removeChild(e)}}])}($e),Pw=["webgl2","experimental-webgl","webkit-3d","moz-webgl","moz-glweb20"],Sw=function(g){function i(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};F(this,i),e=R(this,i,[t,r]),e._backgroundColor=B.vec3([r.backgroundColor?r.backgroundColor[0]:1,r.backgroundColor?r.backgroundColor[1]:1,r.backgroundColor?r.backgroundColor[2]:1]),e._backgroundColorFromAmbientLight=!!r.backgroundColorFromAmbientLight,e.parent=t,r.canvas?e.canvas=r.canvas:e._createCanvas(),e.gl=null,e.webgl2=!1,e.transparent=!!r.transparent,e.contextAttr=r.contextAttr||{},e.contextAttr.alpha=e.transparent,e.contextAttr.preserveDrawingBuffer=!!e.contextAttr.preserveDrawingBuffer,e.contextAttr.stencil=!1,e.contextAttr.premultipliedAlpha=!!e.contextAttr.premultipliedAlpha,e.contextAttr.antialias=e.contextAttr.antialias!==!1,e.resolutionScale=r.resolutionScale,e._offset=r.offset!==void 0?r.offset:[0,0],e.canvas.width=Math.round(e.canvas.clientWidth*e._resolutionScale),e.canvas.height=Math.round(e.canvas.clientHeight*e._resolutionScale),e.boundary=[e.canvas.left,e.canvas.offsetTop,e.canvas.clientWidth,e.canvas.clientHeight],e._initWebGL();var o=e;e.canvas.addEventListener("webglcontextlost",e._webglcontextlostListener=function(y){console.time("webglcontextrestored"),o.scene._webglContextLost(),o.fire("webglcontextlost"),y.preventDefault()},!1),e.canvas.addEventListener("webglcontextrestored",e._webglcontextrestoredListener=function(y){o._initWebGL(),o.gl&&(o.scene._webglContextRestored(o.gl),o.fire("webglcontextrestored",o.gl),y.preventDefault()),console.timeEnd("webglcontextrestored")},!1),e._dirtyBoundary=!0;var n=new ResizeObserver(function(y){var E=v(y),P;try{for(E.s();!(P=E.n()).done;){var z=P.value;z.contentBoxSize&&(e._dirtyBoundary=!0)}}catch(Y){E.e(Y)}finally{E.f()}});return n.observe(e.canvas),e._tick=e.scene.on("tick",function(){e._dirtyBoundary&&(e._dirtyBoundary=!1,o.canvas.width=Math.round(o.canvas.clientWidth*o._resolutionScale),o.canvas.height=Math.round(o.canvas.clientHeight*o._resolutionScale),o.boundary[0]=o.canvas.offsetLeft,o.boundary[1]=o.canvas.offsetTop,o.boundary[2]=o.canvas.clientWidth,o.boundary[3]=o.canvas.clientHeight,o.fire("boundary",o.boundary))}),e._spinner=new Cq(e.scene,{canvas:e.canvas,elementId:r.spinnerElementId}),e}return O(i,g),D(i,[{key:"offset",get:function(){return this._offset},set:function(e){this._offset=e}},{key:"dirtyBoundary",set:function(e){this._dirtyBoundary=e}},{key:"type",get:function(){return"Canvas"}},{key:"backgroundColorFromAmbientLight",get:function(){return this._backgroundColorFromAmbientLight},set:function(e){this._backgroundColorFromAmbientLight=e!==!1,this.glRedraw()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(e){e?(this._backgroundColor[0]=e[0],this._backgroundColor[1]=e[1],this._backgroundColor[2]=e[2]):(this._backgroundColor[0]=1,this._backgroundColor[1]=1,this._backgroundColor[2]=1),this.glRedraw()}},{key:"resolutionScale",get:function(){return this._resolutionScale},set:function(e){if(e=e||1,e!==this._resolutionScale){this._resolutionScale=e;var r=this.canvas;r.width=Math.round(r.clientWidth*this._resolutionScale),r.height=Math.round(r.clientHeight*this._resolutionScale),this.glRedraw()}}},{key:"spinner",get:function(){return this._spinner}},{key:"_createCanvas",value:function(){var e="tctwins-canvas-"+B.createUUID(),r=document.createElement("div"),o=r.style;o.height="100%",o.width="100%",o.padding="0",o.margin="0",o.background="rgba(0,0,0,0);",o.float="left",o.left="0",o.top="0",o.position="absolute",o.opacity="1.0",o["z-index"]="-10000",r.innerHTML+='<canvas id="'+e+'" style="width: 100%; height: 100%; float: left; margin: 0; padding: 0;"></canvas>',this.parent.viewer.container.appendChild(r),this.canvas=document.getElementById(e)}},{key:"_getElementXY",value:function(e){for(var r=0,o=0;e;)r+=e.offsetLeft-e.scrollLeft,o+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:r,y:o}}},{key:"_initWebGL",value:function(){if(!this.gl)for(var e=0;!this.gl&&e<Pw.length;e++)try{this.gl=this.canvas.getContext(Pw[e],this.contextAttr)}catch{}this.gl||(this.error("Failed to get a WebGL context"),this.fire("webglContextFailed",!0,!0));{var r=this.gl,o="__",n=r.activeTexture;r.activeTexture=function(P){o!==P&&(o=P,n.call(this,P))};var y={},E=r.bindTexture;r.bindTexture=function(P,z){y[o]!==z&&(y[o]=z,E.call(this,P,z))}}this.gl&&this.webgl2&&(this.gl.hint(this.gl.FRAGMENT_SHADER_DERIVATIVE_HINT,this.gl.FASTEST),this.gl instanceof WebGL2RenderingContext)}},{key:"getSnapshot",value:function(e){throw"Canvas#getSnapshot() has been replaced by Viewer#getSnapshot() - use that method instead."}},{key:"readPixels",value:function(e,r,o,n){return this.scene._renderer.readPixels(e,r,o,n)}},{key:"loseWebGLContext",value:function(){this.canvas.loseContext&&this.canvas.loseContext()}},{key:"destroy",value:function(){this.scene.off(this._tick),this._spinner&&(this._spinner.destroy(),this._spinner=null),this.canvas.removeEventListener("webglcontextlost",this._webglcontextlostListener),this.canvas.removeEventListener("webglcontextrestored",this._webglcontextrestoredListener),this.gl!=null&&(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this.gl=null),H(i,"destroy",this)([])}}])}($e),Eq=function(){function g(i){F(this,g),this._scene=i,this._matPool=[],this._matPoolNextFreeIndex=0,this._rtcViewMats={},this._rtcPickViewMats={},this.reset()}return D(g,[{key:"reset",value:function(){this._matPoolNextFreeIndex=0,this._rtcViewMats={},this._rtcPickViewMats={},this.gl=this._scene.canvas.gl,this.lastProgramId=null,this.pbrEnabled=!1,this.colorTextureEnabled=!1,this.withSAO=!1,this.backfaces=!1,this.frontface=!0,this.textureUnit=0,this.drawElements=0,this.drawArrays=0,this.useProgram=0,this.bindTexture=0,this.bindArray=0,this.pass=0,this.shadowViewMatrix=null,this.shadowProjMatrix=null,this.pickViewMatrix=null,this.pickProjMatrix=null,this.pickZNear=.01,this.pickZFar=5e3,this.pickInvisible=!1,this.pickElementsCount=null,this.pickElementsOffset=null,this.lineWidth=1,this.snapPickLayerParams={},this.snapPickLayerNumber=0,this.snapPickCoordinateScale=B.vec3(),this.snapPickOrigin=B.vec3()}},{key:"getRTCViewMatrix",value:function(t,e){var r=this._rtcViewMats[t];return r||(r=this._getNewMat(),et(this._scene.camera.viewMatrix,e,r),this._rtcViewMats[t]=r),r}},{key:"getRTCPickViewMatrix",value:function(t,e){var r=this._rtcPickViewMats[t];if(!r){r=this._getNewMat();var o=this.pickViewMatrix||this._scene.camera.viewMatrix;et(o,e,r),this._rtcPickViewMats[t]=r}return r}},{key:"_getNewMat",value:function(){var t=this._matPool[this._matPoolNextFreeIndex];return t||(t=B.mat4(),this._matPool[this._matPoolNextFreeIndex]=t),this._matPoolNextFreeIndex++,t}}])}(),Vi={WEBGL:!1,SUPPORTED_EXTENSIONS:{}},bA=document.createElement("canvas");if(bA){var Ui=bA.getContext("webgl",{antialias:!0})||bA.getContext("experimental-webgl",{antialias:!0});Vi.WEBGL=!!Ui,Vi.WEBGL&&(Vi.ANTIALIAS=Ui.getContextAttributes().antialias,Ui.getShaderPrecisionFormat?Ui.getShaderPrecisionFormat(Ui.FRAGMENT_SHADER,Ui.HIGH_FLOAT).precision>0?Vi.FS_MAX_FLOAT_PRECISION="highp":Ui.getShaderPrecisionFormat(Ui.FRAGMENT_SHADER,Ui.MEDIUM_FLOAT).precision>0?Vi.FS_MAX_FLOAT_PRECISION="mediump":Vi.FS_MAX_FLOAT_PRECISION="lowp":Vi.FS_MAX_FLOAT_PRECISION="mediump",Vi.DEPTH_BUFFER_BITS=Ui.getParameter(Ui.DEPTH_BITS),Vi.MAX_TEXTURE_SIZE=Ui.getParameter(Ui.MAX_TEXTURE_SIZE),Vi.MAX_CUBE_MAP_SIZE=Ui.getParameter(Ui.MAX_CUBE_MAP_TEXTURE_SIZE),Vi.MAX_RENDERBUFFER_SIZE=Ui.getParameter(Ui.MAX_RENDERBUFFER_SIZE),Vi.MAX_TEXTURE_UNITS=Ui.getParameter(Ui.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Vi.MAX_TEXTURE_IMAGE_UNITS=Ui.getParameter(Ui.MAX_TEXTURE_IMAGE_UNITS),Vi.MAX_VERTEX_ATTRIBS=Ui.getParameter(Ui.MAX_VERTEX_ATTRIBS),Vi.MAX_VERTEX_UNIFORM_VECTORS=Ui.getParameter(Ui.MAX_VERTEX_UNIFORM_VECTORS),Vi.MAX_FRAGMENT_UNIFORM_VECTORS=Ui.getParameter(Ui.MAX_FRAGMENT_UNIFORM_VECTORS),Vi.MAX_VARYING_VECTORS=Ui.getParameter(Ui.MAX_VARYING_VECTORS),Ui.getSupportedExtensions().forEach(function(g){Vi.SUPPORTED_EXTENSIONS[g]=!0}))}var _A=function(){function g(){F(this,g),this.entity=null,this.primitive=null,this.primIndex=-1,this.pickSurfacePrecision=!1,this.touchInput=!1,this.snappedToEdge=!1,this.snappedToVertex=!1,this._origin=new Float64Array([0,0,0]),this._direction=new Float64Array([0,0,0]),this._indices=new Int32Array(3),this._localPos=new Float64Array([0,0,0]),this._worldPos=new Float64Array([0,0,0]),this._viewPos=new Float64Array([0,0,0]),this._canvasPos=new Int16Array([0,0]),this._snappedCanvasPos=new Int16Array([0,0]),this._bary=new Float64Array([0,0,0]),this._worldNormal=new Float64Array([0,0,0]),this._uv=new Float64Array([0,0]),this.reset()}return D(g,[{key:"canvasPos",get:function(){return this._gotCanvasPos?this._canvasPos:null},set:function(t){t?(this._canvasPos[0]=t[0],this._canvasPos[1]=t[1],this._gotCanvasPos=!0):this._gotCanvasPos=!1}},{key:"origin",get:function(){return this._gotOrigin?this._origin:null},set:function(t){t?(this._origin[0]=t[0],this._origin[1]=t[1],this._origin[2]=t[2],this._gotOrigin=!0):this._gotOrigin=!1}},{key:"direction",get:function(){return this._gotDirection?this._direction:null},set:function(t){t?(this._direction[0]=t[0],this._direction[1]=t[1],this._direction[2]=t[2],this._gotDirection=!0):this._gotDirection=!1}},{key:"indices",get:function(){return this.entity&&this._gotIndices?this._indices:null},set:function(t){t?(this._indices[0]=t[0],this._indices[1]=t[1],this._indices[2]=t[2],this._gotIndices=!0):this._gotIndices=!1}},{key:"localPos",get:function(){return this.entity&&this._gotLocalPos?this._localPos:null},set:function(t){t?(this._localPos[0]=t[0],this._localPos[1]=t[1],this._localPos[2]=t[2],this._gotLocalPos=!0):this._gotLocalPos=!1}},{key:"snappedCanvasPos",get:function(){return this._gotSnappedCanvasPos?this._snappedCanvasPos:null},set:function(t){t?(this._snappedCanvasPos[0]=t[0],this._snappedCanvasPos[1]=t[1],this._gotSnappedCanvasPos=!0):this._gotSnappedCanvasPos=!1}},{key:"worldPos",get:function(){var t;return(t=this._worldPos)!==null&&t!==void 0?t:null},set:function(t){t&&(this._worldPos[0]=t[0],this._worldPos[1]=t[1],this._worldPos[2]=t[2])}},{key:"viewPos",get:function(){return this.entity&&this._gotViewPos?this._viewPos:null},set:function(t){t?(this._viewPos[0]=t[0],this._viewPos[1]=t[1],this._viewPos[2]=t[2],this._gotViewPos=!0):this._gotViewPos=!1}},{key:"bary",get:function(){return this.entity&&this._gotBary?this._bary:null},set:function(t){t?(this._bary[0]=t[0],this._bary[1]=t[1],this._bary[2]=t[2],this._gotBary=!0):this._gotBary=!1}},{key:"worldNormal",get:function(){return this.entity&&this._gotWorldNormal?this._worldNormal:null},set:function(t){t?(this._worldNormal[0]=t[0],this._worldNormal[1]=t[1],this._worldNormal[2]=t[2],this._gotWorldNormal=!0):this._gotWorldNormal=!1}},{key:"uv",get:function(){return this.entity&&this._gotUV?this._uv:null},set:function(t){t?(this._uv[0]=t[0],this._uv[1]=t[1],this._gotUV=!0):this._gotUV=!1}},{key:"snapped",get:function(){return this.snappedToEdge||this.snappedToVertex}},{key:"reset",value:function(){this.entity=null,this.primIndex=-1,this.primitive=null,this.pickSurfacePrecision=!1,this._gotCanvasPos=!1,this._gotSnappedCanvasPos=!1,this._gotOrigin=!1,this._gotDirection=!1,this._gotIndices=!1,this._gotLocalPos=!1,this._gotViewPos=!1,this._gotBary=!1,this._gotWorldNormal=!1,this._gotUV=!1,this.touchInput=!1,this.snappedToEdge=!1,this.snappedToVertex=!1}}])}(),kw=function(){function g(i,t,e){if(F(this,g),this.allocated=!1,this.compiled=!1,this.handle=i.createShader(t),!this.handle){this.errors=["Failed to allocate"];return}if(this.allocated=!0,i.shaderSource(this.handle,e),i.compileShader(this.handle),this.compiled=i.getShaderParameter(this.handle,i.COMPILE_STATUS),!this.compiled&&!i.isContextLost()){for(var r=e.split(`
@@ -496,7 +496,7 @@ headers: `+JSON.stringify(ze),Ze.data=Xe,Ze.path=X.path,Ze.status=ce,Ze.headers=
496
496
  JSZip uses the library pako released under the MIT license :
497
497
  https://github.com/nodeca/pako/blob/main/LICENSE
498
498
  */(function(x){N.exports=x()})(function(){return function x(S,A,h){function d(c,f){if(!A[c]){if(!S[c]){var p=void 0;if(!f&&p)return require(c,!0);if(u)return u(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var v=A[c]={exports:{}};S[c][0].call(v.exports,function(_){var b=S[c][1][_];return d(b||_)},v,v.exports,x,S,A,h)}return A[c].exports}for(var u=void 0,l=0;l<h.length;l++)d(h[l]);return d}({1:[function(x,S,A){var h=x("./utils"),d=x("./support"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";A.encode=function(l){for(var c,f,p,m,v,_,b,w=[],C=0,k=l.length,T=k,R=h.getTypeOf(l)!=="string";C<l.length;)T=k-C,p=R?(c=l[C++],f=C<k?l[C++]:0,C<k?l[C++]:0):(c=l.charCodeAt(C++),f=C<k?l.charCodeAt(C++):0,C<k?l.charCodeAt(C++):0),m=c>>2,v=(3&c)<<4|f>>4,_=1<T?(15&f)<<2|p>>6:64,b=2<T?63&p:64,w.push(u.charAt(m)+u.charAt(v)+u.charAt(_)+u.charAt(b));return w.join("")},A.decode=function(l){var c,f,p,m,v,_,b=0,w=0,C="data:";if(l.substr(0,C.length)===C)throw new Error("Invalid base64 input, it looks like a data url.");var k,T=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===u.charAt(64)&&T--,l.charAt(l.length-2)===u.charAt(64)&&T--,T%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=d.uint8array?new Uint8Array(0|T):new Array(0|T);b<l.length;)c=u.indexOf(l.charAt(b++))<<2|(m=u.indexOf(l.charAt(b++)))>>4,f=(15&m)<<4|(v=u.indexOf(l.charAt(b++)))>>2,p=(3&v)<<6|(_=u.indexOf(l.charAt(b++))),k[w++]=c,v!==64&&(k[w++]=f),_!==64&&(k[w++]=p);return k}},{"./support":30,"./utils":32}],2:[function(x,S,A){var h=x("./external"),d=x("./stream/DataWorker"),u=x("./stream/Crc32Probe"),l=x("./stream/DataLengthProbe");function c(f,p,m,v,_){this.compressedSize=f,this.uncompressedSize=p,this.crc32=m,this.compression=v,this.compressedContent=_}c.prototype={getContentWorker:function(){var f=new d(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),p=this;return f.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new d(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(f,p,m){return f.pipe(new u).pipe(new l("uncompressedSize")).pipe(p.compressWorker(m)).pipe(new l("compressedSize")).withStreamInfo("compression",p)},S.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(x,S,A){var h=x("./stream/GenericWorker");A.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},A.DEFLATE=x("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(x,S,A){var h=x("./utils"),d=function(){for(var u,l=[],c=0;c<256;c++){u=c;for(var f=0;f<8;f++)u=1&u?3988292384^u>>>1:u>>>1;l[c]=u}return l}();S.exports=function(u,l){return u!==void 0&&u.length?h.getTypeOf(u)!=="string"?function(c,f,p,m){var v=d,_=m+p;c^=-1;for(var b=m;b<_;b++)c=c>>>8^v[255&(c^f[b])];return-1^c}(0|l,u,u.length,0):function(c,f,p,m){var v=d,_=m+p;c^=-1;for(var b=m;b<_;b++)c=c>>>8^v[255&(c^f.charCodeAt(b))];return-1^c}(0|l,u,u.length,0):0}},{"./utils":32}],5:[function(x,S,A){A.base64=!1,A.binary=!1,A.dir=!1,A.createFolders=!0,A.date=null,A.compression=null,A.compressionOptions=null,A.comment=null,A.unixPermissions=null,A.dosPermissions=null},{}],6:[function(x,S,A){var h=null;h=typeof Promise<"u"?Promise:x("lie"),S.exports={Promise:h}},{lie:37}],7:[function(x,S,A){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=x("pako"),u=x("./utils"),l=x("./stream/GenericWorker"),c=h?"uint8array":"array";function f(p,m){l.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=m,this.meta={}}A.magic="\b\0",u.inherits(f,l),f.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(u.transformTo(c,p.data),!1)},f.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(m){p.push({data:m,meta:p.meta})}},A.compressWorker=function(p){return new f("Deflate",p)},A.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(x,S,A){function h(v,_){var b,w="";for(b=0;b<_;b++)w+=String.fromCharCode(255&v),v>>>=8;return w}function d(v,_,b,w,C,k){var T,R,U=v.file,G=v.compression,j=k!==c.utf8encode,H=u.transformTo("string",k(U.name)),W=u.transformTo("string",c.utf8encode(U.name)),K=U.comment,$=u.transformTo("string",k(K)),O=u.transformTo("string",c.utf8encode(K)),L=W.length!==U.name.length,M=O.length!==K.length,I="",F="",V="",D=U.dir,X=U.date,ee={crc32:0,compressedSize:0,uncompressedSize:0};_&&!b||(ee.crc32=v.crc32,ee.compressedSize=v.compressedSize,ee.uncompressedSize=v.uncompressedSize);var q=0;_&&(q|=8),j||!L&&!M||(q|=2048);var ne=0,oe=0;D&&(ne|=16),C==="UNIX"?(oe=798,ne|=function(te,de){var se=te;return te||(se=de?16893:33204),(65535&se)<<16}(U.unixPermissions,D)):(oe=20,ne|=function(te){return 63&(te||0)}(U.dosPermissions)),T=X.getUTCHours(),T<<=6,T|=X.getUTCMinutes(),T<<=5,T|=X.getUTCSeconds()/2,R=X.getUTCFullYear()-1980,R<<=4,R|=X.getUTCMonth()+1,R<<=5,R|=X.getUTCDate(),L&&(F=h(1,1)+h(f(H),4)+W,I+="up"+h(F.length,2)+F),M&&(V=h(1,1)+h(f($),4)+O,I+="uc"+h(V.length,2)+V);var he="";return he+=`
499
- \0`,he+=h(q,2),he+=G.magic,he+=h(T,2),he+=h(R,2),he+=h(ee.crc32,4),he+=h(ee.compressedSize,4),he+=h(ee.uncompressedSize,4),he+=h(H.length,2),he+=h(I.length,2),{fileRecord:p.LOCAL_FILE_HEADER+he+H+I,dirRecord:p.CENTRAL_FILE_HEADER+h(oe,2)+he+h($.length,2)+"\0\0\0\0"+h(ne,4)+h(w,4)+H+I+$}}var u=x("../utils"),l=x("../stream/GenericWorker"),c=x("../utf8"),f=x("../crc32"),p=x("../signature");function m(v,_,b,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=b,this.encodeFileName=w,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(m,l),m.prototype.push=function(v){var _=v.meta.percent||0,b=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,l.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:b?(_+100*(b-w-1))/b:100}}))},m.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var b=d(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:b.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,b=d(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(b.dirRecord),_)this.push({data:function(w){return p.DATA_DESCRIPTOR+h(w.crc32,4)+h(w.compressedSize,4)+h(w.uncompressedSize,4)}(v),meta:{percent:100}});else for(this.push({data:b.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_<this.dirRecords.length;_++)this.push({data:this.dirRecords[_],meta:{percent:100}});var b=this.bytesWritten-v,w=function(C,k,T,R,U){var G=u.transformTo("string",U(R));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+h(C,2)+h(C,2)+h(k,4)+h(T,4)+h(G.length,2)+G}(this.dirRecords.length,b,v,this.zipComment,this.encodeFileName);this.push({data:w,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(v){this._sources.push(v);var _=this;return v.on("data",function(b){_.processChunk(b)}),v.on("end",function(){_.closedSource(_.previous.streamInfo),_._sources.length?_.prepareNextSource():_.end()}),v.on("error",function(b){_.error(b)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(v){var _=this._sources;if(!l.prototype.error.call(this,v))return!1;for(var b=0;b<_.length;b++)try{_[b].error(v)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var v=this._sources,_=0;_<v.length;_++)v[_].lock()},S.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(x,S,A){var h=x("../compressions"),d=x("./ZipFileWorker");A.generateWorker=function(u,l,c){var f=new d(l.streamFiles,c,l.platform,l.encodeFileName),p=0;try{u.forEach(function(m,v){p++;var _=function(k,T){var R=k||T,U=h[R];if(!U)throw new Error(R+" is not a valid compression method !");return U}(v.options.compression,l.compression),b=v.options.compressionOptions||l.compressionOptions||{},w=v.dir,C=v.date;v._compressWorker(_,b).withStreamInfo("file",{name:m,dir:w,date:C,comment:v.comment||"",unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions}).pipe(f)}),f.entriesCount=p}catch(m){f.error(m)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(x,S,A){function h(){if(!(this instanceof h))return new h;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var d=new h;for(var u in this)typeof this[u]!="function"&&(d[u]=this[u]);return d}}(h.prototype=x("./object")).loadAsync=x("./load"),h.support=x("./support"),h.defaults=x("./defaults"),h.version="3.10.1",h.loadAsync=function(d,u){return new h().loadAsync(d,u)},h.external=x("./external"),S.exports=h},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(x,S,A){var h=x("./utils"),d=x("./external"),u=x("./utf8"),l=x("./zipEntries"),c=x("./stream/Crc32Probe"),f=x("./nodejsUtils");function p(m){return new d.Promise(function(v,_){var b=m.decompressed.getContentWorker().pipe(new c);b.on("error",function(w){_(w)}).on("end",function(){b.streamInfo.crc32!==m.decompressed.crc32?_(new Error("Corrupted zip : CRC32 mismatch")):v()}).resume()})}S.exports=function(m,v){var _=this;return v=h.extend(v||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:u.utf8decode}),f.isNode&&f.isStream(m)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):h.prepareContent("the loaded zip file",m,!0,v.optimizedBinaryString,v.base64).then(function(b){var w=new l(v);return w.load(b),w}).then(function(b){var w=[d.Promise.resolve(b)],C=b.files;if(v.checkCRC32)for(var k=0;k<C.length;k++)w.push(p(C[k]));return d.Promise.all(w)}).then(function(b){for(var w=b.shift(),C=w.files,k=0;k<C.length;k++){var T=C[k],R=T.fileNameStr,U=h.resolve(T.fileNameStr);_.file(U,T.decompressed,{binary:!0,optimizedBinaryString:!0,date:T.date,dir:T.dir,comment:T.fileCommentStr.length?T.fileCommentStr:null,unixPermissions:T.unixPermissions,dosPermissions:T.dosPermissions,createFolders:v.createFolders}),T.dir||(_.file(U).unsafeOriginalName=R)}return w.zipComment.length&&(_.comment=w.zipComment),_})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(x,S,A){var h=x("../utils"),d=x("../stream/GenericWorker");function u(l,c){d.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}h.inherits(u,d),u.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(f){c.push({data:f,meta:{percent:0}})}).on("error",function(f){c.isPaused?this.generatedError=f:c.error(f)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},u.prototype.pause=function(){return!!d.prototype.pause.call(this)&&(this._stream.pause(),!0)},u.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},S.exports=u},{"../stream/GenericWorker":28,"../utils":32}],13:[function(x,S,A){var h=x("readable-stream").Readable;function d(u,l,c){h.call(this,l),this._helper=u;var f=this;u.on("data",function(p,m){f.push(p)||f._helper.pause(),c&&c(m)}).on("error",function(p){f.emit("error",p)}).on("end",function(){f.push(null)})}x("../utils").inherits(d,h),d.prototype._read=function(){this._helper.resume()},S.exports=d},{"../utils":32,"readable-stream":16}],14:[function(x,S,A){S.exports={isNode:typeof Buffer<"u",newBufferFrom:function(h,d){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(h,d);if(typeof h=="number")throw new Error('The "data" argument must not be a number');return new Buffer(h,d)},allocBuffer:function(h){if(Buffer.alloc)return Buffer.alloc(h);var d=new Buffer(h);return d.fill(0),d},isBuffer:function(h){return Buffer.isBuffer(h)},isStream:function(h){return h&&typeof h.on=="function"&&typeof h.pause=="function"&&typeof h.resume=="function"}}},{}],15:[function(x,S,A){function h(U,G,j){var H,W=u.getTypeOf(G),K=u.extend(j||{},f);K.date=K.date||new Date,K.compression!==null&&(K.compression=K.compression.toUpperCase()),typeof K.unixPermissions=="string"&&(K.unixPermissions=parseInt(K.unixPermissions,8)),K.unixPermissions&&16384&K.unixPermissions&&(K.dir=!0),K.dosPermissions&&16&K.dosPermissions&&(K.dir=!0),K.dir&&(U=C(U)),K.createFolders&&(H=w(U))&&k.call(this,H,!0);var $=W==="string"&&K.binary===!1&&K.base64===!1;j&&j.binary!==void 0||(K.binary=!$),(G instanceof p&&G.uncompressedSize===0||K.dir||!G||G.length===0)&&(K.base64=!1,K.binary=!0,G="",K.compression="STORE",W="string");var O=null;O=G instanceof p||G instanceof l?G:_.isNode&&_.isStream(G)?new b(U,G):u.prepareContent(U,G,K.binary,K.optimizedBinaryString,K.base64);var L=new m(U,O,K);this.files[U]=L}var d=x("./utf8"),u=x("./utils"),l=x("./stream/GenericWorker"),c=x("./stream/StreamHelper"),f=x("./defaults"),p=x("./compressedObject"),m=x("./zipObject"),v=x("./generate"),_=x("./nodejsUtils"),b=x("./nodejs/NodejsStreamInputAdapter"),w=function(U){U.slice(-1)==="/"&&(U=U.substring(0,U.length-1));var G=U.lastIndexOf("/");return 0<G?U.substring(0,G):""},C=function(U){return U.slice(-1)!=="/"&&(U+="/"),U},k=function(U,G){return G=G!==void 0?G:f.createFolders,U=C(U),this.files[U]||h.call(this,U,null,{dir:!0,createFolders:G}),this.files[U]};function T(U){return Object.prototype.toString.call(U)==="[object RegExp]"}var R={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(U){var G,j,H;for(G in this.files)H=this.files[G],(j=G.slice(this.root.length,G.length))&&G.slice(0,this.root.length)===this.root&&U(j,H)},filter:function(U){var G=[];return this.forEach(function(j,H){U(j,H)&&G.push(H)}),G},file:function(U,G,j){if(arguments.length!==1)return U=this.root+U,h.call(this,U,G,j),this;if(T(U)){var H=U;return this.filter(function(K,$){return!$.dir&&H.test(K)})}var W=this.files[this.root+U];return W&&!W.dir?W:null},folder:function(U){if(!U)return this;if(T(U))return this.filter(function(W,K){return K.dir&&U.test(W)});var G=this.root+U,j=k.call(this,G),H=this.clone();return H.root=j.name,H},remove:function(U){U=this.root+U;var G=this.files[U];if(G||(U.slice(-1)!=="/"&&(U+="/"),G=this.files[U]),G&&!G.dir)delete this.files[U];else for(var j=this.filter(function(W,K){return K.name.slice(0,U.length)===U}),H=0;H<j.length;H++)delete this.files[j[H].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(U){var G,j={};try{if((j=u.extend(U||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=j.type.toLowerCase(),j.compression=j.compression.toUpperCase(),j.type==="binarystring"&&(j.type="string"),!j.type)throw new Error("No output type specified.");u.checkSupport(j.type),j.platform!=="darwin"&&j.platform!=="freebsd"&&j.platform!=="linux"&&j.platform!=="sunos"||(j.platform="UNIX"),j.platform==="win32"&&(j.platform="DOS");var H=j.comment||this.comment||"";G=v.generateWorker(this,j,H)}catch(W){(G=new l("error")).error(W)}return new c(G,j.type||"string",j.mimeType)},generateAsync:function(U,G){return this.generateInternalStream(U).accumulate(G)},generateNodeStream:function(U,G){return(U=U||{}).type||(U.type="nodebuffer"),this.generateInternalStream(U).toNodejsStream(G)}};S.exports=R},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(x,S,A){S.exports=x("stream")},{stream:void 0}],17:[function(x,S,A){var h=x("./DataReader");function d(u){h.call(this,u);for(var l=0;l<this.data.length;l++)u[l]=255&u[l]}x("../utils").inherits(d,h),d.prototype.byteAt=function(u){return this.data[this.zero+u]},d.prototype.lastIndexOfSignature=function(u){for(var l=u.charCodeAt(0),c=u.charCodeAt(1),f=u.charCodeAt(2),p=u.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===f&&this.data[m+3]===p)return m-this.zero;return-1},d.prototype.readAndCheckSignature=function(u){var l=u.charCodeAt(0),c=u.charCodeAt(1),f=u.charCodeAt(2),p=u.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&f===m[2]&&p===m[3]},d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./DataReader":18}],18:[function(x,S,A){var h=x("../utils");function d(u){this.data=u,this.length=u.length,this.index=0,this.zero=0}d.prototype={checkOffset:function(u){this.checkIndex(this.index+u)},checkIndex:function(u){if(this.length<this.zero+u||u<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+u+"). Corrupted zip ?")},setIndex:function(u){this.checkIndex(u),this.index=u},skip:function(u){this.setIndex(this.index+u)},byteAt:function(){},readInt:function(u){var l,c=0;for(this.checkOffset(u),l=this.index+u-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=u,c},readString:function(u){return h.transformTo("string",this.readData(u))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var u=this.readInt(4);return new Date(Date.UTC(1980+(u>>25&127),(u>>21&15)-1,u>>16&31,u>>11&31,u>>5&63,(31&u)<<1))}},S.exports=d},{"../utils":32}],19:[function(x,S,A){var h=x("./Uint8ArrayReader");function d(u){h.call(this,u)}x("../utils").inherits(d,h),d.prototype.readData=function(u){this.checkOffset(u);var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(x,S,A){var h=x("./DataReader");function d(u){h.call(this,u)}x("../utils").inherits(d,h),d.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},d.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},d.prototype.readAndCheckSignature=function(u){return u===this.readData(4)},d.prototype.readData=function(u){this.checkOffset(u);var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./DataReader":18}],21:[function(x,S,A){var h=x("./ArrayReader");function d(u){h.call(this,u)}x("../utils").inherits(d,h),d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(x,S,A){var h=x("../utils"),d=x("../support"),u=x("./ArrayReader"),l=x("./StringReader"),c=x("./NodeBufferReader"),f=x("./Uint8ArrayReader");S.exports=function(p){var m=h.getTypeOf(p);return h.checkSupport(m),m!=="string"||d.uint8array?m==="nodebuffer"?new c(p):d.uint8array?new f(h.transformTo("uint8array",p)):new u(h.transformTo("array",p)):new l(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(x,S,A){A.LOCAL_FILE_HEADER="PK",A.CENTRAL_FILE_HEADER="PK",A.CENTRAL_DIRECTORY_END="PK",A.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",A.ZIP64_CENTRAL_DIRECTORY_END="PK",A.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(x,S,A){var h=x("./GenericWorker"),d=x("../utils");function u(l){h.call(this,"ConvertWorker to "+l),this.destType=l}d.inherits(u,h),u.prototype.processChunk=function(l){this.push({data:d.transformTo(this.destType,l.data),meta:l.meta})},S.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(x,S,A){var h=x("./GenericWorker"),d=x("../crc32");function u(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}x("../utils").inherits(u,h),u.prototype.processChunk=function(l){this.streamInfo.crc32=d(l.data,this.streamInfo.crc32||0),this.push(l)},S.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(x,S,A){var h=x("../utils"),d=x("./GenericWorker");function u(l){d.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}h.inherits(u,d),u.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}d.prototype.processChunk.call(this,l)},S.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(x,S,A){var h=x("../utils"),d=x("./GenericWorker");function u(l){d.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(f){c.dataIsReady=!0,c.data=f,c.max=f&&f.length||0,c.type=h.getTypeOf(f),c.isPaused||c._tickAndRepeat()},function(f){c.error(f)})}h.inherits(u,d),u.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},S.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(x,S,A){function h(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,u){return this._listeners[d].push(u),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,u){if(this._listeners[d])for(var l=0;l<this._listeners[d].length;l++)this._listeners[d][l].call(this,u)},pipe:function(d){return d.registerPrevious(this)},registerPrevious:function(d){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=d.streamInfo,this.mergeStreamInfo(),this.previous=d;var u=this;return d.on("data",function(l){u.processChunk(l)}),d.on("end",function(){u.end()}),d.on("error",function(l){u.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var d=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),d=!0),this.previous&&this.previous.resume(),!d},flush:function(){},processChunk:function(d){this.push(d)},withStreamInfo:function(d,u){return this.extraStreamInfo[d]=u,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var d in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,d)&&(this.streamInfo[d]=this.extraStreamInfo[d])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var d="Worker "+this.name;return this.previous?this.previous+" -> "+d:d}},S.exports=h},{}],29:[function(x,S,A){var h=x("../utils"),d=x("./ConvertWorker"),u=x("./GenericWorker"),l=x("../base64"),c=x("../support"),f=x("../external"),p=null;if(c.nodestream)try{p=x("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(_,b){return new f.Promise(function(w,C){var k=[],T=_._internalType,R=_._outputType,U=_._mimeType;_.on("data",function(G,j){k.push(G),b&&b(j)}).on("error",function(G){k=[],C(G)}).on("end",function(){try{var G=function(j,H,W){switch(j){case"blob":return h.newBlob(h.transformTo("arraybuffer",H),W);case"base64":return l.encode(H);default:return h.transformTo(j,H)}}(R,function(j,H){var W,K=0,$=null,O=0;for(W=0;W<H.length;W++)O+=H[W].length;switch(j){case"string":return H.join("");case"array":return Array.prototype.concat.apply([],H);case"uint8array":for($=new Uint8Array(O),W=0;W<H.length;W++)$.set(H[W],K),K+=H[W].length;return $;case"nodebuffer":return Buffer.concat(H);default:throw new Error("concat : unsupported type '"+j+"'")}}(T,k),U);w(G)}catch(j){C(j)}k=[]}).resume()})}function v(_,b,w){var C=b;switch(b){case"blob":case"arraybuffer":C="uint8array";break;case"base64":C="string"}try{this._internalType=C,this._outputType=b,this._mimeType=w,h.checkSupport(C),this._worker=_.pipe(new d(C)),_.lock()}catch(k){this._worker=new u("error"),this._worker.error(k)}}v.prototype={accumulate:function(_){return m(this,_)},on:function(_,b){var w=this;return _==="data"?this._worker.on(_,function(C){b.call(w,C.data,C.meta)}):this._worker.on(_,function(){h.delay(b,arguments,w)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){if(h.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},_)}},S.exports=v},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(x,S,A){if(A.base64=!0,A.array=!0,A.string=!0,A.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",A.nodebuffer=typeof Buffer<"u",A.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")A.blob=!1;else{var h=new ArrayBuffer(0);try{A.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(h),A.blob=d.getBlob("application/zip").size===0}catch{A.blob=!1}}}try{A.nodestream=!!x("readable-stream").Readable}catch{A.nodestream=!1}},{"readable-stream":16}],31:[function(x,S,A){for(var h=x("./utils"),d=x("./support"),u=x("./nodejsUtils"),l=x("./stream/GenericWorker"),c=new Array(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;c[254]=c[254]=1;function p(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}A.utf8encode=function(v){return d.nodebuffer?u.newBufferFrom(v,"utf-8"):function(_){var b,w,C,k,T,R=_.length,U=0;for(k=0;k<R;k++)(64512&(w=_.charCodeAt(k)))==55296&&k+1<R&&(64512&(C=_.charCodeAt(k+1)))==56320&&(w=65536+(w-55296<<10)+(C-56320),k++),U+=w<128?1:w<2048?2:w<65536?3:4;for(b=d.uint8array?new Uint8Array(U):new Array(U),k=T=0;T<U;k++)(64512&(w=_.charCodeAt(k)))==55296&&k+1<R&&(64512&(C=_.charCodeAt(k+1)))==56320&&(w=65536+(w-55296<<10)+(C-56320),k++),w<128?b[T++]=w:(w<2048?b[T++]=192|w>>>6:(w<65536?b[T++]=224|w>>>12:(b[T++]=240|w>>>18,b[T++]=128|w>>>12&63),b[T++]=128|w>>>6&63),b[T++]=128|63&w);return b}(v)},A.utf8decode=function(v){return d.nodebuffer?h.transformTo("nodebuffer",v).toString("utf-8"):function(_){var b,w,C,k,T=_.length,R=new Array(2*T);for(b=w=0;b<T;)if((C=_[b++])<128)R[w++]=C;else if(4<(k=c[C]))R[w++]=65533,b+=k-1;else{for(C&=k===2?31:k===3?15:7;1<k&&b<T;)C=C<<6|63&_[b++],k--;1<k?R[w++]=65533:C<65536?R[w++]=C:(C-=65536,R[w++]=55296|C>>10&1023,R[w++]=56320|1023&C)}return R.length!==w&&(R.subarray?R=R.subarray(0,w):R.length=w),h.applyFromCharCode(R)}(v=h.transformTo(d.uint8array?"uint8array":"array",v))},h.inherits(p,l),p.prototype.processChunk=function(v){var _=h.transformTo(d.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var b=_;(_=new Uint8Array(b.length+this.leftOver.length)).set(this.leftOver,0),_.set(b,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var w=function(k,T){var R;for((T=T||k.length)>k.length&&(T=k.length),R=T-1;0<=R&&(192&k[R])==128;)R--;return R<0||R===0?T:R+c[k[R]]>T?R:T}(_),C=_;w!==_.length&&(d.uint8array?(C=_.subarray(0,w),this.leftOver=_.subarray(w,_.length)):(C=_.slice(0,w),this.leftOver=_.slice(w,_.length))),this.push({data:A.utf8decode(C),meta:v.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:A.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},A.Utf8DecodeWorker=p,h.inherits(m,l),m.prototype.processChunk=function(v){this.push({data:A.utf8encode(v.data),meta:v.meta})},A.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(x,S,A){var h=x("./support"),d=x("./base64"),u=x("./nodejsUtils"),l=x("./external");function c(b){return b}function f(b,w){for(var C=0;C<b.length;++C)w[C]=255&b.charCodeAt(C);return w}x("setimmediate"),A.newBlob=function(b,w){A.checkSupport("blob");try{return new Blob([b],{type:w})}catch{try{var C=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return C.append(b),C.getBlob(w)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(b,w,C){var k=[],T=0,R=b.length;if(R<=C)return String.fromCharCode.apply(null,b);for(;T<R;)w==="array"||w==="nodebuffer"?k.push(String.fromCharCode.apply(null,b.slice(T,Math.min(T+C,R)))):k.push(String.fromCharCode.apply(null,b.subarray(T,Math.min(T+C,R)))),T+=C;return k.join("")},stringifyByChar:function(b){for(var w="",C=0;C<b.length;C++)w+=String.fromCharCode(b[C]);return w},applyCanBeUsed:{uint8array:function(){try{return h.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return h.nodebuffer&&String.fromCharCode.apply(null,u.allocBuffer(1)).length===1}catch{return!1}}()}};function m(b){var w=65536,C=A.getTypeOf(b),k=!0;if(C==="uint8array"?k=p.applyCanBeUsed.uint8array:C==="nodebuffer"&&(k=p.applyCanBeUsed.nodebuffer),k)for(;1<w;)try{return p.stringifyByChunk(b,C,w)}catch{w=Math.floor(w/2)}return p.stringifyByChar(b)}function v(b,w){for(var C=0;C<b.length;C++)w[C]=b[C];return w}A.applyFromCharCode=m;var _={};_.string={string:c,array:function(b){return f(b,new Array(b.length))},arraybuffer:function(b){return _.string.uint8array(b).buffer},uint8array:function(b){return f(b,new Uint8Array(b.length))},nodebuffer:function(b){return f(b,u.allocBuffer(b.length))}},_.array={string:m,array:c,arraybuffer:function(b){return new Uint8Array(b).buffer},uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return u.newBufferFrom(b)}},_.arraybuffer={string:function(b){return m(new Uint8Array(b))},array:function(b){return v(new Uint8Array(b),new Array(b.byteLength))},arraybuffer:c,uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return u.newBufferFrom(new Uint8Array(b))}},_.uint8array={string:m,array:function(b){return v(b,new Array(b.length))},arraybuffer:function(b){return b.buffer},uint8array:c,nodebuffer:function(b){return u.newBufferFrom(b)}},_.nodebuffer={string:m,array:function(b){return v(b,new Array(b.length))},arraybuffer:function(b){return _.nodebuffer.uint8array(b).buffer},uint8array:function(b){return v(b,new Uint8Array(b.length))},nodebuffer:c},A.transformTo=function(b,w){if(w=w||"",!b)return w;A.checkSupport(b);var C=A.getTypeOf(w);return _[C][b](w)},A.resolve=function(b){for(var w=b.split("/"),C=[],k=0;k<w.length;k++){var T=w[k];T==="."||T===""&&k!==0&&k!==w.length-1||(T===".."?C.pop():C.push(T))}return C.join("/")},A.getTypeOf=function(b){return typeof b=="string"?"string":Object.prototype.toString.call(b)==="[object Array]"?"array":h.nodebuffer&&u.isBuffer(b)?"nodebuffer":h.uint8array&&b instanceof Uint8Array?"uint8array":h.arraybuffer&&b instanceof ArrayBuffer?"arraybuffer":void 0},A.checkSupport=function(b){if(!h[b.toLowerCase()])throw new Error(b+" is not supported by this platform")},A.MAX_VALUE_16BITS=65535,A.MAX_VALUE_32BITS=-1,A.pretty=function(b){var w,C,k="";for(C=0;C<(b||"").length;C++)k+="\\x"+((w=b.charCodeAt(C))<16?"0":"")+w.toString(16).toUpperCase();return k},A.delay=function(b,w,C){setImmediate(function(){b.apply(C||null,w||[])})},A.inherits=function(b,w){function C(){}C.prototype=w.prototype,b.prototype=new C},A.extend=function(){var b,w,C={};for(b=0;b<arguments.length;b++)for(w in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],w)&&C[w]===void 0&&(C[w]=arguments[b][w]);return C},A.prepareContent=function(b,w,C,k,T){return l.Promise.resolve(w).then(function(R){return h.blob&&(R instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(R))!==-1)&&typeof FileReader<"u"?new l.Promise(function(U,G){var j=new FileReader;j.onload=function(H){U(H.target.result)},j.onerror=function(H){G(H.target.error)},j.readAsArrayBuffer(R)}):R}).then(function(R){var U=A.getTypeOf(R);return U?(U==="arraybuffer"?R=A.transformTo("uint8array",R):U==="string"&&(T?R=d.decode(R):C&&k!==!0&&(R=function(G){return f(G,h.uint8array?new Uint8Array(G.length):new Array(G.length))}(R))),R):l.Promise.reject(new Error("Can't read the data of '"+b+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(x,S,A){var h=x("./reader/readerFor"),d=x("./utils"),u=x("./signature"),l=x("./zipEntry"),c=x("./support");function f(p){this.files=[],this.loadOptions=p}f.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(m)+", expected "+d.pretty(p)+")")}},isSignature:function(p,m){var v=this.reader.index;this.reader.setIndex(p);var _=this.reader.readString(4)===m;return this.reader.setIndex(v),_},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",v=d.transformTo(m,p);this.zipComment=this.loadOptions.decodeFileName(v)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,m,v,_=this.zip64EndOfCentralSize-44;0<_;)p=this.reader.readInt(2),m=this.reader.readInt(4),v=this.reader.readData(m),this.zip64ExtensibleData[p]={id:p,length:m,value:v}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,m;for(p=0;p<this.files.length;p++)m=this.files[p],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(u.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(u.CENTRAL_FILE_HEADER);)(p=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(u.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,u.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var m=p;if(this.checkSignature(u.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===d.MAX_VALUE_16BITS||this.diskWithCentralDirStart===d.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===d.MAX_VALUE_16BITS||this.centralDirRecords===d.MAX_VALUE_16BITS||this.centralDirSize===d.MAX_VALUE_32BITS||this.centralDirOffset===d.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(u.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(u.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,u.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(u.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(u.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var v=this.centralDirOffset+this.centralDirSize;this.zip64&&(v+=20,v+=12+this.zip64EndOfCentralSize);var _=m-v;if(0<_)this.isSignature(m,u.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(p){this.reader=h(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},S.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(x,S,A){var h=x("./reader/readerFor"),d=x("./utils"),u=x("./compressedObject"),l=x("./crc32"),c=x("./utf8"),f=x("./compressions"),p=x("./support");function m(v,_){this.options=v,this.loadOptions=_}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(v){var _,b;if(v.skip(22),this.fileNameLength=v.readInt(2),b=v.readInt(2),this.fileName=v.readData(this.fileNameLength),v.skip(b),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((_=function(w){for(var C in f)if(Object.prototype.hasOwnProperty.call(f,C)&&f[C].magic===w)return f[C];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+d.pretty(this.compressionMethod)+" unknown (inner file : "+d.transformTo("string",this.fileName)+")");this.decompressed=new u(this.compressedSize,this.uncompressedSize,this.crc32,_,v.readData(this.compressedSize))},readCentralPart:function(v){this.versionMadeBy=v.readInt(2),v.skip(2),this.bitFlag=v.readInt(2),this.compressionMethod=v.readString(2),this.date=v.readDate(),this.crc32=v.readInt(4),this.compressedSize=v.readInt(4),this.uncompressedSize=v.readInt(4);var _=v.readInt(2);if(this.extraFieldsLength=v.readInt(2),this.fileCommentLength=v.readInt(2),this.diskNumberStart=v.readInt(2),this.internalFileAttributes=v.readInt(2),this.externalFileAttributes=v.readInt(4),this.localHeaderOffset=v.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");v.skip(_),this.readExtraFields(v),this.parseZIP64ExtraField(v),this.fileComment=v.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var v=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=h(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,b,w,C=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4<C;)_=v.readInt(2),b=v.readInt(2),w=v.readData(b),this.extraFields[_]={id:_,length:b,value:w};v.setIndex(C)},handleUTF8:function(){var v=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var _=this.findExtraFieldUnicodePath();if(_!==null)this.fileNameStr=_;else{var b=d.transformTo(v,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(b)}var w=this.findExtraFieldUnicodeComment();if(w!==null)this.fileCommentStr=w;else{var C=d.transformTo(v,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(C)}}},findExtraFieldUnicodePath:function(){var v=this.extraFields[28789];if(v){var _=h(v.value);return _.readInt(1)!==1||l(this.fileName)!==_.readInt(4)?null:c.utf8decode(_.readData(v.length-5))}return null},findExtraFieldUnicodeComment:function(){var v=this.extraFields[25461];if(v){var _=h(v.value);return _.readInt(1)!==1||l(this.fileComment)!==_.readInt(4)?null:c.utf8decode(_.readData(v.length-5))}return null}},S.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(x,S,A){function h(_,b,w){this.name=_,this.dir=w.dir,this.date=w.date,this.comment=w.comment,this.unixPermissions=w.unixPermissions,this.dosPermissions=w.dosPermissions,this._data=b,this._dataBinary=w.binary,this.options={compression:w.compression,compressionOptions:w.compressionOptions}}var d=x("./stream/StreamHelper"),u=x("./stream/DataWorker"),l=x("./utf8"),c=x("./compressedObject"),f=x("./stream/GenericWorker");h.prototype={internalStream:function(_){var b=null,w="string";try{if(!_)throw new Error("No output type specified.");var C=(w=_.toLowerCase())==="string"||w==="text";w!=="binarystring"&&w!=="text"||(w="string"),b=this._decompressWorker();var k=!this._dataBinary;k&&!C&&(b=b.pipe(new l.Utf8EncodeWorker)),!k&&C&&(b=b.pipe(new l.Utf8DecodeWorker))}catch(T){(b=new f("error")).error(T)}return new d(b,w,"")},async:function(_,b){return this.internalStream(_).accumulate(b)},nodeStream:function(_,b){return this.internalStream(_||"nodebuffer").toNodejsStream(b)},_compressWorker:function(_,b){if(this._data instanceof c&&this._data.compression.magic===_.magic)return this._data.getCompressedWorker();var w=this._decompressWorker();return this._dataBinary||(w=w.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(w,_,b)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof f?this._data:new u(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},v=0;v<p.length;v++)h.prototype[p[v]]=m;S.exports=h},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(x,S,A){(function(h){var d,u,l=h.MutationObserver||h.WebKitMutationObserver;if(l){var c=0,f=new l(_),p=h.document.createTextNode("");f.observe(p,{characterData:!0}),d=function(){p.data=c=++c%2}}else if(h.setImmediate||h.MessageChannel===void 0)d="document"in h&&"onreadystatechange"in h.document.createElement("script")?function(){var b=h.document.createElement("script");b.onreadystatechange=function(){_(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},h.document.documentElement.appendChild(b)}:function(){setTimeout(_,0)};else{var m=new h.MessageChannel;m.port1.onmessage=_,d=function(){m.port2.postMessage(0)}}var v=[];function _(){var b,w;u=!0;for(var C=v.length;C;){for(w=v,v=[],b=-1;++b<C;)w[b]();C=v.length}u=!1}S.exports=function(b){v.push(b)!==1||u||d()}}).call(this,typeof a.g<"u"?a.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(x,S,A){var h=x("immediate");function d(){}var u={},l=["REJECTED"],c=["FULFILLED"],f=["PENDING"];function p(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,C!==d&&b(this,C)}function m(C,k,T){this.promise=C,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}function v(C,k,T){h(function(){var R;try{R=k(T)}catch(U){return u.reject(C,U)}R===C?u.reject(C,new TypeError("Cannot resolve promise with itself")):u.resolve(C,R)})}function _(C){var k=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof k=="function")return function(){k.apply(C,arguments)}}function b(C,k){var T=!1;function R(j){T||(T=!0,u.reject(C,j))}function U(j){T||(T=!0,u.resolve(C,j))}var G=w(function(){k(U,R)});G.status==="error"&&R(G.value)}function w(C,k){var T={};try{T.value=C(k),T.status="success"}catch(R){T.status="error",T.value=R}return T}(S.exports=p).prototype.finally=function(C){if(typeof C!="function")return this;var k=this.constructor;return this.then(function(T){return k.resolve(C()).then(function(){return T})},function(T){return k.resolve(C()).then(function(){throw T})})},p.prototype.catch=function(C){return this.then(null,C)},p.prototype.then=function(C,k){if(typeof C!="function"&&this.state===c||typeof k!="function"&&this.state===l)return this;var T=new this.constructor(d);return this.state!==f?v(T,this.state===c?C:k,this.outcome):this.queue.push(new m(T,C,k)),T},m.prototype.callFulfilled=function(C){u.resolve(this.promise,C)},m.prototype.otherCallFulfilled=function(C){v(this.promise,this.onFulfilled,C)},m.prototype.callRejected=function(C){u.reject(this.promise,C)},m.prototype.otherCallRejected=function(C){v(this.promise,this.onRejected,C)},u.resolve=function(C,k){var T=w(_,k);if(T.status==="error")return u.reject(C,T.value);var R=T.value;if(R)b(C,R);else{C.state=c,C.outcome=k;for(var U=-1,G=C.queue.length;++U<G;)C.queue[U].callFulfilled(k)}return C},u.reject=function(C,k){C.state=l,C.outcome=k;for(var T=-1,R=C.queue.length;++T<R;)C.queue[T].callRejected(k);return C},p.resolve=function(C){return C instanceof this?C:u.resolve(new this(d),C)},p.reject=function(C){var k=new this(d);return u.reject(k,C)},p.all=function(C){var k=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=C.length,R=!1;if(!T)return this.resolve([]);for(var U=new Array(T),G=0,j=-1,H=new this(d);++j<T;)W(C[j],j);return H;function W(K,$){k.resolve(K).then(function(O){U[$]=O,++G!==T||R||(R=!0,u.resolve(H,U))},function(O){R||(R=!0,u.reject(H,O))})}},p.race=function(C){var k=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=C.length,R=!1;if(!T)return this.resolve([]);for(var U=-1,G=new this(d);++U<T;)j=C[U],k.resolve(j).then(function(H){R||(R=!0,u.resolve(G,H))},function(H){R||(R=!0,u.reject(G,H))});var j;return G}},{immediate:36}],38:[function(x,S,A){var h={};(0,x("./lib/utils/common").assign)(h,x("./lib/deflate"),x("./lib/inflate"),x("./lib/zlib/constants")),S.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(x,S,A){var h=x("./zlib/deflate"),d=x("./utils/common"),u=x("./utils/strings"),l=x("./zlib/messages"),c=x("./zlib/zstream"),f=Object.prototype.toString,p=0,m=-1,v=0,_=8;function b(C){if(!(this instanceof b))return new b(C);this.options=d.assign({level:m,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:v,to:""},C||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var T=h.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(T!==p)throw new Error(l[T]);if(k.header&&h.deflateSetHeader(this.strm,k.header),k.dictionary){var R;if(R=typeof k.dictionary=="string"?u.string2buf(k.dictionary):f.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(T=h.deflateSetDictionary(this.strm,R))!==p)throw new Error(l[T]);this._dict_set=!0}}function w(C,k){var T=new b(k);if(T.push(C,!0),T.err)throw T.msg||l[T.err];return T.result}b.prototype.push=function(C,k){var T,R,U=this.strm,G=this.options.chunkSize;if(this.ended)return!1;R=k===~~k?k:k===!0?4:0,typeof C=="string"?U.input=u.string2buf(C):f.call(C)==="[object ArrayBuffer]"?U.input=new Uint8Array(C):U.input=C,U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0&&(U.output=new d.Buf8(G),U.next_out=0,U.avail_out=G),(T=h.deflate(U,R))!==1&&T!==p)return this.onEnd(T),!(this.ended=!0);U.avail_out!==0&&(U.avail_in!==0||R!==4&&R!==2)||(this.options.to==="string"?this.onData(u.buf2binstring(d.shrinkBuf(U.output,U.next_out))):this.onData(d.shrinkBuf(U.output,U.next_out)))}while((0<U.avail_in||U.avail_out===0)&&T!==1);return R===4?(T=h.deflateEnd(this.strm),this.onEnd(T),this.ended=!0,T===p):R!==2||(this.onEnd(p),!(U.avail_out=0))},b.prototype.onData=function(C){this.chunks.push(C)},b.prototype.onEnd=function(C){C===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=C,this.msg=this.strm.msg},A.Deflate=b,A.deflate=w,A.deflateRaw=function(C,k){return(k=k||{}).raw=!0,w(C,k)},A.gzip=function(C,k){return(k=k||{}).gzip=!0,w(C,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(x,S,A){var h=x("./zlib/inflate"),d=x("./utils/common"),u=x("./utils/strings"),l=x("./zlib/constants"),c=x("./zlib/messages"),f=x("./zlib/zstream"),p=x("./zlib/gzheader"),m=Object.prototype.toString;function v(b){if(!(this instanceof v))return new v(b);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},b||{});var w=this.options;w.raw&&0<=w.windowBits&&w.windowBits<16&&(w.windowBits=-w.windowBits,w.windowBits===0&&(w.windowBits=-15)),!(0<=w.windowBits&&w.windowBits<16)||b&&b.windowBits||(w.windowBits+=32),15<w.windowBits&&w.windowBits<48&&!(15&w.windowBits)&&(w.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var C=h.inflateInit2(this.strm,w.windowBits);if(C!==l.Z_OK)throw new Error(c[C]);this.header=new p,h.inflateGetHeader(this.strm,this.header)}function _(b,w){var C=new v(w);if(C.push(b,!0),C.err)throw C.msg||c[C.err];return C.result}v.prototype.push=function(b,w){var C,k,T,R,U,G,j=this.strm,H=this.options.chunkSize,W=this.options.dictionary,K=!1;if(this.ended)return!1;k=w===~~w?w:w===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof b=="string"?j.input=u.binstring2buf(b):m.call(b)==="[object ArrayBuffer]"?j.input=new Uint8Array(b):j.input=b,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new d.Buf8(H),j.next_out=0,j.avail_out=H),(C=h.inflate(j,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&W&&(G=typeof W=="string"?u.string2buf(W):m.call(W)==="[object ArrayBuffer]"?new Uint8Array(W):W,C=h.inflateSetDictionary(this.strm,G)),C===l.Z_BUF_ERROR&&K===!0&&(C=l.Z_OK,K=!1),C!==l.Z_STREAM_END&&C!==l.Z_OK)return this.onEnd(C),!(this.ended=!0);j.next_out&&(j.avail_out!==0&&C!==l.Z_STREAM_END&&(j.avail_in!==0||k!==l.Z_FINISH&&k!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(T=u.utf8border(j.output,j.next_out),R=j.next_out-T,U=u.buf2string(j.output,T),j.next_out=R,j.avail_out=H-R,R&&d.arraySet(j.output,j.output,T,R,0),this.onData(U)):this.onData(d.shrinkBuf(j.output,j.next_out)))),j.avail_in===0&&j.avail_out===0&&(K=!0)}while((0<j.avail_in||j.avail_out===0)&&C!==l.Z_STREAM_END);return C===l.Z_STREAM_END&&(k=l.Z_FINISH),k===l.Z_FINISH?(C=h.inflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===l.Z_OK):k!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(j.avail_out=0))},v.prototype.onData=function(b){this.chunks.push(b)},v.prototype.onEnd=function(b){b===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},A.Inflate=v,A.inflate=_,A.inflateRaw=function(b,w){return(w=w||{}).raw=!0,_(b,w)},A.ungzip=_},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(x,S,A){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";A.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var f=c.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var p in f)f.hasOwnProperty(p)&&(l[p]=f[p])}}return l},A.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var d={arraySet:function(l,c,f,p,m){if(c.subarray&&l.subarray)l.set(c.subarray(f,f+p),m);else for(var v=0;v<p;v++)l[m+v]=c[f+v]},flattenChunks:function(l){var c,f,p,m,v,_;for(c=p=0,f=l.length;c<f;c++)p+=l[c].length;for(_=new Uint8Array(p),c=m=0,f=l.length;c<f;c++)v=l[c],_.set(v,m),m+=v.length;return _}},u={arraySet:function(l,c,f,p,m){for(var v=0;v<p;v++)l[m+v]=c[f+v]},flattenChunks:function(l){return[].concat.apply([],l)}};A.setTyped=function(l){l?(A.Buf8=Uint8Array,A.Buf16=Uint16Array,A.Buf32=Int32Array,A.assign(A,d)):(A.Buf8=Array,A.Buf16=Array,A.Buf32=Array,A.assign(A,u))},A.setTyped(h)},{}],42:[function(x,S,A){var h=x("./common"),d=!0,u=!0;try{String.fromCharCode.apply(null,[0])}catch{d=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{u=!1}for(var l=new h.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function f(p,m){if(m<65537&&(p.subarray&&u||!p.subarray&&d))return String.fromCharCode.apply(null,h.shrinkBuf(p,m));for(var v="",_=0;_<m;_++)v+=String.fromCharCode(p[_]);return v}l[254]=l[254]=1,A.string2buf=function(p){var m,v,_,b,w,C=p.length,k=0;for(b=0;b<C;b++)(64512&(v=p.charCodeAt(b)))==55296&&b+1<C&&(64512&(_=p.charCodeAt(b+1)))==56320&&(v=65536+(v-55296<<10)+(_-56320),b++),k+=v<128?1:v<2048?2:v<65536?3:4;for(m=new h.Buf8(k),b=w=0;w<k;b++)(64512&(v=p.charCodeAt(b)))==55296&&b+1<C&&(64512&(_=p.charCodeAt(b+1)))==56320&&(v=65536+(v-55296<<10)+(_-56320),b++),v<128?m[w++]=v:(v<2048?m[w++]=192|v>>>6:(v<65536?m[w++]=224|v>>>12:(m[w++]=240|v>>>18,m[w++]=128|v>>>12&63),m[w++]=128|v>>>6&63),m[w++]=128|63&v);return m},A.buf2binstring=function(p){return f(p,p.length)},A.binstring2buf=function(p){for(var m=new h.Buf8(p.length),v=0,_=m.length;v<_;v++)m[v]=p.charCodeAt(v);return m},A.buf2string=function(p,m){var v,_,b,w,C=m||p.length,k=new Array(2*C);for(v=_=0;v<C;)if((b=p[v++])<128)k[_++]=b;else if(4<(w=l[b]))k[_++]=65533,v+=w-1;else{for(b&=w===2?31:w===3?15:7;1<w&&v<C;)b=b<<6|63&p[v++],w--;1<w?k[_++]=65533:b<65536?k[_++]=b:(b-=65536,k[_++]=55296|b>>10&1023,k[_++]=56320|1023&b)}return f(k,_)},A.utf8border=function(p,m){var v;for((m=m||p.length)>p.length&&(m=p.length),v=m-1;0<=v&&(192&p[v])==128;)v--;return v<0||v===0?m:v+l[p[v]]>m?v:m}},{"./common":41}],43:[function(x,S,A){S.exports=function(h,d,u,l){for(var c=65535&h|0,f=h>>>16&65535|0,p=0;u!==0;){for(u-=p=2e3<u?2e3:u;f=f+(c=c+d[l++]|0)|0,--p;);c%=65521,f%=65521}return c|f<<16|0}},{}],44:[function(x,S,A){S.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(x,S,A){var h=function(){for(var d,u=[],l=0;l<256;l++){d=l;for(var c=0;c<8;c++)d=1&d?3988292384^d>>>1:d>>>1;u[l]=d}return u}();S.exports=function(d,u,l,c){var f=h,p=c+l;d^=-1;for(var m=c;m<p;m++)d=d>>>8^f[255&(d^u[m])];return-1^d}},{}],46:[function(x,S,A){var h,d=x("../utils/common"),u=x("./trees"),l=x("./adler32"),c=x("./crc32"),f=x("./messages"),p=0,m=4,v=0,_=-2,b=-1,w=4,C=2,k=8,T=9,R=286,U=30,G=19,j=2*R+1,H=15,W=3,K=258,$=K+W+1,O=42,L=113,M=1,I=2,F=3,V=4;function D(B,ke){return B.msg=f[ke],ke}function X(B){return(B<<1)-(4<B?9:0)}function ee(B){for(var ke=B.length;0<=--ke;)B[ke]=0}function q(B){var ke=B.state,Ee=ke.pending;Ee>B.avail_out&&(Ee=B.avail_out),Ee!==0&&(d.arraySet(B.output,ke.pending_buf,ke.pending_out,Ee,B.next_out),B.next_out+=Ee,ke.pending_out+=Ee,B.total_out+=Ee,B.avail_out-=Ee,ke.pending-=Ee,ke.pending===0&&(ke.pending_out=0))}function ne(B,ke){u._tr_flush_block(B,0<=B.block_start?B.block_start:-1,B.strstart-B.block_start,ke),B.block_start=B.strstart,q(B.strm)}function oe(B,ke){B.pending_buf[B.pending++]=ke}function he(B,ke){B.pending_buf[B.pending++]=ke>>>8&255,B.pending_buf[B.pending++]=255&ke}function te(B,ke){var Ee,ge,Ae=B.max_chain_length,fe=B.strstart,ue=B.prev_length,_e=B.nice_match,be=B.strstart>B.w_size-$?B.strstart-(B.w_size-$):0,De=B.window,Je=B.w_mask,Qe=B.prev,ot=B.strstart+K,ct=De[fe+ue-1],ht=De[fe+ue];B.prev_length>=B.good_match&&(Ae>>=2),_e>B.lookahead&&(_e=B.lookahead);do if(De[(Ee=ke)+ue]===ht&&De[Ee+ue-1]===ct&&De[Ee]===De[fe]&&De[++Ee]===De[fe+1]){fe+=2,Ee++;do;while(De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&fe<ot);if(ge=K-(ot-fe),fe=ot-K,ue<ge){if(B.match_start=ke,_e<=(ue=ge))break;ct=De[fe+ue-1],ht=De[fe+ue]}}while((ke=Qe[ke&Je])>be&&--Ae!=0);return ue<=B.lookahead?ue:B.lookahead}function de(B){var ke,Ee,ge,Ae,fe,ue,_e,be,De,Je,Qe=B.w_size;do{if(Ae=B.window_size-B.lookahead-B.strstart,B.strstart>=Qe+(Qe-$)){for(d.arraySet(B.window,B.window,Qe,Qe,0),B.match_start-=Qe,B.strstart-=Qe,B.block_start-=Qe,ke=Ee=B.hash_size;ge=B.head[--ke],B.head[ke]=Qe<=ge?ge-Qe:0,--Ee;);for(ke=Ee=Qe;ge=B.prev[--ke],B.prev[ke]=Qe<=ge?ge-Qe:0,--Ee;);Ae+=Qe}if(B.strm.avail_in===0)break;if(ue=B.strm,_e=B.window,be=B.strstart+B.lookahead,De=Ae,Je=void 0,Je=ue.avail_in,De<Je&&(Je=De),Ee=Je===0?0:(ue.avail_in-=Je,d.arraySet(_e,ue.input,ue.next_in,Je,be),ue.state.wrap===1?ue.adler=l(ue.adler,_e,Je,be):ue.state.wrap===2&&(ue.adler=c(ue.adler,_e,Je,be)),ue.next_in+=Je,ue.total_in+=Je,Je),B.lookahead+=Ee,B.lookahead+B.insert>=W)for(fe=B.strstart-B.insert,B.ins_h=B.window[fe],B.ins_h=(B.ins_h<<B.hash_shift^B.window[fe+1])&B.hash_mask;B.insert&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[fe+W-1])&B.hash_mask,B.prev[fe&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=fe,fe++,B.insert--,!(B.lookahead+B.insert<W)););}while(B.lookahead<$&&B.strm.avail_in!==0)}function se(B,ke){for(var Ee,ge;;){if(B.lookahead<$){if(de(B),B.lookahead<$&&ke===p)return M;if(B.lookahead===0)break}if(Ee=0,B.lookahead>=W&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),Ee!==0&&B.strstart-Ee<=B.w_size-$&&(B.match_length=te(B,Ee)),B.match_length>=W)if(ge=u._tr_tally(B,B.strstart-B.match_start,B.match_length-W),B.lookahead-=B.match_length,B.match_length<=B.max_lazy_match&&B.lookahead>=W){for(B.match_length--;B.strstart++,B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart,--B.match_length!=0;);B.strstart++}else B.strstart+=B.match_length,B.match_length=0,B.ins_h=B.window[B.strstart],B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+1])&B.hash_mask;else ge=u._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++;if(ge&&(ne(B,!1),B.strm.avail_out===0))return M}return B.insert=B.strstart<W-1?B.strstart:W-1,ke===m?(ne(B,!0),B.strm.avail_out===0?F:V):B.last_lit&&(ne(B,!1),B.strm.avail_out===0)?M:I}function re(B,ke){for(var Ee,ge,Ae;;){if(B.lookahead<$){if(de(B),B.lookahead<$&&ke===p)return M;if(B.lookahead===0)break}if(Ee=0,B.lookahead>=W&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),B.prev_length=B.match_length,B.prev_match=B.match_start,B.match_length=W-1,Ee!==0&&B.prev_length<B.max_lazy_match&&B.strstart-Ee<=B.w_size-$&&(B.match_length=te(B,Ee),B.match_length<=5&&(B.strategy===1||B.match_length===W&&4096<B.strstart-B.match_start)&&(B.match_length=W-1)),B.prev_length>=W&&B.match_length<=B.prev_length){for(Ae=B.strstart+B.lookahead-W,ge=u._tr_tally(B,B.strstart-1-B.prev_match,B.prev_length-W),B.lookahead-=B.prev_length-1,B.prev_length-=2;++B.strstart<=Ae&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),--B.prev_length!=0;);if(B.match_available=0,B.match_length=W-1,B.strstart++,ge&&(ne(B,!1),B.strm.avail_out===0))return M}else if(B.match_available){if((ge=u._tr_tally(B,0,B.window[B.strstart-1]))&&ne(B,!1),B.strstart++,B.lookahead--,B.strm.avail_out===0)return M}else B.match_available=1,B.strstart++,B.lookahead--}return B.match_available&&(ge=u._tr_tally(B,0,B.window[B.strstart-1]),B.match_available=0),B.insert=B.strstart<W-1?B.strstart:W-1,ke===m?(ne(B,!0),B.strm.avail_out===0?F:V):B.last_lit&&(ne(B,!1),B.strm.avail_out===0)?M:I}function ae(B,ke,Ee,ge,Ae){this.good_length=B,this.max_lazy=ke,this.nice_length=Ee,this.max_chain=ge,this.func=Ae}function Ce(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new d.Buf16(2*j),this.dyn_dtree=new d.Buf16(2*(2*U+1)),this.bl_tree=new d.Buf16(2*(2*G+1)),ee(this.dyn_ltree),ee(this.dyn_dtree),ee(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new d.Buf16(H+1),this.heap=new d.Buf16(2*R+1),ee(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*R+1),ee(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function me(B){var ke;return B&&B.state?(B.total_in=B.total_out=0,B.data_type=C,(ke=B.state).pending=0,ke.pending_out=0,ke.wrap<0&&(ke.wrap=-ke.wrap),ke.status=ke.wrap?O:L,B.adler=ke.wrap===2?0:1,ke.last_flush=p,u._tr_init(ke),v):D(B,_)}function ce(B){var ke=me(B);return ke===v&&function(Ee){Ee.window_size=2*Ee.w_size,ee(Ee.head),Ee.max_lazy_match=h[Ee.level].max_lazy,Ee.good_match=h[Ee.level].good_length,Ee.nice_match=h[Ee.level].nice_length,Ee.max_chain_length=h[Ee.level].max_chain,Ee.strstart=0,Ee.block_start=0,Ee.lookahead=0,Ee.insert=0,Ee.match_length=Ee.prev_length=W-1,Ee.match_available=0,Ee.ins_h=0}(B.state),ke}function pe(B,ke,Ee,ge,Ae,fe){if(!B)return _;var ue=1;if(ke===b&&(ke=6),ge<0?(ue=0,ge=-ge):15<ge&&(ue=2,ge-=16),Ae<1||T<Ae||Ee!==k||ge<8||15<ge||ke<0||9<ke||fe<0||w<fe)return D(B,_);ge===8&&(ge=9);var _e=new Ce;return(B.state=_e).strm=B,_e.wrap=ue,_e.gzhead=null,_e.w_bits=ge,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=Ae+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+W-1)/W),_e.window=new d.Buf8(2*_e.w_size),_e.head=new d.Buf16(_e.hash_size),_e.prev=new d.Buf16(_e.w_size),_e.lit_bufsize=1<<Ae+6,_e.pending_buf_size=4*_e.lit_bufsize,_e.pending_buf=new d.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ke,_e.strategy=fe,_e.method=Ee,ce(B)}h=[new ae(0,0,0,0,function(B,ke){var Ee=65535;for(Ee>B.pending_buf_size-5&&(Ee=B.pending_buf_size-5);;){if(B.lookahead<=1){if(de(B),B.lookahead===0&&ke===p)return M;if(B.lookahead===0)break}B.strstart+=B.lookahead,B.lookahead=0;var ge=B.block_start+Ee;if((B.strstart===0||B.strstart>=ge)&&(B.lookahead=B.strstart-ge,B.strstart=ge,ne(B,!1),B.strm.avail_out===0)||B.strstart-B.block_start>=B.w_size-$&&(ne(B,!1),B.strm.avail_out===0))return M}return B.insert=0,ke===m?(ne(B,!0),B.strm.avail_out===0?F:V):(B.strstart>B.block_start&&(ne(B,!1),B.strm.avail_out),M)}),new ae(4,4,8,4,se),new ae(4,5,16,8,se),new ae(4,6,32,32,se),new ae(4,4,16,16,re),new ae(8,16,32,32,re),new ae(8,16,128,128,re),new ae(8,32,128,256,re),new ae(32,128,258,1024,re),new ae(32,258,258,4096,re)],A.deflateInit=function(B,ke){return pe(B,ke,k,15,8,0)},A.deflateInit2=pe,A.deflateReset=ce,A.deflateResetKeep=me,A.deflateSetHeader=function(B,ke){return B&&B.state?B.state.wrap!==2?_:(B.state.gzhead=ke,v):_},A.deflate=function(B,ke){var Ee,ge,Ae,fe;if(!B||!B.state||5<ke||ke<0)return B?D(B,_):_;if(ge=B.state,!B.output||!B.input&&B.avail_in!==0||ge.status===666&&ke!==m)return D(B,B.avail_out===0?-5:_);if(ge.strm=B,Ee=ge.last_flush,ge.last_flush=ke,ge.status===O)if(ge.wrap===2)B.adler=0,oe(ge,31),oe(ge,139),oe(ge,8),ge.gzhead?(oe(ge,(ge.gzhead.text?1:0)+(ge.gzhead.hcrc?2:0)+(ge.gzhead.extra?4:0)+(ge.gzhead.name?8:0)+(ge.gzhead.comment?16:0)),oe(ge,255&ge.gzhead.time),oe(ge,ge.gzhead.time>>8&255),oe(ge,ge.gzhead.time>>16&255),oe(ge,ge.gzhead.time>>24&255),oe(ge,ge.level===9?2:2<=ge.strategy||ge.level<2?4:0),oe(ge,255&ge.gzhead.os),ge.gzhead.extra&&ge.gzhead.extra.length&&(oe(ge,255&ge.gzhead.extra.length),oe(ge,ge.gzhead.extra.length>>8&255)),ge.gzhead.hcrc&&(B.adler=c(B.adler,ge.pending_buf,ge.pending,0)),ge.gzindex=0,ge.status=69):(oe(ge,0),oe(ge,0),oe(ge,0),oe(ge,0),oe(ge,0),oe(ge,ge.level===9?2:2<=ge.strategy||ge.level<2?4:0),oe(ge,3),ge.status=L);else{var ue=k+(ge.w_bits-8<<4)<<8;ue|=(2<=ge.strategy||ge.level<2?0:ge.level<6?1:ge.level===6?2:3)<<6,ge.strstart!==0&&(ue|=32),ue+=31-ue%31,ge.status=L,he(ge,ue),ge.strstart!==0&&(he(ge,B.adler>>>16),he(ge,65535&B.adler)),B.adler=1}if(ge.status===69)if(ge.gzhead.extra){for(Ae=ge.pending;ge.gzindex<(65535&ge.gzhead.extra.length)&&(ge.pending!==ge.pending_buf_size||(ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),q(B),Ae=ge.pending,ge.pending!==ge.pending_buf_size));)oe(ge,255&ge.gzhead.extra[ge.gzindex]),ge.gzindex++;ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),ge.gzindex===ge.gzhead.extra.length&&(ge.gzindex=0,ge.status=73)}else ge.status=73;if(ge.status===73)if(ge.gzhead.name){Ae=ge.pending;do{if(ge.pending===ge.pending_buf_size&&(ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),q(B),Ae=ge.pending,ge.pending===ge.pending_buf_size)){fe=1;break}fe=ge.gzindex<ge.gzhead.name.length?255&ge.gzhead.name.charCodeAt(ge.gzindex++):0,oe(ge,fe)}while(fe!==0);ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),fe===0&&(ge.gzindex=0,ge.status=91)}else ge.status=91;if(ge.status===91)if(ge.gzhead.comment){Ae=ge.pending;do{if(ge.pending===ge.pending_buf_size&&(ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),q(B),Ae=ge.pending,ge.pending===ge.pending_buf_size)){fe=1;break}fe=ge.gzindex<ge.gzhead.comment.length?255&ge.gzhead.comment.charCodeAt(ge.gzindex++):0,oe(ge,fe)}while(fe!==0);ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),fe===0&&(ge.status=103)}else ge.status=103;if(ge.status===103&&(ge.gzhead.hcrc?(ge.pending+2>ge.pending_buf_size&&q(B),ge.pending+2<=ge.pending_buf_size&&(oe(ge,255&B.adler),oe(ge,B.adler>>8&255),B.adler=0,ge.status=L)):ge.status=L),ge.pending!==0){if(q(B),B.avail_out===0)return ge.last_flush=-1,v}else if(B.avail_in===0&&X(ke)<=X(Ee)&&ke!==m)return D(B,-5);if(ge.status===666&&B.avail_in!==0)return D(B,-5);if(B.avail_in!==0||ge.lookahead!==0||ke!==p&&ge.status!==666){var _e=ge.strategy===2?function(be,De){for(var Je;;){if(be.lookahead===0&&(de(be),be.lookahead===0)){if(De===p)return M;break}if(be.match_length=0,Je=u._tr_tally(be,0,be.window[be.strstart]),be.lookahead--,be.strstart++,Je&&(ne(be,!1),be.strm.avail_out===0))return M}return be.insert=0,De===m?(ne(be,!0),be.strm.avail_out===0?F:V):be.last_lit&&(ne(be,!1),be.strm.avail_out===0)?M:I}(ge,ke):ge.strategy===3?function(be,De){for(var Je,Qe,ot,ct,ht=be.window;;){if(be.lookahead<=K){if(de(be),be.lookahead<=K&&De===p)return M;if(be.lookahead===0)break}if(be.match_length=0,be.lookahead>=W&&0<be.strstart&&(Qe=ht[ot=be.strstart-1])===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]){ct=be.strstart+K;do;while(Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&ot<ct);be.match_length=K-(ct-ot),be.match_length>be.lookahead&&(be.match_length=be.lookahead)}if(be.match_length>=W?(Je=u._tr_tally(be,1,be.match_length-W),be.lookahead-=be.match_length,be.strstart+=be.match_length,be.match_length=0):(Je=u._tr_tally(be,0,be.window[be.strstart]),be.lookahead--,be.strstart++),Je&&(ne(be,!1),be.strm.avail_out===0))return M}return be.insert=0,De===m?(ne(be,!0),be.strm.avail_out===0?F:V):be.last_lit&&(ne(be,!1),be.strm.avail_out===0)?M:I}(ge,ke):h[ge.level].func(ge,ke);if(_e!==F&&_e!==V||(ge.status=666),_e===M||_e===F)return B.avail_out===0&&(ge.last_flush=-1),v;if(_e===I&&(ke===1?u._tr_align(ge):ke!==5&&(u._tr_stored_block(ge,0,0,!1),ke===3&&(ee(ge.head),ge.lookahead===0&&(ge.strstart=0,ge.block_start=0,ge.insert=0))),q(B),B.avail_out===0))return ge.last_flush=-1,v}return ke!==m?v:ge.wrap<=0?1:(ge.wrap===2?(oe(ge,255&B.adler),oe(ge,B.adler>>8&255),oe(ge,B.adler>>16&255),oe(ge,B.adler>>24&255),oe(ge,255&B.total_in),oe(ge,B.total_in>>8&255),oe(ge,B.total_in>>16&255),oe(ge,B.total_in>>24&255)):(he(ge,B.adler>>>16),he(ge,65535&B.adler)),q(B),0<ge.wrap&&(ge.wrap=-ge.wrap),ge.pending!==0?v:1)},A.deflateEnd=function(B){var ke;return B&&B.state?(ke=B.state.status)!==O&&ke!==69&&ke!==73&&ke!==91&&ke!==103&&ke!==L&&ke!==666?D(B,_):(B.state=null,ke===L?D(B,-3):v):_},A.deflateSetDictionary=function(B,ke){var Ee,ge,Ae,fe,ue,_e,be,De,Je=ke.length;if(!B||!B.state||(fe=(Ee=B.state).wrap)===2||fe===1&&Ee.status!==O||Ee.lookahead)return _;for(fe===1&&(B.adler=l(B.adler,ke,Je,0)),Ee.wrap=0,Je>=Ee.w_size&&(fe===0&&(ee(Ee.head),Ee.strstart=0,Ee.block_start=0,Ee.insert=0),De=new d.Buf8(Ee.w_size),d.arraySet(De,ke,Je-Ee.w_size,Ee.w_size,0),ke=De,Je=Ee.w_size),ue=B.avail_in,_e=B.next_in,be=B.input,B.avail_in=Je,B.next_in=0,B.input=ke,de(Ee);Ee.lookahead>=W;){for(ge=Ee.strstart,Ae=Ee.lookahead-(W-1);Ee.ins_h=(Ee.ins_h<<Ee.hash_shift^Ee.window[ge+W-1])&Ee.hash_mask,Ee.prev[ge&Ee.w_mask]=Ee.head[Ee.ins_h],Ee.head[Ee.ins_h]=ge,ge++,--Ae;);Ee.strstart=ge,Ee.lookahead=W-1,de(Ee)}return Ee.strstart+=Ee.lookahead,Ee.block_start=Ee.strstart,Ee.insert=Ee.lookahead,Ee.lookahead=0,Ee.match_length=Ee.prev_length=W-1,Ee.match_available=0,B.next_in=_e,B.input=be,B.avail_in=ue,Ee.wrap=fe,v},A.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(x,S,A){S.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(x,S,A){S.exports=function(h,d){var u,l,c,f,p,m,v,_,b,w,C,k,T,R,U,G,j,H,W,K,$,O,L,M,I;u=h.state,l=h.next_in,M=h.input,c=l+(h.avail_in-5),f=h.next_out,I=h.output,p=f-(d-h.avail_out),m=f+(h.avail_out-257),v=u.dmax,_=u.wsize,b=u.whave,w=u.wnext,C=u.window,k=u.hold,T=u.bits,R=u.lencode,U=u.distcode,G=(1<<u.lenbits)-1,j=(1<<u.distbits)-1;e:do{T<15&&(k+=M[l++]<<T,T+=8,k+=M[l++]<<T,T+=8),H=R[k&G];t:for(;;){if(k>>>=W=H>>>24,T-=W,(W=H>>>16&255)===0)I[f++]=65535&H;else{if(!(16&W)){if(!(64&W)){H=R[(65535&H)+(k&(1<<W)-1)];continue t}if(32&W){u.mode=12;break e}h.msg="invalid literal/length code",u.mode=30;break e}K=65535&H,(W&=15)&&(T<W&&(k+=M[l++]<<T,T+=8),K+=k&(1<<W)-1,k>>>=W,T-=W),T<15&&(k+=M[l++]<<T,T+=8,k+=M[l++]<<T,T+=8),H=U[k&j];r:for(;;){if(k>>>=W=H>>>24,T-=W,!(16&(W=H>>>16&255))){if(!(64&W)){H=U[(65535&H)+(k&(1<<W)-1)];continue r}h.msg="invalid distance code",u.mode=30;break e}if($=65535&H,T<(W&=15)&&(k+=M[l++]<<T,(T+=8)<W&&(k+=M[l++]<<T,T+=8)),v<($+=k&(1<<W)-1)){h.msg="invalid distance too far back",u.mode=30;break e}if(k>>>=W,T-=W,(W=f-p)<$){if(b<(W=$-W)&&u.sane){h.msg="invalid distance too far back",u.mode=30;break e}if(L=C,(O=0)===w){if(O+=_-W,W<K){for(K-=W;I[f++]=C[O++],--W;);O=f-$,L=I}}else if(w<W){if(O+=_+w-W,(W-=w)<K){for(K-=W;I[f++]=C[O++],--W;);if(O=0,w<K){for(K-=W=w;I[f++]=C[O++],--W;);O=f-$,L=I}}}else if(O+=w-W,W<K){for(K-=W;I[f++]=C[O++],--W;);O=f-$,L=I}for(;2<K;)I[f++]=L[O++],I[f++]=L[O++],I[f++]=L[O++],K-=3;K&&(I[f++]=L[O++],1<K&&(I[f++]=L[O++]))}else{for(O=f-$;I[f++]=I[O++],I[f++]=I[O++],I[f++]=I[O++],2<(K-=3););K&&(I[f++]=I[O++],1<K&&(I[f++]=I[O++]))}break}}break}}while(l<c&&f<m);l-=K=T>>3,k&=(1<<(T-=K<<3))-1,h.next_in=l,h.next_out=f,h.avail_in=l<c?c-l+5:5-(l-c),h.avail_out=f<m?m-f+257:257-(f-m),u.hold=k,u.bits=T}},{}],49:[function(x,S,A){var h=x("../utils/common"),d=x("./adler32"),u=x("./crc32"),l=x("./inffast"),c=x("./inftrees"),f=1,p=2,m=0,v=-2,_=1,b=852,w=592;function C(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function T(O){var L;return O&&O.state?(L=O.state,O.total_in=O.total_out=L.total=0,O.msg="",L.wrap&&(O.adler=1&L.wrap),L.mode=_,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new h.Buf32(b),L.distcode=L.distdyn=new h.Buf32(w),L.sane=1,L.back=-1,m):v}function R(O){var L;return O&&O.state?((L=O.state).wsize=0,L.whave=0,L.wnext=0,T(O)):v}function U(O,L){var M,I;return O&&O.state?(I=O.state,L<0?(M=0,L=-L):(M=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?v:(I.window!==null&&I.wbits!==L&&(I.window=null),I.wrap=M,I.wbits=L,R(O))):v}function G(O,L){var M,I;return O?(I=new k,(O.state=I).window=null,(M=U(O,L))!==m&&(O.state=null),M):v}var j,H,W=!0;function K(O){if(W){var L;for(j=new h.Buf32(512),H=new h.Buf32(32),L=0;L<144;)O.lens[L++]=8;for(;L<256;)O.lens[L++]=9;for(;L<280;)O.lens[L++]=7;for(;L<288;)O.lens[L++]=8;for(c(f,O.lens,0,288,j,0,O.work,{bits:9}),L=0;L<32;)O.lens[L++]=5;c(p,O.lens,0,32,H,0,O.work,{bits:5}),W=!1}O.lencode=j,O.lenbits=9,O.distcode=H,O.distbits=5}function $(O,L,M,I){var F,V=O.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new h.Buf8(V.wsize)),I>=V.wsize?(h.arraySet(V.window,L,M-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(I<(F=V.wsize-V.wnext)&&(F=I),h.arraySet(V.window,L,M-I,F,V.wnext),(I-=F)?(h.arraySet(V.window,L,M-I,I,0),V.wnext=I,V.whave=V.wsize):(V.wnext+=F,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=F))),0}A.inflateReset=R,A.inflateReset2=U,A.inflateResetKeep=T,A.inflateInit=function(O){return G(O,15)},A.inflateInit2=G,A.inflate=function(O,L){var M,I,F,V,D,X,ee,q,ne,oe,he,te,de,se,re,ae,Ce,me,ce,pe,B,ke,Ee,ge,Ae=0,fe=new h.Buf8(4),ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return v;(M=O.state).mode===12&&(M.mode=13),D=O.next_out,F=O.output,ee=O.avail_out,V=O.next_in,I=O.input,X=O.avail_in,q=M.hold,ne=M.bits,oe=X,he=ee,ke=m;e:for(;;)switch(M.mode){case _:if(M.wrap===0){M.mode=13;break}for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(2&M.wrap&&q===35615){fe[M.check=0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0),ne=q=0,M.mode=2;break}if(M.flags=0,M.head&&(M.head.done=!1),!(1&M.wrap)||(((255&q)<<8)+(q>>8))%31){O.msg="incorrect header check",M.mode=30;break}if((15&q)!=8){O.msg="unknown compression method",M.mode=30;break}if(ne-=4,B=8+(15&(q>>>=4)),M.wbits===0)M.wbits=B;else if(B>M.wbits){O.msg="invalid window size",M.mode=30;break}M.dmax=1<<B,O.adler=M.check=1,M.mode=512&q?10:12,ne=q=0;break;case 2:for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(M.flags=q,(255&M.flags)!=8){O.msg="unknown compression method",M.mode=30;break}if(57344&M.flags){O.msg="unknown header flags set",M.mode=30;break}M.head&&(M.head.text=q>>8&1),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0)),ne=q=0,M.mode=3;case 3:for(;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.head&&(M.head.time=q),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,fe[2]=q>>>16&255,fe[3]=q>>>24&255,M.check=u(M.check,fe,4,0)),ne=q=0,M.mode=4;case 4:for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.head&&(M.head.xflags=255&q,M.head.os=q>>8),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0)),ne=q=0,M.mode=5;case 5:if(1024&M.flags){for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.length=q,M.head&&(M.head.extra_len=q),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0)),ne=q=0}else M.head&&(M.head.extra=null);M.mode=6;case 6:if(1024&M.flags&&(X<(te=M.length)&&(te=X),te&&(M.head&&(B=M.head.extra_len-M.length,M.head.extra||(M.head.extra=new Array(M.head.extra_len)),h.arraySet(M.head.extra,I,V,te,B)),512&M.flags&&(M.check=u(M.check,I,te,V)),X-=te,V+=te,M.length-=te),M.length))break e;M.length=0,M.mode=7;case 7:if(2048&M.flags){if(X===0)break e;for(te=0;B=I[V+te++],M.head&&B&&M.length<65536&&(M.head.name+=String.fromCharCode(B)),B&&te<X;);if(512&M.flags&&(M.check=u(M.check,I,te,V)),X-=te,V+=te,B)break e}else M.head&&(M.head.name=null);M.length=0,M.mode=8;case 8:if(4096&M.flags){if(X===0)break e;for(te=0;B=I[V+te++],M.head&&B&&M.length<65536&&(M.head.comment+=String.fromCharCode(B)),B&&te<X;);if(512&M.flags&&(M.check=u(M.check,I,te,V)),X-=te,V+=te,B)break e}else M.head&&(M.head.comment=null);M.mode=9;case 9:if(512&M.flags){for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(q!==(65535&M.check)){O.msg="header crc mismatch",M.mode=30;break}ne=q=0}M.head&&(M.head.hcrc=M.flags>>9&1,M.head.done=!0),O.adler=M.check=0,M.mode=12;break;case 10:for(;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}O.adler=M.check=C(q),ne=q=0,M.mode=11;case 11:if(M.havedict===0)return O.next_out=D,O.avail_out=ee,O.next_in=V,O.avail_in=X,M.hold=q,M.bits=ne,2;O.adler=M.check=1,M.mode=12;case 12:if(L===5||L===6)break e;case 13:if(M.last){q>>>=7&ne,ne-=7&ne,M.mode=27;break}for(;ne<3;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}switch(M.last=1&q,ne-=1,3&(q>>>=1)){case 0:M.mode=14;break;case 1:if(K(M),M.mode=20,L!==6)break;q>>>=2,ne-=2;break e;case 2:M.mode=17;break;case 3:O.msg="invalid block type",M.mode=30}q>>>=2,ne-=2;break;case 14:for(q>>>=7&ne,ne-=7&ne;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if((65535&q)!=(q>>>16^65535)){O.msg="invalid stored block lengths",M.mode=30;break}if(M.length=65535&q,ne=q=0,M.mode=15,L===6)break e;case 15:M.mode=16;case 16:if(te=M.length){if(X<te&&(te=X),ee<te&&(te=ee),te===0)break e;h.arraySet(F,I,V,te,D),X-=te,V+=te,ee-=te,D+=te,M.length-=te;break}M.mode=12;break;case 17:for(;ne<14;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(M.nlen=257+(31&q),q>>>=5,ne-=5,M.ndist=1+(31&q),q>>>=5,ne-=5,M.ncode=4+(15&q),q>>>=4,ne-=4,286<M.nlen||30<M.ndist){O.msg="too many length or distance symbols",M.mode=30;break}M.have=0,M.mode=18;case 18:for(;M.have<M.ncode;){for(;ne<3;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.lens[ue[M.have++]]=7&q,q>>>=3,ne-=3}for(;M.have<19;)M.lens[ue[M.have++]]=0;if(M.lencode=M.lendyn,M.lenbits=7,Ee={bits:M.lenbits},ke=c(0,M.lens,0,19,M.lencode,0,M.work,Ee),M.lenbits=Ee.bits,ke){O.msg="invalid code lengths set",M.mode=30;break}M.have=0,M.mode=19;case 19:for(;M.have<M.nlen+M.ndist;){for(;ae=(Ae=M.lencode[q&(1<<M.lenbits)-1])>>>16&255,Ce=65535&Ae,!((re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(Ce<16)q>>>=re,ne-=re,M.lens[M.have++]=Ce;else{if(Ce===16){for(ge=re+2;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(q>>>=re,ne-=re,M.have===0){O.msg="invalid bit length repeat",M.mode=30;break}B=M.lens[M.have-1],te=3+(3&q),q>>>=2,ne-=2}else if(Ce===17){for(ge=re+3;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}ne-=re,B=0,te=3+(7&(q>>>=re)),q>>>=3,ne-=3}else{for(ge=re+7;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}ne-=re,B=0,te=11+(127&(q>>>=re)),q>>>=7,ne-=7}if(M.have+te>M.nlen+M.ndist){O.msg="invalid bit length repeat",M.mode=30;break}for(;te--;)M.lens[M.have++]=B}}if(M.mode===30)break;if(M.lens[256]===0){O.msg="invalid code -- missing end-of-block",M.mode=30;break}if(M.lenbits=9,Ee={bits:M.lenbits},ke=c(f,M.lens,0,M.nlen,M.lencode,0,M.work,Ee),M.lenbits=Ee.bits,ke){O.msg="invalid literal/lengths set",M.mode=30;break}if(M.distbits=6,M.distcode=M.distdyn,Ee={bits:M.distbits},ke=c(p,M.lens,M.nlen,M.ndist,M.distcode,0,M.work,Ee),M.distbits=Ee.bits,ke){O.msg="invalid distances set",M.mode=30;break}if(M.mode=20,L===6)break e;case 20:M.mode=21;case 21:if(6<=X&&258<=ee){O.next_out=D,O.avail_out=ee,O.next_in=V,O.avail_in=X,M.hold=q,M.bits=ne,l(O,he),D=O.next_out,F=O.output,ee=O.avail_out,V=O.next_in,I=O.input,X=O.avail_in,q=M.hold,ne=M.bits,M.mode===12&&(M.back=-1);break}for(M.back=0;ae=(Ae=M.lencode[q&(1<<M.lenbits)-1])>>>16&255,Ce=65535&Ae,!((re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(ae&&!(240&ae)){for(me=re,ce=ae,pe=Ce;ae=(Ae=M.lencode[pe+((q&(1<<me+ce)-1)>>me)])>>>16&255,Ce=65535&Ae,!(me+(re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}q>>>=me,ne-=me,M.back+=me}if(q>>>=re,ne-=re,M.back+=re,M.length=Ce,ae===0){M.mode=26;break}if(32&ae){M.back=-1,M.mode=12;break}if(64&ae){O.msg="invalid literal/length code",M.mode=30;break}M.extra=15&ae,M.mode=22;case 22:if(M.extra){for(ge=M.extra;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.length+=q&(1<<M.extra)-1,q>>>=M.extra,ne-=M.extra,M.back+=M.extra}M.was=M.length,M.mode=23;case 23:for(;ae=(Ae=M.distcode[q&(1<<M.distbits)-1])>>>16&255,Ce=65535&Ae,!((re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(!(240&ae)){for(me=re,ce=ae,pe=Ce;ae=(Ae=M.distcode[pe+((q&(1<<me+ce)-1)>>me)])>>>16&255,Ce=65535&Ae,!(me+(re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}q>>>=me,ne-=me,M.back+=me}if(q>>>=re,ne-=re,M.back+=re,64&ae){O.msg="invalid distance code",M.mode=30;break}M.offset=Ce,M.extra=15&ae,M.mode=24;case 24:if(M.extra){for(ge=M.extra;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.offset+=q&(1<<M.extra)-1,q>>>=M.extra,ne-=M.extra,M.back+=M.extra}if(M.offset>M.dmax){O.msg="invalid distance too far back",M.mode=30;break}M.mode=25;case 25:if(ee===0)break e;if(te=he-ee,M.offset>te){if((te=M.offset-te)>M.whave&&M.sane){O.msg="invalid distance too far back",M.mode=30;break}de=te>M.wnext?(te-=M.wnext,M.wsize-te):M.wnext-te,te>M.length&&(te=M.length),se=M.window}else se=F,de=D-M.offset,te=M.length;for(ee<te&&(te=ee),ee-=te,M.length-=te;F[D++]=se[de++],--te;);M.length===0&&(M.mode=21);break;case 26:if(ee===0)break e;F[D++]=M.length,ee--,M.mode=21;break;case 27:if(M.wrap){for(;ne<32;){if(X===0)break e;X--,q|=I[V++]<<ne,ne+=8}if(he-=ee,O.total_out+=he,M.total+=he,he&&(O.adler=M.check=M.flags?u(M.check,F,he,D-he):d(M.check,F,he,D-he)),he=ee,(M.flags?q:C(q))!==M.check){O.msg="incorrect data check",M.mode=30;break}ne=q=0}M.mode=28;case 28:if(M.wrap&&M.flags){for(;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(q!==(4294967295&M.total)){O.msg="incorrect length check",M.mode=30;break}ne=q=0}M.mode=29;case 29:ke=1;break e;case 30:ke=-3;break e;case 31:return-4;case 32:default:return v}return O.next_out=D,O.avail_out=ee,O.next_in=V,O.avail_in=X,M.hold=q,M.bits=ne,(M.wsize||he!==O.avail_out&&M.mode<30&&(M.mode<27||L!==4))&&$(O,O.output,O.next_out,he-O.avail_out)?(M.mode=31,-4):(oe-=O.avail_in,he-=O.avail_out,O.total_in+=oe,O.total_out+=he,M.total+=he,M.wrap&&he&&(O.adler=M.check=M.flags?u(M.check,F,he,O.next_out-he):d(M.check,F,he,O.next_out-he)),O.data_type=M.bits+(M.last?64:0)+(M.mode===12?128:0)+(M.mode===20||M.mode===15?256:0),(oe==0&&he===0||L===4)&&ke===m&&(ke=-5),ke)},A.inflateEnd=function(O){if(!O||!O.state)return v;var L=O.state;return L.window&&(L.window=null),O.state=null,m},A.inflateGetHeader=function(O,L){var M;return O&&O.state&&2&(M=O.state).wrap?((M.head=L).done=!1,m):v},A.inflateSetDictionary=function(O,L){var M,I=L.length;return O&&O.state?(M=O.state).wrap!==0&&M.mode!==11?v:M.mode===11&&d(1,L,I,0)!==M.check?-3:$(O,L,I,I)?(M.mode=31,-4):(M.havedict=1,m):v},A.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(x,S,A){var h=x("../utils/common"),d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];S.exports=function(f,p,m,v,_,b,w,C){var k,T,R,U,G,j,H,W,K,$=C.bits,O=0,L=0,M=0,I=0,F=0,V=0,D=0,X=0,ee=0,q=0,ne=null,oe=0,he=new h.Buf16(16),te=new h.Buf16(16),de=null,se=0;for(O=0;O<=15;O++)he[O]=0;for(L=0;L<v;L++)he[p[m+L]]++;for(F=$,I=15;1<=I&&he[I]===0;I--);if(I<F&&(F=I),I===0)return _[b++]=20971520,_[b++]=20971520,C.bits=1,0;for(M=1;M<I&&he[M]===0;M++);for(F<M&&(F=M),O=X=1;O<=15;O++)if(X<<=1,(X-=he[O])<0)return-1;if(0<X&&(f===0||I!==1))return-1;for(te[1]=0,O=1;O<15;O++)te[O+1]=te[O]+he[O];for(L=0;L<v;L++)p[m+L]!==0&&(w[te[p[m+L]]++]=L);if(j=f===0?(ne=de=w,19):f===1?(ne=d,oe-=257,de=u,se-=257,256):(ne=l,de=c,-1),O=M,G=b,D=L=q=0,R=-1,U=(ee=1<<(V=F))-1,f===1&&852<ee||f===2&&592<ee)return 1;for(;;){for(H=O-D,K=w[L]<j?(W=0,w[L]):w[L]>j?(W=de[se+w[L]],ne[oe+w[L]]):(W=96,0),k=1<<O-D,M=T=1<<V;_[G+(q>>D)+(T-=k)]=H<<24|W<<16|K|0,T!==0;);for(k=1<<O-1;q&k;)k>>=1;if(k!==0?(q&=k-1,q+=k):q=0,L++,--he[O]==0){if(O===I)break;O=p[m+w[L]]}if(F<O&&(q&U)!==R){for(D===0&&(D=F),G+=M,X=1<<(V=O-D);V+D<I&&!((X-=he[V+D])<=0);)V++,X<<=1;if(ee+=1<<V,f===1&&852<ee||f===2&&592<ee)return 1;_[R=q&U]=F<<24|V<<16|G-b|0}}return q!==0&&(_[G+q]=O-D<<24|64<<16|0),C.bits=F,0}},{"../utils/common":41}],51:[function(x,S,A){S.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(x,S,A){var h=x("../utils/common"),d=0,u=1;function l(Ae){for(var fe=Ae.length;0<=--fe;)Ae[fe]=0}var c=0,f=29,p=256,m=p+1+f,v=30,_=19,b=2*m+1,w=15,C=16,k=7,T=256,R=16,U=17,G=18,j=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],H=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],W=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$=new Array(2*(m+2));l($);var O=new Array(2*v);l(O);var L=new Array(512);l(L);var M=new Array(256);l(M);var I=new Array(f);l(I);var F,V,D,X=new Array(v);function ee(Ae,fe,ue,_e,be){this.static_tree=Ae,this.extra_bits=fe,this.extra_base=ue,this.elems=_e,this.max_length=be,this.has_stree=Ae&&Ae.length}function q(Ae,fe){this.dyn_tree=Ae,this.max_code=0,this.stat_desc=fe}function ne(Ae){return Ae<256?L[Ae]:L[256+(Ae>>>7)]}function oe(Ae,fe){Ae.pending_buf[Ae.pending++]=255&fe,Ae.pending_buf[Ae.pending++]=fe>>>8&255}function he(Ae,fe,ue){Ae.bi_valid>C-ue?(Ae.bi_buf|=fe<<Ae.bi_valid&65535,oe(Ae,Ae.bi_buf),Ae.bi_buf=fe>>C-Ae.bi_valid,Ae.bi_valid+=ue-C):(Ae.bi_buf|=fe<<Ae.bi_valid&65535,Ae.bi_valid+=ue)}function te(Ae,fe,ue){he(Ae,ue[2*fe],ue[2*fe+1])}function de(Ae,fe){for(var ue=0;ue|=1&Ae,Ae>>>=1,ue<<=1,0<--fe;);return ue>>>1}function se(Ae,fe,ue){var _e,be,De=new Array(w+1),Je=0;for(_e=1;_e<=w;_e++)De[_e]=Je=Je+ue[_e-1]<<1;for(be=0;be<=fe;be++){var Qe=Ae[2*be+1];Qe!==0&&(Ae[2*be]=de(De[Qe]++,Qe))}}function re(Ae){var fe;for(fe=0;fe<m;fe++)Ae.dyn_ltree[2*fe]=0;for(fe=0;fe<v;fe++)Ae.dyn_dtree[2*fe]=0;for(fe=0;fe<_;fe++)Ae.bl_tree[2*fe]=0;Ae.dyn_ltree[2*T]=1,Ae.opt_len=Ae.static_len=0,Ae.last_lit=Ae.matches=0}function ae(Ae){8<Ae.bi_valid?oe(Ae,Ae.bi_buf):0<Ae.bi_valid&&(Ae.pending_buf[Ae.pending++]=Ae.bi_buf),Ae.bi_buf=0,Ae.bi_valid=0}function Ce(Ae,fe,ue,_e){var be=2*fe,De=2*ue;return Ae[be]<Ae[De]||Ae[be]===Ae[De]&&_e[fe]<=_e[ue]}function me(Ae,fe,ue){for(var _e=Ae.heap[ue],be=ue<<1;be<=Ae.heap_len&&(be<Ae.heap_len&&Ce(fe,Ae.heap[be+1],Ae.heap[be],Ae.depth)&&be++,!Ce(fe,_e,Ae.heap[be],Ae.depth));)Ae.heap[ue]=Ae.heap[be],ue=be,be<<=1;Ae.heap[ue]=_e}function ce(Ae,fe,ue){var _e,be,De,Je,Qe=0;if(Ae.last_lit!==0)for(;_e=Ae.pending_buf[Ae.d_buf+2*Qe]<<8|Ae.pending_buf[Ae.d_buf+2*Qe+1],be=Ae.pending_buf[Ae.l_buf+Qe],Qe++,_e===0?te(Ae,be,fe):(te(Ae,(De=M[be])+p+1,fe),(Je=j[De])!==0&&he(Ae,be-=I[De],Je),te(Ae,De=ne(--_e),ue),(Je=H[De])!==0&&he(Ae,_e-=X[De],Je)),Qe<Ae.last_lit;);te(Ae,T,fe)}function pe(Ae,fe){var ue,_e,be,De=fe.dyn_tree,Je=fe.stat_desc.static_tree,Qe=fe.stat_desc.has_stree,ot=fe.stat_desc.elems,ct=-1;for(Ae.heap_len=0,Ae.heap_max=b,ue=0;ue<ot;ue++)De[2*ue]!==0?(Ae.heap[++Ae.heap_len]=ct=ue,Ae.depth[ue]=0):De[2*ue+1]=0;for(;Ae.heap_len<2;)De[2*(be=Ae.heap[++Ae.heap_len]=ct<2?++ct:0)]=1,Ae.depth[be]=0,Ae.opt_len--,Qe&&(Ae.static_len-=Je[2*be+1]);for(fe.max_code=ct,ue=Ae.heap_len>>1;1<=ue;ue--)me(Ae,De,ue);for(be=ot;ue=Ae.heap[1],Ae.heap[1]=Ae.heap[Ae.heap_len--],me(Ae,De,1),_e=Ae.heap[1],Ae.heap[--Ae.heap_max]=ue,Ae.heap[--Ae.heap_max]=_e,De[2*be]=De[2*ue]+De[2*_e],Ae.depth[be]=(Ae.depth[ue]>=Ae.depth[_e]?Ae.depth[ue]:Ae.depth[_e])+1,De[2*ue+1]=De[2*_e+1]=be,Ae.heap[1]=be++,me(Ae,De,1),2<=Ae.heap_len;);Ae.heap[--Ae.heap_max]=Ae.heap[1],function(ht,it){var Ze,Xe,dt,at,ze,Ke,ut=it.dyn_tree,yt=it.max_code,Ne=it.stat_desc.static_tree,tt=it.stat_desc.has_stree,Pt=it.stat_desc.extra_bits,Rt=it.stat_desc.extra_base,Ht=it.stat_desc.max_length,zt=0;for(at=0;at<=w;at++)ht.bl_count[at]=0;for(ut[2*ht.heap[ht.heap_max]+1]=0,Ze=ht.heap_max+1;Ze<b;Ze++)Ht<(at=ut[2*ut[2*(Xe=ht.heap[Ze])+1]+1]+1)&&(at=Ht,zt++),ut[2*Xe+1]=at,yt<Xe||(ht.bl_count[at]++,ze=0,Rt<=Xe&&(ze=Pt[Xe-Rt]),Ke=ut[2*Xe],ht.opt_len+=Ke*(at+ze),tt&&(ht.static_len+=Ke*(Ne[2*Xe+1]+ze)));if(zt!==0){do{for(at=Ht-1;ht.bl_count[at]===0;)at--;ht.bl_count[at]--,ht.bl_count[at+1]+=2,ht.bl_count[Ht]--,zt-=2}while(0<zt);for(at=Ht;at!==0;at--)for(Xe=ht.bl_count[at];Xe!==0;)yt<(dt=ht.heap[--Ze])||(ut[2*dt+1]!==at&&(ht.opt_len+=(at-ut[2*dt+1])*ut[2*dt],ut[2*dt+1]=at),Xe--)}}(Ae,fe),se(De,ct,Ae.bl_count)}function B(Ae,fe,ue){var _e,be,De=-1,Je=fe[1],Qe=0,ot=7,ct=4;for(Je===0&&(ot=138,ct=3),fe[2*(ue+1)+1]=65535,_e=0;_e<=ue;_e++)be=Je,Je=fe[2*(_e+1)+1],++Qe<ot&&be===Je||(Qe<ct?Ae.bl_tree[2*be]+=Qe:be!==0?(be!==De&&Ae.bl_tree[2*be]++,Ae.bl_tree[2*R]++):Qe<=10?Ae.bl_tree[2*U]++:Ae.bl_tree[2*G]++,De=be,ct=(Qe=0)===Je?(ot=138,3):be===Je?(ot=6,3):(ot=7,4))}function ke(Ae,fe,ue){var _e,be,De=-1,Je=fe[1],Qe=0,ot=7,ct=4;for(Je===0&&(ot=138,ct=3),_e=0;_e<=ue;_e++)if(be=Je,Je=fe[2*(_e+1)+1],!(++Qe<ot&&be===Je)){if(Qe<ct)for(;te(Ae,be,Ae.bl_tree),--Qe!=0;);else be!==0?(be!==De&&(te(Ae,be,Ae.bl_tree),Qe--),te(Ae,R,Ae.bl_tree),he(Ae,Qe-3,2)):Qe<=10?(te(Ae,U,Ae.bl_tree),he(Ae,Qe-3,3)):(te(Ae,G,Ae.bl_tree),he(Ae,Qe-11,7));De=be,ct=(Qe=0)===Je?(ot=138,3):be===Je?(ot=6,3):(ot=7,4)}}l(X);var Ee=!1;function ge(Ae,fe,ue,_e){he(Ae,(c<<1)+(_e?1:0),3),function(be,De,Je,Qe){ae(be),oe(be,Je),oe(be,~Je),h.arraySet(be.pending_buf,be.window,De,Je,be.pending),be.pending+=Je}(Ae,fe,ue)}A._tr_init=function(Ae){Ee||(function(){var fe,ue,_e,be,De,Je=new Array(w+1);for(be=_e=0;be<f-1;be++)for(I[be]=_e,fe=0;fe<1<<j[be];fe++)M[_e++]=be;for(M[_e-1]=be,be=De=0;be<16;be++)for(X[be]=De,fe=0;fe<1<<H[be];fe++)L[De++]=be;for(De>>=7;be<v;be++)for(X[be]=De<<7,fe=0;fe<1<<H[be]-7;fe++)L[256+De++]=be;for(ue=0;ue<=w;ue++)Je[ue]=0;for(fe=0;fe<=143;)$[2*fe+1]=8,fe++,Je[8]++;for(;fe<=255;)$[2*fe+1]=9,fe++,Je[9]++;for(;fe<=279;)$[2*fe+1]=7,fe++,Je[7]++;for(;fe<=287;)$[2*fe+1]=8,fe++,Je[8]++;for(se($,m+1,Je),fe=0;fe<v;fe++)O[2*fe+1]=5,O[2*fe]=de(fe,5);F=new ee($,j,p+1,m,w),V=new ee(O,H,0,v,w),D=new ee(new Array(0),W,0,_,k)}(),Ee=!0),Ae.l_desc=new q(Ae.dyn_ltree,F),Ae.d_desc=new q(Ae.dyn_dtree,V),Ae.bl_desc=new q(Ae.bl_tree,D),Ae.bi_buf=0,Ae.bi_valid=0,re(Ae)},A._tr_stored_block=ge,A._tr_flush_block=function(Ae,fe,ue,_e){var be,De,Je=0;0<Ae.level?(Ae.strm.data_type===2&&(Ae.strm.data_type=function(Qe){var ot,ct=4093624447;for(ot=0;ot<=31;ot++,ct>>>=1)if(1&ct&&Qe.dyn_ltree[2*ot]!==0)return d;if(Qe.dyn_ltree[18]!==0||Qe.dyn_ltree[20]!==0||Qe.dyn_ltree[26]!==0)return u;for(ot=32;ot<p;ot++)if(Qe.dyn_ltree[2*ot]!==0)return u;return d}(Ae)),pe(Ae,Ae.l_desc),pe(Ae,Ae.d_desc),Je=function(Qe){var ot;for(B(Qe,Qe.dyn_ltree,Qe.l_desc.max_code),B(Qe,Qe.dyn_dtree,Qe.d_desc.max_code),pe(Qe,Qe.bl_desc),ot=_-1;3<=ot&&Qe.bl_tree[2*K[ot]+1]===0;ot--);return Qe.opt_len+=3*(ot+1)+5+5+4,ot}(Ae),be=Ae.opt_len+3+7>>>3,(De=Ae.static_len+3+7>>>3)<=be&&(be=De)):be=De=ue+5,ue+4<=be&&fe!==-1?ge(Ae,fe,ue,_e):Ae.strategy===4||De===be?(he(Ae,2+(_e?1:0),3),ce(Ae,$,O)):(he(Ae,4+(_e?1:0),3),function(Qe,ot,ct,ht){var it;for(he(Qe,ot-257,5),he(Qe,ct-1,5),he(Qe,ht-4,4),it=0;it<ht;it++)he(Qe,Qe.bl_tree[2*K[it]+1],3);ke(Qe,Qe.dyn_ltree,ot-1),ke(Qe,Qe.dyn_dtree,ct-1)}(Ae,Ae.l_desc.max_code+1,Ae.d_desc.max_code+1,Je+1),ce(Ae,Ae.dyn_ltree,Ae.dyn_dtree)),re(Ae),_e&&ae(Ae)},A._tr_tally=function(Ae,fe,ue){return Ae.pending_buf[Ae.d_buf+2*Ae.last_lit]=fe>>>8&255,Ae.pending_buf[Ae.d_buf+2*Ae.last_lit+1]=255&fe,Ae.pending_buf[Ae.l_buf+Ae.last_lit]=255&ue,Ae.last_lit++,fe===0?Ae.dyn_ltree[2*ue]++:(Ae.matches++,fe--,Ae.dyn_ltree[2*(M[ue]+p+1)]++,Ae.dyn_dtree[2*ne(fe)]++),Ae.last_lit===Ae.lit_bufsize-1},A._tr_align=function(Ae){he(Ae,2,3),te(Ae,T,$),function(fe){fe.bi_valid===16?(oe(fe,fe.bi_buf),fe.bi_buf=0,fe.bi_valid=0):8<=fe.bi_valid&&(fe.pending_buf[fe.pending++]=255&fe.bi_buf,fe.bi_buf>>=8,fe.bi_valid-=8)}(Ae)}},{"../utils/common":41}],53:[function(x,S,A){S.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(x,S,A){(function(h){(function(d,u){if(!d.setImmediate){var l,c,f,p,m=1,v={},_=!1,b=d.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(d);w=w&&w.setTimeout?w:d,l={}.toString.call(d.process)==="[object process]"?function(R){process.nextTick(function(){k(R)})}:function(){if(d.postMessage&&!d.importScripts){var R=!0,U=d.onmessage;return d.onmessage=function(){R=!1},d.postMessage("","*"),d.onmessage=U,R}}()?(p="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",T,!1):d.attachEvent("onmessage",T),function(R){d.postMessage(p+R,"*")}):d.MessageChannel?((f=new MessageChannel).port1.onmessage=function(R){k(R.data)},function(R){f.port2.postMessage(R)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,function(R){var U=b.createElement("script");U.onreadystatechange=function(){k(R),U.onreadystatechange=null,c.removeChild(U),U=null},c.appendChild(U)}):function(R){setTimeout(k,0,R)},w.setImmediate=function(R){typeof R!="function"&&(R=new Function(""+R));for(var U=new Array(arguments.length-1),G=0;G<U.length;G++)U[G]=arguments[G+1];var j={callback:R,args:U};return v[m]=j,l(m),m++},w.clearImmediate=C}function C(R){delete v[R]}function k(R){if(_)setTimeout(k,0,R);else{var U=v[R];if(U){_=!0;try{(function(G){var j=G.callback,H=G.args;switch(H.length){case 0:j();break;case 1:j(H[0]);break;case 2:j(H[0],H[1]);break;case 3:j(H[0],H[1],H[2]);break;default:j.apply(u,H)}})(U)}finally{C(R),_=!1}}}}function T(R){R.source===d&&typeof R.data=="string"&&R.data.indexOf(p)===0&&k(+R.data.slice(p.length))}})(typeof self>"u"?h===void 0?this:h:self)}).call(this,typeof a.g<"u"?a.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})},"./node_modules/strnum/strnum.js"(N){const Q=/^[-+]?0x[a-fA-F0-9]+$/,a=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,x={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function S(d,u={}){if(u=Object.assign({},x,u),!d||typeof d!="string")return d;let l=d.trim();if(u.skipLike!==void 0&&u.skipLike.test(l))return d;if(d==="0")return 0;if(u.hex&&Q.test(l))return h(l,16);if(l.search(/[eE]/)!==-1){const c=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(c){if(u.leadingZeros)l=(c[1]||"")+c[3];else if(!(c[2]==="0"&&c[3][0]==="."))return d;return u.eNotation?Number(l):d}else return d}else{const c=a.exec(l);if(c){const f=c[1],p=c[2];let m=A(c[3]);if(!u.leadingZeros&&p.length>0&&f&&l[2]!==".")return d;if(!u.leadingZeros&&p.length>0&&!f&&l[1]!==".")return d;if(u.leadingZeros&&p===d)return 0;{const v=Number(l),_=""+v;return _.search(/[eE]/)!==-1?u.eNotation?v:d:l.indexOf(".")!==-1?_==="0"&&m===""||_===m||f&&_==="-"+m?v:d:p?m===_||f+m===_?v:d:l===_||l===f+_?v:d}}else return d}}function A(d){return d&&d.indexOf(".")!==-1&&(d=d.replace(/0+$/,""),d==="."?d="0":d[0]==="."?d="0"+d:d[d.length-1]==="."&&(d=d.substr(0,d.length-1))),d}function h(d,u){if(parseInt)return parseInt(d,u);if(Number.parseInt)return Number.parseInt(d,u);if(window&&window.parseInt)return window.parseInt(d,u);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}N.exports=S},"./src/BIMXViewer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>$});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/messages.ts"),A=a("./src/EventTrigger.ts"),h=a("./src/Controller.ts"),d=a("./src/toolbar/ResetAction.ts"),u=a("./src/toolbar/FitAction.ts"),l=a("./src/toolbar/FirstPersonMode.ts"),c=a("./src/toolbar/HideTool.ts"),f=a("./src/toolbar/ShowSpacesMode.ts"),p=a("./src/toolbar/SectionTool.ts"),m=a("./src/toolbar/NavCubeMode.ts"),v=a("./src/explorer/ModelsExplorer.ts"),_=a("./src/explorer/ObjectsExplorer.ts"),b=a("./src/explorer/ClassesExplorer.ts"),w=a("./src/explorer/StoreysExplorer.ts"),C=a("./src/toolbar/ThreeDMode.ts"),k=a("./src/toolbar/OrthoMode.ts"),T=a("./src/toolbar/AnnotationTool.ts"),R=a("./src/toolbar/MarkerTool.ts"),U=a("./src/toolbar/MeasureTool.ts"),G=a("./src/toolbar/CommentsTool.ts"),j=a("./src/server/Server.ts"),H=a("./src/toolbar/SkyBoxTool.ts"),W=a("./src/toolbar/BCFTool.ts"),K=function(O,L,M,I){function F(V){return V instanceof M?V:new M(function(D){D(V)})}return new(M||(M=Promise))(function(V,D){function X(ne){try{q(I.next(ne))}catch(oe){D(oe)}}function ee(ne){try{q(I.throw(ne))}catch(oe){D(oe)}}function q(ne){ne.done?V(ne.value):F(ne.value).then(X,ee)}q((I=I.apply(O,L||[])).next())})};class $ extends h.default{constructor(L={}){if(!L.canvasElement)throw new Error("Config expected: canvasElement");if(!L.navCubeCanvasElement)throw new Error("Config expected: navCubeCanvasElement");const{canvasElement:M}=L,{viewerElement:I}=L,F=new x.LocaleService({messages:S.default,locale:"ch"}),V=new x.Viewer({passes:5,localeService:F,canvasElement:M,viewerElement:I,snapRadius:L.snapRadius,antialias:L.viewer_cfg.antialias,saoEnabled:L.viewer_cfg.saoEnabled,pbrEnabled:L.viewer_cfg.pbrEnabled,dtxEnabled:L.viewer_cfg.dtxEnabled,transparent:L.viewer_cfg.transparent,edgesEnabled:L.viewer_cfg.edgesEnabled,alphaDepthMask:L.viewer_cfg.alphaDepthMask,premultipliedAlpha:L.viewer_cfg.premultipliedAlpha,colorTextureEnabled:L.viewer_cfg.colorTextureEnabled,backgroundColorFromAmbientLight:L.viewer_cfg.backgroundColorFromAmbientLight,resolutionScale:window.devicePixelRatio,spinnerElementId:"engine_spinner"}),D=new j.default({dataDir:"./data",filePath:"testdemo"});super(null,L,D,V),this._modelNum=0,this._disableClickEvent=!1,this._focusPartial=!1,this._partialObjectIds=[],this._partialFocusIndex=0,this._metaLoaded=!1,this._worldAxisYDown=!1,this._worldAxisZUp=!1,this._edgesActive=!1,this.orbitYawCamera=ne=>new Promise((oe,he)=>{try{this.viewer.scene.camera.orbitYaw(ne),oe()}catch(te){he(te)}}),this.cameraEnable=(ne=!this.viewer.cameraControl.pointerEnabled)=>{this.viewer.cameraControl.pointerEnabled=ne},this.shot=(ne,oe,he)=>{const te=document.getElementById("myCanvas"),de=document.createElement("a");de.download="screenshot.png";const se=document.createElement("canvas"),re=se.getContext("2d");if(te&&re){se.width=ne,se.height=oe;const ae=ne/te.width,Ce=oe/te.height,me=Math.max(ae,Ce);return te.width*me,te.height*me,re.clearRect(0,0,ne,oe),re.fillStyle="transparent",re.fillRect(0,0,ne,oe),re.drawImage(te,0,0,te.width,te.height,0,0,1,1),he&&se.toBlob(ce=>{const pe=URL.createObjectURL(ce);de.href=pe,de.click(),URL.revokeObjectURL(pe)}),se.toDataURL("image/png")}return""},this._configs={},this._eventTrigger=new A.default,this.navCubeCanvasElement=L.navCubeCanvasElement,this.viewerElement=L.viewerElement,this._multiModel=L.multiModel?L.multiModel:!1,this._hasOutlier=!1,this._outlierObjectIds=[],this._projectId=L.projectId?L.projectId:"",this.viewer=V,(L.skyBoxImage||L.skyBoxSrc)&&(this._skyBoxTool=new H.default(this,{skyBoxImage:L.skyBoxImage,skyBoxSrc:L.skyBoxSrc})),this._modelsExplorer=new v.default(this,{enableEditModels:!1,modelFromOutSide:!0,modelSrc:L.modelSrc?L.modelSrc:"/",modelConfig:L.modelConfig,IfcAPI:L.IfcAPI,WebIFC:L.WebIFC,multiModel:this._multiModel}),this._objectsExplorer=new _.default(this,{modelType:L.modelType}),this._classesExplorer=new b.default(this,{modelType:L.modelType}),this._storeysExplorer=new w.default(this,{modelType:L.modelType}),this._resetAction=new d.default(this,{}),this._fitAction=new u.default(this,{});class X{constructor(oe){this.threeDActive=!1,this.firstPersonActive=!1,this.setThreeDModeActive=he=>{he?(oe._firstPersonMode.setActive(!1),oe.viewer.cameraControl.navMode="orbit"):(oe._firstPersonMode.setActive(!1),oe.viewer.cameraControl.navMode="planView"),this.threeDActive=he},this.setFirstPersonModeActive=he=>{oe.viewer.cameraControl.navMode=he?"firstPerson":this.threeDActive?"orbit":"planView",this.firstPersonActive=he}}}const ee=new X(this);this._threeDMode=new C.default(this,{cameraControlNavModeMediator:ee}),this._orthoMode=new k.default(this,{}),this._firstPersonMode=new l.default(this,{cameraControlNavModeMediator:ee}),this._hideTool=new c.default(this,{}),this._annotationTool=new T.default(this,{modelId:this._projectId}),this._markerTool=new R.default(this,{}),this._measureTool=new U.default(this,{}),this._sectionTool=new p.default(this,{}),this._commentsTool=new G.default(this,{}),this._showSpacesMode=new f.default(this,{}),this._navCubeMode=new m.default(this,{navCubeCanvasElement:this.navCubeCanvasElement,viewerElement:this.viewerElement}),this._bcfTool=new W.default(this,{}),this._threeDMode.setActive(!0),this._firstPersonMode.setActive(!1),this._navCubeMode.setActive(!0),this._annotationTool.setActive(!1),this._markerTool.setActive(!1),this._measureTool.setActive(!1),this._modelsExplorer.on("modelLoaded",ne=>{this.viewer.scene.fire("aabb",this.viewer.scene.aabb),this.fire("modelLoaded",ne)}),this._modelsExplorer.on("modelUnloaded",ne=>{this.eventTrigger.emit("modelUnloaded",ne),this.fire("modelUnloaded",ne)}),this._mutexActivation([this._hideTool,this._sectionTool,this._annotationTool,this._markerTool]),this._initSingleClickEvent(),this._initRightClickEvent(),this._initDoubleClickEvent();let q=0;this.eventTrigger.on("treeReady",()=>{q++,q%3==0&&this.eventTrigger.emit("treeAllReady",{objectsData:this.objectsExplorer.rootNode,classesData:this.classesExplorer.rootNode,storeysData:this.storeysExplorer.rootNode})})}get eventTrigger(){return this._eventTrigger}get multiModel(){return this._multiModel}get localeService(){return this.viewer.localeService}set disableClickEvent(L){this._disableClickEvent=L}get disableClickEvent(){return this._disableClickEvent}get edgesActive(){return this._edgesActive}_initSingleClickEvent(){this.viewer.cameraControl.on("mouseDownEntity",L=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M&&M.entity&&(this.singleChoseEntity(M.entity),this._eventTrigger.emit("pickedEntity",M.entity))}),this.viewer.cameraControl.on("mouseDownNothing",()=>{this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive()||(this.singleChosedSpace(),this._eventTrigger.emit("pickedNothing"))}),this.viewer.cameraControl.on("touchPicked",L=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M&&M.entity&&(this._eventTrigger.emit("touchEntity",M.entity),this.singleChoseEntity(M.entity))}),this.viewer.cameraControl.on("touchPickedNothing",()=>{this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive()||(this._eventTrigger.emit("pickedNothing"),this.singleChosedSpace())})}_initRightClickEvent(){this.viewer.cameraControl.on("rightClick",L=>{L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M?this._eventTrigger.emit("rightPicked",M.entity):this._eventTrigger.emit("rightPickedNothing")})}_initDoubleClickEvent(){this.viewer.cameraControl.on("doublePicked",L=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M&&M.entity&&(this.doubleChoseEntity(M.entity),this._eventTrigger.emit("doublePicked",M.entity))}),this.viewer.cameraControl.on("doublePickedNothing",()=>{this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive()||(this.choseSpace(),this._eventTrigger.emit("doublePickedNothing"))})}_customizeViewer(){const{scene:L}=this.viewer;L.pointsMaterial.pointSize=1,L.pointsMaterial.roundPoints=!0,L.pointsMaterial.perspectivePoints=!0,L.pointsMaterial.minPerspectivePointSize=2,L.pointsMaterial.maxPerspectivePointSize=4,this.viewer.cameraControl.panRightClick=!0,this.viewer.cameraControl.followPointer=!0,this.viewer.cameraControl.doublePickFlyTo=!1,this.viewer.cameraControl.smartPivot=!0,this.viewer.cameraControl.keyboardDollyRate=100,this.viewer.cameraControl.mouseWheelDollyRate=100,this.viewer.cameraControl.dollyInertia=0,this.viewer.cameraControl.dollyMinSpeed=.04,this.viewer.cameraControl.dollyProximityThreshold=30;const M=document.createRange().createContextualFragment("<div class='tctwins-camera-pivot-marker'></div>").firstChild;this.viewer.scene.canvas.canvas.parentNode.appendChild(M),this.viewer.cameraControl.pivotElement=M;const{sao:I}=L;I.enabled=!1,I.numSamples=50,I.kernelRadius=200}_initConfigs(){this.setConfigs({smartPivot:!0,saoEnabled:!0,pbrEnabled:!0,saoBias:"0.5",saoIntensity:"0.15",saoNumSamples:"40",saoKernelRadius:"100",edgesEnabled:!1,xrayContext:!0,xrayPickable:!0,backgroundTransparency:!0,backgroundColor:[1,1,1],objectColorSource:"model",externalMetadata:!1,dtxEnabled:!0,snapRadius:20})}setConfigs(L){for(const M in L)if(Object.prototype.hasOwnProperty.call(L,M)){const I=L[M];this.setConfig(M,I)}}setConfig(L,M){function I(F){return F===!0||F==="true"}try{switch(L){case"backgroundTransparency":const F=M;this.setBackgroundTransparent(F),this._configs[L]=F;break;case"backgroundColor":if(this._configs.backgroundTransparency)break;const V=M;this.setBackgroundColor(V),this._configs[L]=V;break;case"smartPivot":this.viewer.cameraControl.smartPivot=this._configs[L]=I(M);break;case"saoEnabled":this.viewer.scene.saoEnabled=this._configs[L]=I(M);break;case"saoBias":this.viewer.scene.sao.bias=parseFloat(M);break;case"saoIntensity":this.viewer.scene.sao.intensity=parseFloat(M);break;case"saoKernelRadius":this.viewer.scene.sao.kernelRadius=this._configs[L]=parseFloat(M);break;case"saoNumSamples":this.viewer.scene.sao.numSamples=this._configs[L]=parseFloat(M);break;case"saoBlur":this.viewer.scene.sao.blur=this._configs[L]=I(M);break;case"edgesEnabled":this.setEdgesEnabled(M);break;case"pbrEnabled":break;case"viewFitFOV":this.viewer.cameraFlight.fitFOV=this._configs[L]=parseFloat(M);break;case"viewFitDuration":this.viewer.cameraFlight.duration=this._configs[L]=parseFloat(M);break;case"perspectiveFOV":this.viewer.camera.perspective.fov=this._configs[L]=parseFloat(M);break;case"excludeUnclassifiedObjects":this._configs[L]=I(M);break;case"objectColorSource":this.setObjectColorSource(M),this._configs[L]=M;break;case"xrayContext":this._configs[L]=M;break;case"xrayPickable":this._configs[L]=I(M);break;case"externalMetadata":this._configs[L]=M;break;case"showSpaces":this._showSpacesMode.setActive(M);break;case"dtxEnabled":this._configs[L]=I(M),this.viewer.scene.dtxEnabled=M;break;case"snapRadius":this.setSnapRadius(M);break;default:this.error(`setConfig() - unsupported configuration: '${L}'`)}}catch(F){this.error(`setConfig() - failed to configure ${L}: ${F}`)}}getConfig(L){return this._configs[L]}getConfigs(){return this._configs}projectId(){return this._projectId}loadModel(L,M,I=()=>{},F=()=>{},V){this._modelNum+=1,!this._multiModel&&this._modelNum>1&&(this._multiModel=!0),this._multiModel||(this._projectId=L),this._modelsExplorer.loadModel(L,M,I,F,V)}unloadModel(L){if(!this.viewer.scene.models[L]){this.error("unloadModel() - Model not loaded: "+L);return}this._modelsExplorer.unloadModel(L);const M=Object.keys(this.viewer.scene.models);this._modelNum=M.length,M.length>1?(this._multiModel=!0,this._projectId=""):(this._multiModel=!1,this._projectId=M.length===1?M[0]:"")}_resolveModelId(L){if(L!=null&&L!=="")return L;if(this._projectId)return this._projectId;const M=Object.keys(this.viewer.scene.models);if(M.length===1)return M[0]}focusModel(L,M){const I=this._resolveModelId(L);return this.viewer.focusModel(I,M)}loadMetadata(L,M,I=!0,F=()=>{}){this._modelsExplorer.loadMetadata(L,M,I,()=>{this._metaLoaded=!0,this._focusPartial&&this.viewFitPartial(0,F)})}setObjectColorSource(L){switch(L){case"model":break;case"viewer":break;default:L="model",this.error("setObjectColorSource() - Unsupported value - accepted values are 'model' and 'viewer' - defaulting to 'model'");return}this._objectColorSource=L}getObjectProperties(L){const M=this.viewer.metaScene.metaObjects[L];if(!M)return null;const I={id:M.id,name:M.name,type:M.type,propertySets:[]},{propertySets:F}=M;if(F&&F.length>0)for(let V=0;V<F.length;V++){const{properties:D}=F[V],X=[];for(let q=0;q<D.length;q++){const ne={};ne[D[q].name]=D[q].value,X.push(ne)}const ee={id:F[V].id,name:F[V].name,properties:X,type:F[V].type};I.propertySets.push(ee)}return I}getModelInfo(L){const M=this.viewer.metaScene.metaModels[L];return{id:M.id,createDate:M.createdAt?M.createdAt:"",author:M.author?M.author:"",objectCount:M.objectCount?M.objectCount:"",propertySetCount:M.propertySetCount?M.propertySetCount:""}}getMetaModel(L){return this.viewer.metaScene.metaModels[L]}getSceneModel(L){return this.viewer.scene.models[L]}_withObjectsInSubtree(L,M=()=>{}){if(!L){this.error("Argument expected: objectIds");return}L.forEach(I=>{this.viewer.metaScene.withMetaObjectsInSubtree(I,F=>{const V=this.viewer.scene.objects[F.id];V&&M(V)})})}_withObjects(L,M=()=>{}){L.forEach(I=>{const F=this.viewer.scene.objects[I];M(F)})}flyToObject(L,M=()=>{}){if(!L){this.error("flyToObject() - Argument expected: objectId");return}const{viewer:I}=this,{scene:F}=I,V=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(L,X=>{F.objects[X.id]&&V.push(X.id)}),V.length===0){this.error(`Object not found in viewer: '${L}'`),M&&M();return}F.setObjectsVisible(V,!0);const D=F.getAABB(V);I.cameraFlight.flyTo({aabb:D},()=>{M&&M(),setTimeout(()=>{F.setObjectsHighlighted(F.highlightedObjectIds,!1)},500)}),I.cameraControl.pivotPos=x.math.getAABB3Center(D)}viewFitObjects(L,M=()=>{}){if(!L){this.error("viewFitObjects() - Argument expected: objectIds");return}const{viewer:I}=this,{scene:F}=I;F.setObjectsVisible(L,!0);const V=F.getAABB(L);I.cameraFlight.flyTo({aabb:V},()=>{M&&M()}),I.cameraControl.pivotPos=x.math.getAABB3Center(V)}jumpToObjects(L){if(!L){this.error("jumpToObject() - Argument expected: objectIds");return}const{viewer:M}=this,{scene:I}=M,F=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(L,D=>{I.objects[D.id]&&F.push(D.id)}),F.length===0){this.error(`Objects not found in viewer: '${L}'`);return}I.setObjectsVisible(F,!0);const V=I.getAABB(F);M.cameraFlight.jumpTo({aabb:V}),M.cameraControl.pivotPos=x.math.getAABB3Center(V)}setCamera(L){const{viewer:M}=this,{scene:I}=M,{camera:F}=I;L.eye&&(F.eye=L.eye),L.look&&(F.look=L.look),L.up&&(F.up=L.up)}getCameraView(){return{eye:this.viewer.scene.camera.eye,look:this.viewer.scene.camera.look,up:this.viewer.scene.camera.up}}flyToNewView(L){this.viewer.cameraControl.pivotPos=L.look,this.viewer.cameraFlight.flyTo({look:L.look,eye:L.eye,up:L.up,duration:L.duration})}flyToObjectFromDirection(L,M,I,F=()=>{}){const V=this.viewer.scene.objects[L];if(!V){this.error(`flyToObjectFromDirection() - Object not found in viewer: '${L}'`),F&&F();return}const D=this._resolveViewDirection(M);if(!D){this.error(`flyToObjectFromDirection() - Invalid direction: '${M}'`),F&&F();return}const X=x.math.getAABB3Center(V.aabb,[]),ee=[X[0]+D[0]*I,X[1]+D[1]*I,X[2]+D[2]*I],q=Math.abs(D[1])>.9?[0,0,1]:[0,1,0];this.viewer.cameraFlight.flyTo({eye:ee,look:X,up:q},()=>{F&&F()}),this.viewer.cameraControl.pivotPos=X}_resolveViewDirection(L){const M={front:[0,0,1],back:[0,0,-1],left:[-1,0,0],right:[1,0,0],top:[0,1,0],bottom:[0,-1,0]};let I;if(typeof L=="string"){if(I=M[L.toLowerCase()],!I)return null}else if(Array.isArray(L)&&L.length>=3)I=[L[0],L[1],L[2]];else return null;const F=Math.sqrt(I[0]*I[0]+I[1]*I[1]+I[2]*I[2]);return F===0?null:[I[0]/F,I[1]/F,I[2]/F]}viewFitModels(L,M=()=>{}){if(!L){this.error("viewFitModels() - Argument expected: modelIds");return}const{viewer:I}=this,{scene:F}=I,V=x.math.AABB3();x.math.collapseAABB3(V),L.forEach(D=>{const X=F.models[D];X?(X.visible=!0,X.highlighted=!0,x.math.expandAABB3(V,X.aabb)):this.error(`Model not found in viewer: '${D}'`)}),M?I.cameraFlight.flyTo({aabb:V},()=>{M(),setTimeout(()=>{F.setObjectsHighlighted(F.highlightedObjectIds,!1)},500)}):(I.cameraFlight.jumpTo({aabb:V}),setTimeout(()=>{F.setObjectsHighlighted(F.highlightedObjectIds,!1)},500)),I.cameraControl.pivotPos=x.math.getAABB3Center(V)}viewFitPartial(L,M){let I;typeof L=="function"?(M=L,I=this._partialFocusIndex+=1):I=L??(this._partialFocusIndex+=1),I>=0&&I<this._partialObjectIds.length?this.viewFitObjects(this._partialObjectIds[I],()=>{for(let F=0;F<this._partialObjectIds.length;F++)I==F?this.setObjectsVisible(this._partialObjectIds[F],!0):this.setObjectsVisible(this._partialObjectIds[F],!1);M&&M(I)}):(I=this._partialFocusIndex=0,this.viewFitObjects(this._partialObjectIds[I],()=>{for(let F=0;F<this._partialObjectIds.length;F++)I==F?this.setObjectsVisible(this._partialObjectIds[F],!0):this.setObjectsVisible(this._partialObjectIds[F],!1);M&&M(I)}))}setPartialObjectIds(L){const M=[];for(let I=0;I<L.length;I++)M.push(L[I]);this._partialObjectIds=M,this.viewer.cameraControl.smartPivot=!1,this.navCubeMode.fitVisible=!0,this._focusPartial=!0,this._metaLoaded&&this.viewFitPartial(0)}selectStorey(L,M=()=>{}){const{metaScene:I}=this.viewer,F=I.metaObjects[L];if(!F){this.error(`selectStorey() - Object is not found: '${L}'`);return}if(F.type!=="IfcBuildingStorey"){this.error(`selectStorey() - Object is not an IfcBuildingStorey: '${L}'`);return}this._storeysExplorer.selectStorey(L,M)}setKeyboardEnabled(L){this.viewer.scene.input.keyboardEnabled=L}getKeyboardEnabled(){return this.viewer.scene.input.keyboardEnabled}showSpinner(L=!this.viewer.scene.canvas.spinner.visible){this.viewer.scene.canvas.spinner.visible=L}updateAABB(L,M=()=>{}){L.length>0&&(this._hasOutlier=!0,this._outlierObjectIds=L);const I=this._resolveModelId(),F=I!==void 0?this.viewer.scene.models[I]:void 0;if(!F){this.error("updateAABB() - No model available for the current scene"),typeof M=="function"&&M();return}const V=L.concat(F.exceptionIds);F.exceptionIds=V,this.viewer.scene.setObjectsVisible(V,!1),this.viewer.scene.on("aabb",()=>{typeof M=="function"&&M()})}closeAll(){this.fire("closeAll",!0),this.disableClickEvent=!1}destroy(L=()=>{}){var M;this.measureDistanceTool.destroy(),this.measureAngleTool.destroy(),this._annotationTool.destroy(),this._markerTool.destroy(),this._commentsTool.destroy(),this._skyBoxTool&&this._skyBoxTool.destroy(),this._modelsExplorer.destroy(),this._classesExplorer.destroy(),this._objectsExplorer.destroy(),this._storeysExplorer.destroy(),this._eventTrigger.destroy();const I=document.querySelector(".tctwins-camera-pivot-marker");I&&((M=I.parentNode)===null||M===void 0||M.removeChild(I)),this.viewer.destroy(L)}getEntityById(L){return this.viewer.scene.objects[L]}setEntitySelected(L,M=!L.selected){L.selected=M}setObjectsSelected(L,M){this._withObjects(L,I=>{I.selected=M})}setOthersSelected(L){this.setAllObjectsSelected(!0),this.setEntitySelected(L,!0)}setAllObjectsSelected(L){L?this.viewer.scene.setObjectsSelected(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsSelected(this.viewer.scene.selectedObjectIds,!1)}viewFitEntity(L){this.viewer.cameraFlight.flyTo({aabb:L.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=x.math.getAABB3Center(L.aabb)}viewFitEntityById(L){this._withObjects([L],M=>{this.viewer.cameraFlight.flyTo({aabb:M.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=x.math.getAABB3Center(M.aabb)})}viewFitSelectedObjects(){this.viewFitObjects(this.viewer.scene.highlightedObjectIds,()=>{})}viewFitAll(L=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,L);return}this._fitAction.fit(L)}setEntityVisible(L,M=!L.visible){L.visible=M}setObjectsVisible(L,M){this._withObjects(L,I=>{I.visible=M})}setOthersHide(L){const M=this.viewer.metaScene.metaObjects[L.id];M&&(this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds,!1),M.withMetaObjectsInSubtree(I=>{const F=this.viewer.scene.objects[I.id];F&&(F.visible=!0)}))}setAllObjectsVisible(L){L?(this.viewer.scene.setObjectsVisible(this.viewer.scene.objectIds,!0),this._hasOutlier&&this.viewer.scene.setObjectsVisible(this._outlierObjectIds,!1)):this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds,!1)}setEntityXRayed(L,M=!L.xrayed){L.xrayed=M}setObjectsXRayed(L,M){this._withObjects(L,I=>{I.xrayed=M})}setOthersXRayed(L){const{scene:M}=this.viewer,I=this.viewer.metaScene.metaObjects[L.id];I&&(M.setObjectsVisible(M.objectIds,!0),M.setObjectsXRayed(M.objectIds,!0),I.withMetaObjectsInSubtree(F=>{const V=M.objects[F.id];V&&(V.xrayed=!1)}))}setAllObjectsXRayed(L){L?this.viewer.scene.setObjectsXRayed(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsXRayed(this.viewer.scene.xrayedObjectIds,!1)}setEntityHighlighted(L,M=!L.highlighted){L.highlighted=M,L.origin_opacity!=-1&&(L.highlighted?L.opacity=L.opacity<1?L.opacity:.01:L.opacity=L.origin_opacity)}setAllObjectsHighlighted(L){L?(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.objectIds,!0),this.viewer.scene.withObjects(this.viewer.scene.objectIds,M=>{M.origin_opacity,M.opacity=M.opacity<.5?M.opacity:.01})):(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.highlightedObjectIds,!1),this.viewer.scene.withObjects(this.viewer.scene.objectIds,M=>{M.opacity=M.origin_opacity}))}setEntityEdges(L,M=!L.edges){L.edges=M}setObjectsEdges(L,M){this.viewer.scene.withObjects(L,I=>{I.edges=M}),this.viewer.scene.render(!0)}setAllObjectsEdges(L=!this._edgesActive){this._edgesActive=L,this.viewer.scene.withObjects(this.viewer.scene.objectIds,M=>{M.edges=L}),this.viewer.scene.render(!0)}setEntityColor(L,M){this.viewer.scene.setObjectsColorized([L],M),this.viewer.scene.render(!0)}setObjectsColor(L,M){this.viewer.scene.setObjectsColorized(L,M),this.viewer.scene.render(!0)}resetEntityColor(L){this.viewer.scene.setObjectsColorized([L],null)}entityVisble(L){return L.visible}entityXRayed(L){return L.xrayed}entityChosed(L){return L.selected}hiddenMoreThanOne(){return this.viewer.scene.numObjects-this.viewer.scene.numVisibleObjects>0}xRayedMoreThanOne(){return this.viewer.scene.numXRayedObjects>0}SelectedMoreThanOne(){return this.viewer.scene.numSelectedObjects>0}setBackgroundTransparent(L=!this.viewer.scene.backgroundTransparent){this.viewer.scene.backgroundTransparent=L,this.viewer.scene.render(!0)}setBackgroundColor(L){this.viewer.scene.backgroundColor=L,this.viewer.scene.render(!0)}setNavCubeSize(L){this.navCubeCanvasElement.style.width=`${L.toString()}px`,this.navCubeCanvasElement.style.height=`${L.toString()}px`}setNavCubePosition(L,M){switch(L){case"top":this.navCubeCanvasElement.style.top=`${M.toString()}px`,this.navCubeCanvasElement.style.bottom="";break;case"bottom":this.navCubeCanvasElement.style.top="",this.navCubeCanvasElement.style.bottom=`${M.toString()}px`;break;case"right":this.navCubeCanvasElement.style.left="",this.navCubeCanvasElement.style.right=`${M.toString()}px`;break;case"left":this.navCubeCanvasElement.style.right="",this.navCubeCanvasElement.style.left=`${M.toString()}px`;break}}updateCanvas(){this.viewer.scene.canvas.dirtyBoundary=!0}setMeasureOffSet(L,M){this._measureTool.setMeasureOffSet(L,M)}setCommentsOffset(L,M){this._commentsTool.offsetX=L,this._commentsTool.offsetY=M}setSnapRadius(L){this.measureTool.setSnapRadius(L)}setIsTouch(L){this.measureTool.isTouch=L,this.sectionTool.isTouch=L,this.commentTool.isTouch=L}setLightIntensity(L){if(!(L<0||L>100))for(const M in this.viewer.scene.lightsObject)this.viewer.scene.lightsObject[M].intensity=.6+(L-50)/200}setSpaceMaterialColor(L){L===1?this.viewer.scene.highlightMaterial.fillColor=[.6,.7,.8]:L===2&&(this.viewer.scene.highlightMaterial.fillColor=[.2,.3,.4])}setWorldAxisYDown(L){this._worldAxisYDown=L,L?this.viewer.scene.camera.worldAxis=[1,0,0,0,-1,0,0,0,1]:this.viewer.scene.camera.worldAxis=[1,0,0,0,1,0,0,0,1],this.resetView()}setWorldAxisZUp(L){this._worldAxisZUp=L,L?this.viewer.scene.camera.worldAxis=[1,0,0,0,0,1,0,1,0]:this.viewer.scene.camera.worldAxis=[1,0,0,0,1,0,0,0,1],this.resetView()}setEdgesEnabled(L=!this.viewer.scene.edgesEnabled){this.viewer.scene.edgesEnabled=L,this.viewer.scene.render(!0)}setSAOEnabled(L=!this.viewer.scene.saoEnabled){this.viewer.scene.saoEnabled=L}setDTXEnabled(L=!this.viewer.scene.dtxEnabled){this.viewer.scene.dtxEnabled=L}setPBREnabled(L=!this.viewer.scene.pbrEnabled){this.viewer.scene.pbrEnabled=L}resetView(L=()=>{}){if(this._focusPartial||this._worldAxisYDown){this.setDirection(25);return}this._resetAction.reset(L)}fitView(L=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,L);return}this._fitAction.fit()}SetAnnotationToolActive(L=!this._annotationTool.getActive(),M=()=>{}){this._annotationTool.setActive(L),M&&M(this._annotationTool.getActive())}SetMarkerToolActive(L=!this._markerTool.getActive(),M=()=>{}){this._markerTool.setActive(L),M&&M(this._markerTool.getActive())}SetCommentsToolActive(L=!this._commentsTool.getActive(),M=()=>{}){this._commentsTool.setActive(L),M&&M(this._commentsTool.getActive())}SetFirstPersonModeActive(L=!this._firstPersonMode.getActive(),M=()=>{}){this._firstPersonMode.setActive(L),M&&M(this._firstPersonMode.getActive())}SetMeasureToolActive(L=!this.measureAngleTool.getActive(),M=()=>{}){this._measureTool.setActive(L),M&&M(this._measureTool.getActive())}SetMeasureAngleActive(L=!this.measureAngleTool.getActive(),M=()=>{}){this._measureTool.SetMeasureAngleActive(L,M)}SetMeasureDistanceActive(L=!this.measureDistanceTool.getActive(),M=()=>{}){this._measureTool.SetMeasureDistanceActive(L,M)}SetSectionToolActive(L=!this._sectionTool.getActive(),M=()=>{}){this._sectionTool.setActive(L),M(this._sectionTool.getActive())}SetHideToolActive(L,M=()=>{}){this._hideTool.setActive(L),M&&M()}SetOrthoModeActive(L=!this._orthoMode.getActive(),M=()=>{}){this._orthoMode.setActive(L,M)}SetThreeDModeActive(L=!this._threeDMode.getActive(),M=()=>{}){this._threeDMode.setActive(L,M)}SetShowSpaceModeActive(L=!this._showSpacesMode.getActive(),M=()=>{}){this._showSpacesMode.setActive(L,M)}SetSkyBoxToolActive(L,M=()=>{}){this._skyBoxTool&&(L==null?this._skyBoxTool.setActive(!this._skyBoxTool.getActive()):this._skyBoxTool.setActive(L),M&&M(this._skyBoxTool.getActive()))}SetBCFToolActive(L=!this._bcfTool.getActive(),M=()=>{}){this._bcfTool.setActive(L),M(this._bcfTool.getActive())}get firstPersonMode(){return this._firstPersonMode}get measureTool(){return this._measureTool}get measureAngleTool(){return this._measureTool.measureAngleTool}get measureDistanceTool(){return this._measureTool.measureDistanceTool}get sectionTool(){return this._sectionTool}get commentTool(){return this._commentsTool}get annotationTool(){return this._annotationTool}get markerTool(){return this._markerTool}get objectsExplorer(){return this._objectsExplorer}get classesExplorer(){return this._classesExplorer}get storeysExplorer(){return this._storeysExplorer}get modelsExplorer(){return this._modelsExplorer}get orthoMode(){return this._orthoMode}get threeDMode(){return this._threeDMode}get navCubeMode(){return this._navCubeMode}get skyBoxTool(){return this._skyBoxTool}get bcfTool(){return this._bcfTool}setDirection(L){this._navCubeMode.flyByClick(L)}singleChoseEntity(L){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.setEntitySelected(L))}singleChosedSpace(){this._disableClickEvent||this.setAllObjectsSelected(!1)}doubleChoseEntity(L){this._disableClickEvent||(this.viewFitEntity(L),this.setAllObjectsSelected(!1),this.setEntitySelected(L))}choseSpace(){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.viewFitAll())}getPreShot(L,M){const{cameraEnable:I}=this;I(!1);const F=typeof L=="function"?1024:L;typeof L=="function"&&(M=L);const{orbitYawCamera:V}=this,{viewer:D}=this,{canvas:X}=D.scene.canvas,ee=this._projectId,q=document.createElement("canvas"),ne=q.getContext("2d"),oe=F*15,he=F;q.width=oe,q.height=he;const te=Array.from({length:15},()=>de);function de(){return K(this,void 0,void 0,function*(){return yield V(-18),yield se(100),re(F)})}function se(Ce){return new Promise(me=>setTimeout(me,Ce))}function re(Ce){return K(this,void 0,void 0,function*(){const me=document.createElement("canvas"),ce=me.getContext("2d");if(X&&ce){me.width=Ce,me.height=Ce;const pe=Ce/X.width,B=Ce/X.height,ke=Math.max(pe,B),Ee=X.width*ke,ge=X.height*ke,Ae=(Ce-Ee)/2,fe=(Ce-ge)/2;return ce.clearRect(0,0,Ce,Ce),ce.fillStyle="transparent",ce.fillRect(0,0,Ce,Ce),ce.drawImage(X,0,0,X.width,X.height,Ae,fe,Ee,ge),new Promise((ue,_e)=>{const be=new Image;be.onload=()=>ue(be),be.onerror=_e,be.src=me.toDataURL()})}return Promise.reject(new Error("Canvas or context not found."))})}function ae(Ce){const me=q.toDataURL("image/png");{console.log(Ce);const ce=document.createElement("a");ce.href=me,ce.download="combined_image.png",ce.click()}return I(!0),M&&M({modelId:ee,imageData:me}),me}return K(this,void 0,void 0,function*(){for(let Ce=0;Ce<te.length;Ce++)try{const me=yield te[Ce]();ne&&ne.drawImage(me,Ce*F,0)}catch(me){I(!0),console.error("获取图片内容失败:",me)}ae(!0)}),""}setShelterCanvas(L=()=>{}){const{canvas:M}=this.viewer.scene.canvas,I=this.shot(M.width,M.height,!1),F=document.createElement("img");F.src=I,F.style.position="absolute",F.style.top="0px",F.style.left="0px",F.style.right="0px",F.style.bottom="0px",M.parentNode.appendChild(F),typeof L=="function"&&L(F)}}},"./src/Controller.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/TMap.ts");class S{constructor(h,d={},u=null,l=null){this._children=[],this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._enabled=null,this._active=null,this.destroyed=!1,this.bimViewer=h?h.bimViewer||h:this,this.server=h?h.server:u,this.viewer=h?h.viewer:l,h&&h._children.push(this)}fire(h,d,u=!1){this._events||(this._events={}),this._eventSubs||(this._eventSubs={}),u!==!0&&(this._events[h]=d||!0);const l=this._eventSubs[h];let c;l&&Object.keys(l).forEach(f=>{Object.prototype.hasOwnProperty.call(l,f)&&(c=l[f],this._eventCallDepth+=1,this._eventCallDepth<300?c.callback.call(c.scope,d):this.error(`fire: potential stack overflow from recursive event ${h} - dropping this event`),this._eventCallDepth-=1)})}on(h,d,u=this){this._events||(this._events={}),this._subIdMap||(this._subIdMap=new x.default),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={});let l=this._eventSubs[h];l||(l={},this._eventSubs[h]=l);const c=this._subIdMap.addItem();l[c]={callback:d,scope:u||this},this._subIdEvents[c]=h;const f=this._events[h];return f!==void 0&&d.call(u||this,f),c}off(h){if(h==null||!this._subIdEvents)return;const d=this._subIdEvents[h];if(d){delete this._subIdEvents[h];const u=this._eventSubs[d];u&&delete u[h],this._subIdMap.removeItem(h)}}once(h,d,u=this){const l=this,c=this.on(h,f=>{l.off(c),d.call(u||this,f)},u)}log(h){h=`[LOG] ${h}`,console.log(h)}warn(h){h=`[LOG] ${h}`,window.console.warn(h)}error(h){h=`[LOG] ${h}`,window.console.error(h)}_mutexActivation(h){h.forEach((d,u)=>{d.on("active",l=>{l&&h.forEach((c,f)=>{f!==u&&c.setActive(!1)})})})}setEnabled(h){this._enabled!==h&&(this._enabled=h,this.fire("enabled",this._enabled))}getEnabled(){return this._enabled}setActive(h){this._active!==h&&(this._active=h,this.fire("active",this._active))}getActive(){return this._active}destroy(){this.destroyed||(this.fire("destroyed",this.destroyed=!0),this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._children.forEach(h=>{h.destroy()}),this._children=[])}}},"./src/EventTrigger.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>x});class x{constructor(){this.events={}}on(A,h){this.events[A]||(this.events[A]=[]),this.events[A].push(h)}off(A,h){this.events[A]&&(this.events[A]=this.events[A].filter(d=>d!==h))}emit(A,...h){this.events[A]&&this.events[A].forEach(d=>{d(...h)})}destroy(){this.events={}}}},"./src/TMap.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>x});class x{constructor(A=[],h=0){this.items=[],this._lastUniqueId=0,this.items=A||[],this._lastUniqueId=(h||0)+1}addItem(...A){let h;if(A.length===2){const d=A[0];if(h=A[1],this.items[d])throw new Error(`ID clash: '${d}'`);return this.items[d]=h,d}for(h=A[0]||{};;){this._lastUniqueId+=1;const d=this._lastUniqueId;if(!this.items[d])return this.items[d]=h,d}}removeItem(A){const h=this.items[A];return delete this.items[A],h}}},"./src/explorer/ClassesExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u={}){super(d),this.eventTrigger=d.eventTrigger;const{modelType:l}=u;this._treeView=new x.TreeViewPlugin(this.viewer,{hierarchy:"types",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",c=>{this._rootNode=c,this.eventTrigger.emit("classes_rootNodes",c)}),this._treeView.on("nodeNodes_Created",c=>{this._nodeList=c,this.eventTrigger.emit("classes_nodeNodes",c)}),this._treeView.on("objectNodes_Created",c=>{this._objectList=c,this.eventTrigger.emit("classes_objectNodes",c)}),this._treeView.on("checkBoxChanged",c=>{this.eventTrigger.emit("classes_checkBoxChanged",c)}),l==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",c=>{this._treeView.addModel(c,{rootName:c})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",c=>{c.result==="success"&&(this._treeView.addModel(c.metaModel.id,{rootName:c.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",c=>{this.viewer.metaScene.metaModels[c]&&this._treeView.removeModel(c)})}get rootNode(){return this._rootNode}get nodesList(){return this._nodeList}get objectList(){return this._objectList}getNodeIdByObjectId(d){return this._objectList[d]!=null?this._objectList[d].nodeId:null}getNodeById(d){return this._treeView.getNodeById(d)}getChildrenById(d){this._treeView.getChildrenById(d)}checkboxChangeHandler(d,u){const l=this._nodeList[d],c=u,{objects:f}=this.viewer.scene;let p=0;this._treeView.withNodeTree(l,v=>{const{objectId:_}=v,b=f[_],w=v.children.length===0;v.numVisibleEntities=c?v.numEntities:0,w&&c!==v.checked&&p++,v.checked=c,b&&(b.visible=c)});let{parent:m}=l;for(;m;)m.checked=c,c?m.numVisibleEntities+=p:m.numVisibleEntities-=p,m=m.parent}nodeTitleClicked(d){const{scene:u}=this.viewer,l=this._nodeList[d],c=[];this._treeView.withNodeTree(l,p=>{p.objectId&&c.push(p.objectId)});const{checked:f}=l;f?(u.setObjectsXRayed(c,!1),u.setObjectsVisible(c,!1),u.setObjectsPickable(c,!0)):(u.setObjectsXRayed(c,!1),u.setObjectsVisible(c,!0),u.setObjectsPickable(c,!0))}setEnabled(d){}expandTreeViewToDepth(d){}showNodeInTreeView(d){this._treeView.showNode(d)}unShowNodeInTreeView(){this._treeView.unShowNode()}destroy(){super.destroy(),this._treeView.destroy(),this.viewer.scene.off(this._onModelLoaded),this.viewer.scene.off(this._onModelUnloaded),this.viewer.scene.off(this._onMetaDataLoaded)}get treeView(){return this._treeView}}},"./src/explorer/ModelsExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>f});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");let A;const h=["position","scale","rotation","matrix","origin"],d=x.math;function u(p,m,v,_){const b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]),w=Math.sqrt(p[4]*p[4]+p[5]*p[5]+p[6]*p[6]),C=Math.sqrt(p[8]*p[8]+p[9]*p[9]+p[10]*p[10]);m[0]=p[12],m[1]=p[13],m[2]=p[14];const k=new Array(16);for(let T=0;T<16;T++)k[T]=p[T];b>1e-6&&(k[0]/=b,k[1]/=b,k[2]/=b),w>1e-6&&(k[4]/=w,k[5]/=w,k[6]/=w),C>1e-6&&(k[8]/=C,k[9]/=C,k[10]/=C),d.mat4ToQuaternion(k,v),_[0]=b,_[1]=w,_[2]=C}function l(p){const m=[0,0,0];return d.quaternionToEuler(p,"XYZ",m),m}class c{constructor(m,v){this._projectId="",this._modelId="",this._server=m,A=v.tempVec3a}setProjectId(m){this._projectId=m}setModelId(m){this._modelId=m}getManifest(m,v,_){this._server.getSplitModelManifest(this._projectId,this._modelId,m,v,_)}getMetaModel(m,v,_){this._server.getSplitModelMetadata(this._projectId,this._modelId,m,v,_)}getXTC(m,v,_){this._server.getSplitModelGeometry(this._projectId,this._modelId,m,v,_)}}class f extends S.default{constructor(m,v){super(m,v),this._modelFromOutSide=v.modelFromOutSide,this._projectId=v.projectId,this._modelType=v.modelType,this._modelSrc=v.modelSrc,this._eventTrigger=m.eventTrigger,this._dataSource=new c(this.server,{tempVec3a:v.tempVec3a}),this._modelConfig=v.modelConfig,this._modelsInfo={},this._numModels=0,this._numModelsLoaded=0}getModelIds(){return Object.keys(this._modelsInfo)}getModelInfo(m){return this._modelsInfo[m]}loadModel(m,v,_=()=>{},b=()=>{},w){if(this._modelType=w.modelType,this._modelType=="ifc"){const k=w.IfcAPI!==void 0&&w.IfcAPI!==null,T=w.WebIFC!==void 0&&w.WebIFC!==null;k&&T&&this.log("载入外部传入webifc..."),this._ifcLoader=k&&T?new x.WebIFCLoaderPlugin(this.viewer,{WebIFC:w.WebIFC,IfcAPI:w.IfcAPI}):new x.WebIFCLoaderPlugin(this.viewer,{}),this._modelsInfo[m]={id:m,ifc:v,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}}else this._modelType=="xtc"?(this._xtcLoader=new x.XTCLoaderPlugin(this.viewer,{dataSource:this._dataSource}),this._xtcLoader.on("metaLoaded",k=>{this._eventTrigger.emit("metaLoaded",k)}),this._xtcLoader.on("metaLoading",k=>{this._eventTrigger.emit("metaLoading",k)}),this._modelsInfo[m]={id:m,xtc:v,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}):this._modelType=="glb"&&(this._glbLoader=new x.GLTFLoaderPlugin(this.viewer),this._modelsInfo[m]={id:m,gltf:v,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0});const C=this._modelsInfo[m];for(const k of h)w&&w[k]!==void 0&&w[k]!==null&&(C[k]=w[k]);w&&w.alignTo!==void 0&&w.alignTo!==null&&(C.alignTo=w.alignTo),this._loadGeometry(m,_,b)}unloadModel(m){const v=this.viewer.scene.models[m];if(!v){this.error("Model not loaded: "+m);return}v.destroy(),delete this._modelsInfo[m],this.fire("modelUnloaded",m)}loadMetadata(m,v,_,b){const w=this.viewer.metaScene.metaModels[m];if(!w){this.warn("loadMetadata() - MetaModel not found: "+m),b&&b();return}this._xtcLoader&&(this._modelsInfo[m]&&(this._modelsInfo[m].metaBuffer=v),this._xtcLoader.loadMetadata(w,v,_,b))}_loadGeometry(m,v,_){const b=this._modelsInfo[m],w=Object.assign({},b),C=this._resolveModelTransform(b);for(const R of h)delete w[R];delete w.alignTo;for(const R of Object.keys(C))w[R]=C[R];const k=()=>{this._jumpToInitialCamera(),this.fire("modelLoaded",m),v&&v()},T=R=>{this.error(R),_&&_(R)};if(this._modelType=="ifc"&&this._ifcLoader)if(this._modelFromOutSide){this.log("正在载入ifc模型...");const R=this._ifcLoader.load(w);R.on("loaded",k),R.on("error",T)}else{this.log("正在载入引擎从本地获取的ifc模型...");const R={id:m,src:this._modelSrc,edges:w.edges,loadMetadata:!1,pbrEnabled:w.pbrEnabled,dtxEnabled:w.dtxEnabled};for(const G of h)w[G]!==void 0&&w[G]!==null&&(R[G]=w[G]);const U=this._ifcLoader.load(R);U.on("loaded",k),U.on("error",T)}else if(this._modelType==="xtc"&&this._xtcLoader){if(this._modelFromOutSide){this.log("正在载入xtc模型...");const R=this._xtcLoader.load(w);R.on("loaded",k),R.on("error",T)}}else if(this._modelType==="glb"&&this._glbLoader&&this._modelFromOutSide){this.log("正在载入glb模型...");const R=this._glbLoader.load(w);R.on("loaded",k),R.on("error",T)}}_resolveModelTransform(m){const v={};let _=null,b=null,w=null,C=null;if(m.matrix){const k=[0,0,0],T=[0,0,0,1],R=[1,1,1];u(m.matrix,k,T,R),_=k,b=l(T),w=R}else m.position&&(_=Array.from(m.position)),m.quaternion?b=l(m.quaternion):m.rotation&&(b=Array.from(m.rotation)),m.scale&&(w=Array.from(m.scale));if(m.origin&&(C=Array.from(m.origin)),m.alignTo){const k=this.viewer.scene.models[m.alignTo];k?(C===null&&(C=Array.from(k.origin)),_===null&&(_=Array.from(k.position)),b===null&&(b=Array.from(k.rotation)),w===null&&(w=Array.from(k.scale))):this.warn(`alignTo: 基准模型 "${m.alignTo}" 尚未加载,将按自身坐标加载`)}return _&&(v.position=_),b&&(v.rotation=b),w&&(v.scale=w),C&&(v.origin=C),v}_jumpToInitialCamera(){const{viewer:m}=this,{scene:v}=m,_=v.getAABB(v.visibleObjectIds),b=x.math.getAABB3Diag(_),w=x.math.getAABB3Center(_,A),{camera:C}=v,k=Math.abs(b/Math.tan(45*x.math.DEGTORAD)),T=x.math.normalizeVec3(C.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),R=x.math.normalizeVec3(C.yUp?[-.5,.7071,-.5]:[-1,1,1]);m.cameraControl.pivotPos=w,m.cameraControl.planView&&(m.cameraControl.planView=!1),m.cameraFlight.jumpTo({look:w,eye:[w[0]-k*T[0],w[1]-k*T[1],w[2]-k*T[2]],up:R,orthoScale:b*1.1})}destroy(){super.destroy(),this._xtcLoader&&this._xtcLoader.destroy(),this._ifcLoader&&this._ifcLoader.destroy(),this._glbLoader&&this._glbLoader.destroy()}}},"./src/explorer/ObjectsExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u={}){super(d);const{modelType:l}=u;this.eventTrigger=d.eventTrigger,this._treeView=new x.TreeViewPlugin(this.viewer,{hierarchy:"containment",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",c=>{this._rootNode=c,this.eventTrigger.emit("object_rootNodes",c)}),this._treeView.on("nodeNodes_Created",c=>{this._nodeList=c,this.eventTrigger.emit("object_nodeNodes",c)}),this._treeView.on("objectNodes_Created",c=>{this._objectList=c,this.eventTrigger.emit("object_objectNodes",c)}),this._treeView.on("checkBoxChanged",c=>{this.eventTrigger.emit("object_checkBoxChanged",c)}),l==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",c=>{this._treeView.addModel(c,{rootName:c})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",c=>{c.result==="success"&&(this._treeView.addModel(c.metaModel.id,{rootName:c.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",c=>{this.viewer.metaScene.metaModels[c]&&this._treeView.removeModel(c)})}get rootNode(){return this._rootNode}get nodesList(){return this._nodeList}get objectList(){return this._objectList}get treeView(){return this._treeView}getNodeIdByObjectId(d){if(this._objectList[d]!=null)this._objectList[d].nodeId;else return null}getNodeById(d){return this._treeView.getNodeById(d)}getChildrenById(d){this._treeView.getChildrenById(d)}setEnabled(d){}destroy(){super.destroy(),this._treeView.destroy(),this.viewer.scene.off(this._onModelLoaded),this.viewer.scene.off(this._onModelUnloaded),this.viewer.scene.off(this._onMetaDataLoaded)}}},"./src/explorer/StoreysExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A=x.math.vec3();class h extends S.default{constructor(u,l={}){super(u);const{modelType:c}=l;this.eventTrigger=u.eventTrigger,this._treeView=new x.TreeViewPlugin(this.viewer,{hierarchy:"storeys",autoAddModels:!1,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",f=>{this._rootNode=f,this.eventTrigger.emit("storeys_rootNodes",f)}),this._treeView.on("nodeNodes_Created",f=>{this._nodeList=f,this.eventTrigger.emit("storeys_nodeNodes",f)}),this._treeView.on("objectNodes_Created",f=>{this._objectList=f,this.eventTrigger.emit("storeys_objectNodes",f)}),this._treeView.on("checkBoxChanged",f=>{this.eventTrigger.emit("storeys_checkBoxChanged",f)}),c==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",f=>{this._treeView.addModel(f,{rootName:f})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",f=>{f.result==="success"&&(this._treeView.addModel(f.metaModel.id,{rootName:f.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",f=>{this.viewer.metaScene.metaModels[f]&&this._treeView.removeModel(f)})}get rootNode(){return this._rootNode}get nodesList(){return this._nodeList}get objectList(){return this._objectList}getNodeIdByObjectId(u){if(this._objectList[u]!=null)this._objectList[u].nodeId;else return null}getNodeById(u){return this._treeView.getNodeById(u)}getChildrenById(u){this._treeView.getChildrenById(u)}checkboxChangeHandler(u,l){const c=this._nodeList[u],f=l,{objects:p}=this.viewer.scene;let m=0;this._treeView.withNodeTree(c,_=>{const{objectId:b}=_,w=p[b],C=_.children.length===0;_.numVisibleEntities=f?_.numEntities:0,C&&f!==_.checked&&m++,_.checked=f,w&&(w.visible=f)});let{parent:v}=c;for(;v;)v.checked=f,f?v.numVisibleEntities+=m:v.numVisibleEntities-=m,v=v.parent}nodeTitleClicked(u){const{scene:l}=this.viewer,c=this._nodeList[u],f=[];this._treeView.withNodeTree(c,m=>{m.objectId&&f.push(m.objectId)});const{checked:p}=c;p?(l.setObjectsXRayed(f,!1),l.setObjectsVisible(f,!1),l.setObjectsPickable(f,!0)):(l.setObjectsXRayed(f,!1),l.setObjectsVisible(f,!0),l.setObjectsPickable(f,!0))}setEnabled(u){}_selectObjects(u,l){const{scene:c}=this.viewer,f=c.getAABB(u);this.viewer.cameraControl.pivotPos=x.math.getAABB3Center(f,A),l?(c.setObjectsXRayed(c.objectIds,!0),c.setObjectsVisible(c.objectIds,!0),c.setObjectsPickable(c.objectIds,!1),c.setObjectsSelected(c.selectedObjectIds,!1),c.setObjectsXRayed(u,!1),c.setObjectsVisible(u,!0),c.setObjectsPickable(u,!0),this.viewer.cameraFlight.flyTo({aabb:f},()=>{setTimeout(()=>{c.setObjectsVisible(c.xrayedObjectIds,!1),c.setObjectsXRayed(c.xrayedObjectIds,!1)},500),l()})):(c.setObjectsVisible(c.objectIds,!1),c.setObjectsPickable(c.xrayedObjectIds,!0),c.setObjectsXRayed(c.xrayedObjectIds,!1),c.setObjectsSelected(c.selectedObjectIds,!1),c.setObjectsVisible(u,!0),this.viewer.cameraFlight.jumpTo({aabb:f}))}destroy(){super.destroy(),this._treeView.destroy(),this.viewer.scene.off(this._onModelLoaded),this.viewer.scene.off(this._onModelUnloaded),this.viewer.scene.off(this._onMetaDataLoaded)}expandTreeViewToDepth(u){}showNodeInTreeView(u){this._treeView.showNode(u)}unShowNodeInTreeView(){this._treeView.unShowNode()}selectStorey(u,l){const{metaScene:c}=this.viewer,f=c.metaObjects[u];if(!f){this.error(`selectStorey() - object is not found: ${u}`);return}if(f.type!=="IfcBuildingStorey"){this.error(`selectStorey() - object is not found: ${u}`);return}const p=f.getObjectIDsInSubtree();this._selectObjects(p,l)}}},"./src/messages.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});const S={ch:{NavCube:{front:"前",back:"后",top:"上",bottom:"下",left:"左",right:"右"},modelsExplorer:{title:"模型",loadAll:"加载全部",loadAllTip:"加载项目中的所有模型",unloadAll:"卸载全部",unloadAllTip:"卸载所有模型",add:"添加",addTip:"添加模型"},objectsExplorer:{title:"对象",showAll:"显示全部",showAllTip:"显示所有对象",hideAll:"隐藏全部",hideAllTip:"隐藏所有对象"},classesExplorer:{title:"类别",showAll:"显示全部",showAllTip:"显示所有类别",hideAll:"隐藏全部",hideAllTip:"隐藏所有类别"},storeysExplorer:{title:"楼层",showAll:"显示全部",showAllTip:"显示所有楼层",hideAll:"隐藏全部",hideAllTip:"隐藏所有楼层"},propertiesInspector:{title:"属性",noObjectSelectedWarning:"未选中任何对象。右键单击或长按对象,并选择“检查属性”以在此查看其属性。",noPropSetWarning:"未找到此对象的属性集。"},toolbar:{toggleExplorer:"结构树",toggleProperties:"属性",resetViewTip:"重置视图",toggle2d3dTip:"2D/3D",togglePerspectiveTip:"透视/正交",viewFitTip:"适合视图",firstPersonTip:"第一人称",hideObjectsTip:"隐藏对象",annotationObjectsTip:"标注对象",selectObjectsTip:"选择对象",queryObjectsTip:"查询对象",sliceObjectsTip:"切片对象",slicesMenuTip:"切片菜单",showSpacesTip:"显示空间",numSlicesTip:"现有切片数"}},en:{NavCube:{front:"Front",back:"Back",top:"Top",bottom:"Bottom",left:"Left",right:"Right"},modelsExplorer:{title:"Models",loadAll:"Load all",loadAllTip:"Load all models in this project",unloadAll:"Unload all",unloadAllTip:"Unload all models",add:"Add",addTip:"Add a Model"},objectsExplorer:{title:"Objects",showAll:"Show all",showAllTip:"Show all objects",hideAll:"Hide all",hideAllTip:"Hide all objects"},classesExplorer:{title:"Classes",showAll:"Show all",showAllTip:"Show all classes",hideAll:"Hide all",hideAllTip:"Hide all classes"},storeysExplorer:{title:"Storeys",showAll:"Show all",showAllTip:"Show all storeys",hideAll:"Hide all",hideAllTip:"Hide all storeys"},propertiesInspector:{title:"Properties",noObjectSelectedWarning:"No object inspected. Right-click or long-tab an object and select 'Inspect Properties' to view its properties here.",noPropSetWarning:"No property sets found for this object."},toolbar:{toggleExplorer:"Toggle explorer",toggleProperties:"Toggle properties",resetViewTip:"Reset view",toggle2d3dTip:"Toggle 2D/3D",togglePerspectiveTip:"Toggle Perspective/Ortho",viewFitTip:"View fit",firstPersonTip:"Toggle first person navigation mode",hideObjectsTip:"Hide objects",selectObjectsTip:"Select objects",queryObjectsTip:"Query objects",sliceObjectsTip:"Slice objects",slicesMenuTip:"Slices menu",showSpacesTip:"Show IFCSpaces",numSlicesTip:"Number of existing slices"}},de:{NavCube:{front:"Vorne",back:"Hinten",top:"Oben",bottom:"Unten",left:"Links",right:"Rechts"},modelsExplorer:{title:"Modelle",loadAll:"Alle laden",loadAllTip:"Alle Modelle in diesem Projekt laden",unloadAll:"Alle abwählen",unloadAllTip:"Alle Modelle abwählen",add:"Hinzufügen",addTip:"Modell hinzufügen"},objectsExplorer:{title:"Objekte",showAll:"Alle anzeigen",showAllTip:"Alle Objekte anzeigen",hideAll:"Alle ausblenden",hideAllTip:"Alle Objekte ausblenden"},classesExplorer:{title:"Typen",showAll:"Alle anzeigen",showAllTip:"Alle Typen anzeigen",hideAll:"Alle ausblenden",hideAllTip:"Alle Typen ausblenden"},storeysExplorer:{title:"Stockwerke",showAll:"Alle anzeigen",showAllTip:"Alle Stockwerke anzeigen",hideAll:"Alle ausblenden",hideAllTip:"Alle Stockwerke ausblenden"},propertiesInspector:{title:"Eigenschaften",noObjectSelectedWarning:"Kein Objekt inspiziert. Klicken Sie mit der rechten Maustaste auf ein Objekt oder führen Sie einen langen Tabulator aus und wählen Sie 'Eigenschaften prüfen', um die Eigenschaften des Objekts anzuzeigen.",noPropSetWarning:"Keine Eigenschaftssätze für dieses Objekt gefunden."},toolbar:{toggleExplorer:"Explorer ein- und ausblenden",toggleProperties:"Eigenschaften ein- und ausblenden",resetViewTip:"Ansicht zurücksetzen",toggle2d3dTip:"2D/3D umschalten",togglePerspectiveTip:"Orthogonale/Perspektivische Ansicht umschalten",viewFitTip:"In Ansicht einpassen",firstPersonTip:"Ich-Perspektive umschalten",hideObjectsTip:"Objekte ausblenden",selectObjectsTip:"Objekte auswählen",queryObjectsTip:"Abfrageobjekte",sliceObjectsTip:"Objekte schneiden",slicesMenuTip:"Menü Schnittebenen",showSpacesTip:"IFC-Räume anzeigen",numSlicesTip:"Anzahl der Schnittebenen"}},fr:{NavCube:{front:"Face",back:"Arrière",top:"Dessus",bottom:"Dessous",left:"Droite",right:"Gauche"},modelsExplorer:{title:"Modèles",loadAll:"Afficher tout",loadAllTip:"Afficher tous les modèles du projet",unloadAll:"Masquer tout",unloadAllTip:"Masquer tous les modèles",add:"Ajouter",addTip:"Ajouter un modèle"},objectsExplorer:{title:"Conteneurs",showAll:"Afficher tout",showAllTip:"Afficher tous les objets",hideAll:"Masquer tout",hideAllTip:"Masquer tous les objets"},classesExplorer:{title:"Classes IFC",showAll:"Afficher tout",showAllTip:"Affiche toutes les classes",hideAll:"Masquer tout",hideAllTip:"Masquer toutes les classes"},storeysExplorer:{title:"Étages",showAll:"Afficher tout",showAllTip:"Afficher tous les étages",hideAll:"Masquer tout",hideAllTip:"Masquer tous les étages"},propertiesInspector:{title:"Propriétés",noObjectSelectedWarning:"Aucun objet n'a été inspecté. Cliquez avec le bouton droit ou le bouton long sur un objet et sélectionnez 'Inspecter les propriétés' pour afficher ses propriétés ici.",noPropSetWarning:"Aucun ensemble de propriétés n'a été trouvé pour cet objet."},toolbar:{toggleExplorer:"Afficher la structure",toggleProperties:"Afficher les propriétés",resetViewTip:"Réinitialiser la vue",toggle2d3dTip:"Activer 2D/3D",togglePerspectiveTip:"Activer Perspective/Ortho",viewFitTip:"Recadrer la vue",firstPersonTip:"Mode 1ere personne",hideObjectsTip:"Masquer objets",selectObjectsTip:"Sélectionner",queryObjectsTip:"Informations objets",sliceObjectsTip:"Coupes",slicesMenuTip:"Outils de coupe",showSpacesTip:"Afficher les espaces IFC",numSlicesTip:"Nombre de coupes"}},pl:{NavCube:{front:"Przód",back:"Tył",top:"Góra",bottom:"Dół",left:"Lewy",right:"Prawy"},modelsExplorer:{title:"Model",loadAll:"Załaduj",loadAllTip:"Załaduj wszystkie modele",unloadAll:"Zamknij",unloadAllTip:"Zamnij wszystkie modele",add:"Dodaj",addTip:"Dodaj modele"},objectsExplorer:{title:"Obiekty",showAll:"Pokaż",showAllTip:"Pokaż wszystkie obiekty",hideAll:"Ukryj",hideAllTip:"Ukryj wszystkie obiekty"},classesExplorer:{title:"Typy",showAll:"Pokaż",showAllTip:"Pokaż wszystkie typy",hideAll:"Ukryj",hideAllTip:"Ukryj wszystkie typy"},storeysExplorer:{title:"Piętra",showAll:"Pokaż",showAllTip:"Pokaż wszystkie piętra",hideAll:"Ukryj",hideAllTip:"Ukryj wszystkie piętra"},propertiesInspector:{title:"Właściwości",noObjectSelectedWarning:"Nie sprawdzono żadnego obiektu. Kliknij prawym przyciskiem myszy lub kliknij długo na obiekcie i wybierz opcję 'Sprawdź właściwości', aby wyświetlić jego właściwości.",noPropSetWarning:"Nie znaleziono żadnych zestawów właściwości dla tego obiektu."},toolbar:{toggleExplorer:"Przełączanie eksploratora",toggleProperties:"Przełączanie właściwości",resetViewTip:"Resetuj widok",toggle2d3dTip:"Widok 2D/3D",togglePerspectiveTip:"Widok Ortograficzny/Perspektywiczny",viewFitTip:"Dopasowanie do widoku",firstPersonTip:"Widok perspektywy pierwszoosobowej",hideObjectsTip:"Ukryj obiekt",selectObjectsTip:"Zaznacz obiekt",queryObjectsTip:"Wywołaj obiekt",sliceObjectsTip:"Przekroje obiektów",slicesMenuTip:"Menu przekroi",showSpacesTip:"Pokaż przestrzenie IFC",numSlicesTip:"Liczba przekroi"}},ru:{NavCube:{front:"Фронт",back:"Тыл",top:"Верх",bottom:"Низ",left:"Лево",right:"Право"},modelsExplorer:{title:"Модели",loadAll:"Загрузить все",loadAllTip:"Загрузить все модели в этом проекте",unloadAll:"Выгрузить все",unloadAllTip:"Выгрузить все модели",add:"Добавить",addTip:"Добавить модель"},objectsExplorer:{title:"Объекты",showAll:"Показать все",showAllTip:"Показать все объекты",hideAll:"Скрыть все",hideAllTip:"Скрыть все объекты"},classesExplorer:{title:"Классы",showAll:"Показать все",showAllTip:"Показать все классы",hideAll:"Скрыть все",hideAllTip:"Скрыть все классы"},storeysExplorer:{title:"Этажи",showAll:"Показать все",showAllTip:"Показать все этажи",hideAll:"Скрыть все",hideAllTip:"Скрыть все этажи"},propertiesInspector:{title:"Свойства",noObjectSelectedWarning:"Ни один объект не осмотрен. Щелкните правой кнопкой мыши или длинной меткой на объекте и выберите 'Осмотреть свойства', чтобы просмотреть его свойства здесь.",noPropSetWarning:"Для этого объекта не найдено ни одного набора свойств."},toolbar:{toggleExplorer:"Переключить навигатор",toggleProperties:"Переключить Свойства",resetViewTip:"Сбросить вид",toggle2d3dTip:"Переключить 2D/3D",togglePerspectiveTip:"Переключить проекцию перспектива/орто",viewFitTip:"Показать всю модель",firstPersonTip:"Переключить режим навигации от первого лица",hideObjectsTip:"Скрыть объекты",selectObjectsTip:"Выбрать объекты",queryObjectsTip:"Выбрать объекты",sliceObjectsTip:"Рассечь объекты",slicesMenuTip:"Меню сечений",showSpacesTip:"Показать места IFC",numSlicesTip:"Количество существующих сечений"}}}},"./src/server/OSSHelper.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>l});var x=a("./node_modules/axios/lib/axios.js"),S=a("./node_modules/ali-oss/dist/aliyun-oss-sdk.js"),A=a.n(S),h=function(c,f,p,m){function v(_){return _ instanceof p?_:new p(function(b){b(_)})}return new(p||(p=Promise))(function(_,b){function w(T){try{k(m.next(T))}catch(R){b(R)}}function C(T){try{k(m.throw(T))}catch(R){b(R)}}function k(T){T.done?_(T.value):v(T.value).then(w,C)}k((m=m.apply(c,f||[])).next())})};function d(c){return h(this,void 0,void 0,function*(){try{return(yield x.default.get(c)).data.data}catch(f){throw console.error("Error fetching data:",f),f}})}function u(c,f){return h(this,void 0,void 0,function*(){const p=yield d(c);return new(A())({region:"oss-cn-beijing",accessKeyId:p.accessKeyId,accessKeySecret:p.accessKeySecret,stsToken:p.securityToken,bucket:f})})}class l{static getBuffer(f,p,m,v,_){return h(this,void 0,void 0,function*(){try{const w=yield(yield u(p,m)).get(`${f}`);v(w.content.buffer)}catch(b){_(b)}})}static requestFileFromOSS(f,p,m,v,_,b){return h(this,void 0,void 0,function*(){try{const w=yield u(p,m);if(v){const C=yield w.get(`${f}/metadata.json`);_(JSON.parse(C.content))}else{const C=yield w.get(`${f}/index.json`);_(JSON.parse(C.content))}}catch(w){console.error("请求文件失败:",w)}})}}},"./src/server/Server.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/server/OSSHelper.ts"),A=function(d,u,l,c){function f(p){return p instanceof l?p:new l(function(m){m(p)})}return new(l||(l=Promise))(function(p,m){function v(w){try{b(c.next(w))}catch(C){m(C)}}function _(w){try{b(c.throw(w))}catch(C){m(C)}}function b(w){w.done?p(w.value):f(w.value).then(v,_)}b((c=c.apply(d,u||[])).next())})};class h{constructor(u={}){this._dataDir=u.dataDir||"",this._filePath=u.filePath||""}getProjects(u,l){const c=`${this._dataDir}/projects/index.json`;x.utils.loadJSON(c,u,l)}getProject(u,l,c){const f=`${this._dataDir}/projects/${u}/index.json`;x.utils.loadJSON(f,l,c)}getMetadata(u,l,c,f){const p=`${this._dataDir}/projects/${u}/models/${l}/metadata.json`;x.utils.loadJSON(p,c,f)}getModelProject(u,l,c,f){return A(this,void 0,void 0,function*(){yield S.default.requestFileFromOSS(this._filePath,u,l,!1,c,f)})}getModelMetadata(u,l,c,f){return A(this,void 0,void 0,function*(){yield S.default.requestFileFromOSS(this._filePath,u,l,!0,c,f)})}getModelGeometry(u,l,c,f){return A(this,void 0,void 0,function*(){yield S.default.getBuffer(this._filePath,u,l,c,f)})}getGeometry(u,l,c,f){const p=`${this._dataDir}/projects/${u}/models/${l}/geometry.xtc`;x.utils.loadArraybuffer(p,c,f)}getObjectInfo(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models${l}/props/${c}.json`;x.utils.loadJSON(m,f,p)}getIssues(u,l,c,f){const p=`${this._dataDir}/projects/${u}/modelId/${l}/issues.json`;x.utils.loadJSON(p,c,f)}getSplitModelManifest(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models${l}/${c}`;x.utils.loadJSON(m,f,p)}getSplitModelMetadata(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models/${l}/${c}`;x.utils.loadJSON(m,f,p)}getSplitModelGeometry(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models${l}/${c}`;x.utils.loadArraybuffer(m,f,p)}}},"./src/toolbar/AnnotationTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){if(super(d,u),this._AnnotationList=[],this._visible=!0,this._currentType="image",this._modelId=u.modelId,this.eventTrigger=d.eventTrigger,this.imageSrc=new Map,document.getElementById("myAnnotationDiv"))this.annotationWrapper=document.getElementById("myAnnotationDiv");else{this.annotationWrapper=document.createElement("div"),this.annotationWrapper.id="myAnnotationDiv";const{canvas:f}=d.viewer.scene.canvas;f.parentNode.insertBefore(this.annotationWrapper,f)}this.annotationsPlugin=new x.AnnotationsPlugin(this.viewer,{markerHTML:"<div class='annotation-marker annotation-marker-{{iconType}} {{iconType}}' id='{{id}}' entityid='{{entityid}}' style='position:absolute;'><img src='{{iconPath}}'></div>",container:this.annotationWrapper,values:{id:"",entityid:"",iconPath:"",iconType:""}}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.on("active",f=>{});let l;this.annotationsPlugin.on("markerClicked",f=>{this.eventTrigger.emit("markerClicked",f),l=f}),this.annotationsPlugin.on("markerDoubleClicked",f=>{this.eventTrigger.emit("markerDoubleClicked",f)});const c=f=>{this._active&&(f.key==="Delete"||f.keyCode===8)&&this.eventTrigger.emit("requestDeleteMarker",l.id)};document.addEventListener("keydown",c.bind(this)),this.on("destroy",()=>{document.removeEventListener("keydown",c.bind(this))})}setAllVisible(d=!this._visible){this._visible=d,this.annotationsPlugin.setAllVisible(d)}clickToCreateAnno(d){if(!this.getActive()||!this.getEnabled())return;const u=this.getCanvasPos(d),l=this.viewer.scene.pick({canvasPos:u,pickSurface:!0});if(l){const c=l.entity.id,f=this.generateId(c);this.annotationsPlugin.createAnnotation({id:f,pickResult:l,occludable:!0,markerShown:!0,labelShown:!1,values:{id:f,entityid:c,iconPath:this.getTypeImage(this._currentType),iconType:this._currentType}}),this.currentAnnotation={id:f,modelId:l.entity.model.id,entityId:c,type:this._currentType,content:{worldPos:[l.worldPos[0],l.worldPos[1],l.worldPos[2]],fileContent:[],text:""}},this.eventTrigger.emit("createAnnotation",{type:this._currentType,currentAnnotation:this.currentAnnotation}),this._AnnotationList.push(this.currentAnnotation)}else console.log("没有获取到合法的坐标,传入的内容:",d)}generateId(d){const u=Date.now(),l=Math.floor(performance.now()*1e3);return`${d}_${this._currentType}_${u}_${l}`}getCanvasPos(d){const u=[];if(!d)d=window.event,u[0]=d.x,u[1]=d.y;else if("TouchEvent"in window&&d instanceof TouchEvent){if(!d.touches||d.touches.length===0)return;const l=d.touches[0];let c=d.target,f=0,p=0;for(;c.offsetParent;)f+=c.offsetLeft,p+=c.offsetTop,c=c.offsetParent;u[0]=l.pageX-f,u[1]=l.pageY-p}else{let l=this.viewer.scene.canvas.canvas,c=0,f=0;for(;l.offsetParent;)c+=l.offsetLeft,f+=l.offsetTop,l=l.offsetParent;u[0]=d.pageX-c,u[1]=d.pageY-f}return u}setCurrentType(d){this._currentType=d}showAnnotationList(){this.clear();const d=this._AnnotationList;d.length>0&&d.forEach(u=>{this.addAnnotation(u.id.toString(),u.content.worldPos,u.type)})}addAnnotation(d,u,l){this.annotationsPlugin.createAnnotation({id:d,worldPos:u,occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:d,entityid:d,iconPath:this.getTypeImage(l),iconType:l}})}clear(){this.annotationsPlugin.clear()}get AnnotationList(){return this._AnnotationList}set AnnotationList(d){this._AnnotationList=d}getTypeImage(d){if(this.imageSrc.size<1){let u=document.getElementById(`annotation_tool_btn_img_${d}`);return u&&u instanceof HTMLImageElement&&u.src?u.src:null}return this.imageSrc.get(d)}setTypeImage(d){for(const u in d)this.imageSrc.set(u,d[u])}destroyAnnotationById(d){this.annotationsPlugin.destroyAnnotation(d),this._AnnotationList.forEach((u,l)=>{u.id===d&&this._AnnotationList.splice(l,1)})}getAnnotationById(d){return this.annotationsPlugin.annotations[d]}get annotationPluginList(){return this.annotationsPlugin.annotations}destroy(){var d;this.fire("destroy",!0),this.clear(),this.annotationsPlugin.destroy(),this.annotationWrapper&&((d=this.annotationWrapper.parentNode)===null||d===void 0||d.removeChild(this.annotationWrapper))}}},"./src/toolbar/BCFTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>d});var x=a("./src/Controller.ts"),S=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),A=a("./node_modules/@parametricos/bcf-js/dist/index.js"),h=function(u,l,c,f){function p(m){return m instanceof c?m:new c(function(v){v(m)})}return new(c||(c=Promise))(function(m,v){function _(C){try{w(f.next(C))}catch(k){v(k)}}function b(C){try{w(f.throw(C))}catch(k){v(k)}}function w(C){C.done?m(C.value):p(C.value).then(_,b)}w((f=f.apply(u,l||[])).next())})};class d extends x.default{constructor(l,c){super(l,c),this._enableAnno=!1,this._imagePath="",this.eventTrigger=l.eventTrigger,this.bCFViewpointsPlugin=new S.BCFViewpointsPlugin(l.viewer,{originatingSystem:"tctwins.com",authoringTool:"tctwins.com"}),this.bcfAnnoWrapper=document.createElement("div"),this.bcfAnnoWrapper.id="bcfAnnoWrapper";const{canvas:f}=l.viewer.scene.canvas;f.parentNode.insertBefore(this.bcfAnnoWrapper,f),this.bcfAnnoPlugin=new S.AnnotationsPlugin(this.viewer,{markerHTML:"<div class='bcf-anno {{iconType}}' id='{{id}}'entityid='{{entityid}}' style='position:absolute;'><img src='{{iconPath}}'></div>",container:this.bcfAnnoWrapper,values:{id:"",entityid:"",iconPath:"",iconType:""}}),l.viewer.scene.input.on("mouseclicked",p=>{if(!this._enableAnno||!this._active)return;const m=l.viewer.scene.pick({canvasPos:p,pickSurface:!0}),v=m.entity.id;if(m){const _=this.addBCFAnno(v,p,"text");this.eventTrigger.emit("bcfNewAnno",_)}}),this.on("active",p=>{l.disableClickEvent=p})}readBCF(l){return h(this,void 0,void 0,function*(){const c=new A.BcfReader;return yield c.read(l),c.project})}createBCF(l){return h(this,void 0,void 0,function*(){const c=new A.BcfReader;let f=[];const p=l.markups;p&&p.forEach(b=>{let w=[],C=[];b.viewPoints&&b.viewPoints.forEach((U,G)=>{var j;if(U.bcfView){let H=this.bCFViewpointsPlugin.getUUID(),W={index:G,guid:H,snapshot:U.bcfView.snapshot?`${H}_snapshot.png`:void 0,viewpoint:`${H}_viewpoint.bcfv`},K={guid:H,components:U.bcfView.components,perspective_camera:U.bcfView.perspective_camera,orthogonal_camera:U.bcfView.orthogonal_camera,snapshot:(j=U.bcfView.snapshot)===null||j===void 0?void 0:j.snapshot_data};w.push(W),C.push(K)}});let k=[];b.comments&&b.comments.forEach((U,G)=>{let H={guid:this.bCFViewpointsPlugin.getUUID(),date:U.date,author:U.author,comment:U.comment,viewpoint:U.viewPoint,modified_date:U.modified_date?U.modified_date:U.date,modified_author:U.modified_author?U.modified_author:U.author};k.push(H)});const R={topic:{guid:this.bCFViewpointsPlugin.getUUID(),title:b.title,priority:b.priority,topic_type:b.type,topic_status:b.status?b.status:"Active",due_date:b.dueDate,creation_date:b.createDate?b.createDate:new Date().toISOString(),creation_author:b.author,assigned_to:b.assignedTo,index:b.index?b.index:1,viewpoints:w,comments:k},viewpoints:C};f.push(R)});const m={project_id:l.id?l.id:"",name:l.name?l.name:"",version:l.version?l.version:2.1,reader:c,markups:f,extension_schema:void 0};return yield new A.BcfWriter().write(m)})}saveBcf(l){return h(this,void 0,void 0,function*(){return console.log(l),yield new A.BcfWriter().write(l)})}getBCFView(){return this.bCFViewpointsPlugin.getViewpoint()}getSnapshot(l){for(var c=l.replace(/^data:image\/(png|jpeg);base64,/,""),f=atob(c),p=f.length,m=new Uint8Array(p),v=0;v<p;v++)m[v]=f.charCodeAt(v);var _=new Blob([m],{type:"image/png"});return _}set enableAnno(l){this._enableAnno=l}get enableAnno(){return this._enableAnno}set imagePath(l){this._imagePath=l}get imagePath(){return this._imagePath}addBCFAnno(l,c,f){this.bcfAnnoPlugin.createAnnotation({id:l,worldPos:c,occludable:!0,markerShown:!0,labelShown:!0,values:{id:l,entityid:l,iconPath:this._imagePath,iconType:f}})}getNewGuid(){return this.bCFViewpointsPlugin.getUUID()}}},"./src/toolbar/CommentsTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/decimal.js/decimal.mjs"),S=a("./src/Controller.ts");class A extends S.default{constructor(l,c){super(l,c),this._commentsList={},this.eventTrigger=l.eventTrigger,this._commentsList={},this._currentMode="path",this._Pathcolor="#066CFC",this._Ellipsecolor="#066CFC",this._Rectcolor="#066CFC",this._Arrowcolor="#066CFC",this._Textcolor="#066CFC",this._PathstrokeWidth="2",this._EllipsestrokeWidth="2",this._RectstrokeWidth="2",this._ArrowstrokeWidth="2",this._TextstrokeWidth="1",this._offsetX=0,this._offsetY=0,this._FontSize="18",this._stratchPos="",this.isCreating=!1,this.isDrawing=!1,this.isMoving=!1,this.isChosed=!1,this.isHolding=!1,this.isStretch=!1,this.isHovering=!1,this.isDuplicate=!1,this.isTyping=!1,this._isTouch=!1,this._revocationMechanism=null,this.on("active",f=>{f?this.saveSVG():this.endCommentsTool()}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.initEventListeners()}saveSVG(){const l=document.getElementById("myCanvas");let c=l.clientWidth,f=l.clientHeight;const p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",c.toString()),p.setAttribute("height",f.toString());const m=document.createElementNS("http://www.w3.org/2000/svg","image");m.setAttribute("x","0"),m.setAttribute("y","0"),m.setAttribute("width",c.toString()),m.setAttribute("height",f.toString()),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l.toDataURL()),p.appendChild(m),p.setAttribute("id","svgImage");const v=document.getElementById("comments_panel");v&&(v.innerHTML=""),v==null||v.appendChild(p),this.checkSelectionBox(),this._revocationMechanism=new h(this.eventTrigger),this.eventTrigger.emit("saveImage")}initEventListeners(){let l,c,f,p,m;const v=(_,b,w,C)=>{const k=[_-b,w-C],T=this.getInitVector(k[0],k[1]),R=this.getVerticalUnitVector(k[0],k[1]),U=.5,G=(b-2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),j=(C-2*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),H=(_-2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),W=(w-2*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),K=(_-7*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),$=(w-7*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),O=(_+12*Number(this._ArrowstrokeWidth)*U*T[0]).toString(),L=(w+12*Number(this._ArrowstrokeWidth)*U*T[1]).toString(),M=(_+7*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),I=(w+7*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),F=(_+2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),V=(w+2*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),D=(b+2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),X=(C+2*Number(this._ArrowstrokeWidth)*U*R[1]).toString();return`M ${b},${C}L ${G},${j}L ${H},${W}L ${K},${$}L ${O},${L}L ${M},${I}L ${F},${V}L ${D},${X}L${b},${C}`};this.eventTrigger.on("saveImage",()=>{const _=document.getElementById("svgImage"),b=H=>{const{target:W}=H;if(W.tagName==="text"){this.hiddenAllInput();const K=W.parentNode,$=K.querySelector("foreignObject"),O=$.querySelector("input"),{textContent:L}=K;if(O)O.style.display="inline",W.textContent="";else{const M=document.createElement("input");M.setAttribute("type","text"),M.setAttribute("class","commentInputBox"),L!=""&&M.setAttribute("placeholder",L),$.appendChild(M)}this.isTyping=!0}},w=H=>{if(this._isTouch)return;const{target:W}=H;if(W.tagName==="ellipse"||W.tagName==="path"||W.tagName==="rect"||W.tagName==="text"){if(W.id!="selectionBox")if(W.getAttribute("type")=="handle"){l=H.clientX+this._offsetX,c=H.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.isStretch=!0;const{id:K}=H.target;this._stratchPos=K,this.hiddenAllInput()}else this.chosedTarget!=W&&(this.isDuplicate=!1,this.chosedTarget=W),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,l=H.clientX+this._offsetX,c=H.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.autoSaveInput(),this.setCurrentMode(""),this.eventTrigger.emit("choseTarget")}else if(W.classList.contains("commentInputBox"))this.isTyping=!0;else{if(this.isChosed&&H.target!=="circle"&&(this.showHiddenSelectedBox(!1),this.isChosed=!1,this.chosedTarget=null,this.eventTrigger.emit("choseNothing")),this.isTyping&&this.autoSaveInput(),this._currentMode=="")return;if(!this.isCreating){this.showHiddenSelectedBox(!1),this.isCreating=!0,l=H.clientX+this._offsetX,c=H.clientY+this._offsetY;const K=document.createElementNS("http://www.w3.org/2000/svg","g");K.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let $;switch(this._currentMode){case"path":$=document.createElementNS("http://www.w3.org/2000/svg","path"),$.setAttribute("d",`M ${l},${c}`),$.setAttribute("stroke",this._Pathcolor),$.setAttribute("stroke-width",this._PathstrokeWidth),$.setAttribute("fill","transparent"),K.setAttribute("type","path");break;case"ellipse":$=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),$.setAttribute("cx",l.toString()),$.setAttribute("cy",c.toString()),$.setAttribute("rx","0"),$.setAttribute("ry","0"),$.setAttribute("stroke",this._Ellipsecolor),$.setAttribute("stroke-width",this._EllipsestrokeWidth),$.setAttribute("fill","transparent"),K.setAttribute("type","ellipse");break;case"rect":$=document.createElementNS("http://www.w3.org/2000/svg","rect"),$.setAttribute("x",l.toString()),$.setAttribute("y",c.toString()),$.setAttribute("stroke",this._Rectcolor),$.setAttribute("stroke-width",this._RectstrokeWidth),$.setAttribute("fill","transparent"),K.setAttribute("type","rect");break;case"arrow":$=document.createElementNS("http://www.w3.org/2000/svg","path"),$.setAttribute("d",`M ${l},${c}`),$.setAttribute("stroke-width","20"),$.setAttribute("stroke","transparent"),$.setAttribute("fill",this._Arrowcolor),K.setAttribute("type","arrow");break;case"text":if(this.isTyping)this.autoSaveInput();else if(!this.isChosed){const O=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");let L=0;this._FontSize=="16"?(O.setAttribute("width","120"),O.setAttribute("height","26"),L=28):this._FontSize=="18"?(O.setAttribute("width","140"),O.setAttribute("height","28"),L=30):Number(this._FontSize)<=14&&(O.setAttribute("width","100"),O.setAttribute("height",(Number(this._FontSize)+10).toString()),L=Number(this._FontSize)+10),O.setAttribute("x",l),O.setAttribute("y",c);const M=document.createElement("input");M.setAttribute("type","text"),M.setAttribute("class","commentInputBox"),M.setAttribute("placeholder","输入内容...");const I=document.createElementNS("http://www.w3.org/2000/svg","text");I.setAttribute("x",l+3),I.setAttribute("y",(c+L-Number(this._FontSize)/2).toString()),I.setAttribute("font-size",this._FontSize),I.setAttribute("stroke",this._Textcolor),I.setAttribute("stroke-width",this._TextstrokeWidth),I.setAttribute("fill",this._Textcolor),I.setAttribute("lengthAdjust","spacingAndGlyphs"),O.appendChild(M),K.setAttribute("type","text"),K.appendChild(O),K.appendChild(I),_==null||_.insertBefore(K,_==null?void 0:_.lastElementChild),M.click(),this.isTyping=!0,this.eventTrigger.emit("createNew")}break}this._currentMode!="text"&&this._currentMode!=""&&(K.appendChild($),_==null||_.insertBefore(K,_==null?void 0:_.lastElementChild)),this.isChosed=!1}}},C=H=>{var W,K,$,O,L,M,I,F,V,D,X,ee,q,ne,oe,he,te,de,se,re,ae,Ce,me,ce,pe,B,ke,Ee,ge,Ae,fe,ue;if(this._isTouch)return;const _e=H.clientX+this._offsetX,be=H.clientY+this._offsetY;let De;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":De=document.querySelectorAll("g");const Ke=[];De.forEach(rr=>{rr.getAttribute("type")=="path"&&Ke.push(rr)});const yt=Ke[Ke.length-1].querySelector("path");let Ne=yt.getAttribute("d");Ne&&(Ne+=`L ${_e},${be}`,yt.setAttribute("d",Ne));break;case"ellipse":var Je=document.querySelectorAll("ellipse"),Qe=Je[Je.length-1];if(Qe){var ot=Math.abs(_e-l)/2,ct=Math.abs(be-c)/2;Qe.setAttribute("cx",((_e+l)/2).toString()),Qe.setAttribute("cy",((be+c)/2).toString()),Qe.setAttribute("rx",ot.toString()),Qe.setAttribute("ry",ct.toString())}break;case"rect":const tt=document.querySelectorAll("g"),Pt=[];tt.forEach(rr=>{rr.getAttribute("type")=="rect"&&Pt.push(rr.childNodes[0])});const Rt=Pt[Pt.length-1],Ht=Rt.getAttribute("x"),zt=Rt.getAttribute("y");if(Ht&&zt){const rr=Math.abs(parseInt(Ht)-_e),_r=Math.abs(parseInt(zt)-be);Rt.setAttribute("width",rr.toString()),Rt.setAttribute("height",_r.toString()),Rt.setAttribute("rx","9"),Rt.setAttribute("ry","9"),Rt.setAttribute("type","comment")}break;case"arrow":De=document.querySelectorAll("g");const tr=[];De.forEach(rr=>{rr.getAttribute("type")=="arrow"&&tr.push(rr)});const er=tr[tr.length-1].querySelector("path");if(er.getAttribute("d")){const rr=v(_e,l,be,c);er.setAttribute("d",rr)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(_e-l)>=1||Math.abs(be-c)>=1)&&(this.isMoving=!0);const Ke=(W=this.chosedTarget)===null||W===void 0?void 0:W.getBBox();switch(this.chosedTarget.tagName){case"path":const yt=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,Rt=>{const[Ht,zt]=Rt.split(",").map(parseFloat),tr=Number(Ht)+Number(_e)-Number(Ke.x)-(Number(l)-Number(f)),qt=Number(zt)+Number(be)-Number(Ke.y)-(Number(c)-Number(p));return`${tr.toString()},${qt.toString()}`});($=this.chosedTarget)===null||$===void 0||$.setAttribute("d",yt);break;case"ellipse":var ht=Number((O=this.chosedTarget)===null||O===void 0?void 0:O.getAttribute("cx")),it=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("cy"));const Ne=Number((M=this.chosedTarget)===null||M===void 0?void 0:M.getAttribute("rx")),tt=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("ry"));(F=this.chosedTarget)===null||F===void 0||F.setAttribute("cx",_e-(l-f)/2+Ne),(V=this.chosedTarget)===null||V===void 0||V.setAttribute("cy",be-(c-p)/2+tt);break;case"rect":(D=this.chosedTarget)===null||D===void 0||D.setAttribute("x",_e-(l-f)),(X=this.chosedTarget)===null||X===void 0||X.setAttribute("y",be-(c-p));break;case"text":(ee=this.chosedTarget)===null||ee===void 0||ee.setAttribute("x",(_e-(l-f)).toString()),(q=this.chosedTarget)===null||q===void 0||q.setAttribute("y",(be-(c-p)+Ke.height*3/4).toString());var Ze=this.chosedTarget.getAttribute("font-size");const Pt=this.chosedTarget.parentNode;if(Pt){const Rt=Pt.querySelector("foreignObject");Rt&&(Rt.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),Rt.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(Ze)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const ut=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let yt,Ne,tt,Pt,Rt;m=(oe=this.chosedTarget)===null||oe===void 0?void 0:oe.getBBox(),this._stratchPos.indexOf("right")!==-1&&m.width+_e-l<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&m.width-(_e-l)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&m.height-(be-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&m.height+(be-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top")),yt=ut.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,er=>{const[Dt,rr]=er.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(Pt=new x.default(_e-l).mul(new x.default(Dt-m.x).div(m.width))),this._stratchPos.indexOf("left")!==-1&&(Pt=new x.default(_e-l).mul(new x.default(m.x+m.width-Dt).div(m.width))),(Number.isNaN(Pt)||!Pt)&&(Pt=new x.default(0)),Ne=new x.default(Dt).add(Pt)):Ne=new x.default(Dt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(Rt=new x.default(be-c).mul(new x.default(m.y+m.height-rr).div(m.height))),this._stratchPos.indexOf("bottom")!==-1&&(Rt=new x.default(be-c).mul(new x.default(rr-m.y).div(m.height))),(Number.isNaN(Rt)||!Rt)&&(Rt=new x.default(0)),tt=new x.default(rr).add(Rt)):tt=new x.default(rr),`${Ne.toFixed(16)},${tt.toFixed(16)}`}),(he=this.chosedTarget)===null||he===void 0||he.setAttribute("d",yt);break;case"ellipse":var ht=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("cx")),it=Number((de=this.chosedTarget)===null||de===void 0?void 0:de.getAttribute("cy")),ot=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("rx")),ct=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(ht+=(_e-l)*.5,ot-=(_e-l)*.5):this._stratchPos.indexOf("right")!==-1&&(ht+=(_e-l)*.5,ot+=(_e-l)*.5),this._stratchPos.indexOf("top")!==-1?(it+=(be-c)*.5,ct-=(be-c)*.5):this._stratchPos.indexOf("bottom")!==-1&&(it+=(be-c)*.5,ct+=(be-c)*.5),ot<0?this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left"):((ae=this.chosedTarget)===null||ae===void 0||ae.setAttribute("cx",ht.toString()),(Ce=this.chosedTarget)===null||Ce===void 0||Ce.setAttribute("rx",ot.toString())),ct<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top"):((me=this.chosedTarget)===null||me===void 0||me.setAttribute("cy",it.toString()),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("ry",ct.toString()));break;case"rect":var Xe=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),dt=Number((B=this.chosedTarget)===null||B===void 0?void 0:B.getAttribute("y")),at=Number((ke=this.chosedTarget)===null||ke===void 0?void 0:ke.getAttribute("width")),ze=Number((Ee=this.chosedTarget)===null||Ee===void 0?void 0:Ee.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(Xe+=_e-l,at-=_e-l):this._stratchPos.indexOf("right")!==-1&&(at+=_e-l),at<0?this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left"):((ge=this.chosedTarget)===null||ge===void 0||ge.setAttribute("x",Xe.toString()),(Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("width",at.toString())),this._stratchPos.indexOf("top")!==-1?(dt+=be-c,ze-=be-c):this._stratchPos.indexOf("bottom")!==-1&&(ze+=be-c),ze<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top"):((fe=this.chosedTarget)===null||fe===void 0||fe.setAttribute("y",dt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("height",ze.toString()));break}this.updateSelectionBox(),l=H.clientX+this._offsetX,c=H.clientY+this._offsetY}},k=()=>{if(!this._isTouch)if(this.isHolding&&(this.isMoving&&(this.isMoving=!1,this.AddNewState(()=>{})),this.isHolding=!1),this.isCreating){if(this.isDrawing)this.isDrawing=!1,this.eventTrigger.emit("createNew"),this.AddNewState(()=>{});else if(!this.isChosed&&!this.isStretch&&this._currentMode!="text"&&this._currentMode!=""){const H=_==null?void 0:_.lastElementChild;if(H){const W=H.previousElementSibling;_==null||_.removeChild(W)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))},T=H=>{(H.key==="Delete"||H.keyCode===8)&&this.deleteCurrentComments(),H.ctrlKey&&(H.key==="c"||H.key==="C")&&this.isChosed&&(this.isDuplicate=!0),H.ctrlKey&&(H.key==="v"||H.key==="V")&&this.isDuplicate&&this.duplicateComment(),(H.ctrlKey&&H.key==="z"||H.key==="Z")&&this.UnDo(()=>{}),(H.ctrlKey&&H.key==="y"||H.key==="Y")&&this.ReDo(()=>{}),H.key==="Enter"&&this.autoSaveInput()},R=H=>{if(!this._isTouch)return;const W=H.touches[0],{target:K}=W;if(K.tagName==="ellipse"||K.tagName==="path"||K.tagName==="rect"||K.tagName==="arrow"||K.tagName==="text")if(K.getAttribute("type")=="handle"){l=W.clientX+this._offsetX,c=W.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.isStretch=!0;const{id:$}=W.target;this._stratchPos=$}else this.chosedTarget!=K&&(this.isDuplicate=!1,this.chosedTarget=K),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,l=W.clientX+this._offsetX,c=W.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.setCurrentMode(""),this.eventTrigger.emit("choseTarget");else if(K.classList.contains("commentInputBox"))this.isTyping=!0;else{if(this.isChosed&&W.target!=="circle"&&(this.showHiddenSelectedBox(!1),this.isChosed=!1,this.chosedTarget=null,this.eventTrigger.emit("choseNothing")),this._currentMode=="")return;if(!this.isCreating){this.showHiddenSelectedBox(!1),this.isCreating=!0,l=W.clientX+this._offsetX,c=W.clientY+this._offsetY;const $=document.createElementNS("http://www.w3.org/2000/svg","g");$.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let O;switch(this._currentMode){case"path":O=document.createElementNS("http://www.w3.org/2000/svg","path"),O.setAttribute("d",`M ${l},${c}`),O.setAttribute("stroke",this._Pathcolor),O.setAttribute("stroke-width",this._PathstrokeWidth),O.setAttribute("fill","transparent"),$.setAttribute("type","path");break;case"ellipse":O=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),O.setAttribute("cx",l.toString()),O.setAttribute("cy",c.toString()),O.setAttribute("rx","0"),O.setAttribute("ry","0"),O.setAttribute("stroke",this._Ellipsecolor),O.setAttribute("stroke-width",this._EllipsestrokeWidth),O.setAttribute("fill","transparent"),$.setAttribute("type","ellipse");break;case"rect":O=document.createElementNS("http://www.w3.org/2000/svg","rect"),O.setAttribute("x",l.toString()),O.setAttribute("y",c.toString()),O.setAttribute("stroke",this._Rectcolor),O.setAttribute("stroke-width",this._RectstrokeWidth),O.setAttribute("fill","transparent"),$.setAttribute("type","rect");break;case"arrow":O=document.createElementNS("http://www.w3.org/2000/svg","path"),O.setAttribute("d",`M ${l},${c}`),O.setAttribute("stroke-width","20"),O.setAttribute("stroke","transparent"),O.setAttribute("fill",this._Arrowcolor),$.setAttribute("type","arrow");break;case"text":this.eventTrigger.emit("clickCreateText",W);break}this._currentMode!="text"&&this._currentMode!=""&&($.appendChild(O),_==null||_.insertBefore($,_==null?void 0:_.lastElementChild)),this.isChosed=!1}}},U=H=>{var W,K,$,O,L,M,I,F,V,D,X,ee,q,ne,oe,he,te,de,se,re,ae,Ce,me,ce,pe,B,ke,Ee,ge,Ae,fe,ue;if(!this._isTouch)return;const _e=H.touches[0],be=_e.clientX+this._offsetX,De=_e.clientY+this._offsetY;let Je;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":Je=document.querySelectorAll("g");const Pt=[];Je.forEach(rr=>{rr.getAttribute("type")=="path"&&Pt.push(rr)});const Ht=Pt[Pt.length-1].querySelector("path");let zt=Ht.getAttribute("d");zt&&(zt+=`L ${be},${De}`,Ht.setAttribute("d",zt));break;case"ellipse":var Qe=document.querySelectorAll("ellipse"),ot=Qe[Qe.length-1];if(ot){var ct=Math.abs(be-l)/2,ht=Math.abs(De-c)/2;ot.setAttribute("cx",((be+l)/2).toString()),ot.setAttribute("cy",((De+c)/2).toString()),ot.setAttribute("rx",ct.toString()),ot.setAttribute("ry",ht.toString())}break;case"rect":var it=document.querySelectorAll("rect"),Ze=it[it.length-10],Xe=Ze.getAttribute("x"),dt=Ze.getAttribute("y");if(Xe&&dt){var at=Math.abs(parseInt(Xe)-be),ze=Math.abs(parseInt(dt)-De);Ze.setAttribute("width",at.toString()),Ze.setAttribute("height",ze.toString()),Ze.setAttribute("rx","9"),Ze.setAttribute("ry","9"),Ze.setAttribute("type","comment")}break;case"arrow":Je=document.querySelectorAll("g");const tr=[];Je.forEach(rr=>{rr.getAttribute("type")=="arrow"&&tr.push(rr)});const er=tr[tr.length-1].querySelector("path");if(er.getAttribute("d")){const rr=v(be,l,De,c);er.setAttribute("d",rr)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(be-l)>=1||Math.abs(De-c)>=1)&&(this.isMoving=!0);const Pt=(W=this.chosedTarget)===null||W===void 0?void 0:W.getBBox();switch(this.chosedTarget.tagName){case"path":const Ht=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,er=>{const[Dt,rr]=er.split(",").map(parseFloat),_r=Number(Dt)+Number(be)-Number(Pt.x)-(Number(l)-Number(f)),pr=Number(rr)+Number(De)-Number(Pt.y)-(Number(c)-Number(p));return`${_r.toString()},${pr.toString()}`});($=this.chosedTarget)===null||$===void 0||$.setAttribute("d",Ht);break;case"ellipse":var Ke=Number((O=this.chosedTarget)===null||O===void 0?void 0:O.getAttribute("cx")),ut=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("cy"));const zt=Number((M=this.chosedTarget)===null||M===void 0?void 0:M.getAttribute("rx")),tr=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("ry"));(F=this.chosedTarget)===null||F===void 0||F.setAttribute("cx",be-(l-f)/2+zt),(V=this.chosedTarget)===null||V===void 0||V.setAttribute("cy",De-(c-p)/2+tr);break;case"rect":(D=this.chosedTarget)===null||D===void 0||D.setAttribute("x",be-(l-f)),(X=this.chosedTarget)===null||X===void 0||X.setAttribute("y",De-(c-p));break;case"text":(ee=this.chosedTarget)===null||ee===void 0||ee.setAttribute("x",(be-(l-f)).toString()),(q=this.chosedTarget)===null||q===void 0||q.setAttribute("y",(De-(c-p)+Pt.height*3/4).toString());var yt=this.chosedTarget.getAttribute("font-size");const qt=this.chosedTarget.parentNode;if(qt){const er=qt.querySelector("foreignObject");er&&(er.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),er.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(yt)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const Rt=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let Ht,zt,tr,qt,er;m=(oe=this.chosedTarget)===null||oe===void 0?void 0:oe.getBBox(),this._stratchPos.indexOf("right")!==-1&&m.width+be-l<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&m.width-(be-l)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&m.height-(De-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&m.height+(De-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top")),Ht=Rt.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,Et=>{const[Lt,Kt]=Et.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(qt=new x.default(be-l).mul(new x.default(Lt-m.x).div(m.width))),this._stratchPos.indexOf("left")!==-1&&(qt=new x.default(be-l).mul(new x.default(m.x+m.width-Lt).div(m.width))),(Number.isNaN(qt)||!qt)&&(qt=new x.default(0)),zt=new x.default(Lt).add(qt)):zt=new x.default(Lt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(er=new x.default(De-c).mul(new x.default(m.y+m.height-Kt).div(m.height))),this._stratchPos.indexOf("bottom")!==-1&&(er=new x.default(De-c).mul(new x.default(Kt-m.y).div(m.height))),(Number.isNaN(er)||!er)&&(er=new x.default(0)),tr=new x.default(Kt).add(er)):tr=new x.default(Kt),`${zt.toFixed(16)},${tr.toFixed(16)}`}),(he=this.chosedTarget)===null||he===void 0||he.setAttribute("d",Ht);break;case"ellipse":var Ke=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("cx")),ut=Number((de=this.chosedTarget)===null||de===void 0?void 0:de.getAttribute("cy")),ct=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("rx")),ht=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(Ke+=(be-l)*.5,ct-=(be-l)*.5):this._stratchPos.indexOf("right")!==-1&&(Ke+=(be-l)*.5,ct+=(be-l)*.5),this._stratchPos.indexOf("top")!==-1?(ut+=(De-c)*.5,ht-=(De-c)*.5):this._stratchPos.indexOf("bottom")!==-1&&(ut+=(De-c)*.5,ht+=(De-c)*.5),ct<0?this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left"):((ae=this.chosedTarget)===null||ae===void 0||ae.setAttribute("cx",Ke.toString()),(Ce=this.chosedTarget)===null||Ce===void 0||Ce.setAttribute("rx",ct.toString())),ht<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top"):((me=this.chosedTarget)===null||me===void 0||me.setAttribute("cy",ut.toString()),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("ry",ht.toString()));break;case"rect":var Ne=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),tt=Number((B=this.chosedTarget)===null||B===void 0?void 0:B.getAttribute("y")),at=Number((ke=this.chosedTarget)===null||ke===void 0?void 0:ke.getAttribute("width")),ze=Number((Ee=this.chosedTarget)===null||Ee===void 0?void 0:Ee.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(Ne+=be-l,at-=be-l):this._stratchPos.indexOf("right")!==-1&&(at+=be-l),at<0?this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left"):((ge=this.chosedTarget)===null||ge===void 0||ge.setAttribute("x",Ne.toString()),(Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("width",at.toString())),this._stratchPos.indexOf("top")!==-1?(tt+=De-c,ze-=De-c):this._stratchPos.indexOf("bottom")!==-1&&(ze+=De-c),ze<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top"):((fe=this.chosedTarget)===null||fe===void 0||fe.setAttribute("y",tt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("height",ze.toString()));break}this.updateSelectionBox(),l=_e.clientX+this._offsetX,c=_e.clientY+this._offsetY}},G=H=>{if(this._isTouch)if(this.isHolding&&(this.isMoving&&(this.isMoving=!1,this.AddNewState(()=>{})),this.isHolding=!1),this.isCreating){if(this.isDrawing)this.isDrawing=!1,this.eventTrigger.emit("createNew"),this.AddNewState(()=>{});else if(!this.isChosed&&!this.isStretch&&this._currentMode!="text"&&this._currentMode!=""){const W=_==null?void 0:_.lastElementChild;if(W){const K=W.previousElementSibling;_==null||_.removeChild(K)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))};_?(document.addEventListener("keydown",T.bind(this)),_.addEventListener("dblclick",b.bind(this)),_.addEventListener("mousedown",w.bind(this)),document.addEventListener("mousemove",C.bind(this)),_.addEventListener("mouseup",k.bind(this)),_.addEventListener("touchstart",R.bind(this)),document.addEventListener("touchmove",U.bind(this)),_.addEventListener("touchend",G.bind(this))):this.log("no svgImage");const j=()=>{const H=document.getElementById("svgImage");H?(document.removeEventListener("keydown",T.bind(this)),H.removeEventListener("dblclick",b.bind(this)),H.removeEventListener("mousedown",w.bind(this)),document.removeEventListener("mousemove",C.bind(this)),H.removeEventListener("mouseup",k.bind(this)),H.removeEventListener("touchstart",R.bind(this)),document.removeEventListener("touchmove",U.bind(this)),H.removeEventListener("touchend",G.bind(this))):this.log("no svgImage");const W=document.getElementById("comments_panel");W&&(W.innerHTML=""),this.eventTrigger.off("clearAll",j)};this.eventTrigger.on("clearAll",j)})}clickCreateText(l,c){var f,p;let m;l.touches?m=l.touches[0]:m=l,this.showHiddenSelectedBox(!1);const v=m.clientX+this._offsetX,_=m.clientY+this._offsetY,b=document.createElementNS("http://www.w3.org/2000/svg","g");if(b.setAttribute("id",`${this._currentMode}_${this.getTime()}`),!this.isTyping&&!this.isChosed){const w=document.createElementNS("http://www.w3.org/2000/svg","text");w.setAttribute("x",v+3),w.setAttribute("y",(_+24-Number(this._FontSize)/2).toString()),w.setAttribute("font-size",this._FontSize),w.setAttribute("stroke",this._Textcolor),w.setAttribute("stroke-width",this._TextstrokeWidth),w.setAttribute("fill",this._Textcolor),w.setAttribute("lengthAdjust","spacingAndGlyphs"),w.textContent=c,b.setAttribute("type","text"),b.appendChild(w);const C=document.getElementById("selectionBox_g");C&&((f=C.parentNode)===null||f===void 0||f.insertBefore(b,(p=C.parentNode)===null||p===void 0?void 0:p.lastElementChild)),this.isTyping=!0,this.AddNewState(()=>{this.eventTrigger.emit("createNew")})}}getInitVector(l,c){const f=Math.sqrt(l*l+c*c);return f==0?[0,0]:[l/f,c/f]}getVerticalUnitVector(l,c){if(Math.sqrt(l*l+c*c)===0)return[0,0];const p=-c,m=l,v=Math.sqrt(p*p+m*m),_=p/v,b=m/v;return[_,b]}getTwoPointLength(l,c){return l==c?0:Math.sqrt(l*l+c*c)}hiddenAllInput(){const l=document.querySelectorAll("foreignObject");l.length>0&&l.forEach(c=>{const f=c.querySelector("input"),p=c.parentNode;let m;p&&(m=p.querySelector("text")),m&&f&&(f.value!=""?m.textContent=f.value:m.textContent="双击此处输入内容",f.style.display="none")})}showHiddenSelectedBox(l){if(l){const f=this.chosedTarget.getBBox();this.selectionBox.setAttribute("x",f.x),this.selectionBox.setAttribute("y",f.y),this.selectionBox.setAttribute("width",f.width),this.selectionBox.setAttribute("height",f.height),this.selectionBox.style.display="inline";for(var c=0;c<8;c++)this.handles[c].style.display="inline"}else{this.selectionBox.style.display="none";for(var c=0;c<8;c++)this.handles[c].style.display="none"}this.updateSelectionBox()}updateSelectionBox(){var l;const c=(l=this.chosedTarget)===null||l===void 0?void 0:l.getBBox();if(c){this.selectionBox.setAttribute("x",c.x-4),this.selectionBox.setAttribute("y",c.y-4),this.selectionBox.setAttribute("width",c.width+8),this.selectionBox.setAttribute("height",c.height+8);const f=this.selectionBox.getBBox();for(let p=0;p<8;p++){const m=this.handles[p];switch(p){case 0:m.setAttribute("x",f.x-4),m.setAttribute("y",f.y-4);break;case 1:m.setAttribute("x",f.x+f.width/2-4),m.setAttribute("y",f.y-4);break;case 2:m.setAttribute("x",f.x+f.width-4),m.setAttribute("y",f.y-4);break;case 3:m.setAttribute("x",f.x+f.width-4),m.setAttribute("y",f.y+f.height/2-4);break;case 4:m.setAttribute("x",f.x+f.width-4),m.setAttribute("y",f.y+f.height-4);break;case 5:m.setAttribute("x",f.x+f.width/2-4),m.setAttribute("y",f.y+f.height-4);break;case 6:m.setAttribute("x",f.x-4),m.setAttribute("y",f.y+f.height-4);break;case 7:m.setAttribute("x",f.x-4),m.setAttribute("y",f.y+f.height/2-4);break}}}}publishComments(){this.deleteSvgCommentsListeners()}updateCommentsColor(){document.querySelectorAll("path").forEach(p=>{p.setAttribute("stroke","red")}),document.querySelectorAll("ellipse").forEach(p=>{p.setAttribute("stroke","blue")}),document.querySelectorAll("rect").forEach(p=>{p.id!="selectionBox"&&p.setAttribute("stroke","green")})}deleteSvgCommentsListeners(){const l=document.getElementById("svgImage");l&&(l.removeEventListener("mousedown",()=>{}),document.removeEventListener("mousemove",()=>{}),l.removeEventListener("mouseup",()=>{}),l.removeEventListener("mouseover",()=>{}))}deleteCurrentComments(){if(this.isChosed){const l=document.getElementById("svgImage");l==null||l.removeChild(this.chosedTarget.parentNode),this.showHiddenSelectedBox(!1)}this.AddNewState(()=>{})}getTime(){const l=new Date,c=l.getFullYear(),f=l.getMonth()+1<10?`0${l.getMonth()+1}`:l.getMonth()+1,p=l.getDate()<10?`0${l.getDate()}`:l.getDate(),m=l.getHours()<10?`0${l.getHours()}`:l.getHours(),v=l.getMinutes()<10?`0${l.getMinutes()}`:l.getMinutes(),_=l.getSeconds()<10?`0${l.getSeconds()}`:l.getSeconds();return c+f+p+m+v+_}duplicateComment(){var l,c,f,p,m,v,_,b,w,C,k,T,R,U;if(this.isChosed){const j=document.getElementById("svgImage"),H=this.chosedTarget.parentNode.cloneNode(!0);switch(j==null||j.insertBefore(H,j==null?void 0:j.lastElementChild),this.chosedTarget=H.firstChild,this.chosedTarget.tagName){case"path":const K=((l=this.chosedTarget)===null||l===void 0?void 0:l.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,O=>{const[L,M]=O.split(",").map(parseFloat),I=L+20,F=M+10;return`${I},${F}`});(c=this.chosedTarget)===null||c===void 0||c.setAttribute("d",K);break;case"ellipse":(f=this.chosedTarget)===null||f===void 0||f.setAttribute("cx",(Number((p=this.chosedTarget)===null||p===void 0?void 0:p.getAttribute("cx"))+20).toString()),(m=this.chosedTarget)===null||m===void 0||m.setAttribute("cy",(Number((v=this.chosedTarget)===null||v===void 0?void 0:v.getAttribute("cy"))+10).toString());break;case"rect":(_=this.chosedTarget)===null||_===void 0||_.setAttribute("x",(Number((b=this.chosedTarget)===null||b===void 0?void 0:b.getAttribute("x"))+20).toString()),(w=this.chosedTarget)===null||w===void 0||w.setAttribute("y",(Number((C=this.chosedTarget)===null||C===void 0?void 0:C.getAttribute("y"))+10).toString());break;case"text":(k=this.chosedTarget)===null||k===void 0||k.setAttribute("x",(Number((T=this.chosedTarget)===null||T===void 0?void 0:T.getAttribute("x"))+20).toString()),(R=this.chosedTarget)===null||R===void 0||R.setAttribute("y",(Number((U=this.chosedTarget)===null||U===void 0?void 0:U.getAttribute("x"))+10).toString());var G=this.chosedTarget.getAttribute("font-size");const $=this.chosedTarget.parentNode;if($){const O=$.querySelector("foreignObject");O&&(O.setAttribute("x",(Number(this.chosedTarget.getAttribute("x"))-3+20).toString()),O.setAttribute("y",(Number(this.chosedTarget.getAttribute("y"))-(24-Number(G)/2)+10).toString()))}break}this.updateSelectionBox()}this.AddNewState(()=>{})}AddNewState(l){this.saveCurrentState(c=>{this._revocationMechanism&&this._revocationMechanism&&this._revocationMechanism.AddNewState(c,l)}),this.eventTrigger.emit("newState")}saveCurrentState(l){function c(m){const v={};for(let _=0;_<m.length;_++){const b=m[_];v[b.name]=b.value}return v}const f=document.getElementById("svgImage");if(f){const m=f.querySelectorAll("g");var p=[];m.forEach(v=>{if(v.getAttribute("id")){const b=v.attributes,w=v.children,C=new Map;let k=null;if(v.getAttribute("type")==="text"){for(let T=0;T<w.length;T++){const{tagName:R}=w[T];C.set(R,c(w[T].attributes)),R==="text"&&(k=w[T].textContent)}var _=new d(b,C,k);p.push(_)}else{for(let R=0;R<w.length;R++)C.set(w[R].tagName,c(w[R].attributes));var _=new d(b,C,null);p.push(_)}}})}l(p)}displayState(l){const c=document.getElementById("svgImage");if(c){c.querySelectorAll("g").forEach(v=>{v.getAttribute("id")&&c.removeChild(v)});for(const v in l){const _=l[v];var f=document.createElementNS("http://www.w3.org/2000/svg","g");const{attributes:b}=_;var{textContent:p}=_;for(let T=0;T<b.length;T++){const R=b[T].name,U=b[T].value;f.setAttribute(R,U)}const{childrenContents:w}=_;w.forEach((T,R)=>{const U=document.createElementNS("http://www.w3.org/2000/svg",R);if(R=="text"&&(U.textContent=p),T)for(const G in T){const j=T[G];U.setAttribute(G,j)}f.appendChild(U)}),c==null||c.insertBefore(f,c==null?void 0:c.lastElementChild);const C=c==null?void 0:c.querySelector("image");C&&(c==null||c.insertBefore(C,c==null?void 0:c.firstElementChild));const k=c==null?void 0:c.querySelector("#selectionBox_g");k&&(c==null||c.removeChild(k),c==null||c.appendChild(k))}}}autoSaveInput(l){this.isTyping&&(this.isTyping=!1,this.hiddenAllInput(),this.AddNewState(()=>{l&&l()}))}setCurrentMode(l){this.autoSaveInput(),this._currentMode=l,l===""&&this.eventTrigger.emit("cancelAllMode")}ReDo(l){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.ReDo(c=>{this.displayState(c),this.showHiddenSelectedBox(!1),l&&l()}),this.checkSelectionBox()}UnDo(l){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.UnDo(c=>{this.displayState(c),this.showHiddenSelectedBox(!1),l&&l()}),this.checkSelectionBox()}checkSelectionBox(){const l=document.getElementById("svgImage"),c=l==null?void 0:l.querySelector("#selectionBox_g");if(c){if(c.childNodes.length>2)return;l==null||l.removeChild(c)}this.selectionBox=null,this.handles=[];const f=document.createElementNS("http://www.w3.org/2000/svg","g");this.selectionBox=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.selectionBox.setAttribute("stroke","#066CFC"),this.selectionBox.setAttribute("stroke-width","1"),this.selectionBox.setAttribute("fill","none"),this.selectionBox.setAttribute("id","selectionBox"),this.selectionBox.style.display="none",f.setAttribute("id","selectionBox_g"),f.appendChild(this.selectionBox);for(let m=0;m<8;m++){const v=document.createElementNS("http://www.w3.org/2000/svg","rect");v.setAttribute("width","8"),v.setAttribute("height","8"),v.setAttribute("rx","2"),v.setAttribute("ry","2");var p;m==0&&(p="left_top",v.setAttribute("id",p)),m==1&&(p="top",v.setAttribute("id",p)),m==2&&(p="right_top",v.setAttribute("id",p)),m==3&&(p="right",v.setAttribute("id",p)),m==4&&(p="right_bottom",v.setAttribute("id",p)),m==5&&(p="bottom",v.setAttribute("id",p)),m==6&&(p="left_bottom",v.setAttribute("id",p)),m==7&&(p="left",v.setAttribute("id",p)),v.setAttribute("type","handle"),v.setAttribute("fill","white"),v.setAttribute("stroke-width","0.8"),v.setAttribute("stroke","#066CFC"),v.setAttribute("class","selection_box_handle"),v.style.cursor="pointer",v.style.display="none",f.appendChild(v),this.handles.push(v)}l==null||l.appendChild(f)}endCommentsTool(){var l;this._commentsList={},this._currentMode="path",this._Pathcolor="#066CFC",this._Ellipsecolor="#066CFC",this._Rectcolor="#066CFC",this._Arrowcolor="#066CFC",this._Textcolor="#066CFC",this._PathstrokeWidth="2",this._EllipsestrokeWidth="2",this._RectstrokeWidth="2",this._ArrowstrokeWidth="2",this._TextstrokeWidth="1",this._FontSize="16",this._stratchPos="",this.isCreating=!1,this.isDrawing=!1,this.isMoving=!1,this.isChosed=!1,this.isHolding=!1,this.isStretch=!1,this.isHovering=!1,this.isDuplicate=!1,this.isTyping=!1,this.chosedTarget=null,this.selectionBox=null,this.handles=null,this.setActive(!1),(l=this._revocationMechanism)===null||l===void 0||l.destroy(),this._revocationMechanism=null,this.eventTrigger.emit("clearAll")}saveComments(l){this.showHiddenSelectedBox(!1),this.autoSaveInput(l)}setTargetColor(l){if(this.chosedTarget.tagName=="text")this.chosedTarget.setAttribute("stroke",l),this.chosedTarget.setAttribute("fill",l);else if(this.chosedTarget.tagName=="path"){const c=this.chosedTarget.parentNode;c&&c.getAttribute("type")=="arrow"?(this.chosedTarget.setAttribute("stroke",l),this.chosedTarget.setAttribute("fill",l)):this.chosedTarget.setAttribute("stroke",l)}else this.chosedTarget.setAttribute("stroke",l);this.AddNewState(()=>{})}setTargetWidth(l){this.chosedTarget.tagName=="text"?this.chosedTarget.setAttribute("font-size",l.toString()):this.chosedTarget.setAttribute("stroke-width",l.toString()),this.AddNewState(()=>{})}set isTouch(l){this._isTouch=l}set offsetX(l){this._offsetX=l}set offsetY(l){this._offsetY=l}set pathColor(l){this._Pathcolor=l}set ellipseColor(l){this._Ellipsecolor=l}set rectColor(l){this._Rectcolor=l}set arrowColor(l){this._Arrowcolor=l}set textColor(l){this._Textcolor=l}set pathStrokeWidth(l){this._PathstrokeWidth=l}set ellipseStrokeWidth(l){this._EllipsestrokeWidth=l}set rectStrokeWidth(l){this._RectstrokeWidth=l}set arrowSize(l){this._ArrowstrokeWidth=l}set textFontSize(l){this._FontSize=l}destroy(){this.endCommentsTool()}}class h{constructor(l){this.eventTrigger=l,this.stateMap=new Map,this.stateIndex=0,this.stateMap.set(0,null)}AddNewState(l,c){if(this.stateIndex===0)this.stateIndex+=1,this.stateMap.set(this.stateIndex,l),this.stateIndex+=1;else{const _=this.stateMap.get(this.stateIndex-1);f(l,_)||(this.stateMap.set(this.stateIndex,l),this.stateIndex+=1)}if(this.stateMap.size-1>this.stateIndex){for(let _=this.stateIndex;_<=this.stateMap.size;_++)this.stateMap.delete(_);this.stateIndex=this.stateMap.size-1}c();function f(_,b){if(b==null||_==null||_.length!==b.length)return!1;for(let w=0;w<_.length;w++){const C=_[w],k=b[w];if(!p(C,k))return!1}return!0}function p(_,b){return!(Object.keys(_).length!==Object.keys(b).length||!v(_.attributes,b.attributes)||!m(_.childrenContents,b.childrenContents)||_.textContent!==b.textContent)}function m(_,b){if(_.size!==b.size)return!1;for(const[w,C]of _)if(!b.has(w)||b.get(w)!==C)return!1;return!0}function v(_,b){if(_.length!==b.length)return!1;for(let w=0;w<_.length;w++){const C=_.item(w),k=b.item(w);if(C&&k&&(C.name!==k.name||C.value!==k.value))return!1}return!0}}ReDo(l){this.stateIndex==this.stateMap.size?(this.eventTrigger.emit("noNewState"),l(this.stateMap.get(this.stateIndex-1))):(this.stateIndex+=1,this.stateIndex==this.stateMap.size&&this.eventTrigger.emit("noNewState"),l(this.stateMap.get(this.stateIndex-1)))}UnDo(l){this.stateIndex==1?this.eventTrigger.emit("noPreviousState"):(this.stateIndex-=1,this.stateIndex==1&&this.eventTrigger.emit("noPreviousState"),l(this.stateMap.get(this.stateIndex-1)))}destroy(){this.stateIndex=0,this.stateMap.clear()}}class d{constructor(l,c,f){this.attributes=l,this.childrenContents=c,this.textContent=f}}},"./src/toolbar/FirstPersonMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u);const{cameraControl:l}=this.viewer,{cameraControlNavModeMediator:c}=u;l.navMode="orbit",l.followPointer=!0,this.cameraControl=l,l.on("personModeSpeedUp",f=>{d.eventTrigger.emit("personModeSpeedUp",f)}),l.on("personModeSpeedDown",f=>{d.eventTrigger.emit("personModeSpeedDown",f)}),this.on("active",f=>{c.setFirstPersonModeActive(f),f&&(l.followPointer=!0)}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)})}setdirectionChangeCancel(){this.goLeft=!1,this.goRight=!1,this.goUp=!1,this.goDown=!1,this.goForward=!1,this.goBackward=!1}speedUp(){this.cameraControl.speedUp()}speedDown(){this.cameraControl.speedDown()}set moveRate(d){this.cameraControl.moveRate=d}get moveRate(){return this.cameraControl.moveRate}set goRight(d){this.cameraControl.goRight=d}set goLeft(d){this.cameraControl.goLeft=d}set goUp(d){this.cameraControl.goUp=d}set goDown(d){this.cameraControl.goDown=d}set goForward(d){this.cameraControl.goForward=d}set goBackward(d){this.cameraControl.goBackward=d}smallCanvas(){const d=new x.Viewer({spinnerElementId:"manyou_spinner",canvasId:"canvas_manyou",transparent:!0,resolutionScale:window.devicePixelRatio});d.camera.eye=[-3.933,2.855,27.018],d.camera.look=[4.4,3.724,8.899],d.camera.up=[-.018,.999,.039]}}},"./src/toolbar/FitAction.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");x.math.vec3();class A extends S.default{constructor(d,u={}){super(d,u)}fit(d){const{viewer:u}=this,{scene:l}=u,{center:c}=l;let f;this.bimViewer.multiModel?f=l.getAABB(l.visibleObjectIds):f=l.aabb;const p=x.math.getAABB3Diag(f);u.cameraControl.pivotPos=c,u.cameraControl.planView&&(u.cameraControl.planView=!1),u.cameraFlight.flyTo({aabb:f,orthoScale:p*1.3,duration:1},d)}set fov(d){this.viewer.scene.cameraFlight.fitFOV=d}get fov(){return this.viewer.scene.cameraFlight.fitFOV}set duration(d){this.viewer.scene.cameraFlight.duration=d}get duration(){return this.viewer.scene.cameraFlight.duration}}},"./src/toolbar/HideTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/Controller.ts");class S extends x.default{constructor(h,d){super(h,d),this.on("active",u=>{u?(this.viewer.cameraControl.doublePickFlyTo=!1,this._onPick=this.viewer.cameraControl.on("picked",l=>{l.entity&&(l.entity.visible=!1)})):(this.viewer.cameraControl.doublePickFlyTo=!1,this._onPick!==void 0&&(this.viewer.cameraControl.off(this._onPick),this._onPick=void 0))}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)})}}},"./src/toolbar/MarkerTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A="data:image/svg+xml;charset=utf-8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="#1e90ff" stroke="#ffffff" stroke-width="2"/><circle cx="12" cy="12" r="4" fill="#ffffff"/></svg>');class h extends S.default{constructor(u,l={}){if(super(u,l),this._markers=new Map,this._visible=!0,this._focusOnClick=!1,this._defaultIcon=A,this._typeIcons=new Map,this._idCounter=0,this.eventTrigger=u.eventTrigger,this._focusOnClick=!!l.focusOnClick,document.getElementById("myMarkerDiv"))this.markerWrapper=document.getElementById("myMarkerDiv");else{this.markerWrapper=document.createElement("div"),this.markerWrapper.id="myMarkerDiv";const{canvas:c}=u.viewer.scene.canvas;c.parentNode.insertBefore(this.markerWrapper,c)}this.annotationsPlugin=new x.AnnotationsPlugin(this.viewer,{markerHTML:"<div class='bimx-marker' id='{{id}}' style='position:absolute;cursor:pointer;'><img src='{{iconPath}}'></div>",labelHTML:"<div class='bimx-marker-label' style='position:absolute;'>{{text}}</div>",container:this.markerWrapper,values:{id:"",iconPath:A,text:""}}),this.annotationsPlugin.on("markerClicked",c=>{const f=this._markers.get(c.id),p=f?f.worldPos:[c.worldPos[0],c.worldPos[1],c.worldPos[2]];this.eventTrigger.emit("markerClicked",f??{id:c.id,worldPos:p}),this._focusOnClick&&p&&this._focusOn(p)}),this.annotationsPlugin.on("markerDoubleClicked",c=>{const f=this._markers.get(c.id);this.eventTrigger.emit("markerDoubleClicked",f??{id:c.id,worldPos:[c.worldPos[0],c.worldPos[1],c.worldPos[2]]})}),this.annotationsPlugin.on("markerMouseEnter",c=>{const f=this._markers.get(c.id);f&&f.text&&c.setLabelShown(!0)}),this.annotationsPlugin.on("markerMouseLeave",c=>{c.setLabelShown(!1)}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)})}setAllVisible(u=!this._visible){this._visible=u,this.annotationsPlugin.setAllVisible(u)}setDefaultIcon(u){this._defaultIcon=u}setTypeIcons(u){for(const l in u)Object.prototype.hasOwnProperty.call(u,l)&&this._typeIcons.set(l,u[l])}setTypeIcon(u,l){this._typeIcons.set(u,l)}setFocusOnClick(u){this._focusOnClick=u}clickToCreateMarker(u){if(!this.getActive()||!this.getEnabled())return;const l=this.getCanvasPos(u);if(!l)return;const c=this.viewer.scene.pick({canvasPos:l,pickSurface:!0});if(c)return this._createMarkerFromPickResult(c)}addMarker(u,l,c,f,p){const m=f??this._generateId(),v=this._resolveIcon(c);this.annotationsPlugin.createAnnotation({id:m,worldPos:[u[0],u[1],u[2]],occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:m,iconPath:v,text:p??""}});const _={id:m,worldPos:[u[0],u[1],u[2]],type:c,data:l,text:p};return this._markers.set(m,_),_}removeMarker(u){const l=this._markers.get(u);if(!l){this.warn("removeMarker() - Marker not found: "+u);return}this.annotationsPlugin.destroyAnnotation(u),this._markers.delete(u),this.eventTrigger.emit("markerRemoved",l)}getMarkerById(u){return this._markers.get(u)}getMarkers(){return Array.from(this._markers.values()).map(u=>Object.assign(Object.assign({},u),{worldPos:[...u.worldPos]}))}setMarkers(u){this.clear(),(u||[]).forEach(l=>{l&&l.worldPos&&l.worldPos.length>=3&&this.addMarker(l.worldPos,l.data,l.type,l.id,l.text)})}clear(){this.annotationsPlugin.clear(),this._markers.clear(),this.eventTrigger.emit("markersCleared")}getCanvasPos(u){const l=[];if(!u)u=window.event,l[0]=u.x,l[1]=u.y;else if("TouchEvent"in window&&u instanceof TouchEvent){if(!u.touches||u.touches.length===0)return;const c=u.touches[0];let f=u.target,p=0,m=0;for(;f.offsetParent;)p+=f.offsetLeft,m+=f.offsetTop,f=f.offsetParent;l[0]=c.pageX-p,l[1]=c.pageY-m}else{let c=this.viewer.scene.canvas.canvas,f=0,p=0;for(;c.offsetParent;)f+=c.offsetLeft,p+=c.offsetTop,c=c.offsetParent;l[0]=u.pageX-f,l[1]=u.pageY-p}return l}destroy(){this.clear(),this.annotationsPlugin.destroy(),this.markerWrapper&&this.markerWrapper.parentNode&&this.markerWrapper.parentNode.removeChild(this.markerWrapper),super.destroy()}_createMarkerFromPickResult(u){const l=this._generateId(),c=this._resolveIcon(void 0),f=this.annotationsPlugin.createAnnotation({id:l,pickResult:u,occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:l,iconPath:c}}),p={id:l,worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]],entityId:u.entity?u.entity.id:void 0};return this._markers.set(l,p),this.eventTrigger.emit("markerCreated",p),p}_resolveIcon(u){return u&&this._typeIcons.has(u)?this._typeIcons.get(u):this._defaultIcon}_focusOn(u){const l=[u[0],u[1],u[2]];this.viewer.cameraFlight.flyTo({look:l}),this.viewer.cameraControl.pivotPos=l}_generateId(){return this._idCounter+=1,`marker_${Date.now()}_${this._idCounter}`}}},"./src/toolbar/MeasureTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./src/Controller.ts"),S=a("./src/toolbar/MeasureTools/MeasureAngleTool.ts"),A=a("./src/toolbar/MeasureTools/MeasureDistanceTool.ts");class h extends x.default{constructor(u,l){super(u),this._isTouch=!1,this._tools={},this._toolType="distance",this.eventTrigger=u.eventTrigger,this._measure_distance_tool=new A.default(u,{}),this._measure_angle_tool=new S.default(u,{}),this._tools.distance=this._measure_distance_tool,this._tools.angle=this._measure_angle_tool,this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.setActive(!0),this._initEventHandle()}_initEventHandle(){this.eventTrigger.on("clickAngleMeasure",u=>{this._active&&(this.getActiveByType("angle")||this.setActiveByType("angle",!0))}),this.eventTrigger.on("clickDistanceMeasure",u=>{this._active&&(this.getActiveByType("distance")||this.setActiveByType("distance",!0))})}setActive(u=!this._active){this._active=u,this._measure_angle_tool.setEnabled(u),this._measure_distance_tool.setEnabled(u),u||(this._measure_angle_tool.setActive(u),this._measure_distance_tool.setActive(u))}getActive(){return this._active}set isTouch(u){this._isTouch=u,this._measure_angle_tool.isTouch=u,this._measure_distance_tool.isTouch=u}get isTouch(){return this._isTouch}get measureAngleTool(){return this._measure_angle_tool}get measureDistanceTool(){return this._measure_distance_tool}getMeasureToolByType(u){return this._tools[u]}setActiveByType(u,l=!this._tools[u].getActive()){this._toolType=u;for(let c in this._tools)u==c?this._tools[c].setActive(l):this._tools[c].setActive(!1)}getActiveByType(u){return this._tools[u].getActive()}get currentTool(){return this._tools[this._toolType]}SetMeasureAngleActive(u=!this._measure_angle_tool.getActive(),l=()=>{}){this._measure_angle_tool.setActive(u),l(this._measure_angle_tool.getActive())}SetMeasureDistanceActive(u=!this._measure_distance_tool.getActive(),l=()=>{}){this._measure_distance_tool.setActive(u),l(this._measure_distance_tool.getActive())}setAllDisActive(){for(let u in this._tools)this._tools[u].setActive(!1)}setMeasureOffSet(u,l){this.measureAngleTool.offsetX=u,this.measureAngleTool.offsetY=l,this.measureDistanceTool.offsetX=u,this.measureDistanceTool.offsetY=l}setSnapRadius(u){this.viewer.cameraControl.snapRadius=u}destroy(){this._measure_distance_tool.destroy(),this._measure_angle_tool.destroy()}}},"./src/toolbar/MeasureTools/MeasureAngleTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u),this._offsetX=0,this._offsetY=0,this._isTouch=!1,this._approximate=!0,this._precision=2,this.eventTrigger=d.eventTrigger,this.angleMeasureContainer=document.createElement("div"),this.angleMeasureContainer.id="myAngleMeasuresDiv";const{canvas:l}=d.viewer.scene.canvas;l.parentNode.insertBefore(this.angleMeasureContainer,l),this._angleMeasurementsPlugin=new x.AngleMeasurementsPlugin(this.viewer,{container:this.angleMeasureContainer,defaultColor:"#0065FC"}),this._angleMeasurementsMouseControl=new x.AngleMeasurementsMouseControl(this._angleMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsTouchControl=new x.AngleMeasurementsTouchControl(this._angleMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsSimulateMouseControl=new x.AngleMeasurementsSimulateMouseControl(this._angleMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY,snapping:!0}),this._angleMeasurementsMouseControl.snapping=!0,this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this._initSettings(),this._initializeMeasure()}setActive(d){this._active=d,d?this.chosedTarget&&this.chosedTarget.setHighlighted(!0):(this.refreshMouseState(),this.setAllHightLighted(!1)),this._isTouch?(this._angleMeasurementsTouchControl.active=d,this._angleMeasurementsSimulateMouseControl.active=d):this._angleMeasurementsMouseControl.active=d}getActive(){return this._active}_initSettings(){this._angleMeasurementsMouseControl.activate(),this._angleMeasurementsMouseControl.active=!1,this._angleMeasurementsTouchControl.activate(),this._angleMeasurementsTouchControl.active=!1,this._angleMeasurementsSimulateMouseControl.activate(),this._angleMeasurementsSimulateMouseControl.active=!1}_initializeMeasure(){this._angleMeasurementsPlugin.on("measurementCreated",l=>{this.eventTrigger.emit("newAngleMeasure",{id:l.id}),this.newMeasure=l,this.chosedTarget=null}),this._angleMeasurementsPlugin.on("measurementEnd",l=>{if(this.getMeasureResultByID(l.id)===0){this.destroyMeasurementById(l.id);return}this.eventTrigger.emit("createAngleMeasure",{id:l.id,result:this.getMeasureResultByID(l.id)}),this.setAllHightLighted(!1),this.chosedTarget=l,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._angleMeasurementsPlugin.on("mouseOver",l=>{l.measurement.setHighlighted(!0)}),this._angleMeasurementsPlugin.on("mouseLeave",l=>{l.angleMeasurement==this.chosedTarget&&this._active||l.measurement.setHighlighted(!1)}),this._angleMeasurementsPlugin.on("clickMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("touchMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("measurementDestroyed",l=>{this.eventTrigger.emit("AngleMeasureDestroyed",{id:l.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=l=>{if(this._active&&(l.key==="Delete"||l.keyCode===8)){if(!this.chosedTarget)return;this.destroyMeasurementById(this.chosedTarget.id),this._angleMeasurementsPlugin.fire("measureDelete",null),this.getNumMeasurements()==0&&(this.chosedTarget=null)}};document.addEventListener("mousemove",d.bind(this)),document.addEventListener("keydown",u.bind(this)),this.on("destroy",()=>{document.removeEventListener("mousemove",d.bind(this)),document.removeEventListener("keydown",u.bind(this))})}set isTouch(d){this._isTouch=d,d||this._angleMeasurementsMouseControl.deactivate()}get isTouch(){return this._isTouch}set precision(d){this._precision=d,this._angleMeasurementsPlugin.precision=d}get precision(){return this._precision}set offsetX(d){this._offsetX=d,this._isTouch?(this._angleMeasurementsTouchControl.offsetX=d,this._angleMeasurementsSimulateMouseControl.offsetX=d):this._angleMeasurementsMouseControl.offsetX=d}get offsetX(){return this._offsetX}set offsetY(d){this._offsetY=d,this._isTouch?(this._angleMeasurementsTouchControl.offsetY=d,this._angleMeasurementsSimulateMouseControl.offsetY=d):this._angleMeasurementsMouseControl.offsetY=d}get offsetY(){return this._offsetY}refreshMouseState(){this.newMeasure&&(this.destroyMeasurementById(this.newMeasure.id),this.isTouch?(this._angleMeasurementsTouchControl.touchState=0,this._angleMeasurementsSimulateMouseControl.mouseState=0):this._angleMeasurementsMouseControl.mouseState=0,this.setAllHightLighted(!1),this.newMeasure=null)}setAllVisible(d){this._angleMeasurementsPlugin.setMeasurementsShown(d)}setSnappingEnabled(d){return this._angleMeasurementsMouseControl.snapping=d}getNumMeasurements(){return Object.keys(this._angleMeasurementsPlugin.measurements).length}getMeasurementsList(){return this._angleMeasurementsPlugin.measurements}getMeasurementById(d){return this.getMeasurementsList()[d]}getMeasureResultByID(d){const u=this.getMeasurementById(d);return u?u.angle:0}setMeasureColorByID(d,u){const l=this.getMeasurementById(d);l.color=u}setMeasureClickbleById(d,u){const l=this.getMeasurementById(d);l.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const l in u)u[l].setHighlighted(d)}setVisibleById(d,u){const l=this.getMeasurementById(d);l.visible=u}setAngleLabelVisible(d,u){const l=this.getMeasurementById(d);l.angleVisible=u}destroyMeasurementById(d){this._angleMeasurementsPlugin.destroyMeasurement(d)}onSimulateMousedown(d){this._angleMeasurementsSimulateMouseControl.onMousedown(d)}onSimulateMousemove(d){this._angleMeasurementsSimulateMouseControl.onMousemove(d)}onSimulateMouseup(d){this._angleMeasurementsSimulateMouseControl.onMouseup(d)}clear(){this._angleMeasurementsPlugin.clear()}stop(){this._isTouch?(this._angleMeasurementsTouchControl.deactivate(),this._angleMeasurementsSimulateMouseControl.deactivate()):this._angleMeasurementsMouseControl.deactivate()}destroy(){this.fire("destroy",!0),this.angleMeasureContainer.parentNode&&this.angleMeasureContainer.parentNode.removeChild(this.angleMeasureContainer),this._angleMeasurementsPlugin.destroy(),this._angleMeasurementsMouseControl.destroy(),this._angleMeasurementsTouchControl.destroy(),this._angleMeasurementsSimulateMouseControl.destroy(),super.destroy()}}},"./src/toolbar/MeasureTools/MeasureDistanceTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u),this._offsetX=0,this._offsetY=0,this._isTouch=!1,this._approximate=!0,this._precision=2,this._scale=1,this._unit="m",this.eventTrigger=d.eventTrigger,this.distanceMeasureContainer=document.createElement("div"),this.distanceMeasureContainer.id="myDistanceMeasuresDiv";const{canvas:l}=d.viewer.scene.canvas;l.parentNode.insertBefore(this.distanceMeasureContainer,l),this._distanceMeasurementsPlugin=new x.DistanceMeasurementsPlugin(this.viewer,{container:this.distanceMeasureContainer,defaultAxisVisible:!1,defaultColor:"#0065FC"}),this._distanceMeasurementsMouseControl=new x.DistanceMeasurementsMouseControl(this._distanceMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsTouchControl=new x.DistanceMeasurementsTouchControl(this._distanceMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsSimulateMouseControl=new x.DistanceMeasurementsSimulateMouseControl(this._distanceMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY,snapping:!0}),this._distanceMeasurementsMouseControl.snapping=!0,this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this._initSettings(),this._initializeMeasure()}setActive(d){this._active=d,d?this.chosedTarget&&this.chosedTarget.setHighlighted(!0):(this.refreshMouseState(),this.setAllHightLighted(!1)),this._isTouch?(this._distanceMeasurementsTouchControl.active=d,this._distanceMeasurementsSimulateMouseControl.active=d):this._distanceMeasurementsMouseControl.active=d}getActive(){return this._active}_initSettings(){this._distanceMeasurementsMouseControl.activate(),this._distanceMeasurementsMouseControl.active=!1,this._distanceMeasurementsTouchControl.activate(),this._distanceMeasurementsTouchControl.active=!1,this._distanceMeasurementsSimulateMouseControl.activate(),this._distanceMeasurementsSimulateMouseControl.active=!1}_initializeMeasure(){this._distanceMeasurementsPlugin.on("measurementCreated",l=>{this.eventTrigger.emit("newDistanceMeasure",{id:l.id}),this.newMeasure=l,this.chosedTarget=null}),this._distanceMeasurementsPlugin.on("measurementEnd",l=>{if(this.getMeasureResultByID(l.id)===0){this.destroyMeasurementById(l.id);return}this.eventTrigger.emit("createDistanceMeasure",{id:l.id,result:this.getMeasureResultByID(l.id),xResult:l.xLabel,yResult:l.yLabel,zResult:l.zLabel}),this.setAllHightLighted(!1),this.chosedTarget=l,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._distanceMeasurementsPlugin.on("mouseOver",l=>{l.measurement.setHighlighted(!0)}),this._distanceMeasurementsPlugin.on("mouseLeave",l=>{l.distanceMeasurement==this.chosedTarget&&this._active||l.measurement.setHighlighted(!1)}),this._distanceMeasurementsPlugin.on("clickMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("touchMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("measurementCancel",l=>{this.eventTrigger.emit("DistanceMeasureCancel",{id:l.id})}),this._distanceMeasurementsPlugin.on("measurementDestroyed",l=>{this.eventTrigger.emit("DistanceMeasureDestroyed",{id:l.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=l=>{if(this._active&&(l.key==="Delete"||l.keyCode===8)){if(!this.chosedTarget)return;this.destroyMeasurementById(this.chosedTarget.id),this._distanceMeasurementsPlugin.fire("measureDelete",null),this.getNumMeasurements()==0&&(this.chosedTarget=null)}};document.addEventListener("mousemove",d.bind(this)),document.addEventListener("keydown",u.bind(this)),this.on("destroy",()=>{document.removeEventListener("mousemove",d.bind(this)),document.removeEventListener("keydown",u.bind(this))})}set isTouch(d){this._isTouch=d,d||this._distanceMeasurementsMouseControl.deactivate()}get isTouch(){return this._isTouch}set unit(d){switch(this._unit=d,d){case"m":this.viewer.scene.metrics.units="meters",this.viewer.scene.metrics.scale=1*this._scale;break;case"cm":this.viewer.scene.metrics.units="centimeters",this.viewer.scene.metrics.scale=100*this._scale;break;case"mm":this.viewer.scene.metrics.units="millimeters",this.viewer.scene.metrics.scale=1e3*this._scale;break}}set scale(d){this._scale=d,this.unit=this._unit}get scale(){return this._scale}set precision(d){this._precision=d,this._distanceMeasurementsPlugin.precision=d}get precision(){return this._precision}set offsetX(d){this._offsetX=d,this._isTouch?(this._distanceMeasurementsTouchControl.offsetX=d,this._distanceMeasurementsSimulateMouseControl.offsetX=d):this._distanceMeasurementsMouseControl.offsetX=d}get offsetX(){return this._offsetX}set offsetY(d){this._offsetY=d,this._isTouch?(this._distanceMeasurementsTouchControl.offsetY=d,this._distanceMeasurementsSimulateMouseControl.offsetY=d):this._distanceMeasurementsMouseControl.offsetY=d}get offsetY(){return this._offsetY}refreshMouseState(){this.newMeasure&&(this.destroyMeasurementById(this.newMeasure.id),this.isTouch?(this._distanceMeasurementsTouchControl.touchState=0,this._distanceMeasurementsSimulateMouseControl.mouseState=0):this._distanceMeasurementsMouseControl.mouseState=0,this.setAllHightLighted(!1),this.newMeasure=null)}setAllVisible(d){this._distanceMeasurementsPlugin.setMeasurementsShown(d)}setSnappingEnabled(d){return this._distanceMeasurementsMouseControl.snapping=d}getNumMeasurements(){return Object.keys(this._distanceMeasurementsPlugin.measurements).length}getMeasurementsList(){return this._distanceMeasurementsPlugin.measurements}getMeasurementById(d){return this.getMeasurementsList()[d]}getMeasureResultByID(d){const u=this.getMeasurementById(d);return u?u.length:0}setMeasureColorByID(d,u){const l=this.getMeasurementById(d);l.color=u}setMeasureClickbleById(d,u){const l=this.getMeasurementById(d);l.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const l in u)u[l].setHighlighted(d)}setVisibleById(d,u){const l=this.getMeasurementById(d);l.visible=u}setLableVisibleById(d,u){const l=this.getMeasurementById(d);l.labelsVisible=u}destroyMeasurementById(d){this._distanceMeasurementsPlugin.destroyMeasurement(d)}onSimulateMousedown(d){this._distanceMeasurementsSimulateMouseControl.onMousedown(d)}onSimulateMousemove(d){this._distanceMeasurementsSimulateMouseControl.onMousemove(d)}onSimulateMouseup(d){this._distanceMeasurementsSimulateMouseControl.onMouseup(d)}clear(){this._distanceMeasurementsPlugin.clear()}stop(){this._isTouch?(this._distanceMeasurementsTouchControl.deactivate(),this._distanceMeasurementsSimulateMouseControl.deactivate()):this._distanceMeasurementsMouseControl.deactivate()}destroy(){this.fire("destroy",!0),this.distanceMeasureContainer.parentNode&&this.distanceMeasureContainer.parentNode.removeChild(this.distanceMeasureContainer),this._distanceMeasurementsPlugin.destroy(),this._distanceMeasurementsMouseControl.destroy(),this._distanceMeasurementsTouchControl.destroy(),this._distanceMeasurementsSimulateMouseControl.destroy(),super.destroy()}}},"./src/toolbar/NavCubeMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){if(super(d,u),!u.navCubeCanvasElement)throw new Error("Missing config: NavCubeMode navCubeCanvasElement");const{navCubeCanvasElement:l}=u,{viewerElement:c}=u;this._navCubeCanvasElement=l,this._navCubeCanvasElement.oncontextmenu=f=>{f.preventDefault()},this._navCube=new x.NavCubePlugin(this.viewer,{canvasElement:l,viewerElement:c,fitVisible:!1,color:"#CFCFCF",shadowVisible:!1}),this._navCube.setVisible(this._active),this._visible=!0,this.on("active",f=>{this._navCube.setVisible(f)})}set visible(d){this._visible=d,d?this._navCubeCanvasElement.style.visibility="visible":this._navCubeCanvasElement.style.visibility="hidden"}get visible(){return this._visible}get fitVisible(){return this._navCube.getFitVisible()}set fitVisible(d){this._navCube.setFitVisible(d)}flyByClick(d){this._navCube.flyByClick(d)}destroy(){this._navCube.destroy(),super.destroy()}}},"./src/toolbar/OrthoMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/Controller.ts");class S extends x.default{constructor(h,d){super(h,d),this.viewer.camera.on("projection",()=>{const u=this.viewer.camera.projection==="ortho";this._active=u}),this._active=!1}setActive(h,d=()=>{}){if(this._active===h){d&&d();return}this._active=h,h?d?this._enterOrthoMode(()=>{this.fire("active",this._active),d()}):(this._enterOrthoMode(),this.fire("active",this._active)):d?this._exitOrthoMode(()=>{this.fire("active",this._active),d()}):(this._exitOrthoMode(),this.fire("active",this._active))}_enterOrthoMode(h=()=>{}){h?this.viewer.cameraFlight.flyTo({projection:"ortho",duration:.5},h):this.viewer.cameraFlight.jumpTo({projection:"ortho"})}_exitOrthoMode(h=()=>{}){h?this.viewer.cameraFlight.flyTo({projection:"perspective",duration:.5},h):this.viewer.cameraFlight.jumpTo({projection:"perspective"})}}},"./src/toolbar/ResetAction.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A=x.math.vec3();class h extends S.default{constructor(u,l={}){super(u,l),this._modelMementos={},this.bimViewer.modelsExplorer.on("modelLoaded",c=>{this.reset()})}reset(u){this._resetCamera(u)}_resetCamera(u){const{viewer:l}=this,{scene:c}=l;let f;this.bimViewer.multiModel?f=c.getAABB(c.visibleObjectIds):f=c.aabb;const p=x.math.getAABB3Diag(f),m=x.math.getAABB3Center(f,A),{camera:v}=c;v.perspective.fov;const _=Math.abs(p/Math.tan(45*x.math.DEGTORAD)),b=x.math.normalizeVec3(v.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),w=x.math.normalizeVec3(v.yUp?[-.5,.7071,-.5]:[-1,1,1]);l.cameraControl.pivotPos=m,l.cameraControl.planView&&(l.cameraControl.planView=!1),l.cameraFlight.flyTo({look:m,eye:[m[0]-_*b[0],m[1]-_*b[1],m[2]-_*b[2]],up:w,orthoScale:p*1.3,projection:"perspective",duration:1},u)}}},"./src/toolbar/SectionTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u),this.eventTrigger=d.eventTrigger,this._sectionPlanesPlugin=new x.SectionPlanesPlugin(this.viewer,{}),this._sectionPlanesPlugin.sectionConfigs={planeSize:1.4,controlSize:.2,planeOpacity:.2,controlFillColor:[.1,.4,.99]},this._sectionPlanesPlugin.setOverviewVisible(!1),this._sectionPlanesPlugin.on("touchPlaneStart",()=>{this.eventTrigger.emit("touchPlaneStart")}),this._sectionPlanesPlugin.on("touchPlaneEnd",()=>{this.eventTrigger.emit("touchPlaneEnd")}),this._sectionPlanesPlugin.on("clickPlaneStart",()=>{this.eventTrigger.emit("clickPlaneStart")}),this._sectionPlanesPlugin.on("clickPlaneEnd",()=>{this.eventTrigger.emit("clickPlaneEnd")}),this._isTouch=!1,this.on("active",l=>{l?this.showControl():this.hideControl()}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this._initSectionMode()}_initSectionMode(){this.viewer.scene.input.on("mouseclicked",d=>{if(!this.getActive())return;const u=this.viewer.scene.pick({canvasPos:d,pickSurface:!0});if(u){const l=this._sectionPlanesPlugin.createSectionPlane({pos:u.worldPos,dir:x.math.mulVec3Scalar(u.worldNormal,-1)});this._sectionPlanesPlugin.showControl(l.id),this.eventTrigger.emit("createSection",{position:u.worldPos,direction:x.math.mulVec3Scalar(u.worldNormal,-1),id:l.id})}})}set isTouch(d){this._sectionPlanesPlugin.isTouch=d,this._isTouch=d}set sectionWay(d){this._sectionPlanesPlugin.sectionWay=d}set sectionDirection(d){this._sectionPlanesPlugin.sectionDirection=d}setControlPos(d){this._sectionPlanesPlugin.setControlPos(d)}getControlPos(){return this._sectionPlanesPlugin.getControlPos()}set sectionConfigs(d){this._sectionPlanesPlugin.sectionConfigs=d}creatSection(d,u){const l=this._sectionPlanesPlugin.createSectionPlane({pos:d,dir:u});this._sectionPlanesPlugin.showControl(l.id)}getSectionPlanes(){return this._sectionPlanesPlugin.sectionPlanes}getSectionPlane(d){return this.getSectionPlanes()[d]}setSectionEnable(d){const u=this.getSectionPlane(d);u.active=!0}setSectionDisable(d){const u=this.getSectionPlane(d);u.active=!1}setSectionPos(d,u){const l=this.getSectionPlane(d);l.pos=u}flipSection(d){this.getSectionPlane(d).flipDir()}getNumSections(){return Object.keys(this.viewer.scene.sectionPlanes).length}clear(){this._sectionPlanesPlugin.clear()}flipSections(){this._sectionPlanesPlugin.flipSectionPlanes()}getShownControl(){this._sectionPlanesPlugin.getShownControl()}enableSections(){const{sectionPlanes:d}=this.viewer.scene;for(const u in d){const l=d[u];l.active=!0}}disableSections(){const{sectionPlanes:d}=this.viewer.scene;for(const u in d){const l=d[u];l.active=!1,this.hideControl()}}hideControl(){this._sectionPlanesPlugin.hideControl()}showControl(){const d=this.getSectionPlanes();for(const u in d)d[u].control.setVisible(!0)}showSectionPlane(d){this._sectionPlanesPlugin.showControl(d)}destroy(){this._sectionPlanesPlugin.destroy(),super.destroy()}destroySectionPlane(d){this._sectionPlanesPlugin.destroySectionPlane(d)}}},"./src/toolbar/ShowSpacesMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/Controller.ts");class S extends x.default{constructor(h,d){super(h,d),this._active=!0,h.eventTrigger.on("metaLoaded",u=>{const l=this.spaceObjects;if(l.length==0)return;this.viewer.scene.setObjectsCulled(l,!0),this.setIFCSpaceOpacity(),this.viewer.scene.setObjectsHighlighted(l,!0);const c=this.viewer.scene.models[u.metaModel.id],f=c.exceptionIds.concat(l);c.exceptionIds=f,h.resetView()})}setActive(h,d){this._active!==h&&(this._active=h,h?(this._enterShowSpacesMode(),this.fire("active",this._active)):(this._exitShowSpacesMode(),this.fire("active",this._active)),d&&d())}setIFCSpaceOpacity(){this.spaceObjects.length!=0&&this.viewer.scene.withObjects(this.spaceObjects,h=>{h.origin_opacity!=-1&&(h.opacity=h.opacity<.5?h.opacity:.1)})}_enterShowSpacesMode(){const{viewer:h}=this,{scene:d}=h,{metaScene:u}=h,l=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(l,!1)}_exitShowSpacesMode(){const{viewer:h}=this,{scene:d}=h,{metaScene:u}=h,l=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(l,!0)}get spaceObjects(){return this.viewer.metaScene.getObjectIDsByType("IfcSpace")}}},"./src/toolbar/SkyBoxTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u={}){super(d,u),this.skyboxesPlugin=new x.SkyboxesPlugin(this.viewer),this._active=!1,this.createSkyBox(u),this.on("active",l=>{this.setSkyBoxActiveById(l)})}createSkyBox(d){const{skyBoxImage:u}=d,{skyBoxSrc:l}=d;this.skyboxesPlugin.createSkybox("skybox1",{src:l,image:u,size:9e3,scale:[1,1],active:!1})}setSkyBoxActiveById(d=!this.getSkyBoxById("skybox1").active){this.skyboxesPlugin.setSkyBoxActiveById("skybox1",d)}getSkyBoxById(d="skybox1"){return this.skyboxesPlugin.getSkyBoxById(d)}destroy(){this.skyboxesPlugin.destroy()}}},"./src/toolbar/ThreeDMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A=x.math.vec3();class h extends S.default{constructor(u,l){super(u,l),this._saveOrthoActive=null,this._cameraControlNavModeMediator=l.cameraControlNavModeMediator,this._active=!1}setEnabled(u){super.setEnabled(u),this._saveOrthoActive=this.bimViewer.orthoMode.getActive()}setActive(u,l=()=>{}){if(this._active===u){l&&l();return}this._active=u,u?this._enterThreeDMode(()=>{this.fire("active",this._active),l&&l()}):this._exitThreeDMode(()=>{this.fire("active",this._active),l&&l()})}_enterThreeDMode(u=()=>{}){const{viewer:l}=this,{scene:c}=l,{aabb:f}=c,p=x.math.getAABB3Diag(f),m=x.math.getAABB3Center(f,A),v=Math.abs(p/Math.tan(65/2)),{camera:_}=c,b=_.yUp?[-1,-1,-1]:[1,1,1],w=_.yUp?[-1,1,-1]:[-1,1,1];l.cameraControl.pivotPos=m,this.bimViewer.navCubeMode.setActive(!0),this.bimViewer.firstPersonMode.setEnabled(!0),this._cameraControlNavModeMediator.setThreeDModeActive(!0),this.bimViewer.sectionTool.setEnabled(!0),this.bimViewer.orthoMode.setEnabled(!0),u?l.cameraFlight.flyTo({look:m,eye:[m[0]-v*b[0],m[1]-v*b[1],m[2]-v*b[2]],up:w,orthoScale:p*1.3,duration:1,projection:this._saveOrthoActive?"ortho":"perspective"},()=>{u()}):l.cameraFlight.jumpTo({look:m,eye:[m[0]-v*b[0],m[1]-v*b[1],m[2]-v*b[2]],up:w,orthoScale:p*1.3,projection:this._saveOrthoActive?"ortho":"perspective"})}_exitThreeDMode(u=()=>{}){const{viewer:l}=this,{scene:c}=l,{camera:f}=c,{aabb:p}=c,m=x.math.getAABB3Center(p),v=x.math.getAABB3Diag(p),b=Math.abs(v/Math.tan(45*x.math.DEGTORAD)),w=v*1.3,C=A;C[0]=m[0]+f.worldUp[0]*b,C[1]=m[1]+f.worldUp[1]*b,C[2]=m[2]+f.worldUp[2]*b;const k=x.math.mulVec3Scalar(f.worldForward,-1,[]);this.bimViewer.sectionTool.setActive(!1),this.bimViewer.firstPersonMode.setEnabled(!1),this._saveOrthoActive=this.bimViewer.orthoMode.getActive(),this.bimViewer.orthoMode.setEnabled(!1),this._cameraControlNavModeMediator.setThreeDModeActive(!1),u?l.cameraFlight.flyTo({eye:C,look:m,up:k,orthoScale:w,projection:"ortho"},()=>{this.bimViewer.navCubeMode.setActive(!1)}):(l.cameraFlight.jumpTo({eye:C,look:m,up:k,orthoScale:w,projection:"ortho"}),this.bimViewer.navCubeMode.setActive(!1))}}},"./node_modules/unzipit/dist/unzipit.module.js"(N,Q,a){a.r(Q),a.d(Q,{HTTPRangeReader:()=>f,cleanup:()=>at,setOptions:()=>Ze,unzip:()=>dt,unzipRaw:()=>Xe}),N=a.hmd(N);function x(ze){return ze.arrayBuffer?ze.arrayBuffer():new Promise((Ke,ut)=>{const yt=new FileReader;yt.addEventListener("loadend",()=>{Ke(yt.result)}),yt.addEventListener("error",ut),yt.readAsArrayBuffer(ze)})}async function S(ze){const Ke=await x(ze);return new Uint8Array(Ke)}function A(ze){return typeof Blob<"u"&&ze instanceof Blob}function h(ze){return typeof SharedArrayBuffer<"u"&&ze instanceof SharedArrayBuffer}const d=typeof process<"u"&&process.versions&&typeof process.versions.node<"u"&&typeof process.versions.electron>"u";function u(ze){return ze.byteOffset===0&&ze.byteLength===ze.buffer.byteLength}class l{constructor(Ke){this.typedArray=Ke instanceof ArrayBuffer||h(Ke)?new Uint8Array(Ke):new Uint8Array(Ke.buffer,Ke.byteOffset,Ke.byteLength)}async getLength(){return this.typedArray.byteLength}async read(Ke,ut){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+Ke,ut)}}class c{constructor(Ke){this.blob=Ke}async getLength(){return this.blob.size}async read(Ke,ut){const yt=this.blob.slice(Ke,Ke+ut),Ne=await x(yt);return new Uint8Array(Ne)}async sliceAsBlob(Ke,ut,yt=""){return this.blob.slice(Ke,Ke+ut,yt)}}class f{constructor(Ke){this.url=Ke}async getLength(){if(this.length===void 0){const Ke=await fetch(this.url,{method:"HEAD"});if(!Ke.ok)throw new Error(`failed http request ${this.url}, status: ${Ke.status}: ${Ke.statusText}`);if(this.length=parseInt(Ke.headers.get("content-length")),Number.isNaN(this.length))throw Error("could not get length")}return this.length}async read(Ke,ut){if(ut===0)return new Uint8Array(0);const yt=await fetch(this.url,{headers:{Range:`bytes=${Ke}-${Ke+ut-1}`}});if(!yt.ok)throw new Error(`failed http request ${this.url}, status: ${yt.status} offset: ${Ke} size: ${ut}: ${yt.statusText}`);const Ne=await yt.arrayBuffer();return new Uint8Array(Ne)}}function p(ze,Ke){var ut=Uint8Array;if(ze[0]==3&&ze[1]==0)return Ke||new ut(0);var yt=T,Ne=k,tt=v,Pt=R,Rt=Ke==null;Rt&&(Ke=new ut(ze.length>>>2<<3));for(var Ht=0,zt=0,tr=0,qt=0,er=0,Dt=0,rr=0,_r=0,pr=0,xr,Ct;Ht==0;){if(Ht=yt(ze,pr,1),zt=yt(ze,pr+1,2),pr+=3,zt==0){pr&7&&(pr+=8-(pr&7));var Et=(pr>>>3)+4,Lt=ze[Et-4]|ze[Et-3]<<8;Rt&&(Ke=m(Ke,_r+Lt)),Ke.set(new ut(ze.buffer,ze.byteOffset+Et,Lt),_r),pr=Et+Lt<<3,_r+=Lt;continue}if(Rt&&(Ke=m(Ke,_r+(1<<17))),zt==1&&(xr=U.flmap,Ct=U.fdmap,Dt=511,rr=31),zt==2){tr=Ne(ze,pr,5)+257,qt=Ne(ze,pr+5,5)+1,er=Ne(ze,pr+10,4)+4,pr+=14;for(var Kt=0;Kt<38;Kt+=2)U.itree[Kt]=0,U.itree[Kt+1]=0;for(var Ar=1,Kt=0;Kt<er;Kt++){var xt=Ne(ze,pr+Kt*3,3);U.itree[(U.ordr[Kt]<<1)+1]=xt,xt>Ar&&(Ar=xt)}pr+=3*er,b(U.itree,Ar),w(U.itree,Ar,U.imap),xr=U.lmap,Ct=U.dmap,pr=tt(U.imap,(1<<Ar)-1,tr+qt,ze,pr,U.ttree);var Qt=_(U.ttree,0,tr,U.ltree);Dt=(1<<Qt)-1;var $t=_(U.ttree,tr,qt,U.dtree);rr=(1<<$t)-1,b(U.ltree,Qt),w(U.ltree,Qt,xr),b(U.dtree,$t),w(U.dtree,$t,Ct)}for(;;){var nr=xr[Pt(ze,pr)&Dt];pr+=nr&15;var Er=nr>>>4;if(!(Er>>>8))Ke[_r++]=Er;else{if(Er==256)break;var Ie=_r+Er-254;if(Er>264){var Le=U.ldef[Er-257];Ie=_r+(Le>>>3)+Ne(ze,pr,Le&7),pr+=Le&7}var Ue=Ct[Pt(ze,pr)&rr];pr+=Ue&15;var Ge=Ue>>>4,Ye=U.ddef[Ge],$e=(Ye>>>4)+yt(ze,pr,Ye&15);for(pr+=Ye&15,Rt&&(Ke=m(Ke,_r+(1<<17)));_r<Ie;)Ke[_r]=Ke[_r++-$e],Ke[_r]=Ke[_r++-$e],Ke[_r]=Ke[_r++-$e],Ke[_r]=Ke[_r++-$e];_r=Ie}}}return Ke.length==_r?Ke:Ke.slice(0,_r)}function m(ze,Ke){var ut=ze.length;if(Ke<=ut)return ze;var yt=new Uint8Array(Math.max(ut<<1,Ke));return yt.set(ze,0),yt}function v(ze,Ke,ut,yt,Ne,tt){for(var Pt=k,Rt=R,Ht=0;Ht<ut;){var zt=ze[Rt(yt,Ne)&Ke];Ne+=zt&15;var tr=zt>>>4;if(tr<=15)tt[Ht]=tr,Ht++;else{var qt=0,er=0;tr==16?(er=3+Pt(yt,Ne,2),Ne+=2,qt=tt[Ht-1]):tr==17?(er=3+Pt(yt,Ne,3),Ne+=3):tr==18&&(er=11+Pt(yt,Ne,7),Ne+=7);for(var Dt=Ht+er;Ht<Dt;)tt[Ht]=qt,Ht++}}return Ne}function _(ze,Ke,ut,yt){for(var Ne=0,tt=0,Pt=yt.length>>>1;tt<ut;){var Rt=ze[tt+Ke];yt[tt<<1]=0,yt[(tt<<1)+1]=Rt,Rt>Ne&&(Ne=Rt),tt++}for(;tt<Pt;)yt[tt<<1]=0,yt[(tt<<1)+1]=0,tt++;return Ne}function b(ze,Ke){for(var ut=ze.length,yt,Ne,tt,Pt,Rt,Ht=U.bl_count,Pt=0;Pt<=Ke;Pt++)Ht[Pt]=0;for(Pt=1;Pt<ut;Pt+=2)Ht[ze[Pt]]++;var zt=U.next_code;for(yt=0,Ht[0]=0,Ne=1;Ne<=Ke;Ne++)yt=yt+Ht[Ne-1]<<1,zt[Ne]=yt;for(tt=0;tt<ut;tt+=2)Rt=ze[tt+1],Rt!=0&&(ze[tt]=zt[Rt],zt[Rt]++)}function w(ze,Ke,ut){for(var yt=ze.length,Ne=U.rev15,tt=0;tt<yt;tt+=2)if(ze[tt+1]!=0)for(var Pt=tt>>1,Rt=ze[tt+1],Ht=Pt<<4|Rt,zt=Ke-Rt,tr=ze[tt]<<zt,qt=tr+(1<<zt);tr!=qt;){var er=Ne[tr]>>>15-Ke;ut[er]=Ht,tr++}}function C(ze,Ke){for(var ut=U.rev15,yt=15-Ke,Ne=0;Ne<ze.length;Ne+=2){var tt=ze[Ne]<<Ke-ze[Ne+1];ze[Ne]=ut[tt]>>>yt}}function k(ze,Ke,ut){return(ze[Ke>>>3]|ze[(Ke>>>3)+1]<<8)>>>(Ke&7)&(1<<ut)-1}function T(ze,Ke,ut){return(ze[Ke>>>3]|ze[(Ke>>>3)+1]<<8|ze[(Ke>>>3)+2]<<16)>>>(Ke&7)&(1<<ut)-1}function R(ze,Ke){return(ze[Ke>>>3]|ze[(Ke>>>3)+1]<<8|ze[(Ke>>>3)+2]<<16)>>>(Ke&7)}const U=function(){var ze=Uint16Array,Ke=Uint32Array;return{next_code:new ze(16),bl_count:new ze(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new ze(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new Ke(32),flmap:new ze(512),fltree:[],fdmap:new ze(32),fdtree:[],lmap:new ze(32768),ltree:[],ttree:[],dmap:new ze(32768),dtree:[],imap:new ze(512),itree:[],rev15:new ze(32768),lhst:new Ke(286),dhst:new Ke(30),ihst:new Ke(19),lits:new Ke(15e3),strt:new ze(65536),prev:new ze(32768)}}();(function(){for(var ze=32768,Ke=0;Ke<ze;Ke++){var ut=Ke;ut=(ut&2863311530)>>>1|(ut&1431655765)<<1,ut=(ut&3435973836)>>>2|(ut&858993459)<<2,ut=(ut&4042322160)>>>4|(ut&252645135)<<4,ut=(ut&4278255360)>>>8|(ut&16711935)<<8,U.rev15[Ke]=(ut>>>16|ut<<16)>>>17}function yt(Ne,tt,Pt){for(;tt--!=0;)Ne.push(0,Pt)}for(var Ke=0;Ke<32;Ke++)U.ldef[Ke]=U.of0[Ke]<<3|U.exb[Ke],U.ddef[Ke]=U.df0[Ke]<<4|U.dxb[Ke];yt(U.fltree,144,8),yt(U.fltree,112,9),yt(U.fltree,24,7),yt(U.fltree,8,8),b(U.fltree,9),w(U.fltree,9,U.flmap),C(U.fltree,9),yt(U.fdtree,32,5),b(U.fdtree,5),w(U.fdtree,5,U.fdmap),C(U.fdtree,5),yt(U.itree,19,0),yt(U.ltree,286,0),yt(U.dtree,30,0),yt(U.ttree,320,0)})();const G={table:function(){for(var ze=new Uint32Array(256),Ke=0;Ke<256;Ke++){for(var ut=Ke,yt=0;yt<8;yt++)ut&1?ut=3988292384^ut>>>1:ut=ut>>>1;ze[Ke]=ut}return ze}(),update:function(ze,Ke,ut,yt){for(var Ne=0;Ne<yt;Ne++)ze=G.table[(ze^Ke[ut+Ne])&255]^ze>>>8;return ze},crc:function(ze,Ke,ut){return G.update(4294967295,ze,Ke,ut)^4294967295}};function j(ze,Ke){return p(ze,Ke)}const H={numWorkers:1,workerURL:"",useWorkers:!1};let W=0,K=0,$=!0;const O=[],L=[],M=[],I=new Map;function F(ze){ee(ze.target);const{id:Ke,error:ut,data:yt}=ze.data,Ne=I.get(Ke);I.delete(Ke),ut?Ne.reject(ut):Ne.resolve(yt)}function V(ze){return new Promise((Ke,ut)=>{const yt=new Worker(ze);yt.onmessage=Ne=>{Ne.data==="start"?(yt.onerror=void 0,yt.onmessage=void 0,Ke(yt)):ut(new Error(`unexpected message: ${Ne.data}`))},yt.onerror=ut})}function D(ze,Ke){return ze.require?ze.require(Ke):{}}const X=function(){if(d){const{Worker:ze}=D(N,"worker_threads");return{async createWorker(Ke){return new ze(Ke)},addEventListener(Ke,ut){Ke.on("message",yt=>{ut({target:Ke,data:yt})})},async terminate(Ke){await Ke.terminate()}}}else return{async createWorker(ze){try{return await V(ze)}catch{console.warn("could not load worker:",ze)}let Ke;try{const ut=await fetch(ze,{mode:"cors"});if(!ut.ok)throw new Error(`could not load: ${ze}`);Ke=await ut.text(),ze=URL.createObjectURL(new Blob([Ke],{type:"application/javascript"}));const yt=await V(ze);return H.workerURL=ze,yt}catch{console.warn("could not load worker via fetch:",ze)}if(Ke!==void 0)try{ze=`data:application/javascript;base64,${btoa(Ke)}`;const ut=await V(ze);return H.workerURL=ze,ut}catch{console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(ze,Ke){ze.addEventListener("message",Ke)},async terminate(ze){ze.terminate()}}}();function ee(ze){L.push(ze),oe()}async function q(){if(L.length===0&&K<H.numWorkers){++K;try{const ze=await X.createWorker(H.workerURL);O.push(ze),L.push(ze),X.addEventListener(ze,F)}catch{$=!1}}return L.pop()}function ne(ze,Ke,ut,yt){const Ne=new Uint8Array(Ke);j(ze,Ne),yt(ut?new Blob([Ne],{type:ut}):Ne.buffer)}async function oe(){if(M.length!==0){if(H.useWorkers&&$){const ze=await q();if($){if(ze){if(M.length===0){ee(ze);return}const{id:Ke,src:ut,uncompressedSize:yt,type:Ne,resolve:tt,reject:Pt}=M.shift();I.set(Ke,{id:Ke,resolve:tt,reject:Pt});const Rt=[];ze.postMessage({type:"inflate",data:{id:Ke,type:Ne,src:ut,uncompressedSize:yt}},Rt)}return}}for(;M.length;){const{src:ze,uncompressedSize:Ke,type:ut,resolve:yt}=M.shift();let Ne=ze;A(ze)&&(Ne=await S(ze)),ne(Ne,Ke,ut,yt)}}}function he(ze){H.workerURL=ze.workerURL||H.workerURL,ze.workerURL&&(H.useWorkers=!0),H.useWorkers=ze.useWorkers!==void 0?ze.useWorkers:H.useWorkers,H.numWorkers=ze.numWorkers||H.numWorkers}function te(ze,Ke,ut){return new Promise((yt,Ne)=>{M.push({src:ze,uncompressedSize:Ke,type:ut,resolve:yt,reject:Ne,id:W++}),oe()})}function de(ze){ze.splice(0,ze.length)}async function se(){for(const ze of O)await X.terminate(ze);de(O),de(L),de(M),I.clear(),K=0,$=!0}function re(ze,Ke){const ut=ze&31,yt=(ze>>5&15)-1,Ne=(ze>>9&127)+1980,tt=0,Pt=(Ke&31)*2,Rt=Ke>>5&63,Ht=Ke>>11&31;return new Date(Ne,yt,ut,Ht,Rt,Pt,tt)}class ae{constructor(Ke,ut){this._reader=Ke,this._rawEntry=ut,this.name=ut.name,this.nameBytes=ut.nameBytes,this.size=ut.uncompressedSize,this.compressedSize=ut.compressedSize,this.comment=ut.comment,this.commentBytes=ut.commentBytes,this.compressionMethod=ut.compressionMethod,this.lastModDate=re(ut.lastModFileDate,ut.lastModFileTime),this.isDirectory=ut.uncompressedSize===0&&ut.name.endsWith("/"),this.encrypted=!!(ut.generalPurposeBitFlag&1),this.externalFileAttributes=ut.externalFileAttributes,this.versionMadeBy=ut.versionMadeBy}async blob(Ke="application/octet-stream"){return await it(this._reader,this._rawEntry,Ke)}async arrayBuffer(){return await ht(this._reader,this._rawEntry)}async text(){const Ke=await this.arrayBuffer();return _e(new Uint8Array(Ke))}async json(){const Ke=await this.text();return JSON.parse(Ke)}}const Ce=22,me=65535,ce=101010256,pe=101075792;async function B(ze,Ke,ut){return await ze.read(Ke,ut)}async function ke(ze,Ke,ut,yt){return ze.sliceAsBlob?await ze.sliceAsBlob(Ke,ut,yt):await ze.read(Ke,ut)}const Ee={unsigned(){return 0}};function ge(ze,Ke){return ze[Ke]+ze[Ke+1]*256}function Ae(ze,Ke){return ze[Ke]+ze[Ke+1]*256+ze[Ke+2]*65536+ze[Ke+3]*16777216}function fe(ze,Ke){return Ae(ze,Ke)+Ae(ze,Ke+4)*4294967296}const ue=new TextDecoder;function _e(ze,Ke){return h(ze.buffer)&&(ze=new Uint8Array(ze)),ue.decode(ze)}async function be(ze,Ke){const ut=Math.min(Ce+me,Ke),yt=Ke-ut,Ne=await B(ze,yt,ut);for(let tt=ut-Ce;tt>=0;--tt){if(Ae(Ne,tt)!==ce)continue;const Pt=new Uint8Array(Ne.buffer,Ne.byteOffset+tt,Ne.byteLength-tt),Rt=ge(Pt,4);if(Rt!==0)throw new Error(`multi-volume zip files are not supported. This is volume: ${Rt}`);const Ht=ge(Pt,10),zt=Ae(Pt,12),tr=Ae(Pt,16),qt=ge(Pt,20),er=Pt.length-Ce;if(qt!==er)throw new Error(`invalid comment length. expected: ${er}, actual: ${qt}`);const Dt=new Uint8Array(Pt.buffer,Pt.byteOffset+22,qt),rr=_e(Dt);return Ht===65535||tr===4294967295?await Je(ze,yt+tt,rr,Dt):await ot(ze,tr,zt,Ht,rr,Dt)}throw new Error("could not find end of central directory. maybe not zip file")}const De=117853008;async function Je(ze,Ke,ut,yt){const Ne=Ke-20,tt=await B(ze,Ne,20);if(Ae(tt,0)!==De)throw new Error("invalid zip64 end of central directory locator signature");const Pt=fe(tt,8),Rt=await B(ze,Pt,56);if(Ae(Rt,0)!==pe)throw new Error("invalid zip64 end of central directory record signature");const Ht=fe(Rt,32),zt=fe(Rt,40),tr=fe(Rt,48);return ot(ze,tr,zt,Ht,ut,yt)}const Qe=33639248;async function ot(ze,Ke,ut,yt,Ne,tt){let Pt=0;const Rt=await B(ze,Ke,ut),Ht=[];for(let tr=0;tr<yt;++tr){const qt=Rt.subarray(Pt,Pt+46),er=Ae(qt,0);if(er!==Qe)throw new Error(`invalid central directory file header signature: 0x${er.toString(16)}`);const Dt={versionMadeBy:ge(qt,4),versionNeededToExtract:ge(qt,6),generalPurposeBitFlag:ge(qt,8),compressionMethod:ge(qt,10),lastModFileTime:ge(qt,12),lastModFileDate:ge(qt,14),crc32:Ae(qt,16),compressedSize:Ae(qt,20),uncompressedSize:Ae(qt,24),fileNameLength:ge(qt,28),extraFieldLength:ge(qt,30),fileCommentLength:ge(qt,32),internalFileAttributes:ge(qt,36),externalFileAttributes:Ae(qt,38),relativeOffsetOfLocalHeader:Ae(qt,42)};if(Dt.generalPurposeBitFlag&64)throw new Error("strong encryption is not supported");Pt+=46;const rr=Rt.subarray(Pt,Pt+Dt.fileNameLength+Dt.extraFieldLength+Dt.fileCommentLength);Dt.nameBytes=rr.slice(0,Dt.fileNameLength),Dt.name=_e(Dt.nameBytes);const _r=Dt.fileNameLength+Dt.extraFieldLength,pr=rr.slice(Dt.fileNameLength,_r);Dt.extraFields=[];let xr=0;for(;xr<pr.length-3;){const Et=ge(pr,xr+0),Lt=ge(pr,xr+2),Kt=xr+4,Ar=Kt+Lt;if(Ar>pr.length)throw new Error("extra field length exceeds extra field buffer size");Dt.extraFields.push({id:Et,data:pr.slice(Kt,Ar)}),xr=Ar}if(Dt.commentBytes=rr.slice(_r,_r+Dt.fileCommentLength),Dt.comment=_e(Dt.commentBytes),Pt+=rr.length,Dt.uncompressedSize===4294967295||Dt.compressedSize===4294967295||Dt.relativeOffsetOfLocalHeader===4294967295){const Et=Dt.extraFields.find(Ar=>Ar.id===1);if(!Et)throw new Error("expected zip64 extended information extra field");const Lt=Et.data;let Kt=0;if(Dt.uncompressedSize===4294967295){if(Kt+8>Lt.length)throw new Error("zip64 extended information extra field does not include uncompressed size");Dt.uncompressedSize=fe(Lt,Kt),Kt+=8}if(Dt.compressedSize===4294967295){if(Kt+8>Lt.length)throw new Error("zip64 extended information extra field does not include compressed size");Dt.compressedSize=fe(Lt,Kt),Kt+=8}if(Dt.relativeOffsetOfLocalHeader===4294967295){if(Kt+8>Lt.length)throw new Error("zip64 extended information extra field does not include relative header offset");Dt.relativeOffsetOfLocalHeader=fe(Lt,Kt),Kt+=8}}const Ct=Dt.extraFields.find(Et=>Et.id===28789&&Et.data.length>=6&&Et.data[0]===1&&Ae(Et.data,1),Ee.unsigned(Dt.nameBytes));if(Ct&&(Dt.fileName=_e(Ct.data.slice(5))),Dt.compressionMethod===0){let Et=Dt.uncompressedSize;if(Dt.generalPurposeBitFlag&1&&(Et+=12),Dt.compressedSize!==Et)throw new Error(`compressed size mismatch for stored file: ${Dt.compressedSize} != ${Et}`)}Ht.push(Dt)}return{zip:{comment:Ne,commentBytes:tt},entries:Ht.map(tr=>new ae(ze,tr))}}async function ct(ze,Ke){if(Ke.generalPurposeBitFlag&1)throw new Error("encrypted entries not supported");const ut=await B(ze,Ke.relativeOffsetOfLocalHeader,30),yt=await ze.getLength(),Ne=Ae(ut,0);if(Ne!==67324752)throw new Error(`invalid local file header signature: 0x${Ne.toString(16)}`);const tt=ge(ut,26),Pt=ge(ut,28),Rt=Ke.relativeOffsetOfLocalHeader+ut.length+tt+Pt;let Ht;if(Ke.compressionMethod===0)Ht=!1;else if(Ke.compressionMethod===8)Ht=!0;else throw new Error(`unsupported compression method: ${Ke.compressionMethod}`);const zt=Rt,tr=zt+Ke.compressedSize;if(Ke.compressedSize!==0&&tr>yt)throw new Error(`file data overflows file bounds: ${zt} + ${Ke.compressedSize} > ${yt}`);return{decompress:Ht,fileDataStart:zt}}async function ht(ze,Ke){const{decompress:ut,fileDataStart:yt}=await ct(ze,Ke);if(!ut){const Pt=await B(ze,yt,Ke.compressedSize);return u(Pt)?Pt.buffer:Pt.slice().buffer}const Ne=await ke(ze,yt,Ke.compressedSize);return await te(Ne,Ke.uncompressedSize)}async function it(ze,Ke,ut){const{decompress:yt,fileDataStart:Ne}=await ct(ze,Ke);if(!yt){const Rt=await ke(ze,Ne,Ke.compressedSize,ut);return A(Rt)?Rt:new Blob([h(Rt.buffer)?new Uint8Array(Rt):Rt],{type:ut})}const tt=await ke(ze,Ne,Ke.compressedSize);return await te(tt,Ke.uncompressedSize,ut)}function Ze(ze){he(ze)}async function Xe(ze){let Ke;if(typeof Blob<"u"&&ze instanceof Blob)Ke=new c(ze);else if(ze instanceof ArrayBuffer||ze&&ze.buffer&&ze.buffer instanceof ArrayBuffer)Ke=new l(ze);else if(h(ze)||h(ze.buffer))Ke=new l(ze);else if(typeof ze=="string"){const yt=await fetch(ze);if(!yt.ok)throw new Error(`failed http request ${ze}, status: ${yt.status}: ${yt.statusText}`);const Ne=await yt.blob();Ke=new c(Ne)}else if(typeof ze.getLength=="function"&&typeof ze.read=="function")Ke=ze;else throw new Error("unsupported source type");const ut=await Ke.getLength();if(ut>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${ut}. Only file sizes up 4503599627370496 bytes are supported`);return await be(Ke,ut)}async function dt(ze){const{zip:Ke,entries:ut}=await Xe(ze);return{zip:Ke,entries:Object.fromEntries(ut.map(yt=>[yt.name,yt]))}}function at(){se()}},"./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(l,c,f,p){p===void 0&&(p=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,p,m)}:function(l,c,f,p){p===void 0&&(p=f),l[p]=c[f]}),S=this&&this.__setModuleDefault||(Object.create?function(l,c){Object.defineProperty(l,"default",{enumerable:!0,value:c})}:function(l,c){l.default=c}),A=this&&this.__importStar||function(l){if(l&&l.__esModule)return l;var c={};if(l!=null)for(var f in l)f!=="default"&&Object.prototype.hasOwnProperty.call(l,f)&&x(c,l,f);return S(c,l),c};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Helpers=void 0;const h=a("./node_modules/fast-xml-parser/src/fxp.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(l){l.XmlParserOptions=d.XmlParserOptions,l.XmlBuilderOptions=d.XmlBuilderOptions,l.GetViewpoint=d.GetViewpoint,l.XmlToJsonNotation=d.XmlToJsonNotation;const c=d.ChangeToUppercase;function f(R){const{Markup:U}=new h.XMLParser(l.XmlParserOptions).parse(R);return{header:{files:k(U.Header)},topic:{guid:U.Topic["@_Guid"],topic_type:U.Topic["@_TopicType"],topic_status:U.Topic["@_TopicStatus"],reference_links:U.Topic.ReferenceLink&&l.ObjectToArray(U.Topic.ReferenceLink),title:U.Topic.Title,priority:U.Topic.Priority,index:U.Topic.Index,labels:U.Topic.Labels&&l.ObjectToArray(U.Topic.Labels),creation_date:U.Topic.CreationDate,creation_author:U.Topic.CreationAuthor,modified_date:U.Topic.ModifiedDate,modified_author:U.Topic.ModifiedAuthor,assigned_to:U.Topic.AssignedTo,description:U.Topic.Description,comments:l.GetComments(U.Comment),viewpoints:l.GetViewpoints(U.Viewpoints)}}}l.GetMarkup=f;function p(R){if(!R)return;const U=j=>({guid:j["@_Guid"],viewpoint:j.Viewpoint,snapshot:j.Snapshot}),G=[];return Array.isArray(R)?R.forEach(j=>{G.push(U(j))}):G.push(U(R)),G}l.GetViewpoints=p;function m(R){if(!R)return;const U=j=>{var H;return{guid:j["@_Guid"],date:j.Date,author:j.Author,comment:j.Comment,viewpoint:(H=j==null?void 0:j.Viewpoint)==null?void 0:H["@_Guid"],modified_date:j.ModifiedDate,modified_author:j.ModifiedAuthor}},G=[];return Array.isArray(R)?R.forEach(j=>{G.push(U(j))}):G.push(U(R)),G}l.GetComments=m;function v(R){return Array.isArray(R)?R:[R]}l.ObjectToArray=v;function _(R){return{x:R.X,y:R.Y,z:R.Z}}l.ParsePoint=_;const b=["DocumentReferences","RelatedTopics"];function w(R){const U=T(R);let G={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:U.header,topic:U.topic,comment:U.comment,viewpoints:U.viewpoints}};return C(G)}l.MarkupToXmlNotation=w;function C(R,U){let G={};if(typeof R=="string")return R;const j=(U==null?void 0:U.plural_to_singular)!==void 0?U.plural_to_singular:!0;for(const H in R){let W=R[H];if(!W)continue;if(H.startsWith("@_")){G[H]=W;continue}let K=c(H,U);if(Array.isArray(W)){const $=[];for(const L of W)$.push(C(L,U));const O=b.find(L=>L.startsWith(K));O&&j&&(K=O.slice(0,-1)),G[K]=$;continue}typeof W=="object"&&(W=C(W,U)),G[K]=W}return G}l.RenameJsonKeys=C;function k(R){if(R)return l.ObjectToArray(R).map(U=>l.XmlToJsonNotation(U))}function T(R){var W;if(!R.topic)return;const{comments:U,viewpoints:G,...j}=R.topic;return{header:{file:(W=R.header)==null?void 0:W.files},topic:j,comment:U,viewpoints:G}}})(u||(Q.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/2.1/index.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(p,m,v,_){_===void 0&&(_=v);var b=Object.getOwnPropertyDescriptor(m,v);(!b||("get"in b?!m.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return m[v]}}),Object.defineProperty(p,_,b)}:function(p,m,v,_){_===void 0&&(_=v),p[_]=m[v]}),S=this&&this.__exportStar||function(p,m){for(var v in p)v!=="default"&&!Object.prototype.hasOwnProperty.call(m,v)&&x(m,p,v)},A=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.BcfWriter=Q.BcfReader=void 0;const h=a("./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(a("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));S(a("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),Q);const l={GetMarkup:h.Helpers.GetMarkup,GetViewpoint:h.Helpers.GetViewpoint,XmlToJsonNotation:h.Helpers.XmlToJsonNotation,MarkupToXmlNotation:h.Helpers.MarkupToXmlNotation,RenameJsonKeys:h.Helpers.RenameJsonKeys,XmlParserOptions:h.Helpers.XmlParserOptions,XmlBuilderOptions:h.Helpers.XmlBuilderOptions};class c extends d.default{constructor(){super("2.1",l)}}Q.BcfReader=c;class f extends u.default{constructor(){super("2.1",l)}}Q.BcfWriter=f},"./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(l,c,f,p){p===void 0&&(p=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,p,m)}:function(l,c,f,p){p===void 0&&(p=f),l[p]=c[f]}),S=this&&this.__setModuleDefault||(Object.create?function(l,c){Object.defineProperty(l,"default",{enumerable:!0,value:c})}:function(l,c){l.default=c}),A=this&&this.__importStar||function(l){if(l&&l.__esModule)return l;var c={};if(l!=null)for(var f in l)f!=="default"&&Object.prototype.hasOwnProperty.call(l,f)&&x(c,l,f);return S(c,l),c};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Helpers=void 0;const h=a("./node_modules/fast-xml-parser/src/fxp.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(l){l.XmlParserOptions={...d.XmlParserOptions,oneListGroup:!0},l.XmlBuilderOptions=d.XmlBuilderOptions,l.GetViewpoint=d.GetViewpoint,l.XmlToJsonNotation=d.XmlToJsonNotation;const c=d.ChangeToUppercase;function f(v){const{Markup:_}=new h.XMLParser(l.XmlParserOptions).parse(v),b=l.XmlToJsonNotation(_);return{header:b.header,topic:b.topic}}l.GetMarkup=f;function p(v){let _={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:v.header,topic:v.topic}};return m(_)}l.MarkupToXmlNotation=p;function m(v,_){let b={};if(typeof v=="string")return v;const w=(_==null?void 0:_.plural_to_singular)!==void 0?_.plural_to_singular:!0;for(const C in v){let k=v[C];if(!k)continue;if(C.startsWith("@_")){b[C]=k;continue}let T=c(C,_);if(Array.isArray(k)){const R=[];for(const U of k){let G={},j=T;w&&(j=j.slice(0,-1)),G[j]=m(U,_),R.push(G)}b[T]=R;continue}typeof k=="object"&&(k=m(k,_)),b[T]=k}return b}l.RenameJsonKeys=m})(u||(Q.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/3.0/index.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(p,m,v,_){_===void 0&&(_=v);var b=Object.getOwnPropertyDescriptor(m,v);(!b||("get"in b?!m.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return m[v]}}),Object.defineProperty(p,_,b)}:function(p,m,v,_){_===void 0&&(_=v),p[_]=m[v]}),S=this&&this.__exportStar||function(p,m){for(var v in p)v!=="default"&&!Object.prototype.hasOwnProperty.call(m,v)&&x(m,p,v)},A=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.BcfWriter=Q.BcfReader=void 0;const h=a("./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(a("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));S(a("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),Q);const l={GetMarkup:h.Helpers.GetMarkup,GetViewpoint:h.Helpers.GetViewpoint,XmlToJsonNotation:h.Helpers.XmlToJsonNotation,MarkupToXmlNotation:h.Helpers.MarkupToXmlNotation,RenameJsonKeys:h.Helpers.RenameJsonKeys,XmlParserOptions:h.Helpers.XmlParserOptions,XmlBuilderOptions:h.Helpers.XmlBuilderOptions};class c extends d.default{constructor(){super("3.0",l)}}Q.BcfReader=c;class f extends u.default{constructor(){super("3.0",l)}}Q.BcfWriter=f},"./node_modules/@parametricos/bcf-js/dist/BcfReader.js"(N,Q,a){Object.defineProperty(Q,"__esModule",{value:!0}),Q.Markup=void 0;const x=a("./node_modules/unzipit/dist/unzipit.module.js"),S=a("./node_modules/fast-xml-parser/src/fxp.js");class A{constructor(u,l){Fi(this,"version");Fi(this,"bcf_archive");Fi(this,"project");Fi(this,"markups",[]);Fi(this,"helpers");Fi(this,"read",async u=>{try{const l=[];this.bcf_archive=await(0,x.unzip)(u);const{entries:c}=this.bcf_archive;let f="",p="",m="",v;for(const[b,w]of Object.entries(c))if(b.endsWith(".bcf"))l.push(w);else if(b.endsWith(".version"))m=new S.XMLParser(this.helpers.XmlParserOptions).parse(await w.text()).Version.DetailedVersion;else if(b.endsWith(".bcfp")){const C=new S.XMLParser(this.helpers.XmlParserOptions).parse(await w.text());if(!C.ProjectExtension||!C.ProjectExtension.Project)continue;f=C.ProjectExtension.Project["@_ProjectId"]||"",p=C.ProjectExtension.Project.Name||""}else if(b.endsWith("extensions.xsd")){const C=new S.XMLParser(this.helpers.XmlParserOptions).parse(await w.text());v=this.helpers.XmlToJsonNotation(C)}const _=[];for(let b=0;b<l.length;b++){const w=l[b],C=new h(this,w);await C.read(),this.markups.push(C);const k={header:C.header,topic:C.topic,project:this.project,viewpoints:C.viewpoints};_.push(k)}this.project={project_id:f,name:p,version:m,markups:void 0,reader:this,extension_schema:v},this.project.markups=_.map(b=>({...b,project:this.project}))}catch(l){console.log("Error in loading BCF archive. The error below was thrown."),console.error(l)}});Fi(this,"getEntry",u=>{var l;return(l=this.bcf_archive)==null?void 0:l.entries[u]});this.version=u,this.helpers=l}}Q.default=A;class h{constructor(u,l){Fi(this,"reader");Fi(this,"markup_file");Fi(this,"header");Fi(this,"topic");Fi(this,"viewpoints",[]);Fi(this,"read",async()=>{await this.parseMarkup(),await this.parseViewpoints()});Fi(this,"parseMarkup",async()=>{const u=this.reader.helpers.GetMarkup(await this.markup_file.text());this.topic=u.topic,this.header=u.header});Fi(this,"parseViewpoints",async()=>{if(this.topic&&this.topic.viewpoints){const u=this.topic.viewpoints;for(let l=0;l<u.length;l++){const c=u[l],f=this.topic.guid+"/"+c.viewpoint,p=this.reader.getEntry(f);if(!p)throw new Error("Missing Visualization Info");const m=this.reader.helpers.GetViewpoint(await p.text());m.snapshot=c.snapshot,m.getSnapshot=async()=>{if(c.snapshot)return await this.getSnapshot(c.snapshot)},this.viewpoints.push(m)}}});Fi(this,"getViewpointSnapshot",async u=>{if(!u||!this.topic)return;const l=this.reader.getEntry(`${this.topic.guid}/${u.snapshot}`);if(l){const c=await l.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(c)))}});Fi(this,"getSnapshot",async u=>{if(!u||!this.topic)return;const l=this.reader.getEntry(`${this.topic.guid}/${u}`);if(l){const c=await l.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(c)))}});this.reader=u,this.markup_file=l}}Q.Markup=h},"./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"(N,Q,a){var x=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Q,"__esModule",{value:!0});const S=x(a("./node_modules/jszip/dist/jszip.min.js")),A=a("./node_modules/fast-xml-parser/src/fxp.js");class h{constructor(m,v){Fi(this,"version");Fi(this,"project");Fi(this,"markups",[]);Fi(this,"files");Fi(this,"helpers");Fi(this,"addEntry",m=>{m.path.endsWith(".version")||this.files.push(m)});Fi(this,"write",async m=>{try{return this.project=m,d(this,m.markups),await u(this.files)}catch(v){console.log("Error in writing BCF archive. The error below was thrown."),console.error(v)}});this.version=m,this.helpers=v,this.files=[]}}Q.default=h;function d(p,m){if(p.project){p.addEntry(l(p.version)),p.addEntry(c(p.project.project_id,p.project.name)),p.addEntry(f(p));for(const v of m){const _=p.helpers.MarkupToXmlNotation(v);p.markups.push(_);let b=new A.XMLBuilder(p.helpers.XmlBuilderOptions).build(_);if(b=`<?xml version="1.0" encoding="utf-8"?>${b}`,v.topic){const C={path:`${v.topic.guid}/markup.bcf`,content:b};p.addEntry(C)}}}}async function u(p){var v;var m=new S.default;for(const _ of p){const b=_.path.split("/");b&&(b.length==1?m.file(b[0],_.content):b.length==2&&((v=m.folder(b[0]))==null||v.file(b[1],_.content)))}return await m.generateAsync({type:"nodebuffer"})}function l(p){return{path:"bcf.version",content:`<?xml version="1.0" encoding="utf-8"?>
499
+ \0`,he+=h(q,2),he+=G.magic,he+=h(T,2),he+=h(R,2),he+=h(ee.crc32,4),he+=h(ee.compressedSize,4),he+=h(ee.uncompressedSize,4),he+=h(H.length,2),he+=h(I.length,2),{fileRecord:p.LOCAL_FILE_HEADER+he+H+I,dirRecord:p.CENTRAL_FILE_HEADER+h(oe,2)+he+h($.length,2)+"\0\0\0\0"+h(ne,4)+h(w,4)+H+I+$}}var u=x("../utils"),l=x("../stream/GenericWorker"),c=x("../utf8"),f=x("../crc32"),p=x("../signature");function m(v,_,b,w){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=b,this.encodeFileName=w,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(m,l),m.prototype.push=function(v){var _=v.meta.percent||0,b=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,l.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:b?(_+100*(b-w-1))/b:100}}))},m.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var b=d(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:b.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,b=d(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(b.dirRecord),_)this.push({data:function(w){return p.DATA_DESCRIPTOR+h(w.crc32,4)+h(w.compressedSize,4)+h(w.uncompressedSize,4)}(v),meta:{percent:100}});else for(this.push({data:b.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_<this.dirRecords.length;_++)this.push({data:this.dirRecords[_],meta:{percent:100}});var b=this.bytesWritten-v,w=function(C,k,T,R,U){var G=u.transformTo("string",U(R));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+h(C,2)+h(C,2)+h(k,4)+h(T,4)+h(G.length,2)+G}(this.dirRecords.length,b,v,this.zipComment,this.encodeFileName);this.push({data:w,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(v){this._sources.push(v);var _=this;return v.on("data",function(b){_.processChunk(b)}),v.on("end",function(){_.closedSource(_.previous.streamInfo),_._sources.length?_.prepareNextSource():_.end()}),v.on("error",function(b){_.error(b)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(v){var _=this._sources;if(!l.prototype.error.call(this,v))return!1;for(var b=0;b<_.length;b++)try{_[b].error(v)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var v=this._sources,_=0;_<v.length;_++)v[_].lock()},S.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(x,S,A){var h=x("../compressions"),d=x("./ZipFileWorker");A.generateWorker=function(u,l,c){var f=new d(l.streamFiles,c,l.platform,l.encodeFileName),p=0;try{u.forEach(function(m,v){p++;var _=function(k,T){var R=k||T,U=h[R];if(!U)throw new Error(R+" is not a valid compression method !");return U}(v.options.compression,l.compression),b=v.options.compressionOptions||l.compressionOptions||{},w=v.dir,C=v.date;v._compressWorker(_,b).withStreamInfo("file",{name:m,dir:w,date:C,comment:v.comment||"",unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions}).pipe(f)}),f.entriesCount=p}catch(m){f.error(m)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(x,S,A){function h(){if(!(this instanceof h))return new h;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var d=new h;for(var u in this)typeof this[u]!="function"&&(d[u]=this[u]);return d}}(h.prototype=x("./object")).loadAsync=x("./load"),h.support=x("./support"),h.defaults=x("./defaults"),h.version="3.10.1",h.loadAsync=function(d,u){return new h().loadAsync(d,u)},h.external=x("./external"),S.exports=h},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(x,S,A){var h=x("./utils"),d=x("./external"),u=x("./utf8"),l=x("./zipEntries"),c=x("./stream/Crc32Probe"),f=x("./nodejsUtils");function p(m){return new d.Promise(function(v,_){var b=m.decompressed.getContentWorker().pipe(new c);b.on("error",function(w){_(w)}).on("end",function(){b.streamInfo.crc32!==m.decompressed.crc32?_(new Error("Corrupted zip : CRC32 mismatch")):v()}).resume()})}S.exports=function(m,v){var _=this;return v=h.extend(v||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:u.utf8decode}),f.isNode&&f.isStream(m)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):h.prepareContent("the loaded zip file",m,!0,v.optimizedBinaryString,v.base64).then(function(b){var w=new l(v);return w.load(b),w}).then(function(b){var w=[d.Promise.resolve(b)],C=b.files;if(v.checkCRC32)for(var k=0;k<C.length;k++)w.push(p(C[k]));return d.Promise.all(w)}).then(function(b){for(var w=b.shift(),C=w.files,k=0;k<C.length;k++){var T=C[k],R=T.fileNameStr,U=h.resolve(T.fileNameStr);_.file(U,T.decompressed,{binary:!0,optimizedBinaryString:!0,date:T.date,dir:T.dir,comment:T.fileCommentStr.length?T.fileCommentStr:null,unixPermissions:T.unixPermissions,dosPermissions:T.dosPermissions,createFolders:v.createFolders}),T.dir||(_.file(U).unsafeOriginalName=R)}return w.zipComment.length&&(_.comment=w.zipComment),_})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(x,S,A){var h=x("../utils"),d=x("../stream/GenericWorker");function u(l,c){d.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}h.inherits(u,d),u.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(f){c.push({data:f,meta:{percent:0}})}).on("error",function(f){c.isPaused?this.generatedError=f:c.error(f)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},u.prototype.pause=function(){return!!d.prototype.pause.call(this)&&(this._stream.pause(),!0)},u.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},S.exports=u},{"../stream/GenericWorker":28,"../utils":32}],13:[function(x,S,A){var h=x("readable-stream").Readable;function d(u,l,c){h.call(this,l),this._helper=u;var f=this;u.on("data",function(p,m){f.push(p)||f._helper.pause(),c&&c(m)}).on("error",function(p){f.emit("error",p)}).on("end",function(){f.push(null)})}x("../utils").inherits(d,h),d.prototype._read=function(){this._helper.resume()},S.exports=d},{"../utils":32,"readable-stream":16}],14:[function(x,S,A){S.exports={isNode:typeof Buffer<"u",newBufferFrom:function(h,d){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(h,d);if(typeof h=="number")throw new Error('The "data" argument must not be a number');return new Buffer(h,d)},allocBuffer:function(h){if(Buffer.alloc)return Buffer.alloc(h);var d=new Buffer(h);return d.fill(0),d},isBuffer:function(h){return Buffer.isBuffer(h)},isStream:function(h){return h&&typeof h.on=="function"&&typeof h.pause=="function"&&typeof h.resume=="function"}}},{}],15:[function(x,S,A){function h(U,G,j){var H,W=u.getTypeOf(G),K=u.extend(j||{},f);K.date=K.date||new Date,K.compression!==null&&(K.compression=K.compression.toUpperCase()),typeof K.unixPermissions=="string"&&(K.unixPermissions=parseInt(K.unixPermissions,8)),K.unixPermissions&&16384&K.unixPermissions&&(K.dir=!0),K.dosPermissions&&16&K.dosPermissions&&(K.dir=!0),K.dir&&(U=C(U)),K.createFolders&&(H=w(U))&&k.call(this,H,!0);var $=W==="string"&&K.binary===!1&&K.base64===!1;j&&j.binary!==void 0||(K.binary=!$),(G instanceof p&&G.uncompressedSize===0||K.dir||!G||G.length===0)&&(K.base64=!1,K.binary=!0,G="",K.compression="STORE",W="string");var O=null;O=G instanceof p||G instanceof l?G:_.isNode&&_.isStream(G)?new b(U,G):u.prepareContent(U,G,K.binary,K.optimizedBinaryString,K.base64);var L=new m(U,O,K);this.files[U]=L}var d=x("./utf8"),u=x("./utils"),l=x("./stream/GenericWorker"),c=x("./stream/StreamHelper"),f=x("./defaults"),p=x("./compressedObject"),m=x("./zipObject"),v=x("./generate"),_=x("./nodejsUtils"),b=x("./nodejs/NodejsStreamInputAdapter"),w=function(U){U.slice(-1)==="/"&&(U=U.substring(0,U.length-1));var G=U.lastIndexOf("/");return 0<G?U.substring(0,G):""},C=function(U){return U.slice(-1)!=="/"&&(U+="/"),U},k=function(U,G){return G=G!==void 0?G:f.createFolders,U=C(U),this.files[U]||h.call(this,U,null,{dir:!0,createFolders:G}),this.files[U]};function T(U){return Object.prototype.toString.call(U)==="[object RegExp]"}var R={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(U){var G,j,H;for(G in this.files)H=this.files[G],(j=G.slice(this.root.length,G.length))&&G.slice(0,this.root.length)===this.root&&U(j,H)},filter:function(U){var G=[];return this.forEach(function(j,H){U(j,H)&&G.push(H)}),G},file:function(U,G,j){if(arguments.length!==1)return U=this.root+U,h.call(this,U,G,j),this;if(T(U)){var H=U;return this.filter(function(K,$){return!$.dir&&H.test(K)})}var W=this.files[this.root+U];return W&&!W.dir?W:null},folder:function(U){if(!U)return this;if(T(U))return this.filter(function(W,K){return K.dir&&U.test(W)});var G=this.root+U,j=k.call(this,G),H=this.clone();return H.root=j.name,H},remove:function(U){U=this.root+U;var G=this.files[U];if(G||(U.slice(-1)!=="/"&&(U+="/"),G=this.files[U]),G&&!G.dir)delete this.files[U];else for(var j=this.filter(function(W,K){return K.name.slice(0,U.length)===U}),H=0;H<j.length;H++)delete this.files[j[H].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(U){var G,j={};try{if((j=u.extend(U||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=j.type.toLowerCase(),j.compression=j.compression.toUpperCase(),j.type==="binarystring"&&(j.type="string"),!j.type)throw new Error("No output type specified.");u.checkSupport(j.type),j.platform!=="darwin"&&j.platform!=="freebsd"&&j.platform!=="linux"&&j.platform!=="sunos"||(j.platform="UNIX"),j.platform==="win32"&&(j.platform="DOS");var H=j.comment||this.comment||"";G=v.generateWorker(this,j,H)}catch(W){(G=new l("error")).error(W)}return new c(G,j.type||"string",j.mimeType)},generateAsync:function(U,G){return this.generateInternalStream(U).accumulate(G)},generateNodeStream:function(U,G){return(U=U||{}).type||(U.type="nodebuffer"),this.generateInternalStream(U).toNodejsStream(G)}};S.exports=R},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(x,S,A){S.exports=x("stream")},{stream:void 0}],17:[function(x,S,A){var h=x("./DataReader");function d(u){h.call(this,u);for(var l=0;l<this.data.length;l++)u[l]=255&u[l]}x("../utils").inherits(d,h),d.prototype.byteAt=function(u){return this.data[this.zero+u]},d.prototype.lastIndexOfSignature=function(u){for(var l=u.charCodeAt(0),c=u.charCodeAt(1),f=u.charCodeAt(2),p=u.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===f&&this.data[m+3]===p)return m-this.zero;return-1},d.prototype.readAndCheckSignature=function(u){var l=u.charCodeAt(0),c=u.charCodeAt(1),f=u.charCodeAt(2),p=u.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&f===m[2]&&p===m[3]},d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./DataReader":18}],18:[function(x,S,A){var h=x("../utils");function d(u){this.data=u,this.length=u.length,this.index=0,this.zero=0}d.prototype={checkOffset:function(u){this.checkIndex(this.index+u)},checkIndex:function(u){if(this.length<this.zero+u||u<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+u+"). Corrupted zip ?")},setIndex:function(u){this.checkIndex(u),this.index=u},skip:function(u){this.setIndex(this.index+u)},byteAt:function(){},readInt:function(u){var l,c=0;for(this.checkOffset(u),l=this.index+u-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=u,c},readString:function(u){return h.transformTo("string",this.readData(u))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var u=this.readInt(4);return new Date(Date.UTC(1980+(u>>25&127),(u>>21&15)-1,u>>16&31,u>>11&31,u>>5&63,(31&u)<<1))}},S.exports=d},{"../utils":32}],19:[function(x,S,A){var h=x("./Uint8ArrayReader");function d(u){h.call(this,u)}x("../utils").inherits(d,h),d.prototype.readData=function(u){this.checkOffset(u);var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(x,S,A){var h=x("./DataReader");function d(u){h.call(this,u)}x("../utils").inherits(d,h),d.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},d.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},d.prototype.readAndCheckSignature=function(u){return u===this.readData(4)},d.prototype.readData=function(u){this.checkOffset(u);var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./DataReader":18}],21:[function(x,S,A){var h=x("./ArrayReader");function d(u){h.call(this,u)}x("../utils").inherits(d,h),d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},S.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(x,S,A){var h=x("../utils"),d=x("../support"),u=x("./ArrayReader"),l=x("./StringReader"),c=x("./NodeBufferReader"),f=x("./Uint8ArrayReader");S.exports=function(p){var m=h.getTypeOf(p);return h.checkSupport(m),m!=="string"||d.uint8array?m==="nodebuffer"?new c(p):d.uint8array?new f(h.transformTo("uint8array",p)):new u(h.transformTo("array",p)):new l(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(x,S,A){A.LOCAL_FILE_HEADER="PK",A.CENTRAL_FILE_HEADER="PK",A.CENTRAL_DIRECTORY_END="PK",A.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",A.ZIP64_CENTRAL_DIRECTORY_END="PK",A.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(x,S,A){var h=x("./GenericWorker"),d=x("../utils");function u(l){h.call(this,"ConvertWorker to "+l),this.destType=l}d.inherits(u,h),u.prototype.processChunk=function(l){this.push({data:d.transformTo(this.destType,l.data),meta:l.meta})},S.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(x,S,A){var h=x("./GenericWorker"),d=x("../crc32");function u(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}x("../utils").inherits(u,h),u.prototype.processChunk=function(l){this.streamInfo.crc32=d(l.data,this.streamInfo.crc32||0),this.push(l)},S.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(x,S,A){var h=x("../utils"),d=x("./GenericWorker");function u(l){d.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}h.inherits(u,d),u.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}d.prototype.processChunk.call(this,l)},S.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(x,S,A){var h=x("../utils"),d=x("./GenericWorker");function u(l){d.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(f){c.dataIsReady=!0,c.data=f,c.max=f&&f.length||0,c.type=h.getTypeOf(f),c.isPaused||c._tickAndRepeat()},function(f){c.error(f)})}h.inherits(u,d),u.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},S.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(x,S,A){function h(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,u){return this._listeners[d].push(u),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,u){if(this._listeners[d])for(var l=0;l<this._listeners[d].length;l++)this._listeners[d][l].call(this,u)},pipe:function(d){return d.registerPrevious(this)},registerPrevious:function(d){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=d.streamInfo,this.mergeStreamInfo(),this.previous=d;var u=this;return d.on("data",function(l){u.processChunk(l)}),d.on("end",function(){u.end()}),d.on("error",function(l){u.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var d=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),d=!0),this.previous&&this.previous.resume(),!d},flush:function(){},processChunk:function(d){this.push(d)},withStreamInfo:function(d,u){return this.extraStreamInfo[d]=u,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var d in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,d)&&(this.streamInfo[d]=this.extraStreamInfo[d])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var d="Worker "+this.name;return this.previous?this.previous+" -> "+d:d}},S.exports=h},{}],29:[function(x,S,A){var h=x("../utils"),d=x("./ConvertWorker"),u=x("./GenericWorker"),l=x("../base64"),c=x("../support"),f=x("../external"),p=null;if(c.nodestream)try{p=x("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(_,b){return new f.Promise(function(w,C){var k=[],T=_._internalType,R=_._outputType,U=_._mimeType;_.on("data",function(G,j){k.push(G),b&&b(j)}).on("error",function(G){k=[],C(G)}).on("end",function(){try{var G=function(j,H,W){switch(j){case"blob":return h.newBlob(h.transformTo("arraybuffer",H),W);case"base64":return l.encode(H);default:return h.transformTo(j,H)}}(R,function(j,H){var W,K=0,$=null,O=0;for(W=0;W<H.length;W++)O+=H[W].length;switch(j){case"string":return H.join("");case"array":return Array.prototype.concat.apply([],H);case"uint8array":for($=new Uint8Array(O),W=0;W<H.length;W++)$.set(H[W],K),K+=H[W].length;return $;case"nodebuffer":return Buffer.concat(H);default:throw new Error("concat : unsupported type '"+j+"'")}}(T,k),U);w(G)}catch(j){C(j)}k=[]}).resume()})}function v(_,b,w){var C=b;switch(b){case"blob":case"arraybuffer":C="uint8array";break;case"base64":C="string"}try{this._internalType=C,this._outputType=b,this._mimeType=w,h.checkSupport(C),this._worker=_.pipe(new d(C)),_.lock()}catch(k){this._worker=new u("error"),this._worker.error(k)}}v.prototype={accumulate:function(_){return m(this,_)},on:function(_,b){var w=this;return _==="data"?this._worker.on(_,function(C){b.call(w,C.data,C.meta)}):this._worker.on(_,function(){h.delay(b,arguments,w)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){if(h.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},_)}},S.exports=v},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(x,S,A){if(A.base64=!0,A.array=!0,A.string=!0,A.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",A.nodebuffer=typeof Buffer<"u",A.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")A.blob=!1;else{var h=new ArrayBuffer(0);try{A.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(h),A.blob=d.getBlob("application/zip").size===0}catch{A.blob=!1}}}try{A.nodestream=!!x("readable-stream").Readable}catch{A.nodestream=!1}},{"readable-stream":16}],31:[function(x,S,A){for(var h=x("./utils"),d=x("./support"),u=x("./nodejsUtils"),l=x("./stream/GenericWorker"),c=new Array(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;c[254]=c[254]=1;function p(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}A.utf8encode=function(v){return d.nodebuffer?u.newBufferFrom(v,"utf-8"):function(_){var b,w,C,k,T,R=_.length,U=0;for(k=0;k<R;k++)(64512&(w=_.charCodeAt(k)))==55296&&k+1<R&&(64512&(C=_.charCodeAt(k+1)))==56320&&(w=65536+(w-55296<<10)+(C-56320),k++),U+=w<128?1:w<2048?2:w<65536?3:4;for(b=d.uint8array?new Uint8Array(U):new Array(U),k=T=0;T<U;k++)(64512&(w=_.charCodeAt(k)))==55296&&k+1<R&&(64512&(C=_.charCodeAt(k+1)))==56320&&(w=65536+(w-55296<<10)+(C-56320),k++),w<128?b[T++]=w:(w<2048?b[T++]=192|w>>>6:(w<65536?b[T++]=224|w>>>12:(b[T++]=240|w>>>18,b[T++]=128|w>>>12&63),b[T++]=128|w>>>6&63),b[T++]=128|63&w);return b}(v)},A.utf8decode=function(v){return d.nodebuffer?h.transformTo("nodebuffer",v).toString("utf-8"):function(_){var b,w,C,k,T=_.length,R=new Array(2*T);for(b=w=0;b<T;)if((C=_[b++])<128)R[w++]=C;else if(4<(k=c[C]))R[w++]=65533,b+=k-1;else{for(C&=k===2?31:k===3?15:7;1<k&&b<T;)C=C<<6|63&_[b++],k--;1<k?R[w++]=65533:C<65536?R[w++]=C:(C-=65536,R[w++]=55296|C>>10&1023,R[w++]=56320|1023&C)}return R.length!==w&&(R.subarray?R=R.subarray(0,w):R.length=w),h.applyFromCharCode(R)}(v=h.transformTo(d.uint8array?"uint8array":"array",v))},h.inherits(p,l),p.prototype.processChunk=function(v){var _=h.transformTo(d.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var b=_;(_=new Uint8Array(b.length+this.leftOver.length)).set(this.leftOver,0),_.set(b,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var w=function(k,T){var R;for((T=T||k.length)>k.length&&(T=k.length),R=T-1;0<=R&&(192&k[R])==128;)R--;return R<0||R===0?T:R+c[k[R]]>T?R:T}(_),C=_;w!==_.length&&(d.uint8array?(C=_.subarray(0,w),this.leftOver=_.subarray(w,_.length)):(C=_.slice(0,w),this.leftOver=_.slice(w,_.length))),this.push({data:A.utf8decode(C),meta:v.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:A.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},A.Utf8DecodeWorker=p,h.inherits(m,l),m.prototype.processChunk=function(v){this.push({data:A.utf8encode(v.data),meta:v.meta})},A.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(x,S,A){var h=x("./support"),d=x("./base64"),u=x("./nodejsUtils"),l=x("./external");function c(b){return b}function f(b,w){for(var C=0;C<b.length;++C)w[C]=255&b.charCodeAt(C);return w}x("setimmediate"),A.newBlob=function(b,w){A.checkSupport("blob");try{return new Blob([b],{type:w})}catch{try{var C=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return C.append(b),C.getBlob(w)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(b,w,C){var k=[],T=0,R=b.length;if(R<=C)return String.fromCharCode.apply(null,b);for(;T<R;)w==="array"||w==="nodebuffer"?k.push(String.fromCharCode.apply(null,b.slice(T,Math.min(T+C,R)))):k.push(String.fromCharCode.apply(null,b.subarray(T,Math.min(T+C,R)))),T+=C;return k.join("")},stringifyByChar:function(b){for(var w="",C=0;C<b.length;C++)w+=String.fromCharCode(b[C]);return w},applyCanBeUsed:{uint8array:function(){try{return h.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return h.nodebuffer&&String.fromCharCode.apply(null,u.allocBuffer(1)).length===1}catch{return!1}}()}};function m(b){var w=65536,C=A.getTypeOf(b),k=!0;if(C==="uint8array"?k=p.applyCanBeUsed.uint8array:C==="nodebuffer"&&(k=p.applyCanBeUsed.nodebuffer),k)for(;1<w;)try{return p.stringifyByChunk(b,C,w)}catch{w=Math.floor(w/2)}return p.stringifyByChar(b)}function v(b,w){for(var C=0;C<b.length;C++)w[C]=b[C];return w}A.applyFromCharCode=m;var _={};_.string={string:c,array:function(b){return f(b,new Array(b.length))},arraybuffer:function(b){return _.string.uint8array(b).buffer},uint8array:function(b){return f(b,new Uint8Array(b.length))},nodebuffer:function(b){return f(b,u.allocBuffer(b.length))}},_.array={string:m,array:c,arraybuffer:function(b){return new Uint8Array(b).buffer},uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return u.newBufferFrom(b)}},_.arraybuffer={string:function(b){return m(new Uint8Array(b))},array:function(b){return v(new Uint8Array(b),new Array(b.byteLength))},arraybuffer:c,uint8array:function(b){return new Uint8Array(b)},nodebuffer:function(b){return u.newBufferFrom(new Uint8Array(b))}},_.uint8array={string:m,array:function(b){return v(b,new Array(b.length))},arraybuffer:function(b){return b.buffer},uint8array:c,nodebuffer:function(b){return u.newBufferFrom(b)}},_.nodebuffer={string:m,array:function(b){return v(b,new Array(b.length))},arraybuffer:function(b){return _.nodebuffer.uint8array(b).buffer},uint8array:function(b){return v(b,new Uint8Array(b.length))},nodebuffer:c},A.transformTo=function(b,w){if(w=w||"",!b)return w;A.checkSupport(b);var C=A.getTypeOf(w);return _[C][b](w)},A.resolve=function(b){for(var w=b.split("/"),C=[],k=0;k<w.length;k++){var T=w[k];T==="."||T===""&&k!==0&&k!==w.length-1||(T===".."?C.pop():C.push(T))}return C.join("/")},A.getTypeOf=function(b){return typeof b=="string"?"string":Object.prototype.toString.call(b)==="[object Array]"?"array":h.nodebuffer&&u.isBuffer(b)?"nodebuffer":h.uint8array&&b instanceof Uint8Array?"uint8array":h.arraybuffer&&b instanceof ArrayBuffer?"arraybuffer":void 0},A.checkSupport=function(b){if(!h[b.toLowerCase()])throw new Error(b+" is not supported by this platform")},A.MAX_VALUE_16BITS=65535,A.MAX_VALUE_32BITS=-1,A.pretty=function(b){var w,C,k="";for(C=0;C<(b||"").length;C++)k+="\\x"+((w=b.charCodeAt(C))<16?"0":"")+w.toString(16).toUpperCase();return k},A.delay=function(b,w,C){setImmediate(function(){b.apply(C||null,w||[])})},A.inherits=function(b,w){function C(){}C.prototype=w.prototype,b.prototype=new C},A.extend=function(){var b,w,C={};for(b=0;b<arguments.length;b++)for(w in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],w)&&C[w]===void 0&&(C[w]=arguments[b][w]);return C},A.prepareContent=function(b,w,C,k,T){return l.Promise.resolve(w).then(function(R){return h.blob&&(R instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(R))!==-1)&&typeof FileReader<"u"?new l.Promise(function(U,G){var j=new FileReader;j.onload=function(H){U(H.target.result)},j.onerror=function(H){G(H.target.error)},j.readAsArrayBuffer(R)}):R}).then(function(R){var U=A.getTypeOf(R);return U?(U==="arraybuffer"?R=A.transformTo("uint8array",R):U==="string"&&(T?R=d.decode(R):C&&k!==!0&&(R=function(G){return f(G,h.uint8array?new Uint8Array(G.length):new Array(G.length))}(R))),R):l.Promise.reject(new Error("Can't read the data of '"+b+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(x,S,A){var h=x("./reader/readerFor"),d=x("./utils"),u=x("./signature"),l=x("./zipEntry"),c=x("./support");function f(p){this.files=[],this.loadOptions=p}f.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(m)+", expected "+d.pretty(p)+")")}},isSignature:function(p,m){var v=this.reader.index;this.reader.setIndex(p);var _=this.reader.readString(4)===m;return this.reader.setIndex(v),_},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",v=d.transformTo(m,p);this.zipComment=this.loadOptions.decodeFileName(v)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,m,v,_=this.zip64EndOfCentralSize-44;0<_;)p=this.reader.readInt(2),m=this.reader.readInt(4),v=this.reader.readData(m),this.zip64ExtensibleData[p]={id:p,length:m,value:v}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,m;for(p=0;p<this.files.length;p++)m=this.files[p],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(u.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(u.CENTRAL_FILE_HEADER);)(p=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(u.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,u.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var m=p;if(this.checkSignature(u.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===d.MAX_VALUE_16BITS||this.diskWithCentralDirStart===d.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===d.MAX_VALUE_16BITS||this.centralDirRecords===d.MAX_VALUE_16BITS||this.centralDirSize===d.MAX_VALUE_32BITS||this.centralDirOffset===d.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(u.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(u.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,u.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(u.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(u.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var v=this.centralDirOffset+this.centralDirSize;this.zip64&&(v+=20,v+=12+this.zip64EndOfCentralSize);var _=m-v;if(0<_)this.isSignature(m,u.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(p){this.reader=h(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},S.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(x,S,A){var h=x("./reader/readerFor"),d=x("./utils"),u=x("./compressedObject"),l=x("./crc32"),c=x("./utf8"),f=x("./compressions"),p=x("./support");function m(v,_){this.options=v,this.loadOptions=_}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(v){var _,b;if(v.skip(22),this.fileNameLength=v.readInt(2),b=v.readInt(2),this.fileName=v.readData(this.fileNameLength),v.skip(b),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((_=function(w){for(var C in f)if(Object.prototype.hasOwnProperty.call(f,C)&&f[C].magic===w)return f[C];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+d.pretty(this.compressionMethod)+" unknown (inner file : "+d.transformTo("string",this.fileName)+")");this.decompressed=new u(this.compressedSize,this.uncompressedSize,this.crc32,_,v.readData(this.compressedSize))},readCentralPart:function(v){this.versionMadeBy=v.readInt(2),v.skip(2),this.bitFlag=v.readInt(2),this.compressionMethod=v.readString(2),this.date=v.readDate(),this.crc32=v.readInt(4),this.compressedSize=v.readInt(4),this.uncompressedSize=v.readInt(4);var _=v.readInt(2);if(this.extraFieldsLength=v.readInt(2),this.fileCommentLength=v.readInt(2),this.diskNumberStart=v.readInt(2),this.internalFileAttributes=v.readInt(2),this.externalFileAttributes=v.readInt(4),this.localHeaderOffset=v.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");v.skip(_),this.readExtraFields(v),this.parseZIP64ExtraField(v),this.fileComment=v.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var v=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=h(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,b,w,C=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4<C;)_=v.readInt(2),b=v.readInt(2),w=v.readData(b),this.extraFields[_]={id:_,length:b,value:w};v.setIndex(C)},handleUTF8:function(){var v=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var _=this.findExtraFieldUnicodePath();if(_!==null)this.fileNameStr=_;else{var b=d.transformTo(v,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(b)}var w=this.findExtraFieldUnicodeComment();if(w!==null)this.fileCommentStr=w;else{var C=d.transformTo(v,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(C)}}},findExtraFieldUnicodePath:function(){var v=this.extraFields[28789];if(v){var _=h(v.value);return _.readInt(1)!==1||l(this.fileName)!==_.readInt(4)?null:c.utf8decode(_.readData(v.length-5))}return null},findExtraFieldUnicodeComment:function(){var v=this.extraFields[25461];if(v){var _=h(v.value);return _.readInt(1)!==1||l(this.fileComment)!==_.readInt(4)?null:c.utf8decode(_.readData(v.length-5))}return null}},S.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(x,S,A){function h(_,b,w){this.name=_,this.dir=w.dir,this.date=w.date,this.comment=w.comment,this.unixPermissions=w.unixPermissions,this.dosPermissions=w.dosPermissions,this._data=b,this._dataBinary=w.binary,this.options={compression:w.compression,compressionOptions:w.compressionOptions}}var d=x("./stream/StreamHelper"),u=x("./stream/DataWorker"),l=x("./utf8"),c=x("./compressedObject"),f=x("./stream/GenericWorker");h.prototype={internalStream:function(_){var b=null,w="string";try{if(!_)throw new Error("No output type specified.");var C=(w=_.toLowerCase())==="string"||w==="text";w!=="binarystring"&&w!=="text"||(w="string"),b=this._decompressWorker();var k=!this._dataBinary;k&&!C&&(b=b.pipe(new l.Utf8EncodeWorker)),!k&&C&&(b=b.pipe(new l.Utf8DecodeWorker))}catch(T){(b=new f("error")).error(T)}return new d(b,w,"")},async:function(_,b){return this.internalStream(_).accumulate(b)},nodeStream:function(_,b){return this.internalStream(_||"nodebuffer").toNodejsStream(b)},_compressWorker:function(_,b){if(this._data instanceof c&&this._data.compression.magic===_.magic)return this._data.getCompressedWorker();var w=this._decompressWorker();return this._dataBinary||(w=w.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(w,_,b)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof f?this._data:new u(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},v=0;v<p.length;v++)h.prototype[p[v]]=m;S.exports=h},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(x,S,A){(function(h){var d,u,l=h.MutationObserver||h.WebKitMutationObserver;if(l){var c=0,f=new l(_),p=h.document.createTextNode("");f.observe(p,{characterData:!0}),d=function(){p.data=c=++c%2}}else if(h.setImmediate||h.MessageChannel===void 0)d="document"in h&&"onreadystatechange"in h.document.createElement("script")?function(){var b=h.document.createElement("script");b.onreadystatechange=function(){_(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},h.document.documentElement.appendChild(b)}:function(){setTimeout(_,0)};else{var m=new h.MessageChannel;m.port1.onmessage=_,d=function(){m.port2.postMessage(0)}}var v=[];function _(){var b,w;u=!0;for(var C=v.length;C;){for(w=v,v=[],b=-1;++b<C;)w[b]();C=v.length}u=!1}S.exports=function(b){v.push(b)!==1||u||d()}}).call(this,typeof a.g<"u"?a.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(x,S,A){var h=x("immediate");function d(){}var u={},l=["REJECTED"],c=["FULFILLED"],f=["PENDING"];function p(C){if(typeof C!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,C!==d&&b(this,C)}function m(C,k,T){this.promise=C,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}function v(C,k,T){h(function(){var R;try{R=k(T)}catch(U){return u.reject(C,U)}R===C?u.reject(C,new TypeError("Cannot resolve promise with itself")):u.resolve(C,R)})}function _(C){var k=C&&C.then;if(C&&(typeof C=="object"||typeof C=="function")&&typeof k=="function")return function(){k.apply(C,arguments)}}function b(C,k){var T=!1;function R(j){T||(T=!0,u.reject(C,j))}function U(j){T||(T=!0,u.resolve(C,j))}var G=w(function(){k(U,R)});G.status==="error"&&R(G.value)}function w(C,k){var T={};try{T.value=C(k),T.status="success"}catch(R){T.status="error",T.value=R}return T}(S.exports=p).prototype.finally=function(C){if(typeof C!="function")return this;var k=this.constructor;return this.then(function(T){return k.resolve(C()).then(function(){return T})},function(T){return k.resolve(C()).then(function(){throw T})})},p.prototype.catch=function(C){return this.then(null,C)},p.prototype.then=function(C,k){if(typeof C!="function"&&this.state===c||typeof k!="function"&&this.state===l)return this;var T=new this.constructor(d);return this.state!==f?v(T,this.state===c?C:k,this.outcome):this.queue.push(new m(T,C,k)),T},m.prototype.callFulfilled=function(C){u.resolve(this.promise,C)},m.prototype.otherCallFulfilled=function(C){v(this.promise,this.onFulfilled,C)},m.prototype.callRejected=function(C){u.reject(this.promise,C)},m.prototype.otherCallRejected=function(C){v(this.promise,this.onRejected,C)},u.resolve=function(C,k){var T=w(_,k);if(T.status==="error")return u.reject(C,T.value);var R=T.value;if(R)b(C,R);else{C.state=c,C.outcome=k;for(var U=-1,G=C.queue.length;++U<G;)C.queue[U].callFulfilled(k)}return C},u.reject=function(C,k){C.state=l,C.outcome=k;for(var T=-1,R=C.queue.length;++T<R;)C.queue[T].callRejected(k);return C},p.resolve=function(C){return C instanceof this?C:u.resolve(new this(d),C)},p.reject=function(C){var k=new this(d);return u.reject(k,C)},p.all=function(C){var k=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=C.length,R=!1;if(!T)return this.resolve([]);for(var U=new Array(T),G=0,j=-1,H=new this(d);++j<T;)W(C[j],j);return H;function W(K,$){k.resolve(K).then(function(O){U[$]=O,++G!==T||R||(R=!0,u.resolve(H,U))},function(O){R||(R=!0,u.reject(H,O))})}},p.race=function(C){var k=this;if(Object.prototype.toString.call(C)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=C.length,R=!1;if(!T)return this.resolve([]);for(var U=-1,G=new this(d);++U<T;)j=C[U],k.resolve(j).then(function(H){R||(R=!0,u.resolve(G,H))},function(H){R||(R=!0,u.reject(G,H))});var j;return G}},{immediate:36}],38:[function(x,S,A){var h={};(0,x("./lib/utils/common").assign)(h,x("./lib/deflate"),x("./lib/inflate"),x("./lib/zlib/constants")),S.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(x,S,A){var h=x("./zlib/deflate"),d=x("./utils/common"),u=x("./utils/strings"),l=x("./zlib/messages"),c=x("./zlib/zstream"),f=Object.prototype.toString,p=0,m=-1,v=0,_=8;function b(C){if(!(this instanceof b))return new b(C);this.options=d.assign({level:m,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:v,to:""},C||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var T=h.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(T!==p)throw new Error(l[T]);if(k.header&&h.deflateSetHeader(this.strm,k.header),k.dictionary){var R;if(R=typeof k.dictionary=="string"?u.string2buf(k.dictionary):f.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(T=h.deflateSetDictionary(this.strm,R))!==p)throw new Error(l[T]);this._dict_set=!0}}function w(C,k){var T=new b(k);if(T.push(C,!0),T.err)throw T.msg||l[T.err];return T.result}b.prototype.push=function(C,k){var T,R,U=this.strm,G=this.options.chunkSize;if(this.ended)return!1;R=k===~~k?k:k===!0?4:0,typeof C=="string"?U.input=u.string2buf(C):f.call(C)==="[object ArrayBuffer]"?U.input=new Uint8Array(C):U.input=C,U.next_in=0,U.avail_in=U.input.length;do{if(U.avail_out===0&&(U.output=new d.Buf8(G),U.next_out=0,U.avail_out=G),(T=h.deflate(U,R))!==1&&T!==p)return this.onEnd(T),!(this.ended=!0);U.avail_out!==0&&(U.avail_in!==0||R!==4&&R!==2)||(this.options.to==="string"?this.onData(u.buf2binstring(d.shrinkBuf(U.output,U.next_out))):this.onData(d.shrinkBuf(U.output,U.next_out)))}while((0<U.avail_in||U.avail_out===0)&&T!==1);return R===4?(T=h.deflateEnd(this.strm),this.onEnd(T),this.ended=!0,T===p):R!==2||(this.onEnd(p),!(U.avail_out=0))},b.prototype.onData=function(C){this.chunks.push(C)},b.prototype.onEnd=function(C){C===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=C,this.msg=this.strm.msg},A.Deflate=b,A.deflate=w,A.deflateRaw=function(C,k){return(k=k||{}).raw=!0,w(C,k)},A.gzip=function(C,k){return(k=k||{}).gzip=!0,w(C,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(x,S,A){var h=x("./zlib/inflate"),d=x("./utils/common"),u=x("./utils/strings"),l=x("./zlib/constants"),c=x("./zlib/messages"),f=x("./zlib/zstream"),p=x("./zlib/gzheader"),m=Object.prototype.toString;function v(b){if(!(this instanceof v))return new v(b);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},b||{});var w=this.options;w.raw&&0<=w.windowBits&&w.windowBits<16&&(w.windowBits=-w.windowBits,w.windowBits===0&&(w.windowBits=-15)),!(0<=w.windowBits&&w.windowBits<16)||b&&b.windowBits||(w.windowBits+=32),15<w.windowBits&&w.windowBits<48&&!(15&w.windowBits)&&(w.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var C=h.inflateInit2(this.strm,w.windowBits);if(C!==l.Z_OK)throw new Error(c[C]);this.header=new p,h.inflateGetHeader(this.strm,this.header)}function _(b,w){var C=new v(w);if(C.push(b,!0),C.err)throw C.msg||c[C.err];return C.result}v.prototype.push=function(b,w){var C,k,T,R,U,G,j=this.strm,H=this.options.chunkSize,W=this.options.dictionary,K=!1;if(this.ended)return!1;k=w===~~w?w:w===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof b=="string"?j.input=u.binstring2buf(b):m.call(b)==="[object ArrayBuffer]"?j.input=new Uint8Array(b):j.input=b,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new d.Buf8(H),j.next_out=0,j.avail_out=H),(C=h.inflate(j,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&W&&(G=typeof W=="string"?u.string2buf(W):m.call(W)==="[object ArrayBuffer]"?new Uint8Array(W):W,C=h.inflateSetDictionary(this.strm,G)),C===l.Z_BUF_ERROR&&K===!0&&(C=l.Z_OK,K=!1),C!==l.Z_STREAM_END&&C!==l.Z_OK)return this.onEnd(C),!(this.ended=!0);j.next_out&&(j.avail_out!==0&&C!==l.Z_STREAM_END&&(j.avail_in!==0||k!==l.Z_FINISH&&k!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(T=u.utf8border(j.output,j.next_out),R=j.next_out-T,U=u.buf2string(j.output,T),j.next_out=R,j.avail_out=H-R,R&&d.arraySet(j.output,j.output,T,R,0),this.onData(U)):this.onData(d.shrinkBuf(j.output,j.next_out)))),j.avail_in===0&&j.avail_out===0&&(K=!0)}while((0<j.avail_in||j.avail_out===0)&&C!==l.Z_STREAM_END);return C===l.Z_STREAM_END&&(k=l.Z_FINISH),k===l.Z_FINISH?(C=h.inflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===l.Z_OK):k!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(j.avail_out=0))},v.prototype.onData=function(b){this.chunks.push(b)},v.prototype.onEnd=function(b){b===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},A.Inflate=v,A.inflate=_,A.inflateRaw=function(b,w){return(w=w||{}).raw=!0,_(b,w)},A.ungzip=_},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(x,S,A){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";A.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var f=c.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var p in f)f.hasOwnProperty(p)&&(l[p]=f[p])}}return l},A.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var d={arraySet:function(l,c,f,p,m){if(c.subarray&&l.subarray)l.set(c.subarray(f,f+p),m);else for(var v=0;v<p;v++)l[m+v]=c[f+v]},flattenChunks:function(l){var c,f,p,m,v,_;for(c=p=0,f=l.length;c<f;c++)p+=l[c].length;for(_=new Uint8Array(p),c=m=0,f=l.length;c<f;c++)v=l[c],_.set(v,m),m+=v.length;return _}},u={arraySet:function(l,c,f,p,m){for(var v=0;v<p;v++)l[m+v]=c[f+v]},flattenChunks:function(l){return[].concat.apply([],l)}};A.setTyped=function(l){l?(A.Buf8=Uint8Array,A.Buf16=Uint16Array,A.Buf32=Int32Array,A.assign(A,d)):(A.Buf8=Array,A.Buf16=Array,A.Buf32=Array,A.assign(A,u))},A.setTyped(h)},{}],42:[function(x,S,A){var h=x("./common"),d=!0,u=!0;try{String.fromCharCode.apply(null,[0])}catch{d=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{u=!1}for(var l=new h.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function f(p,m){if(m<65537&&(p.subarray&&u||!p.subarray&&d))return String.fromCharCode.apply(null,h.shrinkBuf(p,m));for(var v="",_=0;_<m;_++)v+=String.fromCharCode(p[_]);return v}l[254]=l[254]=1,A.string2buf=function(p){var m,v,_,b,w,C=p.length,k=0;for(b=0;b<C;b++)(64512&(v=p.charCodeAt(b)))==55296&&b+1<C&&(64512&(_=p.charCodeAt(b+1)))==56320&&(v=65536+(v-55296<<10)+(_-56320),b++),k+=v<128?1:v<2048?2:v<65536?3:4;for(m=new h.Buf8(k),b=w=0;w<k;b++)(64512&(v=p.charCodeAt(b)))==55296&&b+1<C&&(64512&(_=p.charCodeAt(b+1)))==56320&&(v=65536+(v-55296<<10)+(_-56320),b++),v<128?m[w++]=v:(v<2048?m[w++]=192|v>>>6:(v<65536?m[w++]=224|v>>>12:(m[w++]=240|v>>>18,m[w++]=128|v>>>12&63),m[w++]=128|v>>>6&63),m[w++]=128|63&v);return m},A.buf2binstring=function(p){return f(p,p.length)},A.binstring2buf=function(p){for(var m=new h.Buf8(p.length),v=0,_=m.length;v<_;v++)m[v]=p.charCodeAt(v);return m},A.buf2string=function(p,m){var v,_,b,w,C=m||p.length,k=new Array(2*C);for(v=_=0;v<C;)if((b=p[v++])<128)k[_++]=b;else if(4<(w=l[b]))k[_++]=65533,v+=w-1;else{for(b&=w===2?31:w===3?15:7;1<w&&v<C;)b=b<<6|63&p[v++],w--;1<w?k[_++]=65533:b<65536?k[_++]=b:(b-=65536,k[_++]=55296|b>>10&1023,k[_++]=56320|1023&b)}return f(k,_)},A.utf8border=function(p,m){var v;for((m=m||p.length)>p.length&&(m=p.length),v=m-1;0<=v&&(192&p[v])==128;)v--;return v<0||v===0?m:v+l[p[v]]>m?v:m}},{"./common":41}],43:[function(x,S,A){S.exports=function(h,d,u,l){for(var c=65535&h|0,f=h>>>16&65535|0,p=0;u!==0;){for(u-=p=2e3<u?2e3:u;f=f+(c=c+d[l++]|0)|0,--p;);c%=65521,f%=65521}return c|f<<16|0}},{}],44:[function(x,S,A){S.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(x,S,A){var h=function(){for(var d,u=[],l=0;l<256;l++){d=l;for(var c=0;c<8;c++)d=1&d?3988292384^d>>>1:d>>>1;u[l]=d}return u}();S.exports=function(d,u,l,c){var f=h,p=c+l;d^=-1;for(var m=c;m<p;m++)d=d>>>8^f[255&(d^u[m])];return-1^d}},{}],46:[function(x,S,A){var h,d=x("../utils/common"),u=x("./trees"),l=x("./adler32"),c=x("./crc32"),f=x("./messages"),p=0,m=4,v=0,_=-2,b=-1,w=4,C=2,k=8,T=9,R=286,U=30,G=19,j=2*R+1,H=15,W=3,K=258,$=K+W+1,O=42,L=113,M=1,I=2,F=3,V=4;function D(B,ke){return B.msg=f[ke],ke}function X(B){return(B<<1)-(4<B?9:0)}function ee(B){for(var ke=B.length;0<=--ke;)B[ke]=0}function q(B){var ke=B.state,Ee=ke.pending;Ee>B.avail_out&&(Ee=B.avail_out),Ee!==0&&(d.arraySet(B.output,ke.pending_buf,ke.pending_out,Ee,B.next_out),B.next_out+=Ee,ke.pending_out+=Ee,B.total_out+=Ee,B.avail_out-=Ee,ke.pending-=Ee,ke.pending===0&&(ke.pending_out=0))}function ne(B,ke){u._tr_flush_block(B,0<=B.block_start?B.block_start:-1,B.strstart-B.block_start,ke),B.block_start=B.strstart,q(B.strm)}function oe(B,ke){B.pending_buf[B.pending++]=ke}function he(B,ke){B.pending_buf[B.pending++]=ke>>>8&255,B.pending_buf[B.pending++]=255&ke}function te(B,ke){var Ee,ge,Ae=B.max_chain_length,fe=B.strstart,ue=B.prev_length,_e=B.nice_match,be=B.strstart>B.w_size-$?B.strstart-(B.w_size-$):0,De=B.window,Je=B.w_mask,Qe=B.prev,ot=B.strstart+K,ct=De[fe+ue-1],ht=De[fe+ue];B.prev_length>=B.good_match&&(Ae>>=2),_e>B.lookahead&&(_e=B.lookahead);do if(De[(Ee=ke)+ue]===ht&&De[Ee+ue-1]===ct&&De[Ee]===De[fe]&&De[++Ee]===De[fe+1]){fe+=2,Ee++;do;while(De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&De[++fe]===De[++Ee]&&fe<ot);if(ge=K-(ot-fe),fe=ot-K,ue<ge){if(B.match_start=ke,_e<=(ue=ge))break;ct=De[fe+ue-1],ht=De[fe+ue]}}while((ke=Qe[ke&Je])>be&&--Ae!=0);return ue<=B.lookahead?ue:B.lookahead}function de(B){var ke,Ee,ge,Ae,fe,ue,_e,be,De,Je,Qe=B.w_size;do{if(Ae=B.window_size-B.lookahead-B.strstart,B.strstart>=Qe+(Qe-$)){for(d.arraySet(B.window,B.window,Qe,Qe,0),B.match_start-=Qe,B.strstart-=Qe,B.block_start-=Qe,ke=Ee=B.hash_size;ge=B.head[--ke],B.head[ke]=Qe<=ge?ge-Qe:0,--Ee;);for(ke=Ee=Qe;ge=B.prev[--ke],B.prev[ke]=Qe<=ge?ge-Qe:0,--Ee;);Ae+=Qe}if(B.strm.avail_in===0)break;if(ue=B.strm,_e=B.window,be=B.strstart+B.lookahead,De=Ae,Je=void 0,Je=ue.avail_in,De<Je&&(Je=De),Ee=Je===0?0:(ue.avail_in-=Je,d.arraySet(_e,ue.input,ue.next_in,Je,be),ue.state.wrap===1?ue.adler=l(ue.adler,_e,Je,be):ue.state.wrap===2&&(ue.adler=c(ue.adler,_e,Je,be)),ue.next_in+=Je,ue.total_in+=Je,Je),B.lookahead+=Ee,B.lookahead+B.insert>=W)for(fe=B.strstart-B.insert,B.ins_h=B.window[fe],B.ins_h=(B.ins_h<<B.hash_shift^B.window[fe+1])&B.hash_mask;B.insert&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[fe+W-1])&B.hash_mask,B.prev[fe&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=fe,fe++,B.insert--,!(B.lookahead+B.insert<W)););}while(B.lookahead<$&&B.strm.avail_in!==0)}function se(B,ke){for(var Ee,ge;;){if(B.lookahead<$){if(de(B),B.lookahead<$&&ke===p)return M;if(B.lookahead===0)break}if(Ee=0,B.lookahead>=W&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),Ee!==0&&B.strstart-Ee<=B.w_size-$&&(B.match_length=te(B,Ee)),B.match_length>=W)if(ge=u._tr_tally(B,B.strstart-B.match_start,B.match_length-W),B.lookahead-=B.match_length,B.match_length<=B.max_lazy_match&&B.lookahead>=W){for(B.match_length--;B.strstart++,B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart,--B.match_length!=0;);B.strstart++}else B.strstart+=B.match_length,B.match_length=0,B.ins_h=B.window[B.strstart],B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+1])&B.hash_mask;else ge=u._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++;if(ge&&(ne(B,!1),B.strm.avail_out===0))return M}return B.insert=B.strstart<W-1?B.strstart:W-1,ke===m?(ne(B,!0),B.strm.avail_out===0?F:V):B.last_lit&&(ne(B,!1),B.strm.avail_out===0)?M:I}function re(B,ke){for(var Ee,ge,Ae;;){if(B.lookahead<$){if(de(B),B.lookahead<$&&ke===p)return M;if(B.lookahead===0)break}if(Ee=0,B.lookahead>=W&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),B.prev_length=B.match_length,B.prev_match=B.match_start,B.match_length=W-1,Ee!==0&&B.prev_length<B.max_lazy_match&&B.strstart-Ee<=B.w_size-$&&(B.match_length=te(B,Ee),B.match_length<=5&&(B.strategy===1||B.match_length===W&&4096<B.strstart-B.match_start)&&(B.match_length=W-1)),B.prev_length>=W&&B.match_length<=B.prev_length){for(Ae=B.strstart+B.lookahead-W,ge=u._tr_tally(B,B.strstart-1-B.prev_match,B.prev_length-W),B.lookahead-=B.prev_length-1,B.prev_length-=2;++B.strstart<=Ae&&(B.ins_h=(B.ins_h<<B.hash_shift^B.window[B.strstart+W-1])&B.hash_mask,Ee=B.prev[B.strstart&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=B.strstart),--B.prev_length!=0;);if(B.match_available=0,B.match_length=W-1,B.strstart++,ge&&(ne(B,!1),B.strm.avail_out===0))return M}else if(B.match_available){if((ge=u._tr_tally(B,0,B.window[B.strstart-1]))&&ne(B,!1),B.strstart++,B.lookahead--,B.strm.avail_out===0)return M}else B.match_available=1,B.strstart++,B.lookahead--}return B.match_available&&(ge=u._tr_tally(B,0,B.window[B.strstart-1]),B.match_available=0),B.insert=B.strstart<W-1?B.strstart:W-1,ke===m?(ne(B,!0),B.strm.avail_out===0?F:V):B.last_lit&&(ne(B,!1),B.strm.avail_out===0)?M:I}function ae(B,ke,Ee,ge,Ae){this.good_length=B,this.max_lazy=ke,this.nice_length=Ee,this.max_chain=ge,this.func=Ae}function Ce(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new d.Buf16(2*j),this.dyn_dtree=new d.Buf16(2*(2*U+1)),this.bl_tree=new d.Buf16(2*(2*G+1)),ee(this.dyn_ltree),ee(this.dyn_dtree),ee(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new d.Buf16(H+1),this.heap=new d.Buf16(2*R+1),ee(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*R+1),ee(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function me(B){var ke;return B&&B.state?(B.total_in=B.total_out=0,B.data_type=C,(ke=B.state).pending=0,ke.pending_out=0,ke.wrap<0&&(ke.wrap=-ke.wrap),ke.status=ke.wrap?O:L,B.adler=ke.wrap===2?0:1,ke.last_flush=p,u._tr_init(ke),v):D(B,_)}function ce(B){var ke=me(B);return ke===v&&function(Ee){Ee.window_size=2*Ee.w_size,ee(Ee.head),Ee.max_lazy_match=h[Ee.level].max_lazy,Ee.good_match=h[Ee.level].good_length,Ee.nice_match=h[Ee.level].nice_length,Ee.max_chain_length=h[Ee.level].max_chain,Ee.strstart=0,Ee.block_start=0,Ee.lookahead=0,Ee.insert=0,Ee.match_length=Ee.prev_length=W-1,Ee.match_available=0,Ee.ins_h=0}(B.state),ke}function pe(B,ke,Ee,ge,Ae,fe){if(!B)return _;var ue=1;if(ke===b&&(ke=6),ge<0?(ue=0,ge=-ge):15<ge&&(ue=2,ge-=16),Ae<1||T<Ae||Ee!==k||ge<8||15<ge||ke<0||9<ke||fe<0||w<fe)return D(B,_);ge===8&&(ge=9);var _e=new Ce;return(B.state=_e).strm=B,_e.wrap=ue,_e.gzhead=null,_e.w_bits=ge,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=Ae+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+W-1)/W),_e.window=new d.Buf8(2*_e.w_size),_e.head=new d.Buf16(_e.hash_size),_e.prev=new d.Buf16(_e.w_size),_e.lit_bufsize=1<<Ae+6,_e.pending_buf_size=4*_e.lit_bufsize,_e.pending_buf=new d.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ke,_e.strategy=fe,_e.method=Ee,ce(B)}h=[new ae(0,0,0,0,function(B,ke){var Ee=65535;for(Ee>B.pending_buf_size-5&&(Ee=B.pending_buf_size-5);;){if(B.lookahead<=1){if(de(B),B.lookahead===0&&ke===p)return M;if(B.lookahead===0)break}B.strstart+=B.lookahead,B.lookahead=0;var ge=B.block_start+Ee;if((B.strstart===0||B.strstart>=ge)&&(B.lookahead=B.strstart-ge,B.strstart=ge,ne(B,!1),B.strm.avail_out===0)||B.strstart-B.block_start>=B.w_size-$&&(ne(B,!1),B.strm.avail_out===0))return M}return B.insert=0,ke===m?(ne(B,!0),B.strm.avail_out===0?F:V):(B.strstart>B.block_start&&(ne(B,!1),B.strm.avail_out),M)}),new ae(4,4,8,4,se),new ae(4,5,16,8,se),new ae(4,6,32,32,se),new ae(4,4,16,16,re),new ae(8,16,32,32,re),new ae(8,16,128,128,re),new ae(8,32,128,256,re),new ae(32,128,258,1024,re),new ae(32,258,258,4096,re)],A.deflateInit=function(B,ke){return pe(B,ke,k,15,8,0)},A.deflateInit2=pe,A.deflateReset=ce,A.deflateResetKeep=me,A.deflateSetHeader=function(B,ke){return B&&B.state?B.state.wrap!==2?_:(B.state.gzhead=ke,v):_},A.deflate=function(B,ke){var Ee,ge,Ae,fe;if(!B||!B.state||5<ke||ke<0)return B?D(B,_):_;if(ge=B.state,!B.output||!B.input&&B.avail_in!==0||ge.status===666&&ke!==m)return D(B,B.avail_out===0?-5:_);if(ge.strm=B,Ee=ge.last_flush,ge.last_flush=ke,ge.status===O)if(ge.wrap===2)B.adler=0,oe(ge,31),oe(ge,139),oe(ge,8),ge.gzhead?(oe(ge,(ge.gzhead.text?1:0)+(ge.gzhead.hcrc?2:0)+(ge.gzhead.extra?4:0)+(ge.gzhead.name?8:0)+(ge.gzhead.comment?16:0)),oe(ge,255&ge.gzhead.time),oe(ge,ge.gzhead.time>>8&255),oe(ge,ge.gzhead.time>>16&255),oe(ge,ge.gzhead.time>>24&255),oe(ge,ge.level===9?2:2<=ge.strategy||ge.level<2?4:0),oe(ge,255&ge.gzhead.os),ge.gzhead.extra&&ge.gzhead.extra.length&&(oe(ge,255&ge.gzhead.extra.length),oe(ge,ge.gzhead.extra.length>>8&255)),ge.gzhead.hcrc&&(B.adler=c(B.adler,ge.pending_buf,ge.pending,0)),ge.gzindex=0,ge.status=69):(oe(ge,0),oe(ge,0),oe(ge,0),oe(ge,0),oe(ge,0),oe(ge,ge.level===9?2:2<=ge.strategy||ge.level<2?4:0),oe(ge,3),ge.status=L);else{var ue=k+(ge.w_bits-8<<4)<<8;ue|=(2<=ge.strategy||ge.level<2?0:ge.level<6?1:ge.level===6?2:3)<<6,ge.strstart!==0&&(ue|=32),ue+=31-ue%31,ge.status=L,he(ge,ue),ge.strstart!==0&&(he(ge,B.adler>>>16),he(ge,65535&B.adler)),B.adler=1}if(ge.status===69)if(ge.gzhead.extra){for(Ae=ge.pending;ge.gzindex<(65535&ge.gzhead.extra.length)&&(ge.pending!==ge.pending_buf_size||(ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),q(B),Ae=ge.pending,ge.pending!==ge.pending_buf_size));)oe(ge,255&ge.gzhead.extra[ge.gzindex]),ge.gzindex++;ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),ge.gzindex===ge.gzhead.extra.length&&(ge.gzindex=0,ge.status=73)}else ge.status=73;if(ge.status===73)if(ge.gzhead.name){Ae=ge.pending;do{if(ge.pending===ge.pending_buf_size&&(ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),q(B),Ae=ge.pending,ge.pending===ge.pending_buf_size)){fe=1;break}fe=ge.gzindex<ge.gzhead.name.length?255&ge.gzhead.name.charCodeAt(ge.gzindex++):0,oe(ge,fe)}while(fe!==0);ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),fe===0&&(ge.gzindex=0,ge.status=91)}else ge.status=91;if(ge.status===91)if(ge.gzhead.comment){Ae=ge.pending;do{if(ge.pending===ge.pending_buf_size&&(ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),q(B),Ae=ge.pending,ge.pending===ge.pending_buf_size)){fe=1;break}fe=ge.gzindex<ge.gzhead.comment.length?255&ge.gzhead.comment.charCodeAt(ge.gzindex++):0,oe(ge,fe)}while(fe!==0);ge.gzhead.hcrc&&ge.pending>Ae&&(B.adler=c(B.adler,ge.pending_buf,ge.pending-Ae,Ae)),fe===0&&(ge.status=103)}else ge.status=103;if(ge.status===103&&(ge.gzhead.hcrc?(ge.pending+2>ge.pending_buf_size&&q(B),ge.pending+2<=ge.pending_buf_size&&(oe(ge,255&B.adler),oe(ge,B.adler>>8&255),B.adler=0,ge.status=L)):ge.status=L),ge.pending!==0){if(q(B),B.avail_out===0)return ge.last_flush=-1,v}else if(B.avail_in===0&&X(ke)<=X(Ee)&&ke!==m)return D(B,-5);if(ge.status===666&&B.avail_in!==0)return D(B,-5);if(B.avail_in!==0||ge.lookahead!==0||ke!==p&&ge.status!==666){var _e=ge.strategy===2?function(be,De){for(var Je;;){if(be.lookahead===0&&(de(be),be.lookahead===0)){if(De===p)return M;break}if(be.match_length=0,Je=u._tr_tally(be,0,be.window[be.strstart]),be.lookahead--,be.strstart++,Je&&(ne(be,!1),be.strm.avail_out===0))return M}return be.insert=0,De===m?(ne(be,!0),be.strm.avail_out===0?F:V):be.last_lit&&(ne(be,!1),be.strm.avail_out===0)?M:I}(ge,ke):ge.strategy===3?function(be,De){for(var Je,Qe,ot,ct,ht=be.window;;){if(be.lookahead<=K){if(de(be),be.lookahead<=K&&De===p)return M;if(be.lookahead===0)break}if(be.match_length=0,be.lookahead>=W&&0<be.strstart&&(Qe=ht[ot=be.strstart-1])===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]){ct=be.strstart+K;do;while(Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&Qe===ht[++ot]&&ot<ct);be.match_length=K-(ct-ot),be.match_length>be.lookahead&&(be.match_length=be.lookahead)}if(be.match_length>=W?(Je=u._tr_tally(be,1,be.match_length-W),be.lookahead-=be.match_length,be.strstart+=be.match_length,be.match_length=0):(Je=u._tr_tally(be,0,be.window[be.strstart]),be.lookahead--,be.strstart++),Je&&(ne(be,!1),be.strm.avail_out===0))return M}return be.insert=0,De===m?(ne(be,!0),be.strm.avail_out===0?F:V):be.last_lit&&(ne(be,!1),be.strm.avail_out===0)?M:I}(ge,ke):h[ge.level].func(ge,ke);if(_e!==F&&_e!==V||(ge.status=666),_e===M||_e===F)return B.avail_out===0&&(ge.last_flush=-1),v;if(_e===I&&(ke===1?u._tr_align(ge):ke!==5&&(u._tr_stored_block(ge,0,0,!1),ke===3&&(ee(ge.head),ge.lookahead===0&&(ge.strstart=0,ge.block_start=0,ge.insert=0))),q(B),B.avail_out===0))return ge.last_flush=-1,v}return ke!==m?v:ge.wrap<=0?1:(ge.wrap===2?(oe(ge,255&B.adler),oe(ge,B.adler>>8&255),oe(ge,B.adler>>16&255),oe(ge,B.adler>>24&255),oe(ge,255&B.total_in),oe(ge,B.total_in>>8&255),oe(ge,B.total_in>>16&255),oe(ge,B.total_in>>24&255)):(he(ge,B.adler>>>16),he(ge,65535&B.adler)),q(B),0<ge.wrap&&(ge.wrap=-ge.wrap),ge.pending!==0?v:1)},A.deflateEnd=function(B){var ke;return B&&B.state?(ke=B.state.status)!==O&&ke!==69&&ke!==73&&ke!==91&&ke!==103&&ke!==L&&ke!==666?D(B,_):(B.state=null,ke===L?D(B,-3):v):_},A.deflateSetDictionary=function(B,ke){var Ee,ge,Ae,fe,ue,_e,be,De,Je=ke.length;if(!B||!B.state||(fe=(Ee=B.state).wrap)===2||fe===1&&Ee.status!==O||Ee.lookahead)return _;for(fe===1&&(B.adler=l(B.adler,ke,Je,0)),Ee.wrap=0,Je>=Ee.w_size&&(fe===0&&(ee(Ee.head),Ee.strstart=0,Ee.block_start=0,Ee.insert=0),De=new d.Buf8(Ee.w_size),d.arraySet(De,ke,Je-Ee.w_size,Ee.w_size,0),ke=De,Je=Ee.w_size),ue=B.avail_in,_e=B.next_in,be=B.input,B.avail_in=Je,B.next_in=0,B.input=ke,de(Ee);Ee.lookahead>=W;){for(ge=Ee.strstart,Ae=Ee.lookahead-(W-1);Ee.ins_h=(Ee.ins_h<<Ee.hash_shift^Ee.window[ge+W-1])&Ee.hash_mask,Ee.prev[ge&Ee.w_mask]=Ee.head[Ee.ins_h],Ee.head[Ee.ins_h]=ge,ge++,--Ae;);Ee.strstart=ge,Ee.lookahead=W-1,de(Ee)}return Ee.strstart+=Ee.lookahead,Ee.block_start=Ee.strstart,Ee.insert=Ee.lookahead,Ee.lookahead=0,Ee.match_length=Ee.prev_length=W-1,Ee.match_available=0,B.next_in=_e,B.input=be,B.avail_in=ue,Ee.wrap=fe,v},A.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(x,S,A){S.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(x,S,A){S.exports=function(h,d){var u,l,c,f,p,m,v,_,b,w,C,k,T,R,U,G,j,H,W,K,$,O,L,M,I;u=h.state,l=h.next_in,M=h.input,c=l+(h.avail_in-5),f=h.next_out,I=h.output,p=f-(d-h.avail_out),m=f+(h.avail_out-257),v=u.dmax,_=u.wsize,b=u.whave,w=u.wnext,C=u.window,k=u.hold,T=u.bits,R=u.lencode,U=u.distcode,G=(1<<u.lenbits)-1,j=(1<<u.distbits)-1;e:do{T<15&&(k+=M[l++]<<T,T+=8,k+=M[l++]<<T,T+=8),H=R[k&G];t:for(;;){if(k>>>=W=H>>>24,T-=W,(W=H>>>16&255)===0)I[f++]=65535&H;else{if(!(16&W)){if(!(64&W)){H=R[(65535&H)+(k&(1<<W)-1)];continue t}if(32&W){u.mode=12;break e}h.msg="invalid literal/length code",u.mode=30;break e}K=65535&H,(W&=15)&&(T<W&&(k+=M[l++]<<T,T+=8),K+=k&(1<<W)-1,k>>>=W,T-=W),T<15&&(k+=M[l++]<<T,T+=8,k+=M[l++]<<T,T+=8),H=U[k&j];r:for(;;){if(k>>>=W=H>>>24,T-=W,!(16&(W=H>>>16&255))){if(!(64&W)){H=U[(65535&H)+(k&(1<<W)-1)];continue r}h.msg="invalid distance code",u.mode=30;break e}if($=65535&H,T<(W&=15)&&(k+=M[l++]<<T,(T+=8)<W&&(k+=M[l++]<<T,T+=8)),v<($+=k&(1<<W)-1)){h.msg="invalid distance too far back",u.mode=30;break e}if(k>>>=W,T-=W,(W=f-p)<$){if(b<(W=$-W)&&u.sane){h.msg="invalid distance too far back",u.mode=30;break e}if(L=C,(O=0)===w){if(O+=_-W,W<K){for(K-=W;I[f++]=C[O++],--W;);O=f-$,L=I}}else if(w<W){if(O+=_+w-W,(W-=w)<K){for(K-=W;I[f++]=C[O++],--W;);if(O=0,w<K){for(K-=W=w;I[f++]=C[O++],--W;);O=f-$,L=I}}}else if(O+=w-W,W<K){for(K-=W;I[f++]=C[O++],--W;);O=f-$,L=I}for(;2<K;)I[f++]=L[O++],I[f++]=L[O++],I[f++]=L[O++],K-=3;K&&(I[f++]=L[O++],1<K&&(I[f++]=L[O++]))}else{for(O=f-$;I[f++]=I[O++],I[f++]=I[O++],I[f++]=I[O++],2<(K-=3););K&&(I[f++]=I[O++],1<K&&(I[f++]=I[O++]))}break}}break}}while(l<c&&f<m);l-=K=T>>3,k&=(1<<(T-=K<<3))-1,h.next_in=l,h.next_out=f,h.avail_in=l<c?c-l+5:5-(l-c),h.avail_out=f<m?m-f+257:257-(f-m),u.hold=k,u.bits=T}},{}],49:[function(x,S,A){var h=x("../utils/common"),d=x("./adler32"),u=x("./crc32"),l=x("./inffast"),c=x("./inftrees"),f=1,p=2,m=0,v=-2,_=1,b=852,w=592;function C(O){return(O>>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function T(O){var L;return O&&O.state?(L=O.state,O.total_in=O.total_out=L.total=0,O.msg="",L.wrap&&(O.adler=1&L.wrap),L.mode=_,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new h.Buf32(b),L.distcode=L.distdyn=new h.Buf32(w),L.sane=1,L.back=-1,m):v}function R(O){var L;return O&&O.state?((L=O.state).wsize=0,L.whave=0,L.wnext=0,T(O)):v}function U(O,L){var M,I;return O&&O.state?(I=O.state,L<0?(M=0,L=-L):(M=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?v:(I.window!==null&&I.wbits!==L&&(I.window=null),I.wrap=M,I.wbits=L,R(O))):v}function G(O,L){var M,I;return O?(I=new k,(O.state=I).window=null,(M=U(O,L))!==m&&(O.state=null),M):v}var j,H,W=!0;function K(O){if(W){var L;for(j=new h.Buf32(512),H=new h.Buf32(32),L=0;L<144;)O.lens[L++]=8;for(;L<256;)O.lens[L++]=9;for(;L<280;)O.lens[L++]=7;for(;L<288;)O.lens[L++]=8;for(c(f,O.lens,0,288,j,0,O.work,{bits:9}),L=0;L<32;)O.lens[L++]=5;c(p,O.lens,0,32,H,0,O.work,{bits:5}),W=!1}O.lencode=j,O.lenbits=9,O.distcode=H,O.distbits=5}function $(O,L,M,I){var F,V=O.state;return V.window===null&&(V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new h.Buf8(V.wsize)),I>=V.wsize?(h.arraySet(V.window,L,M-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize):(I<(F=V.wsize-V.wnext)&&(F=I),h.arraySet(V.window,L,M-I,F,V.wnext),(I-=F)?(h.arraySet(V.window,L,M-I,I,0),V.wnext=I,V.whave=V.wsize):(V.wnext+=F,V.wnext===V.wsize&&(V.wnext=0),V.whave<V.wsize&&(V.whave+=F))),0}A.inflateReset=R,A.inflateReset2=U,A.inflateResetKeep=T,A.inflateInit=function(O){return G(O,15)},A.inflateInit2=G,A.inflate=function(O,L){var M,I,F,V,D,X,ee,q,ne,oe,he,te,de,se,re,ae,Ce,me,ce,pe,B,ke,Ee,ge,Ae=0,fe=new h.Buf8(4),ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!O||!O.state||!O.output||!O.input&&O.avail_in!==0)return v;(M=O.state).mode===12&&(M.mode=13),D=O.next_out,F=O.output,ee=O.avail_out,V=O.next_in,I=O.input,X=O.avail_in,q=M.hold,ne=M.bits,oe=X,he=ee,ke=m;e:for(;;)switch(M.mode){case _:if(M.wrap===0){M.mode=13;break}for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(2&M.wrap&&q===35615){fe[M.check=0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0),ne=q=0,M.mode=2;break}if(M.flags=0,M.head&&(M.head.done=!1),!(1&M.wrap)||(((255&q)<<8)+(q>>8))%31){O.msg="incorrect header check",M.mode=30;break}if((15&q)!=8){O.msg="unknown compression method",M.mode=30;break}if(ne-=4,B=8+(15&(q>>>=4)),M.wbits===0)M.wbits=B;else if(B>M.wbits){O.msg="invalid window size",M.mode=30;break}M.dmax=1<<B,O.adler=M.check=1,M.mode=512&q?10:12,ne=q=0;break;case 2:for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(M.flags=q,(255&M.flags)!=8){O.msg="unknown compression method",M.mode=30;break}if(57344&M.flags){O.msg="unknown header flags set",M.mode=30;break}M.head&&(M.head.text=q>>8&1),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0)),ne=q=0,M.mode=3;case 3:for(;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.head&&(M.head.time=q),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,fe[2]=q>>>16&255,fe[3]=q>>>24&255,M.check=u(M.check,fe,4,0)),ne=q=0,M.mode=4;case 4:for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.head&&(M.head.xflags=255&q,M.head.os=q>>8),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0)),ne=q=0,M.mode=5;case 5:if(1024&M.flags){for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.length=q,M.head&&(M.head.extra_len=q),512&M.flags&&(fe[0]=255&q,fe[1]=q>>>8&255,M.check=u(M.check,fe,2,0)),ne=q=0}else M.head&&(M.head.extra=null);M.mode=6;case 6:if(1024&M.flags&&(X<(te=M.length)&&(te=X),te&&(M.head&&(B=M.head.extra_len-M.length,M.head.extra||(M.head.extra=new Array(M.head.extra_len)),h.arraySet(M.head.extra,I,V,te,B)),512&M.flags&&(M.check=u(M.check,I,te,V)),X-=te,V+=te,M.length-=te),M.length))break e;M.length=0,M.mode=7;case 7:if(2048&M.flags){if(X===0)break e;for(te=0;B=I[V+te++],M.head&&B&&M.length<65536&&(M.head.name+=String.fromCharCode(B)),B&&te<X;);if(512&M.flags&&(M.check=u(M.check,I,te,V)),X-=te,V+=te,B)break e}else M.head&&(M.head.name=null);M.length=0,M.mode=8;case 8:if(4096&M.flags){if(X===0)break e;for(te=0;B=I[V+te++],M.head&&B&&M.length<65536&&(M.head.comment+=String.fromCharCode(B)),B&&te<X;);if(512&M.flags&&(M.check=u(M.check,I,te,V)),X-=te,V+=te,B)break e}else M.head&&(M.head.comment=null);M.mode=9;case 9:if(512&M.flags){for(;ne<16;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(q!==(65535&M.check)){O.msg="header crc mismatch",M.mode=30;break}ne=q=0}M.head&&(M.head.hcrc=M.flags>>9&1,M.head.done=!0),O.adler=M.check=0,M.mode=12;break;case 10:for(;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}O.adler=M.check=C(q),ne=q=0,M.mode=11;case 11:if(M.havedict===0)return O.next_out=D,O.avail_out=ee,O.next_in=V,O.avail_in=X,M.hold=q,M.bits=ne,2;O.adler=M.check=1,M.mode=12;case 12:if(L===5||L===6)break e;case 13:if(M.last){q>>>=7&ne,ne-=7&ne,M.mode=27;break}for(;ne<3;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}switch(M.last=1&q,ne-=1,3&(q>>>=1)){case 0:M.mode=14;break;case 1:if(K(M),M.mode=20,L!==6)break;q>>>=2,ne-=2;break e;case 2:M.mode=17;break;case 3:O.msg="invalid block type",M.mode=30}q>>>=2,ne-=2;break;case 14:for(q>>>=7&ne,ne-=7&ne;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if((65535&q)!=(q>>>16^65535)){O.msg="invalid stored block lengths",M.mode=30;break}if(M.length=65535&q,ne=q=0,M.mode=15,L===6)break e;case 15:M.mode=16;case 16:if(te=M.length){if(X<te&&(te=X),ee<te&&(te=ee),te===0)break e;h.arraySet(F,I,V,te,D),X-=te,V+=te,ee-=te,D+=te,M.length-=te;break}M.mode=12;break;case 17:for(;ne<14;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(M.nlen=257+(31&q),q>>>=5,ne-=5,M.ndist=1+(31&q),q>>>=5,ne-=5,M.ncode=4+(15&q),q>>>=4,ne-=4,286<M.nlen||30<M.ndist){O.msg="too many length or distance symbols",M.mode=30;break}M.have=0,M.mode=18;case 18:for(;M.have<M.ncode;){for(;ne<3;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.lens[ue[M.have++]]=7&q,q>>>=3,ne-=3}for(;M.have<19;)M.lens[ue[M.have++]]=0;if(M.lencode=M.lendyn,M.lenbits=7,Ee={bits:M.lenbits},ke=c(0,M.lens,0,19,M.lencode,0,M.work,Ee),M.lenbits=Ee.bits,ke){O.msg="invalid code lengths set",M.mode=30;break}M.have=0,M.mode=19;case 19:for(;M.have<M.nlen+M.ndist;){for(;ae=(Ae=M.lencode[q&(1<<M.lenbits)-1])>>>16&255,Ce=65535&Ae,!((re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(Ce<16)q>>>=re,ne-=re,M.lens[M.have++]=Ce;else{if(Ce===16){for(ge=re+2;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(q>>>=re,ne-=re,M.have===0){O.msg="invalid bit length repeat",M.mode=30;break}B=M.lens[M.have-1],te=3+(3&q),q>>>=2,ne-=2}else if(Ce===17){for(ge=re+3;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}ne-=re,B=0,te=3+(7&(q>>>=re)),q>>>=3,ne-=3}else{for(ge=re+7;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}ne-=re,B=0,te=11+(127&(q>>>=re)),q>>>=7,ne-=7}if(M.have+te>M.nlen+M.ndist){O.msg="invalid bit length repeat",M.mode=30;break}for(;te--;)M.lens[M.have++]=B}}if(M.mode===30)break;if(M.lens[256]===0){O.msg="invalid code -- missing end-of-block",M.mode=30;break}if(M.lenbits=9,Ee={bits:M.lenbits},ke=c(f,M.lens,0,M.nlen,M.lencode,0,M.work,Ee),M.lenbits=Ee.bits,ke){O.msg="invalid literal/lengths set",M.mode=30;break}if(M.distbits=6,M.distcode=M.distdyn,Ee={bits:M.distbits},ke=c(p,M.lens,M.nlen,M.ndist,M.distcode,0,M.work,Ee),M.distbits=Ee.bits,ke){O.msg="invalid distances set",M.mode=30;break}if(M.mode=20,L===6)break e;case 20:M.mode=21;case 21:if(6<=X&&258<=ee){O.next_out=D,O.avail_out=ee,O.next_in=V,O.avail_in=X,M.hold=q,M.bits=ne,l(O,he),D=O.next_out,F=O.output,ee=O.avail_out,V=O.next_in,I=O.input,X=O.avail_in,q=M.hold,ne=M.bits,M.mode===12&&(M.back=-1);break}for(M.back=0;ae=(Ae=M.lencode[q&(1<<M.lenbits)-1])>>>16&255,Ce=65535&Ae,!((re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(ae&&!(240&ae)){for(me=re,ce=ae,pe=Ce;ae=(Ae=M.lencode[pe+((q&(1<<me+ce)-1)>>me)])>>>16&255,Ce=65535&Ae,!(me+(re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}q>>>=me,ne-=me,M.back+=me}if(q>>>=re,ne-=re,M.back+=re,M.length=Ce,ae===0){M.mode=26;break}if(32&ae){M.back=-1,M.mode=12;break}if(64&ae){O.msg="invalid literal/length code",M.mode=30;break}M.extra=15&ae,M.mode=22;case 22:if(M.extra){for(ge=M.extra;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.length+=q&(1<<M.extra)-1,q>>>=M.extra,ne-=M.extra,M.back+=M.extra}M.was=M.length,M.mode=23;case 23:for(;ae=(Ae=M.distcode[q&(1<<M.distbits)-1])>>>16&255,Ce=65535&Ae,!((re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(!(240&ae)){for(me=re,ce=ae,pe=Ce;ae=(Ae=M.distcode[pe+((q&(1<<me+ce)-1)>>me)])>>>16&255,Ce=65535&Ae,!(me+(re=Ae>>>24)<=ne);){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}q>>>=me,ne-=me,M.back+=me}if(q>>>=re,ne-=re,M.back+=re,64&ae){O.msg="invalid distance code",M.mode=30;break}M.offset=Ce,M.extra=15&ae,M.mode=24;case 24:if(M.extra){for(ge=M.extra;ne<ge;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}M.offset+=q&(1<<M.extra)-1,q>>>=M.extra,ne-=M.extra,M.back+=M.extra}if(M.offset>M.dmax){O.msg="invalid distance too far back",M.mode=30;break}M.mode=25;case 25:if(ee===0)break e;if(te=he-ee,M.offset>te){if((te=M.offset-te)>M.whave&&M.sane){O.msg="invalid distance too far back",M.mode=30;break}de=te>M.wnext?(te-=M.wnext,M.wsize-te):M.wnext-te,te>M.length&&(te=M.length),se=M.window}else se=F,de=D-M.offset,te=M.length;for(ee<te&&(te=ee),ee-=te,M.length-=te;F[D++]=se[de++],--te;);M.length===0&&(M.mode=21);break;case 26:if(ee===0)break e;F[D++]=M.length,ee--,M.mode=21;break;case 27:if(M.wrap){for(;ne<32;){if(X===0)break e;X--,q|=I[V++]<<ne,ne+=8}if(he-=ee,O.total_out+=he,M.total+=he,he&&(O.adler=M.check=M.flags?u(M.check,F,he,D-he):d(M.check,F,he,D-he)),he=ee,(M.flags?q:C(q))!==M.check){O.msg="incorrect data check",M.mode=30;break}ne=q=0}M.mode=28;case 28:if(M.wrap&&M.flags){for(;ne<32;){if(X===0)break e;X--,q+=I[V++]<<ne,ne+=8}if(q!==(4294967295&M.total)){O.msg="incorrect length check",M.mode=30;break}ne=q=0}M.mode=29;case 29:ke=1;break e;case 30:ke=-3;break e;case 31:return-4;case 32:default:return v}return O.next_out=D,O.avail_out=ee,O.next_in=V,O.avail_in=X,M.hold=q,M.bits=ne,(M.wsize||he!==O.avail_out&&M.mode<30&&(M.mode<27||L!==4))&&$(O,O.output,O.next_out,he-O.avail_out)?(M.mode=31,-4):(oe-=O.avail_in,he-=O.avail_out,O.total_in+=oe,O.total_out+=he,M.total+=he,M.wrap&&he&&(O.adler=M.check=M.flags?u(M.check,F,he,O.next_out-he):d(M.check,F,he,O.next_out-he)),O.data_type=M.bits+(M.last?64:0)+(M.mode===12?128:0)+(M.mode===20||M.mode===15?256:0),(oe==0&&he===0||L===4)&&ke===m&&(ke=-5),ke)},A.inflateEnd=function(O){if(!O||!O.state)return v;var L=O.state;return L.window&&(L.window=null),O.state=null,m},A.inflateGetHeader=function(O,L){var M;return O&&O.state&&2&(M=O.state).wrap?((M.head=L).done=!1,m):v},A.inflateSetDictionary=function(O,L){var M,I=L.length;return O&&O.state?(M=O.state).wrap!==0&&M.mode!==11?v:M.mode===11&&d(1,L,I,0)!==M.check?-3:$(O,L,I,I)?(M.mode=31,-4):(M.havedict=1,m):v},A.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(x,S,A){var h=x("../utils/common"),d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];S.exports=function(f,p,m,v,_,b,w,C){var k,T,R,U,G,j,H,W,K,$=C.bits,O=0,L=0,M=0,I=0,F=0,V=0,D=0,X=0,ee=0,q=0,ne=null,oe=0,he=new h.Buf16(16),te=new h.Buf16(16),de=null,se=0;for(O=0;O<=15;O++)he[O]=0;for(L=0;L<v;L++)he[p[m+L]]++;for(F=$,I=15;1<=I&&he[I]===0;I--);if(I<F&&(F=I),I===0)return _[b++]=20971520,_[b++]=20971520,C.bits=1,0;for(M=1;M<I&&he[M]===0;M++);for(F<M&&(F=M),O=X=1;O<=15;O++)if(X<<=1,(X-=he[O])<0)return-1;if(0<X&&(f===0||I!==1))return-1;for(te[1]=0,O=1;O<15;O++)te[O+1]=te[O]+he[O];for(L=0;L<v;L++)p[m+L]!==0&&(w[te[p[m+L]]++]=L);if(j=f===0?(ne=de=w,19):f===1?(ne=d,oe-=257,de=u,se-=257,256):(ne=l,de=c,-1),O=M,G=b,D=L=q=0,R=-1,U=(ee=1<<(V=F))-1,f===1&&852<ee||f===2&&592<ee)return 1;for(;;){for(H=O-D,K=w[L]<j?(W=0,w[L]):w[L]>j?(W=de[se+w[L]],ne[oe+w[L]]):(W=96,0),k=1<<O-D,M=T=1<<V;_[G+(q>>D)+(T-=k)]=H<<24|W<<16|K|0,T!==0;);for(k=1<<O-1;q&k;)k>>=1;if(k!==0?(q&=k-1,q+=k):q=0,L++,--he[O]==0){if(O===I)break;O=p[m+w[L]]}if(F<O&&(q&U)!==R){for(D===0&&(D=F),G+=M,X=1<<(V=O-D);V+D<I&&!((X-=he[V+D])<=0);)V++,X<<=1;if(ee+=1<<V,f===1&&852<ee||f===2&&592<ee)return 1;_[R=q&U]=F<<24|V<<16|G-b|0}}return q!==0&&(_[G+q]=O-D<<24|64<<16|0),C.bits=F,0}},{"../utils/common":41}],51:[function(x,S,A){S.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(x,S,A){var h=x("../utils/common"),d=0,u=1;function l(Ae){for(var fe=Ae.length;0<=--fe;)Ae[fe]=0}var c=0,f=29,p=256,m=p+1+f,v=30,_=19,b=2*m+1,w=15,C=16,k=7,T=256,R=16,U=17,G=18,j=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],H=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],W=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$=new Array(2*(m+2));l($);var O=new Array(2*v);l(O);var L=new Array(512);l(L);var M=new Array(256);l(M);var I=new Array(f);l(I);var F,V,D,X=new Array(v);function ee(Ae,fe,ue,_e,be){this.static_tree=Ae,this.extra_bits=fe,this.extra_base=ue,this.elems=_e,this.max_length=be,this.has_stree=Ae&&Ae.length}function q(Ae,fe){this.dyn_tree=Ae,this.max_code=0,this.stat_desc=fe}function ne(Ae){return Ae<256?L[Ae]:L[256+(Ae>>>7)]}function oe(Ae,fe){Ae.pending_buf[Ae.pending++]=255&fe,Ae.pending_buf[Ae.pending++]=fe>>>8&255}function he(Ae,fe,ue){Ae.bi_valid>C-ue?(Ae.bi_buf|=fe<<Ae.bi_valid&65535,oe(Ae,Ae.bi_buf),Ae.bi_buf=fe>>C-Ae.bi_valid,Ae.bi_valid+=ue-C):(Ae.bi_buf|=fe<<Ae.bi_valid&65535,Ae.bi_valid+=ue)}function te(Ae,fe,ue){he(Ae,ue[2*fe],ue[2*fe+1])}function de(Ae,fe){for(var ue=0;ue|=1&Ae,Ae>>>=1,ue<<=1,0<--fe;);return ue>>>1}function se(Ae,fe,ue){var _e,be,De=new Array(w+1),Je=0;for(_e=1;_e<=w;_e++)De[_e]=Je=Je+ue[_e-1]<<1;for(be=0;be<=fe;be++){var Qe=Ae[2*be+1];Qe!==0&&(Ae[2*be]=de(De[Qe]++,Qe))}}function re(Ae){var fe;for(fe=0;fe<m;fe++)Ae.dyn_ltree[2*fe]=0;for(fe=0;fe<v;fe++)Ae.dyn_dtree[2*fe]=0;for(fe=0;fe<_;fe++)Ae.bl_tree[2*fe]=0;Ae.dyn_ltree[2*T]=1,Ae.opt_len=Ae.static_len=0,Ae.last_lit=Ae.matches=0}function ae(Ae){8<Ae.bi_valid?oe(Ae,Ae.bi_buf):0<Ae.bi_valid&&(Ae.pending_buf[Ae.pending++]=Ae.bi_buf),Ae.bi_buf=0,Ae.bi_valid=0}function Ce(Ae,fe,ue,_e){var be=2*fe,De=2*ue;return Ae[be]<Ae[De]||Ae[be]===Ae[De]&&_e[fe]<=_e[ue]}function me(Ae,fe,ue){for(var _e=Ae.heap[ue],be=ue<<1;be<=Ae.heap_len&&(be<Ae.heap_len&&Ce(fe,Ae.heap[be+1],Ae.heap[be],Ae.depth)&&be++,!Ce(fe,_e,Ae.heap[be],Ae.depth));)Ae.heap[ue]=Ae.heap[be],ue=be,be<<=1;Ae.heap[ue]=_e}function ce(Ae,fe,ue){var _e,be,De,Je,Qe=0;if(Ae.last_lit!==0)for(;_e=Ae.pending_buf[Ae.d_buf+2*Qe]<<8|Ae.pending_buf[Ae.d_buf+2*Qe+1],be=Ae.pending_buf[Ae.l_buf+Qe],Qe++,_e===0?te(Ae,be,fe):(te(Ae,(De=M[be])+p+1,fe),(Je=j[De])!==0&&he(Ae,be-=I[De],Je),te(Ae,De=ne(--_e),ue),(Je=H[De])!==0&&he(Ae,_e-=X[De],Je)),Qe<Ae.last_lit;);te(Ae,T,fe)}function pe(Ae,fe){var ue,_e,be,De=fe.dyn_tree,Je=fe.stat_desc.static_tree,Qe=fe.stat_desc.has_stree,ot=fe.stat_desc.elems,ct=-1;for(Ae.heap_len=0,Ae.heap_max=b,ue=0;ue<ot;ue++)De[2*ue]!==0?(Ae.heap[++Ae.heap_len]=ct=ue,Ae.depth[ue]=0):De[2*ue+1]=0;for(;Ae.heap_len<2;)De[2*(be=Ae.heap[++Ae.heap_len]=ct<2?++ct:0)]=1,Ae.depth[be]=0,Ae.opt_len--,Qe&&(Ae.static_len-=Je[2*be+1]);for(fe.max_code=ct,ue=Ae.heap_len>>1;1<=ue;ue--)me(Ae,De,ue);for(be=ot;ue=Ae.heap[1],Ae.heap[1]=Ae.heap[Ae.heap_len--],me(Ae,De,1),_e=Ae.heap[1],Ae.heap[--Ae.heap_max]=ue,Ae.heap[--Ae.heap_max]=_e,De[2*be]=De[2*ue]+De[2*_e],Ae.depth[be]=(Ae.depth[ue]>=Ae.depth[_e]?Ae.depth[ue]:Ae.depth[_e])+1,De[2*ue+1]=De[2*_e+1]=be,Ae.heap[1]=be++,me(Ae,De,1),2<=Ae.heap_len;);Ae.heap[--Ae.heap_max]=Ae.heap[1],function(ht,it){var Ze,Xe,dt,at,ze,Ke,ut=it.dyn_tree,yt=it.max_code,Ne=it.stat_desc.static_tree,tt=it.stat_desc.has_stree,Pt=it.stat_desc.extra_bits,Rt=it.stat_desc.extra_base,Ht=it.stat_desc.max_length,zt=0;for(at=0;at<=w;at++)ht.bl_count[at]=0;for(ut[2*ht.heap[ht.heap_max]+1]=0,Ze=ht.heap_max+1;Ze<b;Ze++)Ht<(at=ut[2*ut[2*(Xe=ht.heap[Ze])+1]+1]+1)&&(at=Ht,zt++),ut[2*Xe+1]=at,yt<Xe||(ht.bl_count[at]++,ze=0,Rt<=Xe&&(ze=Pt[Xe-Rt]),Ke=ut[2*Xe],ht.opt_len+=Ke*(at+ze),tt&&(ht.static_len+=Ke*(Ne[2*Xe+1]+ze)));if(zt!==0){do{for(at=Ht-1;ht.bl_count[at]===0;)at--;ht.bl_count[at]--,ht.bl_count[at+1]+=2,ht.bl_count[Ht]--,zt-=2}while(0<zt);for(at=Ht;at!==0;at--)for(Xe=ht.bl_count[at];Xe!==0;)yt<(dt=ht.heap[--Ze])||(ut[2*dt+1]!==at&&(ht.opt_len+=(at-ut[2*dt+1])*ut[2*dt],ut[2*dt+1]=at),Xe--)}}(Ae,fe),se(De,ct,Ae.bl_count)}function B(Ae,fe,ue){var _e,be,De=-1,Je=fe[1],Qe=0,ot=7,ct=4;for(Je===0&&(ot=138,ct=3),fe[2*(ue+1)+1]=65535,_e=0;_e<=ue;_e++)be=Je,Je=fe[2*(_e+1)+1],++Qe<ot&&be===Je||(Qe<ct?Ae.bl_tree[2*be]+=Qe:be!==0?(be!==De&&Ae.bl_tree[2*be]++,Ae.bl_tree[2*R]++):Qe<=10?Ae.bl_tree[2*U]++:Ae.bl_tree[2*G]++,De=be,ct=(Qe=0)===Je?(ot=138,3):be===Je?(ot=6,3):(ot=7,4))}function ke(Ae,fe,ue){var _e,be,De=-1,Je=fe[1],Qe=0,ot=7,ct=4;for(Je===0&&(ot=138,ct=3),_e=0;_e<=ue;_e++)if(be=Je,Je=fe[2*(_e+1)+1],!(++Qe<ot&&be===Je)){if(Qe<ct)for(;te(Ae,be,Ae.bl_tree),--Qe!=0;);else be!==0?(be!==De&&(te(Ae,be,Ae.bl_tree),Qe--),te(Ae,R,Ae.bl_tree),he(Ae,Qe-3,2)):Qe<=10?(te(Ae,U,Ae.bl_tree),he(Ae,Qe-3,3)):(te(Ae,G,Ae.bl_tree),he(Ae,Qe-11,7));De=be,ct=(Qe=0)===Je?(ot=138,3):be===Je?(ot=6,3):(ot=7,4)}}l(X);var Ee=!1;function ge(Ae,fe,ue,_e){he(Ae,(c<<1)+(_e?1:0),3),function(be,De,Je,Qe){ae(be),oe(be,Je),oe(be,~Je),h.arraySet(be.pending_buf,be.window,De,Je,be.pending),be.pending+=Je}(Ae,fe,ue)}A._tr_init=function(Ae){Ee||(function(){var fe,ue,_e,be,De,Je=new Array(w+1);for(be=_e=0;be<f-1;be++)for(I[be]=_e,fe=0;fe<1<<j[be];fe++)M[_e++]=be;for(M[_e-1]=be,be=De=0;be<16;be++)for(X[be]=De,fe=0;fe<1<<H[be];fe++)L[De++]=be;for(De>>=7;be<v;be++)for(X[be]=De<<7,fe=0;fe<1<<H[be]-7;fe++)L[256+De++]=be;for(ue=0;ue<=w;ue++)Je[ue]=0;for(fe=0;fe<=143;)$[2*fe+1]=8,fe++,Je[8]++;for(;fe<=255;)$[2*fe+1]=9,fe++,Je[9]++;for(;fe<=279;)$[2*fe+1]=7,fe++,Je[7]++;for(;fe<=287;)$[2*fe+1]=8,fe++,Je[8]++;for(se($,m+1,Je),fe=0;fe<v;fe++)O[2*fe+1]=5,O[2*fe]=de(fe,5);F=new ee($,j,p+1,m,w),V=new ee(O,H,0,v,w),D=new ee(new Array(0),W,0,_,k)}(),Ee=!0),Ae.l_desc=new q(Ae.dyn_ltree,F),Ae.d_desc=new q(Ae.dyn_dtree,V),Ae.bl_desc=new q(Ae.bl_tree,D),Ae.bi_buf=0,Ae.bi_valid=0,re(Ae)},A._tr_stored_block=ge,A._tr_flush_block=function(Ae,fe,ue,_e){var be,De,Je=0;0<Ae.level?(Ae.strm.data_type===2&&(Ae.strm.data_type=function(Qe){var ot,ct=4093624447;for(ot=0;ot<=31;ot++,ct>>>=1)if(1&ct&&Qe.dyn_ltree[2*ot]!==0)return d;if(Qe.dyn_ltree[18]!==0||Qe.dyn_ltree[20]!==0||Qe.dyn_ltree[26]!==0)return u;for(ot=32;ot<p;ot++)if(Qe.dyn_ltree[2*ot]!==0)return u;return d}(Ae)),pe(Ae,Ae.l_desc),pe(Ae,Ae.d_desc),Je=function(Qe){var ot;for(B(Qe,Qe.dyn_ltree,Qe.l_desc.max_code),B(Qe,Qe.dyn_dtree,Qe.d_desc.max_code),pe(Qe,Qe.bl_desc),ot=_-1;3<=ot&&Qe.bl_tree[2*K[ot]+1]===0;ot--);return Qe.opt_len+=3*(ot+1)+5+5+4,ot}(Ae),be=Ae.opt_len+3+7>>>3,(De=Ae.static_len+3+7>>>3)<=be&&(be=De)):be=De=ue+5,ue+4<=be&&fe!==-1?ge(Ae,fe,ue,_e):Ae.strategy===4||De===be?(he(Ae,2+(_e?1:0),3),ce(Ae,$,O)):(he(Ae,4+(_e?1:0),3),function(Qe,ot,ct,ht){var it;for(he(Qe,ot-257,5),he(Qe,ct-1,5),he(Qe,ht-4,4),it=0;it<ht;it++)he(Qe,Qe.bl_tree[2*K[it]+1],3);ke(Qe,Qe.dyn_ltree,ot-1),ke(Qe,Qe.dyn_dtree,ct-1)}(Ae,Ae.l_desc.max_code+1,Ae.d_desc.max_code+1,Je+1),ce(Ae,Ae.dyn_ltree,Ae.dyn_dtree)),re(Ae),_e&&ae(Ae)},A._tr_tally=function(Ae,fe,ue){return Ae.pending_buf[Ae.d_buf+2*Ae.last_lit]=fe>>>8&255,Ae.pending_buf[Ae.d_buf+2*Ae.last_lit+1]=255&fe,Ae.pending_buf[Ae.l_buf+Ae.last_lit]=255&ue,Ae.last_lit++,fe===0?Ae.dyn_ltree[2*ue]++:(Ae.matches++,fe--,Ae.dyn_ltree[2*(M[ue]+p+1)]++,Ae.dyn_dtree[2*ne(fe)]++),Ae.last_lit===Ae.lit_bufsize-1},A._tr_align=function(Ae){he(Ae,2,3),te(Ae,T,$),function(fe){fe.bi_valid===16?(oe(fe,fe.bi_buf),fe.bi_buf=0,fe.bi_valid=0):8<=fe.bi_valid&&(fe.pending_buf[fe.pending++]=255&fe.bi_buf,fe.bi_buf>>=8,fe.bi_valid-=8)}(Ae)}},{"../utils/common":41}],53:[function(x,S,A){S.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(x,S,A){(function(h){(function(d,u){if(!d.setImmediate){var l,c,f,p,m=1,v={},_=!1,b=d.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(d);w=w&&w.setTimeout?w:d,l={}.toString.call(d.process)==="[object process]"?function(R){process.nextTick(function(){k(R)})}:function(){if(d.postMessage&&!d.importScripts){var R=!0,U=d.onmessage;return d.onmessage=function(){R=!1},d.postMessage("","*"),d.onmessage=U,R}}()?(p="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",T,!1):d.attachEvent("onmessage",T),function(R){d.postMessage(p+R,"*")}):d.MessageChannel?((f=new MessageChannel).port1.onmessage=function(R){k(R.data)},function(R){f.port2.postMessage(R)}):b&&"onreadystatechange"in b.createElement("script")?(c=b.documentElement,function(R){var U=b.createElement("script");U.onreadystatechange=function(){k(R),U.onreadystatechange=null,c.removeChild(U),U=null},c.appendChild(U)}):function(R){setTimeout(k,0,R)},w.setImmediate=function(R){typeof R!="function"&&(R=new Function(""+R));for(var U=new Array(arguments.length-1),G=0;G<U.length;G++)U[G]=arguments[G+1];var j={callback:R,args:U};return v[m]=j,l(m),m++},w.clearImmediate=C}function C(R){delete v[R]}function k(R){if(_)setTimeout(k,0,R);else{var U=v[R];if(U){_=!0;try{(function(G){var j=G.callback,H=G.args;switch(H.length){case 0:j();break;case 1:j(H[0]);break;case 2:j(H[0],H[1]);break;case 3:j(H[0],H[1],H[2]);break;default:j.apply(u,H)}})(U)}finally{C(R),_=!1}}}}function T(R){R.source===d&&typeof R.data=="string"&&R.data.indexOf(p)===0&&k(+R.data.slice(p.length))}})(typeof self>"u"?h===void 0?this:h:self)}).call(this,typeof a.g<"u"?a.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})},"./node_modules/strnum/strnum.js"(N){const Q=/^[-+]?0x[a-fA-F0-9]+$/,a=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,x={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function S(d,u={}){if(u=Object.assign({},x,u),!d||typeof d!="string")return d;let l=d.trim();if(u.skipLike!==void 0&&u.skipLike.test(l))return d;if(d==="0")return 0;if(u.hex&&Q.test(l))return h(l,16);if(l.search(/[eE]/)!==-1){const c=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(c){if(u.leadingZeros)l=(c[1]||"")+c[3];else if(!(c[2]==="0"&&c[3][0]==="."))return d;return u.eNotation?Number(l):d}else return d}else{const c=a.exec(l);if(c){const f=c[1],p=c[2];let m=A(c[3]);if(!u.leadingZeros&&p.length>0&&f&&l[2]!==".")return d;if(!u.leadingZeros&&p.length>0&&!f&&l[1]!==".")return d;if(u.leadingZeros&&p===d)return 0;{const v=Number(l),_=""+v;return _.search(/[eE]/)!==-1?u.eNotation?v:d:l.indexOf(".")!==-1?_==="0"&&m===""||_===m||f&&_==="-"+m?v:d:p?m===_||f+m===_?v:d:l===_||l===f+_?v:d}}else return d}}function A(d){return d&&d.indexOf(".")!==-1&&(d=d.replace(/0+$/,""),d==="."?d="0":d[0]==="."?d="0"+d:d[d.length-1]==="."&&(d=d.substr(0,d.length-1))),d}function h(d,u){if(parseInt)return parseInt(d,u);if(Number.parseInt)return Number.parseInt(d,u);if(window&&window.parseInt)return window.parseInt(d,u);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}N.exports=S},"./src/BIMXViewer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>$});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/messages.ts"),A=a("./src/EventTrigger.ts"),h=a("./src/Controller.ts"),d=a("./src/toolbar/ResetAction.ts"),u=a("./src/toolbar/FitAction.ts"),l=a("./src/toolbar/FirstPersonMode.ts"),c=a("./src/toolbar/HideTool.ts"),f=a("./src/toolbar/ShowSpacesMode.ts"),p=a("./src/toolbar/SectionTool.ts"),m=a("./src/toolbar/NavCubeMode.ts"),v=a("./src/explorer/ModelsExplorer.ts"),_=a("./src/explorer/ObjectsExplorer.ts"),b=a("./src/explorer/ClassesExplorer.ts"),w=a("./src/explorer/StoreysExplorer.ts"),C=a("./src/toolbar/ThreeDMode.ts"),k=a("./src/toolbar/OrthoMode.ts"),T=a("./src/toolbar/AnnotationTool.ts"),R=a("./src/toolbar/MarkerTool.ts"),U=a("./src/toolbar/MeasureTool.ts"),G=a("./src/toolbar/CommentsTool.ts"),j=a("./src/server/Server.ts"),H=a("./src/toolbar/SkyBoxTool.ts"),W=a("./src/toolbar/BCFTool.ts"),K=function(O,L,M,I){function F(V){return V instanceof M?V:new M(function(D){D(V)})}return new(M||(M=Promise))(function(V,D){function X(ne){try{q(I.next(ne))}catch(oe){D(oe)}}function ee(ne){try{q(I.throw(ne))}catch(oe){D(oe)}}function q(ne){ne.done?V(ne.value):F(ne.value).then(X,ee)}q((I=I.apply(O,L||[])).next())})};class $ extends h.default{constructor(L={}){if(!L.canvasElement)throw new Error("Config expected: canvasElement");if(!L.navCubeCanvasElement)throw new Error("Config expected: navCubeCanvasElement");const{canvasElement:M}=L,{viewerElement:I}=L,F=new x.LocaleService({messages:S.default,locale:"ch"}),V=new x.Viewer({passes:5,localeService:F,canvasElement:M,viewerElement:I,snapRadius:L.snapRadius,antialias:L.viewer_cfg.antialias,saoEnabled:L.viewer_cfg.saoEnabled,pbrEnabled:L.viewer_cfg.pbrEnabled,dtxEnabled:L.viewer_cfg.dtxEnabled,transparent:L.viewer_cfg.transparent,edgesEnabled:L.viewer_cfg.edgesEnabled,alphaDepthMask:L.viewer_cfg.alphaDepthMask,premultipliedAlpha:L.viewer_cfg.premultipliedAlpha,colorTextureEnabled:L.viewer_cfg.colorTextureEnabled,backgroundColorFromAmbientLight:L.viewer_cfg.backgroundColorFromAmbientLight,resolutionScale:window.devicePixelRatio,spinnerElementId:"engine_spinner"}),D=new j.default({dataDir:"./data",filePath:"testdemo"});super(null,L,D,V),this._modelNum=0,this._disableClickEvent=!1,this._focusPartial=!1,this._partialObjectIds=[],this._partialFocusIndex=0,this._metaLoaded=!1,this._worldAxisYDown=!1,this._worldAxisZUp=!1,this._edgesActive=!1,this.orbitYawCamera=ne=>new Promise((oe,he)=>{try{this.viewer.scene.camera.orbitYaw(ne),oe()}catch(te){he(te)}}),this.cameraEnable=(ne=!this.viewer.cameraControl.pointerEnabled)=>{this.viewer.cameraControl.pointerEnabled=ne},this.shot=(ne,oe,he)=>{const te=document.getElementById("myCanvas"),de=document.createElement("a");de.download="screenshot.png";const se=document.createElement("canvas"),re=se.getContext("2d");if(te&&re){se.width=ne,se.height=oe;const ae=ne/te.width,Ce=oe/te.height,me=Math.max(ae,Ce);return te.width*me,te.height*me,re.clearRect(0,0,ne,oe),re.fillStyle="transparent",re.fillRect(0,0,ne,oe),re.drawImage(te,0,0,te.width,te.height,0,0,1,1),he&&se.toBlob(ce=>{const pe=URL.createObjectURL(ce);de.href=pe,de.click(),URL.revokeObjectURL(pe)}),se.toDataURL("image/png")}return""},this._configs={},this._eventTrigger=new A.default,this.navCubeCanvasElement=L.navCubeCanvasElement,this.viewerElement=L.viewerElement,this._multiModel=L.multiModel?L.multiModel:!1,this._hasOutlier=!1,this._outlierObjectIds=[],this._projectId=L.projectId?L.projectId:"",this.viewer=V,(L.skyBoxImage||L.skyBoxSrc)&&(this._skyBoxTool=new H.default(this,{skyBoxImage:L.skyBoxImage,skyBoxSrc:L.skyBoxSrc})),this._modelsExplorer=new v.default(this,{enableEditModels:!1,modelFromOutSide:!0,modelSrc:L.modelSrc?L.modelSrc:"/",modelConfig:L.modelConfig,IfcAPI:L.IfcAPI,WebIFC:L.WebIFC,multiModel:this._multiModel}),this._objectsExplorer=new _.default(this,{modelType:L.modelType}),this._classesExplorer=new b.default(this,{modelType:L.modelType}),this._storeysExplorer=new w.default(this,{modelType:L.modelType}),this._resetAction=new d.default(this,{}),this._fitAction=new u.default(this,{});class X{constructor(oe){this.threeDActive=!1,this.firstPersonActive=!1,this.setThreeDModeActive=he=>{he?(oe._firstPersonMode.setActive(!1),oe.viewer.cameraControl.navMode="orbit"):(oe._firstPersonMode.setActive(!1),oe.viewer.cameraControl.navMode="planView"),this.threeDActive=he},this.setFirstPersonModeActive=he=>{oe.viewer.cameraControl.navMode=he?"firstPerson":this.threeDActive?"orbit":"planView",this.firstPersonActive=he}}}const ee=new X(this);this._threeDMode=new C.default(this,{cameraControlNavModeMediator:ee}),this._orthoMode=new k.default(this,{}),this._firstPersonMode=new l.default(this,{cameraControlNavModeMediator:ee}),this._hideTool=new c.default(this,{}),this._annotationTool=new T.default(this,{modelId:this._projectId}),this._markerTool=new R.default(this,{}),this._measureTool=new U.default(this,{}),this._sectionTool=new p.default(this,{}),this._commentsTool=new G.default(this,{}),this._showSpacesMode=new f.default(this,{}),this._navCubeMode=new m.default(this,{navCubeCanvasElement:this.navCubeCanvasElement,viewerElement:this.viewerElement}),this._bcfTool=new W.default(this,{}),this._threeDMode.setActive(!0),this._firstPersonMode.setActive(!1),this._navCubeMode.setActive(!0),this._annotationTool.setActive(!1),this._markerTool.setActive(!1),this._measureTool.setActive(!1),this._modelsExplorer.on("modelLoaded",ne=>{this.viewer.scene.fire("aabb",this.viewer.scene.aabb),this.fire("modelLoaded",ne)}),this._modelsExplorer.on("modelUnloaded",ne=>{this.eventTrigger.emit("modelUnloaded",ne),this.fire("modelUnloaded",ne)}),this._mutexActivation([this._hideTool,this._sectionTool,this._annotationTool,this._markerTool]),this._initSingleClickEvent(),this._initRightClickEvent(),this._initDoubleClickEvent();let q=0;this.eventTrigger.on("treeReady",()=>{q++,q%3==0&&this.eventTrigger.emit("treeAllReady",{objectsData:this.objectsExplorer.rootNode,classesData:this.classesExplorer.rootNode,storeysData:this.storeysExplorer.rootNode})})}get eventTrigger(){return this._eventTrigger}get multiModel(){return this._multiModel}get localeService(){return this.viewer.localeService}set disableClickEvent(L){this._disableClickEvent=L}get disableClickEvent(){return this._disableClickEvent}get edgesActive(){return this._edgesActive}_initSingleClickEvent(){this.viewer.cameraControl.on("mouseDownEntity",L=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M&&M.entity&&(this.singleChoseEntity(M.entity),this._eventTrigger.emit("pickedEntity",M.entity))}),this.viewer.cameraControl.on("mouseDownNothing",()=>{this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive()||(this.singleChosedSpace(),this._eventTrigger.emit("pickedNothing"))}),this.viewer.cameraControl.on("touchPicked",L=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M&&M.entity&&(this._eventTrigger.emit("touchEntity",M.entity),this.singleChoseEntity(M.entity))}),this.viewer.cameraControl.on("touchPickedNothing",()=>{this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive()||(this._eventTrigger.emit("pickedNothing"),this.singleChosedSpace())})}_initRightClickEvent(){this.viewer.cameraControl.on("rightClick",L=>{L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M?this._eventTrigger.emit("rightPicked",M.entity):this._eventTrigger.emit("rightPickedNothing")})}_initDoubleClickEvent(){this.viewer.cameraControl.on("doublePicked",L=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;L.preventDefault;const M=this.viewer.scene.pick({canvasPos:L.canvasPos});M&&M.entity&&(this.doubleChoseEntity(M.entity),this._eventTrigger.emit("doublePicked",M.entity))}),this.viewer.cameraControl.on("doublePickedNothing",()=>{this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive()||(this.choseSpace(),this._eventTrigger.emit("doublePickedNothing"))})}_customizeViewer(){const{scene:L}=this.viewer;L.pointsMaterial.pointSize=1,L.pointsMaterial.roundPoints=!0,L.pointsMaterial.perspectivePoints=!0,L.pointsMaterial.minPerspectivePointSize=2,L.pointsMaterial.maxPerspectivePointSize=4,this.viewer.cameraControl.panRightClick=!0,this.viewer.cameraControl.followPointer=!0,this.viewer.cameraControl.doublePickFlyTo=!1,this.viewer.cameraControl.smartPivot=!0,this.viewer.cameraControl.keyboardDollyRate=100,this.viewer.cameraControl.mouseWheelDollyRate=100,this.viewer.cameraControl.dollyInertia=0,this.viewer.cameraControl.dollyMinSpeed=.04,this.viewer.cameraControl.dollyProximityThreshold=30;const M=document.createRange().createContextualFragment("<div class='tctwins-camera-pivot-marker'></div>").firstChild;this.viewer.scene.canvas.canvas.parentNode.appendChild(M),this.viewer.cameraControl.pivotElement=M;const{sao:I}=L;I.enabled=!1,I.numSamples=50,I.kernelRadius=200}_initConfigs(){this.setConfigs({smartPivot:!0,saoEnabled:!0,pbrEnabled:!0,saoBias:"0.5",saoIntensity:"0.15",saoNumSamples:"40",saoKernelRadius:"100",edgesEnabled:!1,xrayContext:!0,xrayPickable:!0,backgroundTransparency:!0,backgroundColor:[1,1,1],objectColorSource:"model",externalMetadata:!1,dtxEnabled:!0,snapRadius:20})}setConfigs(L){for(const M in L)if(Object.prototype.hasOwnProperty.call(L,M)){const I=L[M];this.setConfig(M,I)}}setConfig(L,M){function I(F){return F===!0||F==="true"}try{switch(L){case"backgroundTransparency":const F=M;this.setBackgroundTransparent(F),this._configs[L]=F;break;case"backgroundColor":if(this._configs.backgroundTransparency)break;const V=M;this.setBackgroundColor(V),this._configs[L]=V;break;case"smartPivot":this.viewer.cameraControl.smartPivot=this._configs[L]=I(M);break;case"saoEnabled":this.viewer.scene.saoEnabled=this._configs[L]=I(M);break;case"saoBias":this.viewer.scene.sao.bias=parseFloat(M);break;case"saoIntensity":this.viewer.scene.sao.intensity=parseFloat(M);break;case"saoKernelRadius":this.viewer.scene.sao.kernelRadius=this._configs[L]=parseFloat(M);break;case"saoNumSamples":this.viewer.scene.sao.numSamples=this._configs[L]=parseFloat(M);break;case"saoBlur":this.viewer.scene.sao.blur=this._configs[L]=I(M);break;case"edgesEnabled":this.setEdgesEnabled(M);break;case"pbrEnabled":break;case"viewFitFOV":this.viewer.cameraFlight.fitFOV=this._configs[L]=parseFloat(M);break;case"viewFitDuration":this.viewer.cameraFlight.duration=this._configs[L]=parseFloat(M);break;case"perspectiveFOV":this.viewer.camera.perspective.fov=this._configs[L]=parseFloat(M);break;case"excludeUnclassifiedObjects":this._configs[L]=I(M);break;case"objectColorSource":this.setObjectColorSource(M),this._configs[L]=M;break;case"xrayContext":this._configs[L]=M;break;case"xrayPickable":this._configs[L]=I(M);break;case"externalMetadata":this._configs[L]=M;break;case"showSpaces":this._showSpacesMode.setActive(M);break;case"dtxEnabled":this._configs[L]=I(M),this.viewer.scene.dtxEnabled=M;break;case"snapRadius":this.setSnapRadius(M);break;default:this.error(`setConfig() - unsupported configuration: '${L}'`)}}catch(F){this.error(`setConfig() - failed to configure ${L}: ${F}`)}}getConfig(L){return this._configs[L]}getConfigs(){return this._configs}projectId(){return this._projectId}loadModel(L,M,I=()=>{},F=()=>{},V){this._modelNum+=1,!this._multiModel&&this._modelNum>1&&(this._multiModel=!0),this._multiModel||(this._projectId=L),this._modelsExplorer.loadModel(L,M,I,F,V)}unloadModel(L){if(!this.viewer.scene.models[L]){this.error("unloadModel() - Model not loaded: "+L);return}this._modelsExplorer.unloadModel(L);const M=Object.keys(this.viewer.scene.models);this._modelNum=M.length,M.length>1?(this._multiModel=!0,this._projectId=""):(this._multiModel=!1,this._projectId=M.length===1?M[0]:"")}_resolveModelId(L){if(L!=null&&L!=="")return L;if(this._projectId)return this._projectId;const M=Object.keys(this.viewer.scene.models);if(M.length===1)return M[0]}focusModel(L,M){const I=this._resolveModelId(L);return this.viewer.focusModel(I,M)}loadMetadata(L,M,I=!0,F=()=>{}){this._modelsExplorer.loadMetadata(L,M,I,()=>{this._metaLoaded=!0,this._focusPartial&&this.viewFitPartial(0,F)})}setObjectColorSource(L){switch(L){case"model":break;case"viewer":break;default:L="model",this.error("setObjectColorSource() - Unsupported value - accepted values are 'model' and 'viewer' - defaulting to 'model'");return}this._objectColorSource=L}getObjectProperties(L){const M=this.viewer.metaScene.metaObjects[L];if(!M)return null;const I={id:M.id,name:M.name,type:M.type,propertySets:[]},{propertySets:F}=M;if(F&&F.length>0)for(let V=0;V<F.length;V++){const{properties:D}=F[V],X=[];for(let q=0;q<D.length;q++){const ne={};ne[D[q].name]=D[q].value,X.push(ne)}const ee={id:F[V].id,name:F[V].name,properties:X,type:F[V].type};I.propertySets.push(ee)}return I}getModelInfo(L){const M=this.viewer.metaScene.metaModels[L];return{id:M.id,createDate:M.createdAt?M.createdAt:"",author:M.author?M.author:"",objectCount:M.objectCount?M.objectCount:"",propertySetCount:M.propertySetCount?M.propertySetCount:""}}getMetaModel(L){return this.viewer.metaScene.metaModels[L]}getSceneModel(L){return this.viewer.scene.models[L]}_withObjectsInSubtree(L,M=()=>{}){if(!L){this.error("Argument expected: objectIds");return}L.forEach(I=>{this.viewer.metaScene.withMetaObjectsInSubtree(I,F=>{const V=this.viewer.scene.objects[F.id];V&&M(V)})})}_withObjects(L,M=()=>{}){L.forEach(I=>{const F=this.viewer.scene.objects[I];M(F)})}flyToObject(L,M=()=>{}){if(!L){this.error("flyToObject() - Argument expected: objectId");return}const{viewer:I}=this,{scene:F}=I,V=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(L,X=>{F.objects[X.id]&&V.push(X.id)}),V.length===0){this.error(`Object not found in viewer: '${L}'`),M&&M();return}F.setObjectsVisible(V,!0);const D=F.getAABB(V);I.cameraFlight.flyTo({aabb:D},()=>{M&&M(),setTimeout(()=>{F.setObjectsHighlighted(F.highlightedObjectIds,!1)},500)}),I.cameraControl.pivotPos=x.math.getAABB3Center(D)}viewFitObjects(L,M=()=>{}){if(!L){this.error("viewFitObjects() - Argument expected: objectIds");return}const{viewer:I}=this,{scene:F}=I;F.setObjectsVisible(L,!0);const V=F.getAABB(L);I.cameraFlight.flyTo({aabb:V},()=>{M&&M()}),I.cameraControl.pivotPos=x.math.getAABB3Center(V)}jumpToObjects(L){if(!L){this.error("jumpToObject() - Argument expected: objectIds");return}const{viewer:M}=this,{scene:I}=M,F=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(L,D=>{I.objects[D.id]&&F.push(D.id)}),F.length===0){this.error(`Objects not found in viewer: '${L}'`);return}I.setObjectsVisible(F,!0);const V=I.getAABB(F);M.cameraFlight.jumpTo({aabb:V}),M.cameraControl.pivotPos=x.math.getAABB3Center(V)}setCamera(L){const{viewer:M}=this,{scene:I}=M,{camera:F}=I;L.eye&&(F.eye=L.eye),L.look&&(F.look=L.look),L.up&&(F.up=L.up)}getCameraView(){return{eye:this.viewer.scene.camera.eye,look:this.viewer.scene.camera.look,up:this.viewer.scene.camera.up}}flyToNewView(L){this.viewer.cameraControl.pivotPos=L.look,this.viewer.cameraFlight.flyTo({look:L.look,eye:L.eye,up:L.up,duration:L.duration})}flyToObjectFromDirection(L,M,I,F=()=>{}){const V=this.viewer.scene.objects[L];if(!V){this.error(`flyToObjectFromDirection() - Object not found in viewer: '${L}'`),F&&F();return}const D=this._resolveViewDirection(M);if(!D){this.error(`flyToObjectFromDirection() - Invalid direction: '${M}'`),F&&F();return}const X=x.math.getAABB3Center(V.aabb,[]),ee=[X[0]+D[0]*I,X[1]+D[1]*I,X[2]+D[2]*I],q=Math.abs(D[1])>.9?[0,0,1]:[0,1,0];this.viewer.cameraFlight.flyTo({eye:ee,look:X,up:q},()=>{F&&F()}),this.viewer.cameraControl.pivotPos=X}_resolveViewDirection(L){const M={front:[0,0,1],back:[0,0,-1],left:[-1,0,0],right:[1,0,0],top:[0,1,0],bottom:[0,-1,0]};let I;if(typeof L=="string"){if(I=M[L.toLowerCase()],!I)return null}else if(Array.isArray(L)&&L.length>=3)I=[L[0],L[1],L[2]];else return null;const F=Math.sqrt(I[0]*I[0]+I[1]*I[1]+I[2]*I[2]);return F===0?null:[I[0]/F,I[1]/F,I[2]/F]}viewFitModels(L,M=()=>{}){if(!L){this.error("viewFitModels() - Argument expected: modelIds");return}const{viewer:I}=this,{scene:F}=I,V=x.math.AABB3();x.math.collapseAABB3(V),L.forEach(D=>{const X=F.models[D];X?(X.visible=!0,X.highlighted=!0,x.math.expandAABB3(V,X.aabb)):this.error(`Model not found in viewer: '${D}'`)}),M?I.cameraFlight.flyTo({aabb:V},()=>{M(),setTimeout(()=>{F.setObjectsHighlighted(F.highlightedObjectIds,!1)},500)}):(I.cameraFlight.jumpTo({aabb:V}),setTimeout(()=>{F.setObjectsHighlighted(F.highlightedObjectIds,!1)},500)),I.cameraControl.pivotPos=x.math.getAABB3Center(V)}viewFitPartial(L,M){let I;typeof L=="function"?(M=L,I=this._partialFocusIndex+=1):I=L??(this._partialFocusIndex+=1),I>=0&&I<this._partialObjectIds.length?this.viewFitObjects(this._partialObjectIds[I],()=>{for(let F=0;F<this._partialObjectIds.length;F++)I==F?this.setObjectsVisible(this._partialObjectIds[F],!0):this.setObjectsVisible(this._partialObjectIds[F],!1);M&&M(I)}):(I=this._partialFocusIndex=0,this.viewFitObjects(this._partialObjectIds[I],()=>{for(let F=0;F<this._partialObjectIds.length;F++)I==F?this.setObjectsVisible(this._partialObjectIds[F],!0):this.setObjectsVisible(this._partialObjectIds[F],!1);M&&M(I)}))}setPartialObjectIds(L){const M=[];for(let I=0;I<L.length;I++)M.push(L[I]);this._partialObjectIds=M,this.viewer.cameraControl.smartPivot=!1,this.navCubeMode.fitVisible=!0,this._focusPartial=!0,this._metaLoaded&&this.viewFitPartial(0)}selectStorey(L,M=()=>{}){const{metaScene:I}=this.viewer,F=I.metaObjects[L];if(!F){this.error(`selectStorey() - Object is not found: '${L}'`);return}if(F.type!=="IfcBuildingStorey"){this.error(`selectStorey() - Object is not an IfcBuildingStorey: '${L}'`);return}this._storeysExplorer.selectStorey(L,M)}setKeyboardEnabled(L){this.viewer.scene.input.keyboardEnabled=L}getKeyboardEnabled(){return this.viewer.scene.input.keyboardEnabled}showSpinner(L=!this.viewer.scene.canvas.spinner.visible){this.viewer.scene.canvas.spinner.visible=L}updateAABB(L,M=()=>{}){L.length>0&&(this._hasOutlier=!0,this._outlierObjectIds=L);const I=this._resolveModelId(),F=I!==void 0?this.viewer.scene.models[I]:void 0;if(!F){this.error("updateAABB() - No model available for the current scene"),typeof M=="function"&&M();return}const V=L.concat(F.exceptionIds);F.exceptionIds=V,this.viewer.scene.setObjectsVisible(V,!1),this.viewer.scene.on("aabb",()=>{typeof M=="function"&&M()})}closeAll(){this.fire("closeAll",!0),this.disableClickEvent=!1}destroy(L=()=>{}){var M;this.measureDistanceTool.destroy(),this.measureAngleTool.destroy(),this._annotationTool.destroy(),this._markerTool.destroy(),this._commentsTool.destroy(),this._skyBoxTool&&this._skyBoxTool.destroy(),this._modelsExplorer.destroy(),this._classesExplorer.destroy(),this._objectsExplorer.destroy(),this._storeysExplorer.destroy(),this._eventTrigger.destroy();const I=document.querySelector(".tctwins-camera-pivot-marker");I&&((M=I.parentNode)===null||M===void 0||M.removeChild(I)),this.viewer.destroy(L)}getEntityById(L){return this.viewer.scene.objects[L]}setEntitySelected(L,M=!L.selected){L.selected=M}setObjectsSelected(L,M){this._withObjects(L,I=>{I.selected=M})}setOthersSelected(L){this.setAllObjectsSelected(!0),this.setEntitySelected(L,!0)}setAllObjectsSelected(L){L?this.viewer.scene.setObjectsSelected(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsSelected(this.viewer.scene.selectedObjectIds,!1)}viewFitEntity(L){this.viewer.cameraFlight.flyTo({aabb:L.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=x.math.getAABB3Center(L.aabb)}viewFitEntityById(L){this._withObjects([L],M=>{this.viewer.cameraFlight.flyTo({aabb:M.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=x.math.getAABB3Center(M.aabb)})}viewFitSelectedObjects(){this.viewFitObjects(this.viewer.scene.highlightedObjectIds,()=>{})}viewFitAll(L=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,L);return}this._fitAction.fit(L)}setEntityVisible(L,M=!L.visible){L.visible=M}setObjectsVisible(L,M){this._withObjects(L,I=>{I.visible=M})}setOthersHide(L){const M=this.viewer.metaScene.metaObjects[L.id];M&&(this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds,!1),M.withMetaObjectsInSubtree(I=>{const F=this.viewer.scene.objects[I.id];F&&(F.visible=!0)}))}setAllObjectsVisible(L){L?(this.viewer.scene.setObjectsVisible(this.viewer.scene.objectIds,!0),this._hasOutlier&&this.viewer.scene.setObjectsVisible(this._outlierObjectIds,!1)):this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds,!1)}setEntityXRayed(L,M=!L.xrayed){L.xrayed=M}setObjectsXRayed(L,M){this._withObjects(L,I=>{I.xrayed=M})}setOthersXRayed(L){const{scene:M}=this.viewer,I=this.viewer.metaScene.metaObjects[L.id];I&&(M.setObjectsVisible(M.objectIds,!0),M.setObjectsXRayed(M.objectIds,!0),I.withMetaObjectsInSubtree(F=>{const V=M.objects[F.id];V&&(V.xrayed=!1)}))}setAllObjectsXRayed(L){L?this.viewer.scene.setObjectsXRayed(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsXRayed(this.viewer.scene.xrayedObjectIds,!1)}setEntityHighlighted(L,M=!L.highlighted){L.highlighted=M,L.origin_opacity!=-1&&(L.highlighted?L.opacity=L.opacity<1?L.opacity:.01:L.opacity=L.origin_opacity)}setAllObjectsHighlighted(L){L?(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.objectIds,!0),this.viewer.scene.withObjects(this.viewer.scene.objectIds,M=>{M.origin_opacity,M.opacity=M.opacity<.5?M.opacity:.01})):(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.highlightedObjectIds,!1),this.viewer.scene.withObjects(this.viewer.scene.objectIds,M=>{M.opacity=M.origin_opacity}))}setEntityEdges(L,M=!L.edges){L.edges=M}setObjectsEdges(L,M){this.viewer.scene.withObjects(L,I=>{I.edges=M}),this.viewer.scene.render(!0)}setAllObjectsEdges(L=!this._edgesActive){this._edgesActive=L,this.viewer.scene.withObjects(this.viewer.scene.objectIds,M=>{M.edges=L}),this.viewer.scene.render(!0)}setEntityColor(L,M){this.viewer.scene.setObjectsColorized([L],M),this.viewer.scene.render(!0)}setObjectsColor(L,M){this.viewer.scene.setObjectsColorized(L,M),this.viewer.scene.render(!0)}resetEntityColor(L){this.viewer.scene.setObjectsColorized([L],null)}entityVisble(L){return L.visible}entityXRayed(L){return L.xrayed}entityChosed(L){return L.selected}hiddenMoreThanOne(){return this.viewer.scene.numObjects-this.viewer.scene.numVisibleObjects>0}xRayedMoreThanOne(){return this.viewer.scene.numXRayedObjects>0}SelectedMoreThanOne(){return this.viewer.scene.numSelectedObjects>0}setBackgroundTransparent(L=!this.viewer.scene.backgroundTransparent){this.viewer.scene.backgroundTransparent=L,this.viewer.scene.render(!0)}setBackgroundColor(L){this.viewer.scene.backgroundColor=L,this.viewer.scene.render(!0)}setNavCubeSize(L){this.navCubeCanvasElement.style.width=`${L.toString()}px`,this.navCubeCanvasElement.style.height=`${L.toString()}px`}setNavCubePosition(L,M){switch(L){case"top":this.navCubeCanvasElement.style.top=`${M.toString()}px`,this.navCubeCanvasElement.style.bottom="";break;case"bottom":this.navCubeCanvasElement.style.top="",this.navCubeCanvasElement.style.bottom=`${M.toString()}px`;break;case"right":this.navCubeCanvasElement.style.left="",this.navCubeCanvasElement.style.right=`${M.toString()}px`;break;case"left":this.navCubeCanvasElement.style.right="",this.navCubeCanvasElement.style.left=`${M.toString()}px`;break}}updateCanvas(){this.viewer.scene.canvas.dirtyBoundary=!0}setMeasureOffSet(L,M){this._measureTool.setMeasureOffSet(L,M)}setCommentsOffset(L,M){this._commentsTool.offsetX=L,this._commentsTool.offsetY=M}setSnapRadius(L){this.measureTool.setSnapRadius(L)}setIsTouch(L){this.measureTool.isTouch=L,this.sectionTool.isTouch=L,this.commentTool.isTouch=L}setLightIntensity(L){if(!(L<0||L>100))for(const M in this.viewer.scene.lightsObject)this.viewer.scene.lightsObject[M].intensity=.6+(L-50)/200}setSpaceMaterialColor(L){L===1?this.viewer.scene.highlightMaterial.fillColor=[.6,.7,.8]:L===2&&(this.viewer.scene.highlightMaterial.fillColor=[.2,.3,.4])}setWorldAxisYDown(L){this._worldAxisYDown=L,L?this.viewer.scene.camera.worldAxis=[1,0,0,0,-1,0,0,0,1]:this.viewer.scene.camera.worldAxis=[1,0,0,0,1,0,0,0,1],this.resetView()}setWorldAxisZUp(L){this._worldAxisZUp=L,L?this.viewer.scene.camera.worldAxis=[1,0,0,0,0,1,0,1,0]:this.viewer.scene.camera.worldAxis=[1,0,0,0,1,0,0,0,1],this.resetView()}setEdgesEnabled(L=!this.viewer.scene.edgesEnabled){this.viewer.scene.edgesEnabled=L,this.viewer.scene.render(!0)}setSAOEnabled(L=!this.viewer.scene.saoEnabled){this.viewer.scene.saoEnabled=L}setDTXEnabled(L=!this.viewer.scene.dtxEnabled){this.viewer.scene.dtxEnabled=L}setPBREnabled(L=!this.viewer.scene.pbrEnabled){this.viewer.scene.pbrEnabled=L}resetView(L=()=>{}){if(this._focusPartial||this._worldAxisYDown){this.setDirection(25);return}this._resetAction.reset(L)}fitView(L=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,L);return}this._fitAction.fit()}SetAnnotationToolActive(L=!this._annotationTool.getActive(),M=()=>{}){this._annotationTool.setActive(L),M&&M(this._annotationTool.getActive())}SetMarkerToolActive(L=!this._markerTool.getActive(),M=()=>{}){this._markerTool.setActive(L),M&&M(this._markerTool.getActive())}SetCommentsToolActive(L=!this._commentsTool.getActive(),M=()=>{}){this._commentsTool.setActive(L),M&&M(this._commentsTool.getActive())}SetFirstPersonModeActive(L=!this._firstPersonMode.getActive(),M=()=>{}){this._firstPersonMode.setActive(L),M&&M(this._firstPersonMode.getActive())}SetMeasureToolActive(L=!this.measureAngleTool.getActive(),M=()=>{}){this._measureTool.setActive(L),M&&M(this._measureTool.getActive())}SetMeasureAngleActive(L=!this.measureAngleTool.getActive(),M=()=>{}){this._measureTool.SetMeasureAngleActive(L,M)}SetMeasureDistanceActive(L=!this.measureDistanceTool.getActive(),M=()=>{}){this._measureTool.SetMeasureDistanceActive(L,M)}SetSectionToolActive(L=!this._sectionTool.getActive(),M=()=>{}){this._sectionTool.setActive(L),M(this._sectionTool.getActive())}SetHideToolActive(L,M=()=>{}){this._hideTool.setActive(L),M&&M()}SetOrthoModeActive(L=!this._orthoMode.getActive(),M=()=>{}){this._orthoMode.setActive(L,M)}SetThreeDModeActive(L=!this._threeDMode.getActive(),M=()=>{}){this._threeDMode.setActive(L,M)}SetShowSpaceModeActive(L=!this._showSpacesMode.getActive(),M=()=>{}){this._showSpacesMode.setActive(L,M)}SetSkyBoxToolActive(L,M=()=>{}){this._skyBoxTool&&(L==null?this._skyBoxTool.setActive(!this._skyBoxTool.getActive()):this._skyBoxTool.setActive(L),M&&M(this._skyBoxTool.getActive()))}SetBCFToolActive(L=!this._bcfTool.getActive(),M=()=>{}){this._bcfTool.setActive(L),M(this._bcfTool.getActive())}get marker(){return this._markerTool}get firstPersonMode(){return this._firstPersonMode}get measureTool(){return this._measureTool}get measureAngleTool(){return this._measureTool.measureAngleTool}get measureDistanceTool(){return this._measureTool.measureDistanceTool}get sectionTool(){return this._sectionTool}get commentTool(){return this._commentsTool}get annotationTool(){return this._annotationTool}get markerTool(){return this._markerTool}get objectsExplorer(){return this._objectsExplorer}get classesExplorer(){return this._classesExplorer}get storeysExplorer(){return this._storeysExplorer}get modelsExplorer(){return this._modelsExplorer}get orthoMode(){return this._orthoMode}get threeDMode(){return this._threeDMode}get navCubeMode(){return this._navCubeMode}get skyBoxTool(){return this._skyBoxTool}get bcfTool(){return this._bcfTool}setDirection(L){this._navCubeMode.flyByClick(L)}singleChoseEntity(L){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.setEntitySelected(L))}singleChosedSpace(){this._disableClickEvent||this.setAllObjectsSelected(!1)}doubleChoseEntity(L){this._disableClickEvent||(this.viewFitEntity(L),this.setAllObjectsSelected(!1),this.setEntitySelected(L))}choseSpace(){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.viewFitAll())}getPreShot(L,M){const{cameraEnable:I}=this;I(!1);const F=typeof L=="function"?1024:L;typeof L=="function"&&(M=L);const{orbitYawCamera:V}=this,{viewer:D}=this,{canvas:X}=D.scene.canvas,ee=this._projectId,q=document.createElement("canvas"),ne=q.getContext("2d"),oe=F*15,he=F;q.width=oe,q.height=he;const te=Array.from({length:15},()=>de);function de(){return K(this,void 0,void 0,function*(){return yield V(-18),yield se(100),re(F)})}function se(Ce){return new Promise(me=>setTimeout(me,Ce))}function re(Ce){return K(this,void 0,void 0,function*(){const me=document.createElement("canvas"),ce=me.getContext("2d");if(X&&ce){me.width=Ce,me.height=Ce;const pe=Ce/X.width,B=Ce/X.height,ke=Math.max(pe,B),Ee=X.width*ke,ge=X.height*ke,Ae=(Ce-Ee)/2,fe=(Ce-ge)/2;return ce.clearRect(0,0,Ce,Ce),ce.fillStyle="transparent",ce.fillRect(0,0,Ce,Ce),ce.drawImage(X,0,0,X.width,X.height,Ae,fe,Ee,ge),new Promise((ue,_e)=>{const be=new Image;be.onload=()=>ue(be),be.onerror=_e,be.src=me.toDataURL()})}return Promise.reject(new Error("Canvas or context not found."))})}function ae(Ce){const me=q.toDataURL("image/png");{console.log(Ce);const ce=document.createElement("a");ce.href=me,ce.download="combined_image.png",ce.click()}return I(!0),M&&M({modelId:ee,imageData:me}),me}return K(this,void 0,void 0,function*(){for(let Ce=0;Ce<te.length;Ce++)try{const me=yield te[Ce]();ne&&ne.drawImage(me,Ce*F,0)}catch(me){I(!0),console.error("获取图片内容失败:",me)}ae(!0)}),""}setShelterCanvas(L=()=>{}){const{canvas:M}=this.viewer.scene.canvas,I=this.shot(M.width,M.height,!1),F=document.createElement("img");F.src=I,F.style.position="absolute",F.style.top="0px",F.style.left="0px",F.style.right="0px",F.style.bottom="0px",M.parentNode.appendChild(F),typeof L=="function"&&L(F)}}},"./src/Controller.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/TMap.ts");class S{constructor(h,d={},u=null,l=null){this._children=[],this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._enabled=null,this._active=null,this.destroyed=!1,this.bimViewer=h?h.bimViewer||h:this,this.server=h?h.server:u,this.viewer=h?h.viewer:l,h&&h._children.push(this)}fire(h,d,u=!1){this._events||(this._events={}),this._eventSubs||(this._eventSubs={}),u!==!0&&(this._events[h]=d||!0);const l=this._eventSubs[h];let c;l&&Object.keys(l).forEach(f=>{Object.prototype.hasOwnProperty.call(l,f)&&(c=l[f],this._eventCallDepth+=1,this._eventCallDepth<300?c.callback.call(c.scope,d):this.error(`fire: potential stack overflow from recursive event ${h} - dropping this event`),this._eventCallDepth-=1)})}on(h,d,u=this){this._events||(this._events={}),this._subIdMap||(this._subIdMap=new x.default),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={});let l=this._eventSubs[h];l||(l={},this._eventSubs[h]=l);const c=this._subIdMap.addItem();l[c]={callback:d,scope:u||this},this._subIdEvents[c]=h;const f=this._events[h];return f!==void 0&&d.call(u||this,f),c}off(h){if(h==null||!this._subIdEvents)return;const d=this._subIdEvents[h];if(d){delete this._subIdEvents[h];const u=this._eventSubs[d];u&&delete u[h],this._subIdMap.removeItem(h)}}once(h,d,u=this){const l=this,c=this.on(h,f=>{l.off(c),d.call(u||this,f)},u)}log(h){h=`[LOG] ${h}`,console.log(h)}warn(h){h=`[LOG] ${h}`,window.console.warn(h)}error(h){h=`[LOG] ${h}`,window.console.error(h)}_mutexActivation(h){h.forEach((d,u)=>{d.on("active",l=>{l&&h.forEach((c,f)=>{f!==u&&c.setActive(!1)})})})}setEnabled(h){this._enabled!==h&&(this._enabled=h,this.fire("enabled",this._enabled))}getEnabled(){return this._enabled}setActive(h){this._active!==h&&(this._active=h,this.fire("active",this._active))}getActive(){return this._active}destroy(){this.destroyed||(this.fire("destroyed",this.destroyed=!0),this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._events=null,this._eventCallDepth=0,this._children.forEach(h=>{h.destroy()}),this._children=[])}}},"./src/EventTrigger.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>x});class x{constructor(){this.events={}}on(A,h){this.events[A]||(this.events[A]=[]),this.events[A].push(h)}off(A,h){this.events[A]&&(this.events[A]=this.events[A].filter(d=>d!==h))}emit(A,...h){this.events[A]&&this.events[A].forEach(d=>{d(...h)})}destroy(){this.events={}}}},"./src/TMap.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>x});class x{constructor(A=[],h=0){this.items=[],this._lastUniqueId=0,this.items=A||[],this._lastUniqueId=(h||0)+1}addItem(...A){let h;if(A.length===2){const d=A[0];if(h=A[1],this.items[d])throw new Error(`ID clash: '${d}'`);return this.items[d]=h,d}for(h=A[0]||{};;){this._lastUniqueId+=1;const d=this._lastUniqueId;if(!this.items[d])return this.items[d]=h,d}}removeItem(A){const h=this.items[A];return delete this.items[A],h}}},"./src/explorer/ClassesExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u={}){super(d),this.eventTrigger=d.eventTrigger;const{modelType:l}=u;this._treeView=new x.TreeViewPlugin(this.viewer,{hierarchy:"types",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",c=>{this._rootNode=c,this.eventTrigger.emit("classes_rootNodes",c)}),this._treeView.on("nodeNodes_Created",c=>{this._nodeList=c,this.eventTrigger.emit("classes_nodeNodes",c)}),this._treeView.on("objectNodes_Created",c=>{this._objectList=c,this.eventTrigger.emit("classes_objectNodes",c)}),this._treeView.on("checkBoxChanged",c=>{this.eventTrigger.emit("classes_checkBoxChanged",c)}),l==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",c=>{this._treeView.addModel(c,{rootName:c})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",c=>{c.result==="success"&&(this._treeView.addModel(c.metaModel.id,{rootName:c.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",c=>{this.viewer.metaScene.metaModels[c]&&this._treeView.removeModel(c)})}get rootNode(){return this._rootNode}get nodesList(){return this._nodeList}get objectList(){return this._objectList}getNodeIdByObjectId(d){return this._objectList[d]!=null?this._objectList[d].nodeId:null}getNodeById(d){return this._treeView.getNodeById(d)}getChildrenById(d){this._treeView.getChildrenById(d)}checkboxChangeHandler(d,u){const l=this._nodeList[d],c=u,{objects:f}=this.viewer.scene;let p=0;this._treeView.withNodeTree(l,v=>{const{objectId:_}=v,b=f[_],w=v.children.length===0;v.numVisibleEntities=c?v.numEntities:0,w&&c!==v.checked&&p++,v.checked=c,b&&(b.visible=c)});let{parent:m}=l;for(;m;)m.checked=c,c?m.numVisibleEntities+=p:m.numVisibleEntities-=p,m=m.parent}nodeTitleClicked(d){const{scene:u}=this.viewer,l=this._nodeList[d],c=[];this._treeView.withNodeTree(l,p=>{p.objectId&&c.push(p.objectId)});const{checked:f}=l;f?(u.setObjectsXRayed(c,!1),u.setObjectsVisible(c,!1),u.setObjectsPickable(c,!0)):(u.setObjectsXRayed(c,!1),u.setObjectsVisible(c,!0),u.setObjectsPickable(c,!0))}setEnabled(d){}expandTreeViewToDepth(d){}showNodeInTreeView(d){this._treeView.showNode(d)}unShowNodeInTreeView(){this._treeView.unShowNode()}destroy(){super.destroy(),this._treeView.destroy(),this.viewer.scene.off(this._onModelLoaded),this.viewer.scene.off(this._onModelUnloaded),this.viewer.scene.off(this._onMetaDataLoaded)}get treeView(){return this._treeView}}},"./src/explorer/ModelsExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>f});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");let A;const h=["position","scale","rotation","matrix","origin"],d=x.math;function u(p,m,v,_){const b=Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]),w=Math.sqrt(p[4]*p[4]+p[5]*p[5]+p[6]*p[6]),C=Math.sqrt(p[8]*p[8]+p[9]*p[9]+p[10]*p[10]);m[0]=p[12],m[1]=p[13],m[2]=p[14];const k=new Array(16);for(let T=0;T<16;T++)k[T]=p[T];b>1e-6&&(k[0]/=b,k[1]/=b,k[2]/=b),w>1e-6&&(k[4]/=w,k[5]/=w,k[6]/=w),C>1e-6&&(k[8]/=C,k[9]/=C,k[10]/=C),d.mat4ToQuaternion(k,v),_[0]=b,_[1]=w,_[2]=C}function l(p){const m=[0,0,0];return d.quaternionToEuler(p,"XYZ",m),m}class c{constructor(m,v){this._projectId="",this._modelId="",this._server=m,A=v.tempVec3a}setProjectId(m){this._projectId=m}setModelId(m){this._modelId=m}getManifest(m,v,_){this._server.getSplitModelManifest(this._projectId,this._modelId,m,v,_)}getMetaModel(m,v,_){this._server.getSplitModelMetadata(this._projectId,this._modelId,m,v,_)}getXTC(m,v,_){this._server.getSplitModelGeometry(this._projectId,this._modelId,m,v,_)}}class f extends S.default{constructor(m,v){super(m,v),this._modelFromOutSide=v.modelFromOutSide,this._projectId=v.projectId,this._modelType=v.modelType,this._modelSrc=v.modelSrc,this._eventTrigger=m.eventTrigger,this._dataSource=new c(this.server,{tempVec3a:v.tempVec3a}),this._modelConfig=v.modelConfig,this._modelsInfo={},this._numModels=0,this._numModelsLoaded=0}getModelIds(){return Object.keys(this._modelsInfo)}getModelInfo(m){return this._modelsInfo[m]}loadModel(m,v,_=()=>{},b=()=>{},w){if(this._modelType=w.modelType,this._modelType=="ifc"){const k=w.IfcAPI!==void 0&&w.IfcAPI!==null,T=w.WebIFC!==void 0&&w.WebIFC!==null;k&&T&&this.log("载入外部传入webifc..."),this._ifcLoader=k&&T?new x.WebIFCLoaderPlugin(this.viewer,{WebIFC:w.WebIFC,IfcAPI:w.IfcAPI}):new x.WebIFCLoaderPlugin(this.viewer,{}),this._modelsInfo[m]={id:m,ifc:v,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}}else this._modelType=="xtc"?(this._xtcLoader=new x.XTCLoaderPlugin(this.viewer,{dataSource:this._dataSource}),this._xtcLoader.on("metaLoaded",k=>{this._eventTrigger.emit("metaLoaded",k)}),this._xtcLoader.on("metaLoading",k=>{this._eventTrigger.emit("metaLoading",k)}),this._modelsInfo[m]={id:m,xtc:v,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}):this._modelType=="glb"&&(this._glbLoader=new x.GLTFLoaderPlugin(this.viewer),this._modelsInfo[m]={id:m,gltf:v,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0});const C=this._modelsInfo[m];for(const k of h)w&&w[k]!==void 0&&w[k]!==null&&(C[k]=w[k]);w&&w.alignTo!==void 0&&w.alignTo!==null&&(C.alignTo=w.alignTo),this._loadGeometry(m,_,b)}unloadModel(m){const v=this.viewer.scene.models[m];if(!v){this.error("Model not loaded: "+m);return}v.destroy(),delete this._modelsInfo[m],this.fire("modelUnloaded",m)}loadMetadata(m,v,_,b){const w=this.viewer.metaScene.metaModels[m];if(!w){this.warn("loadMetadata() - MetaModel not found: "+m),b&&b();return}this._xtcLoader&&(this._modelsInfo[m]&&(this._modelsInfo[m].metaBuffer=v),this._xtcLoader.loadMetadata(w,v,_,b))}_loadGeometry(m,v,_){const b=this._modelsInfo[m],w=Object.assign({},b),C=this._resolveModelTransform(b);for(const R of h)delete w[R];delete w.alignTo;for(const R of Object.keys(C))w[R]=C[R];const k=()=>{this._jumpToInitialCamera(),this.fire("modelLoaded",m),v&&v()},T=R=>{this.error(R),_&&_(R)};if(this._modelType=="ifc"&&this._ifcLoader)if(this._modelFromOutSide){this.log("正在载入ifc模型...");const R=this._ifcLoader.load(w);R.on("loaded",k),R.on("error",T)}else{this.log("正在载入引擎从本地获取的ifc模型...");const R={id:m,src:this._modelSrc,edges:w.edges,loadMetadata:!1,pbrEnabled:w.pbrEnabled,dtxEnabled:w.dtxEnabled};for(const G of h)w[G]!==void 0&&w[G]!==null&&(R[G]=w[G]);const U=this._ifcLoader.load(R);U.on("loaded",k),U.on("error",T)}else if(this._modelType==="xtc"&&this._xtcLoader){if(this._modelFromOutSide){this.log("正在载入xtc模型...");const R=this._xtcLoader.load(w);R.on("loaded",k),R.on("error",T)}}else if(this._modelType==="glb"&&this._glbLoader&&this._modelFromOutSide){this.log("正在载入glb模型...");const R=this._glbLoader.load(w);R.on("loaded",k),R.on("error",T)}}_resolveModelTransform(m){const v={};let _=null,b=null,w=null,C=null;if(m.matrix){const k=[0,0,0],T=[0,0,0,1],R=[1,1,1];u(m.matrix,k,T,R),_=k,b=l(T),w=R}else m.position&&(_=Array.from(m.position)),m.quaternion?b=l(m.quaternion):m.rotation&&(b=Array.from(m.rotation)),m.scale&&(w=Array.from(m.scale));if(m.origin&&(C=Array.from(m.origin)),m.alignTo){const k=this.viewer.scene.models[m.alignTo];k?(C===null&&(C=Array.from(k.origin)),_===null&&(_=Array.from(k.position)),b===null&&(b=Array.from(k.rotation)),w===null&&(w=Array.from(k.scale))):this.warn(`alignTo: 基准模型 "${m.alignTo}" 尚未加载,将按自身坐标加载`)}return _&&(v.position=_),b&&(v.rotation=b),w&&(v.scale=w),C&&(v.origin=C),v}_jumpToInitialCamera(){const{viewer:m}=this,{scene:v}=m,_=v.getAABB(v.visibleObjectIds),b=x.math.getAABB3Diag(_),w=x.math.getAABB3Center(_,A),{camera:C}=v,k=Math.abs(b/Math.tan(45*x.math.DEGTORAD)),T=x.math.normalizeVec3(C.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),R=x.math.normalizeVec3(C.yUp?[-.5,.7071,-.5]:[-1,1,1]);m.cameraControl.pivotPos=w,m.cameraControl.planView&&(m.cameraControl.planView=!1),m.cameraFlight.jumpTo({look:w,eye:[w[0]-k*T[0],w[1]-k*T[1],w[2]-k*T[2]],up:R,orthoScale:b*1.1})}destroy(){super.destroy(),this._xtcLoader&&this._xtcLoader.destroy(),this._ifcLoader&&this._ifcLoader.destroy(),this._glbLoader&&this._glbLoader.destroy()}}},"./src/explorer/ObjectsExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u={}){super(d);const{modelType:l}=u;this.eventTrigger=d.eventTrigger,this._treeView=new x.TreeViewPlugin(this.viewer,{hierarchy:"containment",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",c=>{this._rootNode=c,this.eventTrigger.emit("object_rootNodes",c)}),this._treeView.on("nodeNodes_Created",c=>{this._nodeList=c,this.eventTrigger.emit("object_nodeNodes",c)}),this._treeView.on("objectNodes_Created",c=>{this._objectList=c,this.eventTrigger.emit("object_objectNodes",c)}),this._treeView.on("checkBoxChanged",c=>{this.eventTrigger.emit("object_checkBoxChanged",c)}),l==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",c=>{this._treeView.addModel(c,{rootName:c})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",c=>{c.result==="success"&&(this._treeView.addModel(c.metaModel.id,{rootName:c.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",c=>{this.viewer.metaScene.metaModels[c]&&this._treeView.removeModel(c)})}get rootNode(){return this._rootNode}get nodesList(){return this._nodeList}get objectList(){return this._objectList}get treeView(){return this._treeView}getNodeIdByObjectId(d){if(this._objectList[d]!=null)this._objectList[d].nodeId;else return null}getNodeById(d){return this._treeView.getNodeById(d)}getChildrenById(d){this._treeView.getChildrenById(d)}setEnabled(d){}destroy(){super.destroy(),this._treeView.destroy(),this.viewer.scene.off(this._onModelLoaded),this.viewer.scene.off(this._onModelUnloaded),this.viewer.scene.off(this._onMetaDataLoaded)}}},"./src/explorer/StoreysExplorer.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A=x.math.vec3();class h extends S.default{constructor(u,l={}){super(u);const{modelType:c}=l;this.eventTrigger=u.eventTrigger,this._treeView=new x.TreeViewPlugin(this.viewer,{hierarchy:"storeys",autoAddModels:!1,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",f=>{this._rootNode=f,this.eventTrigger.emit("storeys_rootNodes",f)}),this._treeView.on("nodeNodes_Created",f=>{this._nodeList=f,this.eventTrigger.emit("storeys_nodeNodes",f)}),this._treeView.on("objectNodes_Created",f=>{this._objectList=f,this.eventTrigger.emit("storeys_objectNodes",f)}),this._treeView.on("checkBoxChanged",f=>{this.eventTrigger.emit("storeys_checkBoxChanged",f)}),c==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",f=>{this._treeView.addModel(f,{rootName:f})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",f=>{f.result==="success"&&(this._treeView.addModel(f.metaModel.id,{rootName:f.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",f=>{this.viewer.metaScene.metaModels[f]&&this._treeView.removeModel(f)})}get rootNode(){return this._rootNode}get nodesList(){return this._nodeList}get objectList(){return this._objectList}getNodeIdByObjectId(u){if(this._objectList[u]!=null)this._objectList[u].nodeId;else return null}getNodeById(u){return this._treeView.getNodeById(u)}getChildrenById(u){this._treeView.getChildrenById(u)}checkboxChangeHandler(u,l){const c=this._nodeList[u],f=l,{objects:p}=this.viewer.scene;let m=0;this._treeView.withNodeTree(c,_=>{const{objectId:b}=_,w=p[b],C=_.children.length===0;_.numVisibleEntities=f?_.numEntities:0,C&&f!==_.checked&&m++,_.checked=f,w&&(w.visible=f)});let{parent:v}=c;for(;v;)v.checked=f,f?v.numVisibleEntities+=m:v.numVisibleEntities-=m,v=v.parent}nodeTitleClicked(u){const{scene:l}=this.viewer,c=this._nodeList[u],f=[];this._treeView.withNodeTree(c,m=>{m.objectId&&f.push(m.objectId)});const{checked:p}=c;p?(l.setObjectsXRayed(f,!1),l.setObjectsVisible(f,!1),l.setObjectsPickable(f,!0)):(l.setObjectsXRayed(f,!1),l.setObjectsVisible(f,!0),l.setObjectsPickable(f,!0))}setEnabled(u){}_selectObjects(u,l){const{scene:c}=this.viewer,f=c.getAABB(u);this.viewer.cameraControl.pivotPos=x.math.getAABB3Center(f,A),l?(c.setObjectsXRayed(c.objectIds,!0),c.setObjectsVisible(c.objectIds,!0),c.setObjectsPickable(c.objectIds,!1),c.setObjectsSelected(c.selectedObjectIds,!1),c.setObjectsXRayed(u,!1),c.setObjectsVisible(u,!0),c.setObjectsPickable(u,!0),this.viewer.cameraFlight.flyTo({aabb:f},()=>{setTimeout(()=>{c.setObjectsVisible(c.xrayedObjectIds,!1),c.setObjectsXRayed(c.xrayedObjectIds,!1)},500),l()})):(c.setObjectsVisible(c.objectIds,!1),c.setObjectsPickable(c.xrayedObjectIds,!0),c.setObjectsXRayed(c.xrayedObjectIds,!1),c.setObjectsSelected(c.selectedObjectIds,!1),c.setObjectsVisible(u,!0),this.viewer.cameraFlight.jumpTo({aabb:f}))}destroy(){super.destroy(),this._treeView.destroy(),this.viewer.scene.off(this._onModelLoaded),this.viewer.scene.off(this._onModelUnloaded),this.viewer.scene.off(this._onMetaDataLoaded)}expandTreeViewToDepth(u){}showNodeInTreeView(u){this._treeView.showNode(u)}unShowNodeInTreeView(){this._treeView.unShowNode()}selectStorey(u,l){const{metaScene:c}=this.viewer,f=c.metaObjects[u];if(!f){this.error(`selectStorey() - object is not found: ${u}`);return}if(f.type!=="IfcBuildingStorey"){this.error(`selectStorey() - object is not found: ${u}`);return}const p=f.getObjectIDsInSubtree();this._selectObjects(p,l)}}},"./src/messages.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});const S={ch:{NavCube:{front:"前",back:"后",top:"上",bottom:"下",left:"左",right:"右"},modelsExplorer:{title:"模型",loadAll:"加载全部",loadAllTip:"加载项目中的所有模型",unloadAll:"卸载全部",unloadAllTip:"卸载所有模型",add:"添加",addTip:"添加模型"},objectsExplorer:{title:"对象",showAll:"显示全部",showAllTip:"显示所有对象",hideAll:"隐藏全部",hideAllTip:"隐藏所有对象"},classesExplorer:{title:"类别",showAll:"显示全部",showAllTip:"显示所有类别",hideAll:"隐藏全部",hideAllTip:"隐藏所有类别"},storeysExplorer:{title:"楼层",showAll:"显示全部",showAllTip:"显示所有楼层",hideAll:"隐藏全部",hideAllTip:"隐藏所有楼层"},propertiesInspector:{title:"属性",noObjectSelectedWarning:"未选中任何对象。右键单击或长按对象,并选择“检查属性”以在此查看其属性。",noPropSetWarning:"未找到此对象的属性集。"},toolbar:{toggleExplorer:"结构树",toggleProperties:"属性",resetViewTip:"重置视图",toggle2d3dTip:"2D/3D",togglePerspectiveTip:"透视/正交",viewFitTip:"适合视图",firstPersonTip:"第一人称",hideObjectsTip:"隐藏对象",annotationObjectsTip:"标注对象",selectObjectsTip:"选择对象",queryObjectsTip:"查询对象",sliceObjectsTip:"切片对象",slicesMenuTip:"切片菜单",showSpacesTip:"显示空间",numSlicesTip:"现有切片数"}},en:{NavCube:{front:"Front",back:"Back",top:"Top",bottom:"Bottom",left:"Left",right:"Right"},modelsExplorer:{title:"Models",loadAll:"Load all",loadAllTip:"Load all models in this project",unloadAll:"Unload all",unloadAllTip:"Unload all models",add:"Add",addTip:"Add a Model"},objectsExplorer:{title:"Objects",showAll:"Show all",showAllTip:"Show all objects",hideAll:"Hide all",hideAllTip:"Hide all objects"},classesExplorer:{title:"Classes",showAll:"Show all",showAllTip:"Show all classes",hideAll:"Hide all",hideAllTip:"Hide all classes"},storeysExplorer:{title:"Storeys",showAll:"Show all",showAllTip:"Show all storeys",hideAll:"Hide all",hideAllTip:"Hide all storeys"},propertiesInspector:{title:"Properties",noObjectSelectedWarning:"No object inspected. Right-click or long-tab an object and select 'Inspect Properties' to view its properties here.",noPropSetWarning:"No property sets found for this object."},toolbar:{toggleExplorer:"Toggle explorer",toggleProperties:"Toggle properties",resetViewTip:"Reset view",toggle2d3dTip:"Toggle 2D/3D",togglePerspectiveTip:"Toggle Perspective/Ortho",viewFitTip:"View fit",firstPersonTip:"Toggle first person navigation mode",hideObjectsTip:"Hide objects",selectObjectsTip:"Select objects",queryObjectsTip:"Query objects",sliceObjectsTip:"Slice objects",slicesMenuTip:"Slices menu",showSpacesTip:"Show IFCSpaces",numSlicesTip:"Number of existing slices"}},de:{NavCube:{front:"Vorne",back:"Hinten",top:"Oben",bottom:"Unten",left:"Links",right:"Rechts"},modelsExplorer:{title:"Modelle",loadAll:"Alle laden",loadAllTip:"Alle Modelle in diesem Projekt laden",unloadAll:"Alle abwählen",unloadAllTip:"Alle Modelle abwählen",add:"Hinzufügen",addTip:"Modell hinzufügen"},objectsExplorer:{title:"Objekte",showAll:"Alle anzeigen",showAllTip:"Alle Objekte anzeigen",hideAll:"Alle ausblenden",hideAllTip:"Alle Objekte ausblenden"},classesExplorer:{title:"Typen",showAll:"Alle anzeigen",showAllTip:"Alle Typen anzeigen",hideAll:"Alle ausblenden",hideAllTip:"Alle Typen ausblenden"},storeysExplorer:{title:"Stockwerke",showAll:"Alle anzeigen",showAllTip:"Alle Stockwerke anzeigen",hideAll:"Alle ausblenden",hideAllTip:"Alle Stockwerke ausblenden"},propertiesInspector:{title:"Eigenschaften",noObjectSelectedWarning:"Kein Objekt inspiziert. Klicken Sie mit der rechten Maustaste auf ein Objekt oder führen Sie einen langen Tabulator aus und wählen Sie 'Eigenschaften prüfen', um die Eigenschaften des Objekts anzuzeigen.",noPropSetWarning:"Keine Eigenschaftssätze für dieses Objekt gefunden."},toolbar:{toggleExplorer:"Explorer ein- und ausblenden",toggleProperties:"Eigenschaften ein- und ausblenden",resetViewTip:"Ansicht zurücksetzen",toggle2d3dTip:"2D/3D umschalten",togglePerspectiveTip:"Orthogonale/Perspektivische Ansicht umschalten",viewFitTip:"In Ansicht einpassen",firstPersonTip:"Ich-Perspektive umschalten",hideObjectsTip:"Objekte ausblenden",selectObjectsTip:"Objekte auswählen",queryObjectsTip:"Abfrageobjekte",sliceObjectsTip:"Objekte schneiden",slicesMenuTip:"Menü Schnittebenen",showSpacesTip:"IFC-Räume anzeigen",numSlicesTip:"Anzahl der Schnittebenen"}},fr:{NavCube:{front:"Face",back:"Arrière",top:"Dessus",bottom:"Dessous",left:"Droite",right:"Gauche"},modelsExplorer:{title:"Modèles",loadAll:"Afficher tout",loadAllTip:"Afficher tous les modèles du projet",unloadAll:"Masquer tout",unloadAllTip:"Masquer tous les modèles",add:"Ajouter",addTip:"Ajouter un modèle"},objectsExplorer:{title:"Conteneurs",showAll:"Afficher tout",showAllTip:"Afficher tous les objets",hideAll:"Masquer tout",hideAllTip:"Masquer tous les objets"},classesExplorer:{title:"Classes IFC",showAll:"Afficher tout",showAllTip:"Affiche toutes les classes",hideAll:"Masquer tout",hideAllTip:"Masquer toutes les classes"},storeysExplorer:{title:"Étages",showAll:"Afficher tout",showAllTip:"Afficher tous les étages",hideAll:"Masquer tout",hideAllTip:"Masquer tous les étages"},propertiesInspector:{title:"Propriétés",noObjectSelectedWarning:"Aucun objet n'a été inspecté. Cliquez avec le bouton droit ou le bouton long sur un objet et sélectionnez 'Inspecter les propriétés' pour afficher ses propriétés ici.",noPropSetWarning:"Aucun ensemble de propriétés n'a été trouvé pour cet objet."},toolbar:{toggleExplorer:"Afficher la structure",toggleProperties:"Afficher les propriétés",resetViewTip:"Réinitialiser la vue",toggle2d3dTip:"Activer 2D/3D",togglePerspectiveTip:"Activer Perspective/Ortho",viewFitTip:"Recadrer la vue",firstPersonTip:"Mode 1ere personne",hideObjectsTip:"Masquer objets",selectObjectsTip:"Sélectionner",queryObjectsTip:"Informations objets",sliceObjectsTip:"Coupes",slicesMenuTip:"Outils de coupe",showSpacesTip:"Afficher les espaces IFC",numSlicesTip:"Nombre de coupes"}},pl:{NavCube:{front:"Przód",back:"Tył",top:"Góra",bottom:"Dół",left:"Lewy",right:"Prawy"},modelsExplorer:{title:"Model",loadAll:"Załaduj",loadAllTip:"Załaduj wszystkie modele",unloadAll:"Zamknij",unloadAllTip:"Zamnij wszystkie modele",add:"Dodaj",addTip:"Dodaj modele"},objectsExplorer:{title:"Obiekty",showAll:"Pokaż",showAllTip:"Pokaż wszystkie obiekty",hideAll:"Ukryj",hideAllTip:"Ukryj wszystkie obiekty"},classesExplorer:{title:"Typy",showAll:"Pokaż",showAllTip:"Pokaż wszystkie typy",hideAll:"Ukryj",hideAllTip:"Ukryj wszystkie typy"},storeysExplorer:{title:"Piętra",showAll:"Pokaż",showAllTip:"Pokaż wszystkie piętra",hideAll:"Ukryj",hideAllTip:"Ukryj wszystkie piętra"},propertiesInspector:{title:"Właściwości",noObjectSelectedWarning:"Nie sprawdzono żadnego obiektu. Kliknij prawym przyciskiem myszy lub kliknij długo na obiekcie i wybierz opcję 'Sprawdź właściwości', aby wyświetlić jego właściwości.",noPropSetWarning:"Nie znaleziono żadnych zestawów właściwości dla tego obiektu."},toolbar:{toggleExplorer:"Przełączanie eksploratora",toggleProperties:"Przełączanie właściwości",resetViewTip:"Resetuj widok",toggle2d3dTip:"Widok 2D/3D",togglePerspectiveTip:"Widok Ortograficzny/Perspektywiczny",viewFitTip:"Dopasowanie do widoku",firstPersonTip:"Widok perspektywy pierwszoosobowej",hideObjectsTip:"Ukryj obiekt",selectObjectsTip:"Zaznacz obiekt",queryObjectsTip:"Wywołaj obiekt",sliceObjectsTip:"Przekroje obiektów",slicesMenuTip:"Menu przekroi",showSpacesTip:"Pokaż przestrzenie IFC",numSlicesTip:"Liczba przekroi"}},ru:{NavCube:{front:"Фронт",back:"Тыл",top:"Верх",bottom:"Низ",left:"Лево",right:"Право"},modelsExplorer:{title:"Модели",loadAll:"Загрузить все",loadAllTip:"Загрузить все модели в этом проекте",unloadAll:"Выгрузить все",unloadAllTip:"Выгрузить все модели",add:"Добавить",addTip:"Добавить модель"},objectsExplorer:{title:"Объекты",showAll:"Показать все",showAllTip:"Показать все объекты",hideAll:"Скрыть все",hideAllTip:"Скрыть все объекты"},classesExplorer:{title:"Классы",showAll:"Показать все",showAllTip:"Показать все классы",hideAll:"Скрыть все",hideAllTip:"Скрыть все классы"},storeysExplorer:{title:"Этажи",showAll:"Показать все",showAllTip:"Показать все этажи",hideAll:"Скрыть все",hideAllTip:"Скрыть все этажи"},propertiesInspector:{title:"Свойства",noObjectSelectedWarning:"Ни один объект не осмотрен. Щелкните правой кнопкой мыши или длинной меткой на объекте и выберите 'Осмотреть свойства', чтобы просмотреть его свойства здесь.",noPropSetWarning:"Для этого объекта не найдено ни одного набора свойств."},toolbar:{toggleExplorer:"Переключить навигатор",toggleProperties:"Переключить Свойства",resetViewTip:"Сбросить вид",toggle2d3dTip:"Переключить 2D/3D",togglePerspectiveTip:"Переключить проекцию перспектива/орто",viewFitTip:"Показать всю модель",firstPersonTip:"Переключить режим навигации от первого лица",hideObjectsTip:"Скрыть объекты",selectObjectsTip:"Выбрать объекты",queryObjectsTip:"Выбрать объекты",sliceObjectsTip:"Рассечь объекты",slicesMenuTip:"Меню сечений",showSpacesTip:"Показать места IFC",numSlicesTip:"Количество существующих сечений"}}}},"./src/server/OSSHelper.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>l});var x=a("./node_modules/axios/lib/axios.js"),S=a("./node_modules/ali-oss/dist/aliyun-oss-sdk.js"),A=a.n(S),h=function(c,f,p,m){function v(_){return _ instanceof p?_:new p(function(b){b(_)})}return new(p||(p=Promise))(function(_,b){function w(T){try{k(m.next(T))}catch(R){b(R)}}function C(T){try{k(m.throw(T))}catch(R){b(R)}}function k(T){T.done?_(T.value):v(T.value).then(w,C)}k((m=m.apply(c,f||[])).next())})};function d(c){return h(this,void 0,void 0,function*(){try{return(yield x.default.get(c)).data.data}catch(f){throw console.error("Error fetching data:",f),f}})}function u(c,f){return h(this,void 0,void 0,function*(){const p=yield d(c);return new(A())({region:"oss-cn-beijing",accessKeyId:p.accessKeyId,accessKeySecret:p.accessKeySecret,stsToken:p.securityToken,bucket:f})})}class l{static getBuffer(f,p,m,v,_){return h(this,void 0,void 0,function*(){try{const w=yield(yield u(p,m)).get(`${f}`);v(w.content.buffer)}catch(b){_(b)}})}static requestFileFromOSS(f,p,m,v,_,b){return h(this,void 0,void 0,function*(){try{const w=yield u(p,m);if(v){const C=yield w.get(`${f}/metadata.json`);_(JSON.parse(C.content))}else{const C=yield w.get(`${f}/index.json`);_(JSON.parse(C.content))}}catch(w){console.error("请求文件失败:",w)}})}}},"./src/server/Server.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/server/OSSHelper.ts"),A=function(d,u,l,c){function f(p){return p instanceof l?p:new l(function(m){m(p)})}return new(l||(l=Promise))(function(p,m){function v(w){try{b(c.next(w))}catch(C){m(C)}}function _(w){try{b(c.throw(w))}catch(C){m(C)}}function b(w){w.done?p(w.value):f(w.value).then(v,_)}b((c=c.apply(d,u||[])).next())})};class h{constructor(u={}){this._dataDir=u.dataDir||"",this._filePath=u.filePath||""}getProjects(u,l){const c=`${this._dataDir}/projects/index.json`;x.utils.loadJSON(c,u,l)}getProject(u,l,c){const f=`${this._dataDir}/projects/${u}/index.json`;x.utils.loadJSON(f,l,c)}getMetadata(u,l,c,f){const p=`${this._dataDir}/projects/${u}/models/${l}/metadata.json`;x.utils.loadJSON(p,c,f)}getModelProject(u,l,c,f){return A(this,void 0,void 0,function*(){yield S.default.requestFileFromOSS(this._filePath,u,l,!1,c,f)})}getModelMetadata(u,l,c,f){return A(this,void 0,void 0,function*(){yield S.default.requestFileFromOSS(this._filePath,u,l,!0,c,f)})}getModelGeometry(u,l,c,f){return A(this,void 0,void 0,function*(){yield S.default.getBuffer(this._filePath,u,l,c,f)})}getGeometry(u,l,c,f){const p=`${this._dataDir}/projects/${u}/models/${l}/geometry.xtc`;x.utils.loadArraybuffer(p,c,f)}getObjectInfo(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models${l}/props/${c}.json`;x.utils.loadJSON(m,f,p)}getIssues(u,l,c,f){const p=`${this._dataDir}/projects/${u}/modelId/${l}/issues.json`;x.utils.loadJSON(p,c,f)}getSplitModelManifest(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models${l}/${c}`;x.utils.loadJSON(m,f,p)}getSplitModelMetadata(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models/${l}/${c}`;x.utils.loadJSON(m,f,p)}getSplitModelGeometry(u,l,c,f,p){const m=`${this._dataDir}/projects/${u}/models${l}/${c}`;x.utils.loadArraybuffer(m,f,p)}}},"./src/toolbar/AnnotationTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){if(super(d,u),this._AnnotationList=[],this._visible=!0,this._currentType="image",this._modelId=u.modelId,this.eventTrigger=d.eventTrigger,this.imageSrc=new Map,document.getElementById("myAnnotationDiv"))this.annotationWrapper=document.getElementById("myAnnotationDiv");else{this.annotationWrapper=document.createElement("div"),this.annotationWrapper.id="myAnnotationDiv";const{canvas:f}=d.viewer.scene.canvas;f.parentNode.insertBefore(this.annotationWrapper,f)}this.annotationsPlugin=new x.AnnotationsPlugin(this.viewer,{markerHTML:"<div class='annotation-marker annotation-marker-{{iconType}} {{iconType}}' id='{{id}}' entityid='{{entityid}}' style='position:absolute;'><img src='{{iconPath}}'></div>",container:this.annotationWrapper,values:{id:"",entityid:"",iconPath:"",iconType:""}}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.on("active",f=>{});let l;this.annotationsPlugin.on("markerClicked",f=>{this.eventTrigger.emit("markerClicked",f),l=f}),this.annotationsPlugin.on("markerDoubleClicked",f=>{this.eventTrigger.emit("markerDoubleClicked",f)});const c=f=>{this._active&&(f.key==="Delete"||f.keyCode===8)&&this.eventTrigger.emit("requestDeleteMarker",l.id)};document.addEventListener("keydown",c.bind(this)),this.on("destroy",()=>{document.removeEventListener("keydown",c.bind(this))})}setAllVisible(d=!this._visible){this._visible=d,this.annotationsPlugin.setAllVisible(d)}clickToCreateAnno(d){if(!this.getActive()||!this.getEnabled())return;const u=this.getCanvasPos(d),l=this.viewer.scene.pick({canvasPos:u,pickSurface:!0});if(l){const c=l.entity.id,f=this.generateId(c);this.annotationsPlugin.createAnnotation({id:f,pickResult:l,occludable:!0,markerShown:!0,labelShown:!1,values:{id:f,entityid:c,iconPath:this.getTypeImage(this._currentType),iconType:this._currentType}}),this.currentAnnotation={id:f,modelId:l.entity.model.id,entityId:c,type:this._currentType,content:{worldPos:[l.worldPos[0],l.worldPos[1],l.worldPos[2]],fileContent:[],text:""}},this.eventTrigger.emit("createAnnotation",{type:this._currentType,currentAnnotation:this.currentAnnotation}),this._AnnotationList.push(this.currentAnnotation)}else console.log("没有获取到合法的坐标,传入的内容:",d)}generateId(d){const u=Date.now(),l=Math.floor(performance.now()*1e3);return`${d}_${this._currentType}_${u}_${l}`}getCanvasPos(d){const u=[];if(!d)d=window.event,u[0]=d.x,u[1]=d.y;else if("TouchEvent"in window&&d instanceof TouchEvent){if(!d.touches||d.touches.length===0)return;const l=d.touches[0];let c=d.target,f=0,p=0;for(;c.offsetParent;)f+=c.offsetLeft,p+=c.offsetTop,c=c.offsetParent;u[0]=l.pageX-f,u[1]=l.pageY-p}else{let l=this.viewer.scene.canvas.canvas,c=0,f=0;for(;l.offsetParent;)c+=l.offsetLeft,f+=l.offsetTop,l=l.offsetParent;u[0]=d.pageX-c,u[1]=d.pageY-f}return u}setCurrentType(d){this._currentType=d}showAnnotationList(){this.clear();const d=this._AnnotationList;d.length>0&&d.forEach(u=>{this.addAnnotation(u.id.toString(),u.content.worldPos,u.type)})}addAnnotation(d,u,l){this.annotationsPlugin.createAnnotation({id:d,worldPos:u,occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:d,entityid:d,iconPath:this.getTypeImage(l),iconType:l}})}clear(){this.annotationsPlugin.clear()}get AnnotationList(){return this._AnnotationList}set AnnotationList(d){this._AnnotationList=d}getTypeImage(d){if(this.imageSrc.size<1){let u=document.getElementById(`annotation_tool_btn_img_${d}`);return u&&u instanceof HTMLImageElement&&u.src?u.src:null}return this.imageSrc.get(d)}setTypeImage(d){for(const u in d)this.imageSrc.set(u,d[u])}destroyAnnotationById(d){this.annotationsPlugin.destroyAnnotation(d),this._AnnotationList.forEach((u,l)=>{u.id===d&&this._AnnotationList.splice(l,1)})}getAnnotationById(d){return this.annotationsPlugin.annotations[d]}get annotationPluginList(){return this.annotationsPlugin.annotations}destroy(){var d;this.fire("destroy",!0),this.clear(),this.annotationsPlugin.destroy(),this.annotationWrapper&&((d=this.annotationWrapper.parentNode)===null||d===void 0||d.removeChild(this.annotationWrapper))}}},"./src/toolbar/BCFTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>d});var x=a("./src/Controller.ts"),S=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),A=a("./node_modules/@parametricos/bcf-js/dist/index.js"),h=function(u,l,c,f){function p(m){return m instanceof c?m:new c(function(v){v(m)})}return new(c||(c=Promise))(function(m,v){function _(C){try{w(f.next(C))}catch(k){v(k)}}function b(C){try{w(f.throw(C))}catch(k){v(k)}}function w(C){C.done?m(C.value):p(C.value).then(_,b)}w((f=f.apply(u,l||[])).next())})};class d extends x.default{constructor(l,c){super(l,c),this._enableAnno=!1,this._imagePath="",this.eventTrigger=l.eventTrigger,this.bCFViewpointsPlugin=new S.BCFViewpointsPlugin(l.viewer,{originatingSystem:"tctwins.com",authoringTool:"tctwins.com"}),this.bcfAnnoWrapper=document.createElement("div"),this.bcfAnnoWrapper.id="bcfAnnoWrapper";const{canvas:f}=l.viewer.scene.canvas;f.parentNode.insertBefore(this.bcfAnnoWrapper,f),this.bcfAnnoPlugin=new S.AnnotationsPlugin(this.viewer,{markerHTML:"<div class='bcf-anno {{iconType}}' id='{{id}}'entityid='{{entityid}}' style='position:absolute;'><img src='{{iconPath}}'></div>",container:this.bcfAnnoWrapper,values:{id:"",entityid:"",iconPath:"",iconType:""}}),l.viewer.scene.input.on("mouseclicked",p=>{if(!this._enableAnno||!this._active)return;const m=l.viewer.scene.pick({canvasPos:p,pickSurface:!0}),v=m.entity.id;if(m){const _=this.addBCFAnno(v,p,"text");this.eventTrigger.emit("bcfNewAnno",_)}}),this.on("active",p=>{l.disableClickEvent=p})}readBCF(l){return h(this,void 0,void 0,function*(){const c=new A.BcfReader;return yield c.read(l),c.project})}createBCF(l){return h(this,void 0,void 0,function*(){const c=new A.BcfReader;let f=[];const p=l.markups;p&&p.forEach(b=>{let w=[],C=[];b.viewPoints&&b.viewPoints.forEach((U,G)=>{var j;if(U.bcfView){let H=this.bCFViewpointsPlugin.getUUID(),W={index:G,guid:H,snapshot:U.bcfView.snapshot?`${H}_snapshot.png`:void 0,viewpoint:`${H}_viewpoint.bcfv`},K={guid:H,components:U.bcfView.components,perspective_camera:U.bcfView.perspective_camera,orthogonal_camera:U.bcfView.orthogonal_camera,snapshot:(j=U.bcfView.snapshot)===null||j===void 0?void 0:j.snapshot_data};w.push(W),C.push(K)}});let k=[];b.comments&&b.comments.forEach((U,G)=>{let H={guid:this.bCFViewpointsPlugin.getUUID(),date:U.date,author:U.author,comment:U.comment,viewpoint:U.viewPoint,modified_date:U.modified_date?U.modified_date:U.date,modified_author:U.modified_author?U.modified_author:U.author};k.push(H)});const R={topic:{guid:this.bCFViewpointsPlugin.getUUID(),title:b.title,priority:b.priority,topic_type:b.type,topic_status:b.status?b.status:"Active",due_date:b.dueDate,creation_date:b.createDate?b.createDate:new Date().toISOString(),creation_author:b.author,assigned_to:b.assignedTo,index:b.index?b.index:1,viewpoints:w,comments:k},viewpoints:C};f.push(R)});const m={project_id:l.id?l.id:"",name:l.name?l.name:"",version:l.version?l.version:2.1,reader:c,markups:f,extension_schema:void 0};return yield new A.BcfWriter().write(m)})}saveBcf(l){return h(this,void 0,void 0,function*(){return console.log(l),yield new A.BcfWriter().write(l)})}getBCFView(){return this.bCFViewpointsPlugin.getViewpoint()}getSnapshot(l){for(var c=l.replace(/^data:image\/(png|jpeg);base64,/,""),f=atob(c),p=f.length,m=new Uint8Array(p),v=0;v<p;v++)m[v]=f.charCodeAt(v);var _=new Blob([m],{type:"image/png"});return _}set enableAnno(l){this._enableAnno=l}get enableAnno(){return this._enableAnno}set imagePath(l){this._imagePath=l}get imagePath(){return this._imagePath}addBCFAnno(l,c,f){this.bcfAnnoPlugin.createAnnotation({id:l,worldPos:c,occludable:!0,markerShown:!0,labelShown:!0,values:{id:l,entityid:l,iconPath:this._imagePath,iconType:f}})}getNewGuid(){return this.bCFViewpointsPlugin.getUUID()}}},"./src/toolbar/CommentsTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/decimal.js/decimal.mjs"),S=a("./src/Controller.ts");class A extends S.default{constructor(l,c){super(l,c),this._commentsList={},this.eventTrigger=l.eventTrigger,this._commentsList={},this._currentMode="path",this._Pathcolor="#066CFC",this._Ellipsecolor="#066CFC",this._Rectcolor="#066CFC",this._Arrowcolor="#066CFC",this._Textcolor="#066CFC",this._PathstrokeWidth="2",this._EllipsestrokeWidth="2",this._RectstrokeWidth="2",this._ArrowstrokeWidth="2",this._TextstrokeWidth="1",this._offsetX=0,this._offsetY=0,this._FontSize="18",this._stratchPos="",this.isCreating=!1,this.isDrawing=!1,this.isMoving=!1,this.isChosed=!1,this.isHolding=!1,this.isStretch=!1,this.isHovering=!1,this.isDuplicate=!1,this.isTyping=!1,this._isTouch=!1,this._revocationMechanism=null,this.on("active",f=>{f?this.saveSVG():this.endCommentsTool()}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.initEventListeners()}saveSVG(){const l=document.getElementById("myCanvas");let c=l.clientWidth,f=l.clientHeight;const p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("width",c.toString()),p.setAttribute("height",f.toString());const m=document.createElementNS("http://www.w3.org/2000/svg","image");m.setAttribute("x","0"),m.setAttribute("y","0"),m.setAttribute("width",c.toString()),m.setAttribute("height",f.toString()),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l.toDataURL()),p.appendChild(m),p.setAttribute("id","svgImage");const v=document.getElementById("comments_panel");v&&(v.innerHTML=""),v==null||v.appendChild(p),this.checkSelectionBox(),this._revocationMechanism=new h(this.eventTrigger),this.eventTrigger.emit("saveImage")}initEventListeners(){let l,c,f,p,m;const v=(_,b,w,C)=>{const k=[_-b,w-C],T=this.getInitVector(k[0],k[1]),R=this.getVerticalUnitVector(k[0],k[1]),U=.5,G=(b-2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),j=(C-2*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),H=(_-2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),W=(w-2*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),K=(_-7*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),$=(w-7*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),O=(_+12*Number(this._ArrowstrokeWidth)*U*T[0]).toString(),L=(w+12*Number(this._ArrowstrokeWidth)*U*T[1]).toString(),M=(_+7*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),I=(w+7*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),F=(_+2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),V=(w+2*Number(this._ArrowstrokeWidth)*U*R[1]).toString(),D=(b+2*Number(this._ArrowstrokeWidth)*U*R[0]).toString(),X=(C+2*Number(this._ArrowstrokeWidth)*U*R[1]).toString();return`M ${b},${C}L ${G},${j}L ${H},${W}L ${K},${$}L ${O},${L}L ${M},${I}L ${F},${V}L ${D},${X}L${b},${C}`};this.eventTrigger.on("saveImage",()=>{const _=document.getElementById("svgImage"),b=H=>{const{target:W}=H;if(W.tagName==="text"){this.hiddenAllInput();const K=W.parentNode,$=K.querySelector("foreignObject"),O=$.querySelector("input"),{textContent:L}=K;if(O)O.style.display="inline",W.textContent="";else{const M=document.createElement("input");M.setAttribute("type","text"),M.setAttribute("class","commentInputBox"),L!=""&&M.setAttribute("placeholder",L),$.appendChild(M)}this.isTyping=!0}},w=H=>{if(this._isTouch)return;const{target:W}=H;if(W.tagName==="ellipse"||W.tagName==="path"||W.tagName==="rect"||W.tagName==="text"){if(W.id!="selectionBox")if(W.getAttribute("type")=="handle"){l=H.clientX+this._offsetX,c=H.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.isStretch=!0;const{id:K}=H.target;this._stratchPos=K,this.hiddenAllInput()}else this.chosedTarget!=W&&(this.isDuplicate=!1,this.chosedTarget=W),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,l=H.clientX+this._offsetX,c=H.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.autoSaveInput(),this.setCurrentMode(""),this.eventTrigger.emit("choseTarget")}else if(W.classList.contains("commentInputBox"))this.isTyping=!0;else{if(this.isChosed&&H.target!=="circle"&&(this.showHiddenSelectedBox(!1),this.isChosed=!1,this.chosedTarget=null,this.eventTrigger.emit("choseNothing")),this.isTyping&&this.autoSaveInput(),this._currentMode=="")return;if(!this.isCreating){this.showHiddenSelectedBox(!1),this.isCreating=!0,l=H.clientX+this._offsetX,c=H.clientY+this._offsetY;const K=document.createElementNS("http://www.w3.org/2000/svg","g");K.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let $;switch(this._currentMode){case"path":$=document.createElementNS("http://www.w3.org/2000/svg","path"),$.setAttribute("d",`M ${l},${c}`),$.setAttribute("stroke",this._Pathcolor),$.setAttribute("stroke-width",this._PathstrokeWidth),$.setAttribute("fill","transparent"),K.setAttribute("type","path");break;case"ellipse":$=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),$.setAttribute("cx",l.toString()),$.setAttribute("cy",c.toString()),$.setAttribute("rx","0"),$.setAttribute("ry","0"),$.setAttribute("stroke",this._Ellipsecolor),$.setAttribute("stroke-width",this._EllipsestrokeWidth),$.setAttribute("fill","transparent"),K.setAttribute("type","ellipse");break;case"rect":$=document.createElementNS("http://www.w3.org/2000/svg","rect"),$.setAttribute("x",l.toString()),$.setAttribute("y",c.toString()),$.setAttribute("stroke",this._Rectcolor),$.setAttribute("stroke-width",this._RectstrokeWidth),$.setAttribute("fill","transparent"),K.setAttribute("type","rect");break;case"arrow":$=document.createElementNS("http://www.w3.org/2000/svg","path"),$.setAttribute("d",`M ${l},${c}`),$.setAttribute("stroke-width","20"),$.setAttribute("stroke","transparent"),$.setAttribute("fill",this._Arrowcolor),K.setAttribute("type","arrow");break;case"text":if(this.isTyping)this.autoSaveInput();else if(!this.isChosed){const O=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");let L=0;this._FontSize=="16"?(O.setAttribute("width","120"),O.setAttribute("height","26"),L=28):this._FontSize=="18"?(O.setAttribute("width","140"),O.setAttribute("height","28"),L=30):Number(this._FontSize)<=14&&(O.setAttribute("width","100"),O.setAttribute("height",(Number(this._FontSize)+10).toString()),L=Number(this._FontSize)+10),O.setAttribute("x",l),O.setAttribute("y",c);const M=document.createElement("input");M.setAttribute("type","text"),M.setAttribute("class","commentInputBox"),M.setAttribute("placeholder","输入内容...");const I=document.createElementNS("http://www.w3.org/2000/svg","text");I.setAttribute("x",l+3),I.setAttribute("y",(c+L-Number(this._FontSize)/2).toString()),I.setAttribute("font-size",this._FontSize),I.setAttribute("stroke",this._Textcolor),I.setAttribute("stroke-width",this._TextstrokeWidth),I.setAttribute("fill",this._Textcolor),I.setAttribute("lengthAdjust","spacingAndGlyphs"),O.appendChild(M),K.setAttribute("type","text"),K.appendChild(O),K.appendChild(I),_==null||_.insertBefore(K,_==null?void 0:_.lastElementChild),M.click(),this.isTyping=!0,this.eventTrigger.emit("createNew")}break}this._currentMode!="text"&&this._currentMode!=""&&(K.appendChild($),_==null||_.insertBefore(K,_==null?void 0:_.lastElementChild)),this.isChosed=!1}}},C=H=>{var W,K,$,O,L,M,I,F,V,D,X,ee,q,ne,oe,he,te,de,se,re,ae,Ce,me,ce,pe,B,ke,Ee,ge,Ae,fe,ue;if(this._isTouch)return;const _e=H.clientX+this._offsetX,be=H.clientY+this._offsetY;let De;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":De=document.querySelectorAll("g");const Ke=[];De.forEach(rr=>{rr.getAttribute("type")=="path"&&Ke.push(rr)});const yt=Ke[Ke.length-1].querySelector("path");let Ne=yt.getAttribute("d");Ne&&(Ne+=`L ${_e},${be}`,yt.setAttribute("d",Ne));break;case"ellipse":var Je=document.querySelectorAll("ellipse"),Qe=Je[Je.length-1];if(Qe){var ot=Math.abs(_e-l)/2,ct=Math.abs(be-c)/2;Qe.setAttribute("cx",((_e+l)/2).toString()),Qe.setAttribute("cy",((be+c)/2).toString()),Qe.setAttribute("rx",ot.toString()),Qe.setAttribute("ry",ct.toString())}break;case"rect":const tt=document.querySelectorAll("g"),Pt=[];tt.forEach(rr=>{rr.getAttribute("type")=="rect"&&Pt.push(rr.childNodes[0])});const Rt=Pt[Pt.length-1],Ht=Rt.getAttribute("x"),zt=Rt.getAttribute("y");if(Ht&&zt){const rr=Math.abs(parseInt(Ht)-_e),_r=Math.abs(parseInt(zt)-be);Rt.setAttribute("width",rr.toString()),Rt.setAttribute("height",_r.toString()),Rt.setAttribute("rx","9"),Rt.setAttribute("ry","9"),Rt.setAttribute("type","comment")}break;case"arrow":De=document.querySelectorAll("g");const tr=[];De.forEach(rr=>{rr.getAttribute("type")=="arrow"&&tr.push(rr)});const er=tr[tr.length-1].querySelector("path");if(er.getAttribute("d")){const rr=v(_e,l,be,c);er.setAttribute("d",rr)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(_e-l)>=1||Math.abs(be-c)>=1)&&(this.isMoving=!0);const Ke=(W=this.chosedTarget)===null||W===void 0?void 0:W.getBBox();switch(this.chosedTarget.tagName){case"path":const yt=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,Rt=>{const[Ht,zt]=Rt.split(",").map(parseFloat),tr=Number(Ht)+Number(_e)-Number(Ke.x)-(Number(l)-Number(f)),qt=Number(zt)+Number(be)-Number(Ke.y)-(Number(c)-Number(p));return`${tr.toString()},${qt.toString()}`});($=this.chosedTarget)===null||$===void 0||$.setAttribute("d",yt);break;case"ellipse":var ht=Number((O=this.chosedTarget)===null||O===void 0?void 0:O.getAttribute("cx")),it=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("cy"));const Ne=Number((M=this.chosedTarget)===null||M===void 0?void 0:M.getAttribute("rx")),tt=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("ry"));(F=this.chosedTarget)===null||F===void 0||F.setAttribute("cx",_e-(l-f)/2+Ne),(V=this.chosedTarget)===null||V===void 0||V.setAttribute("cy",be-(c-p)/2+tt);break;case"rect":(D=this.chosedTarget)===null||D===void 0||D.setAttribute("x",_e-(l-f)),(X=this.chosedTarget)===null||X===void 0||X.setAttribute("y",be-(c-p));break;case"text":(ee=this.chosedTarget)===null||ee===void 0||ee.setAttribute("x",(_e-(l-f)).toString()),(q=this.chosedTarget)===null||q===void 0||q.setAttribute("y",(be-(c-p)+Ke.height*3/4).toString());var Ze=this.chosedTarget.getAttribute("font-size");const Pt=this.chosedTarget.parentNode;if(Pt){const Rt=Pt.querySelector("foreignObject");Rt&&(Rt.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),Rt.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(Ze)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const ut=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let yt,Ne,tt,Pt,Rt;m=(oe=this.chosedTarget)===null||oe===void 0?void 0:oe.getBBox(),this._stratchPos.indexOf("right")!==-1&&m.width+_e-l<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&m.width-(_e-l)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&m.height-(be-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&m.height+(be-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top")),yt=ut.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,er=>{const[Dt,rr]=er.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(Pt=new x.default(_e-l).mul(new x.default(Dt-m.x).div(m.width))),this._stratchPos.indexOf("left")!==-1&&(Pt=new x.default(_e-l).mul(new x.default(m.x+m.width-Dt).div(m.width))),(Number.isNaN(Pt)||!Pt)&&(Pt=new x.default(0)),Ne=new x.default(Dt).add(Pt)):Ne=new x.default(Dt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(Rt=new x.default(be-c).mul(new x.default(m.y+m.height-rr).div(m.height))),this._stratchPos.indexOf("bottom")!==-1&&(Rt=new x.default(be-c).mul(new x.default(rr-m.y).div(m.height))),(Number.isNaN(Rt)||!Rt)&&(Rt=new x.default(0)),tt=new x.default(rr).add(Rt)):tt=new x.default(rr),`${Ne.toFixed(16)},${tt.toFixed(16)}`}),(he=this.chosedTarget)===null||he===void 0||he.setAttribute("d",yt);break;case"ellipse":var ht=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("cx")),it=Number((de=this.chosedTarget)===null||de===void 0?void 0:de.getAttribute("cy")),ot=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("rx")),ct=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(ht+=(_e-l)*.5,ot-=(_e-l)*.5):this._stratchPos.indexOf("right")!==-1&&(ht+=(_e-l)*.5,ot+=(_e-l)*.5),this._stratchPos.indexOf("top")!==-1?(it+=(be-c)*.5,ct-=(be-c)*.5):this._stratchPos.indexOf("bottom")!==-1&&(it+=(be-c)*.5,ct+=(be-c)*.5),ot<0?this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left"):((ae=this.chosedTarget)===null||ae===void 0||ae.setAttribute("cx",ht.toString()),(Ce=this.chosedTarget)===null||Ce===void 0||Ce.setAttribute("rx",ot.toString())),ct<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top"):((me=this.chosedTarget)===null||me===void 0||me.setAttribute("cy",it.toString()),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("ry",ct.toString()));break;case"rect":var Xe=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),dt=Number((B=this.chosedTarget)===null||B===void 0?void 0:B.getAttribute("y")),at=Number((ke=this.chosedTarget)===null||ke===void 0?void 0:ke.getAttribute("width")),ze=Number((Ee=this.chosedTarget)===null||Ee===void 0?void 0:Ee.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(Xe+=_e-l,at-=_e-l):this._stratchPos.indexOf("right")!==-1&&(at+=_e-l),at<0?this._stratchPos=this._stratchPos.replace(/left|right/g,er=>er==="left"?"right":"left"):((ge=this.chosedTarget)===null||ge===void 0||ge.setAttribute("x",Xe.toString()),(Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("width",at.toString())),this._stratchPos.indexOf("top")!==-1?(dt+=be-c,ze-=be-c):this._stratchPos.indexOf("bottom")!==-1&&(ze+=be-c),ze<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,er=>er==="top"?"bottom":"top"):((fe=this.chosedTarget)===null||fe===void 0||fe.setAttribute("y",dt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("height",ze.toString()));break}this.updateSelectionBox(),l=H.clientX+this._offsetX,c=H.clientY+this._offsetY}},k=()=>{if(!this._isTouch)if(this.isHolding&&(this.isMoving&&(this.isMoving=!1,this.AddNewState(()=>{})),this.isHolding=!1),this.isCreating){if(this.isDrawing)this.isDrawing=!1,this.eventTrigger.emit("createNew"),this.AddNewState(()=>{});else if(!this.isChosed&&!this.isStretch&&this._currentMode!="text"&&this._currentMode!=""){const H=_==null?void 0:_.lastElementChild;if(H){const W=H.previousElementSibling;_==null||_.removeChild(W)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))},T=H=>{(H.key==="Delete"||H.keyCode===8)&&this.deleteCurrentComments(),H.ctrlKey&&(H.key==="c"||H.key==="C")&&this.isChosed&&(this.isDuplicate=!0),H.ctrlKey&&(H.key==="v"||H.key==="V")&&this.isDuplicate&&this.duplicateComment(),(H.ctrlKey&&H.key==="z"||H.key==="Z")&&this.UnDo(()=>{}),(H.ctrlKey&&H.key==="y"||H.key==="Y")&&this.ReDo(()=>{}),H.key==="Enter"&&this.autoSaveInput()},R=H=>{if(!this._isTouch)return;const W=H.touches[0],{target:K}=W;if(K.tagName==="ellipse"||K.tagName==="path"||K.tagName==="rect"||K.tagName==="arrow"||K.tagName==="text")if(K.getAttribute("type")=="handle"){l=W.clientX+this._offsetX,c=W.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.isStretch=!0;const{id:$}=W.target;this._stratchPos=$}else this.chosedTarget!=K&&(this.isDuplicate=!1,this.chosedTarget=K),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,l=W.clientX+this._offsetX,c=W.clientY+this._offsetY,f=this.chosedTarget.getBBox().x,p=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.setCurrentMode(""),this.eventTrigger.emit("choseTarget");else if(K.classList.contains("commentInputBox"))this.isTyping=!0;else{if(this.isChosed&&W.target!=="circle"&&(this.showHiddenSelectedBox(!1),this.isChosed=!1,this.chosedTarget=null,this.eventTrigger.emit("choseNothing")),this._currentMode=="")return;if(!this.isCreating){this.showHiddenSelectedBox(!1),this.isCreating=!0,l=W.clientX+this._offsetX,c=W.clientY+this._offsetY;const $=document.createElementNS("http://www.w3.org/2000/svg","g");$.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let O;switch(this._currentMode){case"path":O=document.createElementNS("http://www.w3.org/2000/svg","path"),O.setAttribute("d",`M ${l},${c}`),O.setAttribute("stroke",this._Pathcolor),O.setAttribute("stroke-width",this._PathstrokeWidth),O.setAttribute("fill","transparent"),$.setAttribute("type","path");break;case"ellipse":O=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),O.setAttribute("cx",l.toString()),O.setAttribute("cy",c.toString()),O.setAttribute("rx","0"),O.setAttribute("ry","0"),O.setAttribute("stroke",this._Ellipsecolor),O.setAttribute("stroke-width",this._EllipsestrokeWidth),O.setAttribute("fill","transparent"),$.setAttribute("type","ellipse");break;case"rect":O=document.createElementNS("http://www.w3.org/2000/svg","rect"),O.setAttribute("x",l.toString()),O.setAttribute("y",c.toString()),O.setAttribute("stroke",this._Rectcolor),O.setAttribute("stroke-width",this._RectstrokeWidth),O.setAttribute("fill","transparent"),$.setAttribute("type","rect");break;case"arrow":O=document.createElementNS("http://www.w3.org/2000/svg","path"),O.setAttribute("d",`M ${l},${c}`),O.setAttribute("stroke-width","20"),O.setAttribute("stroke","transparent"),O.setAttribute("fill",this._Arrowcolor),$.setAttribute("type","arrow");break;case"text":this.eventTrigger.emit("clickCreateText",W);break}this._currentMode!="text"&&this._currentMode!=""&&($.appendChild(O),_==null||_.insertBefore($,_==null?void 0:_.lastElementChild)),this.isChosed=!1}}},U=H=>{var W,K,$,O,L,M,I,F,V,D,X,ee,q,ne,oe,he,te,de,se,re,ae,Ce,me,ce,pe,B,ke,Ee,ge,Ae,fe,ue;if(!this._isTouch)return;const _e=H.touches[0],be=_e.clientX+this._offsetX,De=_e.clientY+this._offsetY;let Je;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":Je=document.querySelectorAll("g");const Pt=[];Je.forEach(rr=>{rr.getAttribute("type")=="path"&&Pt.push(rr)});const Ht=Pt[Pt.length-1].querySelector("path");let zt=Ht.getAttribute("d");zt&&(zt+=`L ${be},${De}`,Ht.setAttribute("d",zt));break;case"ellipse":var Qe=document.querySelectorAll("ellipse"),ot=Qe[Qe.length-1];if(ot){var ct=Math.abs(be-l)/2,ht=Math.abs(De-c)/2;ot.setAttribute("cx",((be+l)/2).toString()),ot.setAttribute("cy",((De+c)/2).toString()),ot.setAttribute("rx",ct.toString()),ot.setAttribute("ry",ht.toString())}break;case"rect":var it=document.querySelectorAll("rect"),Ze=it[it.length-10],Xe=Ze.getAttribute("x"),dt=Ze.getAttribute("y");if(Xe&&dt){var at=Math.abs(parseInt(Xe)-be),ze=Math.abs(parseInt(dt)-De);Ze.setAttribute("width",at.toString()),Ze.setAttribute("height",ze.toString()),Ze.setAttribute("rx","9"),Ze.setAttribute("ry","9"),Ze.setAttribute("type","comment")}break;case"arrow":Je=document.querySelectorAll("g");const tr=[];Je.forEach(rr=>{rr.getAttribute("type")=="arrow"&&tr.push(rr)});const er=tr[tr.length-1].querySelector("path");if(er.getAttribute("d")){const rr=v(be,l,De,c);er.setAttribute("d",rr)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(be-l)>=1||Math.abs(De-c)>=1)&&(this.isMoving=!0);const Pt=(W=this.chosedTarget)===null||W===void 0?void 0:W.getBBox();switch(this.chosedTarget.tagName){case"path":const Ht=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,er=>{const[Dt,rr]=er.split(",").map(parseFloat),_r=Number(Dt)+Number(be)-Number(Pt.x)-(Number(l)-Number(f)),pr=Number(rr)+Number(De)-Number(Pt.y)-(Number(c)-Number(p));return`${_r.toString()},${pr.toString()}`});($=this.chosedTarget)===null||$===void 0||$.setAttribute("d",Ht);break;case"ellipse":var Ke=Number((O=this.chosedTarget)===null||O===void 0?void 0:O.getAttribute("cx")),ut=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("cy"));const zt=Number((M=this.chosedTarget)===null||M===void 0?void 0:M.getAttribute("rx")),tr=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("ry"));(F=this.chosedTarget)===null||F===void 0||F.setAttribute("cx",be-(l-f)/2+zt),(V=this.chosedTarget)===null||V===void 0||V.setAttribute("cy",De-(c-p)/2+tr);break;case"rect":(D=this.chosedTarget)===null||D===void 0||D.setAttribute("x",be-(l-f)),(X=this.chosedTarget)===null||X===void 0||X.setAttribute("y",De-(c-p));break;case"text":(ee=this.chosedTarget)===null||ee===void 0||ee.setAttribute("x",(be-(l-f)).toString()),(q=this.chosedTarget)===null||q===void 0||q.setAttribute("y",(De-(c-p)+Pt.height*3/4).toString());var yt=this.chosedTarget.getAttribute("font-size");const qt=this.chosedTarget.parentNode;if(qt){const er=qt.querySelector("foreignObject");er&&(er.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),er.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(yt)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const Rt=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let Ht,zt,tr,qt,er;m=(oe=this.chosedTarget)===null||oe===void 0?void 0:oe.getBBox(),this._stratchPos.indexOf("right")!==-1&&m.width+be-l<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&m.width-(be-l)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&m.height-(De-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&m.height+(De-c)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top")),Ht=Rt.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,Et=>{const[Lt,Kt]=Et.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(qt=new x.default(be-l).mul(new x.default(Lt-m.x).div(m.width))),this._stratchPos.indexOf("left")!==-1&&(qt=new x.default(be-l).mul(new x.default(m.x+m.width-Lt).div(m.width))),(Number.isNaN(qt)||!qt)&&(qt=new x.default(0)),zt=new x.default(Lt).add(qt)):zt=new x.default(Lt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(er=new x.default(De-c).mul(new x.default(m.y+m.height-Kt).div(m.height))),this._stratchPos.indexOf("bottom")!==-1&&(er=new x.default(De-c).mul(new x.default(Kt-m.y).div(m.height))),(Number.isNaN(er)||!er)&&(er=new x.default(0)),tr=new x.default(Kt).add(er)):tr=new x.default(Kt),`${zt.toFixed(16)},${tr.toFixed(16)}`}),(he=this.chosedTarget)===null||he===void 0||he.setAttribute("d",Ht);break;case"ellipse":var Ke=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("cx")),ut=Number((de=this.chosedTarget)===null||de===void 0?void 0:de.getAttribute("cy")),ct=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("rx")),ht=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(Ke+=(be-l)*.5,ct-=(be-l)*.5):this._stratchPos.indexOf("right")!==-1&&(Ke+=(be-l)*.5,ct+=(be-l)*.5),this._stratchPos.indexOf("top")!==-1?(ut+=(De-c)*.5,ht-=(De-c)*.5):this._stratchPos.indexOf("bottom")!==-1&&(ut+=(De-c)*.5,ht+=(De-c)*.5),ct<0?this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left"):((ae=this.chosedTarget)===null||ae===void 0||ae.setAttribute("cx",Ke.toString()),(Ce=this.chosedTarget)===null||Ce===void 0||Ce.setAttribute("rx",ct.toString())),ht<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top"):((me=this.chosedTarget)===null||me===void 0||me.setAttribute("cy",ut.toString()),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("ry",ht.toString()));break;case"rect":var Ne=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),tt=Number((B=this.chosedTarget)===null||B===void 0?void 0:B.getAttribute("y")),at=Number((ke=this.chosedTarget)===null||ke===void 0?void 0:ke.getAttribute("width")),ze=Number((Ee=this.chosedTarget)===null||Ee===void 0?void 0:Ee.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(Ne+=be-l,at-=be-l):this._stratchPos.indexOf("right")!==-1&&(at+=be-l),at<0?this._stratchPos=this._stratchPos.replace(/left|right/g,Et=>Et==="left"?"right":"left"):((ge=this.chosedTarget)===null||ge===void 0||ge.setAttribute("x",Ne.toString()),(Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("width",at.toString())),this._stratchPos.indexOf("top")!==-1?(tt+=De-c,ze-=De-c):this._stratchPos.indexOf("bottom")!==-1&&(ze+=De-c),ze<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,Et=>Et==="top"?"bottom":"top"):((fe=this.chosedTarget)===null||fe===void 0||fe.setAttribute("y",tt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("height",ze.toString()));break}this.updateSelectionBox(),l=_e.clientX+this._offsetX,c=_e.clientY+this._offsetY}},G=H=>{if(this._isTouch)if(this.isHolding&&(this.isMoving&&(this.isMoving=!1,this.AddNewState(()=>{})),this.isHolding=!1),this.isCreating){if(this.isDrawing)this.isDrawing=!1,this.eventTrigger.emit("createNew"),this.AddNewState(()=>{});else if(!this.isChosed&&!this.isStretch&&this._currentMode!="text"&&this._currentMode!=""){const W=_==null?void 0:_.lastElementChild;if(W){const K=W.previousElementSibling;_==null||_.removeChild(K)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))};_?(document.addEventListener("keydown",T.bind(this)),_.addEventListener("dblclick",b.bind(this)),_.addEventListener("mousedown",w.bind(this)),document.addEventListener("mousemove",C.bind(this)),_.addEventListener("mouseup",k.bind(this)),_.addEventListener("touchstart",R.bind(this)),document.addEventListener("touchmove",U.bind(this)),_.addEventListener("touchend",G.bind(this))):this.log("no svgImage");const j=()=>{const H=document.getElementById("svgImage");H?(document.removeEventListener("keydown",T.bind(this)),H.removeEventListener("dblclick",b.bind(this)),H.removeEventListener("mousedown",w.bind(this)),document.removeEventListener("mousemove",C.bind(this)),H.removeEventListener("mouseup",k.bind(this)),H.removeEventListener("touchstart",R.bind(this)),document.removeEventListener("touchmove",U.bind(this)),H.removeEventListener("touchend",G.bind(this))):this.log("no svgImage");const W=document.getElementById("comments_panel");W&&(W.innerHTML=""),this.eventTrigger.off("clearAll",j)};this.eventTrigger.on("clearAll",j)})}clickCreateText(l,c){var f,p;let m;l.touches?m=l.touches[0]:m=l,this.showHiddenSelectedBox(!1);const v=m.clientX+this._offsetX,_=m.clientY+this._offsetY,b=document.createElementNS("http://www.w3.org/2000/svg","g");if(b.setAttribute("id",`${this._currentMode}_${this.getTime()}`),!this.isTyping&&!this.isChosed){const w=document.createElementNS("http://www.w3.org/2000/svg","text");w.setAttribute("x",v+3),w.setAttribute("y",(_+24-Number(this._FontSize)/2).toString()),w.setAttribute("font-size",this._FontSize),w.setAttribute("stroke",this._Textcolor),w.setAttribute("stroke-width",this._TextstrokeWidth),w.setAttribute("fill",this._Textcolor),w.setAttribute("lengthAdjust","spacingAndGlyphs"),w.textContent=c,b.setAttribute("type","text"),b.appendChild(w);const C=document.getElementById("selectionBox_g");C&&((f=C.parentNode)===null||f===void 0||f.insertBefore(b,(p=C.parentNode)===null||p===void 0?void 0:p.lastElementChild)),this.isTyping=!0,this.AddNewState(()=>{this.eventTrigger.emit("createNew")})}}getInitVector(l,c){const f=Math.sqrt(l*l+c*c);return f==0?[0,0]:[l/f,c/f]}getVerticalUnitVector(l,c){if(Math.sqrt(l*l+c*c)===0)return[0,0];const p=-c,m=l,v=Math.sqrt(p*p+m*m),_=p/v,b=m/v;return[_,b]}getTwoPointLength(l,c){return l==c?0:Math.sqrt(l*l+c*c)}hiddenAllInput(){const l=document.querySelectorAll("foreignObject");l.length>0&&l.forEach(c=>{const f=c.querySelector("input"),p=c.parentNode;let m;p&&(m=p.querySelector("text")),m&&f&&(f.value!=""?m.textContent=f.value:m.textContent="双击此处输入内容",f.style.display="none")})}showHiddenSelectedBox(l){if(l){const f=this.chosedTarget.getBBox();this.selectionBox.setAttribute("x",f.x),this.selectionBox.setAttribute("y",f.y),this.selectionBox.setAttribute("width",f.width),this.selectionBox.setAttribute("height",f.height),this.selectionBox.style.display="inline";for(var c=0;c<8;c++)this.handles[c].style.display="inline"}else{this.selectionBox.style.display="none";for(var c=0;c<8;c++)this.handles[c].style.display="none"}this.updateSelectionBox()}updateSelectionBox(){var l;const c=(l=this.chosedTarget)===null||l===void 0?void 0:l.getBBox();if(c){this.selectionBox.setAttribute("x",c.x-4),this.selectionBox.setAttribute("y",c.y-4),this.selectionBox.setAttribute("width",c.width+8),this.selectionBox.setAttribute("height",c.height+8);const f=this.selectionBox.getBBox();for(let p=0;p<8;p++){const m=this.handles[p];switch(p){case 0:m.setAttribute("x",f.x-4),m.setAttribute("y",f.y-4);break;case 1:m.setAttribute("x",f.x+f.width/2-4),m.setAttribute("y",f.y-4);break;case 2:m.setAttribute("x",f.x+f.width-4),m.setAttribute("y",f.y-4);break;case 3:m.setAttribute("x",f.x+f.width-4),m.setAttribute("y",f.y+f.height/2-4);break;case 4:m.setAttribute("x",f.x+f.width-4),m.setAttribute("y",f.y+f.height-4);break;case 5:m.setAttribute("x",f.x+f.width/2-4),m.setAttribute("y",f.y+f.height-4);break;case 6:m.setAttribute("x",f.x-4),m.setAttribute("y",f.y+f.height-4);break;case 7:m.setAttribute("x",f.x-4),m.setAttribute("y",f.y+f.height/2-4);break}}}}publishComments(){this.deleteSvgCommentsListeners()}updateCommentsColor(){document.querySelectorAll("path").forEach(p=>{p.setAttribute("stroke","red")}),document.querySelectorAll("ellipse").forEach(p=>{p.setAttribute("stroke","blue")}),document.querySelectorAll("rect").forEach(p=>{p.id!="selectionBox"&&p.setAttribute("stroke","green")})}deleteSvgCommentsListeners(){const l=document.getElementById("svgImage");l&&(l.removeEventListener("mousedown",()=>{}),document.removeEventListener("mousemove",()=>{}),l.removeEventListener("mouseup",()=>{}),l.removeEventListener("mouseover",()=>{}))}deleteCurrentComments(){if(this.isChosed){const l=document.getElementById("svgImage");l==null||l.removeChild(this.chosedTarget.parentNode),this.showHiddenSelectedBox(!1)}this.AddNewState(()=>{})}getTime(){const l=new Date,c=l.getFullYear(),f=l.getMonth()+1<10?`0${l.getMonth()+1}`:l.getMonth()+1,p=l.getDate()<10?`0${l.getDate()}`:l.getDate(),m=l.getHours()<10?`0${l.getHours()}`:l.getHours(),v=l.getMinutes()<10?`0${l.getMinutes()}`:l.getMinutes(),_=l.getSeconds()<10?`0${l.getSeconds()}`:l.getSeconds();return c+f+p+m+v+_}duplicateComment(){var l,c,f,p,m,v,_,b,w,C,k,T,R,U;if(this.isChosed){const j=document.getElementById("svgImage"),H=this.chosedTarget.parentNode.cloneNode(!0);switch(j==null||j.insertBefore(H,j==null?void 0:j.lastElementChild),this.chosedTarget=H.firstChild,this.chosedTarget.tagName){case"path":const K=((l=this.chosedTarget)===null||l===void 0?void 0:l.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,O=>{const[L,M]=O.split(",").map(parseFloat),I=L+20,F=M+10;return`${I},${F}`});(c=this.chosedTarget)===null||c===void 0||c.setAttribute("d",K);break;case"ellipse":(f=this.chosedTarget)===null||f===void 0||f.setAttribute("cx",(Number((p=this.chosedTarget)===null||p===void 0?void 0:p.getAttribute("cx"))+20).toString()),(m=this.chosedTarget)===null||m===void 0||m.setAttribute("cy",(Number((v=this.chosedTarget)===null||v===void 0?void 0:v.getAttribute("cy"))+10).toString());break;case"rect":(_=this.chosedTarget)===null||_===void 0||_.setAttribute("x",(Number((b=this.chosedTarget)===null||b===void 0?void 0:b.getAttribute("x"))+20).toString()),(w=this.chosedTarget)===null||w===void 0||w.setAttribute("y",(Number((C=this.chosedTarget)===null||C===void 0?void 0:C.getAttribute("y"))+10).toString());break;case"text":(k=this.chosedTarget)===null||k===void 0||k.setAttribute("x",(Number((T=this.chosedTarget)===null||T===void 0?void 0:T.getAttribute("x"))+20).toString()),(R=this.chosedTarget)===null||R===void 0||R.setAttribute("y",(Number((U=this.chosedTarget)===null||U===void 0?void 0:U.getAttribute("x"))+10).toString());var G=this.chosedTarget.getAttribute("font-size");const $=this.chosedTarget.parentNode;if($){const O=$.querySelector("foreignObject");O&&(O.setAttribute("x",(Number(this.chosedTarget.getAttribute("x"))-3+20).toString()),O.setAttribute("y",(Number(this.chosedTarget.getAttribute("y"))-(24-Number(G)/2)+10).toString()))}break}this.updateSelectionBox()}this.AddNewState(()=>{})}AddNewState(l){this.saveCurrentState(c=>{this._revocationMechanism&&this._revocationMechanism&&this._revocationMechanism.AddNewState(c,l)}),this.eventTrigger.emit("newState")}saveCurrentState(l){function c(m){const v={};for(let _=0;_<m.length;_++){const b=m[_];v[b.name]=b.value}return v}const f=document.getElementById("svgImage");if(f){const m=f.querySelectorAll("g");var p=[];m.forEach(v=>{if(v.getAttribute("id")){const b=v.attributes,w=v.children,C=new Map;let k=null;if(v.getAttribute("type")==="text"){for(let T=0;T<w.length;T++){const{tagName:R}=w[T];C.set(R,c(w[T].attributes)),R==="text"&&(k=w[T].textContent)}var _=new d(b,C,k);p.push(_)}else{for(let R=0;R<w.length;R++)C.set(w[R].tagName,c(w[R].attributes));var _=new d(b,C,null);p.push(_)}}})}l(p)}displayState(l){const c=document.getElementById("svgImage");if(c){c.querySelectorAll("g").forEach(v=>{v.getAttribute("id")&&c.removeChild(v)});for(const v in l){const _=l[v];var f=document.createElementNS("http://www.w3.org/2000/svg","g");const{attributes:b}=_;var{textContent:p}=_;for(let T=0;T<b.length;T++){const R=b[T].name,U=b[T].value;f.setAttribute(R,U)}const{childrenContents:w}=_;w.forEach((T,R)=>{const U=document.createElementNS("http://www.w3.org/2000/svg",R);if(R=="text"&&(U.textContent=p),T)for(const G in T){const j=T[G];U.setAttribute(G,j)}f.appendChild(U)}),c==null||c.insertBefore(f,c==null?void 0:c.lastElementChild);const C=c==null?void 0:c.querySelector("image");C&&(c==null||c.insertBefore(C,c==null?void 0:c.firstElementChild));const k=c==null?void 0:c.querySelector("#selectionBox_g");k&&(c==null||c.removeChild(k),c==null||c.appendChild(k))}}}autoSaveInput(l){this.isTyping&&(this.isTyping=!1,this.hiddenAllInput(),this.AddNewState(()=>{l&&l()}))}setCurrentMode(l){this.autoSaveInput(),this._currentMode=l,l===""&&this.eventTrigger.emit("cancelAllMode")}ReDo(l){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.ReDo(c=>{this.displayState(c),this.showHiddenSelectedBox(!1),l&&l()}),this.checkSelectionBox()}UnDo(l){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.UnDo(c=>{this.displayState(c),this.showHiddenSelectedBox(!1),l&&l()}),this.checkSelectionBox()}checkSelectionBox(){const l=document.getElementById("svgImage"),c=l==null?void 0:l.querySelector("#selectionBox_g");if(c){if(c.childNodes.length>2)return;l==null||l.removeChild(c)}this.selectionBox=null,this.handles=[];const f=document.createElementNS("http://www.w3.org/2000/svg","g");this.selectionBox=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.selectionBox.setAttribute("stroke","#066CFC"),this.selectionBox.setAttribute("stroke-width","1"),this.selectionBox.setAttribute("fill","none"),this.selectionBox.setAttribute("id","selectionBox"),this.selectionBox.style.display="none",f.setAttribute("id","selectionBox_g"),f.appendChild(this.selectionBox);for(let m=0;m<8;m++){const v=document.createElementNS("http://www.w3.org/2000/svg","rect");v.setAttribute("width","8"),v.setAttribute("height","8"),v.setAttribute("rx","2"),v.setAttribute("ry","2");var p;m==0&&(p="left_top",v.setAttribute("id",p)),m==1&&(p="top",v.setAttribute("id",p)),m==2&&(p="right_top",v.setAttribute("id",p)),m==3&&(p="right",v.setAttribute("id",p)),m==4&&(p="right_bottom",v.setAttribute("id",p)),m==5&&(p="bottom",v.setAttribute("id",p)),m==6&&(p="left_bottom",v.setAttribute("id",p)),m==7&&(p="left",v.setAttribute("id",p)),v.setAttribute("type","handle"),v.setAttribute("fill","white"),v.setAttribute("stroke-width","0.8"),v.setAttribute("stroke","#066CFC"),v.setAttribute("class","selection_box_handle"),v.style.cursor="pointer",v.style.display="none",f.appendChild(v),this.handles.push(v)}l==null||l.appendChild(f)}endCommentsTool(){var l;this._commentsList={},this._currentMode="path",this._Pathcolor="#066CFC",this._Ellipsecolor="#066CFC",this._Rectcolor="#066CFC",this._Arrowcolor="#066CFC",this._Textcolor="#066CFC",this._PathstrokeWidth="2",this._EllipsestrokeWidth="2",this._RectstrokeWidth="2",this._ArrowstrokeWidth="2",this._TextstrokeWidth="1",this._FontSize="16",this._stratchPos="",this.isCreating=!1,this.isDrawing=!1,this.isMoving=!1,this.isChosed=!1,this.isHolding=!1,this.isStretch=!1,this.isHovering=!1,this.isDuplicate=!1,this.isTyping=!1,this.chosedTarget=null,this.selectionBox=null,this.handles=null,this.setActive(!1),(l=this._revocationMechanism)===null||l===void 0||l.destroy(),this._revocationMechanism=null,this.eventTrigger.emit("clearAll")}saveComments(l){this.showHiddenSelectedBox(!1),this.autoSaveInput(l)}setTargetColor(l){if(this.chosedTarget.tagName=="text")this.chosedTarget.setAttribute("stroke",l),this.chosedTarget.setAttribute("fill",l);else if(this.chosedTarget.tagName=="path"){const c=this.chosedTarget.parentNode;c&&c.getAttribute("type")=="arrow"?(this.chosedTarget.setAttribute("stroke",l),this.chosedTarget.setAttribute("fill",l)):this.chosedTarget.setAttribute("stroke",l)}else this.chosedTarget.setAttribute("stroke",l);this.AddNewState(()=>{})}setTargetWidth(l){this.chosedTarget.tagName=="text"?this.chosedTarget.setAttribute("font-size",l.toString()):this.chosedTarget.setAttribute("stroke-width",l.toString()),this.AddNewState(()=>{})}set isTouch(l){this._isTouch=l}set offsetX(l){this._offsetX=l}set offsetY(l){this._offsetY=l}set pathColor(l){this._Pathcolor=l}set ellipseColor(l){this._Ellipsecolor=l}set rectColor(l){this._Rectcolor=l}set arrowColor(l){this._Arrowcolor=l}set textColor(l){this._Textcolor=l}set pathStrokeWidth(l){this._PathstrokeWidth=l}set ellipseStrokeWidth(l){this._EllipsestrokeWidth=l}set rectStrokeWidth(l){this._RectstrokeWidth=l}set arrowSize(l){this._ArrowstrokeWidth=l}set textFontSize(l){this._FontSize=l}destroy(){this.endCommentsTool()}}class h{constructor(l){this.eventTrigger=l,this.stateMap=new Map,this.stateIndex=0,this.stateMap.set(0,null)}AddNewState(l,c){if(this.stateIndex===0)this.stateIndex+=1,this.stateMap.set(this.stateIndex,l),this.stateIndex+=1;else{const _=this.stateMap.get(this.stateIndex-1);f(l,_)||(this.stateMap.set(this.stateIndex,l),this.stateIndex+=1)}if(this.stateMap.size-1>this.stateIndex){for(let _=this.stateIndex;_<=this.stateMap.size;_++)this.stateMap.delete(_);this.stateIndex=this.stateMap.size-1}c();function f(_,b){if(b==null||_==null||_.length!==b.length)return!1;for(let w=0;w<_.length;w++){const C=_[w],k=b[w];if(!p(C,k))return!1}return!0}function p(_,b){return!(Object.keys(_).length!==Object.keys(b).length||!v(_.attributes,b.attributes)||!m(_.childrenContents,b.childrenContents)||_.textContent!==b.textContent)}function m(_,b){if(_.size!==b.size)return!1;for(const[w,C]of _)if(!b.has(w)||b.get(w)!==C)return!1;return!0}function v(_,b){if(_.length!==b.length)return!1;for(let w=0;w<_.length;w++){const C=_.item(w),k=b.item(w);if(C&&k&&(C.name!==k.name||C.value!==k.value))return!1}return!0}}ReDo(l){this.stateIndex==this.stateMap.size?(this.eventTrigger.emit("noNewState"),l(this.stateMap.get(this.stateIndex-1))):(this.stateIndex+=1,this.stateIndex==this.stateMap.size&&this.eventTrigger.emit("noNewState"),l(this.stateMap.get(this.stateIndex-1)))}UnDo(l){this.stateIndex==1?this.eventTrigger.emit("noPreviousState"):(this.stateIndex-=1,this.stateIndex==1&&this.eventTrigger.emit("noPreviousState"),l(this.stateMap.get(this.stateIndex-1)))}destroy(){this.stateIndex=0,this.stateMap.clear()}}class d{constructor(l,c,f){this.attributes=l,this.childrenContents=c,this.textContent=f}}},"./src/toolbar/FirstPersonMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u);const{cameraControl:l}=this.viewer,{cameraControlNavModeMediator:c}=u;l.navMode="orbit",l.followPointer=!0,this.cameraControl=l,l.on("personModeSpeedUp",f=>{d.eventTrigger.emit("personModeSpeedUp",f)}),l.on("personModeSpeedDown",f=>{d.eventTrigger.emit("personModeSpeedDown",f)}),this.on("active",f=>{c.setFirstPersonModeActive(f),f&&(l.followPointer=!0)}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)})}setdirectionChangeCancel(){this.goLeft=!1,this.goRight=!1,this.goUp=!1,this.goDown=!1,this.goForward=!1,this.goBackward=!1}speedUp(){this.cameraControl.speedUp()}speedDown(){this.cameraControl.speedDown()}set moveRate(d){this.cameraControl.moveRate=d}get moveRate(){return this.cameraControl.moveRate}set goRight(d){this.cameraControl.goRight=d}set goLeft(d){this.cameraControl.goLeft=d}set goUp(d){this.cameraControl.goUp=d}set goDown(d){this.cameraControl.goDown=d}set goForward(d){this.cameraControl.goForward=d}set goBackward(d){this.cameraControl.goBackward=d}smallCanvas(){const d=new x.Viewer({spinnerElementId:"manyou_spinner",canvasId:"canvas_manyou",transparent:!0,resolutionScale:window.devicePixelRatio});d.camera.eye=[-3.933,2.855,27.018],d.camera.look=[4.4,3.724,8.899],d.camera.up=[-.018,.999,.039]}}},"./src/toolbar/FitAction.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");x.math.vec3();class A extends S.default{constructor(d,u={}){super(d,u)}fit(d){const{viewer:u}=this,{scene:l}=u,{center:c}=l;let f;this.bimViewer.multiModel?f=l.getAABB(l.visibleObjectIds):f=l.aabb;const p=x.math.getAABB3Diag(f);u.cameraControl.pivotPos=c,u.cameraControl.planView&&(u.cameraControl.planView=!1),u.cameraFlight.flyTo({aabb:f,orthoScale:p*1.3,duration:1},d)}set fov(d){this.viewer.scene.cameraFlight.fitFOV=d}get fov(){return this.viewer.scene.cameraFlight.fitFOV}set duration(d){this.viewer.scene.cameraFlight.duration=d}get duration(){return this.viewer.scene.cameraFlight.duration}}},"./src/toolbar/HideTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/Controller.ts");class S extends x.default{constructor(h,d){super(h,d),this.on("active",u=>{u?(this.viewer.cameraControl.doublePickFlyTo=!1,this._onPick=this.viewer.cameraControl.on("picked",l=>{l.entity&&(l.entity.visible=!1)})):(this.viewer.cameraControl.doublePickFlyTo=!1,this._onPick!==void 0&&(this.viewer.cameraControl.off(this._onPick),this._onPick=void 0))}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)})}}},"./src/toolbar/MarkerTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A="data:image/svg+xml;charset=utf-8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="#1e90ff" stroke="#ffffff" stroke-width="2"/><circle cx="12" cy="12" r="4" fill="#ffffff"/></svg>');class h extends S.default{constructor(u,l={}){if(super(u,l),this._markers=new Map,this._visible=!0,this._focusOnClick=!1,this._defaultIcon=A,this._typeIcons=new Map,this._idCounter=0,this.eventTrigger=u.eventTrigger,this._focusOnClick=!!l.focusOnClick,document.getElementById("myMarkerDiv"))this.markerWrapper=document.getElementById("myMarkerDiv");else{this.markerWrapper=document.createElement("div"),this.markerWrapper.id="myMarkerDiv";const{canvas:c}=u.viewer.scene.canvas;c.parentNode.insertBefore(this.markerWrapper,c)}this.annotationsPlugin=new x.AnnotationsPlugin(this.viewer,{markerHTML:"<div class='bimx-marker' id='{{id}}' style='position:absolute;cursor:pointer;'><img src='{{iconPath}}'></div>",labelHTML:"<div class='bimx-marker-label' style='position:absolute;'>{{text}}</div>",container:this.markerWrapper,values:{id:"",iconPath:A,text:""}}),this.annotationsPlugin.on("markerClicked",c=>{const f=this._markers.get(c.id),p=f?f.worldPos:[c.worldPos[0],c.worldPos[1],c.worldPos[2]];this.eventTrigger.emit("markerClicked",f??{id:c.id,worldPos:p}),this._focusOnClick&&p&&this._focusOn(p)}),this.annotationsPlugin.on("markerDoubleClicked",c=>{const f=this._markers.get(c.id);this.eventTrigger.emit("markerDoubleClicked",f??{id:c.id,worldPos:[c.worldPos[0],c.worldPos[1],c.worldPos[2]]})}),this.annotationsPlugin.on("markerMouseEnter",c=>{const f=this._markers.get(c.id);f&&f.text&&c.setLabelShown(!0)}),this.annotationsPlugin.on("markerMouseLeave",c=>{c.setLabelShown(!1)}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)})}setAllVisible(u=!this._visible){this._visible=u,this.annotationsPlugin.setAllVisible(u)}setDefaultIcon(u){this._defaultIcon=u}setTypeIcons(u){for(const l in u)Object.prototype.hasOwnProperty.call(u,l)&&this._typeIcons.set(l,u[l])}setTypeIcon(u,l){this._typeIcons.set(u,l)}setFocusOnClick(u){this._focusOnClick=u}clickToCreateMarker(u){if(!this.getActive()||!this.getEnabled())return;const l=this.getCanvasPos(u);if(!l)return;const c=this.viewer.scene.pick({canvasPos:l,pickSurface:!0});if(c)return this._createMarkerFromPickResult(c)}addMarker(u,l,c,f,p){const m=f??this._generateId(),v=this._resolveIcon(c);this.annotationsPlugin.createAnnotation({id:m,worldPos:[u[0],u[1],u[2]],occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:m,iconPath:v,text:p??""}});const _={id:m,worldPos:[u[0],u[1],u[2]],type:c,data:l,text:p};return this._markers.set(m,_),this.eventTrigger.emit("markerCreated",_),_}removeMarker(u){const l=this._markers.get(u);if(!l){this.warn("removeMarker() - Marker not found: "+u);return}this.annotationsPlugin.destroyAnnotation(u),this._markers.delete(u),this.eventTrigger.emit("markerRemoved",l)}getMarkerById(u){return this._markers.get(u)}focusMarker(u){const l=this._markers.get(u);if(!l){this.warn("focusMarker() - Marker not found: "+u);return}this._focusOn(l.worldPos)}getMarkers(){return Array.from(this._markers.values()).map(u=>Object.assign(Object.assign({},u),{worldPos:[...u.worldPos]}))}setMarkers(u){this.clear(),(u||[]).forEach(l=>{l&&l.worldPos&&l.worldPos.length>=3&&this.addMarker(l.worldPos,l.data,l.type,l.id,l.text)})}clear(){this.annotationsPlugin.clear(),this._markers.clear(),this.eventTrigger.emit("markersCleared")}getCanvasPos(u){const l=[];if(!u)u=window.event,l[0]=u.x,l[1]=u.y;else if("TouchEvent"in window&&u instanceof TouchEvent){if(!u.touches||u.touches.length===0)return;const c=u.touches[0];let f=u.target,p=0,m=0;for(;f.offsetParent;)p+=f.offsetLeft,m+=f.offsetTop,f=f.offsetParent;l[0]=c.pageX-p,l[1]=c.pageY-m}else{let c=this.viewer.scene.canvas.canvas,f=0,p=0;for(;c.offsetParent;)f+=c.offsetLeft,p+=c.offsetTop,c=c.offsetParent;l[0]=u.pageX-f,l[1]=u.pageY-p}return l}destroy(){this.clear(),this.annotationsPlugin.destroy(),this.markerWrapper&&this.markerWrapper.parentNode&&this.markerWrapper.parentNode.removeChild(this.markerWrapper),super.destroy()}_createMarkerFromPickResult(u){const l=this._generateId(),c=this._resolveIcon(void 0),f=this.annotationsPlugin.createAnnotation({id:l,pickResult:u,occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:l,iconPath:c}}),p={id:l,worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]],entityId:u.entity?u.entity.id:void 0};return this._markers.set(l,p),this.eventTrigger.emit("markerCreated",p),p}_resolveIcon(u){return u&&this._typeIcons.has(u)?this._typeIcons.get(u):this._defaultIcon}_focusOn(u){const l=[u[0],u[1],u[2]];this.viewer.cameraFlight.flyTo({look:l}),this.viewer.cameraControl.pivotPos=l}_generateId(){return this._idCounter+=1,`marker_${Date.now()}_${this._idCounter}`}}},"./src/toolbar/MeasureTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./src/Controller.ts"),S=a("./src/toolbar/MeasureTools/MeasureAngleTool.ts"),A=a("./src/toolbar/MeasureTools/MeasureDistanceTool.ts");class h extends x.default{constructor(u,l){super(u),this._isTouch=!1,this._tools={},this._toolType="distance",this.eventTrigger=u.eventTrigger,this._measure_distance_tool=new A.default(u,{}),this._measure_angle_tool=new S.default(u,{}),this._tools.distance=this._measure_distance_tool,this._tools.angle=this._measure_angle_tool,this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.setActive(!0),this._initEventHandle()}_initEventHandle(){this.eventTrigger.on("clickAngleMeasure",u=>{this._active&&(this.getActiveByType("angle")||this.setActiveByType("angle",!0))}),this.eventTrigger.on("clickDistanceMeasure",u=>{this._active&&(this.getActiveByType("distance")||this.setActiveByType("distance",!0))})}setActive(u=!this._active){this._active=u,this._measure_angle_tool.setEnabled(u),this._measure_distance_tool.setEnabled(u),u||(this._measure_angle_tool.setActive(u),this._measure_distance_tool.setActive(u))}getActive(){return this._active}set isTouch(u){this._isTouch=u,this._measure_angle_tool.isTouch=u,this._measure_distance_tool.isTouch=u}get isTouch(){return this._isTouch}get measureAngleTool(){return this._measure_angle_tool}get measureDistanceTool(){return this._measure_distance_tool}getMeasureToolByType(u){return this._tools[u]}setActiveByType(u,l=!this._tools[u].getActive()){this._toolType=u;for(let c in this._tools)u==c?this._tools[c].setActive(l):this._tools[c].setActive(!1)}getActiveByType(u){return this._tools[u].getActive()}get currentTool(){return this._tools[this._toolType]}SetMeasureAngleActive(u=!this._measure_angle_tool.getActive(),l=()=>{}){this._measure_angle_tool.setActive(u),l(this._measure_angle_tool.getActive())}SetMeasureDistanceActive(u=!this._measure_distance_tool.getActive(),l=()=>{}){this._measure_distance_tool.setActive(u),l(this._measure_distance_tool.getActive())}setAllDisActive(){for(let u in this._tools)this._tools[u].setActive(!1)}setMeasureOffSet(u,l){this.measureAngleTool.offsetX=u,this.measureAngleTool.offsetY=l,this.measureDistanceTool.offsetX=u,this.measureDistanceTool.offsetY=l}setSnapRadius(u){this.viewer.cameraControl.snapRadius=u}destroy(){this._measure_distance_tool.destroy(),this._measure_angle_tool.destroy()}}},"./src/toolbar/MeasureTools/MeasureAngleTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u),this._offsetX=0,this._offsetY=0,this._isTouch=!1,this._approximate=!0,this._precision=2,this.eventTrigger=d.eventTrigger,this.angleMeasureContainer=document.createElement("div"),this.angleMeasureContainer.id="myAngleMeasuresDiv";const{canvas:l}=d.viewer.scene.canvas;l.parentNode.insertBefore(this.angleMeasureContainer,l),this._angleMeasurementsPlugin=new x.AngleMeasurementsPlugin(this.viewer,{container:this.angleMeasureContainer,defaultColor:"#0065FC"}),this._angleMeasurementsMouseControl=new x.AngleMeasurementsMouseControl(this._angleMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsTouchControl=new x.AngleMeasurementsTouchControl(this._angleMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsSimulateMouseControl=new x.AngleMeasurementsSimulateMouseControl(this._angleMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY,snapping:!0}),this._angleMeasurementsMouseControl.snapping=!0,this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this._initSettings(),this._initializeMeasure()}setActive(d){this._active=d,d?this.chosedTarget&&this.chosedTarget.setHighlighted(!0):(this.refreshMouseState(),this.setAllHightLighted(!1)),this._isTouch?(this._angleMeasurementsTouchControl.active=d,this._angleMeasurementsSimulateMouseControl.active=d):this._angleMeasurementsMouseControl.active=d}getActive(){return this._active}_initSettings(){this._angleMeasurementsMouseControl.activate(),this._angleMeasurementsMouseControl.active=!1,this._angleMeasurementsTouchControl.activate(),this._angleMeasurementsTouchControl.active=!1,this._angleMeasurementsSimulateMouseControl.activate(),this._angleMeasurementsSimulateMouseControl.active=!1}_initializeMeasure(){this._angleMeasurementsPlugin.on("measurementCreated",l=>{this.eventTrigger.emit("newAngleMeasure",{id:l.id}),this.newMeasure=l,this.chosedTarget=null}),this._angleMeasurementsPlugin.on("measurementEnd",l=>{if(this.getMeasureResultByID(l.id)===0){this.destroyMeasurementById(l.id);return}this.eventTrigger.emit("createAngleMeasure",{id:l.id,result:this.getMeasureResultByID(l.id)}),this.setAllHightLighted(!1),this.chosedTarget=l,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._angleMeasurementsPlugin.on("mouseOver",l=>{l.measurement.setHighlighted(!0)}),this._angleMeasurementsPlugin.on("mouseLeave",l=>{l.angleMeasurement==this.chosedTarget&&this._active||l.measurement.setHighlighted(!1)}),this._angleMeasurementsPlugin.on("clickMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("touchMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("measurementDestroyed",l=>{this.eventTrigger.emit("AngleMeasureDestroyed",{id:l.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=l=>{if(this._active&&(l.key==="Delete"||l.keyCode===8)){if(!this.chosedTarget)return;this.destroyMeasurementById(this.chosedTarget.id),this._angleMeasurementsPlugin.fire("measureDelete",null),this.getNumMeasurements()==0&&(this.chosedTarget=null)}};document.addEventListener("mousemove",d.bind(this)),document.addEventListener("keydown",u.bind(this)),this.on("destroy",()=>{document.removeEventListener("mousemove",d.bind(this)),document.removeEventListener("keydown",u.bind(this))})}set isTouch(d){this._isTouch=d,d||this._angleMeasurementsMouseControl.deactivate()}get isTouch(){return this._isTouch}set precision(d){this._precision=d,this._angleMeasurementsPlugin.precision=d}get precision(){return this._precision}set offsetX(d){this._offsetX=d,this._isTouch?(this._angleMeasurementsTouchControl.offsetX=d,this._angleMeasurementsSimulateMouseControl.offsetX=d):this._angleMeasurementsMouseControl.offsetX=d}get offsetX(){return this._offsetX}set offsetY(d){this._offsetY=d,this._isTouch?(this._angleMeasurementsTouchControl.offsetY=d,this._angleMeasurementsSimulateMouseControl.offsetY=d):this._angleMeasurementsMouseControl.offsetY=d}get offsetY(){return this._offsetY}refreshMouseState(){this.newMeasure&&(this.destroyMeasurementById(this.newMeasure.id),this.isTouch?(this._angleMeasurementsTouchControl.touchState=0,this._angleMeasurementsSimulateMouseControl.mouseState=0):this._angleMeasurementsMouseControl.mouseState=0,this.setAllHightLighted(!1),this.newMeasure=null)}setAllVisible(d){this._angleMeasurementsPlugin.setMeasurementsShown(d)}setSnappingEnabled(d){return this._angleMeasurementsMouseControl.snapping=d}getNumMeasurements(){return Object.keys(this._angleMeasurementsPlugin.measurements).length}getMeasurementsList(){return this._angleMeasurementsPlugin.measurements}getMeasurementById(d){return this.getMeasurementsList()[d]}getMeasureResultByID(d){const u=this.getMeasurementById(d);return u?u.angle:0}setMeasureColorByID(d,u){const l=this.getMeasurementById(d);l.color=u}setMeasureClickbleById(d,u){const l=this.getMeasurementById(d);l.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const l in u)u[l].setHighlighted(d)}setVisibleById(d,u){const l=this.getMeasurementById(d);l.visible=u}setAngleLabelVisible(d,u){const l=this.getMeasurementById(d);l.angleVisible=u}destroyMeasurementById(d){this._angleMeasurementsPlugin.destroyMeasurement(d)}onSimulateMousedown(d){this._angleMeasurementsSimulateMouseControl.onMousedown(d)}onSimulateMousemove(d){this._angleMeasurementsSimulateMouseControl.onMousemove(d)}onSimulateMouseup(d){this._angleMeasurementsSimulateMouseControl.onMouseup(d)}clear(){this._angleMeasurementsPlugin.clear()}stop(){this._isTouch?(this._angleMeasurementsTouchControl.deactivate(),this._angleMeasurementsSimulateMouseControl.deactivate()):this._angleMeasurementsMouseControl.deactivate()}destroy(){this.fire("destroy",!0),this.angleMeasureContainer.parentNode&&this.angleMeasureContainer.parentNode.removeChild(this.angleMeasureContainer),this._angleMeasurementsPlugin.destroy(),this._angleMeasurementsMouseControl.destroy(),this._angleMeasurementsTouchControl.destroy(),this._angleMeasurementsSimulateMouseControl.destroy(),super.destroy()}}},"./src/toolbar/MeasureTools/MeasureDistanceTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u),this._offsetX=0,this._offsetY=0,this._isTouch=!1,this._approximate=!0,this._precision=2,this._scale=1,this._unit="m",this.eventTrigger=d.eventTrigger,this.distanceMeasureContainer=document.createElement("div"),this.distanceMeasureContainer.id="myDistanceMeasuresDiv";const{canvas:l}=d.viewer.scene.canvas;l.parentNode.insertBefore(this.distanceMeasureContainer,l),this._distanceMeasurementsPlugin=new x.DistanceMeasurementsPlugin(this.viewer,{container:this.distanceMeasureContainer,defaultAxisVisible:!1,defaultColor:"#0065FC"}),this._distanceMeasurementsMouseControl=new x.DistanceMeasurementsMouseControl(this._distanceMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsTouchControl=new x.DistanceMeasurementsTouchControl(this._distanceMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsSimulateMouseControl=new x.DistanceMeasurementsSimulateMouseControl(this._distanceMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY,snapping:!0}),this._distanceMeasurementsMouseControl.snapping=!0,this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this._initSettings(),this._initializeMeasure()}setActive(d){this._active=d,d?this.chosedTarget&&this.chosedTarget.setHighlighted(!0):(this.refreshMouseState(),this.setAllHightLighted(!1)),this._isTouch?(this._distanceMeasurementsTouchControl.active=d,this._distanceMeasurementsSimulateMouseControl.active=d):this._distanceMeasurementsMouseControl.active=d}getActive(){return this._active}_initSettings(){this._distanceMeasurementsMouseControl.activate(),this._distanceMeasurementsMouseControl.active=!1,this._distanceMeasurementsTouchControl.activate(),this._distanceMeasurementsTouchControl.active=!1,this._distanceMeasurementsSimulateMouseControl.activate(),this._distanceMeasurementsSimulateMouseControl.active=!1}_initializeMeasure(){this._distanceMeasurementsPlugin.on("measurementCreated",l=>{this.eventTrigger.emit("newDistanceMeasure",{id:l.id}),this.newMeasure=l,this.chosedTarget=null}),this._distanceMeasurementsPlugin.on("measurementEnd",l=>{if(this.getMeasureResultByID(l.id)===0){this.destroyMeasurementById(l.id);return}this.eventTrigger.emit("createDistanceMeasure",{id:l.id,result:this.getMeasureResultByID(l.id),xResult:l.xLabel,yResult:l.yLabel,zResult:l.zLabel}),this.setAllHightLighted(!1),this.chosedTarget=l,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._distanceMeasurementsPlugin.on("mouseOver",l=>{l.measurement.setHighlighted(!0)}),this._distanceMeasurementsPlugin.on("mouseLeave",l=>{l.distanceMeasurement==this.chosedTarget&&this._active||l.measurement.setHighlighted(!1)}),this._distanceMeasurementsPlugin.on("clickMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("touchMeasure",l=>{this.chosedTarget&&this.chosedTarget.id!==l.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=l.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("measurementCancel",l=>{this.eventTrigger.emit("DistanceMeasureCancel",{id:l.id})}),this._distanceMeasurementsPlugin.on("measurementDestroyed",l=>{this.eventTrigger.emit("DistanceMeasureDestroyed",{id:l.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=l=>{if(this._active&&(l.key==="Delete"||l.keyCode===8)){if(!this.chosedTarget)return;this.destroyMeasurementById(this.chosedTarget.id),this._distanceMeasurementsPlugin.fire("measureDelete",null),this.getNumMeasurements()==0&&(this.chosedTarget=null)}};document.addEventListener("mousemove",d.bind(this)),document.addEventListener("keydown",u.bind(this)),this.on("destroy",()=>{document.removeEventListener("mousemove",d.bind(this)),document.removeEventListener("keydown",u.bind(this))})}set isTouch(d){this._isTouch=d,d||this._distanceMeasurementsMouseControl.deactivate()}get isTouch(){return this._isTouch}set unit(d){switch(this._unit=d,d){case"m":this.viewer.scene.metrics.units="meters",this.viewer.scene.metrics.scale=1*this._scale;break;case"cm":this.viewer.scene.metrics.units="centimeters",this.viewer.scene.metrics.scale=100*this._scale;break;case"mm":this.viewer.scene.metrics.units="millimeters",this.viewer.scene.metrics.scale=1e3*this._scale;break}}set scale(d){this._scale=d,this.unit=this._unit}get scale(){return this._scale}set precision(d){this._precision=d,this._distanceMeasurementsPlugin.precision=d}get precision(){return this._precision}set offsetX(d){this._offsetX=d,this._isTouch?(this._distanceMeasurementsTouchControl.offsetX=d,this._distanceMeasurementsSimulateMouseControl.offsetX=d):this._distanceMeasurementsMouseControl.offsetX=d}get offsetX(){return this._offsetX}set offsetY(d){this._offsetY=d,this._isTouch?(this._distanceMeasurementsTouchControl.offsetY=d,this._distanceMeasurementsSimulateMouseControl.offsetY=d):this._distanceMeasurementsMouseControl.offsetY=d}get offsetY(){return this._offsetY}refreshMouseState(){this.newMeasure&&(this.destroyMeasurementById(this.newMeasure.id),this.isTouch?(this._distanceMeasurementsTouchControl.touchState=0,this._distanceMeasurementsSimulateMouseControl.mouseState=0):this._distanceMeasurementsMouseControl.mouseState=0,this.setAllHightLighted(!1),this.newMeasure=null)}setAllVisible(d){this._distanceMeasurementsPlugin.setMeasurementsShown(d)}setSnappingEnabled(d){return this._distanceMeasurementsMouseControl.snapping=d}getNumMeasurements(){return Object.keys(this._distanceMeasurementsPlugin.measurements).length}getMeasurementsList(){return this._distanceMeasurementsPlugin.measurements}getMeasurementById(d){return this.getMeasurementsList()[d]}getMeasureResultByID(d){const u=this.getMeasurementById(d);return u?u.length:0}setMeasureColorByID(d,u){const l=this.getMeasurementById(d);l.color=u}setMeasureClickbleById(d,u){const l=this.getMeasurementById(d);l.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const l in u)u[l].setHighlighted(d)}setVisibleById(d,u){const l=this.getMeasurementById(d);l.visible=u}setLableVisibleById(d,u){const l=this.getMeasurementById(d);l.labelsVisible=u}destroyMeasurementById(d){this._distanceMeasurementsPlugin.destroyMeasurement(d)}onSimulateMousedown(d){this._distanceMeasurementsSimulateMouseControl.onMousedown(d)}onSimulateMousemove(d){this._distanceMeasurementsSimulateMouseControl.onMousemove(d)}onSimulateMouseup(d){this._distanceMeasurementsSimulateMouseControl.onMouseup(d)}clear(){this._distanceMeasurementsPlugin.clear()}stop(){this._isTouch?(this._distanceMeasurementsTouchControl.deactivate(),this._distanceMeasurementsSimulateMouseControl.deactivate()):this._distanceMeasurementsMouseControl.deactivate()}destroy(){this.fire("destroy",!0),this.distanceMeasureContainer.parentNode&&this.distanceMeasureContainer.parentNode.removeChild(this.distanceMeasureContainer),this._distanceMeasurementsPlugin.destroy(),this._distanceMeasurementsMouseControl.destroy(),this._distanceMeasurementsTouchControl.destroy(),this._distanceMeasurementsSimulateMouseControl.destroy(),super.destroy()}}},"./src/toolbar/NavCubeMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){if(super(d,u),!u.navCubeCanvasElement)throw new Error("Missing config: NavCubeMode navCubeCanvasElement");const{navCubeCanvasElement:l}=u,{viewerElement:c}=u;this._navCubeCanvasElement=l,this._navCubeCanvasElement.oncontextmenu=f=>{f.preventDefault()},this._navCube=new x.NavCubePlugin(this.viewer,{canvasElement:l,viewerElement:c,fitVisible:!1,color:"#CFCFCF",shadowVisible:!1}),this._navCube.setVisible(this._active),this._visible=!0,this.on("active",f=>{this._navCube.setVisible(f)})}set visible(d){this._visible=d,d?this._navCubeCanvasElement.style.visibility="visible":this._navCubeCanvasElement.style.visibility="hidden"}get visible(){return this._visible}get fitVisible(){return this._navCube.getFitVisible()}set fitVisible(d){this._navCube.setFitVisible(d)}flyByClick(d){this._navCube.flyByClick(d)}destroy(){this._navCube.destroy(),super.destroy()}}},"./src/toolbar/OrthoMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/Controller.ts");class S extends x.default{constructor(h,d){super(h,d),this.viewer.camera.on("projection",()=>{const u=this.viewer.camera.projection==="ortho";this._active=u}),this._active=!1}setActive(h,d=()=>{}){if(this._active===h){d&&d();return}this._active=h,h?d?this._enterOrthoMode(()=>{this.fire("active",this._active),d()}):(this._enterOrthoMode(),this.fire("active",this._active)):d?this._exitOrthoMode(()=>{this.fire("active",this._active),d()}):(this._exitOrthoMode(),this.fire("active",this._active))}_enterOrthoMode(h=()=>{}){h?this.viewer.cameraFlight.flyTo({projection:"ortho",duration:.5},h):this.viewer.cameraFlight.jumpTo({projection:"ortho"})}_exitOrthoMode(h=()=>{}){h?this.viewer.cameraFlight.flyTo({projection:"perspective",duration:.5},h):this.viewer.cameraFlight.jumpTo({projection:"perspective"})}}},"./src/toolbar/ResetAction.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A=x.math.vec3();class h extends S.default{constructor(u,l={}){super(u,l),this._modelMementos={},this.bimViewer.modelsExplorer.on("modelLoaded",c=>{this.reset()})}reset(u){this._resetCamera(u)}_resetCamera(u){const{viewer:l}=this,{scene:c}=l;let f;this.bimViewer.multiModel?f=c.getAABB(c.visibleObjectIds):f=c.aabb;const p=x.math.getAABB3Diag(f),m=x.math.getAABB3Center(f,A),{camera:v}=c;v.perspective.fov;const _=Math.abs(p/Math.tan(45*x.math.DEGTORAD)),b=x.math.normalizeVec3(v.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),w=x.math.normalizeVec3(v.yUp?[-.5,.7071,-.5]:[-1,1,1]);l.cameraControl.pivotPos=m,l.cameraControl.planView&&(l.cameraControl.planView=!1),l.cameraFlight.flyTo({look:m,eye:[m[0]-_*b[0],m[1]-_*b[1],m[2]-_*b[2]],up:w,orthoScale:p*1.3,projection:"perspective",duration:1},u)}}},"./src/toolbar/SectionTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u){super(d,u),this.eventTrigger=d.eventTrigger,this._sectionPlanesPlugin=new x.SectionPlanesPlugin(this.viewer,{}),this._sectionPlanesPlugin.sectionConfigs={planeSize:1.4,controlSize:.2,planeOpacity:.2,controlFillColor:[.1,.4,.99]},this._sectionPlanesPlugin.setOverviewVisible(!1),this._sectionPlanesPlugin.on("touchPlaneStart",()=>{this.eventTrigger.emit("touchPlaneStart")}),this._sectionPlanesPlugin.on("touchPlaneEnd",()=>{this.eventTrigger.emit("touchPlaneEnd")}),this._sectionPlanesPlugin.on("clickPlaneStart",()=>{this.eventTrigger.emit("clickPlaneStart")}),this._sectionPlanesPlugin.on("clickPlaneEnd",()=>{this.eventTrigger.emit("clickPlaneEnd")}),this._isTouch=!1,this.on("active",l=>{l?this.showControl():this.hideControl()}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this._initSectionMode()}_initSectionMode(){this.viewer.scene.input.on("mouseclicked",d=>{if(!this.getActive())return;const u=this.viewer.scene.pick({canvasPos:d,pickSurface:!0});if(u){const l=this._sectionPlanesPlugin.createSectionPlane({pos:u.worldPos,dir:x.math.mulVec3Scalar(u.worldNormal,-1)});this._sectionPlanesPlugin.showControl(l.id),this.eventTrigger.emit("createSection",{position:u.worldPos,direction:x.math.mulVec3Scalar(u.worldNormal,-1),id:l.id})}})}set isTouch(d){this._sectionPlanesPlugin.isTouch=d,this._isTouch=d}set sectionWay(d){this._sectionPlanesPlugin.sectionWay=d}set sectionDirection(d){this._sectionPlanesPlugin.sectionDirection=d}setControlPos(d){this._sectionPlanesPlugin.setControlPos(d)}getControlPos(){return this._sectionPlanesPlugin.getControlPos()}set sectionConfigs(d){this._sectionPlanesPlugin.sectionConfigs=d}creatSection(d,u){const l=this._sectionPlanesPlugin.createSectionPlane({pos:d,dir:u});this._sectionPlanesPlugin.showControl(l.id)}getSectionPlanes(){return this._sectionPlanesPlugin.sectionPlanes}getSectionPlane(d){return this.getSectionPlanes()[d]}setSectionEnable(d){const u=this.getSectionPlane(d);u.active=!0}setSectionDisable(d){const u=this.getSectionPlane(d);u.active=!1}setSectionPos(d,u){const l=this.getSectionPlane(d);l.pos=u}flipSection(d){this.getSectionPlane(d).flipDir()}getNumSections(){return Object.keys(this.viewer.scene.sectionPlanes).length}clear(){this._sectionPlanesPlugin.clear()}flipSections(){this._sectionPlanesPlugin.flipSectionPlanes()}getShownControl(){this._sectionPlanesPlugin.getShownControl()}enableSections(){const{sectionPlanes:d}=this.viewer.scene;for(const u in d){const l=d[u];l.active=!0}}disableSections(){const{sectionPlanes:d}=this.viewer.scene;for(const u in d){const l=d[u];l.active=!1,this.hideControl()}}hideControl(){this._sectionPlanesPlugin.hideControl()}showControl(){const d=this.getSectionPlanes();for(const u in d)d[u].control.setVisible(!0)}showSectionPlane(d){this._sectionPlanesPlugin.showControl(d)}destroy(){this._sectionPlanesPlugin.destroy(),super.destroy()}destroySectionPlane(d){this._sectionPlanesPlugin.destroySectionPlane(d)}}},"./src/toolbar/ShowSpacesMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>S});var x=a("./src/Controller.ts");class S extends x.default{constructor(h,d){super(h,d),this._active=!0,h.eventTrigger.on("metaLoaded",u=>{const l=this.spaceObjects;if(l.length==0)return;this.viewer.scene.setObjectsCulled(l,!0),this.setIFCSpaceOpacity(),this.viewer.scene.setObjectsHighlighted(l,!0);const c=this.viewer.scene.models[u.metaModel.id],f=c.exceptionIds.concat(l);c.exceptionIds=f,h.resetView()})}setActive(h,d){this._active!==h&&(this._active=h,h?(this._enterShowSpacesMode(),this.fire("active",this._active)):(this._exitShowSpacesMode(),this.fire("active",this._active)),d&&d())}setIFCSpaceOpacity(){this.spaceObjects.length!=0&&this.viewer.scene.withObjects(this.spaceObjects,h=>{h.origin_opacity!=-1&&(h.opacity=h.opacity<.5?h.opacity:.1)})}_enterShowSpacesMode(){const{viewer:h}=this,{scene:d}=h,{metaScene:u}=h,l=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(l,!1)}_exitShowSpacesMode(){const{viewer:h}=this,{scene:d}=h,{metaScene:u}=h,l=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(l,!0)}get spaceObjects(){return this.viewer.metaScene.getObjectIDsByType("IfcSpace")}}},"./src/toolbar/SkyBoxTool.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>A});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");class A extends S.default{constructor(d,u={}){super(d,u),this.skyboxesPlugin=new x.SkyboxesPlugin(this.viewer),this._active=!1,this.createSkyBox(u),this.on("active",l=>{this.setSkyBoxActiveById(l)})}createSkyBox(d){const{skyBoxImage:u}=d,{skyBoxSrc:l}=d;this.skyboxesPlugin.createSkybox("skybox1",{src:l,image:u,size:9e3,scale:[1,1],active:!1})}setSkyBoxActiveById(d=!this.getSkyBoxById("skybox1").active){this.skyboxesPlugin.setSkyBoxActiveById("skybox1",d)}getSkyBoxById(d="skybox1"){return this.skyboxesPlugin.getSkyBoxById(d)}destroy(){this.skyboxesPlugin.destroy()}}},"./src/toolbar/ThreeDMode.ts"(N,Q,a){a.r(Q),a.d(Q,{default:()=>h});var x=a("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),S=a("./src/Controller.ts");const A=x.math.vec3();class h extends S.default{constructor(u,l){super(u,l),this._saveOrthoActive=null,this._cameraControlNavModeMediator=l.cameraControlNavModeMediator,this._active=!1}setEnabled(u){super.setEnabled(u),this._saveOrthoActive=this.bimViewer.orthoMode.getActive()}setActive(u,l=()=>{}){if(this._active===u){l&&l();return}this._active=u,u?this._enterThreeDMode(()=>{this.fire("active",this._active),l&&l()}):this._exitThreeDMode(()=>{this.fire("active",this._active),l&&l()})}_enterThreeDMode(u=()=>{}){const{viewer:l}=this,{scene:c}=l,{aabb:f}=c,p=x.math.getAABB3Diag(f),m=x.math.getAABB3Center(f,A),v=Math.abs(p/Math.tan(65/2)),{camera:_}=c,b=_.yUp?[-1,-1,-1]:[1,1,1],w=_.yUp?[-1,1,-1]:[-1,1,1];l.cameraControl.pivotPos=m,this.bimViewer.navCubeMode.setActive(!0),this.bimViewer.firstPersonMode.setEnabled(!0),this._cameraControlNavModeMediator.setThreeDModeActive(!0),this.bimViewer.sectionTool.setEnabled(!0),this.bimViewer.orthoMode.setEnabled(!0),u?l.cameraFlight.flyTo({look:m,eye:[m[0]-v*b[0],m[1]-v*b[1],m[2]-v*b[2]],up:w,orthoScale:p*1.3,duration:1,projection:this._saveOrthoActive?"ortho":"perspective"},()=>{u()}):l.cameraFlight.jumpTo({look:m,eye:[m[0]-v*b[0],m[1]-v*b[1],m[2]-v*b[2]],up:w,orthoScale:p*1.3,projection:this._saveOrthoActive?"ortho":"perspective"})}_exitThreeDMode(u=()=>{}){const{viewer:l}=this,{scene:c}=l,{camera:f}=c,{aabb:p}=c,m=x.math.getAABB3Center(p),v=x.math.getAABB3Diag(p),b=Math.abs(v/Math.tan(45*x.math.DEGTORAD)),w=v*1.3,C=A;C[0]=m[0]+f.worldUp[0]*b,C[1]=m[1]+f.worldUp[1]*b,C[2]=m[2]+f.worldUp[2]*b;const k=x.math.mulVec3Scalar(f.worldForward,-1,[]);this.bimViewer.sectionTool.setActive(!1),this.bimViewer.firstPersonMode.setEnabled(!1),this._saveOrthoActive=this.bimViewer.orthoMode.getActive(),this.bimViewer.orthoMode.setEnabled(!1),this._cameraControlNavModeMediator.setThreeDModeActive(!1),u?l.cameraFlight.flyTo({eye:C,look:m,up:k,orthoScale:w,projection:"ortho"},()=>{this.bimViewer.navCubeMode.setActive(!1)}):(l.cameraFlight.jumpTo({eye:C,look:m,up:k,orthoScale:w,projection:"ortho"}),this.bimViewer.navCubeMode.setActive(!1))}}},"./node_modules/unzipit/dist/unzipit.module.js"(N,Q,a){a.r(Q),a.d(Q,{HTTPRangeReader:()=>f,cleanup:()=>at,setOptions:()=>Ze,unzip:()=>dt,unzipRaw:()=>Xe}),N=a.hmd(N);function x(ze){return ze.arrayBuffer?ze.arrayBuffer():new Promise((Ke,ut)=>{const yt=new FileReader;yt.addEventListener("loadend",()=>{Ke(yt.result)}),yt.addEventListener("error",ut),yt.readAsArrayBuffer(ze)})}async function S(ze){const Ke=await x(ze);return new Uint8Array(Ke)}function A(ze){return typeof Blob<"u"&&ze instanceof Blob}function h(ze){return typeof SharedArrayBuffer<"u"&&ze instanceof SharedArrayBuffer}const d=typeof process<"u"&&process.versions&&typeof process.versions.node<"u"&&typeof process.versions.electron>"u";function u(ze){return ze.byteOffset===0&&ze.byteLength===ze.buffer.byteLength}class l{constructor(Ke){this.typedArray=Ke instanceof ArrayBuffer||h(Ke)?new Uint8Array(Ke):new Uint8Array(Ke.buffer,Ke.byteOffset,Ke.byteLength)}async getLength(){return this.typedArray.byteLength}async read(Ke,ut){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+Ke,ut)}}class c{constructor(Ke){this.blob=Ke}async getLength(){return this.blob.size}async read(Ke,ut){const yt=this.blob.slice(Ke,Ke+ut),Ne=await x(yt);return new Uint8Array(Ne)}async sliceAsBlob(Ke,ut,yt=""){return this.blob.slice(Ke,Ke+ut,yt)}}class f{constructor(Ke){this.url=Ke}async getLength(){if(this.length===void 0){const Ke=await fetch(this.url,{method:"HEAD"});if(!Ke.ok)throw new Error(`failed http request ${this.url}, status: ${Ke.status}: ${Ke.statusText}`);if(this.length=parseInt(Ke.headers.get("content-length")),Number.isNaN(this.length))throw Error("could not get length")}return this.length}async read(Ke,ut){if(ut===0)return new Uint8Array(0);const yt=await fetch(this.url,{headers:{Range:`bytes=${Ke}-${Ke+ut-1}`}});if(!yt.ok)throw new Error(`failed http request ${this.url}, status: ${yt.status} offset: ${Ke} size: ${ut}: ${yt.statusText}`);const Ne=await yt.arrayBuffer();return new Uint8Array(Ne)}}function p(ze,Ke){var ut=Uint8Array;if(ze[0]==3&&ze[1]==0)return Ke||new ut(0);var yt=T,Ne=k,tt=v,Pt=R,Rt=Ke==null;Rt&&(Ke=new ut(ze.length>>>2<<3));for(var Ht=0,zt=0,tr=0,qt=0,er=0,Dt=0,rr=0,_r=0,pr=0,xr,Ct;Ht==0;){if(Ht=yt(ze,pr,1),zt=yt(ze,pr+1,2),pr+=3,zt==0){pr&7&&(pr+=8-(pr&7));var Et=(pr>>>3)+4,Lt=ze[Et-4]|ze[Et-3]<<8;Rt&&(Ke=m(Ke,_r+Lt)),Ke.set(new ut(ze.buffer,ze.byteOffset+Et,Lt),_r),pr=Et+Lt<<3,_r+=Lt;continue}if(Rt&&(Ke=m(Ke,_r+(1<<17))),zt==1&&(xr=U.flmap,Ct=U.fdmap,Dt=511,rr=31),zt==2){tr=Ne(ze,pr,5)+257,qt=Ne(ze,pr+5,5)+1,er=Ne(ze,pr+10,4)+4,pr+=14;for(var Kt=0;Kt<38;Kt+=2)U.itree[Kt]=0,U.itree[Kt+1]=0;for(var Ar=1,Kt=0;Kt<er;Kt++){var xt=Ne(ze,pr+Kt*3,3);U.itree[(U.ordr[Kt]<<1)+1]=xt,xt>Ar&&(Ar=xt)}pr+=3*er,b(U.itree,Ar),w(U.itree,Ar,U.imap),xr=U.lmap,Ct=U.dmap,pr=tt(U.imap,(1<<Ar)-1,tr+qt,ze,pr,U.ttree);var Qt=_(U.ttree,0,tr,U.ltree);Dt=(1<<Qt)-1;var $t=_(U.ttree,tr,qt,U.dtree);rr=(1<<$t)-1,b(U.ltree,Qt),w(U.ltree,Qt,xr),b(U.dtree,$t),w(U.dtree,$t,Ct)}for(;;){var nr=xr[Pt(ze,pr)&Dt];pr+=nr&15;var Er=nr>>>4;if(!(Er>>>8))Ke[_r++]=Er;else{if(Er==256)break;var Ie=_r+Er-254;if(Er>264){var Le=U.ldef[Er-257];Ie=_r+(Le>>>3)+Ne(ze,pr,Le&7),pr+=Le&7}var Ue=Ct[Pt(ze,pr)&rr];pr+=Ue&15;var Ge=Ue>>>4,Ye=U.ddef[Ge],$e=(Ye>>>4)+yt(ze,pr,Ye&15);for(pr+=Ye&15,Rt&&(Ke=m(Ke,_r+(1<<17)));_r<Ie;)Ke[_r]=Ke[_r++-$e],Ke[_r]=Ke[_r++-$e],Ke[_r]=Ke[_r++-$e],Ke[_r]=Ke[_r++-$e];_r=Ie}}}return Ke.length==_r?Ke:Ke.slice(0,_r)}function m(ze,Ke){var ut=ze.length;if(Ke<=ut)return ze;var yt=new Uint8Array(Math.max(ut<<1,Ke));return yt.set(ze,0),yt}function v(ze,Ke,ut,yt,Ne,tt){for(var Pt=k,Rt=R,Ht=0;Ht<ut;){var zt=ze[Rt(yt,Ne)&Ke];Ne+=zt&15;var tr=zt>>>4;if(tr<=15)tt[Ht]=tr,Ht++;else{var qt=0,er=0;tr==16?(er=3+Pt(yt,Ne,2),Ne+=2,qt=tt[Ht-1]):tr==17?(er=3+Pt(yt,Ne,3),Ne+=3):tr==18&&(er=11+Pt(yt,Ne,7),Ne+=7);for(var Dt=Ht+er;Ht<Dt;)tt[Ht]=qt,Ht++}}return Ne}function _(ze,Ke,ut,yt){for(var Ne=0,tt=0,Pt=yt.length>>>1;tt<ut;){var Rt=ze[tt+Ke];yt[tt<<1]=0,yt[(tt<<1)+1]=Rt,Rt>Ne&&(Ne=Rt),tt++}for(;tt<Pt;)yt[tt<<1]=0,yt[(tt<<1)+1]=0,tt++;return Ne}function b(ze,Ke){for(var ut=ze.length,yt,Ne,tt,Pt,Rt,Ht=U.bl_count,Pt=0;Pt<=Ke;Pt++)Ht[Pt]=0;for(Pt=1;Pt<ut;Pt+=2)Ht[ze[Pt]]++;var zt=U.next_code;for(yt=0,Ht[0]=0,Ne=1;Ne<=Ke;Ne++)yt=yt+Ht[Ne-1]<<1,zt[Ne]=yt;for(tt=0;tt<ut;tt+=2)Rt=ze[tt+1],Rt!=0&&(ze[tt]=zt[Rt],zt[Rt]++)}function w(ze,Ke,ut){for(var yt=ze.length,Ne=U.rev15,tt=0;tt<yt;tt+=2)if(ze[tt+1]!=0)for(var Pt=tt>>1,Rt=ze[tt+1],Ht=Pt<<4|Rt,zt=Ke-Rt,tr=ze[tt]<<zt,qt=tr+(1<<zt);tr!=qt;){var er=Ne[tr]>>>15-Ke;ut[er]=Ht,tr++}}function C(ze,Ke){for(var ut=U.rev15,yt=15-Ke,Ne=0;Ne<ze.length;Ne+=2){var tt=ze[Ne]<<Ke-ze[Ne+1];ze[Ne]=ut[tt]>>>yt}}function k(ze,Ke,ut){return(ze[Ke>>>3]|ze[(Ke>>>3)+1]<<8)>>>(Ke&7)&(1<<ut)-1}function T(ze,Ke,ut){return(ze[Ke>>>3]|ze[(Ke>>>3)+1]<<8|ze[(Ke>>>3)+2]<<16)>>>(Ke&7)&(1<<ut)-1}function R(ze,Ke){return(ze[Ke>>>3]|ze[(Ke>>>3)+1]<<8|ze[(Ke>>>3)+2]<<16)>>>(Ke&7)}const U=function(){var ze=Uint16Array,Ke=Uint32Array;return{next_code:new ze(16),bl_count:new ze(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new ze(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new Ke(32),flmap:new ze(512),fltree:[],fdmap:new ze(32),fdtree:[],lmap:new ze(32768),ltree:[],ttree:[],dmap:new ze(32768),dtree:[],imap:new ze(512),itree:[],rev15:new ze(32768),lhst:new Ke(286),dhst:new Ke(30),ihst:new Ke(19),lits:new Ke(15e3),strt:new ze(65536),prev:new ze(32768)}}();(function(){for(var ze=32768,Ke=0;Ke<ze;Ke++){var ut=Ke;ut=(ut&2863311530)>>>1|(ut&1431655765)<<1,ut=(ut&3435973836)>>>2|(ut&858993459)<<2,ut=(ut&4042322160)>>>4|(ut&252645135)<<4,ut=(ut&4278255360)>>>8|(ut&16711935)<<8,U.rev15[Ke]=(ut>>>16|ut<<16)>>>17}function yt(Ne,tt,Pt){for(;tt--!=0;)Ne.push(0,Pt)}for(var Ke=0;Ke<32;Ke++)U.ldef[Ke]=U.of0[Ke]<<3|U.exb[Ke],U.ddef[Ke]=U.df0[Ke]<<4|U.dxb[Ke];yt(U.fltree,144,8),yt(U.fltree,112,9),yt(U.fltree,24,7),yt(U.fltree,8,8),b(U.fltree,9),w(U.fltree,9,U.flmap),C(U.fltree,9),yt(U.fdtree,32,5),b(U.fdtree,5),w(U.fdtree,5,U.fdmap),C(U.fdtree,5),yt(U.itree,19,0),yt(U.ltree,286,0),yt(U.dtree,30,0),yt(U.ttree,320,0)})();const G={table:function(){for(var ze=new Uint32Array(256),Ke=0;Ke<256;Ke++){for(var ut=Ke,yt=0;yt<8;yt++)ut&1?ut=3988292384^ut>>>1:ut=ut>>>1;ze[Ke]=ut}return ze}(),update:function(ze,Ke,ut,yt){for(var Ne=0;Ne<yt;Ne++)ze=G.table[(ze^Ke[ut+Ne])&255]^ze>>>8;return ze},crc:function(ze,Ke,ut){return G.update(4294967295,ze,Ke,ut)^4294967295}};function j(ze,Ke){return p(ze,Ke)}const H={numWorkers:1,workerURL:"",useWorkers:!1};let W=0,K=0,$=!0;const O=[],L=[],M=[],I=new Map;function F(ze){ee(ze.target);const{id:Ke,error:ut,data:yt}=ze.data,Ne=I.get(Ke);I.delete(Ke),ut?Ne.reject(ut):Ne.resolve(yt)}function V(ze){return new Promise((Ke,ut)=>{const yt=new Worker(ze);yt.onmessage=Ne=>{Ne.data==="start"?(yt.onerror=void 0,yt.onmessage=void 0,Ke(yt)):ut(new Error(`unexpected message: ${Ne.data}`))},yt.onerror=ut})}function D(ze,Ke){return ze.require?ze.require(Ke):{}}const X=function(){if(d){const{Worker:ze}=D(N,"worker_threads");return{async createWorker(Ke){return new ze(Ke)},addEventListener(Ke,ut){Ke.on("message",yt=>{ut({target:Ke,data:yt})})},async terminate(Ke){await Ke.terminate()}}}else return{async createWorker(ze){try{return await V(ze)}catch{console.warn("could not load worker:",ze)}let Ke;try{const ut=await fetch(ze,{mode:"cors"});if(!ut.ok)throw new Error(`could not load: ${ze}`);Ke=await ut.text(),ze=URL.createObjectURL(new Blob([Ke],{type:"application/javascript"}));const yt=await V(ze);return H.workerURL=ze,yt}catch{console.warn("could not load worker via fetch:",ze)}if(Ke!==void 0)try{ze=`data:application/javascript;base64,${btoa(Ke)}`;const ut=await V(ze);return H.workerURL=ze,ut}catch{console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(ze,Ke){ze.addEventListener("message",Ke)},async terminate(ze){ze.terminate()}}}();function ee(ze){L.push(ze),oe()}async function q(){if(L.length===0&&K<H.numWorkers){++K;try{const ze=await X.createWorker(H.workerURL);O.push(ze),L.push(ze),X.addEventListener(ze,F)}catch{$=!1}}return L.pop()}function ne(ze,Ke,ut,yt){const Ne=new Uint8Array(Ke);j(ze,Ne),yt(ut?new Blob([Ne],{type:ut}):Ne.buffer)}async function oe(){if(M.length!==0){if(H.useWorkers&&$){const ze=await q();if($){if(ze){if(M.length===0){ee(ze);return}const{id:Ke,src:ut,uncompressedSize:yt,type:Ne,resolve:tt,reject:Pt}=M.shift();I.set(Ke,{id:Ke,resolve:tt,reject:Pt});const Rt=[];ze.postMessage({type:"inflate",data:{id:Ke,type:Ne,src:ut,uncompressedSize:yt}},Rt)}return}}for(;M.length;){const{src:ze,uncompressedSize:Ke,type:ut,resolve:yt}=M.shift();let Ne=ze;A(ze)&&(Ne=await S(ze)),ne(Ne,Ke,ut,yt)}}}function he(ze){H.workerURL=ze.workerURL||H.workerURL,ze.workerURL&&(H.useWorkers=!0),H.useWorkers=ze.useWorkers!==void 0?ze.useWorkers:H.useWorkers,H.numWorkers=ze.numWorkers||H.numWorkers}function te(ze,Ke,ut){return new Promise((yt,Ne)=>{M.push({src:ze,uncompressedSize:Ke,type:ut,resolve:yt,reject:Ne,id:W++}),oe()})}function de(ze){ze.splice(0,ze.length)}async function se(){for(const ze of O)await X.terminate(ze);de(O),de(L),de(M),I.clear(),K=0,$=!0}function re(ze,Ke){const ut=ze&31,yt=(ze>>5&15)-1,Ne=(ze>>9&127)+1980,tt=0,Pt=(Ke&31)*2,Rt=Ke>>5&63,Ht=Ke>>11&31;return new Date(Ne,yt,ut,Ht,Rt,Pt,tt)}class ae{constructor(Ke,ut){this._reader=Ke,this._rawEntry=ut,this.name=ut.name,this.nameBytes=ut.nameBytes,this.size=ut.uncompressedSize,this.compressedSize=ut.compressedSize,this.comment=ut.comment,this.commentBytes=ut.commentBytes,this.compressionMethod=ut.compressionMethod,this.lastModDate=re(ut.lastModFileDate,ut.lastModFileTime),this.isDirectory=ut.uncompressedSize===0&&ut.name.endsWith("/"),this.encrypted=!!(ut.generalPurposeBitFlag&1),this.externalFileAttributes=ut.externalFileAttributes,this.versionMadeBy=ut.versionMadeBy}async blob(Ke="application/octet-stream"){return await it(this._reader,this._rawEntry,Ke)}async arrayBuffer(){return await ht(this._reader,this._rawEntry)}async text(){const Ke=await this.arrayBuffer();return _e(new Uint8Array(Ke))}async json(){const Ke=await this.text();return JSON.parse(Ke)}}const Ce=22,me=65535,ce=101010256,pe=101075792;async function B(ze,Ke,ut){return await ze.read(Ke,ut)}async function ke(ze,Ke,ut,yt){return ze.sliceAsBlob?await ze.sliceAsBlob(Ke,ut,yt):await ze.read(Ke,ut)}const Ee={unsigned(){return 0}};function ge(ze,Ke){return ze[Ke]+ze[Ke+1]*256}function Ae(ze,Ke){return ze[Ke]+ze[Ke+1]*256+ze[Ke+2]*65536+ze[Ke+3]*16777216}function fe(ze,Ke){return Ae(ze,Ke)+Ae(ze,Ke+4)*4294967296}const ue=new TextDecoder;function _e(ze,Ke){return h(ze.buffer)&&(ze=new Uint8Array(ze)),ue.decode(ze)}async function be(ze,Ke){const ut=Math.min(Ce+me,Ke),yt=Ke-ut,Ne=await B(ze,yt,ut);for(let tt=ut-Ce;tt>=0;--tt){if(Ae(Ne,tt)!==ce)continue;const Pt=new Uint8Array(Ne.buffer,Ne.byteOffset+tt,Ne.byteLength-tt),Rt=ge(Pt,4);if(Rt!==0)throw new Error(`multi-volume zip files are not supported. This is volume: ${Rt}`);const Ht=ge(Pt,10),zt=Ae(Pt,12),tr=Ae(Pt,16),qt=ge(Pt,20),er=Pt.length-Ce;if(qt!==er)throw new Error(`invalid comment length. expected: ${er}, actual: ${qt}`);const Dt=new Uint8Array(Pt.buffer,Pt.byteOffset+22,qt),rr=_e(Dt);return Ht===65535||tr===4294967295?await Je(ze,yt+tt,rr,Dt):await ot(ze,tr,zt,Ht,rr,Dt)}throw new Error("could not find end of central directory. maybe not zip file")}const De=117853008;async function Je(ze,Ke,ut,yt){const Ne=Ke-20,tt=await B(ze,Ne,20);if(Ae(tt,0)!==De)throw new Error("invalid zip64 end of central directory locator signature");const Pt=fe(tt,8),Rt=await B(ze,Pt,56);if(Ae(Rt,0)!==pe)throw new Error("invalid zip64 end of central directory record signature");const Ht=fe(Rt,32),zt=fe(Rt,40),tr=fe(Rt,48);return ot(ze,tr,zt,Ht,ut,yt)}const Qe=33639248;async function ot(ze,Ke,ut,yt,Ne,tt){let Pt=0;const Rt=await B(ze,Ke,ut),Ht=[];for(let tr=0;tr<yt;++tr){const qt=Rt.subarray(Pt,Pt+46),er=Ae(qt,0);if(er!==Qe)throw new Error(`invalid central directory file header signature: 0x${er.toString(16)}`);const Dt={versionMadeBy:ge(qt,4),versionNeededToExtract:ge(qt,6),generalPurposeBitFlag:ge(qt,8),compressionMethod:ge(qt,10),lastModFileTime:ge(qt,12),lastModFileDate:ge(qt,14),crc32:Ae(qt,16),compressedSize:Ae(qt,20),uncompressedSize:Ae(qt,24),fileNameLength:ge(qt,28),extraFieldLength:ge(qt,30),fileCommentLength:ge(qt,32),internalFileAttributes:ge(qt,36),externalFileAttributes:Ae(qt,38),relativeOffsetOfLocalHeader:Ae(qt,42)};if(Dt.generalPurposeBitFlag&64)throw new Error("strong encryption is not supported");Pt+=46;const rr=Rt.subarray(Pt,Pt+Dt.fileNameLength+Dt.extraFieldLength+Dt.fileCommentLength);Dt.nameBytes=rr.slice(0,Dt.fileNameLength),Dt.name=_e(Dt.nameBytes);const _r=Dt.fileNameLength+Dt.extraFieldLength,pr=rr.slice(Dt.fileNameLength,_r);Dt.extraFields=[];let xr=0;for(;xr<pr.length-3;){const Et=ge(pr,xr+0),Lt=ge(pr,xr+2),Kt=xr+4,Ar=Kt+Lt;if(Ar>pr.length)throw new Error("extra field length exceeds extra field buffer size");Dt.extraFields.push({id:Et,data:pr.slice(Kt,Ar)}),xr=Ar}if(Dt.commentBytes=rr.slice(_r,_r+Dt.fileCommentLength),Dt.comment=_e(Dt.commentBytes),Pt+=rr.length,Dt.uncompressedSize===4294967295||Dt.compressedSize===4294967295||Dt.relativeOffsetOfLocalHeader===4294967295){const Et=Dt.extraFields.find(Ar=>Ar.id===1);if(!Et)throw new Error("expected zip64 extended information extra field");const Lt=Et.data;let Kt=0;if(Dt.uncompressedSize===4294967295){if(Kt+8>Lt.length)throw new Error("zip64 extended information extra field does not include uncompressed size");Dt.uncompressedSize=fe(Lt,Kt),Kt+=8}if(Dt.compressedSize===4294967295){if(Kt+8>Lt.length)throw new Error("zip64 extended information extra field does not include compressed size");Dt.compressedSize=fe(Lt,Kt),Kt+=8}if(Dt.relativeOffsetOfLocalHeader===4294967295){if(Kt+8>Lt.length)throw new Error("zip64 extended information extra field does not include relative header offset");Dt.relativeOffsetOfLocalHeader=fe(Lt,Kt),Kt+=8}}const Ct=Dt.extraFields.find(Et=>Et.id===28789&&Et.data.length>=6&&Et.data[0]===1&&Ae(Et.data,1),Ee.unsigned(Dt.nameBytes));if(Ct&&(Dt.fileName=_e(Ct.data.slice(5))),Dt.compressionMethod===0){let Et=Dt.uncompressedSize;if(Dt.generalPurposeBitFlag&1&&(Et+=12),Dt.compressedSize!==Et)throw new Error(`compressed size mismatch for stored file: ${Dt.compressedSize} != ${Et}`)}Ht.push(Dt)}return{zip:{comment:Ne,commentBytes:tt},entries:Ht.map(tr=>new ae(ze,tr))}}async function ct(ze,Ke){if(Ke.generalPurposeBitFlag&1)throw new Error("encrypted entries not supported");const ut=await B(ze,Ke.relativeOffsetOfLocalHeader,30),yt=await ze.getLength(),Ne=Ae(ut,0);if(Ne!==67324752)throw new Error(`invalid local file header signature: 0x${Ne.toString(16)}`);const tt=ge(ut,26),Pt=ge(ut,28),Rt=Ke.relativeOffsetOfLocalHeader+ut.length+tt+Pt;let Ht;if(Ke.compressionMethod===0)Ht=!1;else if(Ke.compressionMethod===8)Ht=!0;else throw new Error(`unsupported compression method: ${Ke.compressionMethod}`);const zt=Rt,tr=zt+Ke.compressedSize;if(Ke.compressedSize!==0&&tr>yt)throw new Error(`file data overflows file bounds: ${zt} + ${Ke.compressedSize} > ${yt}`);return{decompress:Ht,fileDataStart:zt}}async function ht(ze,Ke){const{decompress:ut,fileDataStart:yt}=await ct(ze,Ke);if(!ut){const Pt=await B(ze,yt,Ke.compressedSize);return u(Pt)?Pt.buffer:Pt.slice().buffer}const Ne=await ke(ze,yt,Ke.compressedSize);return await te(Ne,Ke.uncompressedSize)}async function it(ze,Ke,ut){const{decompress:yt,fileDataStart:Ne}=await ct(ze,Ke);if(!yt){const Rt=await ke(ze,Ne,Ke.compressedSize,ut);return A(Rt)?Rt:new Blob([h(Rt.buffer)?new Uint8Array(Rt):Rt],{type:ut})}const tt=await ke(ze,Ne,Ke.compressedSize);return await te(tt,Ke.uncompressedSize,ut)}function Ze(ze){he(ze)}async function Xe(ze){let Ke;if(typeof Blob<"u"&&ze instanceof Blob)Ke=new c(ze);else if(ze instanceof ArrayBuffer||ze&&ze.buffer&&ze.buffer instanceof ArrayBuffer)Ke=new l(ze);else if(h(ze)||h(ze.buffer))Ke=new l(ze);else if(typeof ze=="string"){const yt=await fetch(ze);if(!yt.ok)throw new Error(`failed http request ${ze}, status: ${yt.status}: ${yt.statusText}`);const Ne=await yt.blob();Ke=new c(Ne)}else if(typeof ze.getLength=="function"&&typeof ze.read=="function")Ke=ze;else throw new Error("unsupported source type");const ut=await Ke.getLength();if(ut>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${ut}. Only file sizes up 4503599627370496 bytes are supported`);return await be(Ke,ut)}async function dt(ze){const{zip:Ke,entries:ut}=await Xe(ze);return{zip:Ke,entries:Object.fromEntries(ut.map(yt=>[yt.name,yt]))}}function at(){se()}},"./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(l,c,f,p){p===void 0&&(p=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,p,m)}:function(l,c,f,p){p===void 0&&(p=f),l[p]=c[f]}),S=this&&this.__setModuleDefault||(Object.create?function(l,c){Object.defineProperty(l,"default",{enumerable:!0,value:c})}:function(l,c){l.default=c}),A=this&&this.__importStar||function(l){if(l&&l.__esModule)return l;var c={};if(l!=null)for(var f in l)f!=="default"&&Object.prototype.hasOwnProperty.call(l,f)&&x(c,l,f);return S(c,l),c};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Helpers=void 0;const h=a("./node_modules/fast-xml-parser/src/fxp.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(l){l.XmlParserOptions=d.XmlParserOptions,l.XmlBuilderOptions=d.XmlBuilderOptions,l.GetViewpoint=d.GetViewpoint,l.XmlToJsonNotation=d.XmlToJsonNotation;const c=d.ChangeToUppercase;function f(R){const{Markup:U}=new h.XMLParser(l.XmlParserOptions).parse(R);return{header:{files:k(U.Header)},topic:{guid:U.Topic["@_Guid"],topic_type:U.Topic["@_TopicType"],topic_status:U.Topic["@_TopicStatus"],reference_links:U.Topic.ReferenceLink&&l.ObjectToArray(U.Topic.ReferenceLink),title:U.Topic.Title,priority:U.Topic.Priority,index:U.Topic.Index,labels:U.Topic.Labels&&l.ObjectToArray(U.Topic.Labels),creation_date:U.Topic.CreationDate,creation_author:U.Topic.CreationAuthor,modified_date:U.Topic.ModifiedDate,modified_author:U.Topic.ModifiedAuthor,assigned_to:U.Topic.AssignedTo,description:U.Topic.Description,comments:l.GetComments(U.Comment),viewpoints:l.GetViewpoints(U.Viewpoints)}}}l.GetMarkup=f;function p(R){if(!R)return;const U=j=>({guid:j["@_Guid"],viewpoint:j.Viewpoint,snapshot:j.Snapshot}),G=[];return Array.isArray(R)?R.forEach(j=>{G.push(U(j))}):G.push(U(R)),G}l.GetViewpoints=p;function m(R){if(!R)return;const U=j=>{var H;return{guid:j["@_Guid"],date:j.Date,author:j.Author,comment:j.Comment,viewpoint:(H=j==null?void 0:j.Viewpoint)==null?void 0:H["@_Guid"],modified_date:j.ModifiedDate,modified_author:j.ModifiedAuthor}},G=[];return Array.isArray(R)?R.forEach(j=>{G.push(U(j))}):G.push(U(R)),G}l.GetComments=m;function v(R){return Array.isArray(R)?R:[R]}l.ObjectToArray=v;function _(R){return{x:R.X,y:R.Y,z:R.Z}}l.ParsePoint=_;const b=["DocumentReferences","RelatedTopics"];function w(R){const U=T(R);let G={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:U.header,topic:U.topic,comment:U.comment,viewpoints:U.viewpoints}};return C(G)}l.MarkupToXmlNotation=w;function C(R,U){let G={};if(typeof R=="string")return R;const j=(U==null?void 0:U.plural_to_singular)!==void 0?U.plural_to_singular:!0;for(const H in R){let W=R[H];if(!W)continue;if(H.startsWith("@_")){G[H]=W;continue}let K=c(H,U);if(Array.isArray(W)){const $=[];for(const L of W)$.push(C(L,U));const O=b.find(L=>L.startsWith(K));O&&j&&(K=O.slice(0,-1)),G[K]=$;continue}typeof W=="object"&&(W=C(W,U)),G[K]=W}return G}l.RenameJsonKeys=C;function k(R){if(R)return l.ObjectToArray(R).map(U=>l.XmlToJsonNotation(U))}function T(R){var W;if(!R.topic)return;const{comments:U,viewpoints:G,...j}=R.topic;return{header:{file:(W=R.header)==null?void 0:W.files},topic:j,comment:U,viewpoints:G}}})(u||(Q.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/2.1/index.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(p,m,v,_){_===void 0&&(_=v);var b=Object.getOwnPropertyDescriptor(m,v);(!b||("get"in b?!m.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return m[v]}}),Object.defineProperty(p,_,b)}:function(p,m,v,_){_===void 0&&(_=v),p[_]=m[v]}),S=this&&this.__exportStar||function(p,m){for(var v in p)v!=="default"&&!Object.prototype.hasOwnProperty.call(m,v)&&x(m,p,v)},A=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.BcfWriter=Q.BcfReader=void 0;const h=a("./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(a("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));S(a("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),Q);const l={GetMarkup:h.Helpers.GetMarkup,GetViewpoint:h.Helpers.GetViewpoint,XmlToJsonNotation:h.Helpers.XmlToJsonNotation,MarkupToXmlNotation:h.Helpers.MarkupToXmlNotation,RenameJsonKeys:h.Helpers.RenameJsonKeys,XmlParserOptions:h.Helpers.XmlParserOptions,XmlBuilderOptions:h.Helpers.XmlBuilderOptions};class c extends d.default{constructor(){super("2.1",l)}}Q.BcfReader=c;class f extends u.default{constructor(){super("2.1",l)}}Q.BcfWriter=f},"./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(l,c,f,p){p===void 0&&(p=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,p,m)}:function(l,c,f,p){p===void 0&&(p=f),l[p]=c[f]}),S=this&&this.__setModuleDefault||(Object.create?function(l,c){Object.defineProperty(l,"default",{enumerable:!0,value:c})}:function(l,c){l.default=c}),A=this&&this.__importStar||function(l){if(l&&l.__esModule)return l;var c={};if(l!=null)for(var f in l)f!=="default"&&Object.prototype.hasOwnProperty.call(l,f)&&x(c,l,f);return S(c,l),c};Object.defineProperty(Q,"__esModule",{value:!0}),Q.Helpers=void 0;const h=a("./node_modules/fast-xml-parser/src/fxp.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(l){l.XmlParserOptions={...d.XmlParserOptions,oneListGroup:!0},l.XmlBuilderOptions=d.XmlBuilderOptions,l.GetViewpoint=d.GetViewpoint,l.XmlToJsonNotation=d.XmlToJsonNotation;const c=d.ChangeToUppercase;function f(v){const{Markup:_}=new h.XMLParser(l.XmlParserOptions).parse(v),b=l.XmlToJsonNotation(_);return{header:b.header,topic:b.topic}}l.GetMarkup=f;function p(v){let _={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:v.header,topic:v.topic}};return m(_)}l.MarkupToXmlNotation=p;function m(v,_){let b={};if(typeof v=="string")return v;const w=(_==null?void 0:_.plural_to_singular)!==void 0?_.plural_to_singular:!0;for(const C in v){let k=v[C];if(!k)continue;if(C.startsWith("@_")){b[C]=k;continue}let T=c(C,_);if(Array.isArray(k)){const R=[];for(const U of k){let G={},j=T;w&&(j=j.slice(0,-1)),G[j]=m(U,_),R.push(G)}b[T]=R;continue}typeof k=="object"&&(k=m(k,_)),b[T]=k}return b}l.RenameJsonKeys=m})(u||(Q.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/3.0/index.js"(N,Q,a){var x=this&&this.__createBinding||(Object.create?function(p,m,v,_){_===void 0&&(_=v);var b=Object.getOwnPropertyDescriptor(m,v);(!b||("get"in b?!m.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return m[v]}}),Object.defineProperty(p,_,b)}:function(p,m,v,_){_===void 0&&(_=v),p[_]=m[v]}),S=this&&this.__exportStar||function(p,m){for(var v in p)v!=="default"&&!Object.prototype.hasOwnProperty.call(m,v)&&x(m,p,v)},A=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Q,"__esModule",{value:!0}),Q.BcfWriter=Q.BcfReader=void 0;const h=a("./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"),d=A(a("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(a("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));S(a("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),Q);const l={GetMarkup:h.Helpers.GetMarkup,GetViewpoint:h.Helpers.GetViewpoint,XmlToJsonNotation:h.Helpers.XmlToJsonNotation,MarkupToXmlNotation:h.Helpers.MarkupToXmlNotation,RenameJsonKeys:h.Helpers.RenameJsonKeys,XmlParserOptions:h.Helpers.XmlParserOptions,XmlBuilderOptions:h.Helpers.XmlBuilderOptions};class c extends d.default{constructor(){super("3.0",l)}}Q.BcfReader=c;class f extends u.default{constructor(){super("3.0",l)}}Q.BcfWriter=f},"./node_modules/@parametricos/bcf-js/dist/BcfReader.js"(N,Q,a){Object.defineProperty(Q,"__esModule",{value:!0}),Q.Markup=void 0;const x=a("./node_modules/unzipit/dist/unzipit.module.js"),S=a("./node_modules/fast-xml-parser/src/fxp.js");class A{constructor(u,l){Fi(this,"version");Fi(this,"bcf_archive");Fi(this,"project");Fi(this,"markups",[]);Fi(this,"helpers");Fi(this,"read",async u=>{try{const l=[];this.bcf_archive=await(0,x.unzip)(u);const{entries:c}=this.bcf_archive;let f="",p="",m="",v;for(const[b,w]of Object.entries(c))if(b.endsWith(".bcf"))l.push(w);else if(b.endsWith(".version"))m=new S.XMLParser(this.helpers.XmlParserOptions).parse(await w.text()).Version.DetailedVersion;else if(b.endsWith(".bcfp")){const C=new S.XMLParser(this.helpers.XmlParserOptions).parse(await w.text());if(!C.ProjectExtension||!C.ProjectExtension.Project)continue;f=C.ProjectExtension.Project["@_ProjectId"]||"",p=C.ProjectExtension.Project.Name||""}else if(b.endsWith("extensions.xsd")){const C=new S.XMLParser(this.helpers.XmlParserOptions).parse(await w.text());v=this.helpers.XmlToJsonNotation(C)}const _=[];for(let b=0;b<l.length;b++){const w=l[b],C=new h(this,w);await C.read(),this.markups.push(C);const k={header:C.header,topic:C.topic,project:this.project,viewpoints:C.viewpoints};_.push(k)}this.project={project_id:f,name:p,version:m,markups:void 0,reader:this,extension_schema:v},this.project.markups=_.map(b=>({...b,project:this.project}))}catch(l){console.log("Error in loading BCF archive. The error below was thrown."),console.error(l)}});Fi(this,"getEntry",u=>{var l;return(l=this.bcf_archive)==null?void 0:l.entries[u]});this.version=u,this.helpers=l}}Q.default=A;class h{constructor(u,l){Fi(this,"reader");Fi(this,"markup_file");Fi(this,"header");Fi(this,"topic");Fi(this,"viewpoints",[]);Fi(this,"read",async()=>{await this.parseMarkup(),await this.parseViewpoints()});Fi(this,"parseMarkup",async()=>{const u=this.reader.helpers.GetMarkup(await this.markup_file.text());this.topic=u.topic,this.header=u.header});Fi(this,"parseViewpoints",async()=>{if(this.topic&&this.topic.viewpoints){const u=this.topic.viewpoints;for(let l=0;l<u.length;l++){const c=u[l],f=this.topic.guid+"/"+c.viewpoint,p=this.reader.getEntry(f);if(!p)throw new Error("Missing Visualization Info");const m=this.reader.helpers.GetViewpoint(await p.text());m.snapshot=c.snapshot,m.getSnapshot=async()=>{if(c.snapshot)return await this.getSnapshot(c.snapshot)},this.viewpoints.push(m)}}});Fi(this,"getViewpointSnapshot",async u=>{if(!u||!this.topic)return;const l=this.reader.getEntry(`${this.topic.guid}/${u.snapshot}`);if(l){const c=await l.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(c)))}});Fi(this,"getSnapshot",async u=>{if(!u||!this.topic)return;const l=this.reader.getEntry(`${this.topic.guid}/${u}`);if(l){const c=await l.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(c)))}});this.reader=u,this.markup_file=l}}Q.Markup=h},"./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"(N,Q,a){var x=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Q,"__esModule",{value:!0});const S=x(a("./node_modules/jszip/dist/jszip.min.js")),A=a("./node_modules/fast-xml-parser/src/fxp.js");class h{constructor(m,v){Fi(this,"version");Fi(this,"project");Fi(this,"markups",[]);Fi(this,"files");Fi(this,"helpers");Fi(this,"addEntry",m=>{m.path.endsWith(".version")||this.files.push(m)});Fi(this,"write",async m=>{try{return this.project=m,d(this,m.markups),await u(this.files)}catch(v){console.log("Error in writing BCF archive. The error below was thrown."),console.error(v)}});this.version=m,this.helpers=v,this.files=[]}}Q.default=h;function d(p,m){if(p.project){p.addEntry(l(p.version)),p.addEntry(c(p.project.project_id,p.project.name)),p.addEntry(f(p));for(const v of m){const _=p.helpers.MarkupToXmlNotation(v);p.markups.push(_);let b=new A.XMLBuilder(p.helpers.XmlBuilderOptions).build(_);if(b=`<?xml version="1.0" encoding="utf-8"?>${b}`,v.topic){const C={path:`${v.topic.guid}/markup.bcf`,content:b};p.addEntry(C)}}}}async function u(p){var v;var m=new S.default;for(const _ of p){const b=_.path.split("/");b&&(b.length==1?m.file(b[0],_.content):b.length==2&&((v=m.folder(b[0]))==null||v.file(b[1],_.content)))}return await m.generateAsync({type:"nodebuffer"})}function l(p){return{path:"bcf.version",content:`<?xml version="1.0" encoding="utf-8"?>
500
500
  <Version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
501
501
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" VersionId="${p}">
502
502
  <DetailedVersion>${p}</DetailedVersion>