@xtctwins/tctwins-bimx-engine 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AnnotationTool-BN1cQJZT.mjs → AnnotationTool-w5bGE9cJ.mjs} +2 -2
- package/dist/BIMX_Viewer_Lib.es.js +1 -1
- package/dist/BIMX_Viewer_Lib.umd.js +2 -2
- package/dist/{CameraViewTool-DoHrCSBa.mjs → CameraViewTool-CojdKWOg.mjs} +1 -1
- package/dist/{CommentTool-DzpiIRq5.mjs → CommentTool-B9VooYuw.mjs} +1 -1
- package/dist/{HiddenTool-DKl-Td4d.mjs → HiddenTool-Ckt9Rq-S.mjs} +1 -1
- package/dist/{InspectorTool-ButMlfJZ.mjs → InspectorTool-IbSGNc-p.mjs} +3 -3
- package/dist/{MeasureTool-HA7KurNk.mjs → MeasureTool-ce0glmOH.mjs} +2 -2
- package/dist/{MouseTool-Cx7FUkja.mjs → MouseTool-DEx7EQjC.mjs} +1 -1
- package/dist/{NavigateTool-CHspxjfw.mjs → NavigateTool-CezBNc2T.mjs} +1 -1
- package/dist/{RoamTool-CvErAJ4s.mjs → RoamTool-B-sG7gTn.mjs} +1 -1
- package/dist/{ScreenShotTool-BKFYnVZ5.mjs → ScreenShotTool-Ybx6fN8G.mjs} +2 -2
- package/dist/{SectionTool-Dc_qndpy.mjs → SectionTool-Bk_tM0iv.mjs} +4 -4
- package/dist/{SettingTool-BYVwI27m.mjs → SettingTool-I5JTKEs4.mjs} +3 -3
- package/dist/{StructureTree-CNrEg0TP.mjs → StructureTree-B4zsT8iE.mjs} +3 -3
- package/dist/{alert-BE0cXifr.mjs → alert-mCw4l6h5.mjs} +1 -1
- package/dist/{el-slider-D_kA0TiT.mjs → el-slider-Coa3NGV1.mjs} +1 -1
- package/dist/{index-s9bhlFsR.mjs → index-12nO3dW-.mjs} +15 -20
- package/dist/{panel.vue_vue_type_style_index_0_lang-D0m8xJuR.mjs → panel.vue_vue_type_style_index_0_lang-DrlLccGf.mjs} +1 -1
- package/dist/{tallPanel-C_lzWM4i.mjs → tallPanel-B3pDz4Za.mjs} +1 -1
- package/package.json +2 -2
|
@@ -64,7 +64,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:p,curr
|
|
|
64
64
|
a ${k} ${k} 0 1 1 0 ${P?"-":""}${k*2}
|
|
65
65
|
a ${k} ${k} 0 1 1 0 ${P?"":"-"}${k*2}
|
|
66
66
|
`}),u=t.computed(()=>2*Math.PI*h.value),c=t.computed(()=>i.type==="dashboard"?.75:1),f=t.computed(()=>`${-1*u.value*(1-c.value)/2}px`),m=t.computed(()=>({strokeDasharray:`${u.value*c.value}px, ${u.value}px`,strokeDashoffset:f.value})),g=t.computed(()=>({strokeDasharray:`${u.value*c.value*(i.percentage/100)}px, ${u.value}px`,strokeDashoffset:f.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),v=t.computed(()=>{let k;return i.color?k=E(i.percentage):k=C[i.status]||C.default,k}),b=t.computed(()=>i.status==="warning"?Zt.WarningFilled:i.type==="line"?i.status==="success"?Zt.CircleCheck:Zt.CircleClose:i.status==="success"?Zt.Check:Zt.Close),w=t.computed(()=>i.type==="line"?12+i.strokeWidth*.4:i.width*.111111+2),_=t.computed(()=>i.format(i.percentage));function x(k){const P=100/k.length;return k.map((D,R)=>Ar(D)?{color:D,percentage:(R+1)*P}:D).sort((D,R)=>D.percentage-R.percentage)}const E=k=>{var D;const{color:P}=i;if(Nr(P))return P(k);if(Ar(P))return P;{const R=x(P);for(const z of R)if(z.percentage>k)return z.color;return(D=R[R.length-1])==null?void 0:D.color}};return(k,P)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(p).b(),t.unref(p).m(s.type),t.unref(p).is(s.status),{[t.unref(p).m("without-text")]:!s.showText,[t.unref(p).m("text-inside")]:s.textInside}]),role:"progressbar","aria-valuenow":s.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[s.type==="line"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(p).b("bar"))},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).be("bar","outer")),style:t.normalizeStyle({height:`${s.strokeWidth}px`})},[t.createElementVNode("div",{class:t.normalizeClass([t.unref(p).be("bar","inner"),{[t.unref(p).bem("bar","inner","indeterminate")]:s.indeterminate},{[t.unref(p).bem("bar","inner","striped")]:s.striped},{[t.unref(p).bem("bar","inner","striped-flow")]:s.stripedFlow}]),style:t.normalizeStyle(y.value)},[(s.showText||k.$slots.default)&&s.textInside?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(p).be("bar","innerText"))},[t.renderSlot(k.$slots,"default",{percentage:s.percentage},()=>[t.createElementVNode("span",null,t.toDisplayString(_.value),1)])],2)):t.createCommentVNode("v-if",!0)],6)],6)],2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(p).b("circle")),style:t.normalizeStyle({height:`${s.width}px`,width:`${s.width}px`})},[(t.openBlock(),t.createElementBlock("svg",mte,[t.createElementVNode("path",{class:t.normalizeClass(t.unref(p).be("circle","track")),d:d.value,stroke:`var(${t.unref(p).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":s.strokeLinecap,"stroke-width":A.value,fill:"none",style:t.normalizeStyle(m.value)},null,14,Ate),t.createElementVNode("path",{class:t.normalizeClass(t.unref(p).be("circle","path")),d:d.value,stroke:v.value,fill:"none",opacity:s.percentage?1:0,"stroke-linecap":s.strokeLinecap,"stroke-width":A.value,style:t.normalizeStyle(g.value)},null,14,gte)]))],6)),(s.showText||k.$slots.default)&&!s.textInside?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(t.unref(p).e("text")),style:t.normalizeStyle({fontSize:`${w.value}px`})},[t.renderSlot(k.$slots,"default",{percentage:s.percentage},()=>[s.status?(t.openBlock(),t.createBlock(t.unref(ir),{key:1},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(b.value)))]),_:1})):(t.openBlock(),t.createElementBlock("span",vte,t.toDisplayString(_.value),1))])],6)):t.createCommentVNode("v-if",!0)],10,pte))}}),bte=yte;const PM=Tr(bte),_te=Wt({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:et([Array,Object]),default:()=>mi(["","",""])},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:et([Array,Object]),default:()=>[Zt.StarFilled,Zt.StarFilled,Zt.StarFilled]},voidIcon:{type:Pn,default:()=>Zt.Star},disabledVoidIcon:{type:Pn,default:()=>Zt.StarFilled},disabled:{type:Boolean,default:void 0},allowHalf:Boolean,showText:Boolean,showScore:Boolean,textColor:{type:String,default:""},texts:{type:et(Array),default:()=>mi(["Extremely bad","Disappointed","Fair","Satisfied","Surprise"])},scoreTemplate:{type:String,default:"{value}"},size:Qi,clearable:Boolean,...Vs(["ariaLabel"])}),wte={[Gr]:s=>lr(s),[Pr]:s=>lr(s)},Cte=["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax","tabindex","aria-disabled"],xte=["onMousemove","onClick"];var Ete=t.defineComponent({name:"ElRate",__name:"rate",props:_te,emits:wte,setup(s,{expose:C,emit:i}){function p(O,Q){const W=J=>mn(J),Z=Q[Object.keys(Q).map(J=>+J).filter(J=>{const ne=Q[J];return W(ne)&&ne.excluded?O<J:O<=J}).sort((J,ne)=>J-ne)[0]];return W(Z)&&Z.value||Z}const y=s,A=i,h=t.inject(za,void 0),d=ji(),u=zt("rate"),{inputId:c,isLabeledByFormItem:f}=mo(y,{formItemContext:h}),m=t.ref(co(y.modelValue,0,y.max)),g=t.ref(-1),v=t.ref(!0),b=t.ref([]),w=t.computed(()=>b.value.map(O=>O.$el.clientWidth)),_=t.computed(()=>[u.b(),u.m(d.value)]),x=ri(),E=t.computed(()=>u.cssVarBlock({"void-color":y.voidColor,"disabled-void-color":y.disabledVoidColor,"fill-color":R.value})),k=t.computed(()=>{let O="";return y.showScore?O=y.scoreTemplate.replace(/\{\s*value\s*\}/,x.value?`${y.modelValue}`:`${m.value}`):y.showText&&(O=y.texts[Math.ceil(m.value)-1]),O}),P=t.computed(()=>y.modelValue*100-Math.floor(y.modelValue)*100),D=t.computed(()=>nr(y.colors)?{[y.lowThreshold]:y.colors[0],[y.highThreshold]:{value:y.colors[1],excluded:!0},[y.max]:y.colors[2]}:y.colors),R=t.computed(()=>{const O=p(m.value,D.value);return mn(O)?"":O}),z=t.computed(()=>{let O="";return x.value?O=`${P.value}%`:y.allowHalf&&(O="50%"),{color:R.value,width:O}}),F=t.computed(()=>{let O=nr(y.icons)?[...y.icons]:{...y.icons};return O=t.markRaw(O),nr(O)?{[y.lowThreshold]:O[0],[y.highThreshold]:{value:O[1],excluded:!0},[y.max]:O[2]}:O}),H=t.computed(()=>p(y.modelValue,F.value)),$=t.computed(()=>x.value?Ar(y.disabledVoidIcon)?y.disabledVoidIcon:t.markRaw(y.disabledVoidIcon):Ar(y.voidIcon)?y.voidIcon:t.markRaw(y.voidIcon)),K=t.computed(()=>p(m.value,F.value));function G(O){const Q=x.value&&P.value>0&&O-1<y.modelValue&&O>y.modelValue,W=y.allowHalf&&v.value&&O-.5<=m.value&&O>m.value;return Q||W}function j(O){y.clearable&&O===y.modelValue&&(O=0),A(Pr,O),y.modelValue!==O&&A(Gr,O)}function N(O){x.value||(y.allowHalf&&v.value?j(m.value):j(O))}function I(O){if(x.value)return;const Q=Dn(O),W=y.allowHalf?.5:1;let Z=m.value;switch(Q){case Gt.up:case Gt.right:Z+=W;break;case Gt.left:case Gt.down:Z-=W}if(Z=co(Z,0,y.max),Z!==m.value)return O.stopPropagation(),O.preventDefault(),A(Pr,Z),A(Gr,Z),Z}function L(O,Q){x.value||(y.allowHalf&&Q?(v.value=Q.offsetX*2<=w.value[O-1],m.value=v.value?O-.5:O):m.value=O,g.value=O)}function U(){x.value||(y.allowHalf&&(v.value=y.modelValue!==Math.floor(y.modelValue)),m.value=co(y.modelValue,0,y.max),g.value=-1)}return t.watch(()=>y.modelValue,O=>{m.value=co(O,0,y.max),v.value=y.modelValue!==Math.floor(y.modelValue)}),y.modelValue||A(Pr,0),C({setCurrentValue:L,resetCurrentValue:U}),(O,Q)=>{var W;return t.openBlock(),t.createElementBlock("div",{id:t.unref(c),class:t.normalizeClass([_.value,t.unref(u).is("disabled",t.unref(x))]),role:"slider","aria-label":t.unref(f)?void 0:s.ariaLabel||"rating","aria-labelledby":t.unref(f)?(W=t.unref(h))==null?void 0:W.labelId:void 0,"aria-valuenow":m.value,"aria-valuetext":k.value||void 0,"aria-valuemin":"0","aria-valuemax":s.max,style:t.normalizeStyle(E.value),tabindex:t.unref(x)?void 0:0,"aria-disabled":t.unref(x),onKeydown:I},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.max,(Z,J)=>(t.openBlock(),t.createElementBlock("span",{key:J,class:t.normalizeClass(t.unref(u).e("item")),onMousemove:ne=>L(Z,ne),onMouseleave:U,onClick:ne=>N(Z)},[t.createVNode(t.unref(ir),{ref_for:!0,ref_key:"iconRefs",ref:b,class:t.normalizeClass([t.unref(u).e("icon"),{hover:g.value===Z},t.unref(u).is("active",Z<=m.value),t.unref(u).is("focus-visible",Z===Math.ceil(m.value||1))])},{default:t.withCtx(()=>[t.withDirectives((t.openBlock(),t.createBlock(t.resolveDynamicComponent(K.value),null,null,512)),[[t.vShow,!G(Z)&&Z<=m.value]]),t.withDirectives((t.openBlock(),t.createBlock(t.resolveDynamicComponent($.value),null,null,512)),[[t.vShow,!G(Z)&&Z>m.value]]),t.withDirectives((t.openBlock(),t.createBlock(t.resolveDynamicComponent($.value),{class:t.normalizeClass([t.unref(u).em("decimal","box")])},null,8,["class"])),[[t.vShow,G(Z)]]),t.withDirectives(t.createVNode(t.unref(ir),{style:t.normalizeStyle(z.value),class:t.normalizeClass([t.unref(u).e("icon"),t.unref(u).e("decimal")])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(H.value)))]),_:1},8,["style","class"]),[[t.vShow,G(Z)]])]),_:2},1032,["class"])],42,xte))),128)),s.showText||s.showScore?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(t.unref(u).e("text")),style:t.normalizeStyle({color:s.textColor})},t.toDisplayString(k.value),7)):t.createCommentVNode("v-if",!0)],46,Cte)}}}),Bte=Ete;Tr(Bte);const ou={primary:"icon-primary",success:"icon-success",warning:"icon-warning",error:"icon-error",info:"icon-info"},MM={[ou.primary]:Zt.InfoFilled,[ou.success]:Zt.CircleCheckFilled,[ou.warning]:Zt.WarningFilled,[ou.error]:Zt.CircleCloseFilled,[ou.info]:Zt.InfoFilled},Ste=Wt({title:{type:String,default:""},subTitle:{type:String,default:""},icon:{type:String,values:["primary","success","warning","info","error"],default:"info"}});var kte=t.defineComponent({name:"ElResult",__name:"result",props:Ste,setup(s){const C=s,i=zt("result"),p=t.computed(()=>{const y=C.icon,A=y&&ou[y]?ou[y]:"icon-info";return{class:A,component:MM[A]||MM["icon-info"]}});return(y,A)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(i).b())},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(i).e("icon"))},[t.renderSlot(y.$slots,"icon",{},()=>[p.value.component?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(p.value.component),{key:0,class:t.normalizeClass(p.value.class)},null,8,["class"])):t.createCommentVNode("v-if",!0)])],2),s.title||y.$slots.title?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(i).e("title"))},[t.renderSlot(y.$slots,"title",{},()=>[t.createElementVNode("p",null,t.toDisplayString(s.title),1)])],2)):t.createCommentVNode("v-if",!0),s.subTitle||y.$slots["sub-title"]?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(i).e("subtitle"))},[t.renderSlot(y.$slots,"sub-title",{},()=>[t.createElementVNode("p",null,t.toDisplayString(s.subTitle),1)])],2)):t.createCommentVNode("v-if",!0),y.$slots.extra?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(t.unref(i).e("extra"))},[t.renderSlot(y.$slots,"extra")],2)):t.createCommentVNode("v-if",!0)],2))}}),Pte=kte;Tr(Pte);const Ub=Symbol("ElSelectV2Injection"),Mte=Wt({allowCreate:Boolean,autocomplete:{type:et(String),default:"none"},automaticDropdown:Boolean,clearable:Boolean,clearIcon:{type:Pn,default:Zt.CircleClose},effect:{type:et(String),default:"light"},collapseTags:Boolean,collapseTagsTooltip:Boolean,tagTooltip:{type:et(Object),default:()=>({})},maxCollapseTags:{type:Number,default:1},defaultFirstOption:Boolean,disabled:{type:Boolean,default:void 0},estimatedOptionHeight:{type:Number,default:void 0},filterable:Boolean,filterMethod:{type:et(Function)},height:{type:Number,default:274},itemHeight:{type:Number,default:34},id:String,loading:Boolean,loadingText:String,modelValue:{type:et([Array,String,Number,Boolean,Object]),default:void 0},multiple:Boolean,multipleLimit:{type:Number,default:0},name:String,noDataText:String,noMatchText:String,remoteMethod:{type:et(Function)},reserveKeyword:{type:Boolean,default:!0},options:{type:et(Array),required:!0},placeholder:{type:String},teleported:Qn.teleported,persistent:{type:Boolean,default:!0},popperClass:Qn.popperClass,popperStyle:Qn.popperStyle,popperOptions:{type:et(Object),default:()=>({})},remote:Boolean,debounce:{type:Number,default:300},size:Qi,props:{type:et(Object),default:()=>Ym},valueKey:{type:String,default:"value"},scrollbarAlwaysOn:Boolean,validateEvent:{type:Boolean,default:!0},offset:{type:Number,default:12},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},placement:{type:et(String),values:Oa,default:"bottom-start"},fallbackPlacements:{type:et(Array),default:["bottom-start","top-start","right","left"]},tagType:{...bl.type,default:"info"},tagEffect:{...bl.effect,default:"light"},tabindex:{type:[String,Number],default:0},appendTo:Qn.appendTo,fitInputWidth:{type:[Boolean,Number],default:!0,validator(s){return Bn(s)||lr(s)}},suffixIcon:{type:Pn,default:Zt.ArrowDown},...Yc,...Vs(["ariaLabel"])}),Tte=Wt({data:Array,disabled:Boolean,hovering:Boolean,item:{type:et(Object),required:!0},index:Number,style:Object,selected:Boolean,created:Boolean}),Ite={[Pr]:s=>!0,[Gr]:s=>!0,"end-reached":fh["end-reached"],"remove-tag":s=>!0,"visible-change":s=>!0,focus:s=>s instanceof FocusEvent,blur:s=>s instanceof FocusEvent,clear:()=>!0},Dte={hover:s=>lr(s),select:(s,C)=>!0};var Rte=t.defineComponent({props:{item:{type:Object,required:!0},style:{type:Object},height:Number},setup(){return{ns:zt("select")}}});function Fte(s,C,i,p,y,A){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(s.ns.be("group","title")),style:t.normalizeStyle({...s.style,lineHeight:`${s.height}px`})},t.toDisplayString(s.item.label),7)}var Nte=Yi(Rte,[["render",Fte]]);function Ote(s,{emit:C}){return{hoverItem:()=>{s.disabled||C("hover",s.index)},selectOptionClick:()=>{s.disabled||C("select",s.item,s.index)}}}var Lte=t.defineComponent({props:Tte,emits:Dte,setup(s,{emit:C}){const i=t.inject(Ub),p=zt("select"),y="mousemove",{hoverItem:A,selectOptionClick:h}=Ote(s,{emit:C}),{getLabel:d}=ph(i.props),u=i.contentId;return{ns:p,contentId:u,mouseMoveEventName:y,hoverItem:A,handleMousedown:f=>{let m=f.target;const g=f.currentTarget;for(;m&&m!==g;){if(zc(m))return;m=m.parentElement}f.preventDefault()},selectOptionClick:h,getLabel:d}}});const jte=["id","aria-selected","aria-disabled"];function Vte(s,C,i,p,y,A){return t.openBlock(),t.createElementBlock("li",t.mergeProps({id:`${s.contentId}-${s.index}`,role:"option","aria-selected":s.selected,"aria-disabled":s.disabled||void 0,style:s.style,class:[s.ns.be("dropdown","item"),s.ns.is("selected",s.selected),s.ns.is("disabled",s.disabled),s.ns.is("created",s.created),s.ns.is("hovering",s.hovering)]},{[t.toHandlerKey(s.mouseMoveEventName)]:C[0]||(C[0]=(...h)=>s.hoverItem&&s.hoverItem(...h))},{onMousedown:C[1]||(C[1]=(...h)=>s.handleMousedown&&s.handleMousedown(...h)),onClick:C[2]||(C[2]=t.withModifiers((...h)=>s.selectOptionClick&&s.selectOptionClick(...h),["stop"]))}),[t.renderSlot(s.$slots,"default",{item:s.item,index:s.index,disabled:s.disabled},()=>[t.createElementVNode("span",null,t.toDisplayString(s.getLabel(s.item)),1)])],16,jte)}var Ute=Yi(Lte,[["render",Vte]]),zte=t.defineComponent({name:"ElSelectDropdown",props:{loading:Boolean,data:{type:Array,required:!0},hoveringIndex:Number,width:Number,id:String,ariaLabel:String},emits:{"end-reached":fh["end-reached"]},setup(s,{slots:C,expose:i,emit:p}){const y=t.inject(Ub),A=zt("select"),{getLabel:h,getValue:d,getDisabled:u}=ph(y.props),c=t.ref([]),f=t.ref(),m=t.computed(()=>s.data.length);t.watch(()=>m.value,()=>{var G,j;(j=(G=y.tooltipRef.value)==null?void 0:G.updatePopper)==null||j.call(G)});const g=t.computed(()=>en(y.props.estimatedOptionHeight)),v=t.computed(()=>g.value?{itemSize:y.props.itemHeight}:{estimatedSize:y.props.estimatedOptionHeight,itemSize:G=>c.value[G]}),b=(G=[],j)=>{const{props:{valueKey:N}}=y;return mn(j)?G&&G.some(I=>t.toRaw(Si(I,N))===Si(j,N)):G.includes(j)},w=(G,j)=>{if(mn(j)){const{valueKey:N}=y.props;return Si(G,N)===Si(j,N)}else return G===j},_=(G,j)=>y.props.multiple?b(G,d(j)):w(G,d(j)),x=(G,j)=>{const{disabled:N,multiple:I,multipleLimit:L}=y.props;return N||!j&&(I?L>0&&G.length>=L:!1)},E=G=>s.hoveringIndex===G;i({listRef:f,isSized:g,isItemDisabled:x,isItemHovering:E,isItemSelected:_,scrollToItem:G=>{const j=f.value;j&&j.scrollToItem(G)},resetScrollTop:()=>{const G=f.value;G&&G.resetScrollTop()}});const D=G=>{const{index:j,data:N,style:I}=G,L=t.unref(g),{itemSize:U,estimatedSize:O}=t.unref(v),{modelValue:Q}=y.props,{onSelect:W,onHover:Z}=y,J=N[j];if(J.type==="Group")return t.createVNode(Nte,{item:J,style:I,height:L?U:O},null);const ne=_(Q,J),ae=x(Q,ne),ce=E(j);return t.createVNode(Ute,t.mergeProps(G,{selected:ne,disabled:u(J)||ae,created:!!J.created,hovering:ce,item:J,onSelect:W,onHover:Z}),{default:q=>{var fe;return((fe=C.default)==null?void 0:fe.call(C,q))||t.createVNode("span",null,[h(J)])}})},{onKeyboardNavigate:R,onKeyboardSelect:z}=y,F=()=>{R("forward")},H=()=>{R("backward")},$=G=>{const j=Dn(G),{tab:N,esc:I,down:L,up:U,enter:O,numpadEnter:Q}=Gt;switch([I,L,U,O,Q].includes(j)&&(G.preventDefault(),G.stopPropagation()),j){case N:case I:break;case L:F();break;case U:H();break;case O:case Q:z()}},K=G=>{p("end-reached",G)};return()=>{var Q,W,Z,J;const{data:G,width:j}=s,{height:N,multiple:I,scrollbarAlwaysOn:L}=y.props,U=L,O=t.unref(g)?bh:wW;return t.createVNode("div",{class:[A.b("dropdown"),A.is("multiple",I)],style:{width:`${j}px`}},[(Q=C.header)==null?void 0:Q.call(C),((W=C.loading)==null?void 0:W.call(C))||((Z=C.empty)==null?void 0:Z.call(C))||t.createVNode(O,t.mergeProps({ref:f},t.unref(v),{className:A.be("dropdown","list"),scrollbarAlwaysOn:U,data:G,height:N,width:j,total:G.length,innerElement:"ul",innerProps:{id:s.id,role:"listbox","aria-label":s.ariaLabel,"aria-orientation":"vertical"},onEndReached:K,onKeydown:$}),{default:ne=>t.createVNode(D,ne,null)}),(J=C.footer)==null?void 0:J.call(C)])}}});function Hte(s,C){const{aliasProps:i,getLabel:p,getValue:y}=ph(s),A=t.ref(0),h=t.ref(),d=t.computed(()=>s.allowCreate&&s.filterable);t.watch(()=>s.options,v=>{const b=new Set(v.map(w=>p(w)));C.createdOptions=C.createdOptions.filter(w=>!b.has(p(w)))});function u(v){const b=w=>p(w)===v;return s.options&&s.options.some(b)||C.createdOptions.some(b)}function c(v){d.value&&(s.multiple&&v.created?A.value++:h.value=v)}function f(v){if(d.value)if(v&&v.length>0){if(u(v)){C.createdOptions=C.createdOptions.filter(w=>p(w)!==C.previousQuery);return}const b={[i.value.value]:v,[i.value.label]:v,created:!0,[i.value.disabled]:!1};C.createdOptions.length>=A.value?C.createdOptions[A.value]=b:C.createdOptions.push(b)}else if(s.multiple)C.createdOptions.length=A.value;else{const b=h.value;C.createdOptions.length=0,b&&b.created&&C.createdOptions.push(b)}}function m(v){if(!d.value||!v||!v.created||v.created&&s.reserveKeyword&&C.inputValue===p(v))return;const b=C.createdOptions.findIndex(w=>y(w)===y(v));~b&&(C.createdOptions.splice(b,1),A.value--)}function g(){d.value&&(C.createdOptions.length=0,A.value=0)}return{createNewOption:f,removeNewOption:m,selectNewOption:c,clearAllNewOption:g}}const $te=(s,C)=>{const{t:i}=Yr(),p=t.useSlots(),y=zt("select"),A=zt("input"),{form:h,formItem:d}=ls(),{inputId:u}=mo(s,{formItemContext:d}),{aliasProps:c,getLabel:f,getValue:m,getDisabled:g,getOptions:v}=ph(s),{valueOnClear:b,isEmptyValue:w}=sh(s),_=t.reactive({inputValue:"",cachedOptions:[],createdOptions:[],hoveringIndex:-1,inputHovering:!1,collapseItemWidth:0,previousQuery:null,previousValue:void 0,selectedLabel:"",menuVisibleOnFocus:!1,isBeforeHide:!1}),x=t.ref(-1),E=t.ref(!1),k=t.ref(),P=t.ref(),D=t.ref(),R=t.ref(),z=t.ref(),F=t.ref(),H=t.ref(),$=t.ref(),K=t.ref(),G=t.ref(),{isComposing:j,handleCompositionStart:N,handleCompositionEnd:I,handleCompositionUpdate:L}=ih({afterComposition:ft=>Ue(ft)}),U=ri(),{wrapperRef:O,isFocused:Q,handleBlur:W}=vl(z,{disabled:U,afterFocus(){s.automaticDropdown&&!ae.value&&(ae.value=!0,_.menuVisibleOnFocus=!0)},beforeBlur(ft){var bt,Ft;return((bt=D.value)==null?void 0:bt.isFocusInsideContent(ft))||((Ft=R.value)==null?void 0:Ft.isFocusInsideContent(ft))},afterBlur(){var ft;ae.value=!1,_.menuVisibleOnFocus=!1,s.validateEvent&&((ft=d==null?void 0:d.validate)==null||ft.call(d,"blur").catch(Xr))}}),Z=t.computed(()=>ve("")),J=t.computed(()=>s.loading?!1:s.options.length>0||_.createdOptions.length>0),ne=t.ref([]),ae=t.ref(!1),ce=t.computed(()=>(h==null?void 0:h.statusIcon)??!1),q=t.computed(()=>{const ft=ne.value.length*s.itemHeight;return ft>s.height?s.height:ft}),fe=t.computed(()=>s.multiple?nr(s.modelValue)&&s.modelValue.length>0:!w(s.modelValue)),re=t.computed(()=>s.clearable&&!U.value&&fe.value&&(Q.value||_.inputHovering)),te=t.computed(()=>s.remote&&s.filterable&&!s.remoteShowSuffix?"":s.suffixIcon),le=t.computed(()=>te.value&&y.is("reverse",ae.value)),de=t.computed(()=>(d==null?void 0:d.validateState)||""),he=t.computed(()=>{if(de.value)return Mm[de.value]}),ue=t.computed(()=>s.remote?s.debounce:0),pe=t.computed(()=>s.remote&&!_.inputValue&&!J.value),se=t.computed(()=>s.loading?s.loadingText||i("el.select.loading"):s.filterable&&_.inputValue&&J.value&&ne.value.length===0?s.noMatchText||i("el.select.noMatch"):J.value?null:s.noDataText||i("el.select.noData")),V=t.computed(()=>s.filterable&&Nr(s.filterMethod)),Ce=t.computed(()=>s.filterable&&s.remote&&Nr(s.remoteMethod)),ve=ft=>{const bt=new RegExp(V0(ft),"i"),Ft=lt=>V.value||Ce.value?!0:ft?bt.test(f(lt)||""):!0;return s.loading?[]:[..._.createdOptions,...s.options].reduce((lt,fr)=>{const Fr=v(fr);if(nr(Fr)){const Br=Fr.filter(Ft);Br.length>0&<.push({label:f(fr),type:"Group"},...Br)}else(s.remote||Ft(fr))&<.push(fr);return lt},[])},ye=()=>{ne.value=ve(_.inputValue)},Ae=t.computed(()=>{const ft=new Map;return Z.value.forEach((bt,Ft)=>{ft.set(Bt(m(bt)),{option:bt,index:Ft})}),ft}),me=t.computed(()=>{const ft=new Map;return ne.value.forEach((bt,Ft)=>{ft.set(Bt(m(bt)),{option:bt,index:Ft})}),ft}),be=t.computed(()=>ne.value.every(ft=>g(ft))),we=ji(),Te=t.computed(()=>we.value==="small"?"small":"default"),He=()=>{var bt;if(lr(s.fitInputWidth)){x.value=s.fitInputWidth;return}const ft=((bt=k.value)==null?void 0:bt.offsetWidth)||200;!s.fitInputWidth&&J.value?t.nextTick(()=>{x.value=Math.max(ft,je())}):x.value=ft},je=()=>{var Fr,Br;const ft=document.createElement("canvas").getContext("2d"),bt=y.be("dropdown","item"),Ft=(((Br=(Fr=$.value)==null?void 0:Fr.listRef)==null?void 0:Br.innerRef)||document).querySelector(`.${bt}`);if(Ft===null||ft===null)return 0;const lt=getComputedStyle(Ft),fr=Number.parseFloat(lt.paddingLeft)+Number.parseFloat(lt.paddingRight);return ft.font=`bold ${lt.font.replace(new RegExp(`\\b${lt.fontWeight}\\b`),"")}`,ne.value.reduce((gn,Qr)=>{const ln=ft.measureText(f(Qr));return Math.max(ln.width,gn)},0)+fr},qe=()=>{if(!P.value)return 0;const ft=window.getComputedStyle(P.value);return Number.parseFloat(ft.gap||"6px")},tt=t.computed(()=>{const ft=qe();return{maxWidth:`calc(100% - ${(s.filterable&&!U.value?ft+11:0)+(G.value&&s.maxCollapseTags===1?_.collapseItemWidth+ft:0)}px)`}}),mt=t.computed(()=>nr(s.modelValue)?s.modelValue.length===0&&!_.inputValue:s.filterable?!_.inputValue:!0),kt=t.computed(()=>{const ft=s.placeholder??i("el.select.placeholder");return s.multiple||!fe.value?ft:_.selectedLabel}),ht=t.computed(()=>{var ft,bt;return(bt=(ft=D.value)==null?void 0:ft.popperRef)==null?void 0:bt.contentRef}),yt=t.computed(()=>{if(s.multiple){const ft=s.modelValue.length;if(ft>0&&me.value.has(s.modelValue[ft-1])){const{index:bt}=me.value.get(s.modelValue[ft-1]);return bt}}else if(!w(s.modelValue)&&me.value.has(s.modelValue)){const{index:ft}=me.value.get(s.modelValue);return ft}return-1}),Lt=t.computed({get(){return ae.value&&(s.loading||!pe.value||s.remote&&!!p.empty)&&(!E.value||!Ys(_.previousQuery)||J.value)},set(ft){ae.value=ft}}),We=t.computed(()=>s.multiple?s.collapseTags?_.cachedOptions.slice(0,s.maxCollapseTags):_.cachedOptions:[]),Oe=t.computed(()=>s.multiple?s.collapseTags?_.cachedOptions.slice(s.maxCollapseTags):[]:[]),{createNewOption:Ke,removeNewOption:nt,selectNewOption:Xe,clearAllNewOption:Ge}=Hte(s,_),ze=ft=>{var bt;U.value||s.filterable&&ae.value&&ft&&!((bt=H.value)!=null&&bt.contains(ft.target))||(_.menuVisibleOnFocus?_.menuVisibleOnFocus=!1:ae.value=!ae.value)},Ct=()=>{_.inputValue.length>0&&!ae.value&&(ae.value=!0),Ke(_.inputValue),t.nextTick(()=>{Ot(_.inputValue)})},It=Hf(()=>{Ct(),E.value=!1},ue),Ot=ft=>{_.previousQuery===ft||j.value||(_.previousQuery=ft,s.filterable&&Nr(s.filterMethod)?s.filterMethod(ft):s.filterable&&s.remote&&Nr(s.remoteMethod)&&s.remoteMethod(ft),s.defaultFirstOption&&(s.filterable||s.remote)&&ne.value.length?t.nextTick(Ze):t.nextTick(Le))},Ze=()=>{const ft=ne.value.filter(lt=>!lt.disabled&<.type!=="Group"),bt=ft.find(lt=>lt.created),Ft=ft[0];_.hoveringIndex=_t(ne.value,bt||Ft)},gt=ft=>{hi(s.modelValue,ft)||C(Gr,ft)},vt=ft=>{C(Pr,ft),gt(ft),_.previousValue=s.multiple?String(ft):ft,t.nextTick(()=>{if(s.multiple&&nr(s.modelValue)){const bt=_.cachedOptions.slice(),Ft=s.modelValue.map(lt=>Ve(lt,bt));hi(_.cachedOptions,Ft)||(_.cachedOptions=Ft)}else ot(!0)})},_t=(ft=[],bt)=>{if(!mn(bt))return ft.indexOf(bt);const Ft=s.valueKey;let lt=-1;return ft.some((fr,Fr)=>Si(fr,Ft)===Si(bt,Ft)?(lt=Fr,!0):!1),lt},Bt=ft=>mn(ft)?Si(ft,s.valueKey):ft,at=()=>{He()},jt=ft=>{C("end-reached",ft)},rr=()=>{_.collapseItemWidth=G.value.getBoundingClientRect().width},Dt=()=>{var ft,bt;(bt=(ft=D.value)==null?void 0:ft.updatePopper)==null||bt.call(ft)},rt=()=>{var ft,bt;(bt=(ft=R.value)==null?void 0:ft.updatePopper)==null||bt.call(ft)},ct=ft=>{const bt=m(ft);if(s.multiple){let Ft=s.modelValue.slice();const lt=_t(Ft,bt);lt>-1?(Ft=[...Ft.slice(0,lt),...Ft.slice(lt+1)],_.cachedOptions.splice(lt,1),nt(ft)):(s.multipleLimit<=0||Ft.length<s.multipleLimit)&&(Ft=[...Ft,bt],_.cachedOptions.push(ft),Xe(ft)),vt(Ft),ft.created&&Ot(""),s.filterable&&(ft.created||!s.reserveKeyword)&&(_.inputValue="")}else _.selectedLabel=f(ft),!hi(s.modelValue,bt)&&vt(bt),ae.value=!1,Xe(ft),ft.created||Ge();qt()},Rt=(ft,bt)=>{let Ft=s.modelValue.slice();const lt=_t(Ft,m(bt));lt>-1&&!U.value&&(Ft=[...s.modelValue.slice(0,lt),...s.modelValue.slice(lt+1)],_.cachedOptions.splice(lt,1),vt(Ft),C("remove-tag",m(bt)),nt(bt)),ft.stopPropagation(),qt()},qt=()=>{var ft;(ft=z.value)==null||ft.focus()},pr=()=>{var ft;if(ae.value){ae.value=!1,t.nextTick(()=>{var bt;return(bt=z.value)==null?void 0:bt.blur()});return}(ft=z.value)==null||ft.blur()},ar=()=>{_.inputValue.length>0?_.inputValue="":ae.value=!1},Ir=ft=>yE(ft,bt=>!_.cachedOptions.some(Ft=>m(Ft)===bt&&g(Ft))),Lr=ft=>{const bt=Dn(ft);if(s.multiple&&bt!==Gt.delete&&_.inputValue.length===0){ft.preventDefault();const Ft=s.modelValue.slice(),lt=Ir(Ft);if(lt<0)return;const fr=Ft[lt];Ft.splice(lt,1);const Fr=_.cachedOptions[lt];_.cachedOptions.splice(lt,1),nt(Fr),vt(Ft),C("remove-tag",fr)}},dr=()=>{let ft;nr(s.modelValue)?ft=[]:ft=b.value,_.selectedLabel="",ae.value=!1,vt(ft),C("clear"),Ge(),qt()},zr=(ft,bt=void 0)=>{const Ft=ne.value;if(!["forward","backward"].includes(ft)||U.value||Ft.length<=0||be.value||j.value)return;if(!ae.value)return ze();en(bt)&&(bt=_.hoveringIndex);let lt=-1;ft==="forward"?(lt=bt+1,lt>=Ft.length&&(lt=0)):ft==="backward"&&(lt=bt-1,(lt<0||lt>=Ft.length)&&(lt=Ft.length-1));const fr=Ft[lt];if(g(fr)||fr.type==="Group")return zr(ft,lt);_.hoveringIndex=lt,At(lt)},Se=()=>{if(ae.value)~_.hoveringIndex&&ne.value[_.hoveringIndex]&&ct(ne.value[_.hoveringIndex]);else return ze()},Re=ft=>{_.hoveringIndex=ft??-1},Le=()=>{if(!s.multiple)_.hoveringIndex=ne.value.findIndex(ft=>Bt(m(ft))===Bt(s.modelValue));else{const ft=s.modelValue.length;if(ft>0){const bt=s.modelValue[ft-1];_.hoveringIndex=ne.value.findIndex(Ft=>Bt(bt)===Bt(m(Ft)))}else _.hoveringIndex=-1}},Ue=ft=>{if(_.inputValue=ft.target.value,s.remote)E.value=!0,It();else return Ct()},Je=ft=>{if(ae.value=!1,Q.value){const bt=new FocusEvent("blur",ft);W(bt)}},Ye=()=>(_.isBeforeHide=!1,t.nextTick(()=>{~yt.value&&At(yt.value)})),At=ft=>{$.value.scrollToItem(ft)},Ve=(ft,bt)=>{const Ft=Bt(ft);if(Ae.value.has(Ft)){const{option:lt}=Ae.value.get(Ft);return lt}if(bt&&bt.length){const lt=bt.find(fr=>Bt(m(fr))===Ft);if(lt)return lt}return{[c.value.value]:ft,[c.value.label]:ft}},st=ft=>{var bt;return((bt=Ae.value.get(m(ft)))==null?void 0:bt.index)??-1},ot=(ft=!1)=>{if(s.multiple)if(s.modelValue.length>0){const bt=_.cachedOptions.slice();_.cachedOptions.length=0,_.previousValue=s.modelValue.toString();for(const Ft of s.modelValue){const lt=Ve(Ft,bt);_.cachedOptions.push(lt)}}else _.cachedOptions=[],_.previousValue=void 0;else if(fe.value){_.previousValue=s.modelValue;const bt=ne.value,Ft=bt.findIndex(lt=>Bt(m(lt))===Bt(s.modelValue));~Ft?_.selectedLabel=f(bt[Ft]):(!_.selectedLabel||ft)&&(_.selectedLabel=Bt(s.modelValue))}else _.selectedLabel="",_.previousValue=void 0;Ge(),He()};t.watch(()=>s.fitInputWidth,()=>{He()}),t.watch(ae,ft=>{ft?(s.persistent||He(),Ot("")):(_.inputValue="",_.previousQuery=null,_.isBeforeHide=!0,_.menuVisibleOnFocus=!1,Ke(""))}),t.watch(()=>s.modelValue,(ft,bt)=>{var Ft;(!ft||nr(ft)&&ft.length===0||s.multiple&&!hi(ft.toString(),_.previousValue)||!s.multiple&&Bt(ft)!==Bt(_.previousValue))&&ot(!0),!hi(ft,bt)&&s.validateEvent&&((Ft=d==null?void 0:d.validate)==null||Ft.call(d,"change").catch(Xr))},{deep:!0}),t.watch(()=>s.options,()=>{const ft=z.value;(!ft||ft&&document.activeElement!==ft)&&ot()},{deep:!0,flush:"post"}),t.watch(()=>ne.value,()=>(He(),$.value&&t.nextTick($.value.resetScrollTop))),t.watchEffect(()=>{_.isBeforeHide||ye()}),t.watchEffect(()=>{const{valueKey:ft,options:bt}=s,Ft=new Map;for(const lt of bt){const fr=m(lt);let Fr=fr;if(mn(Fr)&&(Fr=Si(fr,ft)),Ft.get(Fr)){wn("ElSelectV2","The option values you provided seem to be duplicated, which may cause some problems, please check.");break}else Ft.set(Fr,!0)}}),t.onMounted(()=>{ot()}),ti(k,()=>ms(at)),ti(O,Dt),ti(K,rt),ti(G,rr);let Et;return t.watch(()=>Lt.value,ft=>{ft?Et=ti($,Dt).stop:(Et==null||Et(),Et=void 0),C("visible-change",ft)}),{inputId:u,collapseTagSize:Te,currentPlaceholder:kt,expanded:ae,emptyText:se,popupHeight:q,debounce:ue,allOptions:Z,allOptionsValueMap:Ae,filteredOptions:ne,iconComponent:te,iconReverse:le,tagStyle:tt,popperSize:x,dropdownMenuVisible:Lt,hasModelValue:fe,shouldShowPlaceholder:mt,selectDisabled:U,selectSize:we,needStatusIcon:ce,showClearBtn:re,states:_,isFocused:Q,nsSelect:y,nsInput:A,inputRef:z,menuRef:$,tagMenuRef:K,tooltipRef:D,tagTooltipRef:R,selectRef:k,wrapperRef:O,selectionRef:P,prefixRef:F,suffixRef:H,collapseItemRef:G,popperRef:ht,validateState:de,validateIcon:he,showTagList:We,collapseTagList:Oe,debouncedOnInputChange:It,deleteTag:Rt,getLabel:f,getValue:m,getDisabled:g,getValueKey:Bt,getIndex:st,handleClear:dr,handleClickOutside:Je,handleDel:Lr,handleEsc:ar,focus:qt,blur:pr,handleMenuEnter:Ye,handleResize:at,updateTooltip:Dt,updateTagTooltip:rt,updateOptions:ye,toggleMenu:ze,scrollTo:At,onInput:Ue,onKeyboardNavigate:zr,onKeyboardSelect:Se,onEndReached:jt,onSelect:ct,onHover:Re,handleCompositionStart:N,handleCompositionEnd:I,handleCompositionUpdate:L}};var Gte=t.defineComponent({name:"ElSelectV2",components:{ElSelectMenu:zte,ElTag:oc,ElTooltip:Ji,ElIcon:ir},directives:{ClickOutside:sc},props:Mte,emits:Ite,setup(s,{emit:C}){const i=t.computed(()=>{const{modelValue:u,multiple:c}=s,f=c?[]:void 0;return nr(u)?c?u:f:c?f:u}),p=$te(t.reactive({...t.toRefs(s),modelValue:i}),C),{calculatorRef:y,inputStyle:A}=j0(),h=ws();t.provide(Ub,{props:t.reactive({...t.toRefs(s),height:p.popupHeight,modelValue:i}),expanded:p.expanded,tooltipRef:p.tooltipRef,contentId:h,onSelect:p.onSelect,onHover:p.onHover,onKeyboardNavigate:p.onKeyboardNavigate,onKeyboardSelect:p.onKeyboardSelect});const d=t.computed(()=>s.multiple?p.states.cachedOptions.map(u=>p.getLabel(u)):p.states.selectedLabel);return{...p,modelValue:i,selectedLabel:d,calculatorRef:y,inputStyle:A,contentId:h,BORDER_HORIZONTAL_WIDTH:2}}});const Qte=["id","value","autocomplete","tabindex","aria-expanded","aria-label","disabled","aria-controls","aria-activedescendant","readonly","name"],Wte=["textContent"],Kte={key:1};function Xte(s,C,i,p,y,A){const h=t.resolveComponent("el-tag"),d=t.resolveComponent("el-tooltip"),u=t.resolveComponent("el-icon"),c=t.resolveComponent("el-select-menu"),f=t.resolveDirective("click-outside");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref:"selectRef",class:t.normalizeClass([s.nsSelect.b(),s.nsSelect.m(s.selectSize)]),onMouseenter:C[15]||(C[15]=m=>s.states.inputHovering=!0),onMouseleave:C[16]||(C[16]=m=>s.states.inputHovering=!1)},[t.createVNode(d,{ref:"tooltipRef",visible:s.dropdownMenuVisible,teleported:s.teleported,"popper-class":[s.nsSelect.e("popper"),s.popperClass],"popper-style":s.popperStyle,"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"popper-options":s.popperOptions,"fallback-placements":s.fallbackPlacements,effect:s.effect,placement:s.placement,pure:"",transition:`${s.nsSelect.namespace.value}-zoom-in-top`,trigger:"click",persistent:s.persistent,"append-to":s.appendTo,"show-arrow":s.showArrow,offset:s.offset,onBeforeShow:s.handleMenuEnter,onHide:C[14]||(C[14]=m=>s.states.isBeforeHide=!1)},{default:t.withCtx(()=>{var m;return[t.createElementVNode("div",{ref:"wrapperRef",class:t.normalizeClass([s.nsSelect.e("wrapper"),s.nsSelect.is("focused",s.isFocused),s.nsSelect.is("hovering",s.states.inputHovering),s.nsSelect.is("filterable",s.filterable),s.nsSelect.is("disabled",s.selectDisabled)]),onClick:C[11]||(C[11]=t.withModifiers((...g)=>s.toggleMenu&&s.toggleMenu(...g),["prevent"]))},[s.$slots.prefix?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"prefixRef",class:t.normalizeClass(s.nsSelect.e("prefix"))},[t.renderSlot(s.$slots,"prefix")],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{ref:"selectionRef",class:t.normalizeClass([s.nsSelect.e("selection"),s.nsSelect.is("near",s.multiple&&!s.$slots.prefix&&!!s.modelValue.length)])},[s.multiple?t.renderSlot(s.$slots,"tag",{key:0,data:s.states.cachedOptions,deleteTag:s.deleteTag,selectDisabled:s.selectDisabled},()=>{var g,v,b,w,_,x,E,k,P,D,R,z,F;return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.showTagList,H=>(t.openBlock(),t.createElementBlock("div",{key:s.getValueKey(s.getValue(H)),class:t.normalizeClass(s.nsSelect.e("selected-item")),style:t.normalizeStyle(s.tagStyle)},[t.createVNode(h,{closable:!s.selectDisabled&&!s.getDisabled(H),size:s.collapseTagSize,type:s.tagType,effect:s.tagEffect,"disable-transitions":"",onClose:$=>s.deleteTag($,H)},{default:t.withCtx(()=>[t.createElementVNode("span",{class:t.normalizeClass(s.nsSelect.e("tags-text"))},[t.renderSlot(s.$slots,"label",{index:s.getIndex(H),label:s.getLabel(H),value:s.getValue(H)},()=>[t.createTextVNode(t.toDisplayString(s.getLabel(H)),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],6))),128)),s.collapseTags&&s.states.cachedOptions.length>s.maxCollapseTags?(t.openBlock(),t.createBlock(d,{key:0,ref:"tagTooltipRef",disabled:s.dropdownMenuVisible||!s.collapseTagsTooltip,"fallback-placements":((g=s.tagTooltip)==null?void 0:g.fallbackPlacements)??["bottom","top","right","left"],effect:((v=s.tagTooltip)==null?void 0:v.effect)??s.effect,placement:((b=s.tagTooltip)==null?void 0:b.placement)??"bottom","popper-class":((w=s.tagTooltip)==null?void 0:w.popperClass)??s.popperClass,"popper-style":((_=s.tagTooltip)==null?void 0:_.popperStyle)??s.popperStyle,teleported:((x=s.tagTooltip)==null?void 0:x.teleported)??s.teleported,"append-to":((E=s.tagTooltip)==null?void 0:E.appendTo)??s.appendTo,"popper-options":((k=s.tagTooltip)==null?void 0:k.popperOptions)??s.popperOptions,transition:(P=s.tagTooltip)==null?void 0:P.transition,"show-after":(D=s.tagTooltip)==null?void 0:D.showAfter,"hide-after":(R=s.tagTooltip)==null?void 0:R.hideAfter,"auto-close":(z=s.tagTooltip)==null?void 0:z.autoClose,offset:(F=s.tagTooltip)==null?void 0:F.offset},{default:t.withCtx(()=>[t.createElementVNode("div",{ref:"collapseItemRef",class:t.normalizeClass([s.nsSelect.e("selected-item"),s.nsSelect.e("collapse-item")])},[t.createVNode(h,{closable:!1,size:s.collapseTagSize,type:s.tagType,effect:s.tagEffect,"disable-transitions":""},{default:t.withCtx(()=>[t.createElementVNode("span",{class:t.normalizeClass(s.nsSelect.e("tags-text"))}," + "+t.toDisplayString(s.states.cachedOptions.length-s.maxCollapseTags),3)]),_:1},8,["size","type","effect"])],2)]),content:t.withCtx(()=>[t.createElementVNode("div",{ref:"tagMenuRef",class:t.normalizeClass(s.nsSelect.e("selection"))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.collapseTagList,H=>(t.openBlock(),t.createElementBlock("div",{key:s.getValueKey(s.getValue(H)),class:t.normalizeClass(s.nsSelect.e("selected-item"))},[t.createVNode(h,{class:"in-tooltip",closable:!s.selectDisabled&&!s.getDisabled(H),size:s.collapseTagSize,type:s.tagType,effect:s.tagEffect,"disable-transitions":"",onClose:$=>s.deleteTag($,H)},{default:t.withCtx(()=>[t.createElementVNode("span",{class:t.normalizeClass(s.nsSelect.e("tags-text"))},[t.renderSlot(s.$slots,"label",{index:s.getIndex(H),label:s.getLabel(H),value:s.getValue(H)},()=>[t.createTextVNode(t.toDisplayString(s.getLabel(H)),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","fallback-placements","effect","placement","popper-class","popper-style","teleported","append-to","popper-options","transition","show-after","hide-after","auto-close","offset"])):t.createCommentVNode("v-if",!0)]}):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass([s.nsSelect.e("selected-item"),s.nsSelect.e("input-wrapper"),s.nsSelect.is("hidden",!s.filterable||s.selectDisabled||s.multiple&&!s.states.inputValue&&!s.isFocused)])},[t.createElementVNode("input",{id:s.inputId,ref:"inputRef",value:s.states.inputValue,style:t.normalizeStyle(s.inputStyle),autocomplete:s.autocomplete,tabindex:s.tabindex,"aria-autocomplete":"none","aria-haspopup":"listbox",autocapitalize:"off","aria-expanded":s.expanded,"aria-label":s.ariaLabel,class:t.normalizeClass([s.nsSelect.e("input"),s.nsSelect.is(s.selectSize)]),disabled:s.selectDisabled,role:"combobox","aria-controls":s.contentId,"aria-activedescendant":s.states.hoveringIndex>=0?`${s.contentId}-${s.states.hoveringIndex}`:"",readonly:!s.filterable,spellcheck:"false",type:"text",name:s.name,onInput:C[0]||(C[0]=(...g)=>s.onInput&&s.onInput(...g)),onChange:C[1]||(C[1]=t.withModifiers(()=>{},["stop"])),onCompositionstart:C[2]||(C[2]=(...g)=>s.handleCompositionStart&&s.handleCompositionStart(...g)),onCompositionupdate:C[3]||(C[3]=(...g)=>s.handleCompositionUpdate&&s.handleCompositionUpdate(...g)),onCompositionend:C[4]||(C[4]=(...g)=>s.handleCompositionEnd&&s.handleCompositionEnd(...g)),onKeydown:[C[5]||(C[5]=t.withKeys(t.withModifiers(g=>s.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),C[6]||(C[6]=t.withKeys(t.withModifiers(g=>s.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),C[7]||(C[7]=t.withKeys(t.withModifiers((...g)=>s.onKeyboardSelect&&s.onKeyboardSelect(...g),["stop","prevent"]),["enter"])),C[8]||(C[8]=t.withKeys(t.withModifiers((...g)=>s.handleEsc&&s.handleEsc(...g),["stop","prevent"]),["esc"])),C[9]||(C[9]=t.withKeys(t.withModifiers((...g)=>s.handleDel&&s.handleDel(...g),["stop"]),["delete"]))],onClick:C[10]||(C[10]=t.withModifiers((...g)=>s.toggleMenu&&s.toggleMenu(...g),["stop"]))},null,46,Qte),s.filterable?(t.openBlock(),t.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:t.normalizeClass(s.nsSelect.e("input-calculator")),textContent:t.toDisplayString(s.states.inputValue)},null,10,Wte)):t.createCommentVNode("v-if",!0)],2),s.shouldShowPlaceholder?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([s.nsSelect.e("selected-item"),s.nsSelect.e("placeholder"),s.nsSelect.is("transparent",!s.hasModelValue||s.expanded&&!s.states.inputValue)])},[s.hasModelValue?t.renderSlot(s.$slots,"label",{key:0,index:((m=s.allOptionsValueMap.get(s.modelValue))==null?void 0:m.index)??-1,label:s.currentPlaceholder,value:s.modelValue},()=>[t.createElementVNode("span",null,t.toDisplayString(s.currentPlaceholder),1)]):(t.openBlock(),t.createElementBlock("span",Kte,t.toDisplayString(s.currentPlaceholder),1))],2)):t.createCommentVNode("v-if",!0)],2),t.createElementVNode("div",{ref:"suffixRef",class:t.normalizeClass(s.nsSelect.e("suffix"))},[s.iconComponent?t.withDirectives((t.openBlock(),t.createBlock(u,{key:0,class:t.normalizeClass([s.nsSelect.e("caret"),s.nsInput.e("icon"),s.iconReverse])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.iconComponent)))]),_:1},8,["class"])),[[t.vShow,!s.showClearBtn]]):t.createCommentVNode("v-if",!0),s.showClearBtn&&s.clearIcon?(t.openBlock(),t.createBlock(u,{key:1,class:t.normalizeClass([s.nsSelect.e("caret"),s.nsInput.e("icon"),s.nsSelect.e("clear")]),onClick:t.withModifiers(s.handleClear,["prevent","stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.clearIcon)))]),_:1},8,["class","onClick"])):t.createCommentVNode("v-if",!0),s.validateState&&s.validateIcon&&s.needStatusIcon?(t.openBlock(),t.createBlock(u,{key:2,class:t.normalizeClass([s.nsInput.e("icon"),s.nsInput.e("validateIcon"),s.nsInput.is("loading",s.validateState==="validating")])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.validateIcon)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],2)],2)]}),content:t.withCtx(()=>[t.createVNode(c,{id:s.contentId,ref:"menuRef",data:s.filteredOptions,width:s.popperSize-s.BORDER_HORIZONTAL_WIDTH,"hovering-index":s.states.hoveringIndex,"scrollbar-always-on":s.scrollbarAlwaysOn,"aria-label":s.ariaLabel,onEndReached:s.onEndReached},t.createSlots({default:t.withCtx(m=>[t.renderSlot(s.$slots,"default",t.normalizeProps(t.guardReactiveProps(m)))]),_:2},[s.$slots.header?{name:"header",fn:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(s.nsSelect.be("dropdown","header")),onClick:C[12]||(C[12]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(s.$slots,"header")],2)]),key:"0"}:void 0,s.$slots.loading&&s.loading?{name:"loading",fn:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(s.nsSelect.be("dropdown","loading"))},[t.renderSlot(s.$slots,"loading")],2)]),key:"1"}:s.loading||s.filteredOptions.length===0?{name:"empty",fn:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(s.nsSelect.be("dropdown","empty"))},[t.renderSlot(s.$slots,"empty",{},()=>[t.createElementVNode("span",null,t.toDisplayString(s.emptyText),1)])],2)]),key:"2"}:void 0,s.$slots.footer?{name:"footer",fn:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(s.nsSelect.be("dropdown","footer")),onClick:C[13]||(C[13]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(s.$slots,"footer")],2)]),key:"3"}:void 0]),1032,["id","data","width","hovering-index","scrollbar-always-on","aria-label","onEndReached"])]),_:3},8,["visible","teleported","popper-class","popper-style","popper-options","fallback-placements","effect","placement","transition","persistent","append-to","show-arrow","offset","onBeforeShow"])],34)),[[f,s.handleClickOutside,s.popperRef]])}var Yte=Yi(Gte,[["render",Xte]]);Tr(Yte);const Jte=Wt({animated:Boolean,count:{type:Number,default:1},rows:{type:Number,default:3},loading:{type:Boolean,default:!0},throttle:{type:et([Number,Object])}}),Zte=Wt({variant:{type:String,values:["circle","rect","h1","h3","text","caption","p","image","button"],default:"text"}});var qte=t.defineComponent({name:"ElSkeletonItem",__name:"skeleton-item",props:Zte,setup(s){const C=zt("skeleton");return(i,p)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(C).e("item"),t.unref(C).e(s.variant)])},[s.variant==="image"?(t.openBlock(),t.createBlock(t.unref(Zt.PictureFilled),{key:0})):t.createCommentVNode("v-if",!0)],2))}}),bA=qte,ere=t.defineComponent({name:"ElSkeleton",__name:"skeleton",props:Jte,setup(s,{expose:C}){const i=s,p=zt("skeleton"),y=l7(t.toRef(i,"loading"),i.throttle);return C({uiLoading:y}),(A,h)=>t.unref(y)?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:0,class:[t.unref(p).b(),t.unref(p).is("animated",s.animated)]},A.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.count,d=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:d},[t.unref(y)?t.renderSlot(A.$slots,"template",{key:d},()=>[t.createVNode(bA,{class:t.normalizeClass(t.unref(p).is("first")),variant:"p"},null,8,["class"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.rows,u=>(t.openBlock(),t.createBlock(bA,{key:u,class:t.normalizeClass([t.unref(p).e("paragraph"),t.unref(p).is("last",u===s.rows&&s.rows>1)]),variant:"p"},null,8,["class"]))),128))]):t.createCommentVNode("v-if",!0)],64))),128))],16)):t.renderSlot(A.$slots,"default",t.normalizeProps(t.mergeProps({key:1},A.$attrs)))}}),tre=ere;Tr(tre,{SkeletonItem:bA}),ai(bA);const TM=Symbol("sliderContextKey"),rre=Wt({modelValue:{type:et([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:et([Number,String]),default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:Qi,inputSize:Qi,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:et(Function),default:void 0},disabled:{type:Boolean,default:void 0},range:Boolean,vertical:Boolean,height:String,rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:et(Function),default:void 0},tooltipClass:{type:et([String,Array,Object,Boolean]),default:void 0},placement:{type:String,values:Oa,default:"top"},marks:{type:et(Object)},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},...Vs(["ariaLabel"])}),zb=s=>lr(s)||nr(s)&&s.every(lr),nre={[Pr]:zb,[Li]:zb,[Gr]:zb},ire=(s,C,i)=>{const p=t.ref();return t.onMounted(async()=>{s.range?(nr(s.modelValue)?(C.firstValue=Math.max(s.min,s.modelValue[0]),C.secondValue=Math.min(s.max,s.modelValue[1])):(C.firstValue=s.min,C.secondValue=s.max),C.oldValue=[C.firstValue,C.secondValue]):(!lr(s.modelValue)||Number.isNaN(s.modelValue)?C.firstValue=s.min:C.firstValue=Math.min(s.max,Math.max(s.min,s.modelValue)),C.oldValue=C.firstValue),vn(window,"resize",i),await t.nextTick(),i()}),{sliderWrapper:p}},sre=s=>{const C=t.computed(()=>s.marks?Object.keys(s.marks).map(Number.parseFloat).sort((i,p)=>i-p).filter(i=>i<=s.max&&i>=s.min).map(i=>({point:i,position:(i-s.min)*100/(s.max-s.min),mark:s.marks[i]})):[]);return t.watchEffect(()=>{if(s.step==="mark"&&!s.marks&&wn("ElSlider","marks prop must be provided when step is mark"),s.marks){const i=Object.keys(s.marks),p=C.value.map(A=>A.point),y=i.filter(A=>{const h=Number.parseFloat(A);return Number.isNaN(h)||!p.includes(h)});y.length>0&&wn("ElSlider",`Some marks keys are invalid (not a number or out of [min, max]): [${y.map(A=>`'${A}'`).join(", ")}] and will be ignored.`)}}),C},ore=(s,C,i)=>{const{formItem:p}=ls(),y=t.shallowRef(),A=t.ref(),h=t.ref(),d={firstButton:A,secondButton:h},u=ri(),c=t.computed(()=>Math.min(C.firstValue,C.secondValue)),f=t.computed(()=>Math.max(C.firstValue,C.secondValue)),m=t.computed(()=>s.range?`${100*(f.value-c.value)/(s.max-s.min)}%`:`${100*(C.firstValue-s.min)/(s.max-s.min)}%`),g=t.computed(()=>s.range?`${100*(c.value-s.min)/(s.max-s.min)}%`:"0%"),v=t.computed(()=>s.vertical?{height:s.height}:{}),b=t.computed(()=>s.vertical?{height:m.value,bottom:g.value}:{width:m.value,left:g.value}),w=()=>{y.value&&(C.sliderSize=y.value.getBoundingClientRect()[s.vertical?"height":"width"])},_=K=>{const G=s.min+K*(s.max-s.min)/100;if(!s.range)return A;let j;return Math.abs(c.value-G)<Math.abs(f.value-G)?j=C.firstValue<C.secondValue?"firstButton":"secondButton":j=C.firstValue>C.secondValue?"firstButton":"secondButton",d[j]},x=K=>{const G=_(K);return G.value.setPosition(K),G},E=K=>{C.firstValue=K??s.min,P(s.range?[c.value,f.value]:K??s.min)},k=K=>{C.secondValue=K,s.range&&P([c.value,f.value])},P=K=>{i(Pr,K),i(Li,K)},D=async()=>{await t.nextTick(),i(Gr,s.range?[c.value,f.value]:s.modelValue)},R=K=>{var j,N,I,L;if(u.value||C.dragging)return;w();let G=0;if(s.vertical){const U=((N=(j=K.touches)==null?void 0:j.item(0))==null?void 0:N.clientY)??K.clientY;G=(y.value.getBoundingClientRect().bottom-U)/C.sliderSize*100}else G=((((L=(I=K.touches)==null?void 0:I.item(0))==null?void 0:L.clientX)??K.clientX)-y.value.getBoundingClientRect().left)/C.sliderSize*100;if(!(G<0||G>100))return x(G)};return{elFormItem:p,slider:y,firstButton:A,secondButton:h,sliderDisabled:u,minValue:c,maxValue:f,runwayStyle:v,barStyle:b,resetSize:w,setPosition:x,emitChange:D,onSliderWrapperPrevent:K=>{var G,j;((G=d.firstButton.value)!=null&&G.dragging||(j=d.secondButton.value)!=null&&j.dragging)&&K.preventDefault()},onSliderClick:K=>{R(K)&&D()},onSliderDown:async K=>{const G=R(K);G&&(await t.nextTick(),G.value.onButtonDown(K))},onSliderMarkerDown:K=>{u.value||C.dragging||x(K)&&D()},setFirstValue:E,setSecondValue:k}},are=(s,C,i,p)=>({stops:t.computed(()=>{if(!s.showStops||s.min>s.max)return[];if(s.step==="mark"||s.step===0)return s.step===0&&wn("ElSlider","step should not be 0."),[];const h=Math.ceil((s.max-s.min)/s.step),d=100*s.step/(s.max-s.min),u=Array.from({length:h-1}).map((c,f)=>(f+1)*d);return s.range?u.filter(c=>c<100*(i.value-s.min)/(s.max-s.min)||c>100*(p.value-s.min)/(s.max-s.min)):u.filter(c=>c>100*(C.firstValue-s.min)/(s.max-s.min))}),getStopStyle:h=>s.vertical?{bottom:`${h}%`}:{left:`${h}%`}}),lre=(s,C,i,p,y,A)=>{const h=c=>{y(Pr,c),y(Li,c)},d=()=>s.range?![i.value,p.value].every((c,f)=>c===C.oldValue[f]):s.modelValue!==C.oldValue,u=()=>{var f,m;s.min>s.max&&oi("Slider","min should not be greater than max.");const c=s.modelValue;s.range&&nr(c)?c[1]<s.min?h([s.min,s.min]):c[0]>s.max?h([s.max,s.max]):c[0]<s.min?h([s.min,c[1]]):c[1]>s.max?h([c[0],s.max]):(C.firstValue=c[0],C.secondValue=c[1],d()&&(s.validateEvent&&((f=A==null?void 0:A.validate)==null||f.call(A,"change").catch(Xr)),C.oldValue=c.slice())):!s.range&&lr(c)&&!Number.isNaN(c)&&(c<s.min?h(s.min):c>s.max?h(s.max):(C.firstValue=c,d()&&(s.validateEvent&&((m=A==null?void 0:A.validate)==null||m.call(A,"change").catch(Xr)),C.oldValue=c)))};u(),t.watch(()=>C.dragging,c=>{c||u()}),t.watch(()=>s.modelValue,(c,f)=>{C.dragging||nr(c)&&nr(f)&&c.every((m,g)=>m===f[g])&&C.firstValue===c[0]&&C.secondValue===c[1]||u()},{deep:!0}),t.watch(()=>[s.min,s.max],()=>{u()})},cre=(s,C,i)=>{const p=t.ref(),y=t.ref(!1),A=t.computed(()=>C.value instanceof Function);return{tooltip:p,tooltipVisible:y,formatValue:t.computed(()=>A.value&&C.value(s.modelValue)||s.modelValue),displayTooltip:Ra(()=>{i.value&&(y.value=!0)},50),hideTooltip:Ra(()=>{i.value&&(y.value=!1)},50)}},ure=(s,C,i)=>{const{disabled:p,min:y,max:A,step:h,showTooltip:d,persistent:u,precision:c,sliderSize:f,formatTooltip:m,emitChange:g,resetSize:v,updateDragging:b,markList:w}=t.inject(TM),{tooltip:_,tooltipVisible:x,formatValue:E,displayTooltip:k,hideTooltip:P}=cre(s,m,d),D=t.ref(),R=t.computed(()=>`${(s.modelValue-y.value)/(A.value-y.value)*100}%`),z=t.computed(()=>s.vertical?{bottom:R.value}:{left:R.value}),F=t.computed(()=>h.value==="mark"&&w.value.length>0),H=()=>{C.hovering=!0,k()},$=()=>{C.hovering=!1,C.dragging||P()},K=q=>{p.value||(q.preventDefault(),J(q),window.addEventListener("mousemove",ne),window.addEventListener("touchmove",ne),window.addEventListener("mouseup",ae),window.addEventListener("touchend",ae),window.addEventListener("contextmenu",ae),D.value.focus())},G=q=>{p.value||(C.newPosition=Number.parseFloat(R.value)+q/(A.value-y.value)*100,ce(C.newPosition),g())},j=q=>{if(p.value||!w.value.length)return;const fe=s.modelValue,re=Number.EPSILON,te=Math.abs(q);let le;if(q>0){const de=w.value.findIndex(he=>he.point>fe+re);if(de!==-1){const he=Math.min(de+te-1,w.value.length-1);le=w.value[he].point}}else{let de=-1;for(let he=w.value.length-1;he>=0;he--)if(w.value[he].point<fe-re){de=he;break}if(de!==-1){const he=Math.max(de-(te-1),0);le=w.value[he].point}}if(le!==void 0&&le!==fe){const de=(le-y.value)/(A.value-y.value)*100;ce(de),g()}},N=()=>{F.value?j(-1):lr(h.value)&&G(-h.value)},I=()=>{F.value?j(1):lr(h.value)&&G(h.value)},L=()=>{F.value?j(-4):lr(h.value)&&G(-h.value*4)},U=()=>{F.value?j(4):lr(h.value)&&G(h.value*4)},O=()=>{p.value||(ce(0),g())},Q=()=>{p.value||(ce(100),g())},W=q=>{const fe=Dn(q);let re=!0;switch(fe){case Gt.left:case Gt.down:N();break;case Gt.right:case Gt.up:I();break;case Gt.home:O();break;case Gt.end:Q();break;case Gt.pageDown:L();break;case Gt.pageUp:U();break;default:re=!1}re&&q.preventDefault()},Z=q=>{let fe,re;return q.type.startsWith("touch")?(re=q.touches[0].clientY,fe=q.touches[0].clientX):(re=q.clientY,fe=q.clientX),{clientX:fe,clientY:re}},J=q=>{C.dragging=!0,C.isClick=!0;const{clientX:fe,clientY:re}=Z(q);s.vertical?C.startY=re:C.startX=fe,C.startPosition=Number.parseFloat(R.value),C.newPosition=C.startPosition},ne=q=>{if(C.dragging){C.isClick=!1,k(),v();let fe;const{clientX:re,clientY:te}=Z(q);s.vertical?(C.currentY=te,fe=(C.startY-C.currentY)/f.value*100):(C.currentX=re,fe=(C.currentX-C.startX)/f.value*100),C.newPosition=C.startPosition+fe,ce(C.newPosition)}},ae=()=>{C.dragging&&(setTimeout(()=>{C.dragging=!1,C.hovering||P(),C.isClick||ce(C.newPosition),g()},0),window.removeEventListener("mousemove",ne),window.removeEventListener("touchmove",ne),window.removeEventListener("mouseup",ae),window.removeEventListener("touchend",ae),window.removeEventListener("contextmenu",ae))},ce=async q=>{if(q===null||Number.isNaN(+q))return;q=co(q,0,100);let fe;if(h.value==="mark")w.value.length===0?fe=q<=50?y.value:A.value:fe=w.value.reduce((re,te)=>Math.abs(te.position-q)<Math.abs(re.position-q)?te:re).point;else{const re=Math.floor((A.value-y.value)/h.value),te=re*h.value/(A.value-y.value)*100,le=te+(100-te)/2;if(q<te){const de=te/re,he=Math.round(q/de);fe=y.value+he*h.value}else q<le?fe=y.value+re*h.value:fe=A.value;fe=Number.parseFloat(fe.toFixed(c.value))}fe!==s.modelValue&&i(Pr,fe),!C.dragging&&s.modelValue!==C.oldValue&&(C.oldValue=s.modelValue),await t.nextTick(),C.dragging&&k(),_.value.updatePopper()};return t.watch(()=>C.dragging,q=>{b(q)}),vn(D,"touchstart",K,{passive:!1}),{disabled:p,button:D,tooltip:_,tooltipVisible:x,showTooltip:d,persistent:u,wrapperStyle:z,formatValue:E,handleMouseEnter:H,handleMouseLeave:$,onButtonDown:K,onKeyDown:W,setPosition:ce}},dre=Wt({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:{type:et([String,Array,Object,Boolean]),default:void 0},placement:{type:String,values:Oa,default:"top"}}),fre={[Pr]:s=>lr(s)},hre=["tabindex"];var pre=t.defineComponent({name:"ElSliderButton",__name:"button",props:dre,emits:fre,setup(s,{expose:C,emit:i}){const p=s,y=i,A=zt("slider"),h=t.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:p.modelValue}),d=t.computed(()=>m.value?g.value:!1),{disabled:u,button:c,tooltip:f,showTooltip:m,persistent:g,tooltipVisible:v,wrapperStyle:b,formatValue:w,handleMouseEnter:_,handleMouseLeave:x,onButtonDown:E,onKeyDown:k,setPosition:P}=ure(p,h,y),{hovering:D,dragging:R}=t.toRefs(h);return C({onButtonDown:E,onKeyDown:k,setPosition:P,hovering:D,dragging:R}),(z,F)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"button",ref:c,class:t.normalizeClass([t.unref(A).e("button-wrapper"),{hover:t.unref(D),dragging:t.unref(R)}]),style:t.normalizeStyle(t.unref(b)),tabindex:t.unref(u)?void 0:0,onMouseenter:F[0]||(F[0]=(...H)=>t.unref(_)&&t.unref(_)(...H)),onMouseleave:F[1]||(F[1]=(...H)=>t.unref(x)&&t.unref(x)(...H)),onMousedown:F[2]||(F[2]=(...H)=>t.unref(E)&&t.unref(E)(...H)),onFocus:F[3]||(F[3]=(...H)=>t.unref(_)&&t.unref(_)(...H)),onBlur:F[4]||(F[4]=(...H)=>t.unref(x)&&t.unref(x)(...H)),onKeydown:F[5]||(F[5]=(...H)=>t.unref(k)&&t.unref(k)(...H))},[t.createVNode(t.unref(Ji),{ref_key:"tooltip",ref:f,visible:t.unref(v),placement:z.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":z.tooltipClass,disabled:!t.unref(m),persistent:d.value},{content:t.withCtx(()=>[t.createElementVNode("span",null,t.toDisplayString(t.unref(w)),1)]),default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass([t.unref(A).e("button"),{hover:t.unref(D),dragging:t.unref(R)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled","persistent"])],46,hre))}}),IM=pre;const mre=Wt({mark:{type:et([String,Object]),default:void 0}});var Are=t.defineComponent({name:"ElSliderMarker",props:mre,setup(s){const C=zt("slider"),i=t.computed(()=>Ar(s.mark)?s.mark:s.mark.label),p=t.computed(()=>Ar(s.mark)?void 0:s.mark.style);return()=>t.h("div",{class:C.e("marks-text"),style:p.value},i.value)}});const gre=["id","role","aria-label","aria-labelledby"],vre={key:1};var yre=t.defineComponent({name:"ElSlider",__name:"slider",props:rre,emits:nre,setup(s,{expose:C,emit:i}){const p=s,y=i,A=zt("slider"),{t:h}=Yr(),d=t.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:u,slider:c,firstButton:f,secondButton:m,sliderDisabled:g,minValue:v,maxValue:b,runwayStyle:w,barStyle:_,resetSize:x,emitChange:E,onSliderWrapperPrevent:k,onSliderClick:P,onSliderDown:D,onSliderMarkerDown:R,setFirstValue:z,setSecondValue:F}=ore(p,d,y),{stops:H,getStopStyle:$}=are(p,d,v,b),{inputId:K,isLabeledByFormItem:G}=mo(p,{formItemContext:u}),j=ji(),N=t.computed(()=>p.inputSize||j.value),I=t.computed(()=>p.showInput&&!p.range&&p.step!=="mark"),L=t.computed(()=>p.ariaLabel||h("el.slider.defaultLabel",{min:p.min,max:p.max})),U=t.computed(()=>p.range?p.rangeStartLabel||h("el.slider.defaultRangeStartLabel"):L.value),O=t.computed(()=>p.formatValueText?p.formatValueText(q.value):`${q.value}`),Q=t.computed(()=>p.rangeEndLabel||h("el.slider.defaultRangeEndLabel")),W=t.computed(()=>p.formatValueText?p.formatValueText(fe.value):`${fe.value}`),Z=t.computed(()=>[A.b(),A.m(j.value),A.is("vertical",p.vertical),{[A.m("with-input")]:I.value}]),J=sre(p);lre(p,d,v,b,y,u);const ne=t.computed(()=>lr(p.step)?p.step:1),ae=t.computed(()=>{const le=lr(p.step)?p.step:1,de=[p.min,p.max,le].map(he=>{const ue=`${he}`.split(".")[1];return ue?ue.length:0});return Math.max.apply(null,de)}),{sliderWrapper:ce}=ire(p,d,x),{firstValue:q,secondValue:fe,sliderSize:re}=t.toRefs(d),te=le=>{d.dragging=le};return vn(ce,"touchstart",k,{passive:!1}),vn(ce,"touchmove",k,{passive:!1}),t.provide(TM,{...t.toRefs(p),sliderSize:re,disabled:g,precision:ae,markList:J,emitChange:E,resetSize:x,updateDragging:te}),C({onSliderClick:P}),(le,de)=>{var he,ue;return t.openBlock(),t.createElementBlock("div",{id:le.range?t.unref(K):void 0,ref_key:"sliderWrapper",ref:ce,class:t.normalizeClass(Z.value),role:le.range?"group":void 0,"aria-label":le.range&&!t.unref(G)?L.value:void 0,"aria-labelledby":le.range&&t.unref(G)?(he=t.unref(u))==null?void 0:he.labelId:void 0},[t.createElementVNode("div",{ref_key:"slider",ref:c,class:t.normalizeClass([t.unref(A).e("runway"),{"show-input":I.value},t.unref(A).is("disabled",t.unref(g))]),style:t.normalizeStyle(t.unref(w)),onMousedown:de[0]||(de[0]=(...pe)=>t.unref(D)&&t.unref(D)(...pe)),onTouchstartPassive:de[1]||(de[1]=(...pe)=>t.unref(D)&&t.unref(D)(...pe))},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(A).e("bar")),style:t.normalizeStyle(t.unref(_))},null,6),t.createVNode(IM,{id:le.range?void 0:t.unref(K),ref_key:"firstButton",ref:f,"model-value":t.unref(q),vertical:le.vertical,"tooltip-class":le.tooltipClass,placement:le.placement,role:"slider","aria-label":le.range||!t.unref(G)?U.value:void 0,"aria-labelledby":!le.range&&t.unref(G)?(ue=t.unref(u))==null?void 0:ue.labelId:void 0,"aria-valuemin":le.min,"aria-valuemax":le.range?t.unref(fe):le.max,"aria-valuenow":t.unref(q),"aria-valuetext":O.value,"aria-orientation":le.vertical?"vertical":"horizontal","aria-disabled":t.unref(g),"onUpdate:modelValue":t.unref(z)},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"]),le.range?(t.openBlock(),t.createBlock(IM,{key:0,ref_key:"secondButton",ref:m,"model-value":t.unref(fe),vertical:le.vertical,"tooltip-class":le.tooltipClass,placement:le.placement,role:"slider","aria-label":Q.value,"aria-valuemin":t.unref(q),"aria-valuemax":le.max,"aria-valuenow":t.unref(fe),"aria-valuetext":W.value,"aria-orientation":le.vertical?"vertical":"horizontal","aria-disabled":t.unref(g),"onUpdate:modelValue":t.unref(F)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):t.createCommentVNode("v-if",!0),le.showStops?(t.openBlock(),t.createElementBlock("div",vre,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(H),(pe,se)=>(t.openBlock(),t.createElementBlock("div",{key:se,class:t.normalizeClass(t.unref(A).e("stop")),style:t.normalizeStyle(t.unref($)(pe))},null,6))),128))])):t.createCommentVNode("v-if",!0),t.unref(J).length>0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(J),(pe,se)=>(t.openBlock(),t.createElementBlock("div",{key:se,style:t.normalizeStyle(t.unref($)(pe.position)),class:t.normalizeClass([t.unref(A).e("stop"),t.unref(A).e("marks-stop")])},null,6))),128))]),t.createElementVNode("div",{class:t.normalizeClass(t.unref(A).e("marks"))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(J),(pe,se)=>(t.openBlock(),t.createBlock(t.unref(Are),{key:se,mark:pe.mark,style:t.normalizeStyle(t.unref($)(pe.position)),onMousedown:t.withModifiers(V=>t.unref(R)(pe.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):t.createCommentVNode("v-if",!0)],38),I.value?(t.openBlock(),t.createBlock(t.unref(Hq),{key:0,ref:"input","model-value":t.unref(q),class:t.normalizeClass(t.unref(A).e("input")),step:ne.value,disabled:t.unref(g),controls:le.showInputControls,min:le.min,max:le.max,precision:ae.value,size:N.value,"onUpdate:modelValue":t.unref(z),onChange:t.unref(E)},null,8,["model-value","class","step","disabled","controls","min","max","precision","size","onUpdate:modelValue","onChange"])):t.createCommentVNode("v-if",!0)],10,gre)}}}),bre=yre;const DM=Tr(bre),_re=Wt({prefixCls:{type:String}}),RM=t.defineComponent({name:"ElSpaceItem",props:_re,setup(s,{slots:C}){const i=zt("space"),p=t.computed(()=>`${s.prefixCls||i.b()}__item`);return()=>t.h("div",{class:p.value},t.renderSlot(C,"default"))}}),FM={small:8,default:12,large:16};function wre(s){const C=zt("space"),i=t.computed(()=>[C.b(),C.m(s.direction),s.class]),p=t.ref(0),y=t.ref(0),A=t.computed(()=>[s.wrap||s.fill?{flexWrap:"wrap"}:{},{alignItems:s.alignment},{rowGap:`${y.value}px`,columnGap:`${p.value}px`},s.style]),h=t.computed(()=>s.fill?{flexGrow:1,minWidth:`${s.fillRatio}%`}:{});return t.watchEffect(()=>{const{size:d="small",wrap:u,direction:c,fill:f}=s;if(nr(d)){const[m=0,g=0]=d;p.value=m,y.value=g}else{let m;lr(d)?m=d:m=FM[d||"small"]||FM.small,(u||f)&&c==="horizontal"?p.value=y.value=m:c==="horizontal"?(p.value=m,y.value=0):(y.value=m,p.value=0)}}),{classes:i,containerStyle:A,itemStyle:h}}const Cre=Wt({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:et([String,Object,Array,Boolean]),default:""},style:{type:et([String,Array,Object,Boolean]),default:""},alignment:{type:et(String),default:"center"},prefixCls:{type:String},spacer:{type:et([Object,String,Number,Array]),default:null,validator:s=>t.isVNode(s)||lr(s)||Ar(s)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:Aa,validator:s=>lr(s)||nr(s)&&s.length===2&&s.every(lr)}}),xre=t.defineComponent({name:"ElSpace",props:Cre,setup(s,{slots:C}){const{classes:i,containerStyle:p,itemStyle:y}=wre(s);function A(h,d="",u=[]){const{prefixCls:c}=s;return h.forEach((f,m)=>{hy(f)?nr(f.children)&&f.children.forEach((g,v)=>{hy(g)&&nr(g.children)?A(g.children,`${d+v}-`,u):t.isVNode(g)&&(g==null?void 0:g.type)===t.Comment?u.push(g):u.push(t.createVNode(RM,{style:y.value,prefixCls:c,key:`nested-${d+v}`},{default:()=>[g]},12,["style","prefixCls"]))}):cz(f)&&u.push(t.createVNode(RM,{style:y.value,prefixCls:c,key:`LoopKey${d+m}`},{default:()=>[f]},12,["style","prefixCls"]))}),u}return()=>{const{spacer:h,direction:d}=s,u=t.renderSlot(C,"default",{key:0},()=>[]);if((u.children??[]).length===0)return null;if(nr(u.children)){let c=A(u.children);if(h){const f=c.length-1;c=c.reduce((m,g,v)=>{const b=[...m,g];return v!==f&&b.push(t.createVNode("span",{style:[y.value,d==="vertical"?"width: 100%":null],key:v},[t.isVNode(h)?t.cloneVNode(h):t.createTextVNode(h,1)],4)),b},[])}return t.createVNode("div",{class:i.value,style:p.value},c,6)}return u.children}}});Tr(xre);const Ere=Wt({space:{type:[Number,String],default:""},active:{type:Number,default:0},direction:{type:String,default:"horizontal",values:["horizontal","vertical"]},alignCenter:{type:Boolean},simple:{type:Boolean},finishStatus:{type:String,values:["wait","process","finish","error","success"],default:"finish"},processStatus:{type:String,values:["wait","process","finish","error","success"],default:"process"}}),Bre={[Gr]:(s,C)=>[s,C].every(lr)},NM="ElSteps",Sre=Wt({title:{type:String,default:""},icon:{type:Pn},description:{type:String,default:""},status:{type:String,values:["","wait","process","finish","error","success"],default:""}});var kre=t.defineComponent({name:"ElSteps",__name:"steps",props:Ere,emits:Bre,setup(s,{emit:C}){const i=s,p=C,y=zt("steps"),{children:A,addChild:h,removeChild:d,ChildrenSorter:u}=Pm(t.getCurrentInstance(),"ElStep");return t.watch(A,()=>{A.value.forEach((c,f)=>{c.setIndex(f)})}),t.provide(NM,{props:i,steps:A,addStep:h,removeStep:d}),t.watch(()=>i.active,(c,f)=>{p(Gr,c,f)}),(c,f)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(y).b(),t.unref(y).m(s.simple?"simple":s.direction)])},[t.renderSlot(c.$slots,"default"),t.createVNode(t.unref(u))],2))}}),Pre=kre,Mre=t.defineComponent({name:"ElStep",__name:"item",props:Sre,setup(s){const C=s,i=zt("step"),p=t.ref(-1),y=t.ref({}),A=t.ref(""),h=t.inject(NM),d=t.getCurrentInstance();let u=0,c=0;t.onMounted(()=>{t.watch([()=>h.props.active,()=>h.props.processStatus,()=>h.props.finishStatus],([F],[H])=>{c=H||0,u=F-c,R(F)},{immediate:!0})});const f=t.computed(()=>C.status||A.value),m=t.computed(()=>{const F=h.steps.value[p.value-1];return F?F.internalStatus.value:"wait"}),g=t.computed(()=>h.props.alignCenter),v=t.computed(()=>h.props.direction==="vertical"),b=t.computed(()=>h.props.simple),w=t.computed(()=>h.steps.value.length),_=t.computed(()=>{var F;return((F=h.steps.value[w.value-1])==null?void 0:F.uid)===d.uid}),x=t.computed(()=>b.value?"":h.props.space),E=t.computed(()=>[i.b(),i.is(b.value?"simple":h.props.direction),i.is("flex",_.value&&!x.value&&!g.value),i.is("center",g.value&&!v.value&&!b.value)]),k=t.computed(()=>{const F={flexBasis:lr(x.value)?`${x.value}px`:x.value?x.value:`${100/(w.value-(g.value?0:1))}%`};return v.value||_.value&&(F.maxWidth=`${100/w.value}%`),F}),P=F=>{p.value=F},D=F=>{const H=F==="wait",$={transitionDelay:`${Math.abs(u)===1?0:u>0?(p.value+1-c)*150:-(p.value+1-h.props.active)*150}ms`},K=F===h.props.processStatus||H?0:100;$.borderWidth=K&&!b.value?"1px":0,$[h.props.direction==="vertical"?"height":"width"]=`${K}%`,y.value=$},R=F=>{F>p.value?A.value=h.props.finishStatus:F===p.value&&m.value!=="error"?A.value=h.props.processStatus:A.value="wait";const H=h.steps.value[p.value-1];H&&H.calcProgress(A.value)},z={uid:d.uid,getVnode:()=>d.vnode,currentStatus:f,internalStatus:A,setIndex:P,calcProgress:D};return h.addStep(z),t.onBeforeUnmount(()=>{h.removeStep(z)}),(F,H)=>(t.openBlock(),t.createElementBlock("div",{style:t.normalizeStyle(k.value),class:t.normalizeClass(E.value)},[t.createCommentVNode(" icon & line "),t.createElementVNode("div",{class:t.normalizeClass([t.unref(i).e("head"),t.unref(i).is(f.value)])},[b.value?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(i).e("line"))},[t.createElementVNode("i",{class:t.normalizeClass(t.unref(i).e("line-inner")),style:t.normalizeStyle(y.value)},null,6)],2)),t.createElementVNode("div",{class:t.normalizeClass([t.unref(i).e("icon"),t.unref(i).is(s.icon||F.$slots.icon?"icon":"text")])},[t.renderSlot(F.$slots,"icon",{},()=>[s.icon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass(t.unref(i).e("icon-inner"))},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.icon)))]),_:1},8,["class"])):f.value==="success"?(t.openBlock(),t.createBlock(t.unref(ir),{key:1,class:t.normalizeClass([t.unref(i).e("icon-inner"),t.unref(i).is("status")])},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Check))]),_:1},8,["class"])):f.value==="error"?(t.openBlock(),t.createBlock(t.unref(ir),{key:2,class:t.normalizeClass([t.unref(i).e("icon-inner"),t.unref(i).is("status")])},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Close))]),_:1},8,["class"])):b.value?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",{key:3,class:t.normalizeClass(t.unref(i).e("icon-inner"))},t.toDisplayString(p.value+1),3))])],2)],2),t.createCommentVNode(" title & description "),t.createElementVNode("div",{class:t.normalizeClass(t.unref(i).e("main"))},[t.createElementVNode("div",{class:t.normalizeClass([t.unref(i).e("title"),t.unref(i).is(f.value)])},[t.renderSlot(F.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(s.title),1)])],2),b.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(i).e("arrow"))},null,2)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([t.unref(i).e("description"),t.unref(i).is(f.value)])},[t.renderSlot(F.$slots,"description",{},()=>[t.createTextVNode(t.toDisplayString(s.description),1)])],2))],2)],6))}}),OM=Mre;Tr(Pre,{Step:OM}),ai(OM);const LM=s=>["",...Aa].includes(s),Tre=Wt({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:void 0},loading:Boolean,size:{type:String,validator:LM},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:Pn},activeActionIcon:{type:Pn},activeIcon:{type:Pn},inactiveIcon:{type:Pn},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:et(Function)},id:String,tabindex:{type:[String,Number]},...Vs(["ariaLabel"])}),Ire={[Pr]:s=>Bn(s)||Ar(s)||lr(s),[Gr]:s=>Bn(s)||Ar(s)||lr(s),[Li]:s=>Bn(s)||Ar(s)||lr(s)},Dre=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex"],Rre=["aria-hidden"],Fre={key:1},Nre={key:1},Ore=["aria-hidden"],_A="ElSwitch";var Lre=t.defineComponent({name:_A,__name:"switch",props:Tre,emits:Ire,setup(s,{expose:C,emit:i}){const p=s,y=i,{formItem:A}=ls(),h=ji(),d=zt("switch"),{inputId:u}=mo(p,{formItemContext:A}),c=ri(t.computed(()=>{if(p.loading)return!0})),f=t.ref(p.modelValue!==!1),m=t.shallowRef(),g=t.computed(()=>[d.b(),d.m(h.value),d.is("disabled",c.value),d.is("checked",x.value)]),v=t.computed(()=>[d.e("label"),d.em("label","left"),d.is("active",!x.value)]),b=t.computed(()=>[d.e("label"),d.em("label","right"),d.is("active",x.value)]),w=t.computed(()=>({width:pi(p.width)}));t.watch(()=>p.modelValue,()=>{f.value=!0});const _=t.computed(()=>f.value?p.modelValue:!1),x=t.computed(()=>_.value===p.activeValue);[p.activeValue,p.inactiveValue].includes(_.value)||(wn(_A,"model-value must be active-value or inactive-value"),y(Pr,p.inactiveValue),y(Gr,p.inactiveValue),y(Li,p.inactiveValue)),t.watch(x,D=>{var R;m.value.checked=D,p.validateEvent&&((R=A==null?void 0:A.validate)==null||R.call(A,"change").catch(Xr))});const E=()=>{const D=x.value?p.inactiveValue:p.activeValue;y(Pr,D),y(Gr,D),y(Li,D),t.nextTick(()=>{m.value.checked=x.value})},k=()=>{if(c.value)return;const{beforeChange:D}=p;if(!D){E();return}const R=D();[Wu(R),Bn(R)].includes(!0)||oi(_A,"beforeChange must return type `Promise<boolean>` or `boolean`"),Wu(R)?R.then(z=>{z&&E()}).catch(z=>{wn(_A,`some error occurred: ${z}`)}):R&&E()},P=()=>{var D,R;(R=(D=m.value)==null?void 0:D.focus)==null||R.call(D)};return t.onMounted(()=>{m.value.checked=x.value}),C({focus:P,checked:x}),(D,R)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(g.value),onClick:t.withModifiers(k,["prevent"])},[t.createElementVNode("input",{id:t.unref(u),ref_key:"input",ref:m,class:t.normalizeClass(t.unref(d).e("input")),type:"checkbox",role:"switch","aria-checked":x.value,"aria-disabled":t.unref(c),"aria-label":s.ariaLabel,name:s.name,"true-value":s.activeValue,"false-value":s.inactiveValue,disabled:t.unref(c),tabindex:s.tabindex,onChange:E,onKeydown:t.withKeys(k,["enter"])},null,42,Dre),!s.inlinePrompt&&(s.inactiveIcon||s.inactiveText||D.$slots.inactive)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(v.value)},[t.renderSlot(D.$slots,"inactive",{},()=>[s.inactiveIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.inactiveIcon)))]),_:1})):t.createCommentVNode("v-if",!0),!s.inactiveIcon&&s.inactiveText?(t.openBlock(),t.createElementBlock("span",{key:1,"aria-hidden":x.value},t.toDisplayString(s.inactiveText),9,Rre)):t.createCommentVNode("v-if",!0)])],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("span",{class:t.normalizeClass(t.unref(d).e("core")),style:t.normalizeStyle(w.value)},[s.inlinePrompt?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(d).e("inner"))},[x.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(d).e("inner-wrapper"))},[t.renderSlot(D.$slots,"active",{},()=>[s.activeIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.activeIcon)))]),_:1})):t.createCommentVNode("v-if",!0),!s.activeIcon&&s.activeText?(t.openBlock(),t.createElementBlock("span",Nre,t.toDisplayString(s.activeText),1)):t.createCommentVNode("v-if",!0)])],2)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(d).e("inner-wrapper"))},[t.renderSlot(D.$slots,"inactive",{},()=>[s.inactiveIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.inactiveIcon)))]),_:1})):t.createCommentVNode("v-if",!0),!s.inactiveIcon&&s.inactiveText?(t.openBlock(),t.createElementBlock("span",Fre,t.toDisplayString(s.inactiveText),1)):t.createCommentVNode("v-if",!0)])],2))],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(t.unref(d).e("action"))},[s.loading?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass(t.unref(d).is("loading"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Loading))]),_:1},8,["class"])):x.value?t.renderSlot(D.$slots,"active-action",{key:1},()=>[s.activeActionIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.activeActionIcon)))]),_:1})):t.createCommentVNode("v-if",!0)]):x.value?t.createCommentVNode("v-if",!0):t.renderSlot(D.$slots,"inactive-action",{key:2},()=>[s.inactiveActionIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.inactiveActionIcon)))]),_:1})):t.createCommentVNode("v-if",!0)])],2)],6),!s.inlinePrompt&&(s.activeIcon||s.activeText||D.$slots.active)?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(b.value)},[t.renderSlot(D.$slots,"active",{},()=>[s.activeIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.activeIcon)))]),_:1})):t.createCommentVNode("v-if",!0),!s.activeIcon&&s.activeText?(t.openBlock(),t.createElementBlock("span",{key:1,"aria-hidden":!x.value},t.toDisplayString(s.activeText),9,Ore)):t.createCommentVNode("v-if",!0)])],2)):t.createCommentVNode("v-if",!0)],2))}}),jre=Lre;const Vre=Tr(jre),Ure={data:{type:Array,default:()=>[]},size:Qi,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,rowExpandable:{type:Function},defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children",checkStrictly:!1})},lazy:Boolean,load:Function,style:{type:[String,Object,Array,Boolean],default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:Boolean,flexible:Boolean,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,appendFilterPanelTo:String,scrollbarTabindex:{type:[Number,String],default:void 0},allowDragLastColumn:{type:Boolean,default:!0},preserveExpandedContent:Boolean,nativeScrollbar:Boolean};let zre=1,Hre=1;const $re=s=>`${s}-table_${zre++}`,Gre=s=>`${s}_column_${Hre++}`,Hb=function(s){var C;return(C=s.target)==null?void 0:C.closest("td")},Qre=function(s,C,i,p,y){if(!C&&!p&&(!y||nr(y)&&!y.length))return s;Ar(i)?i=i==="descending"?-1:1:i=i&&i<0?-1:1;const A=p?null:function(d,u){return y?bE(os(y),c=>Ar(c)?Si(d,c):c(d,u,s)):(C!=="$key"&&mn(d)&&"$value"in d&&(d=d.$value),[mn(d)?C?Si(d,C):null:d])},h=function(d,u){var c,f,m,g,v;if(p)return p(d.value,u.value);for(let b=0,w=((c=d.key)==null?void 0:c.length)??0;b<w;b++){if(((f=d.key)==null?void 0:f[b])<((m=u.key)==null?void 0:m[b]))return-1;if(((g=d.key)==null?void 0:g[b])>((v=u.key)==null?void 0:v[b]))return 1}return 0};return s.map((d,u)=>({value:d,index:u,key:A?A(d,u):null})).sort((d,u)=>{let c=h(d,u);return c||(c=d.index-u.index),c*+i}).map(d=>d.value)},jM=function(s,C){let i=null;return s.columns.forEach(p=>{p.id===C&&(i=p)}),i},Wre=function(s,C){let i=null;for(let p=0;p<s.columns.length;p++){const y=s.columns[p];if(y.columnKey===C){i=y;break}}return i||oi("ElTable",`No column matching with column-key: ${C}`),i},VM=function(s,C,i){const p=(C.className||"").match(new RegExp(`${i}-table_[^\\s]+`,"gm"));return p?jM(s,p[0]):null},Di=(s,C)=>{if(!s)throw new Error("Row is required when get row identity");if(Ar(C)){if(!C.includes("."))return`${s[C]}`;const i=C.split(".");let p=s;for(const y of i)p=p[y];return`${p}`}else if(Nr(C))return C.call(null,s);return""},Ed=function(s,C,i=!1,p="children"){const y=s||[],A={};return y.forEach((h,d)=>{if(A[Di(h,C)]={row:h,index:d},i){const u=h[p];nr(u)&&Object.assign(A,Ed(u,C,!0,p))}}),A};function Kre(s,C){const i={};let p;for(p in s)i[p]=s[p];for(p in C)if(Xi(C,p)){const y=C[p];en(y)||(i[p]=y)}return i}function $b(s){return s===""||en(s)||(s=Number.parseInt(s,10),Number.isNaN(s)&&(s="")),s}function UM(s){return s===""||en(s)||(s=$b(s),Number.isNaN(s)&&(s=80)),s}function Xre(s){return lr(s)?s:Ar(s)?/^\d+(?:px)?$/.test(s)?Number.parseInt(s,10):s:null}function Yre(...s){return s.length===0?C=>C:s.length===1?s[0]:s.reduce((C,i)=>(...p)=>C(i(...p)))}function Bd(s,C,i,p,y,A,h){let d=A??0,u=!1;const f=(()=>{if(!h)return s.indexOf(C);const w=Di(C,h);return s.findIndex(_=>Di(_,h)===w)})(),m=f!==-1,g=y==null?void 0:y.call(null,C,d),v=w=>{w==="add"?s.push(C):s.splice(f,1),u=!0},b=w=>{let _=0;const x=(p==null?void 0:p.children)&&w[p.children];return x&&nr(x)&&(_+=x.length,x.forEach(E=>{_+=b(E)})),_};return(!y||g)&&(Bn(i)?i&&!m?v("add"):!i&&m&&v("remove"):v(m?"remove":"add")),!(p!=null&&p.checkStrictly)&&(p!=null&&p.children)&&nr(C[p.children])&&C[p.children].forEach(w=>{const _=Bd(s,w,i??!m,p,y,d+1,h);d+=b(w)+1,_&&(u=_)}),u}function Jre(s,C,i="children",p="hasChildren",y=!1){const A=d=>!(nr(d)&&d.length);function h(d,u,c){C(d,u,c),u.forEach(f=>{if(f[p]&&y){C(f,null,c+1);return}const m=f[i];A(m)||h(f,m,c+1)})}s.forEach(d=>{if(d[p]&&y){C(d,null,0);return}const u=d[i];A(u)||h(d,u,0)})}const Zre=(s,C,i,p)=>{const y=Nr(p==null?void 0:p.tooltipFormatter)?p.tooltipFormatter({row:i,column:p,cellValue:Xl(i,p.property).value}):void 0;return t.isVNode(y)?{slotContent:y,content:null,strategy:"fixed",...s}:{slotContent:null,content:y??C,strategy:"fixed",...s}};let bi=null;function qre(s,C,i,p,y,A){var v;const h=Zre(s,C,i,p),d={...h,slotContent:void 0};if((bi==null?void 0:bi.trigger)===y){const b=(v=bi.vm)==null?void 0:v.component;wE(b==null?void 0:b.props,d),b&&h.slotContent&&(b.slots.content=()=>[h.slotContent]);return}bi==null||bi();const u=A==null?void 0:A.refs.tableWrapper,c=u==null?void 0:u.dataset.prefix,f=t.createVNode(Ji,{virtualTriggering:!0,virtualRef:y,appendTo:u,placement:"top",transition:"none",offset:0,hideAfter:0,...d},h.slotContent?{content:()=>h.slotContent}:void 0);f.appContext={...A.appContext,...A};const m=document.createElement("div");t.render(f,m),f.component.exposed.onOpen();const g=u==null?void 0:u.querySelector(`.${c}-scrollbar__wrap`);bi=()=>{var w,_;(_=(w=f.component)==null?void 0:w.exposed)!=null&&_.onClose&&f.component.exposed.onClose(),t.render(null,m);const b=bi;g==null||g.removeEventListener("scroll",b),b.trigger=void 0,b.vm=void 0,bi=null},bi.trigger=y??void 0,bi.vm=f,g==null||g.addEventListener("scroll",bi)}function zM(s){return s.children?bE(s.children,zM):[s]}function HM(s,C){return s+C.colSpan}const $M=(s,C,i,p)=>{let y=0,A=s;const h=i.states.columns.value;if(p){const u=zM(p[s]);y=h.slice(0,h.indexOf(u[0])).reduce(HM,0),A=y+u.reduce(HM,0)-1}else y=s;let d;switch(C){case"left":A<i.states.fixedLeafColumnsLength.value&&(d="left");break;case"right":y>=h.length-i.states.rightFixedLeafColumnsLength.value&&(d="right");break;default:A<i.states.fixedLeafColumnsLength.value?d="left":y>=h.length-i.states.rightFixedLeafColumnsLength.value&&(d="right")}return d?{direction:d,start:y,after:A}:{}},Gb=(s,C,i,p,y,A=0)=>{const h=[],{direction:d,start:u,after:c}=$M(C,i,p,y);if(d){const f=d==="left";h.push(`${s}-fixed-column--${d}`),f&&c+A===p.states.fixedLeafColumnsLength.value-1?h.push("is-last-column"):!f&&u-A===p.states.columns.value.length-p.states.rightFixedLeafColumnsLength.value&&h.push("is-first-column")}return h};function GM(s,C){return s+(lm(C.realWidth)||Number.isNaN(C.realWidth)?Number(C.width):C.realWidth)}const Qb=(s,C,i,p)=>{const{direction:y,start:A=0,after:h=0}=$M(s,C,i,p);if(!y)return;const d={},u=y==="left",c=i.states.columns.value;return u?d.left=c.slice(0,A).reduce(GM,0):d.right=c.slice(h+1).reverse().reduce(GM,0),d},Sd=(s,C)=>{s&&(Number.isNaN(s[C])||(s[C]=`${s[C]}px`))};function QM(s){return s.some(C=>t.isVNode(C)?!(C.type===t.Comment||C.type===t.Fragment&&!QM(C.children)):!0)?s:null}function ene(s){const C=t.getCurrentInstance(),i=t.ref(!1),p=t.ref([]),y=(c,f)=>{const m=C.store.states.rowExpandable.value;return(m==null?void 0:m(c,f))??!0};return{updateExpandRows:()=>{const c=s.data.value||[],f=s.rowKey.value;if(i.value)p.value=C.store.states.rowExpandable.value?c.filter(y):c.slice();else if(f){const m=Ed(p.value,f);p.value=c.filter((g,v)=>{const b=Di(g,f);return!!m[b]&&y(g,v)})}else p.value=[]},toggleRowExpansion:(c,f)=>{const m=(s.data.value||[]).indexOf(c);m>-1&&!y(c,m)||Bd(p.value,c,f,void 0,void 0,void 0,s.rowKey.value)&&C.emit("expand-change",c,p.value.slice())},setExpandRowKeys:c=>{C.store.assertRowKey();const f=s.data.value||[],m=s.rowKey.value,g=Ed(f,m);p.value=c.reduce((v,b)=>{const w=g[b];return w&&y(w.row,w.index)&&v.push(w.row),v},[])},isRowExpanded:c=>{const f=s.rowKey.value;return f?!!Ed(p.value,f)[Di(c,f)]:p.value.includes(c)},states:{expandRows:p,defaultExpandAll:i}}}function tne(s){const C=t.getCurrentInstance(),i=t.ref(null),p=t.ref(null),y=c=>{C.store.assertRowKey(),i.value=c,h(c)},A=()=>{i.value=null},h=c=>{const{data:f,rowKey:m}=s,g=p.value;let v=null;m.value&&(v=(t.unref(f)||[]).find(b=>Di(b,m.value)===c)??null),p.value=v??null,C.emit("current-change",p.value,g)};return{setCurrentRowKey:y,restoreCurrentRowKey:A,setCurrentRowByKey:h,updateCurrentRow:c=>{const f=p.value;if(c&&c!==f){p.value=c,C.emit("current-change",p.value,f);return}!c&&f&&(p.value=null,C.emit("current-change",null,f))},updateCurrentRowData:()=>{const c=s.rowKey.value,f=s.data.value||[],m=p.value;if(m&&!f.includes(m))if(c){const g=Di(m,c);h(g)}else p.value=null,C.emit("current-change",null,m);else i.value&&(h(i.value),A())},states:{_currentRowKey:i,currentRow:p}}}function rne(s){const C=t.ref([]),i=t.ref({}),p=t.ref(16),y=t.ref(!1),A=t.ref({}),h=t.ref("hasChildren"),d=t.ref("children"),u=t.ref(!1),c=t.getCurrentInstance(),f=t.computed(()=>{if(!s.rowKey.value)return{};const P=s.data.value||[];return g(P)}),m=t.computed(()=>{const P=s.rowKey.value,D=Object.keys(A.value),R={};return D.length&&D.forEach(z=>{if(A.value[z].length){const F={children:[]};A.value[z].forEach(H=>{const $=Di(H,P);F.children.push($),H[h.value]&&!R[$]&&(R[$]={children:[]})}),R[z]=F}}),R}),g=P=>{const D=s.rowKey.value,R={};return Jre(P,(z,F,H)=>{const $=Di(z,D);nr(F)?R[$]={children:F.map(K=>Di(K,D)),level:H}:y.value&&(R[$]={children:[],lazy:!0,level:H})},d.value,h.value,y.value),R},v=(P=!1,D)=>{var $,K;D||(D=($=c.store)==null?void 0:$.states.defaultExpandAll.value);const R=f.value,z=m.value,F=Object.keys(R),H={};if(F.length){const G=t.unref(i),j=[],N=(L,U)=>{if(P)return C.value?D||C.value.includes(U):!!(D||L!=null&&L.expanded);{const O=D||C.value&&C.value.includes(U);return!!(L!=null&&L.expanded||O)}};F.forEach(L=>{const U=G[L],O={...R[L]};if(O.expanded=N(U,L),O.lazy){const{loaded:Q=!1,loading:W=!1}=U||{};O.loaded=!!Q,O.loading=!!W,j.push(L)}H[L]=O});const I=Object.keys(z);y.value&&I.length&&j.length&&I.forEach(L=>{var Q;const U=G[L],O=z[L].children;if(j.includes(L)){if(((Q=H[L].children)==null?void 0:Q.length)!==0)throw new Error("[ElTable]children must be an empty array.");H[L].children=O}else{const{loaded:W=!1,loading:Z=!1}=U||{};H[L]={lazy:!0,loaded:!!W,loading:!!Z,expanded:N(U,L),children:O,level:void 0}}})}i.value=H,(K=c.store)==null||K.updateTableScrollY()};t.watch(()=>C.value,()=>{v(!0)},{deep:!0}),t.watch(()=>f.value,()=>{v()}),t.watch(()=>m.value,()=>{v()});const b=P=>{C.value=P,v()},w=P=>y.value&&P&&"loaded"in P&&!P.loaded,_=(P,D)=>{c.store.assertRowKey();const R=s.rowKey.value,z=Di(P,R),F=z&&i.value[z];if(z&&F&&"expanded"in F){const H=F.expanded;D=en(D)?!F.expanded:D,i.value[z].expanded=D,H!==D&&c.emit("expand-change",P,D),D&&w(F)&&E(P,z,F),c.store.updateTableScrollY()}},x=P=>{c.store.assertRowKey();const D=s.rowKey.value,R=Di(P,D),z=i.value[R];w(z)?E(P,R,z):_(P,void 0)},E=(P,D,R)=>{const{load:z}=c.props;z&&!i.value[D].loaded&&(i.value[D].loading=!0,z(P,R,F=>{if(!nr(F))throw new TypeError("[ElTable] data must be an array");i.value[D].loading=!1,i.value[D].loaded=!0,i.value[D].expanded=!0,F.length&&(A.value={...A.value,[D]:F}),c.emit("expand-change",P,!0)}))};return{loadData:E,loadOrToggle:x,toggleTreeExpansion:_,updateTreeExpandKeys:b,updateTreeData:v,updateKeyChildren:(P,D)=>{const{lazy:R,rowKey:z}=c.props;if(R){if(!z)throw new Error("[Table] rowKey is required in updateKeyChild");A.value[P]&&(A.value={...A.value,[P]:D})}},normalize:g,states:{expandRowKeys:C,treeData:i,indent:p,lazy:y,lazyTreeNodeMap:A,lazyColumnIdentifier:h,childrenColumnName:d,checkStrictly:u}}}const nne=(s,C)=>{const i=C.sortingColumn;return!i||Ar(i.sortable)?s:Qre(s,C.sortProp,C.sortOrder,i.sortMethod,i.sortBy)},wA=s=>{const C=[];return s.forEach(i=>{i.children&&i.children.length>0?C.push.apply(C,wA(i.children)):C.push(i)}),C};function ine(){var Ge;const s=t.getCurrentInstance(),{size:C}=t.toRefs((Ge=s.proxy)==null?void 0:Ge.$props),i=t.ref(null),p=t.ref([]),y=t.ref([]),A=t.ref(!1),h=t.ref([]),d=t.ref([]),u=t.ref([]),c=t.ref([]),f=t.ref([]),m=t.ref([]),g=t.ref([]),v=t.ref([]),b=[],w=t.ref(0),_=t.ref(0),x=t.ref(0),E=t.ref(!1),k=t.ref([]),P=t.ref({}),D=t.ref(!1),R=t.ref(!1),z=t.ref(null),F=t.ref(null),H=t.ref({}),$=t.ref(null),K=t.ref(null),G=t.ref(null),j=t.ref(null),N=t.ref(null);let I=[];const L=t.computed(()=>i.value?Ed(k.value,i.value):void 0),U=ze=>{var gt;const{childrenColumnName:Ct,lazyTreeNodeMap:It}=s.store.states,Ot=ze[Ct.value]??[];if(!i.value)return Ot;const Ze=Di(ze,i.value);return[...((gt=It.value)==null?void 0:gt[Ze])??[],...Ot]};t.watch(p,()=>{var ze;s.state&&(Z(!1),s.props.tableLayout==="auto"&&((ze=s.refs.tableHeaderRef)==null||ze.updateFixedColumnStyle()))},{deep:!0});const O=()=>{if(!i.value)throw new Error("[ElTable] prop row-key is required")},Q=ze=>{var Ct;(Ct=ze.children)==null||Ct.forEach(It=>{It.fixed=ze.fixed,Q(It)})},W=()=>{h.value.forEach(vt=>{Q(vt)}),c.value=h.value.filter(vt=>[!0,"left"].includes(vt.fixed));const ze=h.value.find(vt=>vt.type==="selection");let Ct;ze&&ze.fixed!=="right"&&!c.value.includes(ze)&&h.value.indexOf(ze)===0&&c.value.length&&(c.value.unshift(ze),Ct=!0),f.value=h.value.filter(vt=>vt.fixed==="right");const It=h.value.filter(vt=>(Ct?vt.type!=="selection":!0)&&!vt.fixed);d.value=Array.from(c.value).concat(It).concat(f.value);const Ot=wA(It),Ze=wA(c.value),gt=wA(f.value);w.value=Ot.length,_.value=Ze.length,x.value=gt.length,u.value=Array.from(Ze).concat(Ot).concat(gt),A.value=c.value.length>0||f.value.length>0},Z=(ze,Ct=!1)=>{ze&&W(),Ct?s.state.doLayout():s.state.debouncedUpdateLayout()},J=ze=>L.value?!!L.value[Di(ze,i.value)]:k.value.includes(ze),ne=t.computed(()=>{const ze=new Map;if(!i.value||!z.value)return ze;let Ct=0;const It=Ot=>{nr(Ot)&&Ot.forEach(Ze=>{const gt=Di(Ze,i.value);ze.set(gt,Ct),Ct+=1;const vt=U(Ze);vt.length&&It(vt)})};return It(p.value||[]),ze}),ae=(ze={})=>{const{emitChange:Ct=!0}=ze;if(yt.checkStrictly.value||!i.value){P.value={},I=[];return}const It=i.value,Ot=ze.rowIndexMap??ne.value,Ze=z.value,gt=new WeakMap,vt=ct=>{const Rt=gt.get(ct);if(Rt)return Rt;const qt=Di(ct,It);return gt.set(ct,qt),qt},_t={},Bt=[],at=new Set(k.value.map(ct=>vt(ct))),jt=[];let rr=!1;const Dt=(ct,Rt,qt)=>{const pr=at.has(Rt);qt&&!pr?(jt.push(ct),at.add(Rt),rr=!0):!qt&&pr&&(at.delete(Rt),rr=!0)},rt=ct=>{let Rt=0,qt=0;return nr(ct)?(ct.forEach(pr=>{const ar=vt(pr),Ir=U(pr);let Lr=0,dr=0;if(Ir.length){const Se=rt(Ir);Lr=Se.selectedCount,dr=Se.selectableCount}const zr=Ze?Ze.call(null,pr,Ot.get(ar)??0):!0;if(zr&&dr>0){const Se=Lr===dr;!Se&&Lr!==0&&(_t[ar]=!0,Bt.push(pr)),Dt(pr,ar,Se)}zr&&(qt+=1,at.has(ar)&&(Rt+=1)),Rt+=Lr,qt+=dr}),{selectedCount:Rt,selectableCount:qt}):{selectedCount:Rt,selectableCount:qt}};if(rt(p.value||[]),rr){const ct=k.value.filter(Rt=>at.has(vt(Rt)));jt.forEach(Rt=>{at.has(vt(Rt))&&ct.push(Rt)}),k.value=ct}P.value=_t,I=Bt,rr&&Ct&&s.emit("selection-change",k.value?k.value.slice():[])},ce=()=>{E.value=!1;const ze=k.value;k.value=[],P.value={},I=[],ze.length&&s.emit("selection-change",[])},q=()=>{var Ct,It;let ze;if(i.value){ze=[];const Ot=(It=(Ct=s==null?void 0:s.store)==null?void 0:Ct.states)==null?void 0:It.childrenColumnName.value,Ze=Ed(p.value,i.value,!0,Ot),{lazyTreeNodeMap:gt}=s.store.states;gt.value&&Object.entries(gt.value).forEach(([vt,_t])=>{Ze[vt]&&_t.forEach(Bt=>{const at=Di(Bt,i.value);Ze[at]||(Ze[at]={row:Bt,index:-1})})});for(const vt in L.value)Xi(L.value,vt)&&!Ze[vt]&&ze.push(L.value[vt].row)}else ze=k.value.filter(Ot=>!p.value.includes(Ot));if(ze.length){const Ot=k.value.filter(Ze=>!ze.includes(Ze));k.value=Ot,ae({emitChange:!1}),s.emit("selection-change",[...Ot])}},fe=()=>(k.value||[]).slice(),re=()=>I.slice(),te=(ze,Ct,It)=>{var at;if(!i.value||yt.checkStrictly.value||!yt.lazy.value)return;const{lazyTreeNodeMap:Ot,childrenColumnName:Ze}=s.store.states,gt=Di(ze,i.value),vt=((at=Ot.value)==null?void 0:at[gt])??[],_t=ze[Ze.value]??[],Bt={children:Ze.value,checkStrictly:!1};for(const jt of vt){const rr=It.get(Di(jt,i.value))??0;Bd(k.value,jt,Ct,Bt,z.value,rr,i.value),te(jt,Ct,It)}for(const jt of _t)te(jt,Ct,It)},le=(ze,Ct,It=!0,Ot=!1)=>{var gt,vt,_t,Bt;const Ze={children:(vt=(gt=s==null?void 0:s.store)==null?void 0:gt.states)==null?void 0:vt.childrenColumnName.value,checkStrictly:(Bt=(_t=s==null?void 0:s.store)==null?void 0:_t.states)==null?void 0:Bt.checkStrictly.value};if(Bd(k.value,ze,Ct,Ze,Ot?void 0:z.value,p.value.indexOf(ze),i.value)){if(yt.lazy.value&&!yt.checkStrictly.value){const jt=Ct??J(ze);te(ze,jt,ne.value),ae({emitChange:!1,rowIndexMap:ne.value})}else ae({emitChange:!1});const at=(k.value||[]).slice();It&&s.emit("select",at,ze),s.emit("selection-change",at)}},de=()=>{var _t,Bt;const ze=R.value?!E.value:!(E.value||k.value.length);E.value=ze;let Ct=!1,It=0;const Ot=(Bt=(_t=s==null?void 0:s.store)==null?void 0:_t.states)==null?void 0:Bt.rowKey.value,{childrenColumnName:Ze}=s.store.states,gt={children:Ze.value,checkStrictly:!1};p.value.forEach((at,jt)=>{const rr=jt+It;Bd(k.value,at,ze,gt,z.value,rr,Ot)&&(Ct=!0),It+=pe(Di(at,Ot))});const vt=ne.value;if(yt.lazy.value&&!yt.checkStrictly.value&&Ot)for(const at of Object.values(yt.lazyTreeNodeMap.value))for(const jt of at){const rr=vt.get(Di(jt,Ot))??0;Bd(k.value,jt,ze,gt,z.value,rr,Ot)&&(Ct=!0),te(jt,ze,vt)}ae({emitChange:!1,rowIndexMap:vt}),Ct&&s.emit("selection-change",k.value?[...k.value]:[]),s.emit("select-all",(k.value||[]).slice())},he=()=>{var Ze;if(((Ze=p.value)==null?void 0:Ze.length)===0){E.value=!1;return}let ze=0,Ct=0;const It=gt=>{for(const vt of gt){const _t=z.value&&z.value.call(null,vt,ze);if(J(vt))Ct++;else if(!z.value||_t)return!1;ze++;const Bt=U(vt);if(Bt.length&&!It(Bt))return!1}return!0},Ot=It(p.value||[]);E.value=Ct===0?!1:Ot},ue=ze=>{if(!i.value)return!1;const Ct=Di(ze,i.value);return!!P.value[Ct]},pe=ze=>{var Ze;if(!s||!s.store)return 0;const{treeData:Ct}=s.store.states;let It=0;const Ot=(Ze=Ct.value[ze])==null?void 0:Ze.children;return Ot&&(It+=Ot.length,Ot.forEach(gt=>{It+=pe(gt)})),It},se=(ze,Ct)=>{const It={};return os(ze).forEach(Ot=>{H.value[Ot.id]=Ct,It[Ot.columnKey||Ot.id]=Ct}),It},V=(ze,Ct,It)=>{K.value&&K.value!==ze&&(K.value.order=null),K.value=ze,G.value=Ct,j.value=It},Ce=()=>{let ze=t.unref(y);Object.keys(H.value).forEach(Ct=>{const It=H.value[Ct];if(!It||It.length===0)return;const Ot=jM({columns:u.value},Ct);Ot&&Ot.filterMethod&&(ze=ze.filter(Ze=>It.some(gt=>Ot.filterMethod.call(null,gt,Ze,Ot))))}),$.value=ze},ve=()=>{p.value=nne($.value??[],{sortingColumn:K.value,sortProp:G.value,sortOrder:j.value})},ye=(ze=void 0)=>{ze!=null&&ze.filter||Ce(),ve()},Ae=ze=>{const{tableHeaderRef:Ct}=s.refs;if(!Ct)return;const It=Object.assign({},Ct.filterPanels),Ot=Object.keys(It);if(Ot.length)if(Ar(ze)&&(ze=[ze]),nr(ze)){const Ze=ze.map(gt=>Wre({columns:u.value},gt));Ot.forEach(gt=>{const vt=Ze.find(_t=>_t.id===gt);vt&&(vt.filteredValue=[])}),s.store.commit("filterChange",{column:Ze,values:[],silent:!0,multi:!0})}else Ot.forEach(Ze=>{const gt=u.value.find(vt=>vt.id===Ze);gt&&(gt.filteredValue=[])}),H.value={},s.store.commit("filterChange",{column:{},values:[],silent:!0})},me=()=>{K.value&&(V(null,null,null),s.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:be,toggleRowExpansion:we,updateExpandRows:Te,states:He,isRowExpanded:je}=ene({data:p,rowKey:i}),{updateTreeExpandKeys:qe,toggleTreeExpansion:tt,updateTreeData:mt,updateKeyChildren:kt,loadOrToggle:ht,states:yt}=rne({data:p,rowKey:i}),{updateCurrentRowData:Lt,updateCurrentRow:We,setCurrentRowKey:Oe,states:Ke}=tne({data:p,rowKey:i}),nt=ze=>{be(ze),qe(ze)},Xe=(ze,Ct)=>{u.value.some(({type:It})=>It==="expand")?we(ze,Ct):tt(ze,Ct)};return t.watch(()=>yt.checkStrictly.value,ze=>{ze?(P.value={},I=[]):ae({emitChange:!1}),he()}),t.watch(()=>yt.lazyTreeNodeMap.value,()=>{var Ot;if(!yt.lazy.value||yt.checkStrictly.value||!i.value)return;const ze=ne.value,Ct=k.value.length;for(const Ze of Object.keys(yt.lazyTreeNodeMap.value))(Ot=L.value)!=null&&Ot[Ze]&&te(L.value[Ze].row,!0,ze);const It=k.value.length!==Ct;ae({emitChange:!It,rowIndexMap:ze}),he(),It&&s.emit("selection-change",[...k.value])}),{assertRowKey:O,updateColumns:W,scheduleLayout:Z,isSelected:J,clearSelection:ce,cleanSelection:q,getSelectionRows:fe,getHalfSelectionRows:re,toggleRowSelection:le,_toggleAllSelection:de,toggleAllSelection:null,updateAllSelected:he,updateSelectionByChildren:ae,getRowIndeterminate:ue,updateFilters:se,updateCurrentRow:We,updateSort:V,execFilter:Ce,execSort:ve,execQuery:ye,clearFilter:Ae,clearSort:me,toggleRowExpansion:we,setExpandRowKeysAdapter:nt,setCurrentRowKey:Oe,toggleRowExpansionAdapter:Xe,isRowExpanded:je,updateExpandRows:Te,updateCurrentRowData:Lt,loadOrToggle:ht,updateTreeData:mt,updateKeyChildren:kt,states:{tableSize:C,rowKey:i,data:p,_data:y,isComplex:A,_columns:h,originColumns:d,columns:u,fixedColumns:c,rightFixedColumns:f,leafColumns:m,fixedLeafColumns:g,rightFixedLeafColumns:v,updateOrderFns:b,leafColumnsLength:w,fixedLeafColumnsLength:_,rightFixedLeafColumnsLength:x,isAllSelected:E,selection:k,selectionIndeterminate:P,reserveSelection:D,selectOnIndeterminate:R,selectable:z,rowExpandable:F,filters:H,filteredData:$,sortingColumn:K,sortProp:G,sortOrder:j,hoverRow:N,...He,...yt,...Ke}}}function Wb(s,C){return s.map(i=>{var p;return i.id===C.id?C:((p=i.children)!=null&&p.length&&(i.children=Wb(i.children,C)),i)})}function Kb(s){s.forEach(C=>{var i,p;C.no=(i=C.getColumnIndex)==null?void 0:i.call(C),(p=C.children)!=null&&p.length&&Kb(C.children)}),s.sort((C,i)=>C.no-i.no)}function sne(){const s=t.getCurrentInstance(),C=ine(),i=zt("table"),{t:p}=Yr();return{ns:i,t:p,...C,mutations:{setData(d,u){const c=t.unref(d._data)!==u;d.data.value=u,d._data.value=u,s.store.execQuery(),s.store.updateCurrentRowData(),s.store.updateExpandRows(),s.store.updateTreeData(s.store.states.defaultExpandAll.value),t.unref(d.reserveSelection)?s.store.assertRowKey():c?s.store.clearSelection():s.store.cleanSelection(),s.store.updateSelectionByChildren({emitChange:!1}),s.store.updateAllSelected(),s.$ready&&s.store.scheduleLayout()},insertColumn(d,u,c,f){var v;const m=t.unref(d._columns);let g=[];c?(c&&!c.children&&(c.children=[]),(v=c.children)==null||v.push(u),g=Wb(m,c)):(m.push(u),g=m),Kb(g),d._columns.value=g,d.updateOrderFns.push(f),u.type==="selection"&&(d.selectable.value=u.selectable,d.reserveSelection.value=u.reserveSelection),s.$ready&&(s.store.updateColumns(),s.store.scheduleLayout())},updateColumnOrder(d,u){var c;((c=u.getColumnIndex)==null?void 0:c.call(u))!==u.no&&(Kb(d._columns.value),s.$ready&&s.store.updateColumns())},removeColumn(d,u,c,f){var v;const m=t.unref(d._columns)||[];if(c)(v=c.children)==null||v.splice(c.children.findIndex(b=>b.id===u.id),1),t.nextTick(()=>{var b;((b=c.children)==null?void 0:b.length)===0&&delete c.children}),d._columns.value=Wb(m,c);else{const b=m.indexOf(u);b>-1&&(m.splice(b,1),d._columns.value=m)}const g=d.updateOrderFns.indexOf(f);g>-1&&d.updateOrderFns.splice(g,1),s.$ready&&(s.store.updateColumns(),s.store.scheduleLayout())},sort(d,u){const{prop:c,order:f,init:m}=u;if(c){const g=t.unref(d.columns).find(v=>v.property===c);g&&(g.order=f,s.store.updateSort(g,c,f),s.store.commit("changeSortCondition",{init:m}))}},changeSortCondition(d,u){const{sortingColumn:c,sortProp:f,sortOrder:m}=d,g=t.unref(c),v=t.unref(f),b=t.unref(m);lm(b)&&(d.sortingColumn.value=null,d.sortProp.value=null),s.store.execQuery({filter:!0}),(!u||!(u.silent||u.init))&&s.emit("sort-change",{column:g,prop:v,order:b}),s.store.updateTableScrollY()},filterChange(d,u){const{column:c,values:f,silent:m}=u,g=s.store.updateFilters(c,f);s.store.execQuery(),m||s.emit("filter-change",g),s.store.updateTableScrollY()},toggleAllSelection(){var d,u;(u=(d=s.store).toggleAllSelection)==null||u.call(d)},rowSelectedChanged(d,u){s.store.toggleRowSelection(u),s.store.updateAllSelected()},setHoverRow(d,u){d.hoverRow.value=u},setCurrentRow(d,u){s.store.updateCurrentRow(u)}},commit:function(d,...u){const c=s.store.mutations;if(c[d])c[d].apply(s,[s.store.states,...u]);else throw new Error(`Action not found: ${d}`)},updateTableScrollY:function(){t.nextTick(()=>s.layout.updateScrollY.apply(s.layout))}}}const Xb={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",rowExpandable:"rowExpandable",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy","treeProps.hasChildren":{key:"lazyColumnIdentifier",default:"hasChildren"},"treeProps.children":{key:"childrenColumnName",default:"children"},"treeProps.checkStrictly":{key:"checkStrictly",default:!1}};function one(s,C){if(!s)throw new Error("Table is required.");const i=sne();return i.toggleAllSelection=Ra(i._toggleAllSelection,10),Object.keys(Xb).forEach(p=>{WM(KM(C,p),p,i)}),ane(i,C),i}function ane(s,C){Object.keys(Xb).forEach(i=>{t.watch(()=>KM(C,i),p=>{WM(p,i,s)})})}function WM(s,C,i){let p=s,y=Xb[C];mn(y)&&(p=p||y.default,y=y.key),i.states[y].value=p}function KM(s,C){if(C.includes(".")){const i=C.split(".");let p=s;return i.forEach(y=>{p=p[y]}),p}else return s[C]}var lne=class{constructor(s){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.heightMap={},this.height=t.ref(null),this.scrollX=t.ref(!1),this.scrollY=t.ref(!1),this.bodyWidth=t.ref(null),this.fixedWidth=t.ref(null),this.rightFixedWidth=t.ref(null),this.gutterWidth=0;for(const C in s)Xi(s,C)&&(t.isRef(this[C])?this[C].value=s[C]:this[C]=s[C]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){const s=this.height.value;if(lm(s))return!1;const C=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(C!=null&&C.wrapRef)){let i=!0;const p=this.scrollY.value;return i=C.wrapRef.scrollHeight>C.wrapRef.clientHeight,this.scrollY.value=i,p!==i}return!1}setHeight(s,C="height"){if(!un)return;const i=this.table.vnode.el;if(s=Xre(s),this.height.value=Number(s),this.heightMap[C]=s,!i&&(s||s===0)){t.nextTick(()=>{this.heightMap[C]===s&&this.setHeight(s,C)});return}i&&lr(s)?(i.style[C]=`${s}px`,this.updateElsHeight()):i&&Ar(s)&&(i.style[C]=s,this.updateElsHeight())}setMaxHeight(s){this.setHeight(s,"max-height")}getFlattenColumns(){const s=[];return this.table.store.states.columns.value.forEach(C=>{C.isColumnGroup?s.push.apply(s,C.columns):s.push(C)}),s}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(s){if(!s)return!0;let C=s;for(;C.tagName!=="DIV";){if(getComputedStyle(C).display==="none")return!0;C=C.parentElement}return!1}updateColumnsWidth(){var d;if(!un)return;const s=this.fit,C=(d=this.table.vnode.el)==null?void 0:d.clientWidth;let i=0;const p=this.getFlattenColumns(),y=p.filter(u=>!lr(u.width));if(p.forEach(u=>{lr(u.width)&&u.realWidth&&(u.realWidth=null)}),y.length>0&&s){if(p.forEach(u=>{i+=Number(u.width||u.minWidth||80)}),i<=C){this.scrollX.value=!1;const u=C-i;if(y.length===1)y[0].realWidth=Number(y[0].minWidth||80)+u;else{const c=u/y.reduce((m,g)=>m+Number(g.minWidth||80),0);let f=0;y.forEach((m,g)=>{if(g===0)return;const v=Math.floor(Number(m.minWidth||80)*c);f+=v,m.realWidth=Number(m.minWidth||80)+v}),y[0].realWidth=Number(y[0].minWidth||80)+u-f}}else this.scrollX.value=!0,y.forEach(u=>{u.realWidth=Number(u.minWidth)});this.bodyWidth.value=Math.max(i,C),this.table.state.resizeState.value.width=this.bodyWidth.value}else p.forEach(u=>{!u.width&&!u.minWidth?u.realWidth=80:u.realWidth=Number(u.width||u.minWidth),i+=u.realWidth}),this.scrollX.value=i>C,this.bodyWidth.value=i;const A=this.store.states.fixedColumns.value;if(A.length>0){let u=0;A.forEach(c=>{u+=Number(c.realWidth||c.width)}),this.fixedWidth.value=u}const h=this.store.states.rightFixedColumns.value;if(h.length>0){let u=0;h.forEach(c=>{u+=Number(c.realWidth||c.width)}),this.rightFixedWidth.value=u}this.notifyObservers("columns")}addObserver(s){this.observers.push(s)}removeObserver(s){const C=this.observers.indexOf(s);C!==-1&&this.observers.splice(C,1)}notifyObservers(s){this.observers.forEach(C=>{var i,p;switch(s){case"columns":(i=C.state)==null||i.onColumnsChange(this);break;case"scrollable":(p=C.state)==null||p.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${s}.`)}})}};const _a=Symbol("ElTable"),XM=s=>{const C=[];return s.forEach(i=>{i.children?(C.push(i),C.push.apply(C,XM(i.children))):C.push(i)}),C},YM=s=>{let C=1;const i=(y,A)=>{if(A&&(y.level=A.level+1,C<y.level&&(C=y.level)),y.children){let h=0;y.children.forEach(d=>{i(d,y),h+=d.colSpan}),y.colSpan=h}else y.colSpan=1};s.forEach(y=>{y.level=1,i(y,void 0)});const p=[];for(let y=0;y<C;y++)p.push([]);return XM(s).forEach(y=>{y.children?(y.rowSpan=1,y.children.forEach(A=>A.isSubColumn=!0)):y.rowSpan=C-y.level+1,p[y.level-1].push(y)}),p};function cne(s){const C=t.inject(_a),i=t.computed(()=>YM(s.store.states.originColumns.value));return{isGroup:t.computed(()=>{const A=i.value.length>1;return A&&C&&(C.state.isGroup.value=!0),A}),toggleAllSelection:A=>{A.stopPropagation(),C==null||C.store.commit("toggleAllSelection")},columnRows:i}}var une=t.defineComponent({name:"ElTableFilterPanel",components:{ElCheckbox:sa,ElCheckboxGroup:iA,ElScrollbar:gi,ElTooltip:Ji,ElIcon:ir,ArrowDown:Zt.ArrowDown,ArrowUp:Zt.ArrowUp},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function},appendTo:Qn.appendTo},setup(s){const C=t.getCurrentInstance(),{t:i}=Yr(),p=zt("table-filter"),y=C==null?void 0:C.parent;s.column&&!y.filterPanels.value[s.column.id]&&(y.filterPanels.value[s.column.id]=C);const A=t.ref(null),h=t.ref(null),d=t.ref(0),u=t.ref([]),c=t.computed(()=>s.column&&s.column.filters),f=t.computed(()=>s.column&&s.column.filterClassName?`${p.b()} ${s.column.filterClassName}`:p.b()),m=t.computed({get:()=>{var F;return(((F=s.column)==null?void 0:F.filteredValue)||[])[0]},set:F=>{var H;if(s.column){const $=[...s.column.filteredValue??[]];Mo(F)?$.splice(0,1):$.splice(0,1,F),(H=s.upDataColumn)==null||H.call(s,"filteredValue",$)}}}),g=t.computed(()=>s.column?s.column.filterMultiple:!0),v=F=>F.value===m.value,b=()=>{var F;(F=A.value)==null||F.onClose()},w=()=>{E(u.value),b()},_=()=>{u.value=[],E(u.value),b()},x=(F,H)=>{m.value=F,d.value=H,Mo(F)?E([]):E([F]),b()},E=F=>{var H,$,K;(H=s.upDataColumn)==null||H.call(s,"filteredValue",F),($=s.store)==null||$.commit("filterChange",{column:s.column,values:F}),(K=s.store)==null||K.updateAllSelected()},k=()=>{var F;u.value=[...((F=s.column)==null?void 0:F.filteredValue)||[]]},P=()=>{var F,H;(F=h.value)==null||F.focus(),!g.value&&R(),s.column&&((H=s.upDataColumn)==null||H.call(s,"filterOpened",!0))},D=()=>{var F;s.column&&((F=s.upDataColumn)==null||F.call(s,"filterOpened",!1))},R=()=>{if(Mo(m)){d.value=0;return}const F=(c.value||[]).findIndex(H=>H.value===m.value);d.value=F>=0?F+1:0};return{multiple:g,filterClassName:f,filteredValue:u,filterValue:m,filters:c,handleConfirm:w,handleReset:_,handleSelect:x,isPropAbsent:Mo,isActive:v,t:i,ns:p,tooltipRef:A,rootRef:h,checkedIndex:d,handleBeforeShowTooltip:k,handleShowTooltip:P,handleHideTooltip:D,handleKeydown:F=>{var j,N;const H=Dn(F),$=(c.value?c.value.length:0)+1;let K=d.value,G=!0;switch(H){case Gt.down:case Gt.right:K=(K+1)%$;break;case Gt.up:case Gt.left:K=(K-1+$)%$;break;case Gt.tab:b(),G=!1;break;case Gt.enter:case Gt.space:if(K===0)x(null,0);else{const I=(c.value||[])[K-1];I.value&&x(I.value,K)}break;default:G=!1}G&&F.preventDefault(),d.value=K,(N=(j=h.value)==null?void 0:j.querySelector(`.${p.e("list-item")}:nth-child(${K+1})`))==null||N.focus()}}}});const dne=["disabled"],fne=["tabindex","aria-checked"],hne=["tabindex","aria-checked","onClick"],pne=["aria-label"];function mne(s,C,i,p,y,A){const h=t.resolveComponent("el-checkbox"),d=t.resolveComponent("el-checkbox-group"),u=t.resolveComponent("el-scrollbar"),c=t.resolveComponent("arrow-up"),f=t.resolveComponent("arrow-down"),m=t.resolveComponent("el-icon"),g=t.resolveComponent("el-tooltip");return t.openBlock(),t.createBlock(g,{ref:"tooltipRef",offset:0,placement:s.placement,"show-arrow":!1,trigger:"click",role:"dialog",teleported:"",effect:"light",pure:"",loop:"","popper-class":s.filterClassName,persistent:"","append-to":s.appendTo,onBeforeShow:s.handleBeforeShowTooltip,onShow:s.handleShowTooltip,onHide:s.handleHideTooltip},{content:t.withCtx(()=>[s.multiple?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"rootRef",tabindex:"-1",class:t.normalizeClass(s.ns.e("multiple"))},[t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("content"))},[t.createVNode(u,{"wrap-class":s.ns.e("wrap")},{default:t.withCtx(()=>[t.createVNode(d,{modelValue:s.filteredValue,"onUpdate:modelValue":C[0]||(C[0]=v=>s.filteredValue=v),class:t.normalizeClass(s.ns.e("checkbox-group"))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.filters,v=>(t.openBlock(),t.createBlock(h,{key:v.value,value:v.value},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(v.text),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("bottom"))},[t.createElementVNode("button",{class:t.normalizeClass(s.ns.is("disabled",s.filteredValue.length===0)),disabled:s.filteredValue.length===0,type:"button",onClick:C[1]||(C[1]=(...v)=>s.handleConfirm&&s.handleConfirm(...v))},t.toDisplayString(s.t("el.table.confirmFilter")),11,dne),t.createElementVNode("button",{type:"button",onClick:C[2]||(C[2]=(...v)=>s.handleReset&&s.handleReset(...v))},t.toDisplayString(s.t("el.table.resetFilter")),1)],2)],2)):(t.openBlock(),t.createElementBlock("ul",{key:1,ref:"rootRef",tabindex:"-1",role:"radiogroup",class:t.normalizeClass(s.ns.e("list")),onKeydown:C[4]||(C[4]=(...v)=>s.handleKeydown&&s.handleKeydown(...v))},[t.createElementVNode("li",{role:"radio",class:t.normalizeClass([s.ns.e("list-item"),s.ns.is("active",s.isPropAbsent(s.filterValue))]),tabindex:s.checkedIndex===0?0:-1,"aria-checked":s.isPropAbsent(s.filterValue),onClick:C[3]||(C[3]=v=>s.handleSelect(null,0))},t.toDisplayString(s.t("el.table.clearFilter")),11,fne),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.filters,(v,b)=>(t.openBlock(),t.createElementBlock("li",{key:v.value,role:"radio",class:t.normalizeClass([s.ns.e("list-item"),s.ns.is("active",s.isActive(v))]),tabindex:s.checkedIndex===b+1?0:-1,"aria-checked":s.isActive(v),onClick:w=>s.handleSelect(v.value,b+1)},t.toDisplayString(v.text),11,hne))),128))],34))]),default:t.withCtx(()=>{var v;return[t.createElementVNode("button",{type:"button",class:t.normalizeClass(`${s.ns.namespace.value}-table__column-filter-trigger`),"aria-label":s.t("el.table.filterLabel",{column:((v=s.column)==null?void 0:v.label)||""})},[t.createVNode(m,null,{default:t.withCtx(()=>[t.renderSlot(s.$slots,"filter-icon",{},()=>{var b;return[(b=s.column)!=null&&b.filterOpened?(t.openBlock(),t.createBlock(c,{key:0})):(t.openBlock(),t.createBlock(f,{key:1}))]})]),_:3})],10,pne)]}),_:3},8,["placement","popper-class","append-to","onBeforeShow","onShow","onHide"])}var Ane=Yi(une,[["render",mne]]);function Yb(s){const C=t.getCurrentInstance();t.onBeforeMount(()=>{i.value.addObserver(C)}),t.onMounted(()=>{p(i.value),y(i.value)}),t.onUpdated(()=>{p(i.value),y(i.value)}),t.onUnmounted(()=>{i.value.removeObserver(C)});const i=t.computed(()=>{const A=s.layout;if(!A)throw new Error("Can not find table layout.");return A}),p=A=>{var c;const h=((c=s.vnode.el)==null?void 0:c.querySelectorAll("colgroup > col"))||[];if(!h.length)return;const d=A.getFlattenColumns(),u={};d.forEach(f=>{u[f.id]=f});for(let f=0,m=h.length;f<m;f++){const g=h[f],v=u[g.getAttribute("name")];v&&g.setAttribute("width",v.realWidth||v.width)}},y=A=>{var u,c;const h=((u=s.vnode.el)==null?void 0:u.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let f=0,m=h.length;f<m;f++)h[f].setAttribute("width",A.scrollY.value?A.gutterWidth:"0");const d=((c=s.vnode.el)==null?void 0:c.querySelectorAll("th.gutter"))||[];for(let f=0,m=d.length;f<m;f++){const g=d[f];g.style.width=A.scrollY.value?`${A.gutterWidth}px`:"0",g.style.display=A.scrollY.value?"":"none"}};return{tableLayout:i.value,onColumnsChange:p,onScrollableChange:y}}function gne(s,C){const i=t.getCurrentInstance(),p=t.inject(_a),y=w=>{w.stopPropagation()},A=(w,_)=>{!_.filters&&_.sortable?b(w,_,!1):_.filterable&&!_.sortable&&y(w),p==null||p.emit("header-click",_,w)},h=(w,_)=>{p==null||p.emit("header-contextmenu",_,w)},d=t.ref(null),u=t.ref(!1),c=t.ref(),f=(w,_)=>{var x,E,k;if(un&&!(_.children&&_.children.length>0)&&d.value&&s.border&&d.value.id===_.id){u.value=!0;const P=p;C("set-drag-visible",!0);const D=(x=P==null?void 0:P.vnode.el)==null?void 0:x.getBoundingClientRect().left,R=(k=(E=i==null?void 0:i.vnode)==null?void 0:E.el)==null?void 0:k.querySelector(`th.${_.id}`),z=R.getBoundingClientRect(),F=z.left-D+30;Zo(R,"noclick"),c.value={startMouseLeft:w.clientX,startLeft:z.right-D,startColumnLeft:z.left-D,tableLeft:D};const H=P==null?void 0:P.refs.resizeProxy;H.style.left=`${c.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $=G=>{const j=G.clientX-c.value.startMouseLeft,N=c.value.startLeft+j;H.style.left=`${Math.max(F,N)}px`},K=()=>{if(u.value){const{startColumnLeft:G,startLeft:j}=c.value;_.width=_.realWidth=Number.parseInt(H.style.left,10)-G,P==null||P.emit("header-dragend",_.width,j-G,_,w),requestAnimationFrame(()=>{s.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",u.value=!1,d.value=null,c.value=void 0,C("set-drag-visible",!1)}document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",K),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{js(R,"noclick")},0)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",K)}},m=(w,_)=>{var H;if(!s.border||_.children&&_.children.length>0)return;const x=w.target,E=uo(x)?x.closest("th"):null;if(!E)return;const k=Jo(E,"is-sortable");if(k){const $=u.value?"col-resize":"";E.style.cursor=$;const K=E.querySelector(".caret-wrapper");K&&(K.style.cursor=$)}if(!_.resizable||u.value){d.value=null;return}const P=E.getBoundingClientRect(),D=((H=E.parentNode)==null?void 0:H.lastElementChild)===E,R=s.allowDragLastColumn||!D,z=P.width>12&&P.right-w.clientX<8&&R,F=z?"col-resize":"";document.body.style.cursor=F,d.value=z?_:null,k&&(E.style.cursor=F)},g=()=>{!un||u.value||(document.body.style.cursor="")},v=({order:w,sortOrders:_})=>{if(w==="")return _[0];const x=_.indexOf(w||null);return _[x>_.length-2?0:x+1]},b=(w,_,x)=>{var H;w.stopPropagation();const E=_.order===x?null:x||v(_),k=(H=w.target)==null?void 0:H.closest("th");if(k&&Jo(k,"noclick")){js(k,"noclick");return}if(!_.sortable)return;const P=w.currentTarget;if(["ascending","descending"].some($=>Jo(P,$)&&!_.sortOrders.includes($)))return;const D=s.store.states;let R=D.sortProp.value,z;const F=D.sortingColumn.value;(F!==_||F===_&&lm(F.order))&&(F&&(F.order=null),D.sortingColumn.value=_,R=_.property??null),E?z=_.order=E:z=_.order=null,D.sortProp.value=R,D.sortOrder.value=z,p==null||p.store.commit("changeSortCondition")};return{handleHeaderClick:A,handleHeaderContextMenu:h,handleMouseDown:f,handleMouseMove:m,handleMouseOut:g,handleSortClick:b,handleFilterClick:y}}function vne(s){const C=t.inject(_a),i=zt("table");return{getHeaderRowStyle:d=>{const u=C==null?void 0:C.props.headerRowStyle;return Nr(u)?u.call(null,{rowIndex:d}):u},getHeaderRowClass:d=>{const u=[],c=C==null?void 0:C.props.headerRowClassName;return Ar(c)?u.push(c):Nr(c)&&u.push(c.call(null,{rowIndex:d})),u.join(" ")},getHeaderCellStyle:(d,u,c,f)=>{let m=(C==null?void 0:C.props.headerCellStyle)??{};Nr(m)&&(m=m.call(null,{rowIndex:d,columnIndex:u,row:c,column:f}));const g=Qb(u,f.fixed,s.store,c);return Sd(g,"left"),Sd(g,"right"),Object.assign({},m,g)},getHeaderCellClass:(d,u,c,f)=>{const m=Gb(i.b(),u,f.fixed,s.store,c),g=[f.id,f.order,f.headerAlign,f.className,f.labelClassName,...m];f.children||g.push("is-leaf"),f.sortable&&g.push("is-sortable");const v=C==null?void 0:C.props.headerCellClassName;return Ar(v)?g.push(v):Nr(v)&&g.push(v.call(null,{rowIndex:d,columnIndex:u,row:c,column:f})),g.push(i.e("cell")),g.filter(b=>!!b).join(" ")}}}var JM=t.defineComponent({name:"ElTableHeader",components:{ElCheckbox:sa},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})},appendFilterPanelTo:{type:String},allowDragLastColumn:{type:Boolean}},setup(s,{emit:C}){const i=t.getCurrentInstance(),p=t.inject(_a),y=zt("table"),A=t.ref({}),{onColumnsChange:h,onScrollableChange:d}=Yb(p),u=(p==null?void 0:p.props.tableLayout)==="auto",c=t.reactive(new Map),f=t.ref();let m;const g=()=>{m&&(clearTimeout(m),m=void 0),m=setTimeout(()=>{m=void 0;const G=f.value;G&&c.size>0&&(c.forEach((j,N)=>{const I=G.querySelector(`.${N.replace(/\s/g,".")}`);I&&(j.width=I.getBoundingClientRect().width||j.width)}),c.clear())})};t.watch(c,g),t.onBeforeUnmount(()=>{m&&(clearTimeout(m),m=void 0)}),t.onMounted(async()=>{await t.nextTick(),await t.nextTick();const{prop:G,order:j}=s.defaultSort;p==null||p.store.commit("sort",{prop:G,order:j,init:!0}),g()});const{handleHeaderClick:v,handleHeaderContextMenu:b,handleMouseDown:w,handleMouseMove:_,handleMouseOut:x,handleSortClick:E,handleFilterClick:k}=gne(s,C),{getHeaderRowStyle:P,getHeaderRowClass:D,getHeaderCellStyle:R,getHeaderCellClass:z}=vne(s),{isGroup:F,toggleAllSelection:H,columnRows:$}=cne(s),{t:K}=Yr();return i.state={onColumnsChange:h,onScrollableChange:d},i.filterPanels=A,{ns:y,t:K,filterPanels:A,onColumnsChange:h,onScrollableChange:d,columnRows:$,getHeaderRowClass:D,getHeaderRowStyle:P,getHeaderCellClass:z,getHeaderCellStyle:R,handleHeaderClick:v,handleHeaderContextMenu:b,handleMouseDown:w,handleMouseMove:_,handleMouseOut:x,handleSortClick:E,handleFilterClick:k,isGroup:F,toggleAllSelection:H,saveIndexSelection:c,isTableLayoutAuto:u,theadRef:f,updateFixedColumnStyle:g}},render(){const{ns:s,t:C,isGroup:i,columnRows:p,getHeaderCellStyle:y,getHeaderCellClass:A,getHeaderRowClass:h,getHeaderRowStyle:d,handleHeaderClick:u,handleHeaderContextMenu:c,handleMouseDown:f,handleMouseMove:m,handleSortClick:g,handleMouseOut:v,store:b,$parent:w,saveIndexSelection:_,isTableLayoutAuto:x}=this;let E=1;return t.h("thead",{ref:"theadRef",class:s.is("group",i)},p.map((k,P)=>t.h("tr",{class:h(P),key:P,style:d(P)},k.map((D,R)=>{D.rowSpan>E&&(E=D.rowSpan);const z=A(P,R,k,D);return x&&D.fixed&&_.set(z,D),t.h("th",{class:z,colspan:D.colSpan,key:`${D.id}-thead`,rowspan:D.rowSpan,scope:D.colSpan>1?"colgroup":"col",ariaSort:D.sortable?D.order:void 0,style:y(P,R,k,D),onClick:F=>{var H;(H=F.currentTarget)!=null&&H.classList.contains("noclick")||u(F,D)},onContextmenu:F=>c(F,D),onMousedown:F=>f(F,D),onMousemove:F=>m(F,D),onMouseout:v},[t.h("div",{class:["cell",D.filteredValue&&D.filteredValue.length>0?"highlight":""]},[D.renderHeader?D.renderHeader({column:D,$index:R,store:b,_self:w}):D.label,D.sortable&&t.h("button",{type:"button",class:"caret-wrapper","aria-label":C("el.table.sortLabel",{column:D.label||""}),onClick:F=>g(F,D)},[t.h("i",{onClick:F=>g(F,D,"ascending"),class:"sort-caret ascending"}),t.h("i",{onClick:F=>g(F,D,"descending"),class:"sort-caret descending"})]),D.filterable&&t.h(Ane,{store:b,placement:D.filterPlacement||"bottom-start",appendTo:w==null?void 0:w.appendFilterPanelTo,column:D,upDataColumn:(F,H)=>{D[F]=H}},{"filter-icon":()=>D.renderFilterIcon?D.renderFilterIcon({filterOpened:D.filterOpened}):null})])])}))))}});function yne(s){const C=t.inject(_a),i=t.ref(""),p=t.ref(t.h("div")),y=(b,w,_)=>{var D,R;const x=C,E=Hb(b);let k=null;const P=(D=x==null?void 0:x.vnode.el)==null?void 0:D.dataset.prefix;E&&(k=VM({columns:((R=s.store)==null?void 0:R.states.columns.value)??[]},E,P),k&&(x==null||x.emit(`cell-${_}`,w,k,E,b))),x==null||x.emit(`row-${_}`,w,k,b)},A=(b,w)=>{y(b,w,"dblclick")},h=(b,w)=>{var _;(_=s.store)==null||_.commit("setCurrentRow",w),y(b,w,"click")},d=(b,w)=>{y(b,w,"contextmenu")},u=Ra(b=>{var w;(w=s.store)==null||w.commit("setHoverRow",b)},30),c=Ra(()=>{var b;(b=s.store)==null||b.commit("setHoverRow",null)},30),f=b=>{const w=window.getComputedStyle(b,null);return{left:Number.parseInt(w.paddingLeft,10)||0,right:Number.parseInt(w.paddingRight,10)||0,top:Number.parseInt(w.paddingTop,10)||0,bottom:Number.parseInt(w.paddingBottom,10)||0}},m=(b,w,_)=>{var E;let x=(E=w==null?void 0:w.target)==null?void 0:E.parentNode;for(;b>1&&(x=x==null?void 0:x.nextSibling,!(!x||x.nodeName!=="TR"));)_(x,"hover-row hover-fixed-row"),b--};return{handleDoubleClick:A,handleClick:h,handleContextMenu:d,handleMouseEnter:u,handleMouseLeave:c,handleCellMouseEnter:(b,w,_)=>{var U,O,Q;if(!C)return;const x=C,E=Hb(b),k=(U=x==null?void 0:x.vnode.el)==null?void 0:U.dataset.prefix;let P=null;if(E){if(P=VM({columns:((O=s.store)==null?void 0:O.states.columns.value)??[]},E,k),!P)return;E.rowSpan>1&&m(E.rowSpan,b,Zo);const W=x.hoverState={cell:E,column:P,row:w};x==null||x.emit("cell-mouse-enter",W.row,W.column,W.cell,b)}if(!_){(bi==null?void 0:bi.trigger)===E&&(bi==null||bi());return}const D=b.target.querySelector(".cell");if(!(Jo(D,`${k}-tooltip`)&&D.childNodes.length&&((Q=D.textContent)!=null&&Q.trim())))return;const R=document.createRange();R.setStart(D,0),R.setEnd(D,D.childNodes.length);const{width:z,height:F}=R.getBoundingClientRect(),{width:H,height:$}=D.getBoundingClientRect(),{top:K,left:G,right:j,bottom:N}=f(D),I=G+j,L=K+N;Ha(z+I,H)||Ha(F+L,$)||Ha(D.scrollWidth,H)?qre(_,((E==null?void 0:E.innerText)||(E==null?void 0:E.textContent))??"",w,P,E,x):(bi==null?void 0:bi.trigger)===E&&(bi==null||bi())},handleCellMouseLeave:b=>{const w=Hb(b);if(!w)return;w.rowSpan>1&&m(w.rowSpan,b,js);const _=C==null?void 0:C.hoverState;C==null||C.emit("cell-mouse-leave",_==null?void 0:_.row,_==null?void 0:_.column,_==null?void 0:_.cell,b)},tooltipContent:i,tooltipTrigger:p}}function bne(s){const C=t.inject(_a),i=zt("table");return{getRowStyle:(c,f)=>{const m=C==null?void 0:C.props.rowStyle;return Nr(m)?m.call(null,{row:c,rowIndex:f}):m||null},getRowClass:(c,f,m)=>{var b;const g=[i.e("row")];C!=null&&C.props.highlightCurrentRow&&c===((b=s.store)==null?void 0:b.states.currentRow.value)&&g.push("current-row"),s.stripe&&m%2===1&&g.push(i.em("row","striped"));const v=C==null?void 0:C.props.rowClassName;return Ar(v)?g.push(v):Nr(v)&&g.push(v.call(null,{row:c,rowIndex:f})),g},getCellStyle:(c,f,m,g)=>{const v=C==null?void 0:C.props.cellStyle;let b=v??{};Nr(v)&&(b=v.call(null,{rowIndex:c,columnIndex:f,row:m,column:g}));const w=Qb(f,s==null?void 0:s.fixed,s.store);return Sd(w,"left"),Sd(w,"right"),Object.assign({},b,w)},getCellClass:(c,f,m,g,v)=>{const b=Gb(i.b(),f,s==null?void 0:s.fixed,s.store,void 0,v),w=[g.id,g.align,g.className,...b],_=C==null?void 0:C.props.cellClassName;return Ar(_)?w.push(_):Nr(_)&&w.push(_.call(null,{rowIndex:c,columnIndex:f,row:m,column:g})),w.push(i.e("cell")),w.filter(x=>!!x).join(" ")},getSpan:(c,f,m,g)=>{let v=1,b=1;const w=C==null?void 0:C.props.spanMethod;if(Nr(w)){const _=w({row:c,column:f,rowIndex:m,columnIndex:g});nr(_)?(v=_[0],b=_[1]):mn(_)&&(v=_.rowspan,b=_.colspan)}return{rowspan:v,colspan:b}},getColspanRealWidth:(c,f,m)=>{if(f<1)return c[m].realWidth;const g=c.map(({realWidth:v,width:b})=>v||b).slice(m,m+f);return Number(g.reduce((v,b)=>Number(v)+Number(b),-1))}}}const _ne=["colspan","rowspan"];var wne=t.defineComponent({name:"TableTdWrapper",__name:"td-wrapper",props:{colspan:{type:Number,default:1},rowspan:{type:Number,default:1}},setup(s){return(C,i)=>(t.openBlock(),t.createElementBlock("td",{colspan:s.colspan,rowspan:s.rowspan},[t.renderSlot(C.$slots,"default")],8,_ne))}}),Cne=wne;function xne(s){const C=t.inject(_a),i=zt("table"),{handleDoubleClick:p,handleClick:y,handleContextMenu:A,handleMouseEnter:h,handleMouseLeave:d,handleCellMouseEnter:u,handleCellMouseLeave:c,tooltipContent:f,tooltipTrigger:m}=yne(s),{getRowStyle:g,getRowClass:v,getCellStyle:b,getCellClass:w,getSpan:_,getColspanRealWidth:x}=bne(s);let E=-1;const k=t.computed(()=>{var F;return(F=s.store)==null?void 0:F.states.columns.value.findIndex(({type:H})=>H==="default")}),P=(F,H)=>{var K;const $=(K=C==null?void 0:C.props)==null?void 0:K.rowKey;return $?Di(F,$):H},D=(F,H,$,K=!1)=>{const{tooltipEffect:G,tooltipOptions:j,store:N}=s,{indent:I,columns:L}=N.states,U=[];let O=!0;return $&&(U.push(i.em("row",`level-${$.level}`)),O=!!$.display),H===0&&(E=-1),s.stripe&&O&&E++,U.push(...v(F,H,E)),t.h("tr",{style:[O?null:{display:"none"},g(F,H)],class:U,key:P(F,H),onDblclick:Q=>p(Q,F),onClick:Q=>y(Q,F),onContextmenu:Q=>A(Q,F),onMouseenter:()=>h(H),onMouseleave:d},L.value.map((Q,W)=>{const{rowspan:Z,colspan:J}=_(F,Q,H,W);if(!Z||!J)return null;const ne=Object.assign({},Q);ne.realWidth=x(L.value,J,W);const ae={store:N,_self:s.context||C,column:ne,row:F,$index:H,cellIndex:W,expanded:K};W===k.value&&$&&(ae.treeNode={indent:$.level&&$.level*I.value,level:$.level},Bn($.expanded)&&(ae.treeNode.expanded=$.expanded,"loading"in $&&(ae.treeNode.loading=$.loading),"noLazyChildren"in $&&(ae.treeNode.noLazyChildren=$.noLazyChildren)));const ce=`${P(F,H)},${W}`,q=ne.columnKey||ne.rawColumnKey||"",fe=Q.showOverflowTooltip&&wE({effect:G},j,Q.showOverflowTooltip);return t.h(Cne,{style:b(H,W,F,Q),class:w(H,W,F,Q,J-1),key:`${q}${ce}`,rowspan:Z,colspan:J,onMouseenter:re=>u(re,F,fe),onMouseleave:c},{default:()=>R(W,Q,ae)})}))},R=(F,H,$)=>H.renderCell($);return{wrappedRowRender:(F,H)=>{const $=s.store,{isRowExpanded:K,assertRowKey:G}=$,{treeData:j,lazyTreeNodeMap:N,childrenColumnName:I,rowKey:L}=$.states,U=$.states.columns.value;if(U.some(({type:O})=>O==="expand")){const O=K(F),Q=D(F,H,void 0,O),W=C==null?void 0:C.renderExpanded;if(!W)return console.error("[Element Error]renderExpanded is required."),Q;const Z=[[Q]];return(C.props.preserveExpandedContent||O)&&Z[0].push(t.h("tr",{key:`expanded-row__${Q.key}`,style:{display:O?"":"none"}},[t.h("td",{colspan:U.length,class:`${i.e("cell")} ${i.e("expanded-cell")}`},[W({row:F,$index:H,store:$,expanded:O})])])),Z}else if(Object.keys(j.value).length){G();const O=Di(F,L.value);let Q=j.value[O],W=null;Q&&(W={expanded:Q.expanded,level:Q.level,display:!0,noLazyChildren:void 0,loading:void 0},Bn(Q.lazy)&&(W&&Bn(Q.loaded)&&Q.loaded&&(W.noLazyChildren=!(Q.children&&Q.children.length)),W.loading=Q.loading));const Z=[D(F,H,W??void 0)];if(Q){let J=0;const ne=(ae,ce)=>{ae&&ae.length&&ce&&ae.forEach(q=>{const fe={display:ce.display&&ce.expanded,level:ce.level+1,expanded:!1,noLazyChildren:!1,loading:!1},re=Di(q,L.value);if(Mo(re))throw new Error("For nested data item, row-key is required.");if(Q={...j.value[re]},Q&&(fe.expanded=Q.expanded,Q.level=Q.level||fe.level,Q.display=!!(Q.expanded&&fe.display),Bn(Q.lazy)&&(Bn(Q.loaded)&&Q.loaded&&(fe.noLazyChildren=!(Q.children&&Q.children.length)),fe.loading=Q.loading)),J++,Z.push(D(q,H+J,fe)),Q){const te=N.value[re]||q[I.value];ne(te,Q)}})};Q.display=!0,ne(N.value[O]||F[I.value],Q)}return Z}else return D(F,H,void 0)},tooltipContent:f,tooltipTrigger:m}}const Ene={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var Bne=t.defineComponent({name:"ElTableBody",props:Ene,setup(s){var f;const C=t.getCurrentInstance(),i=t.inject(_a),p=zt("table"),{wrappedRowRender:y,tooltipContent:A,tooltipTrigger:h}=xne(s),{onColumnsChange:d,onScrollableChange:u}=Yb(i),c=[];return t.watch((f=s.store)==null?void 0:f.states.hoverRow,(m,g)=>{var x,E;const v=C==null?void 0:C.vnode.el,b=Array.from((v==null?void 0:v.children)||[]).filter(k=>k==null?void 0:k.classList.contains(`${p.e("row")}`));let w=m;const _=(x=b[w])==null?void 0:x.childNodes;if(_!=null&&_.length){let k=0;Array.from(_).reduce((P,D,R)=>{var z,F;return((z=_[R])==null?void 0:z.colSpan)>1&&(k=(F=_[R])==null?void 0:F.colSpan),D.nodeName!=="TD"&&k===0&&P.push(R),k>0&&k--,P},[]).forEach(P=>{var D;for(w=m;w>0;){const R=(D=b[w-1])==null?void 0:D.childNodes;if(R[P]&&R[P].nodeName==="TD"&&R[P].rowSpan>1){Zo(R[P],"hover-cell"),c.push(R[P]);break}w--}})}else c.forEach(k=>js(k,"hover-cell")),c.length=0;!((E=s.store)!=null&&E.states.isComplex.value)||!un||ms(()=>{const k=b[g],P=b[m];k&&!k.classList.contains("hover-fixed-row")&&js(k,"hover-row"),P&&Zo(P,"hover-row")})}),t.onUnmounted(()=>{bi==null||bi()}),{ns:p,onColumnsChange:d,onScrollableChange:u,wrappedRowRender:y,tooltipContent:A,tooltipTrigger:h}},render(){const{wrappedRowRender:s,store:C}=this,i=(C==null?void 0:C.states.data.value)||[];return t.h("tbody",{tabIndex:-1},[i.reduce((p,y)=>p.concat(s(y,p.length)),[])])}});function Sne(){var C;const s=(C=t.inject(_a))==null?void 0:C.store;return{leftFixedLeafCount:t.computed(()=>(s==null?void 0:s.states.fixedLeafColumnsLength.value)??0),rightFixedLeafCount:t.computed(()=>(s==null?void 0:s.states.rightFixedColumns.value.length)??0),columnsCount:t.computed(()=>(s==null?void 0:s.states.columns.value.length)??0),leftFixedCount:t.computed(()=>(s==null?void 0:s.states.fixedColumns.value.length)??0),rightFixedCount:t.computed(()=>(s==null?void 0:s.states.rightFixedColumns.value.length)??0),columns:t.computed(()=>(s==null?void 0:s.states.columns.value)??[])}}function kne(s){const{columns:C}=Sne(),i=zt("table");return{getCellClasses:(A,h)=>{const d=A[h],u=[i.e("cell"),d.id,d.align,d.labelClassName,...Gb(i.b(),h,d.fixed,s.store)];return d.className&&u.push(d.className),d.children||u.push(i.is("leaf")),u},getCellStyles:(A,h)=>{const d=Qb(h,A.fixed,s.store);return Sd(d,"left"),Sd(d,"right"),d},columns:C}}var ZM=t.defineComponent({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(s){const C=t.inject(_a),i=zt("table"),{getCellClasses:p,getCellStyles:y,columns:A}=kne(s),{onScrollableChange:h,onColumnsChange:d}=Yb(C);return{ns:i,onScrollableChange:h,onColumnsChange:d,getCellClasses:p,getCellStyles:y,columns:A}},render(){const{columns:s,getCellStyles:C,getCellClasses:i,summaryMethod:p,sumText:y}=this,A=this.store.states.data.value;let h=[];return p?h=p({columns:s,data:A}):s.forEach((d,u)=>{if(u===0){h[u]=y;return}const c=A.map(v=>Number(v[d.property])),f=[];let m=!0;c.forEach(v=>{if(!Number.isNaN(+v)){m=!1;const b=`${v}`.split(".")[1];f.push(b?b.length:0)}});const g=Math.max.apply(null,f);m?h[u]="":h[u]=c.reduce((v,b)=>{const w=Number(b);return Number.isNaN(+w)?v:Number.parseFloat((v+b).toFixed(Math.min(g,20)))},0)}),t.h(t.h("tfoot",[t.h("tr",{},[...s.map((d,u)=>t.h("td",{key:u,colspan:d.colSpan,rowspan:d.rowSpan,class:i(s,u),style:C(d,u)},[t.h("div",{class:["cell",d.labelClassName]},[h[u]])]))])]))}});function Pne(s){return{setCurrentRow:g=>{s.commit("setCurrentRow",g)},getSelectionRows:()=>s.getSelectionRows(),getHalfSelectionRows:()=>s.getHalfSelectionRows(),toggleRowSelection:(g,v,b=!0)=>{s.toggleRowSelection(g,v,!1,b),s.updateAllSelected()},clearSelection:()=>{s.clearSelection()},clearFilter:g=>{s.clearFilter(g)},toggleAllSelection:()=>{s.commit("toggleAllSelection")},toggleRowExpansion:(g,v)=>{s.toggleRowExpansionAdapter(g,v)},clearSort:()=>{s.clearSort()},sort:(g,v)=>{s.commit("sort",{prop:g,order:v})},updateKeyChildren:(g,v)=>{s.updateKeyChildren(g,v)}}}function Mne(s,C,i,p){const y=t.ref(!1),A=t.ref(null),h=t.ref(!1),d=I=>{h.value=I},u=t.ref({width:null,height:null,headerHeight:null}),c=t.ref(!1),f={display:"inline-block",verticalAlign:"middle"},m=t.ref(),g=t.ref(0),v=t.ref(0),b=t.ref(0),w=t.ref(0),_=t.ref(0);t.watch(()=>s.height,I=>{C.setHeight(I??null)},{immediate:!0}),t.watch(()=>s.maxHeight,I=>{C.setMaxHeight(I??null)},{immediate:!0}),t.watch(()=>[s.currentRowKey,i.states.rowKey],([I,L])=>{!t.unref(L)||!t.unref(I)||i.setCurrentRowKey(`${I}`)},{immediate:!0}),t.watch(()=>s.data,I=>{p.store.commit("setData",I)},{immediate:!0,deep:!0}),t.watchEffect(()=>{s.expandRowKeys&&i.setExpandRowKeysAdapter(s.expandRowKeys)});const x=()=>{p.store.commit("setHoverRow",null),p.hoverState&&(p.hoverState=null)},E=(I,L)=>{const{pixelX:U,pixelY:O}=L;Math.abs(U)>=Math.abs(O)&&(p.refs.bodyWrapper.scrollLeft+=L.pixelX/5)},k=t.computed(()=>s.height||s.maxHeight||i.states.fixedColumns.value.length>0||i.states.rightFixedColumns.value.length>0),P=t.computed(()=>({width:C.bodyWidth.value?`${C.bodyWidth.value}px`:""})),D=()=>{k.value&&C.updateElsHeight(),C.updateColumnsWidth(),!(typeof window>"u")&&requestAnimationFrame(H)};t.onMounted(async()=>{await t.nextTick(),i.updateColumns(),$(),requestAnimationFrame(D);const I=p.vnode.el,L=p.refs.headerWrapper;s.flexible&&I&&I.parentElement&&(I.parentElement.style.minWidth="0"),u.value={width:m.value=I.offsetWidth,height:I.offsetHeight,headerHeight:s.showHeader&&L?L.offsetHeight:null},i.states.columns.value.forEach(U=>{U.filteredValue&&U.filteredValue.length&&p.store.commit("filterChange",{column:U,values:U.filteredValue,silent:!0})}),p.$ready=!0});const R=(I,L)=>{if(!I)return;const U=Array.from(I.classList).filter(O=>!O.startsWith("is-scrolling-"));U.push(C.scrollX.value?L:"is-scrolling-none"),I.className=U.join(" ")},z=I=>{const{tableWrapper:L}=p.refs;R(L,I)},F=I=>{const{tableWrapper:L}=p.refs;return!!(L&&L.classList.contains(I))},H=function(){if(!p.refs.scrollBarRef)return;if(!C.scrollX.value){const Z="is-scrolling-none";F(Z)||z(Z);return}const I=p.refs.scrollBarRef.wrapRef;if(!I)return;const{scrollLeft:L,offsetWidth:U,scrollWidth:O}=I,{headerWrapper:Q,footerWrapper:W}=p.refs;Q&&(Q.scrollLeft=L),W&&(W.scrollLeft=L),L>=O-U-1?z("is-scrolling-right"):z(L===0?"is-scrolling-left":"is-scrolling-middle")},$=()=>{p.refs.scrollBarRef&&(p.refs.scrollBarRef.wrapRef&&vn(p.refs.scrollBarRef.wrapRef,"scroll",H,{passive:!0}),s.fit?ti(p.vnode.el,K):vn(window,"resize",K),ti(p.refs.tableInnerWrapper,()=>{var I,L;K(),(L=(I=p.refs)==null?void 0:I.scrollBarRef)==null||L.update()}))},K=()=>{var ne,ae,ce,q;const I=p.vnode.el;if(!p.$ready||!I)return;let L=!1;const{width:U,height:O,headerHeight:Q}=u.value,W=m.value=I.offsetWidth;U!==W&&(L=!0);const Z=I.offsetHeight;(s.height||k.value)&&O!==Z&&(L=!0);const J=s.tableLayout==="fixed"?p.refs.headerWrapper:(ne=p.refs.tableHeaderRef)==null?void 0:ne.$el;s.showHeader&&(J==null?void 0:J.offsetHeight)!==Q&&(L=!0),g.value=((ae=p.refs.tableWrapper)==null?void 0:ae.scrollHeight)||0,b.value=(J==null?void 0:J.scrollHeight)||0,w.value=((ce=p.refs.footerWrapper)==null?void 0:ce.offsetHeight)||0,_.value=((q=p.refs.appendWrapper)==null?void 0:q.offsetHeight)||0,v.value=g.value-b.value-w.value-_.value,L&&(u.value={width:W,height:Z,headerHeight:s.showHeader&&(J==null?void 0:J.offsetHeight)||0},D())},G=ji(),j=t.computed(()=>{const{bodyWidth:I,scrollY:L,gutterWidth:U}=C;return I.value?`${I.value-(L.value?U:0)}px`:""}),N=t.computed(()=>s.maxHeight?"fixed":s.tableLayout);return{isHidden:y,renderExpanded:A,setDragVisible:d,isGroup:c,handleMouseLeave:x,handleHeaderFooterMousewheel:E,tableSize:G,emptyBlockStyle:t.computed(()=>{if(s.data&&s.data.length)return;let I="100%";s.height&&v.value&&(I=`${v.value}px`);const L=m.value;return{width:L?`${L}px`:"",height:I}}),resizeProxyVisible:h,bodyWidth:j,resizeState:u,doLayout:D,tableBodyStyles:P,tableLayout:N,scrollbarViewStyle:f,scrollbarStyle:t.computed(()=>s.height?{height:"100%"}:s.maxHeight?Number.isNaN(Number(s.maxHeight))?{maxHeight:`calc(${s.maxHeight} - ${b.value+w.value}px)`}:{maxHeight:`${+s.maxHeight-b.value-w.value}px`}:{})}}function Tne(s){let C;const i=()=>{const p=s.vnode.el.querySelector(".hidden-columns"),y={childList:!0,subtree:!0},A=s.store.states.updateOrderFns;C=new MutationObserver(()=>{A.forEach(h=>h())}),C.observe(p,y)};t.onMounted(()=>{i()}),t.onUnmounted(()=>{C==null||C.disconnect()})}function CA(s){const C=s.tableLayout==="auto";let i=s.columns||[];C&&i.every(({width:y})=>en(y))&&(i=[]);const p=y=>{const A={key:`${s.tableLayout}_${y.id}`,style:{},name:void 0};return C?A.style={width:`${y.width}px`}:A.name=y.id,A};return t.h("colgroup",{},i.map(y=>t.h("col",p(y))))}CA.props=["columns","tableLayout"];const Ine=()=>{const s=t.ref(),C=(A,h)=>{const d=s.value;d&&d.scrollTo(A,h)},i=(A,h)=>{const d=s.value;d&&lr(h)&&["Top","Left"].includes(A)&&d[`setScroll${A}`](h)};return{scrollBarRef:s,scrollTo:C,setScrollTop:A=>i("Top",A),setScrollLeft:A=>i("Left",A)}},Dne=["data-prefix"],Rne={ref:"hiddenColumns",class:"hidden-columns"};var Fne=t.defineComponent({name:"ElTable",__name:"table",props:Ure,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-dblclick","cell-contextmenu","cell-click","row-dblclick","row-click","row-contextmenu","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(s,{expose:C}){const i=s,{t:p}=Yr(),y=zt("table"),A=yl("table"),h=t.getCurrentInstance();t.provide(_a,h);const d=one(h,i);h.store=d;const u=new lne({store:h.store,table:h,fit:i.fit,showHeader:i.showHeader});h.layout=u;const c=t.computed(()=>(d.states.data.value||[]).length===0),{setCurrentRow:f,getSelectionRows:m,getHalfSelectionRows:g,toggleRowSelection:v,clearSelection:b,clearFilter:w,toggleAllSelection:_,toggleRowExpansion:x,clearSort:E,sort:k,updateKeyChildren:P}=Pne(d),{isHidden:D,renderExpanded:R,setDragVisible:z,isGroup:F,handleMouseLeave:H,handleHeaderFooterMousewheel:$,tableSize:K,emptyBlockStyle:G,resizeProxyVisible:j,bodyWidth:N,resizeState:I,doLayout:L,tableBodyStyles:U,tableLayout:O,scrollbarViewStyle:Q,scrollbarStyle:W}=Mne(i,u,d,h),{scrollBarRef:Z,scrollTo:J,setScrollLeft:ne,setScrollTop:ae}=Ine(),ce=Ra(L,50),q=$re(y.namespace.value),fe=h;h.tableId=q,h.state={isGroup:F,resizeState:I,doLayout:L,debouncedUpdateLayout:ce};const re=t.computed(()=>i.sumText??p("el.table.sumText")),te=t.computed(()=>i.emptyText??p("el.table.emptyText")),le=t.computed(()=>{var ue;return i.tooltipEffect??((ue=A.value)==null?void 0:ue.tooltipEffect)}),de=t.computed(()=>{var ue;return i.tooltipOptions??((ue=A.value)==null?void 0:ue.tooltipOptions)}),he=t.computed(()=>YM(d.states.originColumns.value)[0]);return Tne(h),t.onBeforeUnmount(()=>{ce.cancel()}),C({ns:y,layout:u,store:d,columns:he,handleHeaderFooterMousewheel:$,handleMouseLeave:H,tableId:q,tableSize:K,isHidden:D,isEmpty:c,renderExpanded:R,resizeProxyVisible:j,resizeState:I,isGroup:F,bodyWidth:N,tableBodyStyles:U,emptyBlockStyle:G,debouncedUpdateLayout:ce,setCurrentRow:f,getSelectionRows:m,getHalfSelectionRows:g,toggleRowSelection:v,clearSelection:b,clearFilter:w,toggleAllSelection:_,toggleRowExpansion:x,clearSort:E,doLayout:L,sort:k,updateKeyChildren:P,t:p,setDragVisible:z,context:fe,computedSumText:re,computedEmptyText:te,computedTooltipEffect:le,computedTooltipOptions:de,tableLayout:O,scrollbarViewStyle:Q,scrollbarStyle:W,scrollBarRef:Z,scrollTo:J,setScrollLeft:ne,setScrollTop:ae,allowDragLastColumn:i.allowDragLastColumn}),(ue,pe)=>(t.openBlock(),t.createElementBlock("div",{ref:"tableWrapper",class:t.normalizeClass([{[t.unref(y).m("fit")]:s.fit,[t.unref(y).m("striped")]:s.stripe,[t.unref(y).m("border")]:s.border||t.unref(F),[t.unref(y).m("hidden")]:t.unref(D),[t.unref(y).m("group")]:t.unref(F),[t.unref(y).m("fluid-height")]:s.maxHeight,[t.unref(y).m("scrollable-x")]:t.unref(u).scrollX.value,[t.unref(y).m("scrollable-y")]:t.unref(u).scrollY.value,[t.unref(y).m("enable-row-hover")]:!t.unref(d).states.isComplex.value,[t.unref(y).m("enable-row-transition")]:(t.unref(d).states.data.value||[]).length!==0&&(t.unref(d).states.data.value||[]).length<100,"has-footer":s.showSummary},t.unref(y).m(t.unref(K)),s.className,t.unref(y).b(),t.unref(y).m(`layout-${t.unref(O)}`)]),style:t.normalizeStyle(s.style),"data-prefix":t.unref(y).namespace.value,onMouseleave:pe[1]||(pe[1]=(...se)=>t.unref(H)&&t.unref(H)(...se))},[t.createElementVNode("div",{ref:"tableInnerWrapper",class:t.normalizeClass(t.unref(y).e("inner-wrapper"))},[t.createElementVNode("div",Rne,[t.renderSlot(ue.$slots,"default")],512),s.showHeader&&t.unref(O)==="fixed"?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,ref:"headerWrapper",class:t.normalizeClass(t.unref(y).e("header-wrapper"))},[t.createElementVNode("table",{ref:"tableHeader",class:t.normalizeClass(t.unref(y).e("header")),style:t.normalizeStyle(t.unref(U)),border:"0",cellpadding:"0",cellspacing:"0"},[t.createVNode(t.unref(CA),{columns:t.unref(d).states.columns.value,"table-layout":t.unref(O)},null,8,["columns","table-layout"]),t.createVNode(t.unref(JM),{ref:"tableHeaderRef",border:s.border,"default-sort":s.defaultSort,store:t.unref(d),"append-filter-panel-to":s.appendFilterPanelTo,"allow-drag-last-column":s.allowDragLastColumn,onSetDragVisible:t.unref(z)},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[t.unref(bk),t.unref($)]]):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{ref:"bodyWrapper",class:t.normalizeClass(t.unref(y).e("body-wrapper"))},[t.createVNode(t.unref(gi),{ref_key:"scrollBarRef",ref:Z,"view-style":t.unref(Q),"wrap-style":t.unref(W),always:s.scrollbarAlwaysOn,tabindex:s.scrollbarTabindex,native:s.nativeScrollbar,onScroll:pe[0]||(pe[0]=se=>ue.$emit("scroll",se))},{default:t.withCtx(()=>[t.createElementVNode("table",{ref:"tableBody",class:t.normalizeClass(t.unref(y).e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:t.normalizeStyle({width:t.unref(N),tableLayout:t.unref(O)})},[t.createVNode(t.unref(CA),{columns:t.unref(d).states.columns.value,"table-layout":t.unref(O)},null,8,["columns","table-layout"]),s.showHeader&&t.unref(O)==="auto"?(t.openBlock(),t.createBlock(t.unref(JM),{key:0,ref:"tableHeaderRef",class:t.normalizeClass(t.unref(y).e("body-header")),border:s.border,"default-sort":s.defaultSort,store:t.unref(d),"append-filter-panel-to":s.appendFilterPanelTo,onSetDragVisible:t.unref(z)},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):t.createCommentVNode("v-if",!0),t.createVNode(t.unref(Bne),{context:t.unref(fe),highlight:s.highlightCurrentRow,"row-class-name":s.rowClassName,"tooltip-effect":le.value,"tooltip-options":de.value,"row-style":s.rowStyle,store:t.unref(d),stripe:s.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),s.showSummary&&t.unref(O)==="auto"?(t.openBlock(),t.createBlock(t.unref(ZM),{key:1,class:t.normalizeClass(t.unref(y).e("body-footer")),border:s.border,"default-sort":s.defaultSort,store:t.unref(d),"sum-text":re.value,"summary-method":s.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):t.createCommentVNode("v-if",!0)],6),c.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"emptyBlock",style:t.normalizeStyle(t.unref(G)),class:t.normalizeClass(t.unref(y).e("empty-block"))},[t.createElementVNode("span",{class:t.normalizeClass(t.unref(y).e("empty-text"))},[t.renderSlot(ue.$slots,"empty",{},()=>[t.createTextVNode(t.toDisplayString(te.value),1)])],2)],6)):t.createCommentVNode("v-if",!0),ue.$slots.append?(t.openBlock(),t.createElementBlock("div",{key:1,ref:"appendWrapper",class:t.normalizeClass(t.unref(y).e("append-wrapper"))},[t.renderSlot(ue.$slots,"append")],2)):t.createCommentVNode("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","native"])],2),s.showSummary&&t.unref(O)==="fixed"?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:1,ref:"footerWrapper",class:t.normalizeClass(t.unref(y).e("footer-wrapper"))},[t.createElementVNode("table",{class:t.normalizeClass(t.unref(y).e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:t.normalizeStyle(t.unref(U))},[t.createVNode(t.unref(CA),{columns:t.unref(d).states.columns.value,"table-layout":t.unref(O)},null,8,["columns","table-layout"]),t.createVNode(t.unref(ZM),{border:s.border,"default-sort":s.defaultSort,store:t.unref(d),"sum-text":re.value,"summary-method":s.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[t.vShow,!c.value],[t.unref(bk),t.unref($)]]):t.createCommentVNode("v-if",!0),s.border||t.unref(F)?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(t.unref(y).e("border-left-patch"))},null,2)):t.createCommentVNode("v-if",!0)],2),t.withDirectives(t.createElementVNode("div",{ref:"resizeProxy",class:t.normalizeClass(t.unref(y).e("column-resize-proxy"))},null,2),[[t.vShow,t.unref(j)]])],46,Dne))}}),Nne=Fne;const One={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:s=>s.every(C=>["ascending","descending",null].includes(C))}},Lne={selection:"table-column--selection",expand:"table__expand-column"},jne={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Vne=s=>Lne[s]||"",Une={selection:{renderHeader({store:s}){function C(){return s.states.data.value&&s.states.data.value.length===0}return t.h(sa,{disabled:C(),size:s.states.tableSize.value,indeterminate:s.states.selection.value.length>0&&!s.states.isAllSelected.value,"onUpdate:modelValue":s.toggleAllSelection??void 0,modelValue:s.states.isAllSelected.value,ariaLabel:s.t("el.table.selectAllLabel")})},renderCell({row:s,column:C,store:i,$index:p}){return t.h(sa,{disabled:C.selectable?!C.selectable.call(null,s,p):!1,size:i.states.tableSize.value,onChange:()=>{i.commit("rowSelectedChanged",s)},onClick:y=>y.stopPropagation(),modelValue:i.isSelected(s),indeterminate:i.getRowIndeterminate(s),ariaLabel:i.t("el.table.selectRowLabel")})},sortable:!1,resizable:!1},index:{renderHeader({column:s}){return s.label||"#"},renderCell({column:s,$index:C}){let i=C+1;const p=s.index;return lr(p)?i=C+p:Nr(p)&&(i=p(C)),t.h("div",{},[i])},sortable:!1},expand:{renderHeader({column:s}){return s.label||""},renderCell({column:s,row:C,store:i,expanded:p,$index:y}){var c,f;const{ns:A}=i,h=[A.e("expand-icon")];!s.renderExpand&&p&&h.push(A.em("expand-icon","expanded"));const d=function(m){m.stopPropagation(),i.toggleRowExpansion(C)},u=((f=(c=i.states.rowExpandable).value)==null?void 0:f.call(c,C,y))??!0;return u||h.push(A.is("disabled")),t.h("button",{type:"button",disabled:!u,"aria-label":i.t(p?"el.table.collapseRowLabel":"el.table.expandRowLabel"),"aria-expanded":p,class:h,onClick:d},{default:()=>s.renderExpand?[s.renderExpand({expanded:p,expandable:u})]:[t.h(ir,null,{default:()=>[t.h(Zt.ArrowRight)]})]})},sortable:!1,resizable:!1}};function zne({row:s,column:C,$index:i}){var A;const p=C.property,y=p&&Xl(s,p).value;return C&&C.formatter?C.formatter(s,C,y,i):((A=y==null?void 0:y.toString)==null?void 0:A.call(y))||""}function Hne({row:s,treeNode:C,store:i},p=!1){const{ns:y}=i;if(!C)return p?[t.h("span",{class:y.e("placeholder")})]:null;const A=[],h=function(d){d.stopPropagation(),!C.loading&&i.loadOrToggle(s)};if(C.indent&&A.push(t.h("span",{class:y.e("indent"),style:{"padding-left":`${C.indent}px`}})),Bn(C.expanded)&&!C.noLazyChildren){const d=[y.e("expand-icon"),C.expanded?y.em("expand-icon","expanded"):""];let u=Zt.ArrowRight;C.loading&&(u=Zt.Loading),A.push(t.h("button",{type:"button","aria-label":i.t(C.expanded?"el.table.collapseRowLabel":"el.table.expandRowLabel"),"aria-expanded":C.expanded,class:d,onClick:h},{default:()=>[t.h(ir,{class:y.is("loading",C.loading)},{default:()=>[t.h(u)]})]}))}else A.push(t.h("span",{class:y.e("placeholder")}));return A}function qM(s,C){return s.reduce((i,p)=>(i[p]=p,i),C)}function $ne(s,C){const i=t.getCurrentInstance();return{registerComplexWatchers:()=>{const A=["fixed"],h={realWidth:"width",realMinWidth:"minWidth"},d=qM(A,h);Object.keys(d).forEach(u=>{const c=h[u];Xi(C,c)&&t.watch(()=>C[c],f=>{let m=f;c==="width"&&u==="realWidth"&&(m=$b(f)),c==="minWidth"&&u==="realMinWidth"&&(m=UM(f)),i.columnConfig.value[c]=m,i.columnConfig.value[u]=m;const g=c==="fixed";s.value.store.scheduleLayout(g)})})},registerNormalWatchers:()=>{const A=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip","tooltipFormatter","resizable"],h=["showOverflowTooltip"],d={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},u=qM(A,d);Object.keys(u).forEach(f=>{const m=d[f];Xi(C,m)&&t.watch(()=>C[m],g=>{i.columnConfig.value[f]=g,(f==="filters"||f==="filterMethod")&&(i.columnConfig.value.filterable=!!(i.columnConfig.value.filters||i.columnConfig.value.filterMethod))})}),h.forEach(f=>{Xi(s.value.props,f)&&t.watch(()=>s.value.props[f],m=>{i.columnConfig.value.type!=="selection"&&en(C[f])&&(i.columnConfig.value[f]=m)})});const c=yl("table");c.value&&Xi(c.value,"showOverflowTooltip")&&t.watch(()=>{var f;return(f=c.value)==null?void 0:f.showOverflowTooltip},f=>{i.columnConfig.value.type!=="selection"&&(!en(C.showOverflowTooltip)||!en(s.value.props.showOverflowTooltip)||(i.columnConfig.value.showOverflowTooltip=f))})}}}function Gne(s,C,i){const p=t.getCurrentInstance(),y=t.ref(""),A=t.ref(!1),h=t.ref(),d=t.ref(),u=zt("table");t.watchEffect(()=>{h.value=s.align?`is-${s.align}`:null,h.value}),t.watchEffect(()=>{d.value=s.headerAlign?`is-${s.headerAlign}`:h.value,d.value});const c=t.computed(()=>{let P=p.vnode.vParent||p.parent;for(;P&&!P.tableId&&!P.columnId;)P=P.vnode.vParent||P.parent;return P}),f=t.computed(()=>{const{store:P}=p.parent;if(!P)return!1;const{treeData:D}=P.states,R=D.value;return R&&Object.keys(R).length>0}),m=t.ref($b(s.width)),g=t.ref(UM(s.minWidth)),v=P=>(m.value&&(P.width=m.value),g.value&&(P.minWidth=g.value),!m.value&&g.value&&(P.width=void 0),P.minWidth||(P.minWidth=80),P.realWidth=Number(en(P.width)?P.minWidth:P.width),P),b=P=>{const D=P.type,R=Une[D]||{};Object.keys(R).forEach(F=>{const H=R[F];F!=="className"&&!en(H)&&(P[F]=H)});const z=Vne(D);if(z){const F=`${t.unref(u.namespace)}-${z}`;P.className=P.className?`${P.className} ${F}`:F}return P},w=P=>{nr(P)?P.forEach(R=>D(R)):D(P);function D(R){var z;((z=R==null?void 0:R.type)==null?void 0:z.name)==="ElTableColumn"&&(R.vParent=p)}};return{columnId:y,realAlign:h,isSubColumn:A,realHeaderAlign:d,columnOrTableParent:c,setColumnWidth:v,setColumnForcedProps:b,setColumnRenders:P=>{s.renderHeader?wn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):P.type!=="selection"&&(P.renderHeader=R=>{if(p.columnConfig.value.label,C.header){const z=C.header(R);if(QM(z))return t.h(t.Fragment,z)}return t.createTextVNode(P.label)}),C["filter-icon"]&&(P.renderFilterIcon=R=>t.renderSlot(C,"filter-icon",R)),C.expand&&(P.renderExpand=R=>t.renderSlot(C,"expand",R));let D=P.renderCell;return P.type==="expand"?(P.renderCell=R=>t.h("div",{class:"cell"},[D(R)]),i.value.renderExpanded=R=>C.default?C.default(R):C.default):(D=D||zne,P.renderCell=R=>{let z=null;if(C.default){const j=C.default(R);z=j.some(N=>N.type!==t.Comment)?j:D(R)}else z=D(R);const{columns:F}=i.value.store.states,H=F.value.findIndex(j=>j.type==="default"),$=f.value&&R.cellIndex===H,K=Hne(R,$),G={class:"cell",style:{}};return P.showOverflowTooltip&&(G.class=`${G.class} ${t.unref(u.namespace)}-tooltip`,G.style={width:`${(R.column.realWidth||Number(R.column.width))-1}px`}),w(z),t.h("div",G,[K,z])}),P},getPropsData:(...P)=>P.reduce((D,R)=>(nr(R)&&R.forEach(z=>{D[z]=s[z]}),D),{}),getColumnElIndex:(P,D)=>Array.prototype.indexOf.call(P,D),updateColumnOrder:()=>{i.value.store.commit("updateColumnOrder",p.columnConfig.value)}}}var Qne=t.defineComponent({name:"ElTableColumn",__name:"index",props:One,setup(s){const C=s,i=t.useSlots(),p=t.getCurrentInstance(),y=yl("table"),A=t.ref({}),h=t.computed(()=>{let z=p.parent;for(;z&&!z.tableId;)z=z.parent;return z}),{registerNormalWatchers:d,registerComplexWatchers:u}=$ne(h,C),{columnId:c,isSubColumn:f,realHeaderAlign:m,columnOrTableParent:g,setColumnWidth:v,setColumnForcedProps:b,setColumnRenders:w,getPropsData:_,getColumnElIndex:x,realAlign:E,updateColumnOrder:k}=Gne(C,i,h),P=g.value,D="tableId"in P?P.tableId:P.columnId;c.value=Gre(D),t.onBeforeMount(()=>{var j,N;f.value=h.value!==P;const z=C.type||"default",F=C.sortable===""?!0:C.sortable,H=z==="selection"?!1:en(C.showOverflowTooltip)?P.props.showOverflowTooltip??((j=y.value)==null?void 0:j.showOverflowTooltip):C.showOverflowTooltip,$=en(C.tooltipFormatter)?P.props.tooltipFormatter??((N=y.value)==null?void 0:N.tooltipFormatter):C.tooltipFormatter,K={...jne[z],id:c.value,type:z,property:C.prop||C.property,align:E,headerAlign:m,showOverflowTooltip:H,tooltipFormatter:$,filterable:C.filters||C.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:F,index:C.index,rawColumnKey:p.vnode.key};let G=_(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);G=Kre(K,G),G=Yre(w,v,b)(G),A.value=G,d(),u()}),t.onMounted(()=>{var $,K;const z=g.value,F=f.value?($=z.vnode.el)==null?void 0:$.children:(K=z.refs.hiddenColumns)==null?void 0:K.children,H=()=>x(F||[],p.vnode.el);A.value.getColumnIndex=H,H()>-1&&h.value.store.commit("insertColumn",A.value,f.value?"columnConfig"in z&&z.columnConfig.value:null,k)}),t.onBeforeUnmount(()=>{const z=A.value.getColumnIndex;(z?z():-1)>-1&&h.value.store.commit("removeColumn",A.value,f.value?"columnConfig"in P&&P.columnConfig.value:null,k)}),p.columnId=c.value,p.columnConfig=A;const R=()=>{var z,F;try{const H=(z=i.default)==null?void 0:z.call(i,{row:{},column:{},$index:-1}),$=[];if(nr(H))for(const K of H)((F=K.type)==null?void 0:F.name)==="ElTableColumn"||K.shapeFlag&2?$.push(K):K.type===t.Fragment&&nr(K.children)&&K.children.forEach(G=>{(G==null?void 0:G.patchFlag)!==1024&&!Ar(G==null?void 0:G.children)&&$.push(G)});return t.h("div",$)}catch{return t.h("div",[])}};return(z,F)=>(t.openBlock(),t.createBlock(R))}}),Wne=Qne,Kne=Wne,eT=Kne;Tr(Nne,{TableColumn:eT}),ai(eT);const Jb={asc:"desc",desc:"asc"},Sh=Symbol("placeholder"),tT=String,kh={type:et(Array),required:!0},Zb={type:et(Array)},rT={...Zb,required:!0},Xne=String,nT={type:et(Array),default:()=>mi([])},au={type:Number,required:!0},iT={type:et([String,Number,Symbol]),default:"id"},sT={type:et(Object)},lu=Wt({class:String,columns:kh,columnsStyles:{type:et(Object),required:!0},depth:Number,expandColumnKey:Xne,estimatedRowHeight:{...nu.estimatedRowHeight,default:void 0},isScrolling:Boolean,onRowExpand:{type:et(Function)},onRowHover:{type:et(Function)},onRowHeightChange:{type:et(Function)},rowData:{type:et(Object),required:!0},rowEventHandlers:{type:et(Object)},rowIndex:{type:Number,required:!0},rowKey:iT,style:{type:et(Object)}}),qb={type:Number,required:!0},e_=Wt({class:String,columns:kh,fixedHeaderData:{type:et(Array)},headerData:{type:et(Array),required:!0},headerHeight:{type:et([Number,Array]),default:50},rowWidth:qb,rowHeight:{type:Number,default:50},height:qb,width:qb}),xA=Wt({columns:kh,data:rT,fixedData:Zb,estimatedRowHeight:lu.estimatedRowHeight,width:au,height:au,headerWidth:au,headerHeight:e_.headerHeight,bodyWidth:au,rowHeight:au,cache:zk.cache,useIsScrolling:Boolean,scrollbarAlwaysOn:nu.scrollbarAlwaysOn,scrollbarStartGap:nu.scrollbarStartGap,scrollbarEndGap:nu.scrollbarEndGap,class:tT,style:sT,containerStyle:sT,getRowHeight:{type:et(Function),required:!0},rowKey:lu.rowKey,onRowsRendered:{type:et(Function)},onScroll:{type:et(Function)}}),Yne=Wt({cache:xA.cache,estimatedRowHeight:lu.estimatedRowHeight,rowKey:iT,headerClass:{type:et([String,Function])},headerProps:{type:et([Object,Function])},headerCellProps:{type:et([Object,Function])},headerHeight:e_.headerHeight,footerHeight:{type:Number,default:0},rowClass:{type:et([String,Function])},rowProps:{type:et([Object,Function])},rowHeight:{type:Number,default:50},cellProps:{type:et([Object,Function])},columns:kh,data:rT,dataGetter:{type:et(Function)},fixedData:Zb,expandColumnKey:lu.expandColumnKey,expandedRowKeys:nT,defaultExpandedRowKeys:nT,class:tT,fixed:Boolean,style:{type:et(Object)},width:au,height:au,maxHeight:Number,useIsScrolling:Boolean,indentSize:{type:Number,default:12},iconSize:{type:Number,default:12},hScrollbarSize:nu.hScrollbarSize,vScrollbarSize:nu.vScrollbarSize,scrollbarAlwaysOn:Gk.alwaysOn,sortBy:{type:et(Object),default:()=>({})},sortState:{type:et(Object),default:void 0},onColumnSort:{type:et(Function)},onExpandedRowsChange:{type:et(Function)},onEndReached:{type:et(Function)},onRowExpand:lu.onRowExpand,onScroll:xA.onScroll,onRowsRendered:xA.onRowsRendered,rowEventHandlers:lu.rowEventHandlers}),Jne=(s,C,i)=>{const p={flexGrow:0,flexShrink:0,...i?{}:{flexGrow:s.flexGrow??0,flexShrink:s.flexShrink??1}},y={...s.style??{},...p,flexBasis:"auto",width:s.width};return C||(s.maxWidth&&(y.maxWidth=s.maxWidth),s.minWidth&&(y.minWidth=s.minWidth)),y};function Zne(s,C,i){const p=t.computed(()=>t.unref(C).map((_,x)=>({..._,key:_.key??_.dataKey??x}))),y=t.computed(()=>t.unref(p).filter(_=>!_.hidden)),A=t.computed(()=>t.unref(y).filter(_=>_.fixed==="left"||_.fixed===!0)),h=t.computed(()=>t.unref(y).filter(_=>_.fixed==="right")),d=t.computed(()=>t.unref(y).filter(_=>!_.fixed)),u=t.computed(()=>{const _=[];return t.unref(A).forEach(x=>{_.push({...x,placeholderSign:Sh})}),t.unref(d).forEach(x=>{_.push(x)}),t.unref(h).forEach(x=>{_.push({...x,placeholderSign:Sh})}),_}),c=t.computed(()=>t.unref(A).length||t.unref(h).length),f=t.computed(()=>t.unref(p).reduce((_,x)=>(_[x.key]=Jne(x,t.unref(i),s.fixed),_),{})),m=t.computed(()=>t.unref(y).reduce((_,x)=>_+x.width,0)),g=_=>t.unref(p).find(x=>x.key===_),v=_=>t.unref(f)[_],b=(_,x)=>{_.width=x};function w(_){var D;const{key:x}=_.currentTarget.dataset;if(!x)return;const{sortState:E,sortBy:k}=s;let P="asc";mn(E)?P=Jb[E[x]]:P=Jb[k.order],(D=s.onColumnSort)==null||D.call(s,{column:g(x),key:x,order:P})}return{columns:p,columnsStyles:f,columnsTotalWidth:m,fixedColumnsOnLeft:A,fixedColumnsOnRight:h,hasFixedColumns:c,mainColumns:u,normalColumns:d,visibleColumns:y,getColumn:g,getColumnStyle:v,updateColumnWidth:b,onColumnSorted:w}}const qne=(s,{mainTableRef:C,leftTableRef:i,rightTableRef:p,onMaybeEndReached:y})=>{const A=t.ref({scrollLeft:0,scrollTop:0});function h(v){var w,_,x;const{scrollTop:b}=v;(w=C.value)==null||w.scrollTo(v),(_=i.value)==null||_.scrollToTop(b),(x=p.value)==null||x.scrollToTop(b)}function d(v){A.value=v,h(v)}function u(v){A.value.scrollTop=v,h(t.unref(A))}function c(v){var b,w;A.value.scrollLeft=v,(w=(b=C.value)==null?void 0:b.scrollTo)==null||w.call(b,t.unref(A))}function f(v){var b;d(v),(b=s.onScroll)==null||b.call(s,v)}function m({scrollTop:v}){const{scrollTop:b}=t.unref(A);v!==b&&u(v)}function g(v,b="auto"){var w;(w=C.value)==null||w.scrollToRow(v,b)}return t.watch(()=>t.unref(A).scrollTop,(v,b)=>{v>b&&y()}),{scrollPos:A,scrollTo:d,scrollToLeft:c,scrollToTop:u,scrollToRow:g,onScroll:f,onVerticalScroll:m}},eie=(s,{mainTableRef:C,leftTableRef:i,rightTableRef:p,tableInstance:y,ns:A,isScrolling:h})=>{const d=t.getCurrentInstance(),{emit:u}=d,c=t.shallowRef(!1),f=t.ref(s.defaultExpandedRowKeys||[]),m=t.ref(-1),g=t.shallowRef(null),v=t.ref({}),b=t.ref({}),w=t.shallowRef({}),_=t.shallowRef({}),x=t.shallowRef({}),E=t.computed(()=>lr(s.estimatedRowHeight));function k($){var K;(K=s.onRowsRendered)==null||K.call(s,$),$.rowCacheEnd>t.unref(m)&&(m.value=$.rowCacheEnd)}function P({hovered:$,rowKey:K}){h.value||y.vnode.el.querySelectorAll(`[rowkey="${String(K)}"]`).forEach(G=>{$?G.classList.add(A.is("hovered")):G.classList.remove(A.is("hovered"))})}function D({expanded:$,rowData:K,rowIndex:G,rowKey:j}){var L,U;const N=[...t.unref(f)],I=N.indexOf(j);$?I===-1&&N.push(j):I>-1&&N.splice(I,1),f.value=N,u("update:expandedRowKeys",N),(L=s.onRowExpand)==null||L.call(s,{expanded:$,rowData:K,rowIndex:G,rowKey:j}),(U=s.onExpandedRowsChange)==null||U.call(s,N),y.vnode.el.querySelector(`.${A.is("hovered")}[rowkey="${String(j)}"]`)&&t.nextTick(()=>P({hovered:!0,rowKey:j}))}const R=Ra(()=>{var $,K,G,j;c.value=!0,v.value={...t.unref(v),...t.unref(b)},z(t.unref(g),!1),b.value={},g.value=null,($=C.value)==null||$.forceUpdate(),(K=i.value)==null||K.forceUpdate(),(G=p.value)==null||G.forceUpdate(),(j=d.proxy)==null||j.$forceUpdate(),c.value=!1},0);function z($,K=!1){t.unref(E)&&[C,i,p].forEach(G=>{const j=t.unref(G);j&&j.resetAfterRowIndex($,K)})}function F($,K,G){const j=t.unref(g);(j===null||j>G)&&(g.value=G),b.value[$]=K}function H({rowKey:$,height:K,rowIndex:G},j){j?j==="right"?x.value[$]=K:w.value[$]=K:_.value[$]=K;const N=Math.max(...[w,x,_].map(I=>I.value[$]||0));t.unref(v)[$]!==N&&(F($,N,G),R())}return{expandedRowKeys:f,lastRenderedRowIndex:m,isDynamic:E,isResetting:c,rowHeights:v,resetAfterIndex:z,onRowExpanded:D,onRowHovered:P,onRowsRendered:k,onRowHeightChange:H}},tie=(s,{expandedRowKeys:C,lastRenderedRowIndex:i,resetAfterIndex:p})=>{const y=t.ref({}),A=t.computed(()=>{const d={},{data:u,rowKey:c}=s,f=t.unref(C);if(!f||!f.length)return u;const m=[],g=new Set;f.forEach(b=>g.add(b));let v=u.slice();for(v.forEach(b=>d[b[c]]=0);v.length>0;){const b=v.shift();m.push(b),g.has(b[c])&&nr(b.children)&&b.children.length>0&&(v=[...b.children,...v],b.children.forEach(w=>d[w[c]]=d[b[c]]+1))}return y.value=d,m}),h=t.computed(()=>{const{data:d,expandColumnKey:u}=s;return u?t.unref(A):d});return t.watch(h,(d,u)=>{d!==u&&(i.value=-1,p(0,!0))}),{data:h,depthMap:y}},rie=(s,C)=>s+C,EA=s=>nr(s)?s.reduce(rie,0):s,cu=(s,C,i={})=>Nr(s)?s(C):s??i,lc=s=>(["width","maxWidth","minWidth","height"].forEach(C=>{s[C]=pi(s[C])}),s),oT=s=>t.isVNode(s)?C=>t.h(s,C):s,nie=(s,{columnsTotalWidth:C,rowsHeight:i,fixedColumnsOnLeft:p,fixedColumnsOnRight:y})=>{const A=t.computed(()=>{const{fixed:w,width:_,vScrollbarSize:x}=s,E=_-x;return w?Math.max(Math.round(t.unref(C)),E):E}),h=t.computed(()=>{const{height:w=0,maxHeight:_=0,footerHeight:x,hScrollbarSize:E}=s;if(_>0){const k=t.unref(g),P=t.unref(i),D=t.unref(m)+k+P+E;return Math.min(D,_-x)}return w-x}),d=t.computed(()=>{const{maxHeight:w}=s,_=t.unref(h);if(lr(w)&&w>0)return _;const x=t.unref(i)+t.unref(m)+t.unref(g);return Math.min(_,x)}),u=w=>w.width,c=t.computed(()=>EA(t.unref(p).map(u))),f=t.computed(()=>EA(t.unref(y).map(u))),m=t.computed(()=>EA(s.headerHeight)),g=t.computed(()=>{var w;return(((w=s.fixedData)==null?void 0:w.length)||0)*s.rowHeight}),v=t.computed(()=>t.unref(h)-t.unref(m)-t.unref(g)),b=t.computed(()=>{const{style:w={},height:_,width:x}=s;return lc({...w,height:_,width:x})});return{bodyWidth:A,fixedTableHeight:d,mainTableHeight:h,leftTableWidth:c,rightTableWidth:f,windowHeight:v,footerHeight:t.computed(()=>lc({height:s.footerHeight})),emptyStyle:t.computed(()=>({top:pi(t.unref(m)),bottom:pi(s.footerHeight),width:pi(s.width)})),rootStyle:b,headerHeight:m}};function iie(s){const C=t.ref(),i=t.ref(),p=t.ref(),{columns:y,columnsStyles:A,columnsTotalWidth:h,fixedColumnsOnLeft:d,fixedColumnsOnRight:u,hasFixedColumns:c,mainColumns:f,onColumnSorted:m}=Zne(s,t.toRef(s,"columns"),t.toRef(s,"fixed")),{scrollTo:g,scrollToLeft:v,scrollToTop:b,scrollToRow:w,onScroll:_,onVerticalScroll:x,scrollPos:E}=qne(s,{mainTableRef:C,leftTableRef:i,rightTableRef:p,onMaybeEndReached:ue}),k=zt("table-v2"),P=t.getCurrentInstance(),D=t.shallowRef(!1),{expandedRowKeys:R,lastRenderedRowIndex:z,isDynamic:F,isResetting:H,rowHeights:$,resetAfterIndex:K,onRowExpanded:G,onRowHeightChange:j,onRowHovered:N,onRowsRendered:I}=eie(s,{mainTableRef:C,leftTableRef:i,rightTableRef:p,tableInstance:P,ns:k,isScrolling:D}),{data:L,depthMap:U}=tie(s,{expandedRowKeys:R,lastRenderedRowIndex:z,resetAfterIndex:K}),O=t.computed(()=>{const{estimatedRowHeight:pe,rowHeight:se}=s,V=t.unref(L);return lr(pe)?Object.values(t.unref($)).reduce((Ce,ve)=>Ce+ve,0):V.length*se}),{bodyWidth:Q,fixedTableHeight:W,mainTableHeight:Z,leftTableWidth:J,rightTableWidth:ne,windowHeight:ae,footerHeight:ce,emptyStyle:q,rootStyle:fe,headerHeight:re}=nie(s,{columnsTotalWidth:h,fixedColumnsOnLeft:d,fixedColumnsOnRight:u,rowsHeight:O}),te=t.ref(),le=t.computed(()=>{const pe=t.unref(L).length===0;return nr(s.fixedData)?s.fixedData.length===0&&pe:pe});function de(pe){const{estimatedRowHeight:se,rowHeight:V,rowKey:Ce}=s;return se?t.unref($)[t.unref(L)[pe][Ce]]||se:V}const he=t.ref(!1);function ue(){const{onEndReached:pe}=s;if(!pe)return;const{scrollTop:se}=t.unref(E),V=t.unref(O),Ce=V-(se+t.unref(ae))+s.hScrollbarSize;!he.value&&t.unref(z)>=0&&V<=se+t.unref(Z)-t.unref(re)?(he.value=!0,pe(Ce)):he.value=!1}return t.watch(()=>t.unref(O),()=>he.value=!1),t.watch(()=>s.expandedRowKeys,pe=>R.value=pe,{deep:!0}),{columns:y,containerRef:te,mainTableRef:C,leftTableRef:i,rightTableRef:p,isDynamic:F,isResetting:H,isScrolling:D,hasFixedColumns:c,columnsStyles:A,columnsTotalWidth:h,data:L,expandedRowKeys:R,depthMap:U,fixedColumnsOnLeft:d,fixedColumnsOnRight:u,mainColumns:f,bodyWidth:Q,emptyStyle:q,rootStyle:fe,footerHeight:ce,mainTableHeight:Z,fixedTableHeight:W,leftTableWidth:J,rightTableWidth:ne,showEmpty:le,getRowHeight:de,onColumnSorted:m,onRowHovered:N,onRowExpanded:G,onRowsRendered:I,onRowHeightChange:j,scrollTo:g,scrollToLeft:v,scrollToTop:b,scrollToRow:w,onScroll:_,onVerticalScroll:x}}const t_=Symbol("tableV2"),aT="tableV2GridScrollLeft",sie=t.defineComponent({name:"ElTableV2Header",props:e_,setup(s,{slots:C,expose:i}){const p=zt("table-v2"),y=t.inject(aT),A=t.ref(),h=t.computed(()=>lc({width:s.width,height:s.height})),d=t.computed(()=>lc({width:s.rowWidth,height:s.height})),u=t.computed(()=>os(t.unref(s.headerHeight))),c=g=>{const v=t.unref(A);t.nextTick(()=>{v!=null&&v.scroll&&v.scroll({left:g})})},f=()=>{const g=p.e("fixed-header-row"),{columns:v,fixedHeaderData:b,rowHeight:w}=s;return b==null?void 0:b.map((_,x)=>{var k;const E=lc({height:w,width:"100%"});return(k=C.fixed)==null?void 0:k.call(C,{class:g,columns:v,rowData:_,rowIndex:-(x+1),style:E})})},m=()=>{const g=p.e("dynamic-header-row"),{columns:v}=s;return t.unref(u).map((b,w)=>{var x;const _=lc({width:"100%",height:b});return(x=C.dynamic)==null?void 0:x.call(C,{class:g,columns:v,headerIndex:w,style:_})})};return t.onUpdated(()=>{y!=null&&y.value&&c(y.value)}),i({scrollToLeft:c}),()=>{if(!(s.height<=0))return t.createVNode("div",{ref:A,class:s.class,style:t.unref(h),role:"rowgroup"},[t.createVNode("div",{style:t.unref(d),class:p.e("header")},[m(),f()])])}}}),oie="ElTableV2Grid",aie=s=>{const C=t.ref(),i=t.ref(),p=t.ref(0),y=t.computed(()=>{const{data:_,rowHeight:x,estimatedRowHeight:E}=s;if(!E)return _.length*x}),A=t.computed(()=>{const{fixedData:_,rowHeight:x}=s;return((_==null?void 0:_.length)||0)*x}),h=t.computed(()=>EA(s.headerHeight)),d=t.computed(()=>{const{height:_}=s;return Math.max(0,_-t.unref(h)-t.unref(A))}),u=t.computed(()=>t.unref(h)+t.unref(A)>0),c=({data:_,rowIndex:x})=>_[x][s.rowKey];function f({rowCacheStart:_,rowCacheEnd:x,rowVisibleStart:E,rowVisibleEnd:k}){var P;(P=s.onRowsRendered)==null||P.call(s,{rowCacheStart:_,rowCacheEnd:x,rowVisibleStart:E,rowVisibleEnd:k})}function m(_,x){var E;(E=i.value)==null||E.resetAfterRowIndex(_,x)}function g(_,x){const E=t.unref(C),k=t.unref(i);mn(_)?(E==null||E.scrollToLeft(_.scrollLeft),p.value=_.scrollLeft,k==null||k.scrollTo(_)):(E==null||E.scrollToLeft(_),p.value=_,k==null||k.scrollTo({scrollLeft:_,scrollTop:x}))}function v(_){var x;(x=t.unref(i))==null||x.scrollTo({scrollTop:_})}function b(_,x){const E=t.unref(i);if(!E)return;const k=p.value;E.scrollToItem(_,0,x),k&&g({scrollLeft:k})}function w(){var _,x;(_=t.unref(i))==null||_.$forceUpdate(),(x=t.unref(C))==null||x.$forceUpdate()}return t.watch(()=>s.bodyWidth,()=>{var _;lr(s.estimatedRowHeight)&&((_=i.value)==null||_.resetAfter({columnIndex:0},!1))}),{bodyRef:i,forceUpdate:w,fixedRowHeight:A,gridHeight:d,hasHeader:u,headerHeight:h,headerRef:C,totalHeight:y,itemKey:c,onItemRendered:f,resetAfterRowIndex:m,scrollTo:g,scrollToTop:v,scrollToRow:b,scrollLeft:p}},r_=t.defineComponent({name:oie,props:xA,setup(s,{slots:C,expose:i}){const{ns:p}=t.inject(t_),{bodyRef:y,fixedRowHeight:A,gridHeight:h,hasHeader:d,headerRef:u,headerHeight:c,totalHeight:f,forceUpdate:m,itemKey:g,onItemRendered:v,resetAfterRowIndex:b,scrollTo:w,scrollToTop:_,scrollToRow:x,scrollLeft:E}=aie(s);t.provide(aT,E),t.onActivated(async()=>{var D;await t.nextTick();const P=(D=y.value)==null?void 0:D.states.scrollTop;P&&_(Math.round(P)+1)}),i({forceUpdate:m,totalHeight:f,scrollTo:w,scrollToTop:_,scrollToRow:x,resetAfterRowIndex:b});const k=()=>s.bodyWidth;return()=>{const{cache:P,columns:D,data:R,fixedData:z,useIsScrolling:F,scrollbarAlwaysOn:H,scrollbarEndGap:$,scrollbarStartGap:K,style:G,rowHeight:j,bodyWidth:N,estimatedRowHeight:I,headerWidth:L,height:U,width:O,getRowHeight:Q,onScroll:W}=s,Z=lr(I),J=Z?PW:EW,ne=t.unref(c);return t.createVNode("div",{role:"table",class:[p.e("table"),s.class],style:G},[t.createVNode(J,{ref:y,data:R,useIsScrolling:F,itemKey:g,columnCache:0,columnWidth:Z?k:N,totalColumn:1,totalRow:R.length,rowCache:P,rowHeight:Z?Q:j,width:O,height:t.unref(h),class:p.e("body"),role:"rowgroup",scrollbarStartGap:K,scrollbarEndGap:$,scrollbarAlwaysOn:H,onScroll:W,onItemRendered:v,perfMode:!1},{default:ae=>{var q;const ce=R[ae.rowIndex];return(q=C.row)==null?void 0:q.call(C,{...ae,columns:D,rowData:ce})}}),t.unref(d)&&t.createVNode(sie,{ref:u,class:p.e("header-wrapper"),columns:D,headerData:R,headerHeight:s.headerHeight,fixedHeaderData:z,rowWidth:L,rowHeight:j,width:O,height:Math.min(ne+t.unref(A),U)},{dynamic:C.header,fixed:C.row})])}}});function lie(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!t.isVNode(s)}const cie=(s,{slots:C})=>{const{mainTableRef:i,...p}=s;return t.createVNode(r_,t.mergeProps({ref:i},p),lie(C)?C:{default:()=>[C]})};function uie(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!t.isVNode(s)}const die=(s,{slots:C})=>{if(!s.columns.length)return;const{leftTableRef:i,...p}=s;return t.createVNode(r_,t.mergeProps({ref:i},p),uie(C)?C:{default:()=>[C]})};function fie(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!t.isVNode(s)}const hie=(s,{slots:C})=>{if(!s.columns.length)return;const{rightTableRef:i,...p}=s;return t.createVNode(r_,t.mergeProps({ref:i},p),fie(C)?C:{default:()=>[C]})},pie=s=>{const{isScrolling:C}=t.inject(t_),i=t.ref(!1),p=t.ref(),y=t.computed(()=>lr(s.estimatedRowHeight)&&s.rowIndex>=0),A=(u=!1)=>{const c=t.unref(p);if(!c)return;const{columns:f,onRowHeightChange:m,rowKey:g,rowIndex:v,style:b}=s,{height:w}=c.getBoundingClientRect();i.value=!0,t.nextTick(()=>{if(u||w!==Number.parseInt(b.height)){const _=f[0],x=(_==null?void 0:_.placeholderSign)===Sh;m==null||m({rowKey:g,height:w,rowIndex:v},_&&!x&&_.fixed)}})},h=t.computed(()=>{const{rowData:u,rowIndex:c,rowKey:f,onRowHover:m}=s,g=s.rowEventHandlers||{},v={};return Object.entries(g).forEach(([b,w])=>{Nr(w)&&(v[b]=_=>{w({event:_,rowData:u,rowIndex:c,rowKey:f})})}),m&&[{name:"onMouseleave",hovered:!1},{name:"onMouseenter",hovered:!0}].forEach(({name:b,hovered:w})=>{const _=v[b];v[b]=x=>{m({event:x,hovered:w,rowData:u,rowIndex:c,rowKey:f}),_==null||_(x)}}),v}),d=u=>{const{onRowExpand:c,rowData:f,rowIndex:m,rowKey:g}=s;c==null||c({expanded:u,rowData:f,rowIndex:m,rowKey:g})};return t.onMounted(()=>{t.unref(y)&&A(!0)}),{isScrolling:C,measurable:y,measured:i,rowRef:p,eventHandlers:h,onExpand:d}},mie=t.defineComponent({name:"ElTableV2TableRow",props:lu,setup(s,{expose:C,slots:i,attrs:p}){const{eventHandlers:y,isScrolling:A,measurable:h,measured:d,rowRef:u,onExpand:c}=pie(s);return C({onExpand:c}),()=>{const{columns:f,columnsStyles:m,expandColumnKey:g,depth:v,rowData:b,rowIndex:w,style:_}=s;let x=f.map((E,k)=>{const P=nr(b.children)&&b.children.length>0&&E.key===g;return i.cell({column:E,columns:f,columnIndex:k,depth:v,style:m[E.key],rowData:b,rowIndex:w,isScrolling:t.unref(A),expandIconProps:P?{rowData:b,rowIndex:w,onExpand:c}:void 0})});if(i.row&&(x=i.row({cells:x.map(E=>nr(E)&&E.length===1?E[0]:E),style:_,columns:f,depth:v,rowData:b,rowIndex:w,isScrolling:t.unref(A)})),t.unref(h)){const{height:E,...k}=_||{},P=t.unref(d);return t.createVNode("div",t.mergeProps({ref:u,class:s.class,style:P?_:k,role:"row"},p,t.unref(y)),[x])}return t.createVNode("div",t.mergeProps(p,{ref:u,class:s.class,style:_,role:"row"},t.unref(y)),[x])}}});function Aie(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!t.isVNode(s)}const gie=(s,{slots:C})=>{const{columns:i,columnsStyles:p,depthMap:y,expandColumnKey:A,expandedRowKeys:h,estimatedRowHeight:d,hasFixedColumns:u,rowData:c,rowIndex:f,style:m,isScrolling:g,rowProps:v,rowClass:b,rowKey:w,rowEventHandlers:_,ns:x,onRowHovered:E,onRowExpanded:k}=s,P=cu(b,{columns:i,rowData:c,rowIndex:f},""),D=cu(v,{columns:i,rowData:c,rowIndex:f}),R=c[w],z=y[R]||0,F=!!A,H=f<0,$=[x.e("row"),P,x.is("expanded",F&&h.includes(R)),x.is("fixed",!z&&H),x.is("customized",!!C.row),{[x.e(`row-depth-${z}`)]:F&&f>=0}],K=u?E:void 0,G={...D,columns:i,columnsStyles:p,class:$,depth:z,expandColumnKey:A,estimatedRowHeight:H?void 0:d,isScrolling:g,rowIndex:f,rowData:c,rowKey:R,rowEventHandlers:_,style:m},j=I=>{K==null||K({hovered:!0,rowKey:R,event:I,rowData:c,rowIndex:f})},N=I=>{K==null||K({hovered:!1,rowKey:R,event:I,rowData:c,rowIndex:f})};return t.createVNode(mie,t.mergeProps(G,{onRowExpand:k,onMouseenter:j,onMouseleave:N,rowkey:R}),Aie(C)?C:{default:()=>[C]})},n_=(s,{slots:C})=>{var h;const{cellData:i,style:p}=s,y=((h=i==null?void 0:i.toString)==null?void 0:h.call(i))||"",A=t.renderSlot(C,"default",s,()=>[y]);return t.createVNode("div",{class:s.class,title:y,style:p},[A])};n_.displayName="ElTableV2Cell",n_.inheritAttrs=!1;const lT=s=>{const{expanded:C,expandable:i,onExpand:p,style:y,size:A,ariaLabel:h}=s,d={onClick:i?()=>p(!C):void 0,ariaLabel:h,ariaExpanded:C,class:s.class};return t.createVNode("button",t.mergeProps(d,{type:"button"}),[t.createVNode(ir,{size:A,style:y},{default:()=>[t.createVNode(Zt.ArrowRight,null,null)]})])};lT.inheritAttrs=!1;const i_=({columns:s,column:C,columnIndex:i,depth:p,expandIconProps:y,isScrolling:A,rowData:h,rowIndex:d,style:u,expandedRowKeys:c,ns:f,t:m,cellProps:g,expandColumnKey:v,indentSize:b,iconSize:w,rowKey:_},{slots:x})=>{const E=lc(u);if(C.placeholderSign===Sh)return t.createVNode("div",{class:f.em("row-cell","placeholder"),style:E},null);const{cellRenderer:k,dataKey:P,dataGetter:D}=C,R=Nr(D)?D({columns:s,column:C,columnIndex:i,rowData:h,rowIndex:d}):Si(h,P??""),z=cu(g,{cellData:R,columns:s,column:C,columnIndex:i,rowIndex:d,rowData:h}),F={class:f.e("cell-text"),columns:s,column:C,columnIndex:i,cellData:R,isScrolling:A,rowData:h,rowIndex:d},H=oT(k),$=H?H(F):t.renderSlot(x,"default",F,()=>[t.createVNode(n_,F,null)]),K=[f.e("row-cell"),C.class,C.align==="center"&&f.is("align-center"),C.align==="right"&&f.is("align-right")],G=d>=0&&v&&C.key===v,j=d>=0&&c.includes(h[_]);let N;const I=`margin-inline-start: ${p*b}px;`;return G&&(mn(y)?N=t.createVNode(lT,t.mergeProps(y,{class:[f.e("expand-icon"),f.is("expanded",j)],size:w,expanded:j,ariaLabel:m(j?"el.table.collapseRowLabel":"el.table.expandRowLabel"),style:I,expandable:!0}),null):N=t.createVNode("div",{style:[I,`width: ${w}px; height: ${w}px;`].join(" ")},null)),t.createVNode("div",t.mergeProps({class:K,style:E},z,{role:"cell"}),[N,$])};i_.inheritAttrs=!1;const vie=Wt({class:String,columns:kh,columnsStyles:{type:et(Object),required:!0},headerIndex:Number,style:{type:et(Object)}}),yie=t.defineComponent({name:"ElTableV2HeaderRow",props:vie,setup(s,{slots:C}){return()=>{const{columns:i,columnsStyles:p,headerIndex:y,style:A}=s;let h=i.map((d,u)=>C.cell({columns:i,column:d,columnIndex:u,headerIndex:y,style:p[d.key]}));return C.header&&(h=C.header({cells:h.map(d=>nr(d)&&d.length===1?d[0]:d),columns:i,headerIndex:y})),t.createVNode("div",{class:s.class,style:A,role:"row"},[h])}}});function bie(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!t.isVNode(s)}const _ie=({columns:s,columnsStyles:C,headerIndex:i,style:p,headerClass:y,headerProps:A,ns:h},{slots:d})=>{const u={columns:s,headerIndex:i},c=[h.e("header-row"),cu(y,u,""),h.is("customized",!!d.header)],f={...cu(A,u),columnsStyles:C,class:c,columns:s,headerIndex:i,style:p};return t.createVNode(yie,f,bie(d)?d:{default:()=>[d]})},s_=(s,{slots:C})=>t.renderSlot(C,"default",s,()=>{var i,p;return[t.createVNode("div",{class:s.class,title:(i=s.column)==null?void 0:i.title},[(p=s.column)==null?void 0:p.title])]});s_.displayName="ElTableV2HeaderCell",s_.inheritAttrs=!1;const wie=s=>{const{sortOrder:C}=s;return t.createVNode("button",{type:"button","aria-label":s.ariaLabel,class:s.class},[t.createVNode(ir,{size:14},{default:()=>[C==="asc"?t.createVNode(Zt.SortUp,null,null):t.createVNode(Zt.SortDown,null,null)]})])},cT=(s,{slots:C})=>{const{column:i,ns:p,t:y,style:A,onColumnSorted:h}=s,d=lc(A);if(i.placeholderSign===Sh)return t.createVNode("div",{class:p.em("header-row-cell","placeholder"),style:d},null);const{headerCellRenderer:u,headerClass:c,sortable:f}=i,m={...s,class:p.e("header-cell-text")},g=oT(u),v=g?g(m):t.renderSlot(C,"default",m,()=>[t.createVNode(s_,m,null)]),{sortBy:b,sortState:w,headerCellProps:_}=s;let x,E,k;if(w){const R=w[i.key];x=!!Jb[R],E=x?R:"asc"}else x=i.key===b.key,E=x?b.order:"asc";E==="asc"?k="ascending":E==="desc"?k="descending":k=void 0;const P=[p.e("header-cell"),cu(c,s,""),i.align==="center"&&p.is("align-center"),i.align==="right"&&p.is("align-right"),f&&p.is("sortable")],D={...cu(_,s),onClick:i.sortable?h:void 0,ariaSort:f?k:void 0,class:P,style:d,"data-key":i.key};return t.createVNode("div",t.mergeProps(D,{role:"columnheader"}),[v,f&&t.createVNode(wie,{class:[p.e("sort-icon"),x&&p.is("sorting")],sortOrder:E,ariaLabel:y("el.table.sortLabel",{column:i.title||""})},null)])},uT=(s,{slots:C})=>{var i;return t.createVNode("div",{class:s.class,style:s.style},[(i=C.default)==null?void 0:i.call(C)])};uT.displayName="ElTableV2Footer";const dT=(s,{slots:C})=>{const i=t.renderSlot(C,"default",{},()=>[t.createVNode(xq,null,null)]);return t.createVNode("div",{class:s.class,style:s.style},[i])};dT.displayName="ElTableV2Empty";const fT=(s,{slots:C})=>{var i;return t.createVNode("div",{class:s.class,style:s.style},[(i=C.default)==null?void 0:i.call(C)])};fT.displayName="ElTableV2Overlay";function Ph(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!t.isVNode(s)}const Cie=t.defineComponent({name:"ElTableV2",props:Yne,slots:Object,setup(s,{slots:C,expose:i}){const p=zt("table-v2"),{t:y}=Yr(),{columnsStyles:A,fixedColumnsOnLeft:h,fixedColumnsOnRight:d,mainColumns:u,mainTableHeight:c,fixedTableHeight:f,leftTableWidth:m,rightTableWidth:g,data:v,depthMap:b,expandedRowKeys:w,hasFixedColumns:_,mainTableRef:x,leftTableRef:E,rightTableRef:k,isDynamic:P,isResetting:D,isScrolling:R,bodyWidth:z,emptyStyle:F,rootStyle:H,footerHeight:$,showEmpty:K,scrollTo:G,scrollToLeft:j,scrollToTop:N,scrollToRow:I,getRowHeight:L,onColumnSorted:U,onRowHeightChange:O,onRowHovered:Q,onRowExpanded:W,onRowsRendered:Z,onScroll:J,onVerticalScroll:ne}=iie(s);return i({scrollTo:G,scrollToLeft:j,scrollToTop:N,scrollToRow:I}),t.provide(t_,{ns:p,isResetting:D,isScrolling:R}),()=>{const{cache:ae,cellProps:ce,estimatedRowHeight:q,expandColumnKey:fe,fixedData:re,headerHeight:te,headerClass:le,headerProps:de,headerCellProps:he,sortBy:ue,sortState:pe,rowHeight:se,rowClass:V,rowEventHandlers:Ce,rowKey:ve,rowProps:ye,scrollbarAlwaysOn:Ae,indentSize:me,iconSize:be,useIsScrolling:we,vScrollbarSize:Te,width:He}=s,je=t.unref(v),qe={cache:ae,class:p.e("main"),columns:t.unref(u),data:je,fixedData:re,estimatedRowHeight:q,bodyWidth:t.unref(z),headerHeight:te,headerWidth:t.unref(z),height:t.unref(c),mainTableRef:x,rowKey:ve,rowHeight:se,scrollbarAlwaysOn:Ae,scrollbarStartGap:2,scrollbarEndGap:Te,useIsScrolling:we,width:He,getRowHeight:L,onRowsRendered:Z,onScroll:J},tt=t.unref(m),mt=t.unref(f),kt={cache:ae,class:p.e("left"),columns:t.unref(h),data:je,fixedData:re,estimatedRowHeight:q,leftTableRef:E,rowHeight:se,bodyWidth:tt,headerWidth:tt,headerHeight:te,height:mt,rowKey:ve,scrollbarAlwaysOn:Ae,scrollbarStartGap:2,scrollbarEndGap:Te,useIsScrolling:we,width:tt,getRowHeight:L,onScroll:ne},ht=t.unref(g),yt={cache:ae,class:p.e("right"),columns:t.unref(d),data:je,fixedData:re,estimatedRowHeight:q,rightTableRef:k,rowHeight:se,bodyWidth:ht,headerWidth:ht,headerHeight:te,height:mt,rowKey:ve,scrollbarAlwaysOn:Ae,scrollbarStartGap:2,scrollbarEndGap:Te,width:ht,style:`${p.cssVarName("table-scrollbar-size")}: ${Te}px`,useIsScrolling:we,getRowHeight:L,onScroll:ne},Lt=t.unref(A),We={ns:p,depthMap:t.unref(b),columnsStyles:Lt,expandColumnKey:fe,expandedRowKeys:t.unref(w),estimatedRowHeight:q,hasFixedColumns:t.unref(_),rowProps:ye,rowClass:V,rowKey:ve,rowEventHandlers:Ce,onRowHovered:Q,onRowExpanded:W,onRowHeightChange:O},Oe={cellProps:ce,expandColumnKey:fe,indentSize:me,iconSize:be,rowKey:ve,expandedRowKeys:t.unref(w),ns:p,t:y},Ke={ns:p,headerClass:le,headerProps:de,columnsStyles:Lt},nt={ns:p,t:y,sortBy:ue,sortState:pe,headerCellProps:he,onColumnSorted:U},Xe={row:Ct=>t.createVNode(gie,t.mergeProps(Ct,We),{row:C.row,cell:It=>{let Ot;return C.cell?t.createVNode(i_,t.mergeProps(It,Oe,{style:Lt[It.column.key]}),Ph(Ot=C.cell(It))?Ot:{default:()=>[Ot]}):t.createVNode(i_,t.mergeProps(It,Oe,{style:Lt[It.column.key]}),null)}}),header:Ct=>t.createVNode(_ie,t.mergeProps(Ct,Ke),{header:C.header,cell:It=>{let Ot;return C["header-cell"]?t.createVNode(cT,t.mergeProps(It,nt,{style:Lt[It.column.key]}),Ph(Ot=C["header-cell"](It))?Ot:{default:()=>[Ot]}):t.createVNode(cT,t.mergeProps(It,nt,{style:Lt[It.column.key]}),null)}})},Ge=[s.class,p.b(),p.e("root"),p.is("dynamic",t.unref(P))],ze={class:p.e("footer"),style:t.unref($)};return t.createVNode("div",{class:Ge,style:t.unref(H)},[t.createVNode(cie,qe,Ph(Xe)?Xe:{default:()=>[Xe]}),t.createVNode(die,kt,Ph(Xe)?Xe:{default:()=>[Xe]}),t.createVNode(hie,yt,Ph(Xe)?Xe:{default:()=>[Xe]}),C.footer&&t.createVNode(uT,ze,{default:C.footer}),t.unref(K)&&t.createVNode(dT,{class:p.e("empty"),style:t.unref(F)},{default:C.empty}),C.overlay&&t.createVNode(fT,{class:p.e("overlay")},{default:C.overlay})])}}}),xie=Wt({disableWidth:Boolean,disableHeight:Boolean,onResize:{type:et(Function)}}),Eie=s=>{const C=t.ref(),i=t.ref(0),p=t.ref(0);let y;return t.onMounted(()=>{y=ti(C,([A])=>{const{width:h,height:d}=A.contentRect,{paddingLeft:u,paddingRight:c,paddingTop:f,paddingBottom:m}=getComputedStyle(A.target),g=Number.parseInt(u)||0,v=Number.parseInt(c)||0,b=Number.parseInt(f)||0,w=Number.parseInt(m)||0;i.value=h-g-v,p.value=d-b-w}).stop}),t.onBeforeUnmount(()=>{y==null||y()}),t.watch([i,p],([A,h])=>{var d;(d=s.onResize)==null||d.call(s,{width:A,height:h})}),{sizer:C,width:i,height:p}},Bie=t.defineComponent({name:"ElAutoResizer",props:xie,setup(s,{slots:C}){const i=zt("auto-resizer"),{height:p,width:y,sizer:A}=Eie(s),h={width:"100%",height:"100%"};return()=>{var d;return t.createVNode("div",{ref:A,class:i.b(),style:h},[(d=C.default)==null?void 0:d.call(C,{height:p.value,width:y.value})])}}});Tr(Cie),Tr(Bie);const BA=Symbol("tabsRootContextKey"),Sie=Wt({tabs:{type:et(Array),default:()=>mi([])},tabRefs:{type:et(Object),default:()=>mi({})}}),hT="ElTabBar";var kie=t.defineComponent({name:hT,__name:"tab-bar",props:Sie,setup(s,{expose:C}){const i=s,p=t.inject(BA);p||oi(hT,"<el-tabs><el-tab-bar /></el-tabs>");const y=zt("tabs"),A=t.ref(),h=t.ref(),d=t.ref(!1),u=t.computed(()=>d.value?h.value:{...h.value,transition:"none"}),c=t.computed(()=>{var w;return en(p.props.defaultValue)||!!((w=h.value)!=null&&w.transform)}),f=()=>{let w=0,_=0;const x=["top","bottom"].includes(p.props.tabPosition)?"width":"height",E=x==="width"?"x":"y",k=E==="x"?"left":"top";return i.tabs.every(P=>{if(en(P.paneName))return!1;const D=i.tabRefs[P.paneName];if(!D)return!1;if(!P.active)return!0;w=D[`offset${U0(k)}`],_=D[`client${U0(x)}`];const R=window.getComputedStyle(D);return x==="width"&&(_-=Number.parseFloat(R.paddingLeft)+Number.parseFloat(R.paddingRight),w+=Number.parseFloat(R.paddingLeft)),!1}),{[x]:`${_}px`,transform:`translate${U0(E)}(${w}px)`}},m=()=>{h.value=f(),d.value||ms(()=>ms(()=>{d.value=!0}))},g=[],v=()=>{g.forEach(w=>w.stop()),g.length=0,Object.values(i.tabRefs).forEach(w=>{g.push(ti(w,m))})};t.watch(()=>i.tabs,async()=>{await t.nextTick(),m(),v()},{immediate:!0});const b=ti(A,()=>m());return t.onBeforeUnmount(()=>{g.forEach(w=>w.stop()),g.length=0,b.stop()}),C({ref:A,update:m}),(w,_)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"barRef",ref:A,class:t.normalizeClass([t.unref(y).e("active-bar"),t.unref(y).is(t.unref(p).props.tabPosition),t.unref(y).is("hidden",!c.value)]),style:t.normalizeStyle(u.value)},null,6))}}),Pie=kie;const Mie=5,Tie=({scrollable:s,navOffset:C,navSize:i,navContainerSize:p,isHorizontal:y})=>{const A=t.ref(!1),h=t.computed(()=>Math.max(i.value-p.value,0));let d,u;const c=g=>{if(!s.value||g.touches.length!==1)return;const{clientX:v,clientY:b}=oA(g);d={startX:v,startY:b,startOffset:C.value},u=void 0},f=g=>{if(!d||!s.value)return;if(g.touches.length!==1){m();return}const{clientX:v,clientY:b}=oA(g),w=d.startX-v,_=d.startY-b,x=y.value?w:_,E=y.value?_:w,k=Math.abs(x),P=Math.abs(E);if(_E(u)){if(Math.max(k,P)<=Mie)return;u=k>P}if(!u)return;const D=co(d.startOffset+x,0,h.value);h.value<=0||D===C.value||!g.cancelable||(g.preventDefault(),A.value=!0,C.value=D)},m=()=>{d=void 0,u=void 0,A.value=!1};return{isTouchScrolling:A,handleTouchStart:c,handleTouchMove:f,handleTouchEnd:m}},Iie=Wt({panes:{type:et(Array),default:()=>mi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean,tabindex:{type:[String,Number],default:void 0}}),Die={tabClick:(s,C,i)=>i instanceof Event,tabRemove:(s,C)=>C instanceof Event},pT="ElTabNav",Rie=t.defineComponent({name:pT,props:Iie,emits:Die,setup(s,{expose:C,emit:i}){const p=t.inject(BA);p||oi(pT,"<el-tabs><tab-nav /></el-tabs>");const y=zt("tabs"),A=VU(),h=HU(),d=t.ref(),u=t.ref(),c=t.ref(),f=t.ref({}),m=t.ref(),g=t.ref(!1),v=t.ref(0),b=t.ref(!1),w=t.ref(!0),_=t.ref(!1),x=t.shallowRef(),E=t.computed(()=>["top","bottom"].includes(p.props.tabPosition)),k=t.computed(()=>E.value?"width":"height"),P=t.computed(()=>{const q=k.value==="width"?"X":"Y";return{transition:_.value||j.value?"none":void 0,transform:`translate${q}(-${v.value}px)`}}),{width:D,height:R}=$f(d),{width:z,height:F}=$f(u,{width:0,height:0},{box:"border-box"}),H=t.computed(()=>E.value?D.value:R.value),$=t.computed(()=>E.value?z.value:F.value),{onWheel:K}=Xk({atStartEdge:t.computed(()=>v.value<=0),atEndEdge:t.computed(()=>$.value-v.value<=H.value),layout:t.computed(()=>E.value?"horizontal":"vertical")},q=>{v.value=co(v.value+q,0,$.value-H.value)}),G=q=>{_.value=!0,K(q),ms(()=>{_.value=!1})},{isTouchScrolling:j,handleTouchStart:N,handleTouchMove:I,handleTouchEnd:L}=Tie({scrollable:g,navOffset:v,navSize:$,navContainerSize:H,isHorizontal:E}),U=()=>{if(!d.value)return;const q=d.value.getBoundingClientRect()[k.value],fe=v.value;if(!fe)return;const re=fe>q?fe-q:0;v.value=re},O=()=>{if(!d.value||!u.value)return;const q=u.value.getBoundingClientRect()[k.value],fe=d.value.getBoundingClientRect()[k.value],re=v.value;if(!Ha(q-re,fe))return;const te=q-re>fe*2?re+fe:q-fe;v.value=te},Q=async()=>{const q=u.value;if(!g.value||!c.value||!d.value||!q)return;await t.nextTick();const fe=f.value[s.currentName];if(!fe)return;const re=d.value,te=fe.getBoundingClientRect(),le=re.getBoundingClientRect(),de=le.left+1,he=le.right-1,ue=q.getBoundingClientRect(),pe=E.value?ue.width-le.width:ue.height-le.height,se=v.value;let V=se;E.value?(te.left<de&&(V=se-(de-te.left)),te.right>he&&(V=se+te.right-he)):(te.top<le.top&&(V=se-(le.top-te.top)),te.bottom>le.bottom&&(V=se+(te.bottom-le.bottom))),V=Math.max(V,0),v.value=Math.min(V,pe)},W=()=>{var te;if(!u.value||!d.value)return;s.stretch&&((te=m.value)==null||te.update());const q=u.value.getBoundingClientRect()[k.value],fe=d.value.getBoundingClientRect()[k.value],re=v.value;fe<q?(g.value=g.value||{},g.value.prev=re,g.value.next=Ha(q,re+fe),Ha(fe,q-re)&&(v.value=q-fe)):(g.value=!1,re>0&&(v.value=0))},Z=q=>{const fe=Dn(q);let re=0;switch(fe){case Gt.left:case Gt.up:re=-1;break;case Gt.right:case Gt.down:re=1;break;default:return}const te=Array.from(q.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));let le=te.indexOf(q.target)+re;le<0?le=te.length-1:le>=te.length&&(le=0),te[le].focus({preventScroll:!0}),te[le].click(),J()},J=()=>{w.value&&(b.value=!0)},ne=()=>b.value=!1,ae=(q,fe)=>{f.value[fe]=q},ce=async()=>{var q;await t.nextTick(),(q=f.value[s.currentName])==null||q.focus({preventScroll:!0})};return t.watch(A,q=>{q==="hidden"?w.value=!1:q==="visible"&&setTimeout(()=>w.value=!0,50)}),t.watch(h,q=>{q?setTimeout(()=>w.value=!0,50):w.value=!1}),ti(c,()=>{ms(W)}),t.onMounted(()=>setTimeout(()=>Q(),0)),t.onUpdated(()=>W()),C({scrollToActiveTab:Q,removeFocus:ne,focusActiveTab:ce,tabListRef:u,tabBarRef:m,scheduleRender:()=>t.triggerRef(x)}),()=>{const q=g.value?[t.createVNode("span",{class:[y.e("nav-prev"),y.is("disabled",!g.value.prev)],onClick:U},[t.createVNode(ir,null,{default:()=>[t.createVNode(Zt.ArrowLeft,null,null)]})]),t.createVNode("span",{class:[y.e("nav-next"),y.is("disabled",!g.value.next)],onClick:O},[t.createVNode(ir,null,{default:()=>[t.createVNode(Zt.ArrowRight,null,null)]})])]:null,fe=s.panes.map((re,te)=>{var Ce,ve;const le=re.uid,de=re.props.disabled,he=re.props.name??re.index??`${te}`,ue=!de&&(re.isClosable||re.props.closable!==!1&&s.editable);re.index=`${te}`;const pe=ue?t.createVNode(ir,{class:"is-icon-close",onClick:ye=>i("tabRemove",re,ye)},{default:()=>[t.createVNode(Zt.Close,null,null)]}):null,se=((ve=(Ce=re.slots).label)==null?void 0:ve.call(Ce))||re.props.label,V=!de&&re.active?s.tabindex??p.props.tabindex:-1;return t.createVNode("div",{ref:ye=>ae(ye,he),class:[y.e("item"),y.is(p.props.tabPosition),y.is("active",re.active),y.is("disabled",de),y.is("closable",ue),y.is("focus",b.value)],id:`tab-${he}`,key:`tab-${le}`,"aria-controls":`pane-${he}`,role:"tab","aria-selected":re.active,tabindex:V,onFocus:()=>J(),onBlur:()=>ne(),onClick:ye=>{ne(),i("tabClick",re,he,ye)},onKeydown:ye=>{const Ae=Dn(ye);ue&&(Ae===Gt.delete||Ae===Gt.backspace)&&i("tabRemove",re,ye)}},[se,pe])});return x.value,t.createVNode("div",{ref:c,class:[y.e("nav-wrap"),y.is("scrollable",!!g.value),y.is(p.props.tabPosition)]},[q,t.createVNode("div",{class:y.e("nav-scroll"),ref:d},[s.panes.length>0?t.createVNode("div",{class:[y.e("nav"),y.is(p.props.tabPosition),y.is("stretch",s.stretch&&["top","bottom"].includes(p.props.tabPosition))],ref:u,style:P.value,role:"tablist",onKeydown:Z,onWheel:G,onTouchstart:N,onTouchmove:I,onTouchend:L,onTouchcancel:L},[s.type?null:t.createVNode(Pie,{ref:m,tabs:[...s.panes],tabRefs:f.value},null),fe]):null])])}}}),Fie=Wt({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},defaultValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:et(Function),default:()=>!0},stretch:Boolean,tabindex:{type:[String,Number],default:0}}),o_=s=>Ar(s)||lr(s),Nie={[Pr]:s=>o_(s),tabClick:(s,C)=>C instanceof Event,tabChange:s=>o_(s),edit:(s,C)=>["remove","add"].includes(C),tabRemove:s=>o_(s),tabAdd:()=>!0},Oie=t.defineComponent({name:"ElTabs",props:Fie,emits:Nie,setup(s,{emit:C,slots:i,expose:p}){const y=zt("tabs"),A=t.computed(()=>["left","right"].includes(s.tabPosition)),{children:h,addChild:d,removeChild:u,ChildrenSorter:c}=Pm(t.getCurrentInstance(),"ElTabPane"),f=t.ref(),m=t.ref((en(s.modelValue)?s.defaultValue:s.modelValue)??"0"),g=async(E,k=!1)=>{var P,D,R,z;if(!(m.value===E||en(E)))try{let F;if(s.beforeLeave){const H=s.beforeLeave(E,m.value);F=H instanceof Promise?await H:H}else F=!0;if(F!==!1){const H=(P=h.value.find($=>$.paneName===m.value))==null?void 0:P.isFocusInsidePane();m.value=E,k&&(C(Pr,E),C("tabChange",E)),(R=(D=f.value)==null?void 0:D.removeFocus)==null||R.call(D),H&&((z=f.value)==null||z.focusActiveTab())}}catch{}},v=(E,k,P)=>{E.props.disabled||(C("tabClick",E,P),g(k,!0))},b=(E,k)=>{E.props.disabled||en(E.props.name)||(k.stopPropagation(),C("edit",E.props.name,"remove"),C("tabRemove",E.props.name))},w=()=>{C("edit",void 0,"add"),C("tabAdd")},_=E=>{const k=Dn(E);[Gt.enter,Gt.numpadEnter].includes(k)&&w()},x=E=>{const k=E.el.firstChild,P=["bottom","right"].includes(s.tabPosition)?E.children[0].el:E.children[1].el;k!==P&&k.before(P)};return t.watch(()=>s.modelValue,E=>g(E)),t.watch(m,async()=>{var E;await t.nextTick(),(E=f.value)==null||E.scrollToActiveTab()}),t.provide(BA,{props:s,currentName:m,registerPane:d,unregisterPane:u,nav$:f}),p({currentName:m,get tabNavRef(){return Uc(f.value,["scheduleRender"])}}),()=>{const E=i["add-icon"],k=s.editable||s.addable?t.createVNode("div",{class:[y.e("new-tab"),A.value&&y.e("new-tab-vertical")],tabindex:s.tabindex,onClick:w,onKeydown:_},[E?t.renderSlot(i,"add-icon"):t.createVNode(ir,{class:y.is("icon-plus")},{default:()=>[t.createVNode(Zt.Plus,null,null)]})]):null,P=()=>t.createVNode(Rie,{ref:f,currentName:m.value,editable:s.editable,type:s.type,panes:h.value,stretch:s.stretch,onTabClick:v,onTabRemove:b},null),D=t.createVNode("div",{class:[y.e("header"),A.value&&y.e("header-vertical"),y.is(s.tabPosition)]},[t.createVNode(c,null,{default:P,$stable:!0}),k]),R=t.createVNode("div",{class:y.e("content")},[t.renderSlot(i,"default")]);return t.createVNode("div",{class:[y.b(),y.m(s.tabPosition),{[y.m("card")]:s.type==="card",[y.m("border-card")]:s.type==="border-card"}],onVnodeMounted:x,onVnodeUpdated:x},[R,D])}}}),Lie=Wt({label:{type:String,default:""},name:{type:[String,Number]},closable:{type:Boolean,default:void 0},disabled:Boolean,lazy:Boolean}),jie=["id","aria-hidden","aria-labelledby"],mT="ElTabPane";var Vie=t.defineComponent({name:mT,__name:"tab-pane",props:Lie,setup(s){const C=s,i=t.getCurrentInstance(),p=t.useSlots(),y=t.inject(BA);y||oi(mT,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const A=zt("tab-pane"),h=t.ref(),d=t.ref(),u=t.computed(()=>C.closable??y.props.closable),c=t.computed(()=>y.currentName.value===(C.name??d.value)),f=t.ref(c.value),m=t.computed(()=>C.name??d.value),g=t.computed(()=>!C.lazy||f.value||c.value),v=()=>{var w;return(w=h.value)==null?void 0:w.contains(document.activeElement)};t.watch(c,w=>{w&&(f.value=!0)});const b=t.reactive({uid:i.uid,getVnode:()=>i.vnode,slots:p,props:C,paneName:m,active:c,index:d,isClosable:u,isFocusInsidePane:v});return y.registerPane(b),t.onBeforeUnmount(()=>{y.unregisterPane(b)}),t.onBeforeUpdate(()=>{var w;p.label&&((w=y.nav$.value)==null||w.scheduleRender())}),(w,_)=>g.value?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,id:`pane-${m.value}`,ref_key:"paneRef",ref:h,class:t.normalizeClass(t.unref(A).b()),role:"tabpanel","aria-hidden":!c.value,"aria-labelledby":`tab-${m.value}`},[t.renderSlot(w.$slots,"default")],10,jie)),[[t.vShow,c.value]]):t.createCommentVNode("v-if",!0)}}),AT=Vie;Tr(Oie,{TabPane:AT}),ai(AT);const Uie=Wt({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:Aa,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});var zie=t.defineComponent({name:"ElText",__name:"text",props:Uie,setup(s,{expose:C}){const i=s,p=t.ref(),y=ji(),A=zt("text"),h=t.computed(()=>[A.b(),A.m(i.type),A.m(y.value),A.is("truncated",i.truncated),A.is("line-clamp",!en(i.lineClamp))]),{width:d,height:u}=$f(p),c=t.ref(!1);let f;const m=()=>{f&&To(f),f=ms(()=>{var g,v,b,w;if(f=void 0,c.value=!1,i.truncated){const _=(g=p.value)==null?void 0:g.offsetWidth,x=(v=p.value)==null?void 0:v.scrollWidth;_&&x&&x>_&&(c.value=!0)}else if(!en(i.lineClamp)){const _=(b=p.value)==null?void 0:b.offsetHeight,x=(w=p.value)==null?void 0:w.scrollHeight;_&&x&&x>_&&(c.value=!0)}})};return t.watch(()=>[d.value,u.value,i.truncated,i.lineClamp],m,{flush:"post"}),rd(p,m,{attributes:!0,attributeFilter:["class","style"],subtree:!0,childList:!0,characterData:!0}),t.onMounted(m),t.onBeforeUnmount(()=>{f&&To(f)}),C({isTruncated:c}),(g,v)=>{var b;return t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.tag),{ref_key:"textRef",ref:p,class:t.normalizeClass(h.value),title:g.$attrs.title??(c.value?(b=p.value)==null?void 0:b.textContent:void 0),style:t.normalizeStyle({"-webkit-line-clamp":s.lineClamp})},{default:t.withCtx(()=>[t.renderSlot(g.$slots,"default")]),_:3},8,["class","title","style"])}}}),Hie=zie;const gT=Tr(Hie),vT="09:00",yT="18:00",bT="00:30",$ie=Wt({format:{type:String,default:"HH:mm"},modelValue:{type:et(String)},disabled:{type:Boolean,default:void 0},editable:{type:Boolean,default:!0},effect:{type:et(String),default:"light"},clearable:{type:Boolean,default:!0},size:Qi,placeholder:String,start:{type:String,default:vT},end:{type:String,default:yT},step:{type:String,default:bT},minTime:{type:et(String)},maxTime:{type:et(String)},includeEndTime:Boolean,name:String,prefixIcon:{type:et([String,Object]),default:()=>Zt.Clock},clearIcon:{type:et([String,Object]),default:()=>Zt.CircleClose},popperClass:{type:et([String,Array,Object,Boolean]),default:""},popperStyle:{type:et([String,Array,Object,Boolean]),default:void 0},...Yc}),uu=s=>{const C=(s||"").split(":");if(C.length>=2){let i=Number.parseInt(C[0],10);const p=Number.parseInt(C[1],10);if(Number.isNaN(i)||Number.isNaN(p))return null;const y=s.toUpperCase();return y.includes("AM")&&i===12?i=0:y.includes("PM")&&i!==12&&(i+=12),{hours:i,minutes:p}}return null},Gie=s=>!!s&&s.hours>=0&&s.minutes>=0&&!Number.isNaN(s.hours)&&!Number.isNaN(s.minutes),a_=(s,C)=>{const i=uu(s);if(!i)return-1;const p=uu(C);if(!p)return-1;const y=i.minutes+i.hours*60,A=p.minutes+p.hours*60;return y===A?0:y>A?1:-1},_T=s=>`${s}`.padStart(2,"0"),SA=s=>`${_T(s.hours)}:${_T(s.minutes)}`,Qie=(s,C)=>{const i=uu(s);if(!i)return"";const p=uu(C);if(!p)return"";const y={hours:i.hours,minutes:i.minutes};return y.minutes+=p.minutes,y.hours+=p.hours,y.hours+=Math.floor(y.minutes/60),y.minutes=y.minutes%60,SA(y)};var Wie=t.defineComponent({name:"ElTimeSelect",__name:"time-select",props:$ie,emits:[Gr,"blur","focus","clear",Pr],setup(s,{expose:C}){br.extend(eb);const{Option:i}=na,p=s,y=zt("input"),A=t.ref(),h=ri(),{lang:d}=Yr(),u=(E,k,P,D=!0)=>{const R=uu(E);return!Gie(R)||!D&&R.hours===0&&R.minutes===0?(wn("ElTimeSelect",`invalid ${k}, fallback to default ${k} (${P}).`),P):SA(R)},c=t.computed(()=>p.modelValue),f=t.computed(()=>u(p.start,"start",vT)),m=t.computed(()=>u(p.end,"end",yT)),g=t.computed(()=>{const E=uu(p.minTime||"");return E?SA(E):null}),v=t.computed(()=>{const E=uu(p.maxTime||"");return E?SA(E):null}),b=t.computed(()=>u(p.step,"step",bT,!1)),w=t.computed(()=>{var D;const E=[],k=(R,z)=>{E.push({value:R,rawValue:z,disabled:a_(z,g.value||"-1:-1")<=0||a_(z,v.value||"100:100")>=0})};let P=f.value;for(;a_(P,m.value)<=0;)k(br(P,"HH:mm").locale(d.value).format(p.format),P),P=Qie(P,b.value);return p.includeEndTime&&((D=E[E.length-1])==null?void 0:D.rawValue)!==m.value&&k(br(m.value,"HH:mm").locale(d.value).format(p.format),m.value),E});return C({blur:()=>{var E,k;(k=(E=A.value)==null?void 0:E.blur)==null||k.call(E)},focus:()=>{var E,k;(k=(E=A.value)==null?void 0:E.focus)==null||k.call(E)}}),(E,k)=>(t.openBlock(),t.createBlock(t.unref(na),{ref_key:"select",ref:A,name:s.name,"model-value":c.value,disabled:t.unref(h),clearable:s.clearable,"clear-icon":s.clearIcon,size:s.size,effect:s.effect,placeholder:s.placeholder,"default-first-option":"",filterable:s.editable,"empty-values":s.emptyValues,"value-on-clear":s.valueOnClear,"popper-class":s.popperClass,"popper-style":s.popperStyle,"onUpdate:modelValue":k[0]||(k[0]=P=>E.$emit(t.unref("update:modelValue"),P)),onChange:k[1]||(k[1]=P=>E.$emit(t.unref("change"),P)),onBlur:k[2]||(k[2]=P=>E.$emit("blur",P)),onFocus:k[3]||(k[3]=P=>E.$emit("focus",P)),onClear:k[4]||(k[4]=()=>E.$emit("clear"))},{prefix:t.withCtx(()=>[s.prefixIcon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass(t.unref(y).e("prefix-icon"))},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.prefixIcon)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)]),default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.value,P=>(t.openBlock(),t.createBlock(t.unref(i),{key:P.value,label:P.value,value:P.value,disabled:P.disabled},null,8,["label","value","disabled"]))),128))]),_:1},8,["name","model-value","disabled","clearable","clear-icon","size","effect","placeholder","filterable","empty-values","value-on-clear","popper-class","popper-style"]))}}),Kie=Wie;Tr(Kie);const wT="timeline",Xie=Wt({mode:{type:String,values:["start","alternate","alternate-reverse","end"],default:"start"},reverse:Boolean}),Yie=t.defineComponent({name:"ElTimeline",props:Xie,setup(s,{slots:C}){const i=zt("timeline");t.provide(wT,{props:s,slots:C});const p=t.computed(()=>[i.b(),i.is(s.mode)]);return()=>{var A;const y=Do(((A=C.default)==null?void 0:A.call(C))??[]);return t.h("ul",{class:p.value},s.reverse?y.reverse():y)}}}),Jie=Wt({timestamp:{type:String,default:""},hideTimestamp:Boolean,center:Boolean,placement:{type:String,values:["top","bottom"],default:"bottom"},type:{type:String,values:["primary","success","warning","danger","info"],default:""},color:{type:String,default:""},size:{type:String,values:["normal","large"],default:"normal"},icon:{type:Pn},hollow:Boolean});var Zie=t.defineComponent({name:"ElTimelineItem",__name:"timeline-item",props:Jie,setup(s){const C=s,{props:i}=t.inject(wT),p=zt("timeline-item"),y=t.computed(()=>[p.e("node"),p.em("node",C.size||""),p.em("node",C.type||""),p.is("hollow",C.hollow)]),A=t.computed(()=>[p.b(),{[p.e("center")]:C.center},p.is(i.mode)]);return(h,d)=>(t.openBlock(),t.createElementBlock("li",{class:t.normalizeClass(A.value)},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("tail"))},null,2),h.$slots.dot?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(y.value),style:t.normalizeStyle({backgroundColor:s.color})},[s.icon?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass(t.unref(p).e("icon"))},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.icon)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],6)),h.$slots.dot?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(p).e("dot"))},[t.renderSlot(h.$slots,"dot")],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("wrapper"))},[!s.hideTimestamp&&s.placement==="top"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(p).e("timestamp"),t.unref(p).is("top")])},t.toDisplayString(s.timestamp),3)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("content"))},[t.renderSlot(h.$slots,"default")],2),!s.hideTimestamp&&s.placement==="bottom"?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([t.unref(p).e("timestamp"),t.unref(p).is("bottom")])},t.toDisplayString(s.timestamp),3)):t.createCommentVNode("v-if",!0)],2)],2))}}),CT=Zie;Tr(Yie,{TimelineItem:CT}),ai(CT);const xT="left-check-change",ET="right-check-change",cc=Wt({data:{type:et(Array),default:()=>[]},titles:{type:et(Array),default:()=>[]},buttonTexts:{type:et(Array),default:()=>[]},filterPlaceholder:String,filterMethod:{type:et(Function)},leftDefaultChecked:{type:et(Array),default:()=>[]},rightDefaultChecked:{type:et(Array),default:()=>[]},renderContent:{type:et(Function)},modelValue:{type:et(Array),default:()=>[]},format:{type:et(Object),default:()=>({})},filterable:Boolean,props:{type:et(Object),default:()=>mi({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},validateEvent:{type:Boolean,default:!0},virtualScroll:Boolean,itemSize:{type:Number,default:30}}),l_=(s,C)=>[s,C].every(nr)||nr(s)&&yi(C),qie={[Gr]:(s,C,i)=>[s,i].every(nr)&&["left","right"].includes(C),[Pr]:s=>nr(s),[xT]:l_,[ET]:l_},Mh=s=>{const C={label:"label",key:"key",disabled:"disabled"};return t.computed(()=>({...C,...s.props}))},ese=(s,C)=>({onSourceCheckedChange:(y,A)=>{s.leftChecked=y,A&&C(xT,y,A)},onTargetCheckedChange:(y,A)=>{s.rightChecked=y,A&&C(ET,y,A)}}),tse=s=>{const C=Mh(s),i=t.computed(()=>s.data.reduce((p,y)=>(p[y[C.value.key]]=y,p),{}));return{sourceData:t.computed(()=>s.data.filter(p=>!s.modelValue.includes(p[C.value.key]))),targetData:t.computed(()=>s.targetOrder==="original"?s.data.filter(p=>s.modelValue.includes(p[C.value.key])):s.modelValue.reduce((p,y)=>{const A=i.value[y];return A&&p.push(A),p},[]))}},rse=(s,C,i)=>{const p=Mh(s),y=(d,u,c)=>{i(Pr,d),i(Gr,d,u,c)};return{addToLeft:()=>{const d=s.modelValue.slice();C.rightChecked.forEach(u=>{const c=d.indexOf(u);c>-1&&d.splice(c,1)}),y(d,"left",C.rightChecked)},addToRight:()=>{let d=s.modelValue.slice();const u=s.data.filter(c=>{const f=c[p.value.key];return C.leftChecked.includes(f)&&!s.modelValue.includes(f)}).map(c=>c[p.value.key]);d=s.targetOrder==="unshift"?u.concat(d):d.concat(u),s.targetOrder==="original"&&(d=s.data.filter(c=>d.includes(c[p.value.key])).map(c=>c[p.value.key])),y(d,"right",C.leftChecked)}}},c_="checked-change",nse=Wt({data:cc.data,optionRender:{type:et(Function)},placeholder:String,title:String,filterable:Boolean,format:cc.format,filterMethod:cc.filterMethod,defaultChecked:cc.leftDefaultChecked,props:cc.props,virtualScroll:cc.virtualScroll,itemSize:cc.itemSize}),ise={[c_]:l_},sse=(s,C,i)=>{const p=Mh(s),y=t.computed(()=>s.data.filter(v=>Nr(s.filterMethod)?s.filterMethod(C.query,v):String(v[p.value.label]||v[p.value.key]).toLowerCase().includes(C.query.toLowerCase()))),A=t.computed(()=>y.value.filter(v=>!v[p.value.disabled])),h=t.computed(()=>{const v=C.checked.length,b=s.data.length,{noChecked:w,hasChecked:_}=s.format;return w&&_?v>0?_.replace(/\${checked}/g,v.toString()).replace(/\${total}/g,b.toString()):w.replace(/\${total}/g,b.toString()):`${v}/${b}`}),d=t.computed(()=>{const v=C.checked.length;return v>0&&v<A.value.length}),u=()=>{const v=A.value.map(b=>b[p.value.key]);C.allChecked=v.length>0&&v.every(b=>C.checked.includes(b))},c=v=>{C.checked=v?A.value.map(b=>b[p.value.key]):[]},f=t.ref(),{height:m}=$f(t.computed(()=>{var v;return(v=f.value)==null?void 0:v.$el})),g=t.ref();return t.watch(()=>C.checked,(v,b)=>{if(u(),C.checkChangeByUser){const w=v.concat(b).filter(_=>!v.includes(_)||!b.includes(_));i(c_,v,w)}else i(c_,v),C.checkChangeByUser=!0}),t.watch(A,()=>{u()}),t.watch(()=>s.data,()=>{const v=[],b=y.value.map(w=>w[p.value.key]);C.checked.forEach(w=>{b.includes(w)&&v.push(w)}),C.checkChangeByUser=!1,C.checked=v}),t.watch(()=>s.defaultChecked,(v,b)=>{if(b&&v.length===b.length&&v.every(x=>b.includes(x)))return;const w=[],_=A.value.map(x=>x[p.value.key]);v.forEach(x=>{_.includes(x)&&w.push(x)}),C.checkChangeByUser=!1,C.checked=w},{immediate:!0}),t.watch(()=>C.query,()=>{var v;s.virtualScroll&&((v=g.value)==null||v.scrollToItem(0))},{flush:"post"}),{filteredData:y,checkableData:A,checkedSummary:h,virtualListRef:g,isIndeterminate:d,checkboxGroupRef:f,virtualListHeight:m,updateAllChecked:u,handleAllCheckedChange:c}};var ose=t.defineComponent({name:"ElTransferPanel",__name:"transfer-panel",props:nse,emits:ise,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.useSlots(),h=({option:z})=>z,{t:d}=Yr(),u=zt("transfer"),c=t.reactive({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),f=Mh(p),{filteredData:m,checkedSummary:g,virtualListRef:v,isIndeterminate:b,checkboxGroupRef:w,virtualListHeight:_,handleAllCheckedChange:x}=sse(p,c,y),E=t.computed(()=>!Ys(c.query)&&Ys(m.value)),k=t.computed(()=>!Ys(A.default()[0].children)),{checked:P,allChecked:D,query:R}=t.toRefs(c);return C({query:R}),(z,F)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(u).b("panel"))},[t.createElementVNode("p",{class:t.normalizeClass(t.unref(u).be("panel","header"))},[t.createVNode(t.unref(sa),{modelValue:t.unref(D),"onUpdate:modelValue":F[0]||(F[0]=H=>t.isRef(D)?D.value=H:null),indeterminate:t.unref(b),"validate-event":!1,onChange:t.unref(x)},{default:t.withCtx(()=>[t.createElementVNode("span",{class:t.normalizeClass(t.unref(u).be("panel","header-title"))},t.toDisplayString(s.title),3),t.createElementVNode("span",{class:t.normalizeClass(t.unref(u).be("panel","header-count"))},t.toDisplayString(t.unref(g)),3)]),_:1},8,["modelValue","indeterminate","onChange"])],2),t.createElementVNode("div",{class:t.normalizeClass([t.unref(u).be("panel","body"),t.unref(u).is("with-footer",k.value)])},[s.filterable?(t.openBlock(),t.createBlock(t.unref(Ai),{key:0,modelValue:t.unref(R),"onUpdate:modelValue":F[1]||(F[1]=H=>t.isRef(R)?R.value=H:null),class:t.normalizeClass(t.unref(u).be("panel","filter")),size:"default",placeholder:s.placeholder,"prefix-icon":t.unref(Zt.Search),clearable:"","validate-event":!1},null,8,["modelValue","class","placeholder","prefix-icon"])):t.createCommentVNode("v-if",!0),t.withDirectives(t.createVNode(t.unref(iA),{ref_key:"checkboxGroupRef",ref:w,modelValue:t.unref(P),"onUpdate:modelValue":F[2]||(F[2]=H=>t.isRef(P)?P.value=H:null),"validate-event":!1,class:t.normalizeClass([t.unref(u).is("filterable",s.filterable),t.unref(u).be("panel","list")])},{default:t.withCtx(()=>[s.virtualScroll?(t.openBlock(),t.createBlock(t.unref(bh),{key:1,ref_key:"virtualListRef",ref:v,data:t.unref(m),total:t.unref(m).length,"item-size":s.itemSize,height:t.unref(_)},{default:t.withCtx(({data:H,index:$,style:K})=>[(t.openBlock(),t.createElementBlock("div",{key:H[$][t.unref(f).key],style:t.normalizeStyle(K)},[t.createVNode(t.unref(sa),{class:t.normalizeClass(t.unref(u).be("panel","item")),value:H[$][t.unref(f).key],disabled:H[$][t.unref(f).disabled],"validate-event":!1},{default:t.withCtx(()=>{var G;return[t.createVNode(h,{option:(G=s.optionRender)==null?void 0:G.call(s,H[$])},null,8,["option"])]}),_:2},1032,["class","value","disabled"])],4))]),_:1},8,["data","total","item-size","height"])):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(m),H=>(t.openBlock(),t.createBlock(t.unref(sa),{key:H[t.unref(f).key],class:t.normalizeClass(t.unref(u).be("panel","item")),value:H[t.unref(f).key],disabled:H[t.unref(f).disabled],"validate-event":!1},{default:t.withCtx(()=>{var $;return[t.createVNode(h,{option:($=s.optionRender)==null?void 0:$.call(s,H)},null,8,["option"])]}),_:2},1032,["class","value","disabled"]))),128))]),_:1},8,["modelValue","class"]),[[t.vShow,!E.value&&!t.unref(Ys)(s.data)]]),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(t.unref(u).be("panel","empty"))},[t.renderSlot(z.$slots,"empty",{},()=>[t.createTextVNode(t.toDisplayString(E.value?t.unref(d)("el.transfer.noMatch"):t.unref(d)("el.transfer.noData")),1)])],2),[[t.vShow,E.value||t.unref(Ys)(s.data)]])],2),k.value?(t.openBlock(),t.createElementBlock("p",{key:0,class:t.normalizeClass(t.unref(u).be("panel","footer"))},[t.renderSlot(z.$slots,"default")],2)):t.createCommentVNode("v-if",!0)],2))}}),BT=ose;const ase={key:0},lse={key:0};var cse=t.defineComponent({name:"ElTransfer",__name:"transfer",props:cc,emits:qie,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.useSlots(),{t:h}=Yr(),d=zt("transfer"),{formItem:u}=ls(),c=t.reactive({leftChecked:[],rightChecked:[]}),f=Mh(p),{sourceData:m,targetData:g}=tse(p),{onSourceCheckedChange:v,onTargetCheckedChange:b}=ese(c,y),{addToLeft:w,addToRight:_}=rse(p,c,y),x=t.ref(),E=t.ref(),k=H=>{switch(H){case"left":x.value.query="";break;case"right":E.value.query=""}},P=t.computed(()=>p.buttonTexts.length===2),D=t.computed(()=>p.titles[0]||h("el.transfer.titles.0")),R=t.computed(()=>p.titles[1]||h("el.transfer.titles.1")),z=t.computed(()=>p.filterPlaceholder||h("el.transfer.filterPlaceholder"));t.watch(()=>p.modelValue,()=>{var H;p.validateEvent&&((H=u==null?void 0:u.validate)==null||H.call(u,"change").catch(Xr))});const F=t.computed(()=>H=>{var K;if(p.renderContent)return p.renderContent(t.h,H);const $=(((K=A.default)==null?void 0:K.call(A,{option:H}))||[]).filter(G=>G.type!==t.Comment);return $.length?$:t.h("span",H[f.value.label]||H[f.value.key])});return C({clearQuery:k,leftPanel:x,rightPanel:E}),(H,$)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(d).b())},[t.createVNode(BT,{ref_key:"leftPanel",ref:x,data:t.unref(m),"option-render":F.value,placeholder:z.value,title:D.value,filterable:s.filterable,format:s.format,"filter-method":s.filterMethod,"default-checked":s.leftDefaultChecked,props:p.props,"virtual-scroll":s.virtualScroll,"item-size":s.itemSize,onCheckedChange:t.unref(v)},{empty:t.withCtx(()=>[t.renderSlot(H.$slots,"left-empty")]),default:t.withCtx(()=>[t.renderSlot(H.$slots,"left-footer")]),_:3},8,["data","option-render","placeholder","title","filterable","format","filter-method","default-checked","props","virtual-scroll","item-size","onCheckedChange"]),t.createElementVNode("div",{class:t.normalizeClass(t.unref(d).e("buttons"))},[t.createVNode(t.unref(gs),{type:"primary",class:t.normalizeClass([t.unref(d).e("button"),t.unref(d).is("with-texts",P.value)]),disabled:t.unref(Ys)(c.rightChecked),onClick:t.unref(w)},{default:t.withCtx(()=>[t.createVNode(t.unref(ir),null,{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.ArrowLeft))]),_:1}),t.unref(en)(s.buttonTexts[0])?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",ase,t.toDisplayString(s.buttonTexts[0]),1))]),_:1},8,["class","disabled","onClick"]),t.createVNode(t.unref(gs),{type:"primary",class:t.normalizeClass([t.unref(d).e("button"),t.unref(d).is("with-texts",P.value)]),disabled:t.unref(Ys)(c.leftChecked),onClick:t.unref(_)},{default:t.withCtx(()=>[t.unref(en)(s.buttonTexts[1])?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",lse,t.toDisplayString(s.buttonTexts[1]),1)),t.createVNode(t.unref(ir),null,{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.ArrowRight))]),_:1})]),_:1},8,["class","disabled","onClick"])],2),t.createVNode(BT,{ref_key:"rightPanel",ref:E,data:t.unref(g),"option-render":F.value,placeholder:z.value,filterable:s.filterable,format:s.format,"filter-method":s.filterMethod,title:R.value,"default-checked":s.rightDefaultChecked,props:p.props,"virtual-scroll":s.virtualScroll,"item-size":s.itemSize,onCheckedChange:t.unref(b)},{empty:t.withCtx(()=>[t.renderSlot(H.$slots,"right-empty")]),default:t.withCtx(()=>[t.renderSlot(H.$slots,"right-footer")]),_:3},8,["data","option-render","placeholder","filterable","format","filter-method","title","default-checked","props","virtual-scroll","item-size","onCheckedChange"])],2))}}),use=cse;Tr(use);const u_="RootTree",ST="NodeInstance",kT="TreeNodeMap",PT=Wt({data:{type:et(Array),default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkOnClickLeaf:{type:Boolean,default:!0},checkDescendants:Boolean,autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array},defaultExpandedKeys:{type:Array},currentNodeKey:{type:[String,Number]},renderContent:{type:et(Function)},showCheckbox:Boolean,draggable:Boolean,allowDrag:{type:et(Function)},allowDrop:{type:et(Function)},props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:Boolean,highlightCurrent:Boolean,load:{type:Function},filterNodeMethod:{type:Function},accordion:Boolean,indent:{type:Number,default:18},icon:{type:Pn}}),dse={"check-change":(s,C,i)=>s&&Bn(C)&&Bn(i),"current-change":(s,C)=>!0,"node-click":(s,C,i,p)=>s&&C&&p instanceof Event,"node-contextmenu":(s,C,i,p)=>s instanceof Event&&C&&i,"node-collapse":(s,C,i)=>s&&C,"node-expand":(s,C,i)=>s&&C,check:(s,C)=>s&&C,"node-drag-start":(s,C)=>s&&C,"node-drag-end":(s,C,i,p)=>s&&p,"node-drop":(s,C,i,p)=>s&&C&&p,"node-drag-leave":(s,C,i)=>s&&C&&i,"node-drag-enter":(s,C,i)=>s&&C&&i,"node-drag-over":(s,C,i)=>s&&C&&i},MT="$treeNodeId",TT=function(s,C){!C||C.$treeNodeId||Object.defineProperty(C,MT,{value:s.id,enumerable:!1,configurable:!1,writable:!1})},d_=(s,C)=>C==null?void 0:C[s||"$treeNodeId"],f_=(s,C,i)=>{const p=s.value.currentNode;i();const y=s.value.currentNode;p!==y&&C("current-change",y?y.data:null,y)},IT=s=>{let C=!0,i=!0,p=!0,y=!0;for(let A=0,h=s.length;A<h;A++){const d=s[A];(d.checked!==!0||d.indeterminate)&&(C=!1,d.disabled||(p=!1)),(d.checked!==!1||d.indeterminate)&&(i=!1),d.isEffectivelyChecked||(y=!1)}return{all:C,none:i,allWithoutDisable:p,half:!C&&!i,isEffectivelyChecked:y}},Th=function(s){if(s.childNodes.length===0||s.loading){s.isEffectivelyChecked=s.disabled||s.checked;return}const{all:C,none:i,half:p,isEffectivelyChecked:y}=IT(s.childNodes);s.isEffectivelyChecked=y,C?(s.checked=!0,s.indeterminate=!1):p?(s.checked=!1,s.indeterminate=!0):i&&(s.checked=!1,s.indeterminate=!1);const A=s.parent;!A||A.level===0||s.store.checkStrictly||Th(A)},kA=function(s,C){const i=s.store.props,p=s.data||{},y=i[C];if(Nr(y))return y(p,s);if(Ar(y))return p[y];if(en(y)){const A=p[C];return en(A)?"":A}},h_=function(s,C){s.forEach(i=>{i.canFocus=C,h_(i.childNodes,C)})};let fse=0;var p_=class r0{constructor(C){this.isLeafByUser=void 0,this.isLeaf=void 0,this.isEffectivelyChecked=!1,this.id=fse++,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 i in C)Xi(C,i)&&(this[i]=C[i]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){var A;const C=this.store;if(!C)throw new Error("[Node]store is required!");C.registerNode(this);const i=C.props;if(i&&typeof i.isLeaf<"u"){const h=kA(this,"isLeaf");Bn(h)&&(this.isLeafByUser=h)}if(C.lazy!==!0&&this.data?(this.setData(this.data),C.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&C.lazy&&C.defaultExpandAll&&!this.isLeafByUser&&this.expand(),nr(this.data)||TT(this,this.data),!this.data)return;const p=C.defaultExpandedKeys,y=C.key;y&&!yi(this.key)&&p&&p.includes(this.key)&&this.expand(null,C.autoExpandParent),y&&C.currentNodeKey!==void 0&&this.key===C.currentNodeKey&&(C.currentNode&&(C.currentNode.isCurrent=!1),C.currentNode=this,C.currentNode.isCurrent=!0),C.lazy&&C._initDefaultCheckedNode(this),this.updateLeafState(),(this.level===1||((A=this.parent)==null?void 0:A.expanded)===!0)&&(this.canFocus=!0)}setData(C){nr(C)||TT(this,C),this.data=C,this.childNodes=[];let i;this.level===0&&nr(this.data)?i=this.data:i=kA(this,"children")||[];for(let p=0,y=i.length;p<y;p++)this.insertChild({data:i[p]})}get label(){return kA(this,"label")}get key(){const C=this.store.key;return this.data?this.data[C]:null}get disabled(){return kA(this,"disabled")}get nextSibling(){const C=this.parent;if(C){const i=C.childNodes.indexOf(this);if(i>-1)return C.childNodes[i+1]}return null}get previousSibling(){const C=this.parent;if(C){const i=C.childNodes.indexOf(this);if(i>-1)return i>0?C.childNodes[i-1]:null}return null}contains(C,i=!0){return(this.childNodes||[]).some(p=>p===C||i&&p.contains(C))}remove(){const C=this.parent;C&&C.removeChild(this)}insertChild(C,i,p){if(!C)throw new Error("InsertChild error: child is required.");if(!(C instanceof r0)){if(!p){const y=this.getChildren(!0);y!=null&&y.includes(C.data)||(en(i)||i<0?y==null||y.push(C.data):y==null||y.splice(i,0,C.data))}Object.assign(C,{parent:this,store:this.store}),C=t.reactive(new r0(C)),C instanceof r0&&C.initialize()}C.level=this.level+1,en(i)||i<0?this.childNodes.push(C):this.childNodes.splice(i,0,C),this.updateLeafState()}insertBefore(C,i){let p;i&&(p=this.childNodes.indexOf(i)),this.insertChild(C,p)}insertAfter(C,i){let p;i&&(p=this.childNodes.indexOf(i),p!==-1&&(p+=1)),this.insertChild(C,p)}removeChild(C){const i=this.getChildren()||[],p=i.indexOf(C.data);p>-1&&i.splice(p,1);const y=this.childNodes.indexOf(C);y>-1&&(this.store&&this.store.deregisterNode(C),C.parent=null,this.childNodes.splice(y,1)),this.updateLeafState()}removeChildByData(C){const i=this.childNodes.find(p=>p.data===C);i&&this.removeChild(i)}expand(C,i){const p=()=>{if(i){let y=this.parent;for(;y&&y.level>0;)y.expanded=!0,y=y.parent}this.expanded=!0,C&&C(),h_(this.childNodes,!0)};this.shouldLoadData()?this.loadData(y=>{nr(y)&&(this.store.checkStrictly||(this.checked?this.setChecked(!0,!0):Th(this)),p())}):p()}doCreateChildren(C,i={}){C.forEach(p=>{this.insertChild(Object.assign({data:p},i),void 0,!0)})}collapse(){this.expanded=!1,h_(this.childNodes,!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,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}const C=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!C||C.length===0,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}this.isLeaf=!1}setChecked(C,i,p,y){if(this.indeterminate=C==="half",this.checked=C===!0,this.isEffectivelyChecked=!this.childNodes.length&&(this.disabled||this.checked),this.store.checkStrictly&&!i)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const h=()=>{if(i){const d=this.childNodes;for(let m=0,g=d.length;m<g;m++){const v=d[m];y=y||C!==!1;const b=v.disabled&&v.isLeaf?v.checked:y;v.setChecked(b,i,!0,y)}const{half:u,all:c,isEffectivelyChecked:f}=IT(d);c||(this.checked=c,this.indeterminate=u),this.isEffectivelyChecked=this.childNodes.length?f:this.disabled||this.checked}};if(this.shouldLoadData()){this.loadData(()=>{h(),Th(this)},{checked:C!==!1});return}else h()}const A=this.parent;!A||A.level===0||!p&&!this.store.checkStrictly&&Th(A)}getChildren(C=!1){if(this.level===0)return this.data;const i=this.data;if(!i)return null;const p=this.store.props;let y="children";return p&&(y=p.children||"children"),en(i[y])&&(i[y]=null),C&&!i[y]&&(i[y]=[]),i[y]}updateChildren(){const C=this.getChildren()||[],i=this.childNodes.map(A=>A.data),p={},y=[];C.forEach((A,h)=>{const d=A[MT];d&&i.some(u=>(u==null?void 0:u.$treeNodeId)===d)?p[d]={index:h,data:A}:y.push({index:h,data:A})}),this.store.lazy||i.forEach(A=>{p[A==null?void 0:A.$treeNodeId]||this.removeChildByData(A)}),y.forEach(({index:A,data:h})=>{this.insertChild({data:h},A)}),this.updateLeafState()}loadData(C,i={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(i).length)){this.loading=!0;const p=A=>{this.childNodes=[],this.doCreateChildren(A,i),this.loaded=!0,this.loading=!1,this.updateLeafState(),C&&C.call(this,A)},y=()=>{this.loading=!1};this.store.load(this,p,y)}else C&&C.call(this)}eachNode(C){const i=[this];for(;i.length;){const p=i.shift();i.unshift(...p.childNodes),C(p)}}reInitChecked(){this.store.checkStrictly||Th(this)}},hse=class{constructor(s){this.lazy=!1,this.checkStrictly=!1,this.autoExpandParent=!1,this.defaultExpandAll=!1,this.checkDescendants=!1,this.currentNode=null,this.currentNodeKey=null;for(const C in s)Xi(s,C)&&(this[C]=s[C]);this.nodesMap={}}initialize(){if(this.root=new p_({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const s=this.load;s(this.root,C=>{this.root.doCreateChildren(C),this._initDefaultCheckedNodes()},Xr)}else this._initDefaultCheckedNodes()}filter(s){const C=this.filterNodeMethod,i=this.lazy,p=async function(y){const A=y.root?y.root.childNodes:y.childNodes;for(const[h,d]of A.entries())d.visible=!!(C!=null&&C.call(d,s,d.data,d)),h%80===0&&h>0&&await t.nextTick(),await p(d);if(!y.visible&&A.length){let h=!0;h=!A.some(d=>d.visible),y.root?y.root.visible=h===!1:y.visible=h===!1}s&&y.visible&&!y.isLeaf&&(!i||y.loaded)&&y.expand()};p(this)}setData(s){s!==this.root.data?(this.nodesMap={},this.root.setData(s),this._initDefaultCheckedNodes(),this.setCurrentNodeKey(this.currentNodeKey)):this.root.updateChildren()}getNode(s){if(s instanceof p_)return s;const C=mn(s)?d_(this.key,s):s;return this.nodesMap[C]||null}insertBefore(s,C){var p;const i=this.getNode(C);(p=i.parent)==null||p.insertBefore({data:s},i)}insertAfter(s,C){var p;const i=this.getNode(C);(p=i.parent)==null||p.insertAfter({data:s},i)}remove(s){const C=this.getNode(s);C&&C.parent&&(C===this.currentNode&&(this.currentNode=null),C.parent.removeChild(C))}append(s,C){const i=Mo(C)?this.root:this.getNode(C);i&&i.insertChild({data:s})}_initDefaultCheckedNodes(){const s=this.defaultCheckedKeys||[],C=this.nodesMap;s.forEach(i=>{const p=C[i];p&&p.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(s){const C=this.defaultCheckedKeys||[];!yi(s.key)&&C.includes(s.key)&&s.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(s){s!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=s,this._initDefaultCheckedNodes())}registerNode(s){const C=this.key;if(!(!s||!s.data))if(!C)this.nodesMap[s.id]=s;else{const i=s.key;yi(i)||(this.nodesMap[i]=s)}}deregisterNode(s){!this.key||!s||!s.data||(s.childNodes.forEach(C=>{this.deregisterNode(C)}),delete this.nodesMap[s.key])}getCheckedNodes(s=!1,C=!1){const i=[],p=function(y){(y.root?y.root.childNodes:y.childNodes).forEach(A=>{(A.checked||C&&A.indeterminate)&&(!s||s&&A.isLeaf)&&i.push(A.data),p(A)})};return p(this),i}getCheckedKeys(s=!1){return this.getCheckedNodes(s).map(C=>(C||{})[this.key])}getHalfCheckedNodes(){const s=[],C=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(p=>{p.indeterminate&&s.push(p.data),C(p)})};return C(this),s}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(s=>(s||{})[this.key])}_getAllNodes(){const s=[],C=this.nodesMap;for(const i in C)Xi(C,i)&&s.push(C[i]);return s}updateChildren(s,C){const i=this.nodesMap[s];if(!i)return;const p=i.childNodes;for(let y=p.length-1;y>=0;y--){const A=p[y];this.remove(A.data)}for(let y=0,A=C.length;y<A;y++){const h=C[y];this.append(h,i.data)}}_setCheckedKeys(s,C=!1,i){const p=this._getAllNodes().sort((d,u)=>d.level-u.level),y=Object.create(null),A=Object.keys(i);p.forEach(d=>d.setChecked(!1,!1));const h=d=>{d.childNodes.forEach(u=>{var c;y[u.data[s]]=!0,(c=u.childNodes)!=null&&c.length&&h(u)})};for(let d=0,u=p.length;d<u;d++){const c=p[d],f=c.data[s].toString();if(!A.includes(f)){c.checked&&!y[f]&&c.setChecked(!1,!1);continue}if(c.childNodes.length&&h(c),c.isLeaf||this.checkStrictly){c.setChecked(!0,!1);continue}if(c.setChecked(!0,!0),C){c.setChecked(!1,!1,!0);const m=function(g){g.childNodes.forEach(v=>{v.isLeaf||v.setChecked(!1,!1,!0),m(v)}),g.reInitChecked()};m(c)}}}setCheckedNodes(s,C=!1){const i=this.key,p={};s.forEach(y=>{p[(y||{})[i]]=!0}),this._setCheckedKeys(i,C,p)}setCheckedKeys(s,C=!1){this.defaultCheckedKeys=s;const i=this.key,p={};s.forEach(y=>{p[y]=!0}),this._setCheckedKeys(i,C,p)}setDefaultExpandedKeys(s){s=s||[],this.defaultExpandedKeys=s,s.forEach(C=>{const i=this.getNode(C);i&&i.expand(null,this.autoExpandParent)})}setChecked(s,C,i){const p=this.getNode(s);p&&p.setChecked(!!C,i)}getCurrentNode(){return this.currentNode}setCurrentNode(s){const C=this.currentNode;C&&(C.isCurrent=!1),this.currentNode=s,this.currentNode.isCurrent=!0}setUserCurrentNode(s,C=!0){var y;const i=s[this.key],p=this.nodesMap[i];this.setCurrentNode(p),C&&this.currentNode&&this.currentNode.level>1&&((y=this.currentNode.parent)==null||y.expand(null,!0))}setCurrentNodeKey(s,C=!0){var p;if(this.currentNodeKey=s,Mo(s)){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const i=this.getNode(s);i&&(this.setCurrentNode(i),C&&this.currentNode&&this.currentNode.level>1&&((p=this.currentNode.parent)==null||p.expand(null,!0)))}};function DT(s){const C=t.inject(kT,null);let i={treeNodeExpand:p=>{var y;s.node!==p&&((y=s.node)==null||y.collapse())},children:new Set};return C&&C.children.add(i),t.onBeforeUnmount(()=>{C&&C.children.delete(i),i=null}),t.provide(kT,i),{broadcastExpanded:p=>{if(s.accordion)for(const y of i.children)y.treeNodeExpand(p)}}}const RT=Symbol("dragEvents");function pse({props:s,ctx:C,el$:i,dropIndicator$:p,store:y}){const A=zt("tree"),h=t.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),d=({event:f,treeNode:m})=>{if(f.dataTransfer){if(Nr(s.allowDrag)&&!s.allowDrag(m.node))return f.preventDefault(),!1;f.dataTransfer.effectAllowed="move";try{f.dataTransfer.setData("text/plain","")}catch{}h.value.draggingNode=m,C.emit("node-drag-start",m.node,f)}},u=({event:f,treeNode:m})=>{if(!f.dataTransfer)return;const g=m,v=h.value.dropNode;v&&v.node.id!==g.node.id&&js(v.$el,A.is("drop-inner"));const b=h.value.draggingNode;if(!b||!g)return;let w=!0,_=!0,x=!0,E=!0;Nr(s.allowDrop)&&(w=s.allowDrop(b.node,g.node,"prev"),E=_=s.allowDrop(b.node,g.node,"inner"),x=s.allowDrop(b.node,g.node,"next")),f.dataTransfer.dropEffect=_||w||x?"move":"none",(w||_||x)&&(v==null?void 0:v.node.id)!==g.node.id&&(v&&C.emit("node-drag-leave",b.node,v.node,f),C.emit("node-drag-enter",b.node,g.node,f)),w||_||x?h.value.dropNode=g:h.value.dropNode=null,g.node.nextSibling===b.node&&(x=!1),g.node.previousSibling===b.node&&(w=!1),g.node.contains(b.node,!1)&&(_=!1),(b.node===g.node||b.node.contains(g.node))&&(w=!1,_=!1,x=!1);const k=g.$el,P=k.querySelector(`.${A.be("node","content")}`).getBoundingClientRect(),D=i.value.getBoundingClientRect(),R=i.value.scrollTop;let z;const F=w?_?.25:x?.45:1:Number.NEGATIVE_INFINITY,H=x?_?.75:w?.55:0:Number.POSITIVE_INFINITY;let $=-9999;const K=f.clientY-P.top;K<P.height*F?z="before":K>P.height*H?z="after":_?z="inner":z="none";const G=k.querySelector(`.${A.be("node","expand-icon")}`).getBoundingClientRect(),j=p.value;z==="before"?$=G.top-D.top+R:z==="after"&&($=G.bottom-D.top+R),j.style.top=`${$}px`,j.style.left=`${G.right-D.left}px`,z==="inner"?Zo(k,A.is("drop-inner")):js(k,A.is("drop-inner")),h.value.showDropIndicator=z==="before"||z==="after",h.value.allowDrop=h.value.showDropIndicator||E,h.value.dropType=z,C.emit("node-drag-over",b.node,g.node,f)},c=f=>{var b,w;const{draggingNode:m,dropType:g,dropNode:v}=h.value;if(f.preventDefault(),f.dataTransfer&&(f.dataTransfer.dropEffect="move"),m!=null&&m.node.data&&v){const _={data:m.node.data};g!=="none"&&m.node.remove(),g==="before"?(b=v.node.parent)==null||b.insertBefore(_,v.node):g==="after"?(w=v.node.parent)==null||w.insertAfter(_,v.node):g==="inner"&&v.node.insertChild(_),g!=="none"&&(y.value.registerNode(_),y.value.key&&m.node.eachNode(x=>{var E;(E=y.value.nodesMap[x.data[y.value.key]])==null||E.setChecked(x.checked,!y.value.checkStrictly)})),js(v.$el,A.is("drop-inner")),C.emit("node-drag-end",m.node,v.node,g,f),g!=="none"&&C.emit("node-drop",m.node,v.node,g,f)}m&&!v&&C.emit("node-drag-end",m.node,null,g,f),h.value.showDropIndicator=!1,h.value.draggingNode=null,h.value.dropNode=null,h.value.allowDrop=!0};return t.provide(RT,{treeNodeDragStart:d,treeNodeDragOver:u,treeNodeDragEnd:c}),{dragState:h}}var mse=t.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(s){const C=zt("tree"),i=t.inject(ST),p=t.inject(u_);return()=>{const y=s.node,{data:A,store:h}=y;return s.renderContent?s.renderContent(t.h,{_self:i,node:y,data:A,store:h}):t.renderSlot(p.ctx.slots,"default",{node:y,data:A},()=>[t.h(gT,{tag:"span",truncated:!0,class:C.be("node","label")},()=>[y.label])])}}}),Ase=mse,gse=t.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:yb,ElCheckbox:sa,NodeContent:Ase,ElIcon:ir,Loading:Zt.Loading},props:{node:{type:p_,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:Boolean},emits:["node-expand"],setup(s,C){const i=zt("tree"),{broadcastExpanded:p}=DT(s),y=t.inject(u_),A=t.ref(!1),h=t.ref(!1),d=t.ref(),u=t.ref(),c=t.ref(),f=t.inject(RT),m=t.getCurrentInstance();t.provide(ST,m),y||wn("Tree","Can not find node's tree."),s.node.expanded&&(A.value=!0,h.value=!0);const g=y.props.props.children||"children";t.watch(()=>{var $;const H=($=s.node.data)==null?void 0:$[g];return H&&[...H]},()=>{s.node.updateChildren()}),t.watch(()=>s.node.indeterminate,H=>{w(s.node.checked,H)}),t.watch(()=>s.node.checked,H=>{w(H,s.node.indeterminate)}),t.watch(()=>s.node.childNodes.length,()=>s.node.reInitChecked()),t.watch(()=>s.node.expanded,H=>{t.nextTick(()=>A.value=H),H&&(h.value=!0)});const v=H=>y.props.nodeKey?d_(y.props.nodeKey,H.data):H.id,b=H=>{const $=s.props.class;if(!$)return{};let K;if(Nr($)){const{data:G}=H;K=$(G,H)}else K=$;return Ar(K)?{[K]:!0}:K},w=(H,$)=>{(d.value!==H||u.value!==$)&&y.ctx.emit("check-change",s.node.data,H,$),d.value=H,u.value=$},_=H=>{f_(y.store,y.ctx.emit,()=>{var $;if(($=y==null?void 0:y.props)!=null&&$.nodeKey){const K=v(s.node);y.store.value.setCurrentNodeKey(K)}else y.store.value.setCurrentNode(s.node)}),y.currentNode.value=s.node,y.props.expandOnClickNode&&E(),(y.props.checkOnClickNode||s.node.isLeaf&&y.props.checkOnClickLeaf&&s.showCheckbox)&&!s.node.disabled&&k(!s.node.checked),y.ctx.emit("node-click",s.node.data,s.node,m,H)},x=H=>{var $;($=y.instance.vnode.props)!=null&&$.onNodeContextmenu&&(H.stopPropagation(),H.preventDefault()),y.ctx.emit("node-contextmenu",H,s.node.data,s.node,m)},E=()=>{s.node.isLeaf||(A.value?(y.ctx.emit("node-collapse",s.node.data,s.node,m),s.node.collapse()):s.node.expand(()=>{C.emit("node-expand",s.node.data,s.node,m)}))},k=H=>{const $=y==null?void 0:y.props.checkStrictly,K=s.node.childNodes;!$&&K.length&&(H=K.some(G=>!G.isEffectivelyChecked)),s.node.setChecked(H,!$),t.nextTick(()=>{const G=y.store.value;y.ctx.emit("check",s.node.data,{checkedNodes:G.getCheckedNodes(),checkedKeys:G.getCheckedKeys(),halfCheckedNodes:G.getHalfCheckedNodes(),halfCheckedKeys:G.getHalfCheckedKeys()})})};return{ns:i,node$:c,tree:y,expanded:A,childNodeRendered:h,oldChecked:d,oldIndeterminate:u,getNodeKey:v,getNodeClass:b,handleSelectChange:w,handleClick:_,handleContextMenu:x,handleExpandIconClick:E,handleCheckChange:k,handleChildNodeExpand:(H,$,K)=>{p($),y.ctx.emit("node-expand",H,$,K)},handleDragStart:H=>{y.props.draggable&&f.treeNodeDragStart({event:H,treeNode:s})},handleDragOver:H=>{H.preventDefault(),y.props.draggable&&f.treeNodeDragOver({event:H,treeNode:{$el:c.value,node:s.node}})},handleDrop:H=>{H.preventDefault()},handleDragEnd:H=>{y.props.draggable&&f.treeNodeDragEnd(H)},CaretRight:Zt.CaretRight}}});const vse=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],yse=["aria-expanded"];function bse(s,C,i,p,y,A){const h=t.resolveComponent("el-icon"),d=t.resolveComponent("el-checkbox"),u=t.resolveComponent("loading"),c=t.resolveComponent("node-content"),f=t.resolveComponent("el-tree-node"),m=t.resolveComponent("el-collapse-transition");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref:"node$",class:t.normalizeClass([s.ns.b("node"),s.ns.is("expanded",s.expanded),s.ns.is("current",s.node.isCurrent),s.ns.is("hidden",!s.node.visible),s.ns.is("focusable",!s.node.disabled),s.ns.is("checked",!s.node.disabled&&s.node.checked),s.getNodeClass(s.node)]),role:"treeitem",tabindex:"-1","aria-expanded":s.expanded,"aria-disabled":s.node.disabled,"aria-checked":s.node.checked,draggable:s.tree.props.draggable,"data-key":s.getNodeKey(s.node),onClick:C[2]||(C[2]=t.withModifiers((...g)=>s.handleClick&&s.handleClick(...g),["stop"])),onContextmenu:C[3]||(C[3]=(...g)=>s.handleContextMenu&&s.handleContextMenu(...g)),onDragstart:C[4]||(C[4]=t.withModifiers((...g)=>s.handleDragStart&&s.handleDragStart(...g),["stop"])),onDragover:C[5]||(C[5]=t.withModifiers((...g)=>s.handleDragOver&&s.handleDragOver(...g),["stop"])),onDragend:C[6]||(C[6]=t.withModifiers((...g)=>s.handleDragEnd&&s.handleDragEnd(...g),["stop"])),onDrop:C[7]||(C[7]=t.withModifiers((...g)=>s.handleDrop&&s.handleDrop(...g),["stop"]))},[t.createElementVNode("div",{class:t.normalizeClass(s.ns.be("node","content")),style:t.normalizeStyle({paddingLeft:(s.node.level-1)*s.tree.props.indent+"px"})},[s.tree.props.icon||s.CaretRight?(t.openBlock(),t.createBlock(h,{key:0,class:t.normalizeClass([s.ns.be("node","expand-icon"),s.ns.is("leaf",s.node.isLeaf),{expanded:!s.node.isLeaf&&s.expanded}]),onClick:t.withModifiers(s.handleExpandIconClick,["stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.tree.props.icon||s.CaretRight)))]),_:1},8,["class","onClick"])):t.createCommentVNode("v-if",!0),s.showCheckbox?(t.openBlock(),t.createBlock(d,{key:1,"model-value":s.node.checked,indeterminate:s.node.indeterminate,disabled:!!s.node.disabled,onClick:C[0]||(C[0]=t.withModifiers(()=>{},["stop"])),onChange:s.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):t.createCommentVNode("v-if",!0),s.node.loading?(t.openBlock(),t.createBlock(h,{key:2,class:t.normalizeClass([s.ns.be("node","loading-icon"),s.ns.is("loading")])},{default:t.withCtx(()=>[t.createVNode(u)]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),t.createVNode(c,{node:s.node,"render-content":s.renderContent},null,8,["node","render-content"])],6),t.createVNode(m,null,{default:t.withCtx(()=>[!s.renderAfterExpand||s.childNodeRendered?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(s.ns.be("node","children")),role:"group","aria-expanded":s.expanded,onClick:C[1]||(C[1]=t.withModifiers(()=>{},["stop"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.node.childNodes,g=>(t.openBlock(),t.createBlock(f,{key:s.getNodeKey(g),"render-content":s.renderContent,"render-after-expand":s.renderAfterExpand,"show-checkbox":s.showCheckbox,node:g,accordion:s.accordion,props:s.props,onNodeExpand:s.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,yse)),[[t.vShow,s.expanded]]):t.createCommentVNode("v-if",!0)]),_:1})],42,vse)),[[t.vShow,s.node.visible]])}var _se=Yi(gse,[["render",bse]]);function wse({el$:s},C){const i=zt("tree");t.onMounted(()=>{A()}),t.onUpdated(()=>{var h;(h=s.value)==null||h.querySelectorAll("input[type=checkbox]").forEach(d=>{d.setAttribute("tabindex","-1")})});function p(h,d){var c,f;const u=C.value.getNode(h[d].dataset.key);return u.canFocus&&u.visible&&(((c=u.parent)==null?void 0:c.expanded)||((f=u.parent)==null?void 0:f.level)===0)}vn(s,"keydown",h=>{const d=h.target;if(!d.className.includes(i.b("node")))return;const u=Dn(h),c=Array.from(s.value.querySelectorAll(`.${i.is("focusable")}[role=treeitem]`)),f=c.indexOf(d);let m;if([Gt.up,Gt.down].includes(u)){if(h.preventDefault(),u===Gt.up){m=f===-1?0:f!==0?f-1:c.length-1;const v=m;for(;!p(c,m);){if(m--,m===v){m=-1;break}m<0&&(m=c.length-1)}}else{m=f===-1?0:f<c.length-1?f+1:0;const v=m;for(;!p(c,m);){if(m++,m===v){m=-1;break}m>=c.length&&(m=0)}}m!==-1&&c[m].focus()}[Gt.left,Gt.right].includes(u)&&(h.preventDefault(),d.click());const g=d.querySelector('[type="checkbox"]');[Gt.enter,Gt.numpadEnter,Gt.space].includes(u)&&g&&(h.preventDefault(),g.click())});const A=()=>{var u;if(!s.value)return;const h=Array.from(s.value.querySelectorAll(`.${i.is("focusable")}[role=treeitem]`));Array.from(s.value.querySelectorAll("input[type=checkbox]")).forEach(c=>{c.setAttribute("tabindex","-1")});const d=s.value.querySelectorAll(`.${i.is("checked")}[role=treeitem]`);if(d.length){d[0].setAttribute("tabindex","0");return}(u=h[0])==null||u.setAttribute("tabindex","0")}}var Cse=t.defineComponent({name:"ElTree",components:{ElTreeNode:_se},props:PT,emits:dse,setup(s,C){const{t:i}=Yr(),p=zt("tree"),y=t.ref(new hse({key:s.nodeKey,data:s.data,lazy:s.lazy,props:s.props,load:s.load,currentNodeKey:s.currentNodeKey,checkStrictly:s.checkStrictly,checkDescendants:s.checkDescendants,defaultCheckedKeys:s.defaultCheckedKeys,defaultExpandedKeys:s.defaultExpandedKeys,autoExpandParent:s.autoExpandParent,defaultExpandAll:s.defaultExpandAll,filterNodeMethod:s.filterNodeMethod}));y.value.initialize();const A=t.ref(y.value.root),h=t.ref(null),d=t.ref(null),u=t.ref(null),{broadcastExpanded:c}=DT(s),{dragState:f}=pse({props:s,ctx:C,el$:d,dropIndicator$:u,store:y});wse({el$:d},y);const m=t.getCurrentInstance(),g=t.computed(()=>{let W=m==null?void 0:m.parent;for(;W;){if(W.type.name==="ElTreeSelect")return!0;W=W.parent}return!1}),v=t.computed(()=>{const{childNodes:W}=A.value;return(!W||W.length===0||W.every(({visible:Z})=>!Z))&&!g.value});t.watch(()=>s.currentNodeKey,W=>{y.value.setCurrentNodeKey(W??null)}),t.watch(()=>s.defaultCheckedKeys,(W,Z)=>{hi(W,Z)||y.value.setDefaultCheckedKey(W??[])}),t.watch(()=>s.defaultExpandedKeys,W=>{y.value.setDefaultExpandedKeys(W??[])}),t.watch(()=>s.data,W=>{y.value.setData(W)},{deep:!0}),t.watch(()=>s.checkStrictly,W=>{y.value.checkStrictly=W});const b=W=>{if(!s.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");y.value.filter(W)},w=W=>s.nodeKey?d_(s.nodeKey,W.data):W.id,_=W=>{if(!s.nodeKey)throw new Error(`[Tree] nodeKey is required in ${W}`)},x=W=>{_("getNodePath");const Z=y.value.getNode(W);if(!Z)return[];const J=[Z.data];let ne=Z.parent;for(;ne&&ne!==A.value;)J.push(ne.data),ne=ne.parent;return J.reverse()},E=(W,Z)=>y.value.getCheckedNodes(W,Z),k=W=>y.value.getCheckedKeys(W),P=()=>{const W=y.value.getCurrentNode();return W?W.data:null},D=()=>{_("getCurrentKey");const W=P();return W?W[s.nodeKey]:null},R=(W,Z)=>{_("setCheckedNodes"),y.value.setCheckedNodes(W,Z)},z=(W,Z)=>{_("setCheckedKeys"),y.value.setCheckedKeys(W,Z)},F=(W,Z,J=!1)=>{y.value.setChecked(W,Z,J)},H=()=>y.value.getHalfCheckedNodes(),$=()=>y.value.getHalfCheckedKeys(),K=(W,Z=!0)=>{_("setCurrentNode"),f_(y,C.emit,()=>{c(W),y.value.setUserCurrentNode(W,Z)})},G=(W=null,Z=!0)=>{_("setCurrentKey"),f_(y,C.emit,()=>{c(),y.value.setCurrentNodeKey(W,Z)})},j=W=>y.value.getNode(W),N=W=>{y.value.remove(W)},I=(W,Z)=>{y.value.append(W,Z)},L=(W,Z)=>{y.value.insertBefore(W,Z)},U=(W,Z)=>{y.value.insertAfter(W,Z)},O=(W,Z,J)=>{c(Z),C.emit("node-expand",W,Z,J)},Q=(W,Z)=>{_("updateKeyChildren"),y.value.updateChildren(W,Z)};return t.provide(u_,{ctx:C,props:s,store:y,root:A,currentNode:h,instance:m}),t.provide(za,void 0),{ns:p,store:y,root:A,currentNode:h,dragState:f,el$:d,dropIndicator$:u,isEmpty:v,filter:b,getNodeKey:w,getNodePath:x,getCheckedNodes:E,getCheckedKeys:k,getCurrentNode:P,getCurrentKey:D,setCheckedNodes:R,setCheckedKeys:z,setChecked:F,getHalfCheckedNodes:H,getHalfCheckedKeys:$,setCurrentNode:K,setCurrentKey:G,t:i,getNode:j,remove:N,append:I,insertBefore:L,insertAfter:U,handleNodeExpand:O,updateKeyChildren:Q}}});function xse(s,C,i,p,y,A){const h=t.resolveComponent("el-tree-node");return t.openBlock(),t.createElementBlock("div",{ref:"el$",class:t.normalizeClass([s.ns.b(),s.ns.is("dragging",!!s.dragState.draggingNode),s.ns.is("drop-not-allow",!s.dragState.allowDrop),s.ns.is("drop-inner",s.dragState.dropType==="inner"),{[s.ns.m("highlight-current")]:s.highlightCurrent}]),role:"tree"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.root.childNodes,d=>(t.openBlock(),t.createBlock(h,{key:s.getNodeKey(d),node:d,props:s.props,accordion:s.accordion,"render-after-expand":s.renderAfterExpand,"show-checkbox":s.showCheckbox,"render-content":s.renderContent,onNodeExpand:s.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),s.isEmpty?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(s.ns.e("empty-block"))},[t.renderSlot(s.$slots,"empty",{},()=>[t.createElementVNode("span",{class:t.normalizeClass(s.ns.e("empty-text"))},t.toDisplayString(s.emptyText??s.t("el.tree.emptyText")),3)])],2)):t.createCommentVNode("v-if",!0),t.withDirectives(t.createElementVNode("div",{ref:"dropIndicator$",class:t.normalizeClass(s.ns.e("drop-indicator"))},null,2),[[t.vShow,s.dragState.showDropIndicator]])],2)}var Ese=Yi(Cse,[["render",xse]]);const m_=Tr(Ese),Bse=(s,{attrs:C,emit:i},{select:p,tree:y,key:A})=>{const h=zt("tree-select");t.watch(()=>s.data,()=>{s.filterable&&t.nextTick(()=>{var u,c;(c=y.value)==null||c.filter((u=p.value)==null?void 0:u.states.inputValue)})},{flush:"post"});const d=u=>{var f,m;const c=u.at(-1);if(c.expanded&&c.childNodes.at(-1))d([c.childNodes.at(-1)]);else{(m=(f=y.value.el$)==null?void 0:f.querySelector(`[data-key="${u.at(-1).key}"]`))==null||m.focus({preventScroll:!0});return}};return t.onMounted(()=>{vn(()=>{var u;return(u=p.value)==null?void 0:u.$el},"keydown",async u=>{const c=Dn(u),{dropdownMenuVisible:f}=p.value;[Gt.down,Gt.up].includes(c)&&f&&(await t.nextTick(),setTimeout(()=>{var m,g,v;if(Gt.up===c){const b=y.value.store.root.childNodes;d(b);return}(v=(g=(m=p.value.optionsArray[p.value.states.hoveringIndex].$el)==null?void 0:m.parentNode)==null?void 0:g.parentNode)==null||v.focus({preventScroll:!0})}))},{capture:!0})}),{...Fa(t.toRefs(s),Object.keys(na.props)),...C,class:t.computed(()=>C.class),style:t.computed(()=>C.style),"onUpdate:modelValue":u=>i(Pr,u),valueKey:A,popperClass:t.computed(()=>[h.e("popper"),s.popperClass]),filterMethod:(u="")=>{var c;s.filterMethod?s.filterMethod(u):s.remoteMethod?s.remoteMethod(u):(c=y.value)==null||c.filter(u)}}},Sse=t.defineComponent({extends:ac,setup(s,C){const i=ac.setup(s,C);delete i.selectOptionClick;const p=t.getCurrentInstance().proxy;return t.nextTick(()=>{i.select.states.cachedOptions.get(p.value)||i.select.onOptionCreate(p)}),t.watch(()=>C.attrs.visible,y=>{t.nextTick(()=>{i.states.visible=y})},{immediate:!0}),i},methods:{selectOptionClick(){this.$el.parentElement.click()}}});function A_(s){return s||s===0}function g_(s){return nr(s)&&s.length}function kd(s){return nr(s)?s:A_(s)?[s]:[]}function PA(s,C,i,p,y){for(let A=0;A<s.length;A++){const h=s[A];if(C(h,A,s,y))return p?p(h,A,s,y):h;{const d=i(h);if(g_(d)){const u=PA(d,C,i,p,h);if(u)return u}}}}function MA(s,C,i,p){for(let y=0;y<s.length;y++){const A=s[y];C(A,y,s,p);const h=i(A);g_(h)&&MA(h,C,i,A)}}const kse=(s,{attrs:C,slots:i,emit:p},{select:y,tree:A,key:h})=>{t.watch([()=>s.modelValue,A],()=>{s.showCheckbox&&t.nextTick(()=>{const b=A.value;b&&!hi(b.getCheckedKeys(),kd(s.modelValue))&&b.setCheckedKeys(kd(s.modelValue))})},{immediate:!0,deep:!0});const d=t.computed(()=>({value:h.value,label:"label",children:"children",disabled:"disabled",isLeaf:"isLeaf",...s.props})),u=(b,w)=>{var x;const _=d.value[b];return Nr(_)?_(w,(x=A.value)==null?void 0:x.getNode(u("value",w))):w[_]},c=kd(s.modelValue).map(b=>PA(s.data||[],w=>u("value",w)===b,w=>u("children",w),(w,_,x,E)=>E&&u("value",E))).filter(b=>A_(b)),f=t.computed(()=>{if(!s.renderAfterExpand&&!s.lazy)return[];const b=[];return MA(s.data.concat(s.cacheData),w=>{const _=u("value",w);b.push({value:_,currentLabel:u("label",w),isDisabled:u("disabled",w)})},w=>u("children",w)),b}),m=()=>{var b;return(b=A.value)==null?void 0:b.getCheckedKeys().filter(w=>{var x;const _=(x=A.value)==null?void 0:x.getNode(w);return!yi(_)&&Ys(_.childNodes)})},g=b=>{hi(s.modelValue,b)||p(Gr,b)};function v(b){p(Pr,b),g(b)}return{...Fa(t.toRefs(s),Object.keys(m_.props)),...C,nodeKey:h,expandOnClickNode:t.computed(()=>!s.checkStrictly&&s.expandOnClickNode),defaultExpandedKeys:t.computed(()=>s.defaultExpandedKeys?s.defaultExpandedKeys.concat(c):c),renderContent:(b,{node:w,data:_,store:x})=>b(Sse,{value:u("value",_),label:u("label",_),disabled:u("disabled",_),visible:w.visible},s.renderContent?()=>s.renderContent(b,{node:w,data:_,store:x}):i.default?()=>i.default({node:w,data:_,store:x}):void 0),filterNodeMethod:(b,w,_)=>s.filterNodeMethod?s.filterNodeMethod(b,w,_):b?new RegExp(V0(b),"i").test(u("label",w)||""):!0,onNodeClick:(b,w,_)=>{var x,E,k;if((x=C.onNodeClick)==null||x.call(C,b,w,_),!(s.showCheckbox&&s.checkOnClickNode))if(!s.showCheckbox&&(s.checkStrictly||w.isLeaf)){if(!u("disabled",b)){const P=(E=y.value)==null?void 0:E.states.options.get(u("value",b));(k=y.value)==null||k.handleOptionSelect(P)}}else s.expandOnClickNode&&_.proxy.handleExpandIconClick()},onCheck:(b,w)=>{var D;if(!s.showCheckbox)return;const _=u("value",b),x={};MA([A.value.store.root],R=>x[R.key]=R,R=>R.childNodes);const E=w.checkedKeys,k=s.multiple?kd(s.modelValue).filter(R=>!(R in x)&&!E.includes(R)):[],P=k.concat(E);if(s.checkStrictly)v(s.multiple?P:P.includes(_)?_:void 0);else if(s.multiple){const R=m();v(k.concat(R))}else{const R=PA([b],H=>!g_(u("children",H))&&!u("disabled",H),H=>u("children",H)),z=R?u("value",R):void 0,F=A_(s.modelValue)&&!!PA([b],H=>u("value",H)===s.modelValue,H=>u("children",H));v(z===s.modelValue||F?void 0:z)}t.nextTick(()=>{var z;const R=kd(s.modelValue);A.value.setCheckedKeys(R),(z=C.onCheck)==null||z.call(C,b,{checkedKeys:A.value.getCheckedKeys(),checkedNodes:A.value.getCheckedNodes(),halfCheckedKeys:A.value.getHalfCheckedKeys(),halfCheckedNodes:A.value.getHalfCheckedNodes()})}),(D=y.value)==null||D.focus()},onNodeExpand:(b,w,_)=>{var x;(x=C.onNodeExpand)==null||x.call(C,b,w,_),t.nextTick(()=>{if(!s.checkStrictly&&s.lazy&&s.multiple&&w.checked){const E={},k=A.value.getCheckedKeys();MA([A.value.store.root],R=>E[R.key]=R,R=>R.childNodes);const P=kd(s.modelValue).filter(R=>!(R in E)&&!k.includes(R)),D=m();v(P.concat(D))}})},cacheOptions:f}};var Pse=t.defineComponent({props:{data:{type:Array,default:()=>[]}},setup(s){const C=t.inject(hh);return t.watch(()=>s.data,()=>{var p;s.data.forEach(y=>{C.states.cachedOptions.has(y.value)||C.states.cachedOptions.set(y.value,y)});const i=((p=C.selectRef)==null?void 0:p.querySelectorAll("input"))||[];un&&!Array.from(i).includes(document.activeElement)&&C.setSelected()},{flush:"post",immediate:!0}),()=>{}}}),Mse=t.defineComponent({name:"ElTreeSelect",inheritAttrs:!1,props:{...Sk,...PT,cacheData:{type:Array,default:()=>[]}},setup(s,C){const{slots:i,expose:p,emit:y,attrs:A}=C,h={...A,onChange:void 0},d=t.ref(),u=t.ref(),c=t.computed(()=>s.nodeKey||s.valueKey||"value"),f=Bse(s,{attrs:A,emit:y},{select:d,tree:u,key:c}),{cacheOptions:m,...g}=kse(s,{attrs:h,slots:i,emit:y},{select:d,tree:u,key:c}),v=t.reactive({});return p(v),t.onMounted(()=>{Object.assign(v,{...Fa(u.value,["filter","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter"]),...Fa(d.value,["focus","blur","selectedLabel"]),treeRef:u.value,selectRef:d.value})}),()=>t.h(na,t.reactive({...f,ref:b=>d.value=b}),{...i,default:()=>[t.h(Pse,{data:m.value}),t.h(m_,t.reactive({...g,ref:b=>u.value=b}))]})}}),Tse=Mse;Tr(Tse);const v_=Symbol(),Ise={key:-1,level:-1,data:{}},FT={type:Number,default:26},Dse=Wt({data:{type:et(Array),default:()=>mi([])},emptyText:{type:String},height:{type:Number,default:200},props:{type:et(Object),default:()=>mi({children:"children",label:"label",disabled:"disabled",value:"id",class:""})},highlightCurrent:Boolean,showCheckbox:Boolean,defaultCheckedKeys:{type:et(Array),default:()=>mi([])},checkStrictly:Boolean,defaultExpandedKeys:{type:et(Array),default:()=>mi([])},indent:{type:Number,default:16},itemSize:FT,icon:{type:Pn},expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkOnClickLeaf:{type:Boolean,default:!0},currentNodeKey:{type:et([String,Number])},accordion:Boolean,filterMethod:{type:et(Function)},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:Boolean}),Rse=Wt({node:{type:et(Object),default:()=>mi(Ise)},expanded:Boolean,checked:Boolean,indeterminate:Boolean,showCheckbox:Boolean,disabled:Boolean,current:Boolean,hiddenExpandIcon:Boolean,itemSize:FT}),Fse=Wt({node:{type:et(Object),required:!0}}),NT="node-click",OT="node-drop",LT="node-expand",jT="node-collapse",VT="current-change",UT="check",zT="check-change",HT="node-contextmenu",Nse={[NT]:(s,C,i)=>s&&C&&i,[OT]:(s,C,i)=>s&&C&&i,[LT]:(s,C)=>s&&C,[jT]:(s,C)=>s&&C,[VT]:(s,C)=>s&&C,[UT]:(s,C)=>s&&C,[zT]:(s,C)=>s&&Bn(C),[HT]:(s,C,i)=>s&&C&&i},Ose={click:(s,C)=>!!(s&&C),drop:(s,C)=>!!(s&&C),toggle:s=>!!s,check:(s,C)=>s&&Bn(C)};function Lse(s,C){const i=t.ref(new Set),p=t.ref(new Set),{emit:y}=t.getCurrentInstance();t.watch([()=>C.value,()=>s.defaultCheckedKeys],()=>t.nextTick(()=>{E(s.defaultCheckedKeys)}),{immediate:!0});const A=(k=!1)=>{if(!C.value||!s.showCheckbox||s.checkStrictly&&!k)return;const{levelTreeNodeMap:P,maxLevel:D}=C.value,R=i.value,z=new Set;for(let F=D;F>=1;--F){const H=P.get(F);H&&H.forEach($=>{const K=$.children;let G=!$.isLeaf||$.disabled||R.has($.key);if(K){let j=!0,N=!1;for(const I of K){const L=I.key;if(I.isEffectivelyChecked||(G=!1),R.has(L))N=!0;else if(z.has(L)){j=!1,N=!0;break}else j=!1}j?R.add($.key):N?(z.add($.key),R.delete($.key)):(R.delete($.key),z.delete($.key))}$.isEffectivelyChecked=G})}p.value=z},h=k=>i.value.has(k.key),d=k=>p.value.has(k.key),u=(k,P,D=!0,R=!0,z=!1)=>{const F=i.value,H=k.children;(!s.checkStrictly||z)&&D&&(H!=null&&H.length)&&(P=H.some(K=>!K.isEffectivelyChecked));const $=(K,G)=>{F[G?"add":"delete"](K.key);const j=K.children;(!s.checkStrictly||z)&&j&&j.forEach(N=>{(!N.disabled||N.children)&&$(N,G)})};$(k,P),R&&A(),D&&c(k,P)},c=(k,P)=>{const{checkedNodes:D,checkedKeys:R}=b(),{halfCheckedNodes:z,halfCheckedKeys:F}=w();y(UT,k.data,{checkedKeys:R,checkedNodes:D,halfCheckedKeys:F,halfCheckedNodes:z}),y(zT,k.data,P)};function f(k=!1){return b(k).checkedKeys}function m(k=!1){return b(k).checkedNodes}function g(){return w().halfCheckedKeys}function v(){return w().halfCheckedNodes}function b(k=!1){const P=[],D=[];if(C!=null&&C.value&&s.showCheckbox){const{treeNodeMap:R}=C.value;i.value.forEach(z=>{const F=R.get(z);F&&(!k||k&&F.isLeaf)&&(D.push(z),P.push(F.data))})}return{checkedKeys:D,checkedNodes:P}}function w(){const k=[],P=[];if(C!=null&&C.value&&s.showCheckbox){const{treeNodeMap:D}=C.value;p.value.forEach(R=>{const z=D.get(R);z&&(P.push(R),k.push(z.data))})}return{halfCheckedNodes:k,halfCheckedKeys:P}}function _(k){i.value.clear(),p.value.clear(),t.nextTick(()=>{E(k)})}function x(k,P,D){if(C!=null&&C.value&&s.showCheckbox){const R=C.value.treeNodeMap.get(k);R&&u(R,P,!1,void 0,D)}}function E(k){if(C!=null&&C.value){const{treeNodeMap:P}=C.value;if(s.showCheckbox&&P){for(const D of k){const R=P.get(D);R&&!h(R)&&u(R,!0,!1,!1)}A()}}}return{updateCheckedKeys:A,toggleCheckbox:u,isChecked:h,isIndeterminate:d,getCheckedKeys:f,getCheckedNodes:m,getHalfCheckedKeys:g,getHalfCheckedNodes:v,setChecked:x,setCheckedKeys:_}}function jse(s,C){const i=t.ref(new Set([])),p=t.ref(new Set([])),y=t.computed(()=>Nr(s.filterMethod));function A(d){var w;if(!y.value)return;const u=new Set,c=p.value,f=i.value,m=[],g=((w=C.value)==null?void 0:w.treeNodes)||[],v=s.filterMethod;f.clear();function b(_){_.forEach(x=>{m.push(x),v!=null&&v(d,x.data,x)?m.forEach(k=>{u.add(k.key),k.expanded=!0}):(x.expanded=!1,x.isLeaf&&f.add(x.key));const E=x.children;if(E&&b(E),!x.isLeaf){if(!u.has(x.key))f.add(x.key);else if(E){let k=!0;for(const P of E)if(!f.has(P.key)){k=!1;break}k?c.add(x.key):c.delete(x.key)}}m.pop()})}return b(g),u}function h(d){return p.value.has(d.key)}return{hiddenExpandIconKeySet:p,hiddenNodeKeySet:i,doFilter:A,isForceHiddenExpandIcon:h}}function Vse(s,C){const i=t.ref(new Set),p=t.ref(),y=t.shallowRef(),A=t.ref(),{isIndeterminate:h,isChecked:d,toggleCheckbox:u,getCheckedKeys:c,getCheckedNodes:f,getHalfCheckedKeys:m,getHalfCheckedNodes:g,setChecked:v,setCheckedKeys:b}=Lse(s,y),{doFilter:w,hiddenNodeKeySet:_,isForceHiddenExpandIcon:x}=jse(s,y),E=t.computed(()=>{var de;return((de=s.props)==null?void 0:de.value)||"id"}),k=t.computed(()=>{var de;return((de=s.props)==null?void 0:de.children)||"children"}),P=t.computed(()=>{var de;return((de=s.props)==null?void 0:de.disabled)||"disabled"}),D=t.computed(()=>{var de;return((de=s.props)==null?void 0:de.label)||"label"}),R=t.computed(()=>{var V;const de=i.value,he=_.value,ue=[],pe=((V=y.value)==null?void 0:V.treeNodes)||[],se=[];for(let Ce=pe.length-1;Ce>=0;--Ce)se.push(pe[Ce]);for(;se.length;){const Ce=se.pop();if(!he.has(Ce.key)&&(ue.push(Ce),Ce.children&&de.has(Ce.key)))for(let ve=Ce.children.length-1;ve>=0;--ve)se.push(Ce.children[ve])}return ue}),z=t.computed(()=>R.value.length>0);function F(de){const he=new Map,ue=new Map;let pe=1;function se(Ce,ve=1,ye=void 0){var me;const Ae=[];for(const be of Ce){const we=K(be),Te={level:ve,key:we,data:be};Te.label=j(be),Te.parent=ye;const He=$(be);Te.disabled=G(be),Te.isLeaf=!He||He.length===0,Te.expanded=i.value.has(we),He&&He.length&&(Te.children=se(He,ve+1,Te)),Ae.push(Te),he.set(we,Te),ue.has(ve)||ue.set(ve,[]),(me=ue.get(ve))==null||me.push(Te)}return ve>pe&&(pe=ve),Ae}const V=se(de);return{treeNodeMap:he,levelTreeNodeMap:ue,maxLevel:pe,treeNodes:V}}function H(de){const he=w(de);he&&(i.value=he)}function $(de){return de[k.value]}function K(de){return de?de[E.value]:""}function G(de){return de[P.value]}function j(de){return de[D.value]}function N(de){i.value.has(de.key)?Z(de):W(de)}function I(de){const he=new Set,ue=y.value.treeNodeMap;i.value.forEach(pe=>{const se=ue.get(pe);se&&(se.expanded=!1)}),de.forEach(pe=>{let se=ue.get(pe);for(;se&&!he.has(se.key);)he.add(se.key),se.expanded=!0,se=se.parent}),i.value=he}function L(de,he){O(de),C(NT,de.data,de,he),s.expandOnClickNode&&N(de),s.showCheckbox&&(s.checkOnClickNode||de.isLeaf&&s.checkOnClickLeaf)&&!de.disabled&&u(de,!d(de),!0)}function U(de,he){C(OT,de.data,de,he)}function O(de){ne(de)||(p.value=de.key,C(VT,de.data,de))}function Q(de,he){u(de,he)}function W(de){const he=i.value;if(y.value&&s.accordion){const{treeNodeMap:pe}=y.value;he.forEach(se=>{const V=pe.get(se);de&&de.level===(V==null?void 0:V.level)&&(he.delete(se),V.expanded=!1)})}he.add(de.key);const ue=re(de.key);ue&&(ue.expanded=!0,C(LT,ue.data,ue))}function Z(de){i.value.delete(de.key);const he=re(de.key);he&&(he.expanded=!1,C(jT,he.data,he))}function J(de){return!!de.disabled}function ne(de){const he=p.value;return he!==void 0&&he===de.key}function ae(){var de,he;if(p.value!==void 0)return(he=(de=y.value)==null?void 0:de.treeNodeMap.get(p.value))==null?void 0:he.data}function ce(){return p.value}function q(de){p.value=de}function fe(de){y.value=F(de)}function re(de){var ue;const he=mn(de)?K(de):de;return(ue=y.value)==null?void 0:ue.treeNodeMap.get(he)}function te(de,he="auto"){const ue=re(de);ue&&A.value&&A.value.scrollToItem(R.value.indexOf(ue),he)}function le(de){var he;(he=A.value)==null||he.scrollTo(de)}return t.watch(()=>s.currentNodeKey,de=>{p.value=de},{immediate:!0}),t.watch(()=>s.defaultExpandedKeys,de=>{I(de||[])}),t.watch(()=>s.data,de=>{fe(de),I(s.defaultExpandedKeys||[])},{immediate:!0}),{tree:y,flattenTree:R,isNotEmpty:z,listRef:A,getKey:K,getChildren:$,toggleExpand:N,toggleCheckbox:u,isChecked:d,isIndeterminate:h,isDisabled:J,isCurrent:ne,isForceHiddenExpandIcon:x,handleNodeClick:L,handleNodeDrop:U,handleNodeCheck:Q,getCurrentNode:ae,getCurrentKey:ce,setCurrentKey:q,getCheckedKeys:c,getCheckedNodes:f,getHalfCheckedKeys:m,getHalfCheckedNodes:g,setChecked:v,setCheckedKeys:b,filter:H,setData:fe,getNode:re,expandNode:W,collapseNode:Z,setExpandedKeys:I,scrollToNode:te,scrollTo:le}}var Use=t.defineComponent({name:"ElTreeNodeContent",props:Fse,setup(s){const C=t.inject(v_),i=zt("tree");return()=>{const p=s.node,{data:y}=p;return C!=null&&C.ctx.slots.default?C.ctx.slots.default({node:p,data:y}):t.h(gT,{tag:"span",truncated:!0,class:i.be("node","label")},()=>[p==null?void 0:p.label])}}});const zse=["aria-expanded","aria-disabled","aria-checked","data-key"];var Hse=t.defineComponent({name:"ElTreeNode",__name:"tree-node",props:Rse,emits:Ose,setup(s,{emit:C}){const i=s,p=C,y=t.inject(v_),A=zt("tree"),h=t.computed(()=>(y==null?void 0:y.props.indent)??16),d=t.computed(()=>(y==null?void 0:y.props.icon)??Zt.CaretRight),u=b=>{var x;const w=(x=y==null?void 0:y.props.props)==null?void 0:x.class;if(!w)return{};let _;if(Nr(w)){const{data:E}=b;_=w(E,b)}else _=w;return Ar(_)?{[_]:!0}:_},c=b=>{p("click",i.node,b)},f=b=>{p("drop",i.node,b)},m=()=>{p("toggle",i.node)},g=b=>{p("check",i.node,b)},v=b=>{var w,_,x,E;(x=(_=(w=y==null?void 0:y.instance)==null?void 0:w.vnode)==null?void 0:_.props)!=null&&x.onNodeContextmenu&&(b.stopPropagation(),b.preventDefault()),y==null||y.ctx.emit(HT,b,(E=i.node)==null?void 0:E.data,i.node)};return(b,w)=>{var _,x,E;return t.openBlock(),t.createElementBlock("div",{ref:"node$",class:t.normalizeClass([t.unref(A).b("node"),t.unref(A).is("expanded",s.expanded),t.unref(A).is("current",s.current),t.unref(A).is("focusable",!s.disabled),t.unref(A).is("checked",!s.disabled&&s.checked),u(s.node)]),role:"treeitem",tabindex:"-1","aria-expanded":s.expanded,"aria-disabled":s.disabled,"aria-checked":s.checked,"data-key":(_=s.node)==null?void 0:_.key,onClick:t.withModifiers(c,["stop"]),onContextmenu:v,onDragover:w[1]||(w[1]=t.withModifiers(()=>{},["prevent"])),onDragenter:w[2]||(w[2]=t.withModifiers(()=>{},["prevent"])),onDrop:t.withModifiers(f,["stop"])},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(A).be("node","content")),style:t.normalizeStyle({paddingLeft:`${(s.node.level-1)*h.value}px`,height:s.itemSize+"px"})},[d.value?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass([t.unref(A).is("leaf",!!((x=s.node)!=null&&x.isLeaf)),t.unref(A).is("hidden",s.hiddenExpandIcon),{expanded:!((E=s.node)!=null&&E.isLeaf)&&s.expanded},t.unref(A).be("node","expand-icon")]),onClick:t.withModifiers(m,["stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(d.value)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),s.showCheckbox?(t.openBlock(),t.createBlock(t.unref(sa),{key:1,"model-value":s.checked,indeterminate:s.indeterminate,disabled:s.disabled,onChange:g,onClick:w[0]||(w[0]=t.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate","disabled"])):t.createCommentVNode("v-if",!0),t.createVNode(t.unref(Use),{node:{...s.node,expanded:s.expanded}},null,8,["node"])],6)],42,zse)}}}),$se=Hse,Gse=t.defineComponent({name:"ElTreeV2",__name:"tree",props:Dse,emits:Nse,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.useSlots(),h=t.computed(()=>p.itemSize);t.provide(v_,{ctx:{emit:y,slots:A},props:p,instance:t.getCurrentInstance()}),t.provide(za,void 0);const{t:d}=Yr(),u=zt("tree"),{flattenTree:c,isNotEmpty:f,listRef:m,toggleExpand:g,isIndeterminate:v,isChecked:b,isDisabled:w,isCurrent:_,isForceHiddenExpandIcon:x,handleNodeClick:E,handleNodeDrop:k,handleNodeCheck:P,toggleCheckbox:D,getCurrentNode:R,getCurrentKey:z,setCurrentKey:F,getCheckedKeys:H,getCheckedNodes:$,getHalfCheckedKeys:K,getHalfCheckedNodes:G,setChecked:j,setCheckedKeys:N,filter:I,setData:L,getNode:U,expandNode:O,collapseNode:Q,setExpandedKeys:W,scrollToNode:Z,scrollTo:J}=Vse(p,y);return C({toggleCheckbox:D,getCurrentNode:R,getCurrentKey:z,setCurrentKey:F,getCheckedKeys:H,getCheckedNodes:$,getHalfCheckedKeys:K,getHalfCheckedNodes:G,setChecked:j,setCheckedKeys:N,filter:I,setData:L,getNode:U,expandNode:O,collapseNode:Q,setExpandedKeys:W,scrollToNode:Z,scrollTo:J}),(ne,ae)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(u).b(),{[t.unref(u).m("highlight-current")]:s.highlightCurrent}]),role:"tree"},[t.unref(f)?(t.openBlock(),t.createBlock(t.unref(bh),{key:0,ref_key:"listRef",ref:m,"class-name":t.unref(u).b("virtual-list"),data:t.unref(c),total:t.unref(c).length,height:s.height,"item-size":h.value,"perf-mode":s.perfMode,"scrollbar-always-on":s.scrollbarAlwaysOn},{default:t.withCtx(({data:ce,index:q,style:fe})=>[(t.openBlock(),t.createBlock($se,{key:ce[q].key,style:t.normalizeStyle(fe),node:ce[q],expanded:ce[q].expanded,"show-checkbox":s.showCheckbox,checked:t.unref(b)(ce[q]),indeterminate:t.unref(v)(ce[q]),"item-size":h.value,disabled:t.unref(w)(ce[q]),current:t.unref(_)(ce[q]),"hidden-expand-icon":t.unref(x)(ce[q]),onClick:t.unref(E),onToggle:t.unref(g),onCheck:t.unref(P),onDrop:t.unref(k)},null,8,["style","node","expanded","show-checkbox","checked","indeterminate","item-size","disabled","current","hidden-expand-icon","onClick","onToggle","onCheck","onDrop"]))]),_:1},8,["class-name","data","total","height","item-size","perf-mode","scrollbar-always-on"])):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(u).e("empty-block"))},[t.renderSlot(ne.$slots,"empty",{},()=>[t.createElementVNode("span",{class:t.normalizeClass(t.unref(u).e("empty-text"))},t.toDisplayString(s.emptyText??t.unref(d)("el.tree.emptyText")),3)])],2))],2))}}),Qse=Gse;Tr(Qse);const Wse="ElUpload";var Kse=class extends Error{constructor(s,C,i,p){super(s),this.name="UploadAjaxError",this.status=C,this.method=i,this.url=p}};function $T(s,C,i){let p;return i.response?p=`${i.response.error||i.response}`:i.responseText?p=`${i.responseText}`:p=`fail to ${C.method} ${s} ${i.status}`,new Kse(p,i.status,C.method,s)}function Xse(s){const C=s.responseText||s.response;if(!C)return C;try{return JSON.parse(C)}catch{return C}}const Yse=s=>{typeof XMLHttpRequest>"u"&&oi(Wse,"XMLHttpRequest is undefined");const C=new XMLHttpRequest,i=s.action;C.upload&&C.upload.addEventListener("progress",A=>{const h=A;h.percent=A.total>0?A.loaded/A.total*100:0,s.onProgress(h)});const p=new FormData;if(s.data)for(const[A,h]of Object.entries(s.data))nr(h)?h.length===2&&h[0]instanceof Blob&&Ar(h[1])?p.append(A,h[0],h[1]):h.forEach(d=>{p.append(A,d)}):p.append(A,h);p.append(s.filename,s.file,s.file.name),C.addEventListener("error",()=>{s.onError($T(i,s,C))}),C.addEventListener("load",()=>{if(C.status<200||C.status>=300)return s.onError($T(i,s,C));s.onSuccess(Xse(C))}),C.open(s.method,i,!0),s.withCredentials&&"withCredentials"in C&&(C.withCredentials=!0);const y=s.headers||{};if(y instanceof Headers)y.forEach((A,h)=>C.setRequestHeader(h,A));else for(const[A,h]of Object.entries(y))yi(h)||C.setRequestHeader(A,String(h));return C.send(p),C},GT=["text","picture","picture-card"];let Jse=1;const y_=()=>Date.now()+Jse++,QT=Wt({action:{type:String,default:"#"},headers:{type:et(Object)},method:{type:String,default:"post"},data:{type:et([Object,Function,Promise]),default:()=>mi({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:et(Array),default:()=>mi([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:GT,default:"text"},httpRequest:{type:et(Function),default:Yse},disabled:{type:Boolean,default:void 0},limit:Number,directory:Boolean}),Zse=Wt({...QT,beforeUpload:{type:et(Function),default:Xr},beforeRemove:{type:et(Function)},onRemove:{type:et(Function),default:Xr},onChange:{type:et(Function),default:Xr},onPreview:{type:et(Function),default:Xr},onSuccess:{type:et(Function),default:Xr},onProgress:{type:et(Function),default:Xr},onError:{type:et(Function),default:Xr},onExceed:{type:et(Function),default:Xr},crossorigin:{type:et(String)}}),WT=Symbol("uploadContextKey"),qse=Wt({files:{type:et(Array),default:()=>mi([])},disabled:{type:Boolean,default:void 0},handlePreview:{type:et(Function),default:Xr},listType:{type:String,values:GT,default:"text"},crossorigin:{type:et(String)}}),eoe={remove:s=>!!s},toe=Wt({...QT,beforeUpload:{type:et(Function),default:Xr},onRemove:{type:et(Function),default:Xr},onStart:{type:et(Function),default:Xr},onSuccess:{type:et(Function),default:Xr},onProgress:{type:et(Function),default:Xr},onError:{type:et(Function),default:Xr},onExceed:{type:et(Function),default:Xr}}),roe=Wt({disabled:{type:Boolean,default:void 0},directory:Boolean}),noe={file:s=>nr(s)},ioe=["tabindex","aria-disabled","onKeydown"],soe=["src","crossorigin"],ooe=["onClick"],aoe=["title"],loe=["onClick"],coe=["onClick"];var uoe=t.defineComponent({name:"ElUploadList",__name:"upload-list",props:qse,emits:eoe,setup(s,{emit:C}){const i=s,p=C,{t:y}=Yr(),A=zt("upload"),h=zt("icon"),d=zt("list"),u=ri(),c=t.ref(!1),f=t.computed(()=>[A.b("list"),A.bm("list",i.listType),A.is("disabled",u.value)]),m=async v=>{const b=v.relatedTarget;await t.nextTick(),b!=null&&b.classList.contains(A.be("list","item"))||(c.value=!1)},g=v=>{p("remove",v)};return(v,b)=>(t.openBlock(),t.createBlock(t.TransitionGroup,{tag:"ul",class:t.normalizeClass(f.value),name:t.unref(d).b()},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.files,(w,_)=>(t.openBlock(),t.createElementBlock("li",{key:w.uid||w.name,class:t.normalizeClass([t.unref(A).be("list","item"),t.unref(A).is(w.status),{focusing:c.value}]),tabindex:t.unref(u)?void 0:0,"aria-disabled":t.unref(u),role:"button",onKeydown:t.withKeys(x=>!t.unref(u)&&g(w),["delete"]),onFocus:b[0]||(b[0]=x=>c.value=!0),onBlur:m,onClick:b[1]||(b[1]=x=>c.value=!1)},[t.renderSlot(v.$slots,"default",{file:w,index:_},()=>[s.listType==="picture"||w.status!=="uploading"&&s.listType==="picture-card"?(t.openBlock(),t.createElementBlock("img",{key:0,class:t.normalizeClass(t.unref(A).be("list","item-thumbnail")),src:w.url,crossorigin:s.crossorigin,alt:""},null,10,soe)):t.createCommentVNode("v-if",!0),w.status==="uploading"||s.listType!=="picture-card"?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(A).be("list","item-info"))},[t.createElementVNode("a",{class:t.normalizeClass(t.unref(A).be("list","item-name")),onClick:t.withModifiers(x=>s.handlePreview(w),["prevent"])},[t.createVNode(t.unref(ir),{class:t.normalizeClass(t.unref(h).m("document"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Document))]),_:1},8,["class"]),t.createElementVNode("span",{class:t.normalizeClass(t.unref(A).be("list","item-file-name")),title:w.name},t.toDisplayString(w.name),11,aoe)],10,ooe),w.status==="uploading"?(t.openBlock(),t.createBlock(t.unref(PM),{key:0,type:s.listType==="picture-card"?"circle":"line","stroke-width":s.listType==="picture-card"?6:2,percentage:Number(w.percentage),style:t.normalizeStyle(s.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):t.createCommentVNode("v-if",!0)],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("label",{class:t.normalizeClass(t.unref(A).be("list","item-status-label"))},[s.listType==="text"?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass([t.unref(h).m("upload-success"),t.unref(h).m("circle-check")])},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.CircleCheck))]),_:1},8,["class"])):["picture-card","picture"].includes(s.listType)?(t.openBlock(),t.createBlock(t.unref(ir),{key:1,class:t.normalizeClass([t.unref(h).m("upload-success"),t.unref(h).m("check")])},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Check))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],2),t.unref(u)?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock(t.unref(ir),{key:2,class:t.normalizeClass(t.unref(h).m("close")),"aria-label":t.unref(y)("el.upload.delete"),role:"button",tabindex:"0",onClick:x=>g(w),onKeydown:t.withKeys(t.withModifiers(x=>g(w),["prevent"]),["enter","space"])},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Close))]),_:1},8,["class","aria-label","onClick","onKeydown"])),t.unref(u)?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("i",{key:3,class:t.normalizeClass(t.unref(h).m("close-tip"))},t.toDisplayString(t.unref(y)("el.upload.deleteTip")),3)),s.listType==="picture-card"?(t.openBlock(),t.createElementBlock("span",{key:4,class:t.normalizeClass(t.unref(A).be("list","item-actions"))},[t.createElementVNode("span",{class:t.normalizeClass(t.unref(A).be("list","item-preview")),onClick:x=>s.handlePreview(w)},[t.createVNode(t.unref(ir),{class:t.normalizeClass(t.unref(h).m("zoom-in"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.ZoomIn))]),_:1},8,["class"])],10,loe),t.unref(u)?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(t.unref(A).be("list","item-delete")),onClick:x=>g(w)},[t.createVNode(t.unref(ir),{class:t.normalizeClass(t.unref(h).m("delete"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Zt.Delete))]),_:1},8,["class"])],10,coe))],2)):t.createCommentVNode("v-if",!0)])],42,ioe))),128)),t.renderSlot(v.$slots,"append")]),_:3},8,["class","name"]))}}),KT=uoe;const XT="ElUploadDrag";var doe=t.defineComponent({name:XT,__name:"upload-dragger",props:roe,emits:noe,setup(s,{emit:C}){const i=s,p=C;t.inject(WT)||oi(XT,"usage: <el-upload><el-upload-dragger /></el-upload>");const y=zt("upload"),A=t.ref(!1),h=ri(),d=g=>new Promise((v,b)=>g.file(v,b)),u=async g=>{try{if(g.isFile){const v=await d(g);return g.fullPath&&!v.webkitRelativePath&&Object.defineProperty(v,"webkitRelativePath",{value:g.fullPath.replace(/^\//,"")}),v.isDirectory=!1,[v]}if(g.isDirectory){const v=g.createReader(),b=()=>new Promise((k,P)=>v.readEntries(k,P)),w=[];let _=await b();for(;_.length>0;)w.push(..._),_=await b();const x=w.map(k=>u(k).catch(()=>[])),E=await Promise.all(x);return im(E)}}catch{return[]}return[]},c=async g=>{if(h.value)return;A.value=!1,g.stopPropagation();const v=Array.from(g.dataTransfer.files),b=g.dataTransfer.items||[];if(i.directory){const w=Array.from(b).map(x=>{var E;return(E=x==null?void 0:x.webkitGetAsEntry)==null?void 0:E.call(x)}).filter(x=>x),_=await Promise.all(w.map(u));p("file",im(_));return}v.forEach((w,_)=>{var E,k;const x=(k=(E=b[_])==null?void 0:E.webkitGetAsEntry)==null?void 0:k.call(E);x&&(w.isDirectory=x.isDirectory)}),p("file",v)},f=()=>{h.value||(A.value=!0)},m=g=>{g.currentTarget.contains(g.relatedTarget)||(A.value=!1)};return(g,v)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(y).b("dragger"),t.unref(y).is("dragover",A.value)]),onDrop:t.withModifiers(c,["prevent"]),onDragover:t.withModifiers(f,["prevent"]),onDragleave:t.withModifiers(m,["prevent"])},[t.renderSlot(g.$slots,"default")],34))}}),foe=doe;const hoe=["tabindex","aria-disabled","onKeydown"],poe=["name","disabled","multiple","accept","webkitdirectory"];var moe=t.defineComponent({name:"ElUploadContent",inheritAttrs:!1,__name:"upload-content",props:toe,setup(s,{expose:C}){const i=s,p=zt("upload"),y=ri(),A=t.shallowRef({}),h=t.shallowRef(),d=w=>{if(w.length===0)return;const{autoUpload:_,limit:x,fileList:E,multiple:k,onStart:P,onExceed:D}=i;if(x&&E.length+w.length>x){D(w,E);return}k||(w=w.slice(0,1));for(const R of w){const z=R;z.uid=y_(),P(z),_&&u(z)}},u=async w=>{if(h.value.value="",!i.beforeUpload)return f(w);let _,x={};try{const k=i.data,P=i.beforeUpload(w);x=a0(i.data)?Da(i.data):i.data,_=await P,a0(i.data)&&hi(k,x)&&(x=Da(i.data))}catch{_=!1}if(_===!1){i.onRemove(w);return}let E=w;_ instanceof Blob&&(_ instanceof File?E=_:E=new File([_],w.name,{type:w.type})),f(Object.assign(E,{uid:w.uid}),x)},c=async(w,_)=>Nr(w)?w(_):w,f=async(w,_)=>{const{headers:x,data:E,method:k,withCredentials:P,name:D,action:R,onProgress:z,onSuccess:F,onError:H,httpRequest:$}=i;try{_=await c(_??E,w)}catch{i.onRemove(w);return}const{uid:K}=w,G={headers:x||{},withCredentials:P,file:w,data:_,method:k,filename:D,action:R,onProgress:N=>{z(N,w)},onSuccess:N=>{F(N,w),delete A.value[K]},onError:N=>{H(N,w),delete A.value[K]}},j=$(G);A.value[K]=j,j instanceof Promise&&j.then(G.onSuccess,G.onError)},m=w=>{const _=w.target.files;_&&d(Array.from(_))},g=()=>{y.value||(h.value.value="",h.value.click())},v=()=>{g()};return C({abort:w=>{xE(A.value).filter(w?([_])=>String(w.uid)===_:()=>!0).forEach(([_,x])=>{x instanceof XMLHttpRequest&&x.abort(),delete A.value[_]})},upload:u}),(w,_)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(p).b(),t.unref(p).m(s.listType),t.unref(p).is("drag",s.drag),t.unref(p).is("disabled",t.unref(y))]),tabindex:t.unref(y)?void 0:0,"aria-disabled":t.unref(y),role:"button",onClick:g,onKeydown:t.withKeys(t.withModifiers(v,["self"]),["enter","space"])},[s.drag?(t.openBlock(),t.createBlock(foe,{key:0,disabled:t.unref(y),directory:s.directory,onFile:d},{default:t.withCtx(()=>[t.renderSlot(w.$slots,"default")]),_:3},8,["disabled","directory"])):t.renderSlot(w.$slots,"default",{key:1}),t.createElementVNode("input",{ref_key:"inputRef",ref:h,class:t.normalizeClass(t.unref(p).e("input")),name:s.name,disabled:t.unref(y),multiple:s.multiple,accept:s.accept,webkitdirectory:s.directory||void 0,type:"file",onChange:m,onClick:_[0]||(_[0]=t.withModifiers(()=>{},["stop"]))},null,42,poe)],42,hoe))}}),YT=moe;const JT="ElUpload",ZT=s=>{var C;(C=s.url)!=null&&C.startsWith("blob:")&&URL.revokeObjectURL(s.url)},Aoe=(s,C)=>{const i=zU(s,"fileList",void 0,{passive:!0}),p=b=>i.value.find(w=>w.uid===b.uid);function y(b){var w;(w=C.value)==null||w.abort(b)}function A(b=["ready","uploading","success","fail"]){i.value=i.value.filter(w=>!b.includes(w.status))}function h(b){i.value=i.value.filter(w=>w.uid!==b.uid)}const d=b=>{t.nextTick(()=>s.onChange(b,i.value))},u=(b,w)=>{const _=p(w);_&&(console.error(b),_.status="fail",h(_),s.onError(b,_,i.value),d(_))},c=(b,w)=>{const _=p(w);_&&(s.onProgress(b,_,i.value),_.status="uploading",_.percentage=Math.round(b.percent))},f=(b,w)=>{const _=p(w);_&&(_.status="success",_.response=b,s.onSuccess(b,_,i.value),d(_))},m=b=>{yi(b.uid)&&(b.uid=y_());const w={name:b.name,percentage:0,status:"ready",size:b.size,raw:b,uid:b.uid};if(s.listType==="picture-card"||s.listType==="picture")try{w.url=URL.createObjectURL(b)}catch(_){wn(JT,_.message),s.onError(_,w,i.value)}i.value=[...i.value,w],d(w)},g=async b=>{const w=b instanceof File?p(b):b;w||oi(JT,"file to be removed not found");const _=x=>{y(x),h(x),s.onRemove(x,i.value),ZT(x)};s.beforeRemove?await s.beforeRemove(w,i.value)!==!1&&_(w):_(w)};function v(){i.value.filter(({status:b})=>b==="ready").forEach(({raw:b})=>{var w;return b&&((w=C.value)==null?void 0:w.upload(b))})}return t.watch(()=>s.listType,b=>{b!=="picture-card"&&b!=="picture"||(i.value=i.value.map(w=>{const{raw:_,url:x}=w;if(!x&&_)try{w.url=URL.createObjectURL(_)}catch(E){s.onError(E,w,i.value)}return w}))}),t.watch(i,b=>{for(const w of b)w.uid||(w.uid=y_()),w.status||(w.status="success")},{immediate:!0,deep:!0}),{uploadFiles:i,abort:y,clearFiles:A,handleError:u,handleProgress:c,handleStart:m,handleSuccess:f,handleRemove:g,submit:v,revokeFileObjectURL:ZT}};var goe=t.defineComponent({name:"ElUpload",__name:"upload",props:Zse,setup(s,{expose:C}){const i=s,p=ri(),y=t.shallowRef(),{abort:A,submit:h,clearFiles:d,uploadFiles:u,handleStart:c,handleError:f,handleRemove:m,handleSuccess:g,handleProgress:v,revokeFileObjectURL:b}=Aoe(i,y),w=t.computed(()=>i.listType==="picture-card"),_=t.computed(()=>({...i,fileList:u.value,onStart:c,onProgress:v,onSuccess:g,onError:f,onRemove:m}));return t.onBeforeUnmount(()=>{u.value.forEach(b)}),t.provide(WT,{accept:t.toRef(i,"accept")}),C({abort:A,submit:h,clearFiles:d,handleStart:c,handleRemove:m}),(x,E)=>(t.openBlock(),t.createElementBlock("div",null,[w.value&&s.showFileList?(t.openBlock(),t.createBlock(KT,{key:0,disabled:t.unref(p),"list-type":s.listType,files:t.unref(u),crossorigin:s.crossorigin,"handle-preview":s.onPreview,onRemove:t.unref(m)},t.createSlots({append:t.withCtx(()=>[t.createVNode(YT,t.mergeProps({ref_key:"uploadRef",ref:y},_.value),{default:t.withCtx(()=>[x.$slots.trigger?t.renderSlot(x.$slots,"trigger",{key:0}):t.createCommentVNode("v-if",!0),!x.$slots.trigger&&x.$slots.default?t.renderSlot(x.$slots,"default",{key:1}):t.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[x.$slots.file?{name:"default",fn:t.withCtx(({file:k,index:P})=>[t.renderSlot(x.$slots,"file",{file:k,index:P})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):t.createCommentVNode("v-if",!0),!w.value||w.value&&!s.showFileList?(t.openBlock(),t.createBlock(YT,t.mergeProps({key:1,ref_key:"uploadRef",ref:y},_.value),{default:t.withCtx(()=>[x.$slots.trigger?t.renderSlot(x.$slots,"trigger",{key:0}):t.createCommentVNode("v-if",!0),!x.$slots.trigger&&x.$slots.default?t.renderSlot(x.$slots,"default",{key:1}):t.createCommentVNode("v-if",!0)]),_:3},16)):t.createCommentVNode("v-if",!0),x.$slots.trigger?t.renderSlot(x.$slots,"default",{key:2}):t.createCommentVNode("v-if",!0),t.renderSlot(x.$slots,"tip"),!w.value&&s.showFileList?(t.openBlock(),t.createBlock(KT,{key:3,disabled:t.unref(p),"list-type":s.listType,files:t.unref(u),crossorigin:s.crossorigin,"handle-preview":s.onPreview,onRemove:t.unref(m)},t.createSlots({_:2},[x.$slots.file?{name:"default",fn:t.withCtx(({file:k,index:P})=>[t.renderSlot(x.$slots,"file",{file:k,index:P})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):t.createCommentVNode("v-if",!0)]))}}),voe=goe;Tr(voe);const yoe=Wt({zIndex:{type:Number,default:9},rotate:{type:Number,default:-22},width:Number,height:Number,image:String,content:{type:et([String,Array]),default:"Element Plus"},font:{type:et(Object)},gap:{type:et(Array),default:()=>[100,100]},offset:{type:et(Array)}});function boe(s){return s.replace(/([A-Z])/g,"-$1").toLowerCase()}function _oe(s){return Object.keys(s).map(C=>`${boe(C)}: ${s[C]};`).join(" ")}function woe(){return window.devicePixelRatio||1}const Coe=(s,C)=>{let i=!1;return s.removedNodes.length&&C&&(i=Array.from(s.removedNodes).includes(C)),s.type==="attributes"&&s.target===C&&(i=!0),i},xoe={left:[0,.5],start:[0,.5],center:[.5,0],right:[1,-.5],end:[1,-.5]};function b_(s,C,i=1){const p=document.createElement("canvas"),y=p.getContext("2d"),A=s*i,h=C*i;return p.setAttribute("width",`${A}px`),p.setAttribute("height",`${h}px`),y.save(),[y,p,A,h]}function Eoe(){function s(C,i,p,y,A,h,d,u,c){const[f,m,g,v]=b_(y,A,p);let b=0;if(C instanceof HTMLImageElement)f.drawImage(C,0,0,g,v);else{const{color:J,fontSize:ne,fontStyle:ae,fontWeight:ce,fontFamily:q,textAlign:fe,textBaseline:re}=h,te=Number(ne)*p;f.font=`${ae} normal ${ce} ${te}px/${A}px ${q}`,f.fillStyle=J,f.textAlign=fe,f.textBaseline=re;const le=nr(C)?C:[C];if(re!=="top"&&le[0]){const de=f.measureText(le[0]);f.textBaseline="top";const he=f.measureText(le[0]);b=de.actualBoundingBoxAscent-he.actualBoundingBoxAscent}le==null||le.forEach((de,he)=>{const[ue,pe]=xoe[fe];f.fillText(de??"",g*ue+c*pe,he*(te+h.fontGap*p))})}const w=Math.PI/180*Number(i),_=Math.max(y,A),[x,E,k]=b_(_,_,p);x.translate(k/2,k/2),x.rotate(w),g>0&&v>0&&x.drawImage(m,-g/2,-v/2);function P(J,ne){return[J*Math.cos(w)-ne*Math.sin(w),J*Math.sin(w)+ne*Math.cos(w)]}let D=0,R=0,z=0,F=0;const H=g/2,$=v/2;[[0-H,0-$],[0+H,0-$],[0+H,0+$],[0-H,0+$]].forEach(([J,ne])=>{const[ae,ce]=P(J,ne);D=Math.min(D,ae),R=Math.max(R,ae),z=Math.min(z,ce),F=Math.max(F,ce)});const K=D+k/2,G=z+k/2,j=R-D,N=F-z,I=d*p,L=u*p,U=(j+I)*2,O=N+L,[Q,W]=b_(U,O);function Z(J=0,ne=0){Q.drawImage(E,K,G,j,N,J,ne+b,j,N)}return Z(),Z(j+I,-N/2-L/2),Z(j+I,+N/2+L/2),[W.toDataURL(),U/p,O/p]}return s}var Boe=t.defineComponent({name:"ElWatermark",__name:"watermark",props:yoe,setup(s){const C={position:"relative"},i=s,p=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.fontGap)??3}),y=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.color)??"rgba(0,0,0,.15)"}),A=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.fontSize)??16}),h=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.fontWeight)??"normal"}),d=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.fontStyle)??"normal"}),u=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.fontFamily)??"sans-serif"}),c=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.textAlign)??"center"}),f=t.computed(()=>{var K;return((K=i.font)==null?void 0:K.textBaseline)??"hanging"}),m=t.computed(()=>i.gap[0]),g=t.computed(()=>i.gap[1]),v=t.computed(()=>m.value/2),b=t.computed(()=>g.value/2),w=t.computed(()=>{var K;return((K=i.offset)==null?void 0:K[0])??v.value}),_=t.computed(()=>{var K;return((K=i.offset)==null?void 0:K[1])??b.value}),x=()=>{const K={zIndex:i.zIndex,position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",backgroundRepeat:"repeat"};let G=w.value-v.value,j=_.value-b.value;return G>0&&(K.left=`${G}px`,K.width=`calc(100% - ${G}px)`,G=0),j>0&&(K.top=`${j}px`,K.height=`calc(100% - ${j}px)`,j=0),K.backgroundPosition=`${G}px ${j}px`,K},E=t.shallowRef(null),k=t.shallowRef(),P=t.ref(!1),D=()=>{k.value&&(k.value.remove(),k.value=void 0)},R=(K,G)=>{var j;E.value&&k.value&&(P.value=!0,k.value.setAttribute("style",_oe({...x(),backgroundImage:`url('${K}')`,backgroundSize:`${Math.floor(G)}px`})),(j=E.value)==null||j.append(k.value),setTimeout(()=>{P.value=!1}))},z=K=>{let G=120,j=64,N=0;const{image:I,content:L,width:U,height:O,rotate:Q}=i;if(!I&&K.measureText){K.font=`${Number(A.value)}px ${u.value}`;const W=nr(L)?L:[L];let Z=0,J=0;W.forEach(ae=>{const{width:ce,fontBoundingBoxAscent:q,fontBoundingBoxDescent:fe,actualBoundingBoxAscent:re,actualBoundingBoxDescent:te}=K.measureText(ae),le=en(q)?re+te:q+fe;ce>Z&&(Z=Math.ceil(ce)),le>J&&(J=Math.ceil(le))}),G=Z,j=J*W.length+(W.length-1)*p.value;const ne=Math.PI/180*Number(Q);N=Math.ceil(Math.abs(Math.sin(ne)*j)/2),G+=N}return[U??G,O??j,N]},F=Eoe(),H=()=>{const K=document.createElement("canvas").getContext("2d"),G=i.image,j=i.content,N=i.rotate;if(K){k.value||(k.value=document.createElement("div"));const I=woe(),[L,U,O]=z(K),Q=W=>{const[Z,J]=F(W||"",N,I,L,U,{color:y.value,fontSize:A.value,fontStyle:d.value,fontWeight:h.value,fontFamily:u.value,fontGap:p.value,textAlign:c.value,textBaseline:f.value},m.value,g.value,O);R(Z,J)};if(G){const W=new Image;W.onload=()=>{Q(W)},W.onerror=()=>{Q(j)},W.crossOrigin="anonymous",W.referrerPolicy="no-referrer",W.src=G}else Q(j)}};return t.onMounted(()=>{H()}),t.watch(()=>i,()=>{H()},{deep:!0,flush:"post"}),t.onBeforeUnmount(()=>{D()}),rd(E,K=>{P.value||K.forEach(G=>{Coe(G,k.value)&&(D(),H())})},{attributes:!0,subtree:!0,childList:!0}),(K,G)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerRef",ref:E,style:t.normalizeStyle([C])},[t.renderSlot(K.$slots,"default")],4))}}),Soe=Boe;Tr(Soe);const koe=["absolute","fixed"],Poe=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],__=Wt({placement:{type:et(String),values:Poe,default:"bottom"},reference:{type:et(Object),default:null},strategy:{type:et(String),values:koe,default:"absolute"},offset:{type:Number,default:10},showArrow:Boolean,zIndex:{type:Number,default:2001}}),Moe={close:()=>!0},Toe=Wt({modelValue:Boolean,current:{type:Number},showArrow:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeIcon:{type:Pn},placement:__.placement,contentStyle:{type:et([Object])},mask:{type:et([Boolean,Object]),default:!0},gap:{type:et(Object),default:()=>({offset:6,radius:2})},zIndex:{type:Number},scrollIntoViewOptions:{type:et([Boolean,Object]),default:()=>({block:"center"})},type:{type:et(String)},appendTo:{type:et([String,Object]),default:"body"},closeOnPressEscape:{type:Boolean,default:!0},targetAreaClickable:{type:Boolean,default:!0}}),Ioe={[Pr]:s=>Bn(s),"update:current":s=>lr(s),close:s=>lr(s),finish:()=>!0,change:s=>lr(s)},Doe=Wt({target:{type:et([String,Object,Function])},title:String,description:String,showClose:{type:Boolean,default:void 0},closeIcon:{type:Pn},showArrow:{type:Boolean,default:void 0},placement:__.placement,mask:{type:et([Boolean,Object]),default:void 0},contentStyle:{type:et([Object])},prevButtonProps:{type:et(Object)},nextButtonProps:{type:et(Object)},scrollIntoViewOptions:{type:et([Boolean,Object]),default:void 0},type:{type:et(String)}}),Roe={close:()=>!0},Foe=(s,C,i,p,y)=>{const A=t.ref(null),h=()=>{let f;return Ar(s.value)?f=document.querySelector(s.value):Nr(s.value)?f=s.value():f=s.value,f},d=()=>{const f=h();if(!f||!C.value){A.value=null;return}Noe(f)||f.scrollIntoView(y.value);const{left:m,top:g,width:v,height:b}=f.getBoundingClientRect();A.value={left:m,top:g,width:v,height:b,radius:0}};t.onMounted(()=>{t.watch([C,s],()=>{d()},{immediate:!0}),window.addEventListener("resize",d)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",d)});const u=f=>(nr(i.value.offset)?i.value.offset[f]:i.value.offset)??6,c=t.computed(()=>{var v;if(!A.value)return A.value;const f=u(0),m=u(1),g=((v=i.value)==null?void 0:v.radius)||2;return{left:A.value.left-f,top:A.value.top-m,width:A.value.width+f*2,height:A.value.height+m*2,radius:g}});return{mergedPosInfo:c,triggerTarget:t.computed(()=>{const f=h();return!p.value||!f||!window.DOMRect?f||void 0:{getBoundingClientRect(){var m,g,v,b;return window.DOMRect.fromRect({width:((m=c.value)==null?void 0:m.width)||0,height:((g=c.value)==null?void 0:g.height)||0,x:((v=c.value)==null?void 0:v.left)||0,y:((b=c.value)==null?void 0:b.top)||0})}}})}},TA=Symbol("ElTour");function Noe(s){const C=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,{top:p,right:y,bottom:A,left:h}=s.getBoundingClientRect();return p>=0&&h>=0&&y<=C&&A<=i}const Ooe=(s,C,i,p,y,A,h,d)=>{const u=t.ref(),c=t.ref(),f=t.ref({}),m={x:u,y:c,placement:p,strategy:y,middlewareData:f},g=t.computed(()=>{const x=[rz(t.unref(A)),iz(),nz(),Loe()];return t.unref(d)&&t.unref(i)&&x.push(sz({element:t.unref(i)})),x}),v=async()=>{if(!un)return;const x=t.unref(s),E=t.unref(C);if(!x||!E)return;const k=await oz(x,E,{placement:t.unref(p),strategy:t.unref(y),middleware:t.unref(g)});zf(m).forEach(P=>{m[P].value=k[P]})},b=t.computed(()=>{if(!t.unref(s))return{position:"fixed",top:"50%",left:"50%",transform:"translate3d(-50%, -50%, 0)",maxWidth:"100vw",zIndex:t.unref(h)};const{overflow:x}=t.unref(f);return{position:t.unref(y),zIndex:t.unref(h),top:t.unref(c)!=null?`${t.unref(c)}px`:"",left:t.unref(u)!=null?`${t.unref(u)}px`:"",maxWidth:x!=null&&x.maxWidth?`${x==null?void 0:x.maxWidth}px`:""}}),w=t.computed(()=>{if(!t.unref(d))return{};const{arrow:x}=t.unref(f);return{left:(x==null?void 0:x.x)!=null?`${x==null?void 0:x.x}px`:"",top:(x==null?void 0:x.y)!=null?`${x==null?void 0:x.y}px`:""}});let _;return t.onMounted(()=>{const x=t.unref(s),E=t.unref(C);x&&E&&(_=ez(x,E,v)),t.watchEffect(()=>{v()})}),t.onBeforeUnmount(()=>{_&&_()}),{update:v,contentStyle:b,arrowStyle:w}},Loe=()=>({name:"overflow",async fn(s){const C=await tz(s);let i=0;return C.left>0&&(i=C.left),C.right>0&&(i=C.right),{data:{maxWidth:s.rects.floating.width-i}}}}),joe=Wt({zIndex:{type:Number,default:1001},visible:Boolean,fill:{type:String,default:"rgba(0,0,0,0.5)"},pos:{type:et(Object)},targetAreaClickable:{type:Boolean,default:!0}}),Voe={style:{width:"100%",height:"100%"}},Uoe=["d"];var zoe=t.defineComponent({name:"ElTourMask",inheritAttrs:!1,__name:"mask",props:joe,setup(s){const C=s,{ns:i}=t.inject(TA),p=t.computed(()=>{var f;return((f=C.pos)==null?void 0:f.radius)??2}),y=t.computed(()=>{const f=p.value,m=`a${f},${f} 0 0 1`;return{topRight:`${m} ${f},${f}`,bottomRight:`${m} ${-f},${f}`,bottomLeft:`${m} ${-f},${-f}`,topLeft:`${m} ${f},${-f}`}}),{width:A,height:h}=L0(),d=t.computed(()=>{const f=A.value,m=h.value,g=y.value,v=`M${f},0 L0,0 L0,${m} L${f},${m} L${f},0 Z`,b=p.value;return C.pos?`${v} M${C.pos.left+b},${C.pos.top} h${C.pos.width-b*2} ${g.topRight} v${C.pos.height-b*2} ${g.bottomRight} h${-C.pos.width+b*2} ${g.bottomLeft} v${-C.pos.height+b*2} ${g.topLeft} z`:v}),u=t.computed(()=>({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:C.zIndex,pointerEvents:C.pos&&C.targetAreaClickable?"none":"auto"})),c=t.computed(()=>({fill:C.fill,pointerEvents:"auto",cursor:"auto"}));return mm(t.toRef(C,"visible"),{ns:i}),(f,m)=>s.visible?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:0,class:t.unref(i).e("mask"),style:u.value},f.$attrs),[(t.openBlock(),t.createElementBlock("svg",Voe,[t.createElementVNode("path",{class:t.normalizeClass(t.unref(i).e("hollow")),style:t.normalizeStyle(c.value),d:d.value},null,14,Uoe)]))],16)):t.createCommentVNode("v-if",!0)}}),Hoe=zoe;const $oe=["data-side"];var Goe=t.defineComponent({name:"ElTourContent",__name:"content",props:__,emits:Moe,setup(s,{emit:C}){const i=s,p=C,y=t.ref(i.placement),A=t.ref(i.strategy),h=t.ref(null),d=t.ref(null);t.watch(()=>i.placement,()=>{y.value=i.placement});const{contentStyle:u,arrowStyle:c}=Ooe(t.toRef(i,"reference"),h,d,y,A,t.toRef(i,"offset"),t.toRef(i,"zIndex"),t.toRef(i,"showArrow")),f=t.computed(()=>y.value.split("-")[0]),{ns:m}=t.inject(TA),g=()=>{p("close")},v=b=>{b.detail.focusReason==="pointer"&&b.preventDefault()};return(b,w)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"contentRef",ref:h,style:t.normalizeStyle(t.unref(u)),class:t.normalizeClass(t.unref(m).e("content")),"data-side":f.value,tabindex:"-1"},[t.createVNode(t.unref(md),{loop:"",trapped:"","focus-start-el":"container","focus-trap-el":h.value||void 0,onReleaseRequested:g,onFocusoutPrevented:v},{default:t.withCtx(()=>[t.renderSlot(b.$slots,"default")]),_:3},8,["focus-trap-el"]),s.showArrow?(t.openBlock(),t.createElementBlock("span",{key:0,ref_key:"arrowRef",ref:d,style:t.normalizeStyle(t.unref(c)),class:t.normalizeClass(t.unref(m).e("arrow"))},null,6)):t.createCommentVNode("v-if",!0)],14,$oe))}}),Qoe=Goe,Woe=t.defineComponent({name:"ElTourSteps",props:{current:{type:Number,default:0}},emits:["update-total"],setup(s,{slots:C,emit:i}){let p=0;return()=>{var u,c;const y=(u=C.default)==null?void 0:u.call(C),A=[];let h=0;function d(f){nr(f)&&f.forEach(m=>{var g;((g=(m==null?void 0:m.type)||{})==null?void 0:g.name)==="ElTourStep"&&(A.push(m),h+=1)})}return y.length&&d(Do((c=y[0])==null?void 0:c.children)),p!==h&&(p=h,i("update-total",h)),A.length?A[s.current]:null}}}),Koe=t.defineComponent({name:"ElTour",inheritAttrs:!1,__name:"tour",props:Toe,emits:Ioe,setup(s,{emit:C}){const i=s,p=C,y=zt("tour"),A=t.ref(0),h=t.ref(),d=t.computed(()=>!en(i.current)),u=t.ref(i.current??0),c=t.computed({get(){return en(i.current)?u.value:i.current},set(G){(d.value?i.current:u.value)!==G&&(d.value||(u.value=G),p("update:current",G))}}),f=t.computed(()=>{var G;return(G=h.value)==null?void 0:G.target}),m=t.computed(()=>[y.b(),k.value==="primary"?y.m("primary"):""]),g=t.computed(()=>{var G;return((G=h.value)==null?void 0:G.placement)||i.placement}),v=t.computed(()=>{var G;return((G=h.value)==null?void 0:G.contentStyle)??i.contentStyle}),b=t.computed(()=>{var G;return((G=h.value)==null?void 0:G.mask)??i.mask}),w=t.computed(()=>!!b.value&&i.modelValue),_=t.computed(()=>Bn(b.value)?void 0:b.value),x=t.computed(()=>{var G;return!!f.value&&(((G=h.value)==null?void 0:G.showArrow)??i.showArrow)}),E=t.computed(()=>{var G;return((G=h.value)==null?void 0:G.scrollIntoViewOptions)??i.scrollIntoViewOptions}),k=t.computed(()=>{var G;return((G=h.value)==null?void 0:G.type)??i.type}),{nextZIndex:P}=qf(),D=P(),R=t.computed(()=>i.zIndex??D),{mergedPosInfo:z,triggerTarget:F}=Foe(f,t.toRef(i,"modelValue"),t.toRef(i,"gap"),b,E);t.watch(()=>i.current,G=>!en(G)&&(u.value=G)),t.watch(c,(G,j)=>{!i.modelValue||G===j||p(Gr,G)},{flush:"post"}),t.watch(()=>i.modelValue,G=>{!G&&c.value!==0&&(c.value=0)});const H=()=>{i.closeOnPressEscape&&(p(Pr,!1),p("close",c.value))},$=G=>{A.value=G},K=t.useSlots();return t.provide(TA,{currentStep:h,current:c,total:A,showClose:t.toRef(i,"showClose"),closeIcon:t.toRef(i,"closeIcon"),mergedType:k,ns:y,slots:K,updateModelValue(G){p(Pr,G)},onClose(){p("close",c.value)},onFinish(){p("finish")}}),(G,j)=>{var N,I;return t.openBlock(),t.createElementBlock(t.Fragment,null,[(t.openBlock(),t.createBlock(t.Teleport,{to:s.appendTo},[t.createElementVNode("div",t.mergeProps({class:m.value},G.$attrs),[t.createVNode(Hoe,{visible:w.value,fill:(N=_.value)==null?void 0:N.color,style:t.normalizeStyle((I=_.value)==null?void 0:I.style),pos:t.unref(z),"z-index":R.value,"target-area-clickable":s.targetAreaClickable},null,8,["visible","fill","style","pos","z-index","target-area-clickable"]),s.modelValue?(t.openBlock(),t.createBlock(Qoe,{key:c.value,reference:t.unref(F),placement:g.value,"show-arrow":x.value,"z-index":R.value,style:t.normalizeStyle(v.value),onClose:H},{default:t.withCtx(()=>[t.createVNode(t.unref(Woe),{current:c.value,onUpdateTotal:$},{default:t.withCtx(()=>[t.renderSlot(G.$slots,"default")]),_:3},8,["current"])]),_:3},8,["reference","placement","show-arrow","z-index","style"])):t.createCommentVNode("v-if",!0)],16)],8,["to"])),t.createCommentVNode(" just for IDE "),t.createCommentVNode("v-if",!0)],64)}}}),Xoe=Koe;const Yoe=["aria-label"];var Joe=t.defineComponent({name:"ElTourStep",__name:"step",props:Doe,emits:Roe,setup(s,{emit:C}){const i=s,p=C,{Close:y}=XB,{t:A}=Yr(),{currentStep:h,current:d,total:u,showClose:c,closeIcon:f,mergedType:m,ns:g,slots:v,updateModelValue:b,onClose:w,onFinish:_}=t.inject(TA);t.watch(i,H=>{h.value=H},{immediate:!0});const x=t.computed(()=>i.showClose??c.value),E=t.computed(()=>i.closeIcon??f.value??y),k=H=>{if(H)return Uc(H,["children","onClick"])},P=()=>{var H,$;d.value-=1,(H=i.prevButtonProps)!=null&&H.onClick&&(($=i.prevButtonProps)==null||$.onClick())},D=()=>{var H;d.value>=u.value-1?R():d.value+=1,(H=i.nextButtonProps)!=null&&H.onClick&&i.nextButtonProps.onClick()},R=()=>{z(),_()},z=()=>{b(!1),w(),p("close")},F=H=>{var $;if(!(($=H.target)!=null&&$.isContentEditable))switch(Dn(H)){case Gt.left:H.preventDefault(),d.value>0&&P();break;case Gt.right:H.preventDefault(),D()}};return t.onMounted(()=>{window.addEventListener("keydown",F)}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",F)}),(H,$)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[x.value?(t.openBlock(),t.createElementBlock("button",{key:0,"aria-label":t.unref(A)("el.tour.close"),class:t.normalizeClass(t.unref(g).e("closebtn")),type:"button",onClick:z},[t.createVNode(t.unref(ir),{class:t.normalizeClass(t.unref(g).e("close"))},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(E.value)))]),_:1},8,["class"])],10,Yoe)):t.createCommentVNode("v-if",!0),t.createElementVNode("header",{class:t.normalizeClass([t.unref(g).e("header"),{"show-close":t.unref(c)}])},[t.renderSlot(H.$slots,"header",{},()=>[t.createElementVNode("span",{role:"heading",class:t.normalizeClass(t.unref(g).e("title"))},t.toDisplayString(s.title),3)])],2),t.createElementVNode("div",{class:t.normalizeClass(t.unref(g).e("body"))},[t.renderSlot(H.$slots,"default",{},()=>[t.createElementVNode("span",null,t.toDisplayString(s.description),1)])],2),t.createElementVNode("footer",{class:t.normalizeClass(t.unref(g).e("footer"))},[t.createElementVNode("div",{class:t.normalizeClass(t.unref(g).b("indicators"))},[t.unref(v).indicators?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(v).indicators),{key:0,current:t.unref(d),total:t.unref(u)},null,8,["current","total"])):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(t.unref(u),(K,G)=>(t.openBlock(),t.createElementBlock("span",{key:K,class:t.normalizeClass([t.unref(g).b("indicator"),t.unref(g).is("active",G===t.unref(d))])},null,2))),128))],2),t.createElementVNode("div",{class:t.normalizeClass(t.unref(g).b("buttons"))},[t.unref(d)>0?(t.openBlock(),t.createBlock(t.unref(gs),t.mergeProps({key:0,size:"small",type:t.unref(m)},k(s.prevButtonProps),{onClick:P}),{default:t.withCtx(()=>{var K;return[t.createTextVNode(t.toDisplayString(((K=s.prevButtonProps)==null?void 0:K.children)??t.unref(A)("el.tour.previous")),1)]}),_:1},16,["type"])):t.createCommentVNode("v-if",!0),t.unref(d)<=t.unref(u)-1?(t.openBlock(),t.createBlock(t.unref(gs),t.mergeProps({key:1,size:"small",type:t.unref(m)==="primary"?"default":"primary"},k(s.nextButtonProps),{onClick:D}),{default:t.withCtx(()=>{var K;return[t.createTextVNode(t.toDisplayString(((K=s.nextButtonProps)==null?void 0:K.children)??(t.unref(d)===t.unref(u)-1?t.unref(A)("el.tour.finish"):t.unref(A)("el.tour.next"))),1)]}),_:1},16,["type"])):t.createCommentVNode("v-if",!0)],2)],2)],64))}}),qT=Joe;Tr(Xoe,{TourStep:qT}),ai(qT);const Zoe=Wt({container:{type:et([String,Object])},offset:{type:Number,default:0},bound:{type:Number,default:15},duration:{type:Number,default:300},marker:{type:Boolean,default:!0},type:{type:et(String),default:"default"},direction:{type:et(String),default:"vertical"},selectScrollTop:Boolean}),qoe={change:s=>Ar(s),click:(s,C)=>s instanceof MouseEvent&&(Ar(C)||en(C))},IA=s=>{if(!un||s==="")return null;if(Ar(s))try{return document.querySelector(s)}catch{return null}return s};function eae(s){let C=0;const i=(...p)=>{C&&To(C),C=ms(()=>{s(...p),C=0})};return i.cancel=()=>{To(C),C=0},i}const e3=Symbol("anchor");var tae=t.defineComponent({name:"ElAnchor",__name:"anchor",props:Zoe,emits:qoe,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.useSlots(),h=t.ref(""),d=t.ref({}),u=t.ref(null),c=t.ref(null),f=t.ref(),m={};let g=!1,v=0;const b=zt("anchor"),w=t.computed(()=>[b.b(),p.type==="underline"?b.m("underline"):"",b.m(p.direction)]),_=G=>{m[G.href]=G.el},x=G=>{delete m[G]},E=G=>{h.value!==G&&(h.value=G,y(Gr,G))};let k=null,P="";const D=G=>{if(!f.value)return;const j=IA(G);if(!j)return;if(k){if(P===G)return;k()}P=G,g=!0;const N=$E(j,f.value),I=bb(j,N),L=N.scrollHeight-N.clientHeight,U=Math.min(I-p.offset,L);k=e9(f.value,v,U,p.duration,()=>{setTimeout(()=>{g=!1,P=""},20)})},R=G=>{G&&(E(G),D(G))},z=(G,j)=>{y("click",G,j),R(j)},F=eae(()=>{f.value&&(v=GE(f.value));const G=H();g||en(G)||E(G)}),H=()=>{if(!f.value)return;const G=GE(f.value),j=[];for(const N of Object.keys(m)){const I=IA(N);if(!I)continue;const L=$E(I,f.value),U=bb(I,L);j.push({top:U-p.offset-p.bound,href:N})}j.sort((N,I)=>N.top-I.top);for(let N=0;N<j.length;N++){const I=j[N],L=j[N+1];if(N===0&&G===0)return p.selectScrollTop?I.href:"";if(I.top<=G&&(!L||L.top>G))return I.href}},$=()=>{const G=IA(p.container);!G||Uf(G)?f.value=window:f.value=G};vn(f,"scroll",F);const K=()=>{t.nextTick(()=>{if(!u.value||!c.value||!h.value){d.value={};return}const G=m[h.value];if(!G){d.value={};return}const j=u.value.getBoundingClientRect(),N=c.value.getBoundingClientRect(),I=G.getBoundingClientRect();if(p.direction==="horizontal"){const L=I.left-j.left;d.value={left:`${L}px`,width:`${I.width}px`,opacity:1}}else{const L=I.top-j.top+(I.height-N.height)/2;d.value={top:`${L}px`,opacity:1}}})};return t.watch(h,K),t.watch(()=>{var G;return(G=A.default)==null?void 0:G.call(A)},K),t.onMounted(()=>{$();const G=decodeURIComponent(window.location.hash);IA(G)?R(G):F()}),t.watch(()=>p.container,()=>{$()}),t.provide(e3,{ns:b,direction:p.direction,currentAnchor:h,addLink:_,removeLink:x,handleClick:z}),C({scrollTo:R}),(G,j)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"anchorRef",ref:u,class:t.normalizeClass(w.value)},[s.marker?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"markerRef",ref:c,class:t.normalizeClass(t.unref(b).e("marker")),style:t.normalizeStyle(d.value)},null,6)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(t.unref(b).e("list"))},[t.renderSlot(G.$slots,"default")],2)],2))}}),rae=tae;const nae=Wt({title:String,href:String}),iae=["href"];var sae=t.defineComponent({name:"ElAnchorLink",__name:"anchor-link",props:nae,setup(s){const C=s,i=t.ref(null),{ns:p,direction:y,currentAnchor:A,addLink:h,removeLink:d,handleClick:u}=t.inject(e3),c=t.computed(()=>[p.e("link"),p.is("active",A.value===C.href)]),f=m=>{u(m,C.href)};return t.watch(()=>C.href,(m,g)=>{t.nextTick(()=>{g&&d(g),m&&h({href:m,el:i.value})})}),t.onMounted(()=>{const{href:m}=C;m&&h({href:m,el:i.value})}),t.onBeforeUnmount(()=>{const{href:m}=C;m&&d(m)}),(m,g)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(t.unref(p).e("item"))},[t.createElementVNode("a",{ref_key:"linkRef",ref:i,class:t.normalizeClass(c.value),href:s.href,onClick:f},[t.renderSlot(m.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(s.title),1)])],10,iae),m.$slots["sub-link"]&&t.unref(y)==="vertical"?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(p).e("list"))},[t.renderSlot(m.$slots,"sub-link")],2)):t.createCommentVNode("v-if",!0)],2))}}),t3=sae;Tr(rae,{AnchorLink:t3}),ai(t3);const r3={label:"label",value:"value",disabled:"disabled"},oae=Wt({direction:{type:et(String),default:"horizontal"},options:{type:et(Array),default:()=>[]},modelValue:{type:[String,Number,Boolean],default:void 0},props:{type:et(Object),default:()=>r3},block:Boolean,size:Qi,disabled:{type:Boolean,default:void 0},validateEvent:{type:Boolean,default:!0},id:String,name:String,...Vs(["ariaLabel"])}),aae={[Pr]:s=>Ar(s)||lr(s)||Bn(s),[Gr]:s=>Ar(s)||lr(s)||Bn(s)},lae=["id","aria-label","aria-labelledby"],cae=["name","disabled","checked","onChange"];var uae=t.defineComponent({name:"ElSegmented",__name:"segmented",props:oae,emits:aae,setup(s,{emit:C}){const i=s,p=C,y=zt("segmented"),A=ws(),h=ji(),d=ri(),{formItem:u}=ls(),{inputId:c,isLabeledByFormItem:f}=mo(i,{formItemContext:u}),m=t.ref(null),g=RU(),v=t.reactive({isInit:!1,width:0,height:0,translateX:0,translateY:0,focusVisible:!1}),b=(K,G)=>{const j=_(G);p(Pr,j),p(Gr,j),K.target.checked=j===i.modelValue},w=t.computed(()=>({...r3,...i.props})),_=K=>mn(K)?K[w.value.value]:K,x=K=>mn(K)?K[w.value.label]:K,E=K=>!!(d.value||mn(K)&&K[w.value.disabled]),k=K=>i.modelValue===_(K),P=K=>i.options.find(G=>_(G)===K),D=K=>[y.e("item"),y.is("selected",k(K)),y.is("disabled",E(K))],R=()=>{if(!m.value)return;const K=m.value.querySelector(".is-selected"),G=m.value.querySelector(".is-selected input");if(!K||!G){v.width=0,v.height=0,v.translateX=0,v.translateY=0,v.focusVisible=!1;return}v.isInit=!0,i.direction==="vertical"?(v.height=K.offsetHeight,v.translateY=K.offsetTop):(v.width=K.offsetWidth,v.translateX=K.offsetLeft);try{v.focusVisible=G.matches(":focus-visible")}catch{}},z=t.computed(()=>[y.b(),y.m(h.value),y.is("block",i.block)]),F=t.computed(()=>({width:i.direction==="vertical"?"100%":`${v.width}px`,height:i.direction==="vertical"?`${v.height}px`:"100%",transform:i.direction==="vertical"?`translateY(${v.translateY}px)`:`translateX(${v.translateX}px)`,display:v.isInit?"block":"none"})),H=t.computed(()=>[y.e("item-selected"),y.is("disabled",E(P(i.modelValue))),y.is("focus-visible",v.focusVisible)]),$=t.computed(()=>i.name||A.value);return ti(m,R),t.watch(g,R),t.watch(()=>i.options,R,{deep:!0,flush:"post"}),t.watch(()=>i.modelValue,()=>{var K;R(),i.validateEvent&&((K=u==null?void 0:u.validate)==null||K.call(u,"change").catch(Xr))},{flush:"post"}),(K,G)=>s.options.length?(t.openBlock(),t.createElementBlock("div",{key:0,id:t.unref(c),ref_key:"segmentedRef",ref:m,class:t.normalizeClass(z.value),role:"radiogroup","aria-label":t.unref(f)?void 0:s.ariaLabel||"segmented","aria-labelledby":t.unref(f)?t.unref(u).labelId:void 0},[t.createElementVNode("div",{class:t.normalizeClass([t.unref(y).e("group"),t.unref(y).m(s.direction)])},[t.createElementVNode("div",{style:t.normalizeStyle(F.value),class:t.normalizeClass(H.value)},null,6),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.options,(j,N)=>(t.openBlock(),t.createElementBlock("label",{key:N,class:t.normalizeClass(D(j))},[t.createElementVNode("input",{class:t.normalizeClass(t.unref(y).e("item-input")),type:"radio",name:$.value,disabled:E(j),checked:k(j),onChange:I=>b(I,j)},null,42,cae),t.createElementVNode("div",{class:t.normalizeClass(t.unref(y).e("item-label"))},[t.renderSlot(K.$slots,"default",{item:j},()=>[t.createTextVNode(t.toDisplayString(x(j)),1)])],2)],2))),128))],2)],10,lae)):t.createCommentVNode("v-if",!0)}}),dae=uae;Tr(dae);const fae=(s,C)=>{const i=s.toLowerCase();return(C.label||C.value||"").toLowerCase().includes(i)},hae=(s,C,i)=>{const{selectionEnd:p}=s;if(p===null)return;const y=s.value,A=os(C);let h=-1,d;for(let u=p-1;u>=0;--u){const c=y[u];if(h===-1&&(c===i||c===`
|
|
67
|
-
`||c==="\r")){h=u;continue}if(A.includes(c)){const f=h===-1?p:h;d={pattern:y.slice(u+1,f),start:u+1,end:f,prefix:c,prefixIndex:u,splitIndex:h,selectionEnd:p};break}}return d},pae=(s,C={debug:!1,useSelectionEnd:!1})=>{const i=s.selectionStart!==null?s.selectionStart:0,p=s.selectionEnd!==null?s.selectionEnd:0,y=C.useSelectionEnd?p:i,A=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];if(C.debug){const g=document.querySelector("#input-textarea-caret-position-mirror-div");g!=null&&g.parentNode&&g.parentNode.removeChild(g)}const h=document.createElement("div");h.id="input-textarea-caret-position-mirror-div",document.body.appendChild(h);const d=h.style,u=window.getComputedStyle(s),c=s.nodeName==="INPUT";d.whiteSpace=c?"nowrap":"pre-wrap",c||(d.wordWrap="break-word"),d.position="absolute",C.debug||(d.visibility="hidden"),A.forEach(g=>{if(c&&g==="lineHeight")if(u.boxSizing==="border-box"){const v=Number.parseInt(u.height),b=Number.parseInt(u.paddingTop)+Number.parseInt(u.paddingBottom)+Number.parseInt(u.borderTopWidth)+Number.parseInt(u.borderBottomWidth),w=b+Number.parseInt(u.lineHeight);v>w?d.lineHeight=`${v-b}px`:v===w?d.lineHeight=u.lineHeight:d.lineHeight="0"}else d.lineHeight=u.height;else d[g]=u[g]}),hm()?s.scrollHeight>Number.parseInt(u.height)&&(d.overflowY="scroll"):d.overflow="hidden",h.textContent=s.value.slice(0,Math.max(0,y)),c&&h.textContent&&(h.textContent=h.textContent.replace(/\s/g," "));const f=document.createElement("span");f.textContent=s.value.slice(Math.max(0,y))||".",f.style.position="relative",f.style.left=`${-s.scrollLeft}px`,f.style.top=`${-s.scrollTop}px`,h.appendChild(f);const m={top:f.offsetTop+Number.parseInt(u.borderTopWidth),left:f.offsetLeft+Number.parseInt(u.borderLeftWidth),height:Number.parseInt(u.fontSize)*1.5};return C.debug?f.style.backgroundColor="#aaa":document.body.removeChild(h),m.left>=s.clientWidth&&(m.left=s.clientWidth),m},mae=Wt({...Py,options:{type:et(Array),default:()=>[]},prefix:{type:et([String,Array]),default:"@",validator:s=>Ar(s)?s.length===1:s.every(C=>Ar(C)&&C.length===1)},split:{type:String,default:" ",validator:s=>s.length===1},filterOption:{type:et([Boolean,Function]),default:()=>fae,validator:s=>s===!1?!0:Nr(s)},placement:{type:et(String),default:"bottom"},showArrow:Boolean,offset:{type:Number,default:0},whole:Boolean,checkIsWhole:{type:et(Function)},modelValue:String,loading:Boolean,popperClass:Qn.popperClass,popperStyle:Qn.popperStyle,popperOptions:{type:et(Object),default:()=>({})},props:{type:et(Object),default:()=>n3}}),Aae={[Pr]:s=>Ar(s),"whole-remove":(s,C)=>Ar(s)&&Ar(C),input:s=>Ar(s),search:(s,C)=>Ar(s)&&Ar(C),select:(s,C)=>mn(s)&&Ar(C),focus:s=>s instanceof FocusEvent,blur:s=>s instanceof FocusEvent},n3={value:"value",label:"label",disabled:"disabled"},gae=Wt({options:{type:et(Array),default:()=>[]},loading:Boolean,disabled:Boolean,contentId:String,ariaLabel:String}),vae={select:s=>Ar(s.value)},yae=["id","aria-disabled","aria-selected","onMousemove","onClick"];var bae=t.defineComponent({name:"ElMentionDropdown",__name:"mention-dropdown",props:gae,emits:vae,setup(s,{expose:C,emit:i}){const p=s,y=i,A=zt("mention"),{t:h}=Yr(),d=t.ref(-1),u=t.ref(),c=t.ref(),f=t.ref(),m=(P,D)=>[A.be("dropdown","item"),A.is("hovering",d.value===D),A.is("disabled",P.disabled||p.disabled)],g=P=>{P.disabled||p.disabled||y("select",P)},v=P=>{d.value=P},b=t.computed(()=>p.disabled||p.options.every(P=>P.disabled)),w=t.computed(()=>p.options[d.value]),_=()=>{!w.value||w.value.disabled||p.disabled||y("select",w.value)},x=P=>{const{options:D}=p;if(D.length===0||b.value)return;P==="next"?(d.value++,d.value===D.length&&(d.value=0)):P==="prev"&&(d.value--,d.value<0&&(d.value=D.length-1));const R=D[d.value];if(R.disabled){x(P);return}t.nextTick(()=>E(R))},E=P=>{var F,H,$,K;const{options:D}=p,R=D.findIndex(G=>G.value===P.value),z=(F=c.value)==null?void 0:F[R];if(z){const G=($=(H=f.value)==null?void 0:H.querySelector)==null?void 0:$.call(H,`.${A.be("dropdown","wrap")}`);G&&$0(G,z)}(K=u.value)==null||K.handleScroll()},k=()=>{b.value||p.options.length===0?d.value=-1:d.value=p.options.findIndex(P=>!P.disabled)};return t.watch(()=>p.options,k,{immediate:!0}),C({hoveringIndex:d,navigateOptions:x,selectHoverOption:_,hoverOption:w}),(P,D)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropdownRef",ref:f,class:t.normalizeClass(t.unref(A).b("dropdown"))},[P.$slots.header?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(A).be("dropdown","header"))},[t.renderSlot(P.$slots,"header")],2)):t.createCommentVNode("v-if",!0),t.withDirectives(t.createVNode(t.unref(gi),{id:s.contentId,ref_key:"scrollbarRef",ref:u,tag:"ul","wrap-class":t.unref(A).be("dropdown","wrap"),"view-class":t.unref(A).be("dropdown","list"),role:"listbox","aria-label":s.ariaLabel,"aria-orientation":"vertical"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.options,(R,z)=>(t.openBlock(),t.createElementBlock("li",{id:`${s.contentId}-${z}`,ref_for:!0,ref_key:"optionRefs",ref:c,key:z,class:t.normalizeClass(m(R,z)),role:"option","aria-disabled":R.disabled||s.disabled||void 0,"aria-selected":d.value===z,onMousemove:F=>v(z),onClick:t.withModifiers(F=>g(R),["stop"])},[t.renderSlot(P.$slots,"label",{item:R,index:z},()=>[t.createElementVNode("span",null,t.toDisplayString(R.label??R.value),1)])],42,yae))),128))]),_:3},8,["id","wrap-class","view-class","aria-label"]),[[t.vShow,s.options.length>0&&!s.loading]]),s.loading?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(A).be("dropdown","loading"))},[t.renderSlot(P.$slots,"loading",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(h)("el.mention.loading")),1)])],2)):t.createCommentVNode("v-if",!0),P.$slots.footer?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(t.unref(A).be("dropdown","footer"))},[t.renderSlot(P.$slots,"footer")],2)):t.createCommentVNode("v-if",!0)],2))}}),_ae=bae,wae=t.defineComponent({name:"ElMention",inheritAttrs:!1,__name:"mention",props:mae,emits:Aae,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.computed(()=>{const U=Ai.props??[],O=nr(U)?U:Object.keys(U);return Fa(p,O)}),h=zt("mention"),d=ri(),u=ws(),c=t.ref(),f=t.ref(),m=t.ref(),g=t.ref(!1),v=t.ref(),b=t.ref(),w=t.computed(()=>p.showArrow?p.placement:`${p.placement}-start`),_=t.computed(()=>p.showArrow?["bottom","top"]:["bottom-start","top-start"]),x=t.computed(()=>({...n3,...p.props})),E=U=>{const O={label:U[x.value.label],value:U[x.value.value],disabled:U[x.value.disabled]};return{...U,...O}},k=t.computed(()=>p.options.map(E)),P=t.computed(()=>{const{filterOption:U}=p;return!b.value||!U?k.value:k.value.filter(O=>U(b.value.pattern,O))}),D=t.computed(()=>g.value&&(!!P.value.length||p.loading)),R=t.computed(()=>{var U;return`${u.value}-${(U=m.value)==null?void 0:U.hoveringIndex}`}),z=U=>{y(Pr,U),y(Li,U),N()},F=U=>{var Q,W,Z,J;if((Q=c.value)!=null&&Q.isComposing)return;const O=Dn(U);switch(O){case Gt.left:case Gt.right:N();break;case Gt.up:case Gt.down:if(!g.value)return;U.preventDefault(),(W=m.value)==null||W.navigateOptions(O===Gt.up?"prev":"next");break;case Gt.enter:case Gt.numpadEnter:if(!g.value){p.type!=="textarea"&&N();return}U.preventDefault(),(Z=m.value)!=null&&Z.hoverOption?(J=m.value)==null||J.selectHoverOption():g.value=!1;break;case Gt.esc:if(!g.value)return;U.preventDefault(),g.value=!1;break;case Gt.backspace:if(p.whole&&b.value){const{splitIndex:ne,selectionEnd:ae,pattern:ce,prefixIndex:q,prefix:fe}=b.value,re=j();if(!re)return;const te=re.value,le=k.value.find(de=>de.value===ce);if((Nr(p.checkIsWhole)?p.checkIsWhole(ce,fe):le)&&ne!==-1&&ne+1===ae){U.preventDefault();const de=te.slice(0,q)+te.slice(ne+1);y(Pr,de),y(Li,de),y("whole-remove",ce,fe);const he=q;t.nextTick(()=>{re.selectionStart=he,re.selectionEnd=he,L()})}}}},{wrapperRef:H}=vl(c,{disabled:d,afterFocus(){N()},beforeBlur(U){var O;return(O=f.value)==null?void 0:O.isFocusInsideContent(U)},afterBlur(){g.value=!1}}),$=()=>{N()},K=U=>p.options.find(O=>U.value===O[x.value.value]),G=U=>{if(!b.value)return;const O=j();if(!O)return;const Q=O.value,{split:W}=p,Z=Q.slice(b.value.end),J=Z.startsWith(W),ne=`${U.value}${J?"":W}`,ae=Q.slice(0,b.value.start)+ne+Z;y(Pr,ae),y(Li,ae),y("select",K(U),b.value.prefix);const ce=b.value.start+ne.length+(J?1:0);t.nextTick(()=>{O.selectionStart=ce,O.selectionEnd=ce,O.focus(),L()})},j=()=>{var U,O;return p.type==="textarea"?(U=c.value)==null?void 0:U.textarea:(O=c.value)==null?void 0:O.input},N=()=>{setTimeout(()=>{I(),L(),t.nextTick(()=>{var U;return(U=f.value)==null?void 0:U.updatePopper()})},0)},I=()=>{const U=j();if(!U)return;const O=pae(U),Q=U.getBoundingClientRect(),W=H.value.getBoundingClientRect();v.value={position:"absolute",width:0,height:`${O.height}px`,left:`${O.left+Q.left-W.left}px`,top:`${O.top+Q.top-W.top}px`}},L=()=>{const U=j();if(document.activeElement!==U){g.value=!1;return}const{prefix:O,split:Q}=p;if(b.value=hae(U,O,Q),b.value&&b.value.splitIndex===-1){g.value=!0,y("search",b.value.pattern,b.value.prefix);return}g.value=!1};return C({input:c,tooltip:f,dropdownVisible:D}),(U,O)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"wrapperRef",ref:H,class:t.normalizeClass(t.unref(h).b())},[t.createVNode(t.unref(Ai),t.mergeProps(t.mergeProps(A.value,U.$attrs),{ref_key:"elInputRef",ref:c,"model-value":s.modelValue,disabled:t.unref(d),role:D.value?"combobox":void 0,"aria-activedescendant":D.value?R.value||"":void 0,"aria-controls":D.value?t.unref(u):void 0,"aria-expanded":D.value||void 0,"aria-label":s.ariaLabel,"aria-autocomplete":D.value?"none":void 0,"aria-haspopup":D.value?"listbox":void 0,onInput:z,onKeydown:F,onMousedown:$}),t.createSlots({_:2},[t.renderList(U.$slots,(Q,W)=>({name:W,fn:t.withCtx(Z=>[t.renderSlot(U.$slots,W,t.normalizeProps(t.guardReactiveProps(Z)))])}))]),1040,["model-value","disabled","role","aria-activedescendant","aria-controls","aria-expanded","aria-label","aria-autocomplete","aria-haspopup"]),t.createVNode(t.unref(Ji),{ref_key:"tooltipRef",ref:f,visible:D.value,"popper-class":[t.unref(h).e("popper"),s.popperClass],"popper-style":s.popperStyle,"popper-options":s.popperOptions,placement:w.value,"fallback-placements":_.value,effect:"light",pure:"",offset:s.offset,"show-arrow":s.showArrow},{default:t.withCtx(()=>[t.createElementVNode("div",{style:t.normalizeStyle(v.value)},null,4)]),content:t.withCtx(()=>[t.createVNode(_ae,{ref_key:"dropdownRef",ref:m,options:P.value,disabled:t.unref(d),loading:s.loading,"content-id":t.unref(u),"aria-label":s.ariaLabel,onSelect:G,onClick:O[0]||(O[0]=t.withModifiers(Q=>{var W;return(W=c.value)==null?void 0:W.focus()},["stop"]))},t.createSlots({_:2},[t.renderList(U.$slots,(Q,W)=>({name:W,fn:t.withCtx(Z=>[t.renderSlot(U.$slots,W,t.normalizeProps(t.guardReactiveProps(Z)))])}))]),1032,["options","disabled","loading","content-id","aria-label"])]),_:3},8,["visible","popper-class","popper-style","popper-options","placement","fallback-placements","offset","show-arrow"])],2))}}),Cae=wae;Tr(Cae);const xae=Wt({layout:{type:String,default:"horizontal",values:["horizontal","vertical"]},lazy:Boolean}),Eae={resizeStart:(s,C)=>!0,resize:(s,C)=>!0,resizeEnd:(s,C)=>!0,collapse:(s,C,i)=>!0},Bae=Wt({min:{type:[String,Number]},max:{type:[String,Number]},size:{type:[String,Number]},resizable:{type:Boolean,default:!0},collapsible:Boolean}),Sae={"update:size":s=>typeof s=="number"||typeof s=="string"};function kae(s){const C=t.ref(),{width:i,height:p}=$f(C);return{containerEl:C,containerSize:t.computed(()=>s.value==="horizontal"?i.value:p.value)}}function w_(s){return Number(s.slice(0,-1))/100}function C_(s){return Number(s.slice(0,-2))}function x_(s){return Ar(s)&&s.endsWith("%")}function E_(s){return Ar(s)&&s.endsWith("px")}function Pae(s,C){const i=t.computed(()=>s.value.map(h=>h.size)),p=t.computed(()=>s.value.length),y=t.ref([]);t.watch([i,p,C],()=>{var c;let h=[],d=0;for(let f=0;f<p.value;f+=1){const m=(c=s.value[f])==null?void 0:c.size;if(x_(m))h[f]=w_(m);else if(E_(m))h[f]=C_(m)/C.value;else if(m||m===0){const g=Number(m);Number.isNaN(g)||(h[f]=g/C.value)}else d+=1,h[f]=void 0}const u=h.reduce((f,m)=>f+(m||0),0);if(u>1||!d){const f=1/u;h=h.map(m=>m===void 0?0:m*f)}else{const f=(1-u)/d;h=h.map(m=>m===void 0?f:m)}y.value=h});const A=h=>h*C.value;return{percentSizes:y,pxSizes:t.computed(()=>y.value.map(A))}}function Mae(s,C,i,p){const y=_=>_*C.value||0;function A(_,x){return x_(_)?y(w_(_)):E_(_)?C_(_):_??x}const h=t.ref(0),d=t.ref(null);let u=[],c=Xr;const f=t.computed(()=>s.value.map(_=>[_.min,_.max]));t.watch(p,()=>{if(h.value){const _=new MouseEvent("mouseup",{bubbles:!0});window.dispatchEvent(_)}});const m=_=>{h.value=0,d.value={index:_,confirmed:!1},u=i.value},g=(_,x)=>{var K;let E=null;if((!d.value||!d.value.confirmed)&&x!==0){if(x>0)E=_,d.value={index:_,confirmed:!0};else for(let G=_;G>=0;G-=1)if(u[G]>0){E=G,d.value={index:G,confirmed:!0};break}}const k=E??((K=d.value)==null?void 0:K.index)??_,P=[...u],D=k+1,R=A(f.value[k][0],0),z=A(f.value[D][0],0),F=A(f.value[k][1],C.value||0),H=A(f.value[D][1],C.value||0);let $=x;P[k]+$<R&&($=R-P[k]),P[D]-$<z&&($=P[D]-z),P[k]+$>F&&($=F-P[k]),P[D]-$>H&&($=P[D]-H),P[k]+=$,P[D]-=$,h.value=$,c=()=>{s.value.forEach((G,j)=>{G.size=P[j]}),c=Xr},p.value||c()},v=()=>{p.value&&c(),h.value=0,d.value=null,u=[]},b=[];return{lazyOffset:h,onMoveStart:m,onMoving:g,onMoveEnd:v,movingIndex:d,onCollapse:(_,x)=>{b.length||b.push(...i.value.map((z,F)=>{var H;return z<=0?A((H=f.value[F])==null?void 0:H[0],0):z}));const E=i.value,k=x==="start"?_:_+1,P=x==="start"?_+1:_,D=E[k],R=E[P];if(D!==0&&R!==0)E[k]=0,E[P]+=D,b[_]=D;else{const z=D+R,F=co(b[_],0,z),H=z-F;E[P]=F,E[k]=H}s.value.forEach((z,F)=>{z.size=E[F]})}}}const i3=Symbol("splitterRootContextKey");var Tae=t.defineComponent({name:"ElSplitter",__name:"splitter",props:xae,emits:Eae,setup(s,{emit:C}){const i=zt("splitter"),p=C,y=s,A=t.toRef(y,"layout"),h=t.toRef(y,"lazy"),{containerEl:d,containerSize:u}=kae(A),{removeChild:c,children:f,addChild:m,ChildrenSorter:g}=Pm(t.getCurrentInstance(),"ElSplitterPanel");t.watch(f,()=>{_.value=null,f.value.forEach(($,K)=>{$.setIndex(K)})});const{percentSizes:v,pxSizes:b}=Pae(f,u),{lazyOffset:w,movingIndex:_,onMoveStart:x,onMoving:E,onMoveEnd:k,onCollapse:P}=Mae(f,u,b,h),D=t.computed(()=>({[i.cssVarBlockName("bar-offset")]:h.value?`${w.value}px`:void 0})),R=$=>{x($),p("resizeStart",$,b.value)},z=($,K)=>{E($,K),h.value||p("resize",$,b.value)},F=async $=>{k(),await t.nextTick(),p("resizeEnd",$,b.value)},H=($,K)=>{P($,K),p("collapse",$,K,b.value)};return t.provide(i3,t.reactive({panels:f,percentSizes:v,pxSizes:b,layout:A,lazy:h,movingIndex:_,containerSize:u,onMoveStart:R,onMoving:z,onMoveEnd:F,onCollapse:H,registerPanel:m,unregisterPanel:c})),($,K)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerEl",ref:d,class:t.normalizeClass([t.unref(i).b(),t.unref(i).e(A.value)]),style:t.normalizeStyle(D.value)},[t.renderSlot($.$slots,"default"),t.createVNode(t.unref(g)),t.createCommentVNode(" Prevent iframe touch events from breaking "),t.unref(_)?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(i).e("mask"),t.unref(i).e(`mask-${A.value}`)])},null,2)):t.createCommentVNode("v-if",!0)],6))}}),Iae=Tae;function Dae(s){return s&&mn(s)?s:{start:!!s,end:!!s}}function s3(s,C,i,p){return!!(s!=null&&s.collapsible.end&&C>0||i!=null&&i.collapsible.start&&p===0&&C>0)}var Rae=t.defineComponent({name:"ElSplitterBar",__name:"split-bar",props:{index:{type:Number,required:!0},layout:{type:String,values:["horizontal","vertical"],default:"horizontal"},resizable:{type:Boolean,default:!0},lazy:Boolean,startCollapsible:Boolean,endCollapsible:Boolean},emits:["moveStart","moving","moveEnd","collapse"],setup(s,{emit:C}){const i=zt("splitter-bar"),p=s,y=C,A=t.computed(()=>p.layout==="horizontal"),h=t.computed(()=>A.value?{width:0}:{height:0}),d=t.computed(()=>({width:A.value?"16px":"100%",height:A.value?"100%":"16px",cursor:p.resizable?A.value?"ew-resize":"ns-resize":"auto",touchAction:"none"})),u=t.computed(()=>{const E=i.e("dragger");return{[`${E}-horizontal`]:A.value,[`${E}-vertical`]:!A.value,[`${E}-active`]:!!c.value}}),c=t.ref(null),f=E=>{p.resizable&&(c.value=[E.pageX,E.pageY],y("moveStart",p.index),window.addEventListener("mouseup",b),window.addEventListener("mousemove",g))},m=E=>{if(p.resizable&&E.touches.length===1){E.preventDefault();const k=E.touches[0];c.value=[k.pageX,k.pageY],y("moveStart",p.index),window.addEventListener("touchend",w),window.addEventListener("touchmove",v)}},g=E=>{const{pageX:k,pageY:P}=E,D=k-c.value[0],R=P-c.value[1],z=A.value?D:R;y("moving",p.index,z)},v=E=>{if(E.touches.length===1){E.preventDefault();const k=E.touches[0],P=k.pageX-c.value[0],D=k.pageY-c.value[1],R=A.value?P:D;y("moving",p.index,R)}},b=()=>{c.value=null,window.removeEventListener("mouseup",b),window.removeEventListener("mousemove",g),y("moveEnd",p.index)},w=()=>{c.value=null,window.removeEventListener("touchend",w),window.removeEventListener("touchmove",v),y("moveEnd",p.index)},_=t.computed(()=>A.value?Zt.ArrowLeft:Zt.ArrowUp),x=t.computed(()=>A.value?Zt.ArrowRight:Zt.ArrowDown);return(E,k)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(i).b()]),style:t.normalizeStyle(h.value)},[s.startCollapsible?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(i).e("collapse-icon"),t.unref(i).e(`${s.layout}-collapse-icon-start`)]),onClick:k[0]||(k[0]=P=>y("collapse",s.index,"start"))},[t.renderSlot(E.$slots,"start-collapsible",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(_.value),{style:{width:"12px",height:"12px"}}))])],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass([t.unref(i).e("dragger"),u.value,t.unref(i).is("disabled",!s.resizable),t.unref(i).is("lazy",s.resizable&&s.lazy)]),style:t.normalizeStyle(d.value),onMousedown:f,onTouchstart:m},null,38),s.endCollapsible?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([t.unref(i).e("collapse-icon"),t.unref(i).e(`${s.layout}-collapse-icon-end`)]),onClick:k[1]||(k[1]=P=>y("collapse",s.index,"end"))},[t.renderSlot(E.$slots,"end-collapsible",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(x.value),{style:{width:"12px",height:"12px"}}))])],2)):t.createCommentVNode("v-if",!0)],6))}}),Fae=Rae;const o3="ElSplitterPanel";var Nae=t.defineComponent({name:o3,__name:"split-panel",props:Bae,emits:Sae,setup(s,{expose:C,emit:i}){const p=zt("splitter-panel"),y=s,A=i,h=t.inject(i3);h||oi(o3,"usage: <el-splitter><el-splitter-panel /></el-splitter/>");const{panels:d,layout:u,lazy:c,containerSize:f,pxSizes:m}=t.toRefs(h),{registerPanel:g,unregisterPanel:v,onCollapse:b,onMoveEnd:w,onMoveStart:_,onMoving:x}=h,E=t.ref(),k=t.getCurrentInstance(),P=k.uid,D=t.ref(0),R=t.computed(()=>d.value[D.value]),z=O=>{D.value=O},F=t.computed(()=>R.value?m.value[D.value]??0:0),H=t.computed(()=>R.value?m.value[D.value+1]??0:0),$=t.computed(()=>R.value?d.value[D.value+1]:null),K=t.computed(()=>{var O;return $.value?y.resizable&&((O=$.value)==null?void 0:O.resizable)&&(F.value!==0||!y.min)&&(H.value!==0||!$.value.min):!1}),G=t.computed(()=>R.value?D.value!==d.value.length-1:!1),j=t.computed(()=>s3(R.value,F.value,$.value,H.value)),N=t.computed(()=>s3($.value,H.value,R.value,F.value));function I(O){return x_(O)?w_(O)*f.value||0:E_(O)?C_(O):O??0}let L=!1;t.watch(()=>y.size,()=>{if(!L&&R.value){if(!f.value){R.value.size=y.size;return}const O=I(y.size),Q=I(y.max),W=I(y.min),Z=Math.min(Math.max(O,W||0),Q||O);Z!==O&&A("update:size",Z),R.value.size=Z}}),t.watch(()=>{var O;return(O=R.value)==null?void 0:O.size},O=>{O!==y.size&&(L=!0,A("update:size",O),t.nextTick(()=>L=!1))}),t.watch(()=>y.resizable,O=>{R.value&&(R.value.resizable=O)});const U=t.reactive({uid:P,getVnode:()=>k.vnode,setIndex:z,...y,collapsible:t.computed(()=>Dae(y.collapsible))});return g(U),t.onBeforeUnmount(()=>v(U)),C({splitterPanelRef:E}),(O,Q)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",t.mergeProps({ref_key:"panelEl",ref:E,class:[t.unref(p).b()],style:{flexBasis:`${F.value}px`}},O.$attrs),[t.renderSlot(O.$slots,"default")],16),G.value?(t.openBlock(),t.createBlock(Fae,{key:0,index:D.value,layout:t.unref(u),lazy:t.unref(c),resizable:K.value,"start-collapsible":j.value,"end-collapsible":N.value,onMoveStart:t.unref(_),onMoving:t.unref(x),onMoveEnd:t.unref(w),onCollapse:t.unref(b)},{"start-collapsible":t.withCtx(()=>[t.renderSlot(O.$slots,"start-collapsible")]),"end-collapsible":t.withCtx(()=>[t.renderSlot(O.$slots,"end-collapsible")]),_:3},8,["index","layout","lazy","resizable","start-collapsible","end-collapsible","onMoveStart","onMoving","onMoveEnd","onCollapse"])):t.createCommentVNode("v-if",!0)],64))}}),a3=Nae;Tr(Iae,{SplitPanel:a3}),ai(a3);const wa="ElInfiniteScroll",Oae={delay:{type:Number,default:200},distance:{type:Number,default:0},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},B_=(s,C)=>Object.entries(Oae).reduce((i,[p,y])=>{const{type:A,default:h}=y,d=s.getAttribute(`infinite-scroll-${p}`);let u=C[d]??d??h;return u=u==="false"?!1:u,u=A(u),i[p]=Number.isNaN(u)?h:u,i},{}),l3=s=>{const{observer:C}=s[wa];C&&(C.disconnect(),delete s[wa].observer)},Lae=(s,C)=>{const{container:i,containerEl:p,instance:y,observer:A,lastScrollTop:h}=s[wa],{disabled:d,distance:u}=B_(s,y),{clientHeight:c,scrollHeight:f,scrollTop:m}=p,g=m-h;if(s[wa].lastScrollTop=m,A||d||g<0)return;let v=!1;if(i===s)v=f-(c+m)<=u;else{const{clientTop:b,scrollHeight:w}=s,_=bb(s,p);v=m+c>=_+b+w-u}v&&C.call(y)};function S_(s,C){const{containerEl:i,instance:p}=s[wa],{disabled:y}=B_(s,p);y||i.clientHeight===0||(i.scrollHeight<=i.clientHeight?C.call(p):l3(s))}const c3={async mounted(s,C){const{instance:i,value:p}=C;Na({scope:wa,from:"the directive v-infinite-scroll",replacement:"the el-scrollbar infinite scroll",version:"3.0.0",ref:"https://element-plus.org/en-US/component/scrollbar#infinite-scroll"},!0),Nr(p)||oi(wa,"'v-infinite-scroll' binding value must be a function"),await t.nextTick();const{delay:y,immediate:A}=B_(s,i),h=H0(s,!0),d=h===window?document.documentElement:h,u=Kl(Lae.bind(null,s,p),y);if(h){if(s[wa]={instance:i,container:h,containerEl:d,delay:y,cb:p,onScroll:u,lastScrollTop:d.scrollTop},A){const c=new MutationObserver(Kl(S_.bind(null,s,p),50));s[wa].observer=c,c.observe(s,{childList:!0,subtree:!0}),S_(s,p)}h.addEventListener("scroll",u)}},unmounted(s){if(!s.ElInfiniteScroll)return;const{container:C,onScroll:i}=s[wa];C==null||C.removeEventListener("scroll",i),l3(s)},async updated(s){if(!s.ElInfiniteScroll)await t.nextTick();else{const{containerEl:C,cb:i,observer:p}=s[wa];C.clientHeight&&p&&S_(s,i)}}};c3.install=s=>{s.directive("InfiniteScroll",c3)};function jae(s,C){let i,p=!1;const y=t.ref(!1),A=t.reactive({...s,originalPosition:"",originalOverflow:"",visible:!1});function h(b){A.text=b}function d(){if(p)return;p=!0;const b=A.parent,w=v.ns||v._.exposed.ns;if(!b.vLoadingAddClassList){let x=b.getAttribute("loading-number");x=Number.parseInt(x)-1,x?b.setAttribute("loading-number",x.toString()):(js(b,w.bm("parent","relative")),b.removeAttribute("loading-number")),js(b,w.bm("parent","hidden"))}u(),g.unmount();const _=v.$;_.vnode.el=null,_.subTree=null,g._container=null}function u(){var b,w;(w=(b=v.$el)==null?void 0:b.parentNode)==null||w.removeChild(v.$el)}function c(){var b;s.beforeClose&&!s.beforeClose()||(y.value=!0,clearTimeout(i),i=setTimeout(f,400),A.visible=!1,(b=s.closed)==null||b.call(s))}function f(){if(!y.value)return;const b=A.parent;y.value=!1,b.vLoadingAddClassList=void 0,d()}const m=t.defineComponent({name:"ElLoading",setup(b,{expose:w}){const{ns:_,zIndex:x}=jm("loading");return w({ns:_,zIndex:x}),()=>{const E=A.spinner||A.svg,k=t.h("svg",{class:"circular",viewBox:A.svgViewBox?A.svgViewBox:"0 0 50 50",...E?{innerHTML:E}:{}},E?void 0:[t.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),P=A.text?t.h("p",{class:_.b("text")},[A.text]):void 0;return t.h(t.Transition,{name:_.b("fade"),onAfterLeave:f},{default:t.withCtx(()=>[t.withDirectives(t.createVNode("div",{style:{backgroundColor:A.background||""},class:[_.b("mask"),A.customClass,_.is("fullscreen",A.fullscreen)]},[t.h("div",{class:_.b("spinner")},[k,P])]),[[t.vShow,A.visible]])])})}}}),g=t.createApp(m);Object.assign(g._context,C??{});const v=g.mount(document.createElement("div"));return{...t.toRefs(A),setText:h,removeElLoadingChild:u,close:c,handleAfterLeave:f,vm:v,get $el(){return p?null:v.$el}}}let DA;const u3=function(s={},C){if(!un)return;const i=Vae(s);if(i.fullscreen&&DA)return DA;const p=jae({...i,closed:()=>{var A;(A=i.closed)==null||A.call(i),i.fullscreen&&(DA=void 0)}},C??u3._context);Uae(i,i.parent,p),d3(i,i.parent,p),i.parent.vLoadingAddClassList=()=>d3(i,i.parent,p);let y=i.parent.getAttribute("loading-number");return y?y=`${Number.parseInt(y)+1}`:y="1",i.parent.setAttribute("loading-number",y),i.parent.appendChild(p.$el),t.nextTick(()=>p.visible.value=i.visible),i.fullscreen&&(DA=p),p},Vae=s=>{let C;return Ar(s.target)?C=document.querySelector(s.target)??document.body:C=s.target||document.body,{parent:C===document.body||s.body?document.body:C,background:s.background||"",svg:s.svg||"",svgViewBox:s.svgViewBox||"",spinner:s.spinner||!1,text:s.text||"",fullscreen:C===document.body&&(s.fullscreen??!0),lock:s.lock??!1,customClass:s.customClass||"",visible:s.visible??!0,beforeClose:s.beforeClose,closed:s.closed,target:C}},Uae=async(s,C,i)=>{const{nextZIndex:p}=i.vm.zIndex||i.vm._.exposed.zIndex,y={};if(s.fullscreen)i.originalPosition.value=pl(document.body,"position"),i.originalOverflow.value=pl(document.body,"overflow"),y.zIndex=p();else if(s.parent===document.body){i.originalPosition.value=pl(document.body,"position"),await t.nextTick();for(const A of["top","left"]){const h=A==="top"?"scrollTop":"scrollLeft";y[A]=`${s.target.getBoundingClientRect()[A]+document.body[h]+document.documentElement[h]-Number.parseInt(pl(document.body,`margin-${A}`),10)}px`}for(const A of["height","width"])y[A]=`${s.target.getBoundingClientRect()[A]}px`}else i.originalPosition.value=pl(C,"position");for(const[A,h]of Object.entries(y))i.$el.style[A]=h},d3=(s,C,i)=>{const p=i.vm.ns||i.vm._.exposed.ns;["absolute","fixed","sticky"].includes(i.originalPosition.value)?js(C,p.bm("parent","relative")):Zo(C,p.bm("parent","relative")),s.fullscreen&&s.lock?Zo(C,p.bm("parent","hidden")):js(C,p.bm("parent","hidden"))};u3._context=null;const zae={};zae._context=null;const f3=["primary","success","info","warning","error"],h3=["top","top-left","top-right","bottom","bottom-left","bottom-right"],Hs=mi({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:un?document.body:void 0}),Hae=Wt({customClass:{type:et([String,Array,Object,Boolean]),default:Hs.customClass},dangerouslyUseHTMLString:{type:Boolean,default:Hs.dangerouslyUseHTMLString},duration:{type:Number,default:Hs.duration},icon:{type:Pn,default:Hs.icon},id:{type:String,default:Hs.id},message:{type:et([String,Object,Function]),default:Hs.message},onClose:{type:et(Function),default:Hs.onClose},showClose:{type:Boolean,default:Hs.showClose},type:{type:String,values:f3,default:Hs.type},plain:{type:Boolean,default:Hs.plain},offset:{type:Number,default:Hs.offset},placement:{type:String,values:h3,default:Hs.placement},zIndex:{type:Number,default:Hs.zIndex},grouping:{type:Boolean,default:Hs.grouping},repeatNum:{type:Number,default:Hs.repeatNum}}),$ae={destroy:()=>!0},Ca=t.shallowReactive({}),Gae=s=>(Ca[s]||(Ca[s]=t.shallowReactive([])),Ca[s]),Qae=(s,C)=>{const i=Ca[C]||[],p=i.findIndex(h=>h.id===s),y=i[p];let A;return p>0&&(A=i[p-1]),{current:y,prev:A}},Wae=(s,C)=>{const{prev:i}=Qae(s,C);return i?i.vm.exposed.bottom.value:0},Kae=(s,C,i)=>(Ca[i]||[]).findIndex(p=>p.id===s)>0?16:C,Xae=["id"],Yae=["innerHTML"];var Jae=t.defineComponent({name:"ElMessage",__name:"message",props:Hae,emits:$ae,setup(s,{expose:C,emit:i}){const{Close:p}=py,y=s,A=i,h=t.ref(!1),{ns:d,zIndex:u}=jm("message"),{currentZIndex:c,nextZIndex:f}=u,m=t.ref(),g=t.ref(!1),v=t.ref(0);let b;const w=t.computed(()=>y.type?y.type==="error"?"danger":y.type:"info"),_=t.computed(()=>{const j=y.type;return{[d.bm("icon",j)]:j&&ec[j]}}),x=t.computed(()=>y.icon||ec[y.type]||""),E=t.computed(()=>y.placement||"top"),k=t.computed(()=>Wae(y.id,E.value)),P=t.computed(()=>Math.max(Kae(y.id,y.offset,E.value)+k.value,y.offset)),D=t.computed(()=>v.value+P.value),R=t.computed(()=>E.value.includes("left")?d.is("left"):E.value.includes("right")?d.is("right"):d.is("center")),z=t.computed(()=>E.value.startsWith("top")?"top":"bottom"),F=t.computed(()=>({[z.value]:`${P.value}px`,zIndex:c.value}));function H(){y.duration!==0&&({stop:b}=td(()=>{K()},y.duration))}function $(){b==null||b()}function K(){g.value=!1,t.nextTick(()=>{var j;h.value||((j=y.onClose)==null||j.call(y),A("destroy"))})}function G(j){Dn(j)===Gt.esc&&K()}return t.onMounted(()=>{H(),f(),g.value=!0}),t.watch(()=>y.repeatNum,()=>{$(),H()}),vn(document,"keydown",G),ti(m,()=>{v.value=m.value.getBoundingClientRect().height}),C({visible:g,bottom:D,close:K}),(j,N)=>(t.openBlock(),t.createBlock(t.Transition,{name:t.unref(d).b("fade"),onBeforeEnter:N[0]||(N[0]=I=>h.value=!0),onBeforeLeave:s.onClose,onAfterLeave:N[1]||(N[1]=I=>j.$emit("destroy")),persisted:""},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{id:s.id,ref_key:"messageRef",ref:m,class:t.normalizeClass([t.unref(d).b(),{[t.unref(d).m(s.type)]:s.type},t.unref(d).is("closable",s.showClose),t.unref(d).is("plain",s.plain),t.unref(d).is("bottom",z.value==="bottom"),R.value,s.customClass]),style:t.normalizeStyle(F.value),role:"alert",onMouseenter:$,onMouseleave:H},[s.repeatNum>1?(t.openBlock(),t.createBlock(t.unref(K$),{key:0,value:s.repeatNum,type:w.value,class:t.normalizeClass(t.unref(d).e("badge"))},null,8,["value","type","class"])):t.createCommentVNode("v-if",!0),x.value?(t.openBlock(),t.createBlock(t.unref(ir),{key:1,class:t.normalizeClass([t.unref(d).e("icon"),_.value])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(x.value)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),!s.dangerouslyUseHTMLString||j.$slots.default?(t.openBlock(),t.createElementBlock("p",{key:2,class:t.normalizeClass(t.unref(d).e("content"))},[t.renderSlot(j.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(s.message),1)])],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),t.createElementVNode("p",{class:t.normalizeClass(t.unref(d).e("content")),innerHTML:s.message},null,10,Yae)],2112)),s.showClose?(t.openBlock(),t.createBlock(t.unref(ir),{key:4,class:t.normalizeClass(t.unref(d).e("closeBtn")),onClick:t.withModifiers(K,["stop"])},{default:t.withCtx(()=>[t.createVNode(t.unref(p))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],46,Xae),[[t.vShow,g.value]])]),_:3},8,["name","onBeforeLeave"]))}}),Zae=Jae;let qae=1;const ele=s=>{if(!s.appendTo)s.appendTo=document.body;else if(Ar(s.appendTo)){let C=document.querySelector(s.appendTo);uo(C)||(wn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),C=document.body),s.appendTo=C}},tle=s=>{!s.placement&&Ar(zs.placement)&&zs.placement&&(s.placement=zs.placement),s.placement||(s.placement="top"),h3.includes(s.placement)||(wn("ElMessage",`Invalid placement: ${s.placement}. Falling back to 'top'.`),s.placement="top")},p3=s=>{const C=!s||Ar(s)||t.isVNode(s)||Nr(s)?{message:s}:s,i={...Hs,...C};return ele(i),tle(i),Bn(zs.grouping)&&!i.grouping&&(i.grouping=zs.grouping),lr(zs.duration)&&i.duration===3e3&&(i.duration=zs.duration),lr(zs.offset)&&i.offset===16&&(i.offset=zs.offset),Bn(zs.showClose)&&!i.showClose&&(i.showClose=zs.showClose),Bn(zs.plain)&&!i.plain&&(i.plain=zs.plain),i},rle=s=>{const C=s.props.placement||"top",i=Ca[C],p=i.indexOf(s);if(p===-1)return;i.splice(p,1);const{handler:y}=s;y.close()},nle=({appendTo:s,...C},i)=>{const p=`message_${qae++}`,y=C.onClose,A=document.createElement("div"),h={...C,id:p,onClose:()=>{y==null||y(),rle(c)},onDestroy:()=>{t.render(null,A)}},d=t.createVNode(Zae,h,Nr(h.message)||t.isVNode(h.message)?{default:Nr(h.message)?h.message:()=>h.message}:null);d.appContext=i||du._context,t.render(d,A),s.appendChild(A.firstElementChild);const u=d.component,c={id:p,vnode:d,vm:u,handler:{close:()=>{u.exposed.close()}},props:d.component.props};return c},du=(s={},C)=>{if(!un)return{close:()=>{}};const i=p3(s),p=Gae(i.placement||"top");if(i.grouping&&p.length){const A=p.find(({vnode:h})=>{var d;return((d=h.props)==null?void 0:d.message)===i.message});if(A)return A.props.repeatNum+=1,A.props.type=i.type,A.handler}if(lr(zs.max)&&p.length>=zs.max)return{close:()=>{}};const y=nle(i,C);return p.push(y),y.handler};f3.forEach(s=>{du[s]=(C={},i)=>{const p=p3(C);return du({...p,type:s},i)}});function ile(s){for(const C in Ca)if(Xi(Ca,C)){const i=[...Ca[C]];for(const p of i)(!s||s===p.props.type)&&p.handler.close()}}function sle(s){Ca[s]&&[...Ca[s]].forEach(C=>C.handler.close())}du.closeAll=ile,du.closeAllByPlacement=sle,du._context=null,WB(du,"$message");var ole=t.defineComponent({name:"ElMessageBox",directives:{TrapFocus:RG},components:{ElButton:gs,ElFocusTrap:md,ElInput:Ai,ElOverlay:Tb,ElIcon:ir,...py},inheritAttrs:!1,props:{buttonSize:{type:String,validator:LM},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(s,{emit:C}){const{locale:i,zIndex:p,ns:y,size:A}=jm("message-box",t.computed(()=>s.buttonSize)),{t:h}=i,{nextZIndex:d}=p,u=t.ref(!1),c=t.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",cancelButtonType:"",confirmButtonType:"primary",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:t.markRaw(Zt.Loading),cancelButtonLoadingIcon:t.markRaw(Zt.Loading),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:d()}),f=t.computed(()=>{const U=c.type;return{[y.bm("icon",U)]:U&&ec[U]}}),m=ws(),g=ws(),v=t.computed(()=>{const U=c.type;return c.icon||U&&ec[U]||""}),b=t.computed(()=>!!c.message),w=t.ref(),_=t.ref(),x=t.ref(),E=t.ref(),k=t.ref(),P=t.computed(()=>c.confirmButtonClass);t.watch(()=>c.inputValue,async U=>{await t.nextTick(),s.boxType==="prompt"&&U&&j()},{immediate:!0}),t.watch(()=>u.value,U=>{var O;U&&(s.boxType!=="prompt"&&(c.autofocus?x.value=((O=k.value)==null?void 0:O.$el)??w.value:x.value=w.value),c.zIndex=d()),s.boxType==="prompt"&&(U?t.nextTick().then(()=>{E.value&&E.value.$el&&(c.autofocus?x.value=N()??w.value:x.value=w.value)}):(c.editorErrorMessage="",c.validateError=!1))});const D=t.computed(()=>s.draggable),R=t.computed(()=>s.overflow),{isDragging:z}=VE(w,_,D,R);t.onMounted(async()=>{await t.nextTick(),s.closeOnHashChange&&window.addEventListener("hashchange",F)}),t.onBeforeUnmount(()=>{s.closeOnHashChange&&window.removeEventListener("hashchange",F)});function F(){u.value&&(u.value=!1,t.nextTick(()=>{c.action&&C("action",c.action)}))}const H=()=>{s.closeOnClickModal&&G(c.distinguishCancelAndClose?"close":"cancel")},$=ty(H),K=U=>{var O;if(c.inputType!=="textarea"&&!((O=E.value)!=null&&O.isComposing))return U.preventDefault(),G("confirm")},G=U=>{var O;s.boxType==="prompt"&&U==="confirm"&&!j()||(c.action=U,c.beforeClose?(O=c.beforeClose)==null||O.call(c,U,c,F):F())},j=()=>{if(s.boxType==="prompt"){const U=c.inputPattern;if(U&&!U.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||h("el.messagebox.error"),c.validateError=!0,!1;const O=c.inputValidator;if(Nr(O)){const Q=O(c.inputValue);if(Q===!1)return c.editorErrorMessage=c.inputErrorMessage||h("el.messagebox.error"),c.validateError=!0,!1;if(Ar(Q))return c.editorErrorMessage=Q,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},N=()=>{var O;const U=(O=E.value)==null?void 0:O.$refs;return(U==null?void 0:U.input)??(U==null?void 0:U.textarea)},I=()=>{G("close")},L=()=>{s.closeOnPressEscape&&I()};return s.lockScroll&&mm(u,{ns:y}),{...t.toRefs(c),ns:y,overlayEvent:$,visible:u,hasMessage:b,typeClass:f,contentId:m,inputId:g,btnSize:A,iconComponent:v,confirmButtonClasses:P,rootRef:w,focusStartRef:x,headerRef:_,inputRef:E,isDragging:z,confirmRef:k,doClose:F,handleClose:I,onCloseRequested:L,handleWrapperClick:H,handleInputEnter:K,handleAction:G,t:h}}});const ale=["aria-label","aria-describedby"],lle=["aria-label"],cle=["id"];function ule(s,C,i,p,y,A){const h=t.resolveComponent("el-icon"),d=t.resolveComponent("el-input"),u=t.resolveComponent("el-button"),c=t.resolveComponent("el-focus-trap"),f=t.resolveComponent("el-overlay");return t.openBlock(),t.createBlock(t.Transition,{name:"fade-in-linear",onAfterLeave:C[11]||(C[11]=m=>s.$emit("vanish")),persisted:""},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(f,{"z-index":s.zIndex,"overlay-class":[s.ns.is("message-box"),s.modalClass],mask:s.modal},{default:t.withCtx(()=>[t.createElementVNode("div",{role:"dialog","aria-label":s.title,"aria-modal":"true","aria-describedby":s.showInput?void 0:s.contentId,class:t.normalizeClass(`${s.ns.namespace.value}-overlay-message-box`),onClick:C[8]||(C[8]=(...m)=>s.overlayEvent.onClick&&s.overlayEvent.onClick(...m)),onMousedown:C[9]||(C[9]=(...m)=>s.overlayEvent.onMousedown&&s.overlayEvent.onMousedown(...m)),onMouseup:C[10]||(C[10]=(...m)=>s.overlayEvent.onMouseup&&s.overlayEvent.onMouseup(...m))},[t.createVNode(c,{loop:"",trapped:s.visible,"focus-trap-el":s.rootRef,"focus-start-el":s.focusStartRef,onReleaseRequested:s.onCloseRequested},{default:t.withCtx(()=>[t.createElementVNode("div",{ref:"rootRef",class:t.normalizeClass([s.ns.b(),s.customClass,s.ns.is("draggable",s.draggable),s.ns.is("dragging",s.isDragging),{[s.ns.m("center")]:s.center}]),style:t.normalizeStyle(s.customStyle),tabindex:"-1",onClick:C[7]||(C[7]=t.withModifiers(()=>{},["stop"]))},[s.title!==null&&s.title!==void 0?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"headerRef",class:t.normalizeClass([s.ns.e("header"),{"show-close":s.showClose}])},[t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("title"))},[s.iconComponent&&s.center?(t.openBlock(),t.createBlock(h,{key:0,class:t.normalizeClass([s.ns.e("status"),s.typeClass])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.iconComponent)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",null,t.toDisplayString(s.title),1)],2),s.showClose?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(s.ns.e("headerbtn")),"aria-label":s.t("el.messagebox.close"),onClick:C[0]||(C[0]=m=>s.handleAction(s.distinguishCancelAndClose?"close":"cancel")),onKeydown:C[1]||(C[1]=t.withKeys(t.withModifiers(m=>s.handleAction(s.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[t.createVNode(h,{class:t.normalizeClass(s.ns.e("close"))},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.closeIcon||"close")))]),_:1},8,["class"])],42,lle)):t.createCommentVNode("v-if",!0)],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{id:s.contentId,class:t.normalizeClass(s.ns.e("content"))},[t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("container"))},[s.iconComponent&&!s.center&&s.hasMessage?(t.openBlock(),t.createBlock(h,{key:0,class:t.normalizeClass([s.ns.e("status"),s.typeClass])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.iconComponent)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),s.hasMessage?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(s.ns.e("message"))},[t.renderSlot(s.$slots,"default",{},()=>[s.dangerouslyUseHTMLString?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.showInput?"label":"p"),{key:1,for:s.showInput?s.inputId:void 0,innerHTML:s.message},null,8,["for","innerHTML"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.showInput?"label":"p"),{key:0,for:s.showInput?s.inputId:void 0,textContent:t.toDisplayString(s.message)},null,8,["for","textContent"]))])],2)):t.createCommentVNode("v-if",!0)],2),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("input"))},[t.createVNode(d,{id:s.inputId,ref:"inputRef",modelValue:s.inputValue,"onUpdate:modelValue":C[2]||(C[2]=m=>s.inputValue=m),type:s.inputType,placeholder:s.inputPlaceholder,"aria-invalid":s.validateError,class:t.normalizeClass({invalid:s.validateError}),onKeydown:t.withKeys(s.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("errormsg")),style:t.normalizeStyle({visibility:s.editorErrorMessage?"visible":"hidden"})},t.toDisplayString(s.editorErrorMessage),7)],2),[[t.vShow,s.showInput]])],10,cle),s.showCancelButton||s.showConfirmButton?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(s.ns.e("btns"))},[s.showCancelButton?(t.openBlock(),t.createBlock(u,{key:0,type:s.cancelButtonType==="text"?"":s.cancelButtonType,text:s.cancelButtonType==="text",loading:s.cancelButtonLoading,"loading-icon":s.cancelButtonLoadingIcon,class:t.normalizeClass([s.cancelButtonClass]),round:s.roundButton,size:s.btnSize,onClick:C[3]||(C[3]=m=>s.handleAction("cancel")),onKeydown:C[4]||(C[4]=t.withKeys(t.withModifiers(m=>s.handleAction("cancel"),["prevent"]),["enter"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.cancelButtonText||s.t("el.messagebox.cancel")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","size"])):t.createCommentVNode("v-if",!0),t.withDirectives(t.createVNode(u,{ref:"confirmRef",type:s.confirmButtonType==="text"?"":s.confirmButtonType,text:s.confirmButtonType==="text",loading:s.confirmButtonLoading,"loading-icon":s.confirmButtonLoadingIcon,class:t.normalizeClass([s.confirmButtonClasses]),round:s.roundButton,disabled:s.confirmButtonDisabled,size:s.btnSize,onClick:C[5]||(C[5]=m=>s.handleAction("confirm")),onKeydown:C[6]||(C[6]=t.withKeys(t.withModifiers(m=>s.handleAction("confirm"),["prevent"]),["enter"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.confirmButtonText||s.t("el.messagebox.confirm")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","disabled","size"]),[[t.vShow,s.showConfirmButton]])],2)):t.createCommentVNode("v-if",!0)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,ale)]),_:3},8,["z-index","overlay-class","mask"]),[[t.vShow,s.visible]])]),_:3})}var dle=Yi(ole,[["render",ule]]);const Ih=new Map,fle=s=>{let C=document.body;return s.appendTo&&(Ar(s.appendTo)&&(C=document.querySelector(s.appendTo)),uo(s.appendTo)&&(C=s.appendTo),uo(C)||(wn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),C=document.body)),C},k_=(s,C)=>{var p;const i=(p=s.component)==null?void 0:p.proxy;return()=>i.handleAction(C)},hle=(s,C,i=null)=>{const p=t.createVNode(dle,s,Nr(s.message)||t.isVNode(s.message)?{default:Nr(s.message)?()=>s.message({confirm:k_(p,"confirm"),cancel:k_(p,"cancel"),close:k_(p,"close")}):()=>s.message}:null);return p.appContext=i,t.render(p,C),fle(s).appendChild(C.firstElementChild),p.component},ple=()=>document.createElement("div"),mle=(s,C)=>{const i=ple();s.onVanish=()=>{t.render(null,i),Ih.delete(y)},s.onAction=A=>{const h=Ih.get(y);let d;s.showInput?d={value:y.inputValue,action:A}:d=A,s.callback?s.callback(d,p.proxy):A==="cancel"||A==="close"?s.distinguishCancelAndClose&&A!=="cancel"?h.reject("close"):h.reject("cancel"):h.resolve(d)};const p=hle(s,i,C),y=p.proxy;for(const A in s)Xi(s,A)&&!Xi(y.$props,A)&&(A==="closeIcon"&&mn(s[A])?y[A]=t.markRaw(s[A]):y[A]=s[A]);return y.visible=!0,y};function Pd(s,C=null){if(!un)return Promise.reject();let i;return Ar(s)||t.isVNode(s)?s={message:s}:i=s.callback,new Promise((p,y)=>{const A=mle(s,C??Pd._context);Ih.set(A,{options:s,callback:i,resolve:p,reject:y})})}const Ale=["alert","confirm","prompt"],gle={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Ale.forEach(s=>{Pd[s]=vle(s)});function vle(s){return(C,i,p,y)=>{let A="";return mn(i)?(p=i,A=""):en(i)?A="":A=i,Pd(Object.assign({title:A,message:C,type:"",...gle[s]},p,{boxType:s}),y)}}Pd.close=()=>{Ih.forEach((s,C)=>{C.doClose()}),Ih.clear()},Pd._context=null;const fu=Pd;fu.install=s=>{fu._context=s._context,s.config.globalProperties.$msgbox=fu,s.config.globalProperties.$messageBox=fu,s.config.globalProperties.$alert=fu.alert,s.config.globalProperties.$confirm=fu.confirm,s.config.globalProperties.$prompt=fu.prompt};const m3=["primary","success","info","warning","error"],yle=Wt({customClass:{type:et([String,Array,Object,Boolean]),default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:Pn},id:{type:String,default:""},message:{type:et([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:et(Function),default:()=>{}},onClose:{type:et(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...m3,""],default:""},zIndex:Number,closeIcon:{type:Pn,default:Zt.Close},progress:{type:et([Boolean,Object]),default:!1},pauseOnHover:{type:Boolean,default:!0}}),ble={destroy:()=>!0},_le=["id"],wle=["textContent"],Cle={key:0},xle=["innerHTML"];var Ele=t.defineComponent({name:"ElNotification",__name:"notification",props:yle,emits:ble,setup(s,{expose:C}){const i=s,{ns:p,zIndex:y}=jm("notification"),{nextZIndex:A,currentZIndex:h}=y,d=t.ref(!1);let u;const c=t.ref(100);let f=0,m=0;const g=t.computed(()=>{const j=i.type;return j&&ec[i.type]?p.m(j):""}),v=t.computed(()=>!!i.progress&&i.duration>0),b=t.computed(()=>{switch(i.type){case"success":return"success";case"warning":return"warning";case"error":return"exception";default:return}}),w=t.computed(()=>({status:b.value,strokeWidth:3,showText:!1,...typeof i.progress=="object"?i.progress:void 0})),_=t.computed(()=>i.type&&ec[i.type]||i.icon),x=t.computed(()=>i.position.endsWith("right")?"right":"left"),E=t.computed(()=>i.position.startsWith("top")?"top":"bottom"),k=t.computed(()=>({[E.value]:`${i.offset}px`,zIndex:i.zIndex??h.value})),{pause:P,resume:D}=PU(()=>{c.value=Math.max(0,100-(f+Date.now()-m)/i.duration*100)},100,{immediate:!1});function R(){if(i.duration<=0)return;u==null||u(),P(),m=Date.now();const j=Math.max(0,i.duration-f);({stop:u}=td(()=>{d.value&&K()},j)),v.value&&(c.value=j/i.duration*100,D())}function z(){u==null||u(),P(),m>0&&(f+=Date.now()-m,m=0)}let F=!1;function H(){F=!0,i.pauseOnHover&&z()}function $(){F=!1,i.pauseOnHover&&R()}function K(){d.value=!1,z()}function G(j){switch(Dn(j)){case Gt.delete:case Gt.backspace:z();break;case Gt.esc:d.value&&K();break;default:if(F&&i.pauseOnHover)break;z(),R()}}return t.onMounted(()=>{R(),A(),d.value=!0}),vn(document,"keydown",G),C({visible:d,close:K}),(j,N)=>(t.openBlock(),t.createBlock(t.Transition,{name:t.unref(p).b("fade"),onBeforeLeave:s.onClose,onAfterLeave:N[1]||(N[1]=I=>j.$emit("destroy")),persisted:""},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{id:s.id,class:t.normalizeClass([t.unref(p).b(),s.customClass,x.value]),style:t.normalizeStyle(k.value),role:"alert",onMouseenter:H,onMouseleave:$,onClick:N[0]||(N[0]=(...I)=>s.onClick&&s.onClick(...I))},[_.value?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass([t.unref(p).e("icon"),g.value])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(_.value)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("group"))},[t.createElementVNode("h2",{class:t.normalizeClass(t.unref(p).e("title")),textContent:t.toDisplayString(s.title)},null,10,wle),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("content")),style:t.normalizeStyle(s.title?void 0:{margin:0})},[t.renderSlot(j.$slots,"default",{},()=>[s.dangerouslyUseHTMLString?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),t.createElementVNode("p",{innerHTML:s.message},null,8,xle)],2112)):(t.openBlock(),t.createElementBlock("p",Cle,t.toDisplayString(s.message),1))])],6),[[t.vShow,s.message]]),s.showClose?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass(t.unref(p).e("closeBtn")),onClick:t.withModifiers(K,["stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.closeIcon)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],2),v.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(p).e("progress")),"aria-hidden":"true"},[t.createVNode(t.unref(PM),t.mergeProps(w.value,{percentage:c.value}),null,16,["percentage"])],2)):t.createCommentVNode("v-if",!0)],46,_le),[[t.vShow,d.value]])]),_:3},8,["name","onBeforeLeave"]))}}),Ble=Ele;const Md={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},RA=16;let Sle=1;const hu=function(s={},C){if(!un)return{close:()=>{}};(Ar(s)||t.isVNode(s))&&(s={message:s});const i=s.position||"top-right";let p=s.offset||0;Md[i].forEach(({vm:f})=>{var m;p+=(((m=f.el)==null?void 0:m.offsetHeight)||0)+RA}),p+=RA;const y=`notification_${Sle++}`,A=s.onClose,h={...s,offset:p,id:y,onClose:()=>{kle(y,i,A)}};let d=document.body;uo(s.appendTo)?d=s.appendTo:Ar(s.appendTo)&&(d=document.querySelector(s.appendTo)),uo(d)||(wn("ElNotification","the appendTo option is not an HTMLElement. Falling back to document.body."),d=document.body);const u=document.createElement("div"),c=t.createVNode(Ble,h,Nr(h.message)?h.message:t.isVNode(h.message)?()=>h.message:null);return c.appContext=en(C)?hu._context:C,c.props.onDestroy=()=>{t.render(null,u)},t.render(c,u),Md[i].push({vm:c}),d.appendChild(u.firstElementChild),{close:()=>{c.component.exposed.close()}}};m3.forEach(s=>{hu[s]=(C={},i)=>((Ar(C)||t.isVNode(C))&&(C={message:C}),hu({...C,type:s},i))});function kle(s,C,i){const p=Md[C],y=p.findIndex(({vm:c})=>{var f;return((f=c.component)==null?void 0:f.props.id)===s});if(y===-1)return;const{vm:A}=p[y];if(!A)return;i==null||i(A);const h=A.el.offsetHeight,d=C.split("-")[0];p.splice(y,1);const u=p.length;if(!(u<1))for(let c=y;c<u;c++){const{el:f,component:m}=p[c].vm,g=Number.parseInt(f.style[d],10)-h-RA;m.props.offset=g}}function Ple(){for(const s of Object.values(Md))s.forEach(({vm:C})=>{C.component.exposed.close()})}function Mle(s="top-right"){var i,p,y,A;let C=((y=(p=(i=Md[s][0])==null?void 0:i.vm.component)==null?void 0:p.props)==null?void 0:y.offset)||0;for(const{vm:h}of Md[s])h.component.props.offset=C,C+=(((A=h.el)==null?void 0:A.offsetHeight)||0)+RA}hu.closeAll=Ple,hu.updateOffsets=Mle,hu._context=null,WB(hu,"$notify");const Tle=Wt({...Uc(dh,["ariaLabel","gpuAcceleration","rawContent"]),placement:Db.placement,tabindex:Db.tabindex,effect:{...dh.effect,default:"light"},title:String,width:{type:[String,Number],default:150},offset:{...dh.offset,default:void 0},persistent:{...dh.persistent,default:!0}}),Ile={"update:visible":s=>Bn(s),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0};({...Uc(KH,["gpuAcceleration"])});var Dle=t.defineComponent({name:"ElPopover",__name:"popover",props:Tle,emits:Ile,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.computed(()=>{const x=Ji.props,E=nr(x)?x:Object.keys(x);return Fa(p,E)}),h=zt("popover"),d=t.ref(),u=t.computed(()=>{var x;return(x=t.unref(d))==null?void 0:x.popperRef}),c=t.computed(()=>[{width:pi(p.width)},p.popperStyle]),f=t.computed(()=>[h.b(),p.popperClass,{[h.m("plain")]:!!p.content}]),m=t.computed(()=>p.transition===`${h.namespace.value}-fade-in-linear`),g=()=>{var x;(x=d.value)==null||x.hide()},v=()=>{y("before-enter")},b=()=>{y("before-leave")},w=()=>{y("after-enter")},_=()=>{y("update:visible",!1),y("after-leave")};return C({popperRef:u,hide:g}),(x,E)=>(t.openBlock(),t.createBlock(t.unref(Ji),t.mergeProps({ref_key:"tooltipRef",ref:d},A.value,{"aria-label":s.title,"popper-class":f.value,"popper-style":c.value,"gpu-acceleration":m.value,onBeforeShow:v,onBeforeHide:b,onShow:w,onHide:_}),{content:t.withCtx(()=>[s.title?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(h).e("title")),role:"title"},t.toDisplayString(s.title),3)):t.createCommentVNode("v-if",!0),t.renderSlot(x.$slots,"default",{hide:g},()=>[t.createTextVNode(t.toDisplayString(s.content),1)])]),default:t.withCtx(()=>[x.$slots.reference?t.renderSlot(x.$slots,"reference",{key:0}):t.createCommentVNode("v-if",!0)]),_:3},16,["aria-label","popper-class","popper-style","gpu-acceleration"]))}}),Rle=Dle;const A3=(s,C)=>{var p;const i=(p=C.arg||C.value)==null?void 0:p.popperRef;i&&(i.triggerRef=s)};var Fle={mounted(s,C){A3(s,C)},updated(s,C){A3(s,C)}};const Nle=mz(Fle,"popover");Tr(Rle,{directive:Nle}),yr.on("ThemeConfig",()=>{Or.ConfigViewer()});class Or{static ConfigViewer(){if(jr.BIMX_CONFIGS.themeColor&&Or.setTheme(Yt("themeColor")),jr.BIMX_CONFIGS.isMobile&&(Or.setProperty("--annotation-marker-size","32px"),Or.setProperty("--annotation-marker-img-size","18px")),jr.BIMX_CONFIGS.topHeight||jr.BIMX_CONFIGS.bottomHeight){const C=parseInt(Yt("topHeight"));if(Yt("isMobile"))Or.setProperty("--mobile-top-height",`${(8+C).toString()}px`);else{const i=parseInt(Yt("bottomHeight")),p=C+i;Or.setProperty("--tall-panel-height",`calc(100% - ${p.toString()}px)`),Or.setProperty("--operate-item-top",`${(14+C).toString()}px`),Or.setProperty("--left-toggle-top",`${(14+C).toString()}px`)}Or.setProperty("--alert-box-top",`${(40+C).toString()}px`)}if(jr.BIMX_CONFIGS.annotationPos){const C=Yt("annotationPos").pos,i=Yt("annotationPos").posNum;C.includes("top")&&Or.setProperty("--annotation-panel-triangle-border","0 6px 6px "),C.includes("bottom")&&Or.setProperty("--annotation-panel-triangle-border"," 6px 6px 0"),C.includes("-")?(Or.setProperty("--annotation-panel-width","unset"),C.includes("left")?Or.setProperty("--annotation-panel-left",i[0].toString()+"px"):Or.setProperty("--annotation-panel-left","unset"),C.includes("right")?Or.setProperty("--annotation-panel-right",i[0].toString()+"px"):Or.setProperty("--annotation-panel-right","unset"),C.includes("bottom")?Or.setProperty("--annotation-panel-bottom",i[1].toString()+"px"):Or.setProperty("--annotation-panel-bottom","unset"),C.includes("top")?Or.setProperty("--annotation-panel-top",i[1].toString()+"px"):Or.setProperty("--annotation-panel-top","unset")):(C.includes("bottom")&&Or.setProperty("--annotation-panel-right","calc(50% - 136px)"),Or.setProperty("--annotation-panel-"+C,i[0].toString()+"px"))}if(jr.BIMX_CONFIGS.commentPos){const C=Yt("commentPos").pos,i=Yt("commentPos").posNum;C.includes("top")&&(Or.setProperty("--comment-panel-triangle-display","unset"),Or.setProperty("--comment-panel-triangle-border","0 6px 6px "),Or.setProperty("--comment-color-panel-top","46px"),Or.setProperty("--comment-color-panel-left","-9px"),Or.setProperty("--comment-color-edit-tips-bottom","48px")),C.includes("bottom")&&Or.setProperty("--comment-panel-triangle-border"," 6px 6px 0"),C.includes("-")?(Or.setProperty("--comment-panel-width","unset"),C.includes("left")?Or.setProperty("--comment-panel-left",i[0].toString()+"px"):Or.setProperty("--comment-panel-left","unset"),C.includes("right")?Or.setProperty("--comment-panel-right",i[0].toString()+"px"):Or.setProperty("--comment-panel-right","unset"),C.includes("bottom")?Or.setProperty("--comment-panel-bottom",i[1].toString()+"px"):Or.setProperty("--comment-panel-bottom","unset"),C.includes("top")?Or.setProperty("--comment-panel-top",i[1].toString()+"px"):Or.setProperty("--comment-panel-top","unset")):((C.includes("top")||C.includes("bottom"))&&(Or.setProperty("--comment-panel-wrapper-width","100%"),Or.setProperty("--comment-panel-left","0"),Or.setProperty("--comment-panel-right","0")),Or.setProperty("--comment-panel-"+C,i[0].toString()+"px"))}if(jr.BIMX_CONFIGS.roamPos){const C=Yt("roamPos").pos,i=parseInt(Yt("topHeight")),p=parseInt(Yt("bottomHeight"));C.includes("top")&&(Or.setProperty("--roam-toolbar-top",`${(30+i).toString()}px`),Or.setProperty("--roam-toolbar-bottom","unset")),C.includes("bottom")&&(Or.setProperty("--roam-toolbar-top","unset"),Or.setProperty("--roam-toolbar-bottom",`${(14+p).toString()}px`))}}static get currentTheme(){return document.documentElement.getAttribute("data-theme")}static setTheme(C){document.documentElement.setAttribute("data-theme",C)}static setProperty(C,i){document.body.style.setProperty(C,i)}static getProperty(C){return document.body.style.getPropertyValue(C)}}const FA=(s,C)=>{let i=0,p=0;return Yt("navCubePos").pos.includes("left")?i+=parseInt(Yt("leftWidth")):Yt("navCubePos").pos.includes("right")&&(i+=parseInt(Yt("rightWidth"))),Yt("navCubePos").pos.includes("top")?p+=parseInt(Yt("topHeight")):Yt("navCubePos").pos.includes("bottom")&&(p+=parseInt(Yt("bottomHeight"))),[s?i+C:i,p]},Ole={class:"unfold_btn"},Lle=["onClick"],jle={key:0,class:"tctwins_btn"},Vle=["src"],Ule=["src"],zle=["src"],Hle={key:1,class:"left_button_group"},$le=["src"],Gle={key:2,class:"right_button_group"},Qle={key:0,class:"cooperate_btn mobile_toggle"},Wle=["src"],Kle={key:1,class:"bcf_btn mobile_toggle"},Xle=["src"],Yle={key:3,class:"exit_fullscreen"},Jle=["src"],Zle={class:"click_events"},qle=t.defineComponent({__name:"AppToolbar",props:["visibleTools"],emits:["emitHandler"],setup(s,{emit:C}){const i=In(),p=si(),y=t.ref(jr.BIMX_CONFIGS.enableTree),A=t.ref(jr.BIMX_CONFIGS.showInspector),h=t.computed(()=>F=>F=="tree"?y.value:F=="inspector"?A.value:!0),d=()=>{const{eventTrigger:F}=window.bimViewer;F.on("treeAllReady",H=>{Gn("enableTree",!0),y.value=!0}),F.on("metaLoaded",H=>{Gn("showInspector",!0),A.value=!0})};yr.on("BimViewer",d);const u=p.tools.filter(F=>F.id<14||F.id==17);t.onMounted(()=>{y.value&&p.setToolActiveStatusBykey("tree",!0)});const c=C,f=F=>{c("emitHandler",F)},m=F=>{b.value=F,D.value=!0,R.value=!0,k.value.enable()};yr.on("hideToolbar",m);const g=t.ref(!1),v=F=>{g.value=F,Or.setProperty("--toolbar-tool-bottom",`${g.value?"3.8":"1.44"}rem`)};yr.on("expandMenu",v),t.onBeforeUnmount(()=>{yr.off("hideToolbar",m),yr.off("expandMenu",v),yr.off("BimViewer",d)});const b=t.ref(!1),w=t.ref(!1),_=F=>{const H=p.getToolByKey(F);H&&(H.isActive?(F!=="reset"&&(D.value=!0,R.value=!0,k.value.enable(),F==="mouse"?P.value=p.isToolActiveBykey("navigate"):P.value=!1),b.value=!1):(F!=="reset"&&F!=="fullscreen"&&F!=="cooperate"&&F!=="mouse"&&(p.setAllToolClose(["fullscreen","mouse"].map($=>{var K;return(K=p.getToolByKey($))==null?void 0:K.id}).filter(Boolean)),Un.SetAllClose()),F!=="reset"&&F!=="navigate"&&F!=="enjoy"&&F!=="share"&&F!=="mouse"&&(D.value=!1,R.value=!1,k.value.disable(),p.setToolActiveStatusBykey("mouse",!1)),F!=="reset"&&(P.value=F==="navigate"),F==="mouse"&&(P.value=p.isToolActiveBykey("navigate")),(F==="comment"||F==="tree"||F==="inspector"||F==="section")&&(b.value=!0),F==="navigate"&&(D.value=!0,R.value=!0,k.value.enable(),P.value=!0)),F==="fullscreen"&&(H.isActive?w.value=!1:w.value=!0),x(H))},x=F=>{var H;F.key!=="fullscreen"&&Un.SetToolActiveByKey(F.key),p.setToolActiveStatus(F.id),f({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:F.id,toolKey:F.key,status:(H=p.getToolById(F.id))==null?void 0:H.isActive}})},E=()=>{f({isTool:!1,event_target:"ToolBar",event_name:"exitViewer",content:{}})},k=t.ref(),P=t.ref(!1),D=t.ref(!0),R=t.ref(!0),z=()=>{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(F,H)=>{var G,j,N,I,L,U,O,Q,W,Z;const $=gi,K=OL;return t.openBlock(),t.createElementBlock(t.Fragment,null,[!w.value&&!b.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"mobile_toolbar",style:t.normalizeStyle({height:g.value?"3.8rem":"unset"})},[t.createElementVNode("div",Ole,[t.createElementVNode("div",{class:"unfold_wrapper",onClick:H[0]||(H[0]=J=>v(!g.value))},[...H[6]||(H[6]=[t.createElementVNode("div",null,null,-1)])])]),t.createVNode($,null,{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["tctwins_toolbar",{tctwins_toolbar_expend:g.value}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.visibleTools,J=>(t.openBlock(),t.createElementBlock("div",{key:J.id,class:"tctwins_btn_group",onClick:ne=>_(J.key)},[t.unref(u).includes(J)&&h.value(J.key)?(t.openBlock(),t.createElementBlock("div",jle,[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bar/new-icons/bimkk-mobile-toolbar-${J.isActive?J.imgActive:J.img}.svg`},null,8,Vle),t.createElementVNode("span",{class:t.normalizeClass(J.hasActiveState&&t.unref(p).isToolActive(J.id)?"tool_name_active":"tool_name")},t.toDisplayString(t.unref(p).isToolActive(J.id)&&J.key==="fullscreen"?t.unref(i)("toolbar.exitFullscreen"):t.unref(i)(J.name)),3)])):t.createCommentVNode("",!0)],8,Lle))),128))],2)]),_:1}),R.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["mouse_btn",{mouse_higher:P.value}])},[t.createElementVNode("div",{class:"mouse",onClick:H[1]||(H[1]=J=>_("mouse"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/industry-viewer/action-bar/${(G=t.unref(p).getToolByKey("mouse"))!=null&&G.isActive?(j=t.unref(p).getToolByKey("mouse"))==null?void 0:j.imgActive:(N=t.unref(p).getToolByKey("mouse"))==null?void 0:N.img}.svg`},null,8,Ule),t.createElementVNode("span",{style:t.normalizeStyle({color:(I=t.unref(p).getToolByKey("mouse"))!=null&&I.isActive?"#1457F7":"#262626"})},t.toDisplayString(t.unref(i)("toolbar.virtualMouse")),5)]),t.createElementVNode("div",{class:"reset",onClick:z},[t.createElementVNode("img",{src:`${t.unref(Qt)}/industry-viewer/reset.svg`},null,8,zle),t.createElementVNode("span",null,t.toDisplayString(t.unref(i)("common.reset")),1)])],2)):t.createCommentVNode("",!0)],4)):t.createCommentVNode("",!0),w.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Hle,[t.unref(Yt)("backButton")?(t.openBlock(),t.createElementBlock("div",{key:0,class:"back mobile_toggle",onClick:H[2]||(H[2]=J=>E())},[t.createElementVNode("img",{src:t.unref(Qt)+"/bim-viewer/close_black.png"},null,8,$le)])):t.createCommentVNode("",!0)])),w.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Gle,[s.visibleTools&&t.unref(p).isToolEnableBykey("cooperate")?(t.openBlock(),t.createElementBlock("div",Qle,[t.createElementVNode("div",{class:t.normalizeClass(["tctwins_btn",{tctwins_btn_active:t.unref(p).isToolActiveBykey("cooperate")&&(((L=t.unref(p).getToolByKey("cooperate"))==null?void 0:L.hasActiveState)??!1)}]),onClick:H[3]||(H[3]=J=>_("cooperate"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/bim-viewer/action-bar/${t.unref(p).isToolActiveBykey("cooperate")?(O=t.unref(p).getToolByKey("cooperate"))==null?void 0:O.imgActive:(U=t.unref(p).getToolByKey("cooperate"))==null?void 0:U.img}.svg`},null,8,Wle)],2)])):t.createCommentVNode("",!0),s.visibleTools&&t.unref(p).isToolEnableBykey("bcf")?(t.openBlock(),t.createElementBlock("div",Kle,[t.createElementVNode("div",{class:t.normalizeClass(["tctwins_btn",{tctwins_btn_active:t.unref(p).isToolActiveBykey("bcf")&&(((Q=t.unref(p).getToolByKey("bcf"))==null?void 0:Q.hasActiveState)??!1)}]),onClick:H[4]||(H[4]=J=>_("bcf"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/bim-viewer/action-bar/${t.unref(p).isToolActiveBykey("bcf")?(Z=t.unref(p).getToolByKey("bcf"))==null?void 0:Z.imgActive:(W=t.unref(p).getToolByKey("bcf"))==null?void 0:W.img}.svg`},null,8,Xle)],2)])):t.createCommentVNode("",!0)])),w.value?(t.openBlock(),t.createElementBlock("div",Yle,[t.createElementVNode("div",{class:"exit_full_btn",onClick:H[5]||(H[5]=J=>_("fullscreen"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/industry-viewer/action-bar/fullscreen-active.svg`},null,8,Jle)])])):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",Zle,[t.createVNode(K,{ref_key:"clickEventRef",ref:k},null,512)],512),[[t.vShow,D.value]])],64)}}}),yn=(s,C)=>{const i=s.__vccOpts||s;for(const[p,y]of C)i[p]=y;return i},ece=yn(qle,[["__scopeId","data-v-eef618d2"]]),tce={class:"bimx-tools-wrapper"},rce={class:"left_buttons"},nce=["onClick"],ice=["src"],sce={class:"tctwins_toolbar_wrapper"},oce={class:"tctwins_toolbar"},ace=["onClick"],lce=["src"],cce={key:1,class:"splitLine"},uce={class:"right_buttons"},dce=["onClick"],fce=["src"],hce=yn(t.defineComponent({__name:"Toolbar",props:["visibleTools"],emits:["emitHandler"],setup(s,{emit:C}){const i=In(),p=t.ref(jr.BIMX_CONFIGS.enableTree),y=t.ref(jr.BIMX_CONFIGS.showInspector),A=()=>{const{eventTrigger:x}=window.bimViewer;x.on("treeAllReady",E=>{Gn("enableTree",!0),p.value=!0}),x.on("metaLoaded",E=>{Gn("showInspector",!0),y.value=!0})};yr.on("BimViewer",A),t.onMounted(()=>{jr.BIMX_CONFIGS.enableTree&&(p.value=!0)}),t.onUnmounted(()=>{yr.off("BimViewer",A)});const h=t.computed(()=>x=>x=="tree"?p.value:!0),d=t.computed(()=>x=>x=="inspector"?y.value:!0);Wl.BIMX_CONFIGS.Toolbar||(yr.on("BIMX_CONFIGS",()=>{jr.BIMX_CONFIGS.enableTree&&(p.value=!0)}),Wl.BIMX_CONFIGS.Toolbar=!0);const u=C,c=x=>{u("emitHandler",x)},f=si(),m=f.tools.filter(x=>x.position==1),g=f.tools.filter(x=>x.position==2),v=x=>{f.isToolActive(x.id)||x.id!=10&&x.id!=1&&(f.setAllToolClose([0,14]),Un.SetAllClose()),_(x)},b=x=>{f.isToolActive(x.id)||(x.key=="bcf"?(f.setAllToolClose([7,8,9,11]),Un.SetAllClose()):f.setToolActiveStatusBykey("bcf",!1)),_(x)},w=x=>{f.isToolActive(x.id)||x.key=="enjoy"&&(f.setAllToolClose(),Un.SetAllClose()),_(x)},_=x=>{Un.SetToolActiveByKey(x.key),f.setToolActiveStatus(x.id),c({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:x.id,toolKey:x.key,status:x.isActive}})};return(x,E)=>{const k=Ji;return t.openBlock(),t.createElementBlock("div",tce,[t.createElementVNode("div",rce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(m),(P,D)=>(t.openBlock(),t.createElementBlock("div",{key:P.id,onClick:R=>b(P)},[P.position==1&&t.unref(f).isToolEnable(P.id)&&h.value(P.key)?(t.openBlock(),t.createBlock(k,{key:0,content:t.unref(i)(P.name),placement:"right",effect:"light"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["toggle_btn",{tctwins_btn_active:P.isActive&&P.hasActiveState}])},[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bars/${P.isActive?P.imgActive:P.img}.svg`,alt:""},null,8,ice)],2)]),_:2},1032,["content"])):t.createCommentVNode("",!0)],8,nce))),128))]),t.createElementVNode("div",sce,[t.createElementVNode("div",oce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.visibleTools,(P,D)=>(t.openBlock(),t.createElementBlock("div",{key:P.id,class:"tctwins_btn-group",onClick:R=>v(P)},[d.value(P.key)?(t.openBlock(),t.createBlock(k,{key:0,content:t.unref(i)(P.name),placement:"top",effect:"light"},{default:t.withCtx(()=>[P.position==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["tctwins_btn",{tctwins_btn_active:P.isActive&&P.hasActiveState}])},[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bars/${P.isActive?P.imgActive:P.img}.svg`,alt:""},null,8,lce)],2)):t.createCommentVNode("",!0)]),_:2},1032,["content"])):t.createCommentVNode("",!0),P.isShowDelimiter&&D!=s.visibleTools.length-1?(t.openBlock(),t.createElementBlock("div",cce)):t.createCommentVNode("",!0)],8,ace))),128))])]),t.createElementVNode("div",uce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(g),(P,D)=>(t.openBlock(),t.createElementBlock("div",{key:P.id,onClick:R=>w(P)},[P.position==2&&t.unref(f).isToolEnable(P.id)?(t.openBlock(),t.createBlock(k,{key:0,content:t.unref(i)(P.name),placement:"left",effect:"light"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["toggle_btn",{tctwins_btn_active:P.isActive&&P.hasActiveState}])},[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bars/${P.isActive?P.imgActive:P.img}.svg`,alt:""},null,8,fce)],2)]),_:2},1032,["content"])):t.createCommentVNode("",!0)],8,dce))),128))])])}}}),[["__scopeId","data-v-e4035baa"]]),pce="1.1.5";async function mce(){try{return(await eL.get(`${sL}/oss/sts`)).data.data}catch(s){throw console.error("Error fetching data:",s),s}}async function g3(){try{const s=await mce();return new tL({region:"oss-cn-beijing",accessKeyId:s.accessKeyId,accessKeySecret:s.accessKeySecret,stsToken:s.securityToken,bucket:s.bucketName})}catch(s){console.log("getSTStoken() throw an error: ",s)}}class uc{static async getBuffer(C,i,p){try{const A=await(await g3()).get(C);i(A.content.buffer)}catch(y){p&&p(y)}}static async requestFileFromOSS(C,i,p,y){try{const A=await g3();if(i){const h=await A.get(`${C}/metadata.json`);p(JSON.parse(h.content))}else{const h=await A.get(`${C}/index.json`);p(JSON.parse(h.content))}}catch(A){console.error("请求文件失败:",A),y(A)}}static async downloadFile(C){try{const i=await fetch(C);if(!i.ok)throw new Error(`Failed to fetch file: ${i.status} ${i.statusText}`);return await i.arrayBuffer()}catch(i){throw console.error("Error fetching file:",i),i}}}const NA=s=>{if(!s)return"";const C=s.split("?")[0],i=C.lastIndexOf("/");if(C.lastIndexOf(".")===-1)return C.slice(i+1);const y=C.slice(i+1),A=y.lastIndexOf(".");return A===-1?y:y.slice(0,A)},Td=s=>{const C=s.lastIndexOf(".");let i=[];return C!==-1&&(i=[s.slice(0,C),s.slice(C+1)]),i[0]},v3=[];function Ace(s){const{viewer:C}=window.bimViewer,{scene:i}=C,p=i.models[s];if(!p){console.error("没有找到正确的模型,无法检测构建异常");return}gce({points:vce(p.aabbs),epsilon:100,min_samples:i.numObjects/4>=1?i.numObjects/4:1},y=>{if(y.noise.length>0){const{noise:A}=y;for(const h in A)v3.push(i.objectIds[A[h]]);window.bimViewer.updateAABB(v3,()=>{C.cameraFlight.jumpTo({aabb:C.scene.aabb})})}if(y.labels_count>1){const{labels:A}=y;let h;const d=y.change_indices,u=[];for(let c=0;c<d.length;c++)h=d[c],c==d.length-1?u.push(i.objectIds.slice(h,A.length)):u.push(i.objectIds.slice(h,d[c+1]));window.bimViewer.setPartialObjectIds(u)}})}function gce(s,C){console.log("start dbscan..."),fetch(`${oL}/dbscan/convert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(i=>(i.ok,i.json())).then(i=>{if(i&&i.error)throw new Error(i.error);i.noise.length>0||i.labels_count>1?(C(i),console.log("DBSCAN Result:",`noise:${i.noise}`,`labels_count:${i.labels_count}`)):(console.log("DBSCAN Result:",i),console.log("DBSCAN Result: no outlier"))}).catch(i=>{console.error("DBSCAN failed:",i)})}function vce(s){const C=[];for(let i=0;i<s.length;i++){const p=s[i],y=[(p[0]+p[3])/2,(p[1]+p[4])/2,(p[2]+p[5])/2];C.push(y)}return C}let y3=!1;function yce(s,C,i,p,y){const A=new Date().getTime();window.bimViewer.loadModel(s,i,()=>{p&&p({code:200,result:s+"模型加载完成!"})},h=>{p&&p({code:-1,result:s+"模型加载失败!",msg:h})},{modelType:C,...y||{}}),y3||(y3=!0,window.bimViewer.modelsExplorer.on("modelLoaded",()=>{window.bimViewer.setAllObjectsEdges(!1);const d=new Date().getTime()-A;console.log(`加载时长: ${d/1e3} s`),Yt("multiModel")?console.log("集成模式下不进行离群点检测"):Yt("outliersDetect")&&Ace(s)}))}var b3={"./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"(s,C,i){i.r(C),i.d(C,{AlphaFormat:()=>mI,AmbientLight:()=>H_,AngleMeasurementsControl:()=>Nn,AngleMeasurementsMouseControl:()=>xa,AngleMeasurementsPlugin:()=>Au,AngleMeasurementsSimulateMouseControl:()=>BEe,AngleMeasurementsTouchControl:()=>EEe,AnnotationsPlugin:()=>TEe,AxisGizmoPlugin:()=>gSe,BCFViewpointsPlugin:()=>OTe,Bitmap:()=>e4,ByteType:()=>sI,CameraMemento:()=>DD,CameraPath:()=>QTe,CameraPathAnimation:()=>op,Canvas:()=>j3,ClampToEdgeWrapping:()=>_o,Component:()=>At,CompressedMediaType:()=>NBe,Configs:()=>lg,CubicBezierCurve:()=>r3e,Curve:()=>sp,DefaultLoadingManager:()=>iD,DepthFormat:()=>yI,DepthStencilFormat:()=>bI,DirLight:()=>Ba,DistanceMeasurementsControl:()=>Eg,DistanceMeasurementsMouseControl:()=>yD,DistanceMeasurementsPlugin:()=>UTe,DistanceMeasurementsSimulateMouseControl:()=>HTe,DistanceMeasurementsTouchControl:()=>zTe,EdgeMaterial:()=>Q_,EmphasisMaterial:()=>Es,FloatType:()=>uI,Fresnel:()=>BSe,Frustum:()=>ro,FrustumPlane:()=>yu,GIFMediaType:()=>DBe,GLTFDefaultDataSource:()=>xD,GLTFLoaderPlugin:()=>wje,HalfFloatType:()=>dI,ImagePlane:()=>XTe,IntType:()=>lI,JPEGMediaType:()=>RBe,KTX2TextureTranscoder:()=>Jd,LASLoaderPlugin:()=>bVe,LambertMaterial:()=>ySe,LightMap:()=>qTe,LineSet:()=>vD,LinearEncoding:()=>Lo,LinearFilter:()=>$s,LinearMipMapLinearFilter:()=>Hd,LinearMipMapNearestFilter:()=>jh,LinearMipmapLinearFilter:()=>wu,LinearMipmapNearestFilter:()=>IBe,Loader:()=>sD,LoadingManager:()=>nD,LocaleService:()=>ED,LuminanceAlphaFormat:()=>vI,LuminanceFormat:()=>gI,Map:()=>Ae,Marker:()=>ln,Mesh:()=>wr,MetallicMaterial:()=>wSe,MirroredRepeatWrapping:()=>kl,ModelMemento:()=>t3e,NavCubePlugin:()=>xje,NearestFilter:()=>_u,NearestMipMapLinearFilter:()=>zd,NearestMipMapNearestFilter:()=>Lh,NearestMipmapLinearFilter:()=>iI,NearestMipmapNearestFilter:()=>nI,Node:()=>Gd,ObjectEditPlugin:()=>uVe,ObjectsKdTree3:()=>ye,ObjectsMemento:()=>RD,PNGMediaType:()=>FBe,Path:()=>n3e,PerformanceModel:()=>s3e,PhongMaterial:()=>Hn,Plugin:()=>Ye,PointLight:()=>YTe,PointerLens:()=>te,QuadraticBezierCurve:()=>i3e,Queue:()=>me,RGBAFormat:()=>Vh,RGBAIntegerFormat:()=>EI,RGBA_ASTC_10x10_Format:()=>c1,RGBA_ASTC_10x5_Format:()=>o1,RGBA_ASTC_10x6_Format:()=>a1,RGBA_ASTC_10x8_Format:()=>l1,RGBA_ASTC_12x10_Format:()=>u1,RGBA_ASTC_12x12_Format:()=>d1,RGBA_ASTC_4x4_Format:()=>rg,RGBA_ASTC_5x4_Format:()=>q_,RGBA_ASTC_5x5_Format:()=>e1,RGBA_ASTC_6x5_Format:()=>t1,RGBA_ASTC_6x6_Format:()=>r1,RGBA_ASTC_8x5_Format:()=>n1,RGBA_ASTC_8x6_Format:()=>i1,RGBA_ASTC_8x8_Format:()=>s1,RGBA_BPTC_Format:()=>ng,RGBA_ETC2_EAC_Format:()=>tg,RGBA_PVRTC_2BPPV1_Format:()=>J_,RGBA_PVRTC_4BPPV1_Format:()=>qA,RGBA_S3TC_DXT1_Format:()=>YA,RGBA_S3TC_DXT3_Format:()=>JA,RGBA_S3TC_DXT5_Format:()=>zh,RGBFormat:()=>AI,RGB_ETC1_Format:()=>Z_,RGB_ETC2_Format:()=>eg,RGB_PVRTC_2BPPV1_Format:()=>Y_,RGB_PVRTC_4BPPV1_Format:()=>ZA,RGB_S3TC_DXT1_Format:()=>Uh,RGFormat:()=>CI,RGIntegerFormat:()=>xI,ReadableGeometry:()=>Mn,RedFormat:()=>_I,RedIntegerFormat:()=>wI,ReflectionMap:()=>ZTe,Renderer:()=>Q3,RepeatWrapping:()=>Mi,Scene:()=>Oh,SceneModel:()=>Bu,SceneModelMesh:()=>r4,SceneModelTransform:()=>dD,SectionBoxControl:()=>BO,SectionPlane:()=>sg,SectionPlanesPlugin:()=>Vje,ShortType:()=>oI,Skybox:()=>X1,SkyboxesPlugin:()=>Gje,SpecularMaterial:()=>ESe,SplineCurve:()=>Pg,SpriteMarker:()=>e3e,StoreyViewsPlugin:()=>$je,Texture:()=>Qd,TextureTranscoder:()=>o3e,TreeViewPlugin:()=>Qje,UnsignedByteType:()=>X_,UnsignedInt248Type:()=>pI,UnsignedIntType:()=>cI,UnsignedShort4444Type:()=>fI,UnsignedShort5551Type:()=>hI,UnsignedShortType:()=>aI,VBOGeometry:()=>JI,ViewCullPlugin:()=>Yje,Viewer:()=>uNe,WebIFCLoaderPlugin:()=>lVe,WorkerPool:()=>aD,XTCDefaultDataSource:()=>kO,XTCLoaderPlugin:()=>iVe,buildBoxGeometry:()=>Nh,buildBoxLinesGeometry:()=>PSe,buildCylinderGeometry:()=>wo,buildGridGeometry:()=>ZI,buildLineGeometry:()=>TSe,buildPlaneGeometry:()=>y1,buildPolylineGeometry:()=>qI,buildPolylineGeometryFromCurve:()=>MSe,buildSphereGeometry:()=>$d,buildTorusGeometry:()=>gc,buildVectorTextGeometry:()=>ig,createRTCViewMat:()=>ot,frustumIntersectsAABB3:()=>O3,getKTX2TextureTranscoder:()=>lD,getPlaneRTCPos:()=>Ft,load3DSGeometry:()=>SSe,loadOBJGeometry:()=>kSe,math:()=>V,rtcToWorldPos:()=>bt,sRGBEncoding:()=>_i,setFrustum:()=>N3,stats:()=>be,utils:()=>at,worldToRTCPos:()=>Et,worldToRTCPositions:()=>ft});var p=A().m(TN),y=A().m(ax);function A(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var B,o,r=typeof Symbol=="function"?Symbol:{},e=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function l(oe,ge,ie,xe){var Ee=ge&&ge.prototype instanceof S?ge:S,Me=Object.create(Ee.prototype);return h(Me,"_invoke",function(Be,ke,De){var Ie,Fe,Ne,$e=0,it=De||[],pt=!1,ut={p:0,n:0,v:B,a:dt,f:dt.bind(B,4),d:function(Tt,Xt){return Ie=Tt,Fe=0,Ne=B,ut.n=Xt,a}};function dt(wt,Tt){for(Fe=wt,Ne=Tt,o=0;!pt&&$e&&!Xt&&o<it.length;o++){var Xt,Nt=it[o],Pt=ut.p,er=Nt[2];wt>3?(Xt=er===Tt)&&(Ne=Nt[(Fe=Nt[4])?5:(Fe=3,3)],Nt[4]=Nt[5]=B):Nt[0]<=Pt&&((Xt=wt<2&&Pt<Nt[1])?(Fe=0,ut.v=Tt,ut.n=Nt[1]):Pt<er&&(Xt=wt<3||Nt[0]>Tt||Tt>er)&&(Nt[4]=wt,Nt[5]=Tt,ut.n=er,Fe=0))}if(Xt||wt>1)return a;throw pt=!0,Tt}return function(wt,Tt,Xt){if($e>1)throw TypeError("Generator is already running");for(pt&&Tt===1&&dt(Tt,Xt),Fe=Tt,Ne=Xt;(o=Fe<2?B:Ne)||!pt;){Ie||(Fe?Fe<3?(Fe>1&&(ut.n=-1),dt(Fe,Ne)):ut.n=Ne:ut.v=Ne);try{if($e=2,Ie){if(Fe||(wt="next"),o=Ie[wt]){if(!(o=o.call(Ie,Ne)))throw TypeError("iterator result is not an object");if(!o.done)return o;Ne=o.value,Fe<2&&(Fe=0)}else Fe===1&&(o=Ie.return)&&o.call(Ie),Fe<2&&(Ne=TypeError("The iterator does not provide a '"+wt+"' method"),Fe=1);Ie=B}else if((o=(pt=ut.n<0)?Ne:Be.call(ke,ut))!==a)break}catch(Nt){Ie=B,Fe=1,Ne=Nt}finally{$e=1}}return{value:o,done:pt}}}(oe,ie,xe),!0),Me}var a={};function S(){}function T(){}function M(){}o=Object.getPrototypeOf;var X=[][e]?o(o([][e]())):(h(o={},e,function(){return this}),o),Y=M.prototype=S.prototype=Object.create(X);function ee(oe){return Object.setPrototypeOf?Object.setPrototypeOf(oe,M):(oe.__proto__=M,h(oe,n,"GeneratorFunction")),oe.prototype=Object.create(Y),oe}return T.prototype=M,h(Y,"constructor",M),h(M,"constructor",T),T.displayName="GeneratorFunction",h(M,n,"GeneratorFunction"),h(Y),h(Y,n,"Generator"),h(Y,e,function(){return this}),h(Y,"toString",function(){return"[object Generator]"}),(A=function(){return{w:l,m:ee}})()}function h(B,o,r,e){var n=Object.defineProperty;try{n({},"",{})}catch{n=0}h=function(a,S,T,M){function X(Y,ee){h(a,Y,function(oe){return this._invoke(Y,ee,oe)})}S?n?n(a,S,{value:T,enumerable:!M,configurable:!M,writable:!M}):a[S]=T:(X("next",0),X("throw",1),X("return",2))},h(B,o,r,e)}function d(B,o,r,e,n,l,a){try{var S=B[l](a),T=S.value}catch(M){return void r(M)}S.done?o(T):Promise.resolve(T).then(e,n)}function u(B){return function(){var o=this,r=arguments;return new Promise(function(e,n){var l=B.apply(o,r);function a(T){d(l,e,n,a,S,"next",T)}function S(T){d(l,e,n,a,S,"throw",T)}a(void 0)})}}function c(B,o){var r=Object.keys(B);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(B);o&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(B,n).enumerable})),r.push.apply(r,e)}return r}function f(B){for(var o=1;o<arguments.length;o++){var r=arguments[o]!=null?arguments[o]:{};o%2?c(Object(r),!0).forEach(function(e){L(B,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(B,e,Object.getOwnPropertyDescriptor(r,e))})}return B}function m(B){return b(B)||v(B)||P(B)||g()}function g(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
67
|
+
`||c==="\r")){h=u;continue}if(A.includes(c)){const f=h===-1?p:h;d={pattern:y.slice(u+1,f),start:u+1,end:f,prefix:c,prefixIndex:u,splitIndex:h,selectionEnd:p};break}}return d},pae=(s,C={debug:!1,useSelectionEnd:!1})=>{const i=s.selectionStart!==null?s.selectionStart:0,p=s.selectionEnd!==null?s.selectionEnd:0,y=C.useSelectionEnd?p:i,A=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];if(C.debug){const g=document.querySelector("#input-textarea-caret-position-mirror-div");g!=null&&g.parentNode&&g.parentNode.removeChild(g)}const h=document.createElement("div");h.id="input-textarea-caret-position-mirror-div",document.body.appendChild(h);const d=h.style,u=window.getComputedStyle(s),c=s.nodeName==="INPUT";d.whiteSpace=c?"nowrap":"pre-wrap",c||(d.wordWrap="break-word"),d.position="absolute",C.debug||(d.visibility="hidden"),A.forEach(g=>{if(c&&g==="lineHeight")if(u.boxSizing==="border-box"){const v=Number.parseInt(u.height),b=Number.parseInt(u.paddingTop)+Number.parseInt(u.paddingBottom)+Number.parseInt(u.borderTopWidth)+Number.parseInt(u.borderBottomWidth),w=b+Number.parseInt(u.lineHeight);v>w?d.lineHeight=`${v-b}px`:v===w?d.lineHeight=u.lineHeight:d.lineHeight="0"}else d.lineHeight=u.height;else d[g]=u[g]}),hm()?s.scrollHeight>Number.parseInt(u.height)&&(d.overflowY="scroll"):d.overflow="hidden",h.textContent=s.value.slice(0,Math.max(0,y)),c&&h.textContent&&(h.textContent=h.textContent.replace(/\s/g," "));const f=document.createElement("span");f.textContent=s.value.slice(Math.max(0,y))||".",f.style.position="relative",f.style.left=`${-s.scrollLeft}px`,f.style.top=`${-s.scrollTop}px`,h.appendChild(f);const m={top:f.offsetTop+Number.parseInt(u.borderTopWidth),left:f.offsetLeft+Number.parseInt(u.borderLeftWidth),height:Number.parseInt(u.fontSize)*1.5};return C.debug?f.style.backgroundColor="#aaa":document.body.removeChild(h),m.left>=s.clientWidth&&(m.left=s.clientWidth),m},mae=Wt({...Py,options:{type:et(Array),default:()=>[]},prefix:{type:et([String,Array]),default:"@",validator:s=>Ar(s)?s.length===1:s.every(C=>Ar(C)&&C.length===1)},split:{type:String,default:" ",validator:s=>s.length===1},filterOption:{type:et([Boolean,Function]),default:()=>fae,validator:s=>s===!1?!0:Nr(s)},placement:{type:et(String),default:"bottom"},showArrow:Boolean,offset:{type:Number,default:0},whole:Boolean,checkIsWhole:{type:et(Function)},modelValue:String,loading:Boolean,popperClass:Qn.popperClass,popperStyle:Qn.popperStyle,popperOptions:{type:et(Object),default:()=>({})},props:{type:et(Object),default:()=>n3}}),Aae={[Pr]:s=>Ar(s),"whole-remove":(s,C)=>Ar(s)&&Ar(C),input:s=>Ar(s),search:(s,C)=>Ar(s)&&Ar(C),select:(s,C)=>mn(s)&&Ar(C),focus:s=>s instanceof FocusEvent,blur:s=>s instanceof FocusEvent},n3={value:"value",label:"label",disabled:"disabled"},gae=Wt({options:{type:et(Array),default:()=>[]},loading:Boolean,disabled:Boolean,contentId:String,ariaLabel:String}),vae={select:s=>Ar(s.value)},yae=["id","aria-disabled","aria-selected","onMousemove","onClick"];var bae=t.defineComponent({name:"ElMentionDropdown",__name:"mention-dropdown",props:gae,emits:vae,setup(s,{expose:C,emit:i}){const p=s,y=i,A=zt("mention"),{t:h}=Yr(),d=t.ref(-1),u=t.ref(),c=t.ref(),f=t.ref(),m=(P,D)=>[A.be("dropdown","item"),A.is("hovering",d.value===D),A.is("disabled",P.disabled||p.disabled)],g=P=>{P.disabled||p.disabled||y("select",P)},v=P=>{d.value=P},b=t.computed(()=>p.disabled||p.options.every(P=>P.disabled)),w=t.computed(()=>p.options[d.value]),_=()=>{!w.value||w.value.disabled||p.disabled||y("select",w.value)},x=P=>{const{options:D}=p;if(D.length===0||b.value)return;P==="next"?(d.value++,d.value===D.length&&(d.value=0)):P==="prev"&&(d.value--,d.value<0&&(d.value=D.length-1));const R=D[d.value];if(R.disabled){x(P);return}t.nextTick(()=>E(R))},E=P=>{var F,H,$,K;const{options:D}=p,R=D.findIndex(G=>G.value===P.value),z=(F=c.value)==null?void 0:F[R];if(z){const G=($=(H=f.value)==null?void 0:H.querySelector)==null?void 0:$.call(H,`.${A.be("dropdown","wrap")}`);G&&$0(G,z)}(K=u.value)==null||K.handleScroll()},k=()=>{b.value||p.options.length===0?d.value=-1:d.value=p.options.findIndex(P=>!P.disabled)};return t.watch(()=>p.options,k,{immediate:!0}),C({hoveringIndex:d,navigateOptions:x,selectHoverOption:_,hoverOption:w}),(P,D)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropdownRef",ref:f,class:t.normalizeClass(t.unref(A).b("dropdown"))},[P.$slots.header?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(A).be("dropdown","header"))},[t.renderSlot(P.$slots,"header")],2)):t.createCommentVNode("v-if",!0),t.withDirectives(t.createVNode(t.unref(gi),{id:s.contentId,ref_key:"scrollbarRef",ref:u,tag:"ul","wrap-class":t.unref(A).be("dropdown","wrap"),"view-class":t.unref(A).be("dropdown","list"),role:"listbox","aria-label":s.ariaLabel,"aria-orientation":"vertical"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.options,(R,z)=>(t.openBlock(),t.createElementBlock("li",{id:`${s.contentId}-${z}`,ref_for:!0,ref_key:"optionRefs",ref:c,key:z,class:t.normalizeClass(m(R,z)),role:"option","aria-disabled":R.disabled||s.disabled||void 0,"aria-selected":d.value===z,onMousemove:F=>v(z),onClick:t.withModifiers(F=>g(R),["stop"])},[t.renderSlot(P.$slots,"label",{item:R,index:z},()=>[t.createElementVNode("span",null,t.toDisplayString(R.label??R.value),1)])],42,yae))),128))]),_:3},8,["id","wrap-class","view-class","aria-label"]),[[t.vShow,s.options.length>0&&!s.loading]]),s.loading?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(A).be("dropdown","loading"))},[t.renderSlot(P.$slots,"loading",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(h)("el.mention.loading")),1)])],2)):t.createCommentVNode("v-if",!0),P.$slots.footer?(t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(t.unref(A).be("dropdown","footer"))},[t.renderSlot(P.$slots,"footer")],2)):t.createCommentVNode("v-if",!0)],2))}}),_ae=bae,wae=t.defineComponent({name:"ElMention",inheritAttrs:!1,__name:"mention",props:mae,emits:Aae,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.computed(()=>{const U=Ai.props??[],O=nr(U)?U:Object.keys(U);return Fa(p,O)}),h=zt("mention"),d=ri(),u=ws(),c=t.ref(),f=t.ref(),m=t.ref(),g=t.ref(!1),v=t.ref(),b=t.ref(),w=t.computed(()=>p.showArrow?p.placement:`${p.placement}-start`),_=t.computed(()=>p.showArrow?["bottom","top"]:["bottom-start","top-start"]),x=t.computed(()=>({...n3,...p.props})),E=U=>{const O={label:U[x.value.label],value:U[x.value.value],disabled:U[x.value.disabled]};return{...U,...O}},k=t.computed(()=>p.options.map(E)),P=t.computed(()=>{const{filterOption:U}=p;return!b.value||!U?k.value:k.value.filter(O=>U(b.value.pattern,O))}),D=t.computed(()=>g.value&&(!!P.value.length||p.loading)),R=t.computed(()=>{var U;return`${u.value}-${(U=m.value)==null?void 0:U.hoveringIndex}`}),z=U=>{y(Pr,U),y(Li,U),N()},F=U=>{var Q,W,Z,J;if((Q=c.value)!=null&&Q.isComposing)return;const O=Dn(U);switch(O){case Gt.left:case Gt.right:N();break;case Gt.up:case Gt.down:if(!g.value)return;U.preventDefault(),(W=m.value)==null||W.navigateOptions(O===Gt.up?"prev":"next");break;case Gt.enter:case Gt.numpadEnter:if(!g.value){p.type!=="textarea"&&N();return}U.preventDefault(),(Z=m.value)!=null&&Z.hoverOption?(J=m.value)==null||J.selectHoverOption():g.value=!1;break;case Gt.esc:if(!g.value)return;U.preventDefault(),g.value=!1;break;case Gt.backspace:if(p.whole&&b.value){const{splitIndex:ne,selectionEnd:ae,pattern:ce,prefixIndex:q,prefix:fe}=b.value,re=j();if(!re)return;const te=re.value,le=k.value.find(de=>de.value===ce);if((Nr(p.checkIsWhole)?p.checkIsWhole(ce,fe):le)&&ne!==-1&&ne+1===ae){U.preventDefault();const de=te.slice(0,q)+te.slice(ne+1);y(Pr,de),y(Li,de),y("whole-remove",ce,fe);const he=q;t.nextTick(()=>{re.selectionStart=he,re.selectionEnd=he,L()})}}}},{wrapperRef:H}=vl(c,{disabled:d,afterFocus(){N()},beforeBlur(U){var O;return(O=f.value)==null?void 0:O.isFocusInsideContent(U)},afterBlur(){g.value=!1}}),$=()=>{N()},K=U=>p.options.find(O=>U.value===O[x.value.value]),G=U=>{if(!b.value)return;const O=j();if(!O)return;const Q=O.value,{split:W}=p,Z=Q.slice(b.value.end),J=Z.startsWith(W),ne=`${U.value}${J?"":W}`,ae=Q.slice(0,b.value.start)+ne+Z;y(Pr,ae),y(Li,ae),y("select",K(U),b.value.prefix);const ce=b.value.start+ne.length+(J?1:0);t.nextTick(()=>{O.selectionStart=ce,O.selectionEnd=ce,O.focus(),L()})},j=()=>{var U,O;return p.type==="textarea"?(U=c.value)==null?void 0:U.textarea:(O=c.value)==null?void 0:O.input},N=()=>{setTimeout(()=>{I(),L(),t.nextTick(()=>{var U;return(U=f.value)==null?void 0:U.updatePopper()})},0)},I=()=>{const U=j();if(!U)return;const O=pae(U),Q=U.getBoundingClientRect(),W=H.value.getBoundingClientRect();v.value={position:"absolute",width:0,height:`${O.height}px`,left:`${O.left+Q.left-W.left}px`,top:`${O.top+Q.top-W.top}px`}},L=()=>{const U=j();if(document.activeElement!==U){g.value=!1;return}const{prefix:O,split:Q}=p;if(b.value=hae(U,O,Q),b.value&&b.value.splitIndex===-1){g.value=!0,y("search",b.value.pattern,b.value.prefix);return}g.value=!1};return C({input:c,tooltip:f,dropdownVisible:D}),(U,O)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"wrapperRef",ref:H,class:t.normalizeClass(t.unref(h).b())},[t.createVNode(t.unref(Ai),t.mergeProps(t.mergeProps(A.value,U.$attrs),{ref_key:"elInputRef",ref:c,"model-value":s.modelValue,disabled:t.unref(d),role:D.value?"combobox":void 0,"aria-activedescendant":D.value?R.value||"":void 0,"aria-controls":D.value?t.unref(u):void 0,"aria-expanded":D.value||void 0,"aria-label":s.ariaLabel,"aria-autocomplete":D.value?"none":void 0,"aria-haspopup":D.value?"listbox":void 0,onInput:z,onKeydown:F,onMousedown:$}),t.createSlots({_:2},[t.renderList(U.$slots,(Q,W)=>({name:W,fn:t.withCtx(Z=>[t.renderSlot(U.$slots,W,t.normalizeProps(t.guardReactiveProps(Z)))])}))]),1040,["model-value","disabled","role","aria-activedescendant","aria-controls","aria-expanded","aria-label","aria-autocomplete","aria-haspopup"]),t.createVNode(t.unref(Ji),{ref_key:"tooltipRef",ref:f,visible:D.value,"popper-class":[t.unref(h).e("popper"),s.popperClass],"popper-style":s.popperStyle,"popper-options":s.popperOptions,placement:w.value,"fallback-placements":_.value,effect:"light",pure:"",offset:s.offset,"show-arrow":s.showArrow},{default:t.withCtx(()=>[t.createElementVNode("div",{style:t.normalizeStyle(v.value)},null,4)]),content:t.withCtx(()=>[t.createVNode(_ae,{ref_key:"dropdownRef",ref:m,options:P.value,disabled:t.unref(d),loading:s.loading,"content-id":t.unref(u),"aria-label":s.ariaLabel,onSelect:G,onClick:O[0]||(O[0]=t.withModifiers(Q=>{var W;return(W=c.value)==null?void 0:W.focus()},["stop"]))},t.createSlots({_:2},[t.renderList(U.$slots,(Q,W)=>({name:W,fn:t.withCtx(Z=>[t.renderSlot(U.$slots,W,t.normalizeProps(t.guardReactiveProps(Z)))])}))]),1032,["options","disabled","loading","content-id","aria-label"])]),_:3},8,["visible","popper-class","popper-style","popper-options","placement","fallback-placements","offset","show-arrow"])],2))}}),Cae=wae;Tr(Cae);const xae=Wt({layout:{type:String,default:"horizontal",values:["horizontal","vertical"]},lazy:Boolean}),Eae={resizeStart:(s,C)=>!0,resize:(s,C)=>!0,resizeEnd:(s,C)=>!0,collapse:(s,C,i)=>!0},Bae=Wt({min:{type:[String,Number]},max:{type:[String,Number]},size:{type:[String,Number]},resizable:{type:Boolean,default:!0},collapsible:Boolean}),Sae={"update:size":s=>typeof s=="number"||typeof s=="string"};function kae(s){const C=t.ref(),{width:i,height:p}=$f(C);return{containerEl:C,containerSize:t.computed(()=>s.value==="horizontal"?i.value:p.value)}}function w_(s){return Number(s.slice(0,-1))/100}function C_(s){return Number(s.slice(0,-2))}function x_(s){return Ar(s)&&s.endsWith("%")}function E_(s){return Ar(s)&&s.endsWith("px")}function Pae(s,C){const i=t.computed(()=>s.value.map(h=>h.size)),p=t.computed(()=>s.value.length),y=t.ref([]);t.watch([i,p,C],()=>{var c;let h=[],d=0;for(let f=0;f<p.value;f+=1){const m=(c=s.value[f])==null?void 0:c.size;if(x_(m))h[f]=w_(m);else if(E_(m))h[f]=C_(m)/C.value;else if(m||m===0){const g=Number(m);Number.isNaN(g)||(h[f]=g/C.value)}else d+=1,h[f]=void 0}const u=h.reduce((f,m)=>f+(m||0),0);if(u>1||!d){const f=1/u;h=h.map(m=>m===void 0?0:m*f)}else{const f=(1-u)/d;h=h.map(m=>m===void 0?f:m)}y.value=h});const A=h=>h*C.value;return{percentSizes:y,pxSizes:t.computed(()=>y.value.map(A))}}function Mae(s,C,i,p){const y=_=>_*C.value||0;function A(_,x){return x_(_)?y(w_(_)):E_(_)?C_(_):_??x}const h=t.ref(0),d=t.ref(null);let u=[],c=Xr;const f=t.computed(()=>s.value.map(_=>[_.min,_.max]));t.watch(p,()=>{if(h.value){const _=new MouseEvent("mouseup",{bubbles:!0});window.dispatchEvent(_)}});const m=_=>{h.value=0,d.value={index:_,confirmed:!1},u=i.value},g=(_,x)=>{var K;let E=null;if((!d.value||!d.value.confirmed)&&x!==0){if(x>0)E=_,d.value={index:_,confirmed:!0};else for(let G=_;G>=0;G-=1)if(u[G]>0){E=G,d.value={index:G,confirmed:!0};break}}const k=E??((K=d.value)==null?void 0:K.index)??_,P=[...u],D=k+1,R=A(f.value[k][0],0),z=A(f.value[D][0],0),F=A(f.value[k][1],C.value||0),H=A(f.value[D][1],C.value||0);let $=x;P[k]+$<R&&($=R-P[k]),P[D]-$<z&&($=P[D]-z),P[k]+$>F&&($=F-P[k]),P[D]-$>H&&($=P[D]-H),P[k]+=$,P[D]-=$,h.value=$,c=()=>{s.value.forEach((G,j)=>{G.size=P[j]}),c=Xr},p.value||c()},v=()=>{p.value&&c(),h.value=0,d.value=null,u=[]},b=[];return{lazyOffset:h,onMoveStart:m,onMoving:g,onMoveEnd:v,movingIndex:d,onCollapse:(_,x)=>{b.length||b.push(...i.value.map((z,F)=>{var H;return z<=0?A((H=f.value[F])==null?void 0:H[0],0):z}));const E=i.value,k=x==="start"?_:_+1,P=x==="start"?_+1:_,D=E[k],R=E[P];if(D!==0&&R!==0)E[k]=0,E[P]+=D,b[_]=D;else{const z=D+R,F=co(b[_],0,z),H=z-F;E[P]=F,E[k]=H}s.value.forEach((z,F)=>{z.size=E[F]})}}}const i3=Symbol("splitterRootContextKey");var Tae=t.defineComponent({name:"ElSplitter",__name:"splitter",props:xae,emits:Eae,setup(s,{emit:C}){const i=zt("splitter"),p=C,y=s,A=t.toRef(y,"layout"),h=t.toRef(y,"lazy"),{containerEl:d,containerSize:u}=kae(A),{removeChild:c,children:f,addChild:m,ChildrenSorter:g}=Pm(t.getCurrentInstance(),"ElSplitterPanel");t.watch(f,()=>{_.value=null,f.value.forEach(($,K)=>{$.setIndex(K)})});const{percentSizes:v,pxSizes:b}=Pae(f,u),{lazyOffset:w,movingIndex:_,onMoveStart:x,onMoving:E,onMoveEnd:k,onCollapse:P}=Mae(f,u,b,h),D=t.computed(()=>({[i.cssVarBlockName("bar-offset")]:h.value?`${w.value}px`:void 0})),R=$=>{x($),p("resizeStart",$,b.value)},z=($,K)=>{E($,K),h.value||p("resize",$,b.value)},F=async $=>{k(),await t.nextTick(),p("resizeEnd",$,b.value)},H=($,K)=>{P($,K),p("collapse",$,K,b.value)};return t.provide(i3,t.reactive({panels:f,percentSizes:v,pxSizes:b,layout:A,lazy:h,movingIndex:_,containerSize:u,onMoveStart:R,onMoving:z,onMoveEnd:F,onCollapse:H,registerPanel:m,unregisterPanel:c})),($,K)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerEl",ref:d,class:t.normalizeClass([t.unref(i).b(),t.unref(i).e(A.value)]),style:t.normalizeStyle(D.value)},[t.renderSlot($.$slots,"default"),t.createVNode(t.unref(g)),t.createCommentVNode(" Prevent iframe touch events from breaking "),t.unref(_)?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(i).e("mask"),t.unref(i).e(`mask-${A.value}`)])},null,2)):t.createCommentVNode("v-if",!0)],6))}}),Iae=Tae;function Dae(s){return s&&mn(s)?s:{start:!!s,end:!!s}}function s3(s,C,i,p){return!!(s!=null&&s.collapsible.end&&C>0||i!=null&&i.collapsible.start&&p===0&&C>0)}var Rae=t.defineComponent({name:"ElSplitterBar",__name:"split-bar",props:{index:{type:Number,required:!0},layout:{type:String,values:["horizontal","vertical"],default:"horizontal"},resizable:{type:Boolean,default:!0},lazy:Boolean,startCollapsible:Boolean,endCollapsible:Boolean},emits:["moveStart","moving","moveEnd","collapse"],setup(s,{emit:C}){const i=zt("splitter-bar"),p=s,y=C,A=t.computed(()=>p.layout==="horizontal"),h=t.computed(()=>A.value?{width:0}:{height:0}),d=t.computed(()=>({width:A.value?"16px":"100%",height:A.value?"100%":"16px",cursor:p.resizable?A.value?"ew-resize":"ns-resize":"auto",touchAction:"none"})),u=t.computed(()=>{const E=i.e("dragger");return{[`${E}-horizontal`]:A.value,[`${E}-vertical`]:!A.value,[`${E}-active`]:!!c.value}}),c=t.ref(null),f=E=>{p.resizable&&(c.value=[E.pageX,E.pageY],y("moveStart",p.index),window.addEventListener("mouseup",b),window.addEventListener("mousemove",g))},m=E=>{if(p.resizable&&E.touches.length===1){E.preventDefault();const k=E.touches[0];c.value=[k.pageX,k.pageY],y("moveStart",p.index),window.addEventListener("touchend",w),window.addEventListener("touchmove",v)}},g=E=>{const{pageX:k,pageY:P}=E,D=k-c.value[0],R=P-c.value[1],z=A.value?D:R;y("moving",p.index,z)},v=E=>{if(E.touches.length===1){E.preventDefault();const k=E.touches[0],P=k.pageX-c.value[0],D=k.pageY-c.value[1],R=A.value?P:D;y("moving",p.index,R)}},b=()=>{c.value=null,window.removeEventListener("mouseup",b),window.removeEventListener("mousemove",g),y("moveEnd",p.index)},w=()=>{c.value=null,window.removeEventListener("touchend",w),window.removeEventListener("touchmove",v),y("moveEnd",p.index)},_=t.computed(()=>A.value?Zt.ArrowLeft:Zt.ArrowUp),x=t.computed(()=>A.value?Zt.ArrowRight:Zt.ArrowDown);return(E,k)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(i).b()]),style:t.normalizeStyle(h.value)},[s.startCollapsible?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([t.unref(i).e("collapse-icon"),t.unref(i).e(`${s.layout}-collapse-icon-start`)]),onClick:k[0]||(k[0]=P=>y("collapse",s.index,"start"))},[t.renderSlot(E.$slots,"start-collapsible",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(_.value),{style:{width:"12px",height:"12px"}}))])],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass([t.unref(i).e("dragger"),u.value,t.unref(i).is("disabled",!s.resizable),t.unref(i).is("lazy",s.resizable&&s.lazy)]),style:t.normalizeStyle(d.value),onMousedown:f,onTouchstart:m},null,38),s.endCollapsible?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass([t.unref(i).e("collapse-icon"),t.unref(i).e(`${s.layout}-collapse-icon-end`)]),onClick:k[1]||(k[1]=P=>y("collapse",s.index,"end"))},[t.renderSlot(E.$slots,"end-collapsible",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(x.value),{style:{width:"12px",height:"12px"}}))])],2)):t.createCommentVNode("v-if",!0)],6))}}),Fae=Rae;const o3="ElSplitterPanel";var Nae=t.defineComponent({name:o3,__name:"split-panel",props:Bae,emits:Sae,setup(s,{expose:C,emit:i}){const p=zt("splitter-panel"),y=s,A=i,h=t.inject(i3);h||oi(o3,"usage: <el-splitter><el-splitter-panel /></el-splitter/>");const{panels:d,layout:u,lazy:c,containerSize:f,pxSizes:m}=t.toRefs(h),{registerPanel:g,unregisterPanel:v,onCollapse:b,onMoveEnd:w,onMoveStart:_,onMoving:x}=h,E=t.ref(),k=t.getCurrentInstance(),P=k.uid,D=t.ref(0),R=t.computed(()=>d.value[D.value]),z=O=>{D.value=O},F=t.computed(()=>R.value?m.value[D.value]??0:0),H=t.computed(()=>R.value?m.value[D.value+1]??0:0),$=t.computed(()=>R.value?d.value[D.value+1]:null),K=t.computed(()=>{var O;return $.value?y.resizable&&((O=$.value)==null?void 0:O.resizable)&&(F.value!==0||!y.min)&&(H.value!==0||!$.value.min):!1}),G=t.computed(()=>R.value?D.value!==d.value.length-1:!1),j=t.computed(()=>s3(R.value,F.value,$.value,H.value)),N=t.computed(()=>s3($.value,H.value,R.value,F.value));function I(O){return x_(O)?w_(O)*f.value||0:E_(O)?C_(O):O??0}let L=!1;t.watch(()=>y.size,()=>{if(!L&&R.value){if(!f.value){R.value.size=y.size;return}const O=I(y.size),Q=I(y.max),W=I(y.min),Z=Math.min(Math.max(O,W||0),Q||O);Z!==O&&A("update:size",Z),R.value.size=Z}}),t.watch(()=>{var O;return(O=R.value)==null?void 0:O.size},O=>{O!==y.size&&(L=!0,A("update:size",O),t.nextTick(()=>L=!1))}),t.watch(()=>y.resizable,O=>{R.value&&(R.value.resizable=O)});const U=t.reactive({uid:P,getVnode:()=>k.vnode,setIndex:z,...y,collapsible:t.computed(()=>Dae(y.collapsible))});return g(U),t.onBeforeUnmount(()=>v(U)),C({splitterPanelRef:E}),(O,Q)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",t.mergeProps({ref_key:"panelEl",ref:E,class:[t.unref(p).b()],style:{flexBasis:`${F.value}px`}},O.$attrs),[t.renderSlot(O.$slots,"default")],16),G.value?(t.openBlock(),t.createBlock(Fae,{key:0,index:D.value,layout:t.unref(u),lazy:t.unref(c),resizable:K.value,"start-collapsible":j.value,"end-collapsible":N.value,onMoveStart:t.unref(_),onMoving:t.unref(x),onMoveEnd:t.unref(w),onCollapse:t.unref(b)},{"start-collapsible":t.withCtx(()=>[t.renderSlot(O.$slots,"start-collapsible")]),"end-collapsible":t.withCtx(()=>[t.renderSlot(O.$slots,"end-collapsible")]),_:3},8,["index","layout","lazy","resizable","start-collapsible","end-collapsible","onMoveStart","onMoving","onMoveEnd","onCollapse"])):t.createCommentVNode("v-if",!0)],64))}}),a3=Nae;Tr(Iae,{SplitPanel:a3}),ai(a3);const wa="ElInfiniteScroll",Oae={delay:{type:Number,default:200},distance:{type:Number,default:0},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},B_=(s,C)=>Object.entries(Oae).reduce((i,[p,y])=>{const{type:A,default:h}=y,d=s.getAttribute(`infinite-scroll-${p}`);let u=C[d]??d??h;return u=u==="false"?!1:u,u=A(u),i[p]=Number.isNaN(u)?h:u,i},{}),l3=s=>{const{observer:C}=s[wa];C&&(C.disconnect(),delete s[wa].observer)},Lae=(s,C)=>{const{container:i,containerEl:p,instance:y,observer:A,lastScrollTop:h}=s[wa],{disabled:d,distance:u}=B_(s,y),{clientHeight:c,scrollHeight:f,scrollTop:m}=p,g=m-h;if(s[wa].lastScrollTop=m,A||d||g<0)return;let v=!1;if(i===s)v=f-(c+m)<=u;else{const{clientTop:b,scrollHeight:w}=s,_=bb(s,p);v=m+c>=_+b+w-u}v&&C.call(y)};function S_(s,C){const{containerEl:i,instance:p}=s[wa],{disabled:y}=B_(s,p);y||i.clientHeight===0||(i.scrollHeight<=i.clientHeight?C.call(p):l3(s))}const c3={async mounted(s,C){const{instance:i,value:p}=C;Na({scope:wa,from:"the directive v-infinite-scroll",replacement:"the el-scrollbar infinite scroll",version:"3.0.0",ref:"https://element-plus.org/en-US/component/scrollbar#infinite-scroll"},!0),Nr(p)||oi(wa,"'v-infinite-scroll' binding value must be a function"),await t.nextTick();const{delay:y,immediate:A}=B_(s,i),h=H0(s,!0),d=h===window?document.documentElement:h,u=Kl(Lae.bind(null,s,p),y);if(h){if(s[wa]={instance:i,container:h,containerEl:d,delay:y,cb:p,onScroll:u,lastScrollTop:d.scrollTop},A){const c=new MutationObserver(Kl(S_.bind(null,s,p),50));s[wa].observer=c,c.observe(s,{childList:!0,subtree:!0}),S_(s,p)}h.addEventListener("scroll",u)}},unmounted(s){if(!s.ElInfiniteScroll)return;const{container:C,onScroll:i}=s[wa];C==null||C.removeEventListener("scroll",i),l3(s)},async updated(s){if(!s.ElInfiniteScroll)await t.nextTick();else{const{containerEl:C,cb:i,observer:p}=s[wa];C.clientHeight&&p&&S_(s,i)}}};c3.install=s=>{s.directive("InfiniteScroll",c3)};function jae(s,C){let i,p=!1;const y=t.ref(!1),A=t.reactive({...s,originalPosition:"",originalOverflow:"",visible:!1});function h(b){A.text=b}function d(){if(p)return;p=!0;const b=A.parent,w=v.ns||v._.exposed.ns;if(!b.vLoadingAddClassList){let x=b.getAttribute("loading-number");x=Number.parseInt(x)-1,x?b.setAttribute("loading-number",x.toString()):(js(b,w.bm("parent","relative")),b.removeAttribute("loading-number")),js(b,w.bm("parent","hidden"))}u(),g.unmount();const _=v.$;_.vnode.el=null,_.subTree=null,g._container=null}function u(){var b,w;(w=(b=v.$el)==null?void 0:b.parentNode)==null||w.removeChild(v.$el)}function c(){var b;s.beforeClose&&!s.beforeClose()||(y.value=!0,clearTimeout(i),i=setTimeout(f,400),A.visible=!1,(b=s.closed)==null||b.call(s))}function f(){if(!y.value)return;const b=A.parent;y.value=!1,b.vLoadingAddClassList=void 0,d()}const m=t.defineComponent({name:"ElLoading",setup(b,{expose:w}){const{ns:_,zIndex:x}=jm("loading");return w({ns:_,zIndex:x}),()=>{const E=A.spinner||A.svg,k=t.h("svg",{class:"circular",viewBox:A.svgViewBox?A.svgViewBox:"0 0 50 50",...E?{innerHTML:E}:{}},E?void 0:[t.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),P=A.text?t.h("p",{class:_.b("text")},[A.text]):void 0;return t.h(t.Transition,{name:_.b("fade"),onAfterLeave:f},{default:t.withCtx(()=>[t.withDirectives(t.createVNode("div",{style:{backgroundColor:A.background||""},class:[_.b("mask"),A.customClass,_.is("fullscreen",A.fullscreen)]},[t.h("div",{class:_.b("spinner")},[k,P])]),[[t.vShow,A.visible]])])})}}}),g=t.createApp(m);Object.assign(g._context,C??{});const v=g.mount(document.createElement("div"));return{...t.toRefs(A),setText:h,removeElLoadingChild:u,close:c,handleAfterLeave:f,vm:v,get $el(){return p?null:v.$el}}}let DA;const u3=function(s={},C){if(!un)return;const i=Vae(s);if(i.fullscreen&&DA)return DA;const p=jae({...i,closed:()=>{var A;(A=i.closed)==null||A.call(i),i.fullscreen&&(DA=void 0)}},C??u3._context);Uae(i,i.parent,p),d3(i,i.parent,p),i.parent.vLoadingAddClassList=()=>d3(i,i.parent,p);let y=i.parent.getAttribute("loading-number");return y?y=`${Number.parseInt(y)+1}`:y="1",i.parent.setAttribute("loading-number",y),i.parent.appendChild(p.$el),t.nextTick(()=>p.visible.value=i.visible),i.fullscreen&&(DA=p),p},Vae=s=>{let C;return Ar(s.target)?C=document.querySelector(s.target)??document.body:C=s.target||document.body,{parent:C===document.body||s.body?document.body:C,background:s.background||"",svg:s.svg||"",svgViewBox:s.svgViewBox||"",spinner:s.spinner||!1,text:s.text||"",fullscreen:C===document.body&&(s.fullscreen??!0),lock:s.lock??!1,customClass:s.customClass||"",visible:s.visible??!0,beforeClose:s.beforeClose,closed:s.closed,target:C}},Uae=async(s,C,i)=>{const{nextZIndex:p}=i.vm.zIndex||i.vm._.exposed.zIndex,y={};if(s.fullscreen)i.originalPosition.value=pl(document.body,"position"),i.originalOverflow.value=pl(document.body,"overflow"),y.zIndex=p();else if(s.parent===document.body){i.originalPosition.value=pl(document.body,"position"),await t.nextTick();for(const A of["top","left"]){const h=A==="top"?"scrollTop":"scrollLeft";y[A]=`${s.target.getBoundingClientRect()[A]+document.body[h]+document.documentElement[h]-Number.parseInt(pl(document.body,`margin-${A}`),10)}px`}for(const A of["height","width"])y[A]=`${s.target.getBoundingClientRect()[A]}px`}else i.originalPosition.value=pl(C,"position");for(const[A,h]of Object.entries(y))i.$el.style[A]=h},d3=(s,C,i)=>{const p=i.vm.ns||i.vm._.exposed.ns;["absolute","fixed","sticky"].includes(i.originalPosition.value)?js(C,p.bm("parent","relative")):Zo(C,p.bm("parent","relative")),s.fullscreen&&s.lock?Zo(C,p.bm("parent","hidden")):js(C,p.bm("parent","hidden"))};u3._context=null;const zae={};zae._context=null;const f3=["primary","success","info","warning","error"],h3=["top","top-left","top-right","bottom","bottom-left","bottom-right"],Hs=mi({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:un?document.body:void 0}),Hae=Wt({customClass:{type:et([String,Array,Object,Boolean]),default:Hs.customClass},dangerouslyUseHTMLString:{type:Boolean,default:Hs.dangerouslyUseHTMLString},duration:{type:Number,default:Hs.duration},icon:{type:Pn,default:Hs.icon},id:{type:String,default:Hs.id},message:{type:et([String,Object,Function]),default:Hs.message},onClose:{type:et(Function),default:Hs.onClose},showClose:{type:Boolean,default:Hs.showClose},type:{type:String,values:f3,default:Hs.type},plain:{type:Boolean,default:Hs.plain},offset:{type:Number,default:Hs.offset},placement:{type:String,values:h3,default:Hs.placement},zIndex:{type:Number,default:Hs.zIndex},grouping:{type:Boolean,default:Hs.grouping},repeatNum:{type:Number,default:Hs.repeatNum}}),$ae={destroy:()=>!0},Ca=t.shallowReactive({}),Gae=s=>(Ca[s]||(Ca[s]=t.shallowReactive([])),Ca[s]),Qae=(s,C)=>{const i=Ca[C]||[],p=i.findIndex(h=>h.id===s),y=i[p];let A;return p>0&&(A=i[p-1]),{current:y,prev:A}},Wae=(s,C)=>{const{prev:i}=Qae(s,C);return i?i.vm.exposed.bottom.value:0},Kae=(s,C,i)=>(Ca[i]||[]).findIndex(p=>p.id===s)>0?16:C,Xae=["id"],Yae=["innerHTML"];var Jae=t.defineComponent({name:"ElMessage",__name:"message",props:Hae,emits:$ae,setup(s,{expose:C,emit:i}){const{Close:p}=py,y=s,A=i,h=t.ref(!1),{ns:d,zIndex:u}=jm("message"),{currentZIndex:c,nextZIndex:f}=u,m=t.ref(),g=t.ref(!1),v=t.ref(0);let b;const w=t.computed(()=>y.type?y.type==="error"?"danger":y.type:"info"),_=t.computed(()=>{const j=y.type;return{[d.bm("icon",j)]:j&&ec[j]}}),x=t.computed(()=>y.icon||ec[y.type]||""),E=t.computed(()=>y.placement||"top"),k=t.computed(()=>Wae(y.id,E.value)),P=t.computed(()=>Math.max(Kae(y.id,y.offset,E.value)+k.value,y.offset)),D=t.computed(()=>v.value+P.value),R=t.computed(()=>E.value.includes("left")?d.is("left"):E.value.includes("right")?d.is("right"):d.is("center")),z=t.computed(()=>E.value.startsWith("top")?"top":"bottom"),F=t.computed(()=>({[z.value]:`${P.value}px`,zIndex:c.value}));function H(){y.duration!==0&&({stop:b}=td(()=>{K()},y.duration))}function $(){b==null||b()}function K(){g.value=!1,t.nextTick(()=>{var j;h.value||((j=y.onClose)==null||j.call(y),A("destroy"))})}function G(j){Dn(j)===Gt.esc&&K()}return t.onMounted(()=>{H(),f(),g.value=!0}),t.watch(()=>y.repeatNum,()=>{$(),H()}),vn(document,"keydown",G),ti(m,()=>{v.value=m.value.getBoundingClientRect().height}),C({visible:g,bottom:D,close:K}),(j,N)=>(t.openBlock(),t.createBlock(t.Transition,{name:t.unref(d).b("fade"),onBeforeEnter:N[0]||(N[0]=I=>h.value=!0),onBeforeLeave:s.onClose,onAfterLeave:N[1]||(N[1]=I=>j.$emit("destroy")),persisted:""},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{id:s.id,ref_key:"messageRef",ref:m,class:t.normalizeClass([t.unref(d).b(),{[t.unref(d).m(s.type)]:s.type},t.unref(d).is("closable",s.showClose),t.unref(d).is("plain",s.plain),t.unref(d).is("bottom",z.value==="bottom"),R.value,s.customClass]),style:t.normalizeStyle(F.value),role:"alert",onMouseenter:$,onMouseleave:H},[s.repeatNum>1?(t.openBlock(),t.createBlock(t.unref(K$),{key:0,value:s.repeatNum,type:w.value,class:t.normalizeClass(t.unref(d).e("badge"))},null,8,["value","type","class"])):t.createCommentVNode("v-if",!0),x.value?(t.openBlock(),t.createBlock(t.unref(ir),{key:1,class:t.normalizeClass([t.unref(d).e("icon"),_.value])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(x.value)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),!s.dangerouslyUseHTMLString||j.$slots.default?(t.openBlock(),t.createElementBlock("p",{key:2,class:t.normalizeClass(t.unref(d).e("content"))},[t.renderSlot(j.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(s.message),1)])],2)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),t.createElementVNode("p",{class:t.normalizeClass(t.unref(d).e("content")),innerHTML:s.message},null,10,Yae)],2112)),s.showClose?(t.openBlock(),t.createBlock(t.unref(ir),{key:4,class:t.normalizeClass(t.unref(d).e("closeBtn")),onClick:t.withModifiers(K,["stop"])},{default:t.withCtx(()=>[t.createVNode(t.unref(p))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],46,Xae),[[t.vShow,g.value]])]),_:3},8,["name","onBeforeLeave"]))}}),Zae=Jae;let qae=1;const ele=s=>{if(!s.appendTo)s.appendTo=document.body;else if(Ar(s.appendTo)){let C=document.querySelector(s.appendTo);uo(C)||(wn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),C=document.body),s.appendTo=C}},tle=s=>{!s.placement&&Ar(zs.placement)&&zs.placement&&(s.placement=zs.placement),s.placement||(s.placement="top"),h3.includes(s.placement)||(wn("ElMessage",`Invalid placement: ${s.placement}. Falling back to 'top'.`),s.placement="top")},p3=s=>{const C=!s||Ar(s)||t.isVNode(s)||Nr(s)?{message:s}:s,i={...Hs,...C};return ele(i),tle(i),Bn(zs.grouping)&&!i.grouping&&(i.grouping=zs.grouping),lr(zs.duration)&&i.duration===3e3&&(i.duration=zs.duration),lr(zs.offset)&&i.offset===16&&(i.offset=zs.offset),Bn(zs.showClose)&&!i.showClose&&(i.showClose=zs.showClose),Bn(zs.plain)&&!i.plain&&(i.plain=zs.plain),i},rle=s=>{const C=s.props.placement||"top",i=Ca[C],p=i.indexOf(s);if(p===-1)return;i.splice(p,1);const{handler:y}=s;y.close()},nle=({appendTo:s,...C},i)=>{const p=`message_${qae++}`,y=C.onClose,A=document.createElement("div"),h={...C,id:p,onClose:()=>{y==null||y(),rle(c)},onDestroy:()=>{t.render(null,A)}},d=t.createVNode(Zae,h,Nr(h.message)||t.isVNode(h.message)?{default:Nr(h.message)?h.message:()=>h.message}:null);d.appContext=i||du._context,t.render(d,A),s.appendChild(A.firstElementChild);const u=d.component,c={id:p,vnode:d,vm:u,handler:{close:()=>{u.exposed.close()}},props:d.component.props};return c},du=(s={},C)=>{if(!un)return{close:()=>{}};const i=p3(s),p=Gae(i.placement||"top");if(i.grouping&&p.length){const A=p.find(({vnode:h})=>{var d;return((d=h.props)==null?void 0:d.message)===i.message});if(A)return A.props.repeatNum+=1,A.props.type=i.type,A.handler}if(lr(zs.max)&&p.length>=zs.max)return{close:()=>{}};const y=nle(i,C);return p.push(y),y.handler};f3.forEach(s=>{du[s]=(C={},i)=>{const p=p3(C);return du({...p,type:s},i)}});function ile(s){for(const C in Ca)if(Xi(Ca,C)){const i=[...Ca[C]];for(const p of i)(!s||s===p.props.type)&&p.handler.close()}}function sle(s){Ca[s]&&[...Ca[s]].forEach(C=>C.handler.close())}du.closeAll=ile,du.closeAllByPlacement=sle,du._context=null,WB(du,"$message");var ole=t.defineComponent({name:"ElMessageBox",directives:{TrapFocus:RG},components:{ElButton:gs,ElFocusTrap:md,ElInput:Ai,ElOverlay:Tb,ElIcon:ir,...py},inheritAttrs:!1,props:{buttonSize:{type:String,validator:LM},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(s,{emit:C}){const{locale:i,zIndex:p,ns:y,size:A}=jm("message-box",t.computed(()=>s.buttonSize)),{t:h}=i,{nextZIndex:d}=p,u=t.ref(!1),c=t.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",cancelButtonType:"",confirmButtonType:"primary",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:t.markRaw(Zt.Loading),cancelButtonLoadingIcon:t.markRaw(Zt.Loading),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:d()}),f=t.computed(()=>{const U=c.type;return{[y.bm("icon",U)]:U&&ec[U]}}),m=ws(),g=ws(),v=t.computed(()=>{const U=c.type;return c.icon||U&&ec[U]||""}),b=t.computed(()=>!!c.message),w=t.ref(),_=t.ref(),x=t.ref(),E=t.ref(),k=t.ref(),P=t.computed(()=>c.confirmButtonClass);t.watch(()=>c.inputValue,async U=>{await t.nextTick(),s.boxType==="prompt"&&U&&j()},{immediate:!0}),t.watch(()=>u.value,U=>{var O;U&&(s.boxType!=="prompt"&&(c.autofocus?x.value=((O=k.value)==null?void 0:O.$el)??w.value:x.value=w.value),c.zIndex=d()),s.boxType==="prompt"&&(U?t.nextTick().then(()=>{E.value&&E.value.$el&&(c.autofocus?x.value=N()??w.value:x.value=w.value)}):(c.editorErrorMessage="",c.validateError=!1))});const D=t.computed(()=>s.draggable),R=t.computed(()=>s.overflow),{isDragging:z}=VE(w,_,D,R);t.onMounted(async()=>{await t.nextTick(),s.closeOnHashChange&&window.addEventListener("hashchange",F)}),t.onBeforeUnmount(()=>{s.closeOnHashChange&&window.removeEventListener("hashchange",F)});function F(){u.value&&(u.value=!1,t.nextTick(()=>{c.action&&C("action",c.action)}))}const H=()=>{s.closeOnClickModal&&G(c.distinguishCancelAndClose?"close":"cancel")},$=ty(H),K=U=>{var O;if(c.inputType!=="textarea"&&!((O=E.value)!=null&&O.isComposing))return U.preventDefault(),G("confirm")},G=U=>{var O;s.boxType==="prompt"&&U==="confirm"&&!j()||(c.action=U,c.beforeClose?(O=c.beforeClose)==null||O.call(c,U,c,F):F())},j=()=>{if(s.boxType==="prompt"){const U=c.inputPattern;if(U&&!U.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||h("el.messagebox.error"),c.validateError=!0,!1;const O=c.inputValidator;if(Nr(O)){const Q=O(c.inputValue);if(Q===!1)return c.editorErrorMessage=c.inputErrorMessage||h("el.messagebox.error"),c.validateError=!0,!1;if(Ar(Q))return c.editorErrorMessage=Q,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},N=()=>{var O;const U=(O=E.value)==null?void 0:O.$refs;return(U==null?void 0:U.input)??(U==null?void 0:U.textarea)},I=()=>{G("close")},L=()=>{s.closeOnPressEscape&&I()};return s.lockScroll&&mm(u,{ns:y}),{...t.toRefs(c),ns:y,overlayEvent:$,visible:u,hasMessage:b,typeClass:f,contentId:m,inputId:g,btnSize:A,iconComponent:v,confirmButtonClasses:P,rootRef:w,focusStartRef:x,headerRef:_,inputRef:E,isDragging:z,confirmRef:k,doClose:F,handleClose:I,onCloseRequested:L,handleWrapperClick:H,handleInputEnter:K,handleAction:G,t:h}}});const ale=["aria-label","aria-describedby"],lle=["aria-label"],cle=["id"];function ule(s,C,i,p,y,A){const h=t.resolveComponent("el-icon"),d=t.resolveComponent("el-input"),u=t.resolveComponent("el-button"),c=t.resolveComponent("el-focus-trap"),f=t.resolveComponent("el-overlay");return t.openBlock(),t.createBlock(t.Transition,{name:"fade-in-linear",onAfterLeave:C[11]||(C[11]=m=>s.$emit("vanish")),persisted:""},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(f,{"z-index":s.zIndex,"overlay-class":[s.ns.is("message-box"),s.modalClass],mask:s.modal},{default:t.withCtx(()=>[t.createElementVNode("div",{role:"dialog","aria-label":s.title,"aria-modal":"true","aria-describedby":s.showInput?void 0:s.contentId,class:t.normalizeClass(`${s.ns.namespace.value}-overlay-message-box`),onClick:C[8]||(C[8]=(...m)=>s.overlayEvent.onClick&&s.overlayEvent.onClick(...m)),onMousedown:C[9]||(C[9]=(...m)=>s.overlayEvent.onMousedown&&s.overlayEvent.onMousedown(...m)),onMouseup:C[10]||(C[10]=(...m)=>s.overlayEvent.onMouseup&&s.overlayEvent.onMouseup(...m))},[t.createVNode(c,{loop:"",trapped:s.visible,"focus-trap-el":s.rootRef,"focus-start-el":s.focusStartRef,onReleaseRequested:s.onCloseRequested},{default:t.withCtx(()=>[t.createElementVNode("div",{ref:"rootRef",class:t.normalizeClass([s.ns.b(),s.customClass,s.ns.is("draggable",s.draggable),s.ns.is("dragging",s.isDragging),{[s.ns.m("center")]:s.center}]),style:t.normalizeStyle(s.customStyle),tabindex:"-1",onClick:C[7]||(C[7]=t.withModifiers(()=>{},["stop"]))},[s.title!==null&&s.title!==void 0?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"headerRef",class:t.normalizeClass([s.ns.e("header"),{"show-close":s.showClose}])},[t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("title"))},[s.iconComponent&&s.center?(t.openBlock(),t.createBlock(h,{key:0,class:t.normalizeClass([s.ns.e("status"),s.typeClass])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.iconComponent)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",null,t.toDisplayString(s.title),1)],2),s.showClose?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:t.normalizeClass(s.ns.e("headerbtn")),"aria-label":s.t("el.messagebox.close"),onClick:C[0]||(C[0]=m=>s.handleAction(s.distinguishCancelAndClose?"close":"cancel")),onKeydown:C[1]||(C[1]=t.withKeys(t.withModifiers(m=>s.handleAction(s.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[t.createVNode(h,{class:t.normalizeClass(s.ns.e("close"))},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.closeIcon||"close")))]),_:1},8,["class"])],42,lle)):t.createCommentVNode("v-if",!0)],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{id:s.contentId,class:t.normalizeClass(s.ns.e("content"))},[t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("container"))},[s.iconComponent&&!s.center&&s.hasMessage?(t.openBlock(),t.createBlock(h,{key:0,class:t.normalizeClass([s.ns.e("status"),s.typeClass])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.iconComponent)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),s.hasMessage?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(s.ns.e("message"))},[t.renderSlot(s.$slots,"default",{},()=>[s.dangerouslyUseHTMLString?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.showInput?"label":"p"),{key:1,for:s.showInput?s.inputId:void 0,innerHTML:s.message},null,8,["for","innerHTML"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.showInput?"label":"p"),{key:0,for:s.showInput?s.inputId:void 0,textContent:t.toDisplayString(s.message)},null,8,["for","textContent"]))])],2)):t.createCommentVNode("v-if",!0)],2),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("input"))},[t.createVNode(d,{id:s.inputId,ref:"inputRef",modelValue:s.inputValue,"onUpdate:modelValue":C[2]||(C[2]=m=>s.inputValue=m),type:s.inputType,placeholder:s.inputPlaceholder,"aria-invalid":s.validateError,class:t.normalizeClass({invalid:s.validateError}),onKeydown:t.withKeys(s.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),t.createElementVNode("div",{class:t.normalizeClass(s.ns.e("errormsg")),style:t.normalizeStyle({visibility:s.editorErrorMessage?"visible":"hidden"})},t.toDisplayString(s.editorErrorMessage),7)],2),[[t.vShow,s.showInput]])],10,cle),s.showCancelButton||s.showConfirmButton?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(s.ns.e("btns"))},[s.showCancelButton?(t.openBlock(),t.createBlock(u,{key:0,type:s.cancelButtonType==="text"?"":s.cancelButtonType,text:s.cancelButtonType==="text",loading:s.cancelButtonLoading,"loading-icon":s.cancelButtonLoadingIcon,class:t.normalizeClass([s.cancelButtonClass]),round:s.roundButton,size:s.btnSize,onClick:C[3]||(C[3]=m=>s.handleAction("cancel")),onKeydown:C[4]||(C[4]=t.withKeys(t.withModifiers(m=>s.handleAction("cancel"),["prevent"]),["enter"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.cancelButtonText||s.t("el.messagebox.cancel")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","size"])):t.createCommentVNode("v-if",!0),t.withDirectives(t.createVNode(u,{ref:"confirmRef",type:s.confirmButtonType==="text"?"":s.confirmButtonType,text:s.confirmButtonType==="text",loading:s.confirmButtonLoading,"loading-icon":s.confirmButtonLoadingIcon,class:t.normalizeClass([s.confirmButtonClasses]),round:s.roundButton,disabled:s.confirmButtonDisabled,size:s.btnSize,onClick:C[5]||(C[5]=m=>s.handleAction("confirm")),onKeydown:C[6]||(C[6]=t.withKeys(t.withModifiers(m=>s.handleAction("confirm"),["prevent"]),["enter"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.confirmButtonText||s.t("el.messagebox.confirm")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","disabled","size"]),[[t.vShow,s.showConfirmButton]])],2)):t.createCommentVNode("v-if",!0)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,ale)]),_:3},8,["z-index","overlay-class","mask"]),[[t.vShow,s.visible]])]),_:3})}var dle=Yi(ole,[["render",ule]]);const Ih=new Map,fle=s=>{let C=document.body;return s.appendTo&&(Ar(s.appendTo)&&(C=document.querySelector(s.appendTo)),uo(s.appendTo)&&(C=s.appendTo),uo(C)||(wn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),C=document.body)),C},k_=(s,C)=>{var p;const i=(p=s.component)==null?void 0:p.proxy;return()=>i.handleAction(C)},hle=(s,C,i=null)=>{const p=t.createVNode(dle,s,Nr(s.message)||t.isVNode(s.message)?{default:Nr(s.message)?()=>s.message({confirm:k_(p,"confirm"),cancel:k_(p,"cancel"),close:k_(p,"close")}):()=>s.message}:null);return p.appContext=i,t.render(p,C),fle(s).appendChild(C.firstElementChild),p.component},ple=()=>document.createElement("div"),mle=(s,C)=>{const i=ple();s.onVanish=()=>{t.render(null,i),Ih.delete(y)},s.onAction=A=>{const h=Ih.get(y);let d;s.showInput?d={value:y.inputValue,action:A}:d=A,s.callback?s.callback(d,p.proxy):A==="cancel"||A==="close"?s.distinguishCancelAndClose&&A!=="cancel"?h.reject("close"):h.reject("cancel"):h.resolve(d)};const p=hle(s,i,C),y=p.proxy;for(const A in s)Xi(s,A)&&!Xi(y.$props,A)&&(A==="closeIcon"&&mn(s[A])?y[A]=t.markRaw(s[A]):y[A]=s[A]);return y.visible=!0,y};function Pd(s,C=null){if(!un)return Promise.reject();let i;return Ar(s)||t.isVNode(s)?s={message:s}:i=s.callback,new Promise((p,y)=>{const A=mle(s,C??Pd._context);Ih.set(A,{options:s,callback:i,resolve:p,reject:y})})}const Ale=["alert","confirm","prompt"],gle={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Ale.forEach(s=>{Pd[s]=vle(s)});function vle(s){return(C,i,p,y)=>{let A="";return mn(i)?(p=i,A=""):en(i)?A="":A=i,Pd(Object.assign({title:A,message:C,type:"",...gle[s]},p,{boxType:s}),y)}}Pd.close=()=>{Ih.forEach((s,C)=>{C.doClose()}),Ih.clear()},Pd._context=null;const fu=Pd;fu.install=s=>{fu._context=s._context,s.config.globalProperties.$msgbox=fu,s.config.globalProperties.$messageBox=fu,s.config.globalProperties.$alert=fu.alert,s.config.globalProperties.$confirm=fu.confirm,s.config.globalProperties.$prompt=fu.prompt};const m3=["primary","success","info","warning","error"],yle=Wt({customClass:{type:et([String,Array,Object,Boolean]),default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:Pn},id:{type:String,default:""},message:{type:et([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:et(Function),default:()=>{}},onClose:{type:et(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...m3,""],default:""},zIndex:Number,closeIcon:{type:Pn,default:Zt.Close},progress:{type:et([Boolean,Object]),default:!1},pauseOnHover:{type:Boolean,default:!0}}),ble={destroy:()=>!0},_le=["id"],wle=["textContent"],Cle={key:0},xle=["innerHTML"];var Ele=t.defineComponent({name:"ElNotification",__name:"notification",props:yle,emits:ble,setup(s,{expose:C}){const i=s,{ns:p,zIndex:y}=jm("notification"),{nextZIndex:A,currentZIndex:h}=y,d=t.ref(!1);let u;const c=t.ref(100);let f=0,m=0;const g=t.computed(()=>{const j=i.type;return j&&ec[i.type]?p.m(j):""}),v=t.computed(()=>!!i.progress&&i.duration>0),b=t.computed(()=>{switch(i.type){case"success":return"success";case"warning":return"warning";case"error":return"exception";default:return}}),w=t.computed(()=>({status:b.value,strokeWidth:3,showText:!1,...typeof i.progress=="object"?i.progress:void 0})),_=t.computed(()=>i.type&&ec[i.type]||i.icon),x=t.computed(()=>i.position.endsWith("right")?"right":"left"),E=t.computed(()=>i.position.startsWith("top")?"top":"bottom"),k=t.computed(()=>({[E.value]:`${i.offset}px`,zIndex:i.zIndex??h.value})),{pause:P,resume:D}=PU(()=>{c.value=Math.max(0,100-(f+Date.now()-m)/i.duration*100)},100,{immediate:!1});function R(){if(i.duration<=0)return;u==null||u(),P(),m=Date.now();const j=Math.max(0,i.duration-f);({stop:u}=td(()=>{d.value&&K()},j)),v.value&&(c.value=j/i.duration*100,D())}function z(){u==null||u(),P(),m>0&&(f+=Date.now()-m,m=0)}let F=!1;function H(){F=!0,i.pauseOnHover&&z()}function $(){F=!1,i.pauseOnHover&&R()}function K(){d.value=!1,z()}function G(j){switch(Dn(j)){case Gt.delete:case Gt.backspace:z();break;case Gt.esc:d.value&&K();break;default:if(F&&i.pauseOnHover)break;z(),R()}}return t.onMounted(()=>{R(),A(),d.value=!0}),vn(document,"keydown",G),C({visible:d,close:K}),(j,N)=>(t.openBlock(),t.createBlock(t.Transition,{name:t.unref(p).b("fade"),onBeforeLeave:s.onClose,onAfterLeave:N[1]||(N[1]=I=>j.$emit("destroy")),persisted:""},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{id:s.id,class:t.normalizeClass([t.unref(p).b(),s.customClass,x.value]),style:t.normalizeStyle(k.value),role:"alert",onMouseenter:H,onMouseleave:$,onClick:N[0]||(N[0]=(...I)=>s.onClick&&s.onClick(...I))},[_.value?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass([t.unref(p).e("icon"),g.value])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(_.value)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("group"))},[t.createElementVNode("h2",{class:t.normalizeClass(t.unref(p).e("title")),textContent:t.toDisplayString(s.title)},null,10,wle),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(t.unref(p).e("content")),style:t.normalizeStyle(s.title?void 0:{margin:0})},[t.renderSlot(j.$slots,"default",{},()=>[s.dangerouslyUseHTMLString?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),t.createElementVNode("p",{innerHTML:s.message},null,8,xle)],2112)):(t.openBlock(),t.createElementBlock("p",Cle,t.toDisplayString(s.message),1))])],6),[[t.vShow,s.message]]),s.showClose?(t.openBlock(),t.createBlock(t.unref(ir),{key:0,class:t.normalizeClass(t.unref(p).e("closeBtn")),onClick:t.withModifiers(K,["stop"])},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.closeIcon)))]),_:1},8,["class"])):t.createCommentVNode("v-if",!0)],2),v.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(t.unref(p).e("progress")),"aria-hidden":"true"},[t.createVNode(t.unref(PM),t.mergeProps(w.value,{percentage:c.value}),null,16,["percentage"])],2)):t.createCommentVNode("v-if",!0)],46,_le),[[t.vShow,d.value]])]),_:3},8,["name","onBeforeLeave"]))}}),Ble=Ele;const Md={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},RA=16;let Sle=1;const hu=function(s={},C){if(!un)return{close:()=>{}};(Ar(s)||t.isVNode(s))&&(s={message:s});const i=s.position||"top-right";let p=s.offset||0;Md[i].forEach(({vm:f})=>{var m;p+=(((m=f.el)==null?void 0:m.offsetHeight)||0)+RA}),p+=RA;const y=`notification_${Sle++}`,A=s.onClose,h={...s,offset:p,id:y,onClose:()=>{kle(y,i,A)}};let d=document.body;uo(s.appendTo)?d=s.appendTo:Ar(s.appendTo)&&(d=document.querySelector(s.appendTo)),uo(d)||(wn("ElNotification","the appendTo option is not an HTMLElement. Falling back to document.body."),d=document.body);const u=document.createElement("div"),c=t.createVNode(Ble,h,Nr(h.message)?h.message:t.isVNode(h.message)?()=>h.message:null);return c.appContext=en(C)?hu._context:C,c.props.onDestroy=()=>{t.render(null,u)},t.render(c,u),Md[i].push({vm:c}),d.appendChild(u.firstElementChild),{close:()=>{c.component.exposed.close()}}};m3.forEach(s=>{hu[s]=(C={},i)=>((Ar(C)||t.isVNode(C))&&(C={message:C}),hu({...C,type:s},i))});function kle(s,C,i){const p=Md[C],y=p.findIndex(({vm:c})=>{var f;return((f=c.component)==null?void 0:f.props.id)===s});if(y===-1)return;const{vm:A}=p[y];if(!A)return;i==null||i(A);const h=A.el.offsetHeight,d=C.split("-")[0];p.splice(y,1);const u=p.length;if(!(u<1))for(let c=y;c<u;c++){const{el:f,component:m}=p[c].vm,g=Number.parseInt(f.style[d],10)-h-RA;m.props.offset=g}}function Ple(){for(const s of Object.values(Md))s.forEach(({vm:C})=>{C.component.exposed.close()})}function Mle(s="top-right"){var i,p,y,A;let C=((y=(p=(i=Md[s][0])==null?void 0:i.vm.component)==null?void 0:p.props)==null?void 0:y.offset)||0;for(const{vm:h}of Md[s])h.component.props.offset=C,C+=(((A=h.el)==null?void 0:A.offsetHeight)||0)+RA}hu.closeAll=Ple,hu.updateOffsets=Mle,hu._context=null,WB(hu,"$notify");const Tle=Wt({...Uc(dh,["ariaLabel","gpuAcceleration","rawContent"]),placement:Db.placement,tabindex:Db.tabindex,effect:{...dh.effect,default:"light"},title:String,width:{type:[String,Number],default:150},offset:{...dh.offset,default:void 0},persistent:{...dh.persistent,default:!0}}),Ile={"update:visible":s=>Bn(s),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0};({...Uc(KH,["gpuAcceleration"])});var Dle=t.defineComponent({name:"ElPopover",__name:"popover",props:Tle,emits:Ile,setup(s,{expose:C,emit:i}){const p=s,y=i,A=t.computed(()=>{const x=Ji.props,E=nr(x)?x:Object.keys(x);return Fa(p,E)}),h=zt("popover"),d=t.ref(),u=t.computed(()=>{var x;return(x=t.unref(d))==null?void 0:x.popperRef}),c=t.computed(()=>[{width:pi(p.width)},p.popperStyle]),f=t.computed(()=>[h.b(),p.popperClass,{[h.m("plain")]:!!p.content}]),m=t.computed(()=>p.transition===`${h.namespace.value}-fade-in-linear`),g=()=>{var x;(x=d.value)==null||x.hide()},v=()=>{y("before-enter")},b=()=>{y("before-leave")},w=()=>{y("after-enter")},_=()=>{y("update:visible",!1),y("after-leave")};return C({popperRef:u,hide:g}),(x,E)=>(t.openBlock(),t.createBlock(t.unref(Ji),t.mergeProps({ref_key:"tooltipRef",ref:d},A.value,{"aria-label":s.title,"popper-class":f.value,"popper-style":c.value,"gpu-acceleration":m.value,onBeforeShow:v,onBeforeHide:b,onShow:w,onHide:_}),{content:t.withCtx(()=>[s.title?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(t.unref(h).e("title")),role:"title"},t.toDisplayString(s.title),3)):t.createCommentVNode("v-if",!0),t.renderSlot(x.$slots,"default",{hide:g},()=>[t.createTextVNode(t.toDisplayString(s.content),1)])]),default:t.withCtx(()=>[x.$slots.reference?t.renderSlot(x.$slots,"reference",{key:0}):t.createCommentVNode("v-if",!0)]),_:3},16,["aria-label","popper-class","popper-style","gpu-acceleration"]))}}),Rle=Dle;const A3=(s,C)=>{var p;const i=(p=C.arg||C.value)==null?void 0:p.popperRef;i&&(i.triggerRef=s)};var Fle={mounted(s,C){A3(s,C)},updated(s,C){A3(s,C)}};const Nle=mz(Fle,"popover");Tr(Rle,{directive:Nle}),yr.on("ThemeConfig",()=>{Or.ConfigViewer()});class Or{static ConfigViewer(){if(jr.BIMX_CONFIGS.themeColor&&Or.setTheme(Yt("themeColor")),jr.BIMX_CONFIGS.isMobile&&(Or.setProperty("--annotation-marker-size","32px"),Or.setProperty("--annotation-marker-img-size","18px")),jr.BIMX_CONFIGS.topHeight||jr.BIMX_CONFIGS.bottomHeight){const C=parseInt(Yt("topHeight"));if(Yt("isMobile"))Or.setProperty("--mobile-top-height",`${(8+C).toString()}px`);else{const i=parseInt(Yt("bottomHeight")),p=C+i;Or.setProperty("--tall-panel-height",`calc(100% - ${p.toString()}px)`),Or.setProperty("--operate-item-top",`${(14+C).toString()}px`),Or.setProperty("--left-toggle-top",`${(14+C).toString()}px`)}Or.setProperty("--alert-box-top",`${(40+C).toString()}px`)}if(jr.BIMX_CONFIGS.annotationPos){const C=Yt("annotationPos").pos,i=Yt("annotationPos").posNum;C.includes("top")&&Or.setProperty("--annotation-panel-triangle-border","0 6px 6px "),C.includes("bottom")&&Or.setProperty("--annotation-panel-triangle-border"," 6px 6px 0"),C.includes("-")?(Or.setProperty("--annotation-panel-width","unset"),C.includes("left")?Or.setProperty("--annotation-panel-left",i[0].toString()+"px"):Or.setProperty("--annotation-panel-left","unset"),C.includes("right")?Or.setProperty("--annotation-panel-right",i[0].toString()+"px"):Or.setProperty("--annotation-panel-right","unset"),C.includes("bottom")?Or.setProperty("--annotation-panel-bottom",i[1].toString()+"px"):Or.setProperty("--annotation-panel-bottom","unset"),C.includes("top")?Or.setProperty("--annotation-panel-top",i[1].toString()+"px"):Or.setProperty("--annotation-panel-top","unset")):(C.includes("bottom")&&Or.setProperty("--annotation-panel-right","calc(50% - 136px)"),Or.setProperty("--annotation-panel-"+C,i[0].toString()+"px"))}if(jr.BIMX_CONFIGS.commentPos){const C=Yt("commentPos").pos,i=Yt("commentPos").posNum;C.includes("top")&&(Or.setProperty("--comment-panel-triangle-display","unset"),Or.setProperty("--comment-panel-triangle-border","0 6px 6px "),Or.setProperty("--comment-color-panel-top","46px"),Or.setProperty("--comment-color-panel-left","-9px"),Or.setProperty("--comment-color-edit-tips-bottom","48px")),C.includes("bottom")&&Or.setProperty("--comment-panel-triangle-border"," 6px 6px 0"),C.includes("-")?(Or.setProperty("--comment-panel-width","unset"),C.includes("left")?Or.setProperty("--comment-panel-left",i[0].toString()+"px"):Or.setProperty("--comment-panel-left","unset"),C.includes("right")?Or.setProperty("--comment-panel-right",i[0].toString()+"px"):Or.setProperty("--comment-panel-right","unset"),C.includes("bottom")?Or.setProperty("--comment-panel-bottom",i[1].toString()+"px"):Or.setProperty("--comment-panel-bottom","unset"),C.includes("top")?Or.setProperty("--comment-panel-top",i[1].toString()+"px"):Or.setProperty("--comment-panel-top","unset")):((C.includes("top")||C.includes("bottom"))&&(Or.setProperty("--comment-panel-wrapper-width","100%"),Or.setProperty("--comment-panel-left","0"),Or.setProperty("--comment-panel-right","0")),Or.setProperty("--comment-panel-"+C,i[0].toString()+"px"))}if(jr.BIMX_CONFIGS.roamPos){const C=Yt("roamPos").pos,i=parseInt(Yt("topHeight")),p=parseInt(Yt("bottomHeight"));C.includes("top")&&(Or.setProperty("--roam-toolbar-top",`${(30+i).toString()}px`),Or.setProperty("--roam-toolbar-bottom","unset")),C.includes("bottom")&&(Or.setProperty("--roam-toolbar-top","unset"),Or.setProperty("--roam-toolbar-bottom",`${(14+p).toString()}px`))}}static get currentTheme(){return document.documentElement.getAttribute("data-theme")}static setTheme(C){document.documentElement.setAttribute("data-theme",C)}static setProperty(C,i){document.body.style.setProperty(C,i)}static getProperty(C){return document.body.style.getPropertyValue(C)}}const FA=(s,C)=>{let i=0,p=0;return Yt("navCubePos").pos.includes("left")?i+=parseInt(Yt("leftWidth")):Yt("navCubePos").pos.includes("right")&&(i+=parseInt(Yt("rightWidth"))),Yt("navCubePos").pos.includes("top")?p+=parseInt(Yt("topHeight")):Yt("navCubePos").pos.includes("bottom")&&(p+=parseInt(Yt("bottomHeight"))),[s?i+C:i,p]},Ole={class:"unfold_btn"},Lle=["onClick"],jle={key:0,class:"tctwins_btn"},Vle=["src"],Ule=["src"],zle=["src"],Hle={key:1,class:"left_button_group"},$le=["src"],Gle={key:2,class:"right_button_group"},Qle={key:0,class:"cooperate_btn mobile_toggle"},Wle=["src"],Kle={key:1,class:"bcf_btn mobile_toggle"},Xle=["src"],Yle={key:3,class:"exit_fullscreen"},Jle=["src"],Zle={class:"click_events"},qle=t.defineComponent({__name:"AppToolbar",props:["visibleTools"],emits:["emitHandler"],setup(s,{emit:C}){const i=In(),p=si(),y=t.ref(jr.BIMX_CONFIGS.enableTree),A=t.ref(jr.BIMX_CONFIGS.showInspector),h=t.computed(()=>F=>F=="tree"?y.value:F=="inspector"?A.value:!0),d=()=>{const{eventTrigger:F}=window.bimViewer;F.on("treeAllReady",H=>{Gn("enableTree",!0),y.value=!0}),F.on("metaLoaded",H=>{Gn("showInspector",!0),A.value=!0})};yr.on("BimViewer",d);const u=p.tools.filter(F=>F.id<14||F.id==17);t.onMounted(()=>{y.value&&p.setToolActiveStatusBykey("tree",!0)});const c=C,f=F=>{c("emitHandler",F)},m=F=>{b.value=F,D.value=!0,R.value=!0,k.value.enable()};yr.on("hideToolbar",m);const g=t.ref(!1),v=F=>{g.value=F,Or.setProperty("--toolbar-tool-bottom",`${g.value?"3.8":"1.44"}rem`)};yr.on("expandMenu",v),t.onBeforeUnmount(()=>{yr.off("hideToolbar",m),yr.off("expandMenu",v),yr.off("BimViewer",d)});const b=t.ref(!1),w=t.ref(!1),_=F=>{const H=p.getToolByKey(F);H&&(H.isActive?(F!=="reset"&&(D.value=!0,R.value=!0,k.value.enable(),F==="mouse"?P.value=p.isToolActiveBykey("navigate"):P.value=!1),b.value=!1):(F!=="reset"&&F!=="fullscreen"&&F!=="cooperate"&&F!=="mouse"&&(p.setAllToolClose(["fullscreen","mouse"].map($=>{var K;return(K=p.getToolByKey($))==null?void 0:K.id}).filter(Boolean)),Un.SetAllClose()),F!=="reset"&&F!=="navigate"&&F!=="enjoy"&&F!=="share"&&F!=="mouse"&&(D.value=!1,R.value=!1,k.value.disable(),p.setToolActiveStatusBykey("mouse",!1)),F!=="reset"&&(P.value=F==="navigate"),F==="mouse"&&(P.value=p.isToolActiveBykey("navigate")),(F==="comment"||F==="tree"||F==="inspector"||F==="section")&&(b.value=!0),F==="navigate"&&(D.value=!0,R.value=!0,k.value.enable(),P.value=!0)),F==="fullscreen"&&(H.isActive?w.value=!1:w.value=!0),x(H))},x=F=>{var H;F.key!=="fullscreen"&&Un.SetToolActiveByKey(F.key),p.setToolActiveStatus(F.id),f({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:F.id,toolKey:F.key,status:(H=p.getToolById(F.id))==null?void 0:H.isActive}})},E=()=>{f({isTool:!1,event_target:"ToolBar",event_name:"exitViewer",content:{}})},k=t.ref(),P=t.ref(!1),D=t.ref(!0),R=t.ref(!0),z=()=>{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(F,H)=>{var G,j,N,I,L,U,O,Q,W,Z;const $=gi,K=OL;return t.openBlock(),t.createElementBlock(t.Fragment,null,[!w.value&&!b.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"mobile_toolbar",style:t.normalizeStyle({height:g.value?"3.8rem":"unset"})},[t.createElementVNode("div",Ole,[t.createElementVNode("div",{class:"unfold_wrapper",onClick:H[0]||(H[0]=J=>v(!g.value))},[...H[6]||(H[6]=[t.createElementVNode("div",null,null,-1)])])]),t.createVNode($,null,{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["tctwins_toolbar",{tctwins_toolbar_expend:g.value}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.visibleTools,J=>(t.openBlock(),t.createElementBlock("div",{key:J.id,class:"tctwins_btn_group",onClick:ne=>_(J.key)},[t.unref(u).includes(J)&&h.value(J.key)?(t.openBlock(),t.createElementBlock("div",jle,[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bar/new-icons/bimkk-mobile-toolbar-${J.isActive?J.imgActive:J.img}.svg`},null,8,Vle),t.createElementVNode("span",{class:t.normalizeClass(J.hasActiveState&&t.unref(p).isToolActive(J.id)?"tool_name_active":"tool_name")},t.toDisplayString(t.unref(p).isToolActive(J.id)&&J.key==="fullscreen"?t.unref(i)("toolbar.exitFullscreen"):t.unref(i)(J.name)),3)])):t.createCommentVNode("",!0)],8,Lle))),128))],2)]),_:1}),R.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["mouse_btn",{mouse_higher:P.value}])},[t.createElementVNode("div",{class:"mouse",onClick:H[1]||(H[1]=J=>_("mouse"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/industry-viewer/action-bar/${(G=t.unref(p).getToolByKey("mouse"))!=null&&G.isActive?(j=t.unref(p).getToolByKey("mouse"))==null?void 0:j.imgActive:(N=t.unref(p).getToolByKey("mouse"))==null?void 0:N.img}.svg`},null,8,Ule),t.createElementVNode("span",{style:t.normalizeStyle({color:(I=t.unref(p).getToolByKey("mouse"))!=null&&I.isActive?"#1457F7":"#262626"})},t.toDisplayString(t.unref(i)("toolbar.virtualMouse")),5)]),t.createElementVNode("div",{class:"reset",onClick:z},[t.createElementVNode("img",{src:`${t.unref(Qt)}/industry-viewer/reset.svg`},null,8,zle),t.createElementVNode("span",null,t.toDisplayString(t.unref(i)("common.reset")),1)])],2)):t.createCommentVNode("",!0)],4)):t.createCommentVNode("",!0),w.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Hle,[t.unref(Yt)("backButton")?(t.openBlock(),t.createElementBlock("div",{key:0,class:"back mobile_toggle",onClick:H[2]||(H[2]=J=>E())},[t.createElementVNode("img",{src:t.unref(Qt)+"/bim-viewer/close_black.png"},null,8,$le)])):t.createCommentVNode("",!0)])),w.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Gle,[s.visibleTools&&t.unref(p).isToolEnableBykey("cooperate")?(t.openBlock(),t.createElementBlock("div",Qle,[t.createElementVNode("div",{class:t.normalizeClass(["tctwins_btn",{tctwins_btn_active:t.unref(p).isToolActiveBykey("cooperate")&&(((L=t.unref(p).getToolByKey("cooperate"))==null?void 0:L.hasActiveState)??!1)}]),onClick:H[3]||(H[3]=J=>_("cooperate"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/bim-viewer/action-bar/${t.unref(p).isToolActiveBykey("cooperate")?(O=t.unref(p).getToolByKey("cooperate"))==null?void 0:O.imgActive:(U=t.unref(p).getToolByKey("cooperate"))==null?void 0:U.img}.svg`},null,8,Wle)],2)])):t.createCommentVNode("",!0),s.visibleTools&&t.unref(p).isToolEnableBykey("bcf")?(t.openBlock(),t.createElementBlock("div",Kle,[t.createElementVNode("div",{class:t.normalizeClass(["tctwins_btn",{tctwins_btn_active:t.unref(p).isToolActiveBykey("bcf")&&(((Q=t.unref(p).getToolByKey("bcf"))==null?void 0:Q.hasActiveState)??!1)}]),onClick:H[4]||(H[4]=J=>_("bcf"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/bim-viewer/action-bar/${t.unref(p).isToolActiveBykey("bcf")?(Z=t.unref(p).getToolByKey("bcf"))==null?void 0:Z.imgActive:(W=t.unref(p).getToolByKey("bcf"))==null?void 0:W.img}.svg`},null,8,Xle)],2)])):t.createCommentVNode("",!0)])),w.value?(t.openBlock(),t.createElementBlock("div",Yle,[t.createElementVNode("div",{class:"exit_full_btn",onClick:H[5]||(H[5]=J=>_("fullscreen"))},[t.createElementVNode("img",{src:`${t.unref(Qt)}/industry-viewer/action-bar/fullscreen-active.svg`},null,8,Jle)])])):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",Zle,[t.createVNode(K,{ref_key:"clickEventRef",ref:k},null,512)],512),[[t.vShow,D.value]])],64)}}}),yn=(s,C)=>{const i=s.__vccOpts||s;for(const[p,y]of C)i[p]=y;return i},ece=yn(qle,[["__scopeId","data-v-eef618d2"]]),tce={class:"bimx-tools-wrapper"},rce={class:"left_buttons"},nce=["onClick"],ice=["src"],sce={class:"tctwins_toolbar_wrapper"},oce={class:"tctwins_toolbar"},ace=["onClick"],lce=["src"],cce={key:1,class:"splitLine"},uce={class:"right_buttons"},dce=["onClick"],fce=["src"],hce=yn(t.defineComponent({__name:"Toolbar",props:["visibleTools"],emits:["emitHandler"],setup(s,{emit:C}){const i=In(),p=t.ref(jr.BIMX_CONFIGS.enableTree),y=t.ref(jr.BIMX_CONFIGS.showInspector),A=()=>{const{eventTrigger:x}=window.bimViewer;x.on("treeAllReady",E=>{Gn("enableTree",!0),p.value=!0}),x.on("metaLoaded",E=>{Gn("showInspector",!0),y.value=!0})};yr.on("BimViewer",A),t.onMounted(()=>{jr.BIMX_CONFIGS.enableTree&&(p.value=!0)}),t.onUnmounted(()=>{yr.off("BimViewer",A)});const h=t.computed(()=>x=>x=="tree"?p.value:!0),d=t.computed(()=>x=>x=="inspector"?y.value:!0);Wl.BIMX_CONFIGS.Toolbar||(yr.on("BIMX_CONFIGS",()=>{jr.BIMX_CONFIGS.enableTree&&(p.value=!0)}),Wl.BIMX_CONFIGS.Toolbar=!0);const u=C,c=x=>{u("emitHandler",x)},f=si(),m=f.tools.filter(x=>x.position==1),g=f.tools.filter(x=>x.position==2),v=x=>{f.isToolActive(x.id)||x.id!=10&&x.id!=1&&(f.setAllToolClose([0,14]),Un.SetAllClose()),_(x)},b=x=>{f.isToolActive(x.id)||(x.key=="bcf"?(f.setAllToolClose([7,8,9,11]),Un.SetAllClose()):f.setToolActiveStatusBykey("bcf",!1)),_(x)},w=x=>{f.isToolActive(x.id)||x.key=="enjoy"&&(f.setAllToolClose(),Un.SetAllClose()),_(x)},_=x=>{Un.SetToolActiveByKey(x.key),f.setToolActiveStatus(x.id),c({isTool:!1,event_target:"ToolBar",event_name:"clickTool",content:{toolId:x.id,toolKey:x.key,status:x.isActive}})};return(x,E)=>{const k=Ji;return t.openBlock(),t.createElementBlock("div",tce,[t.createElementVNode("div",rce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(m),(P,D)=>(t.openBlock(),t.createElementBlock("div",{key:P.id,onClick:R=>b(P)},[P.position==1&&t.unref(f).isToolEnable(P.id)&&h.value(P.key)?(t.openBlock(),t.createBlock(k,{key:0,content:t.unref(i)(P.name),placement:"right",effect:"light"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["toggle_btn",{tctwins_btn_active:P.isActive&&P.hasActiveState}])},[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bars/${P.isActive?P.imgActive:P.img}.svg`,alt:""},null,8,ice)],2)]),_:2},1032,["content"])):t.createCommentVNode("",!0)],8,nce))),128))]),t.createElementVNode("div",sce,[t.createElementVNode("div",oce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.visibleTools,(P,D)=>(t.openBlock(),t.createElementBlock("div",{key:P.id,class:"tctwins_btn-group",onClick:R=>v(P)},[d.value(P.key)?(t.openBlock(),t.createBlock(k,{key:0,content:t.unref(i)(P.name),placement:"top",effect:"light"},{default:t.withCtx(()=>[P.position==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["tctwins_btn",{tctwins_btn_active:P.isActive&&P.hasActiveState}])},[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bars/${P.isActive?P.imgActive:P.img}.svg`,alt:""},null,8,lce)],2)):t.createCommentVNode("",!0)]),_:2},1032,["content"])):t.createCommentVNode("",!0),P.isShowDelimiter&&D!=s.visibleTools.length-1?(t.openBlock(),t.createElementBlock("div",cce)):t.createCommentVNode("",!0)],8,ace))),128))])]),t.createElementVNode("div",uce,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(g),(P,D)=>(t.openBlock(),t.createElementBlock("div",{key:P.id,onClick:R=>w(P)},[P.position==2&&t.unref(f).isToolEnable(P.id)?(t.openBlock(),t.createBlock(k,{key:0,content:t.unref(i)(P.name),placement:"left",effect:"light"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["toggle_btn",{tctwins_btn_active:P.isActive&&P.hasActiveState}])},[t.createElementVNode("img",{class:"img",src:`${t.unref(Qt)}/bim-viewer/action-bars/${P.isActive?P.imgActive:P.img}.svg`,alt:""},null,8,fce)],2)]),_:2},1032,["content"])):t.createCommentVNode("",!0)],8,dce))),128))])])}}}),[["__scopeId","data-v-e4035baa"]]),pce="1.1.6";async function mce(){try{return(await eL.get(`${sL}/oss/sts`)).data.data}catch(s){throw console.error("Error fetching data:",s),s}}async function g3(){try{const s=await mce();return new tL({region:"oss-cn-beijing",accessKeyId:s.accessKeyId,accessKeySecret:s.accessKeySecret,stsToken:s.securityToken,bucket:s.bucketName})}catch(s){console.log("getSTStoken() throw an error: ",s)}}class uc{static async getBuffer(C,i,p){try{const A=await(await g3()).get(C);i(A.content.buffer)}catch(y){p&&p(y)}}static async requestFileFromOSS(C,i,p,y){try{const A=await g3();if(i){const h=await A.get(`${C}/metadata.json`);p(JSON.parse(h.content))}else{const h=await A.get(`${C}/index.json`);p(JSON.parse(h.content))}}catch(A){console.error("请求文件失败:",A),y(A)}}static async downloadFile(C){try{const i=await fetch(C);if(!i.ok)throw new Error(`Failed to fetch file: ${i.status} ${i.statusText}`);return await i.arrayBuffer()}catch(i){throw console.error("Error fetching file:",i),i}}}const NA=s=>{if(!s)return"";const C=s.split("?")[0],i=C.lastIndexOf("/");if(C.lastIndexOf(".")===-1)return C.slice(i+1);const y=C.slice(i+1),A=y.lastIndexOf(".");return A===-1?y:y.slice(0,A)},Td=s=>{const C=s.lastIndexOf(".");let i=[];return C!==-1&&(i=[s.slice(0,C),s.slice(C+1)]),i[0]},v3=[];function Ace(s){const{viewer:C}=window.bimViewer,{scene:i}=C,p=i.models[s];if(!p){console.error("没有找到正确的模型,无法检测构建异常");return}gce({points:vce(p.aabbs),epsilon:100,min_samples:i.numObjects/4>=1?i.numObjects/4:1},y=>{if(y.noise.length>0){const{noise:A}=y;for(const h in A)v3.push(i.objectIds[A[h]]);window.bimViewer.updateAABB(v3,()=>{C.cameraFlight.jumpTo({aabb:C.scene.aabb})})}if(y.labels_count>1){const{labels:A}=y;let h;const d=y.change_indices,u=[];for(let c=0;c<d.length;c++)h=d[c],c==d.length-1?u.push(i.objectIds.slice(h,A.length)):u.push(i.objectIds.slice(h,d[c+1]));window.bimViewer.setPartialObjectIds(u)}})}function gce(s,C){console.log("start dbscan..."),fetch(`${oL}/dbscan/convert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(i=>(i.ok,i.json())).then(i=>{if(i&&i.error)throw new Error(i.error);i.noise.length>0||i.labels_count>1?(C(i),console.log("DBSCAN Result:",`noise:${i.noise}`,`labels_count:${i.labels_count}`)):(console.log("DBSCAN Result:",i),console.log("DBSCAN Result: no outlier"))}).catch(i=>{console.error("DBSCAN failed:",i)})}function vce(s){const C=[];for(let i=0;i<s.length;i++){const p=s[i],y=[(p[0]+p[3])/2,(p[1]+p[4])/2,(p[2]+p[5])/2];C.push(y)}return C}let y3=!1;function yce(s,C,i,p,y){const A=new Date().getTime();window.bimViewer.loadModel(s,i,()=>{p&&p({code:200,result:s+"模型加载完成!"})},h=>{p&&p({code:-1,result:s+"模型加载失败!",msg:h})},{modelType:C,...y||{}}),y3||(y3=!0,window.bimViewer.modelsExplorer.on("modelLoaded",()=>{window.bimViewer.setAllObjectsEdges(!1);const d=new Date().getTime()-A;console.log(`加载时长: ${d/1e3} s`),Yt("multiModel")?console.log("集成模式下不进行离群点检测"):Yt("outliersDetect")&&Ace(s)}))}var b3={"./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"(s,C,i){i.r(C),i.d(C,{AlphaFormat:()=>mI,AmbientLight:()=>H_,AngleMeasurementsControl:()=>Nn,AngleMeasurementsMouseControl:()=>xa,AngleMeasurementsPlugin:()=>Au,AngleMeasurementsSimulateMouseControl:()=>BEe,AngleMeasurementsTouchControl:()=>EEe,AnnotationsPlugin:()=>TEe,AxisGizmoPlugin:()=>gSe,BCFViewpointsPlugin:()=>OTe,Bitmap:()=>e4,ByteType:()=>sI,CameraMemento:()=>DD,CameraPath:()=>QTe,CameraPathAnimation:()=>op,Canvas:()=>j3,ClampToEdgeWrapping:()=>_o,Component:()=>At,CompressedMediaType:()=>NBe,Configs:()=>lg,CubicBezierCurve:()=>r3e,Curve:()=>sp,DefaultLoadingManager:()=>iD,DepthFormat:()=>yI,DepthStencilFormat:()=>bI,DirLight:()=>Ba,DistanceMeasurementsControl:()=>Eg,DistanceMeasurementsMouseControl:()=>yD,DistanceMeasurementsPlugin:()=>UTe,DistanceMeasurementsSimulateMouseControl:()=>HTe,DistanceMeasurementsTouchControl:()=>zTe,EdgeMaterial:()=>Q_,EmphasisMaterial:()=>Es,FloatType:()=>uI,Fresnel:()=>BSe,Frustum:()=>ro,FrustumPlane:()=>yu,GIFMediaType:()=>DBe,GLTFDefaultDataSource:()=>xD,GLTFLoaderPlugin:()=>wje,HalfFloatType:()=>dI,ImagePlane:()=>XTe,IntType:()=>lI,JPEGMediaType:()=>RBe,KTX2TextureTranscoder:()=>Jd,LASLoaderPlugin:()=>bVe,LambertMaterial:()=>ySe,LightMap:()=>qTe,LineSet:()=>vD,LinearEncoding:()=>Lo,LinearFilter:()=>$s,LinearMipMapLinearFilter:()=>Hd,LinearMipMapNearestFilter:()=>jh,LinearMipmapLinearFilter:()=>wu,LinearMipmapNearestFilter:()=>IBe,Loader:()=>sD,LoadingManager:()=>nD,LocaleService:()=>ED,LuminanceAlphaFormat:()=>vI,LuminanceFormat:()=>gI,Map:()=>Ae,Marker:()=>ln,Mesh:()=>wr,MetallicMaterial:()=>wSe,MirroredRepeatWrapping:()=>kl,ModelMemento:()=>t3e,NavCubePlugin:()=>xje,NearestFilter:()=>_u,NearestMipMapLinearFilter:()=>zd,NearestMipMapNearestFilter:()=>Lh,NearestMipmapLinearFilter:()=>iI,NearestMipmapNearestFilter:()=>nI,Node:()=>Gd,ObjectEditPlugin:()=>uVe,ObjectsKdTree3:()=>ye,ObjectsMemento:()=>RD,PNGMediaType:()=>FBe,Path:()=>n3e,PerformanceModel:()=>s3e,PhongMaterial:()=>Hn,Plugin:()=>Ye,PointLight:()=>YTe,PointerLens:()=>te,QuadraticBezierCurve:()=>i3e,Queue:()=>me,RGBAFormat:()=>Vh,RGBAIntegerFormat:()=>EI,RGBA_ASTC_10x10_Format:()=>c1,RGBA_ASTC_10x5_Format:()=>o1,RGBA_ASTC_10x6_Format:()=>a1,RGBA_ASTC_10x8_Format:()=>l1,RGBA_ASTC_12x10_Format:()=>u1,RGBA_ASTC_12x12_Format:()=>d1,RGBA_ASTC_4x4_Format:()=>rg,RGBA_ASTC_5x4_Format:()=>q_,RGBA_ASTC_5x5_Format:()=>e1,RGBA_ASTC_6x5_Format:()=>t1,RGBA_ASTC_6x6_Format:()=>r1,RGBA_ASTC_8x5_Format:()=>n1,RGBA_ASTC_8x6_Format:()=>i1,RGBA_ASTC_8x8_Format:()=>s1,RGBA_BPTC_Format:()=>ng,RGBA_ETC2_EAC_Format:()=>tg,RGBA_PVRTC_2BPPV1_Format:()=>J_,RGBA_PVRTC_4BPPV1_Format:()=>qA,RGBA_S3TC_DXT1_Format:()=>YA,RGBA_S3TC_DXT3_Format:()=>JA,RGBA_S3TC_DXT5_Format:()=>zh,RGBFormat:()=>AI,RGB_ETC1_Format:()=>Z_,RGB_ETC2_Format:()=>eg,RGB_PVRTC_2BPPV1_Format:()=>Y_,RGB_PVRTC_4BPPV1_Format:()=>ZA,RGB_S3TC_DXT1_Format:()=>Uh,RGFormat:()=>CI,RGIntegerFormat:()=>xI,ReadableGeometry:()=>Mn,RedFormat:()=>_I,RedIntegerFormat:()=>wI,ReflectionMap:()=>ZTe,Renderer:()=>Q3,RepeatWrapping:()=>Mi,Scene:()=>Oh,SceneModel:()=>Bu,SceneModelMesh:()=>r4,SceneModelTransform:()=>dD,SectionBoxControl:()=>BO,SectionPlane:()=>sg,SectionPlanesPlugin:()=>Vje,ShortType:()=>oI,Skybox:()=>X1,SkyboxesPlugin:()=>Gje,SpecularMaterial:()=>ESe,SplineCurve:()=>Pg,SpriteMarker:()=>e3e,StoreyViewsPlugin:()=>$je,Texture:()=>Qd,TextureTranscoder:()=>o3e,TreeViewPlugin:()=>Qje,UnsignedByteType:()=>X_,UnsignedInt248Type:()=>pI,UnsignedIntType:()=>cI,UnsignedShort4444Type:()=>fI,UnsignedShort5551Type:()=>hI,UnsignedShortType:()=>aI,VBOGeometry:()=>JI,ViewCullPlugin:()=>Yje,Viewer:()=>uNe,WebIFCLoaderPlugin:()=>lVe,WorkerPool:()=>aD,XTCDefaultDataSource:()=>kO,XTCLoaderPlugin:()=>iVe,buildBoxGeometry:()=>Nh,buildBoxLinesGeometry:()=>PSe,buildCylinderGeometry:()=>wo,buildGridGeometry:()=>ZI,buildLineGeometry:()=>TSe,buildPlaneGeometry:()=>y1,buildPolylineGeometry:()=>qI,buildPolylineGeometryFromCurve:()=>MSe,buildSphereGeometry:()=>$d,buildTorusGeometry:()=>gc,buildVectorTextGeometry:()=>ig,createRTCViewMat:()=>ot,frustumIntersectsAABB3:()=>O3,getKTX2TextureTranscoder:()=>lD,getPlaneRTCPos:()=>Ft,load3DSGeometry:()=>SSe,loadOBJGeometry:()=>kSe,math:()=>V,rtcToWorldPos:()=>bt,sRGBEncoding:()=>_i,setFrustum:()=>N3,stats:()=>be,utils:()=>at,worldToRTCPos:()=>Et,worldToRTCPositions:()=>ft});var p=A().m(TN),y=A().m(ax);function A(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var B,o,r=typeof Symbol=="function"?Symbol:{},e=r.iterator||"@@iterator",n=r.toStringTag||"@@toStringTag";function l(oe,ge,ie,xe){var Ee=ge&&ge.prototype instanceof S?ge:S,Me=Object.create(Ee.prototype);return h(Me,"_invoke",function(Be,ke,De){var Ie,Fe,Ne,$e=0,it=De||[],pt=!1,ut={p:0,n:0,v:B,a:dt,f:dt.bind(B,4),d:function(Tt,Xt){return Ie=Tt,Fe=0,Ne=B,ut.n=Xt,a}};function dt(wt,Tt){for(Fe=wt,Ne=Tt,o=0;!pt&&$e&&!Xt&&o<it.length;o++){var Xt,Nt=it[o],Pt=ut.p,er=Nt[2];wt>3?(Xt=er===Tt)&&(Ne=Nt[(Fe=Nt[4])?5:(Fe=3,3)],Nt[4]=Nt[5]=B):Nt[0]<=Pt&&((Xt=wt<2&&Pt<Nt[1])?(Fe=0,ut.v=Tt,ut.n=Nt[1]):Pt<er&&(Xt=wt<3||Nt[0]>Tt||Tt>er)&&(Nt[4]=wt,Nt[5]=Tt,ut.n=er,Fe=0))}if(Xt||wt>1)return a;throw pt=!0,Tt}return function(wt,Tt,Xt){if($e>1)throw TypeError("Generator is already running");for(pt&&Tt===1&&dt(Tt,Xt),Fe=Tt,Ne=Xt;(o=Fe<2?B:Ne)||!pt;){Ie||(Fe?Fe<3?(Fe>1&&(ut.n=-1),dt(Fe,Ne)):ut.n=Ne:ut.v=Ne);try{if($e=2,Ie){if(Fe||(wt="next"),o=Ie[wt]){if(!(o=o.call(Ie,Ne)))throw TypeError("iterator result is not an object");if(!o.done)return o;Ne=o.value,Fe<2&&(Fe=0)}else Fe===1&&(o=Ie.return)&&o.call(Ie),Fe<2&&(Ne=TypeError("The iterator does not provide a '"+wt+"' method"),Fe=1);Ie=B}else if((o=(pt=ut.n<0)?Ne:Be.call(ke,ut))!==a)break}catch(Nt){Ie=B,Fe=1,Ne=Nt}finally{$e=1}}return{value:o,done:pt}}}(oe,ie,xe),!0),Me}var a={};function S(){}function T(){}function M(){}o=Object.getPrototypeOf;var X=[][e]?o(o([][e]())):(h(o={},e,function(){return this}),o),Y=M.prototype=S.prototype=Object.create(X);function ee(oe){return Object.setPrototypeOf?Object.setPrototypeOf(oe,M):(oe.__proto__=M,h(oe,n,"GeneratorFunction")),oe.prototype=Object.create(Y),oe}return T.prototype=M,h(Y,"constructor",M),h(M,"constructor",T),T.displayName="GeneratorFunction",h(M,n,"GeneratorFunction"),h(Y),h(Y,n,"Generator"),h(Y,e,function(){return this}),h(Y,"toString",function(){return"[object Generator]"}),(A=function(){return{w:l,m:ee}})()}function h(B,o,r,e){var n=Object.defineProperty;try{n({},"",{})}catch{n=0}h=function(a,S,T,M){function X(Y,ee){h(a,Y,function(oe){return this._invoke(Y,ee,oe)})}S?n?n(a,S,{value:T,enumerable:!M,configurable:!M,writable:!M}):a[S]=T:(X("next",0),X("throw",1),X("return",2))},h(B,o,r,e)}function d(B,o,r,e,n,l,a){try{var S=B[l](a),T=S.value}catch(M){return void r(M)}S.done?o(T):Promise.resolve(T).then(e,n)}function u(B){return function(){var o=this,r=arguments;return new Promise(function(e,n){var l=B.apply(o,r);function a(T){d(l,e,n,a,S,"next",T)}function S(T){d(l,e,n,a,S,"throw",T)}a(void 0)})}}function c(B,o){var r=Object.keys(B);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(B);o&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(B,n).enumerable})),r.push.apply(r,e)}return r}function f(B){for(var o=1;o<arguments.length;o++){var r=arguments[o]!=null?arguments[o]:{};o%2?c(Object(r),!0).forEach(function(e){L(B,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(e){Object.defineProperty(B,e,Object.getOwnPropertyDescriptor(r,e))})}return B}function m(B){return b(B)||v(B)||P(B)||g()}function g(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
68
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(B){if(typeof Symbol<"u"&&B[Symbol.iterator]!=null||B["@@iterator"]!=null)return Array.from(B)}function b(B){if(Array.isArray(B))return D(B)}function w(B,o){return E(B)||x(B,o)||P(B,o)||_()}function _(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
69
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(B,o){var r=B==null?null:typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(r!=null){var e,n,l,a,S=[],T=!0,M=!1;try{if(l=(r=r.call(B)).next,o===0){if(Object(r)!==r)return;T=!1}else for(;!(T=(e=l.call(r)).done)&&(S.push(e.value),S.length!==o);T=!0);}catch(X){M=!0,n=X}finally{try{if(!T&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(M)throw n}}return S}}function E(B){if(Array.isArray(B))return B}function k(B,o){var r=typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(!r){if(Array.isArray(B)||(r=P(B))||o){r&&(B=r);var e=0,n=function(){};return{s:n,n:function(){return e>=B.length?{done:!0}:{done:!1,value:B[e++]}},e:function(M){throw M},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
70
70
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,a=!0,S=!1;return{s:function(){r=r.call(B)},n:function(){var M=r.next();return a=M.done,M},e:function(M){S=!0,l=M},f:function(){try{a||r.return==null||r.return()}finally{if(S)throw l}}}}function P(B,o){if(B){if(typeof B=="string")return D(B,o);var r={}.toString.call(B).slice(8,-1);return r==="Object"&&B.constructor&&(r=B.constructor.name),r==="Map"||r==="Set"?Array.from(B):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(B,o):void 0}}function D(B,o){(o==null||o>B.length)&&(o=B.length);for(var r=0,e=Array(o);r<o;r++)e[r]=B[r];return e}function R(B,o,r){return o=j(o),z(B,H()?Reflect.construct(o,r||[],j(B).constructor):o.apply(B,r))}function z(B,o){if(o&&(U(o)=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F(B)}function F(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}function H(){try{var B=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(H=function(){return!!B})()}function $(B,o,r,e){var n=K(j(B.prototype),o,r);return typeof n=="function"?function(l){return n.apply(r,l)}:n}function K(){return K=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(B,o,r){var e=G(B,o);if(e){var n=Object.getOwnPropertyDescriptor(e,o);return n.get?n.get.call(arguments.length<3?B:r):n.value}},K.apply(null,arguments)}function G(B,o){for(;!{}.hasOwnProperty.call(B,o)&&(B=j(B))!==null;);return B}function j(B){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},j(B)}function N(B,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(o&&o.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),o&&I(B,o)}function I(B,o){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},I(B,o)}function L(B,o,r){return(o=Z(o))in B?Object.defineProperty(B,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):B[o]=r,B}function U(B){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},U(B)}function O(B,o){if(!(B instanceof o))throw new TypeError("Cannot call a class as a function")}function Q(B,o){for(var r=0;r<o.length;r++){var e=o[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(B,Z(e.key),e)}}function W(B,o,r){return o&&Q(B.prototype,o),r&&Q(B,r),Object.defineProperty(B,"prototype",{writable:!1}),B}function Z(B){var o=J(B,"string");return U(o)=="symbol"?o:o+""}function J(B,o){if(U(B)!="object"||!B)return B;var r=B[Symbol.toPrimitive];if(r!==void 0){var e=r.call(B,o);if(U(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(B)}function ne(B){return new q(B,0)}function ae(B){return function(){return new ce(B.apply(this,arguments))}}function ce(B){var o,r;function e(l,a){try{var S=B[l](a),T=S.value,M=T instanceof q;Promise.resolve(M?T.v:T).then(function(X){if(M){var Y=l==="return"&&T.k?l:"next";if(!T.k||X.done)return e(Y,X);X=B[Y](X).value}n(!!S.done,X)},function(X){e("throw",X)})}catch(X){n(2,X)}}function n(l,a){l===2?o.reject(a):o.resolve({value:a,done:l}),(o=o.next)?e(o.key,o.arg):r=null}this._invoke=function(l,a){return new Promise(function(S,T){var M={key:l,arg:a,resolve:S,reject:T,next:null};r?r=r.next=M:(o=r=M,e(l,a))})},typeof B.return!="function"&&(this.return=void 0)}ce.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ce.prototype.next=function(B){return this._invoke("next",B)},ce.prototype.throw=function(B){return this._invoke("throw",B)},ce.prototype.return=function(B){return this._invoke("return",B)};function q(B,o){this.v=B,this.k=o}function fe(B){var o,r,e,n=2;for(typeof Symbol<"u"&&(r=Symbol.asyncIterator,e=Symbol.iterator);n--;){if(r&&(o=B[r])!=null)return o.call(B);if(e&&(o=B[e])!=null)return new re(o.call(B));r="@@asyncIterator",e="@@iterator"}throw new TypeError("Object is not async iterable")}function re(B){function o(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var e=r.done;return Promise.resolve(r.value).then(function(n){return{value:n,done:e}})}return re=function(e){this.s=e,this.n=e.next},re.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):o(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):o(n.apply(this.s,arguments))}},new re(B)}var te=function(){function B(o){var r=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,B),this.viewer=o,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(){r._active&&r._visible&&r.update()})}return W(B,[{key:"update",value:function(){if(!(!this._active||!this._visible)&&this._canvasPos){var r=this._lensContainer.getBoundingClientRect(),e=this._canvasElement.getBoundingClientRect(),n=this._canvasPos[0]<r.right&&this._canvasPos[0]>r.left&&this._canvasPos[1]<r.bottom&&this._canvasPos[1]>r.top;this._lensContainer.style.marginLeft="25px",n&&(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 l=Math.max(this._lensCanvas.width,this._lensCanvas.height)/this._zoomLevel;this._lensCanvasContext.drawImage(this._canvasElement,this._canvasPos[0]-l/2,this._canvasPos[1]-l/2,l,l,0,0,this._lensCanvas.width,this._lensCanvas.height);var a=[(r.left+r.right)/2,(r.top+r.bottom)/2];if(this._snappedCanvasPos){var S=this._snappedCanvasPos[0]-this._canvasPos[0],T=this._snappedCanvasPos[1]-this._canvasPos[1];this._lensCursorDiv.style.marginLeft="".concat(a[0]+S*this._zoomLevel-10,"px"),this._lensCursorDiv.style.marginTop="".concat(a[1]+T*this._zoomLevel-10,"px")}else this._lensCursorDiv.style.marginLeft="".concat(a[0]-10,"px"),this._lensCursorDiv.style.marginTop="".concat(a[1]-10,"px")}}},{key:"zoomFactor",get:function(){return this._zoomLevel},set:function(r){this._zoomLevel=r,this.update()}},{key:"canvasPos",get:function(){return this._canvasPos},set:function(r){this._canvasPos=r,this.update()}},{key:"snappedCanvasPos",get:function(){return this._snappedCanvasPos},set:function(r){this._snappedCanvasPos=r,this.update()}},{key:"snapped",get:function(){return this._snapped},set:function(r){this._snapped=r,r?(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(r){this._active=r,this._lensContainer.style.visibility=r&&this._visible?"visible":"hidden",(!r||!this._visible)&&(this._lensCursorDiv.style.marginLeft="-100px",this._lensCursorDiv.style.marginTop="-100px"),this.update()}},{key:"visible",get:function(){return this._visible},set:function(r){this._visible=r,this._lensContainer.style.visibility=r&&this._active?"visible":"hidden",(!r||!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)}}])}(),le=!0,de=le?Float64Array:Float32Array,he=new de(3),ue=new de(16),pe=new de(16),se=new de(4),V={setDoublePrecisionEnabled:function(o){le=o,de=le?Float64Array:Float32Array},getDoublePrecisionEnabled:function(){return le},MIN_DOUBLE:-Number.MAX_SAFE_INTEGER,MAX_DOUBLE:Number.MAX_SAFE_INTEGER,MAX_INT:1e7,DEGTORAD:.0174532925,RADTODEG:57.295779513,unglobalizeObjectId:function(o,r){var e=r.indexOf("#");return e===o.length&&r.startsWith(o)?r.substring(e+1):r},globalizeObjectId:function(o,r){return o+"#"+r},safeInv:function(o){var r=1/o;return isNaN(r)||!isFinite(r)?1:r},vec2:function(o){return new de(o||2)},vec3:function(o){return new de(o||3)},vec4:function(o){return new de(o||4)},mat3:function(o){return new de(o||9)},mat3ToMat4:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new de(16);return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=0,r[4]=o[3],r[5]=o[4],r[6]=o[5],r[7]=0,r[8]=o[6],r[9]=o[7],r[10]=o[8],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},mat4:function(o){return new de(o||16)},mat4ToMat3:function(o,r){},doublesToFloats:function(o,r,e){for(var n=new de(2),l=0,a=o.length;l<a;l++)V.splitDouble(o[l],n),r[l]=n[0],e[l]=n[1]},splitDouble:function(o,r){var e=de.from([o])[0],n=o-e;r[0]=e,r[1]=n},createUUID:function(){for(var B=[],o=0;o<256;o++)B[o]=(o<16?"0":"")+o.toString(16);return function(){var r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,l=Math.random()*4294967295|0;return"".concat(B[r&255]+B[r>>8&255]+B[r>>16&255]+B[r>>24&255],"-").concat(B[e&255]).concat(B[e>>8&255],"-").concat(B[e>>16&15|64]).concat(B[e>>24&255],"-").concat(B[n&63|128]).concat(B[n>>8&255],"-").concat(B[n>>16&255]).concat(B[n>>24&255]).concat(B[l&255]).concat(B[l>>8&255]).concat(B[l>>16&255]).concat(B[l>>24&255])}}(),clamp:function(o,r,e){return Math.max(r,Math.min(e,o))},fmod:function(o,r){if(o<r)return console.error("math.fmod : Attempting to find modulus within negative range - would be infinite loop - ignoring"),o;for(;r<=o;)o-=r;return o},compareVec3:function(o,r){return o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]},negateVec3:function(o,r){return r||(r=o),r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r},negateVec4:function(o,r){return r||(r=o),r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r},addVec4:function(o,r,e){return e||(e=o),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e[3]=o[3]+r[3],e},addVec4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]+r,e[1]=o[1]+r,e[2]=o[2]+r,e[3]=o[3]+r,e},addVec3:function(o,r,e){return e||(e=o),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e},addVec3Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]+r,e[1]=o[1]+r,e[2]=o[2]+r,e},subVec4:function(o,r,e){return e||(e=o),e[0]=o[0]-r[0],e[1]=o[1]-r[1],e[2]=o[2]-r[2],e[3]=o[3]-r[3],e},subVec3:function(o,r,e){return e||(e=o),e[0]=o[0]-r[0],e[1]=o[1]-r[1],e[2]=o[2]-r[2],e},subVec2:function(o,r,e){return e||(e=o),e[0]=o[0]-r[0],e[1]=o[1]-r[1],e},geometricMeanVec2:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];for(var n=new de(r[0]),l=1;l<r.length;l++)n[0]+=r[l][0],n[1]+=r[l][1];return n[0]/=r.length,n[1]/=r.length,n},subVec4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]-r,e[1]=o[1]-r,e[2]=o[2]-r,e[3]=o[3]-r,e},subScalarVec4:function(o,r,e){return e||(e=o),e[0]=r-o[0],e[1]=r-o[1],e[2]=r-o[2],e[3]=r-o[3],e},mulVec3:function(o,r,e){return e||(e=o),e[0]=o[0]*r[0],e[1]=o[1]*r[1],e[2]=o[2]*r[2],e},mulVec4:function(o,r,e){return e||(e=o),e[0]=o[0]*r[0],e[1]=o[1]*r[1],e[2]=o[2]*r[2],e[3]=o[3]*r[3],e},mulVec4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]*r,e[1]=o[1]*r,e[2]=o[2]*r,e[3]=o[3]*r,e},mulVec3Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]*r,e[1]=o[1]*r,e[2]=o[2]*r,e},mulVec2Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]*r,e[1]=o[1]*r,e},divVec3:function(o,r,e){return e||(e=o),e[0]=o[0]/r[0],e[1]=o[1]/r[1],e[2]=o[2]/r[2],e},divVec4:function(o,r,e){return e||(e=o),e[0]=o[0]/r[0],e[1]=o[1]/r[1],e[2]=o[2]/r[2],e[3]=o[3]/r[3],e},divScalarVec3:function(o,r,e){return e||(e=r),e[0]=o/r[0],e[1]=o/r[1],e[2]=o/r[2],e},divVec3Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]/r,e[1]=o[1]/r,e[2]=o[2]/r,e},divVec4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]/r,e[1]=o[1]/r,e[2]=o[2]/r,e[3]=o[3]/r,e},divScalarVec4:function(o,r,e){return e||(e=r),e[0]=o/r[0],e[1]=o/r[1],e[2]=o/r[2],e[3]=o/r[3],e},dotVec4:function(o,r){return o[0]*r[0]+o[1]*r[1]+o[2]*r[2]+o[3]*r[3]},cross3Vec4:function(o,r){var e=o[0],n=o[1],l=o[2],a=r[0],S=r[1],T=r[2];return[n*T-l*S,l*a-e*T,e*S-n*a,0]},cross3Vec3:function(o,r,e){e||(e=o);var n=o[0],l=o[1],a=o[2],S=r[0],T=r[1],M=r[2];return e[0]=l*M-a*T,e[1]=a*S-n*M,e[2]=n*T-l*S,e},sqLenVec4:function(o){return V.dotVec4(o,o)},lenVec4:function(o){return Math.sqrt(V.sqLenVec4(o))},dotVec3:function(o,r){return o[0]*r[0]+o[1]*r[1]+o[2]*r[2]},dotVec2:function(o,r){return o[0]*r[0]+o[1]*r[1]},sqLenVec3:function(o){return V.dotVec3(o,o)},sqLenVec2:function(o){return V.dotVec2(o,o)},lenVec3:function(o){return Math.sqrt(V.sqLenVec3(o))},distVec3:function(){var B=new de(3);return function(o,r){return V.lenVec3(V.subVec3(o,r,B))}}(),lenVec2:function(o){return Math.sqrt(V.sqLenVec2(o))},distVec2:function(){var B=new de(2);return function(o,r){return V.lenVec2(V.subVec2(o,r,B))}}(),rcpVec3:function(o,r){return V.divScalarVec3(1,o,r)},normalizeVec4:function(o,r){var e=1/V.lenVec4(o);return V.mulVec4Scalar(o,e,r)},normalizeVec3:function(o,r){var e=1/V.lenVec3(o);return V.mulVec3Scalar(o,e,r)},normalizeVec2:function(o,r){var e=1/V.lenVec2(o);return V.mulVec2Scalar(o,e,r)},angleVec3:function(o,r){var e=V.dotVec3(o,r)/Math.sqrt(V.sqLenVec3(o)*V.sqLenVec3(r));return e=e<-1?-1:e>1?1:e,Math.acos(e)},vec3FromMat4Scale:function(){var B=new de(3);return function(o,r){return B[0]=o[0],B[1]=o[1],B[2]=o[2],r[0]=V.lenVec3(B),B[0]=o[4],B[1]=o[5],B[2]=o[6],r[1]=V.lenVec3(B),B[0]=o[8],B[1]=o[9],B[2]=o[10],r[2]=V.lenVec3(B),r}}(),vecToArray:function(){function B(o){return Math.round(o*1e5)/1e5}return function(o){o=Array.prototype.slice.call(o);for(var r=0,e=o.length;r<e;r++)o[r]=B(o[r]);return o}}(),xyzArrayToObject:function(o){return{x:o[0],y:o[1],z:o[2]}},xyzObjectToArray:function(o,r){return r=r||V.vec3(),r[0]=o.x,r[1]=o.y,r[2]=o.z,r},dupMat4:function(o){return o.slice(0,16)},mat4To3:function(o){return[o[0],o[1],o[2],o[4],o[5],o[6],o[8],o[9],o[10]]},m4s:function(o){return[o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o]},setMat4ToZeroes:function(){return V.m4s(0)},setMat4ToOnes:function(){return V.m4s(1)},diagonalMat4v:function(o){return new de([o[0],0,0,0,0,o[1],0,0,0,0,o[2],0,0,0,0,o[3]])},diagonalMat4c:function(o,r,e,n){return V.diagonalMat4v([o,r,e,n])},diagonalMat4s:function(o){return V.diagonalMat4c(o,o,o,o)},identityMat4:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new de(16);return o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1,o[11]=0,o[12]=0,o[13]=0,o[14]=0,o[15]=1,o},identityMat3:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new de(9);return o[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},isIdentityMat4:function(o){return!(o[0]!==1||o[1]!==0||o[2]!==0||o[3]!==0||o[4]!==0||o[5]!==1||o[6]!==0||o[7]!==0||o[8]!==0||o[9]!==0||o[10]!==1||o[11]!==0||o[12]!==0||o[13]!==0||o[14]!==0||o[15]!==1)},negateMat4:function(o,r){return r||(r=o),r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r[4]=-o[4],r[5]=-o[5],r[6]=-o[6],r[7]=-o[7],r[8]=-o[8],r[9]=-o[9],r[10]=-o[10],r[11]=-o[11],r[12]=-o[12],r[13]=-o[13],r[14]=-o[14],r[15]=-o[15],r},addMat4:function(o,r,e){return e||(e=o),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e[3]=o[3]+r[3],e[4]=o[4]+r[4],e[5]=o[5]+r[5],e[6]=o[6]+r[6],e[7]=o[7]+r[7],e[8]=o[8]+r[8],e[9]=o[9]+r[9],e[10]=o[10]+r[10],e[11]=o[11]+r[11],e[12]=o[12]+r[12],e[13]=o[13]+r[13],e[14]=o[14]+r[14],e[15]=o[15]+r[15],e},addMat4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]+r,e[1]=o[1]+r,e[2]=o[2]+r,e[3]=o[3]+r,e[4]=o[4]+r,e[5]=o[5]+r,e[6]=o[6]+r,e[7]=o[7]+r,e[8]=o[8]+r,e[9]=o[9]+r,e[10]=o[10]+r,e[11]=o[11]+r,e[12]=o[12]+r,e[13]=o[13]+r,e[14]=o[14]+r,e[15]=o[15]+r,e},addScalarMat4:function(o,r,e){return V.addMat4Scalar(r,o,e)},subMat4:function(o,r,e){return e||(e=o),e[0]=o[0]-r[0],e[1]=o[1]-r[1],e[2]=o[2]-r[2],e[3]=o[3]-r[3],e[4]=o[4]-r[4],e[5]=o[5]-r[5],e[6]=o[6]-r[6],e[7]=o[7]-r[7],e[8]=o[8]-r[8],e[9]=o[9]-r[9],e[10]=o[10]-r[10],e[11]=o[11]-r[11],e[12]=o[12]-r[12],e[13]=o[13]-r[13],e[14]=o[14]-r[14],e[15]=o[15]-r[15],e},subMat4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]-r,e[1]=o[1]-r,e[2]=o[2]-r,e[3]=o[3]-r,e[4]=o[4]-r,e[5]=o[5]-r,e[6]=o[6]-r,e[7]=o[7]-r,e[8]=o[8]-r,e[9]=o[9]-r,e[10]=o[10]-r,e[11]=o[11]-r,e[12]=o[12]-r,e[13]=o[13]-r,e[14]=o[14]-r,e[15]=o[15]-r,e},subScalarMat4:function(o,r,e){return e||(e=r),e[0]=o-r[0],e[1]=o-r[1],e[2]=o-r[2],e[3]=o-r[3],e[4]=o-r[4],e[5]=o-r[5],e[6]=o-r[6],e[7]=o-r[7],e[8]=o-r[8],e[9]=o-r[9],e[10]=o-r[10],e[11]=o-r[11],e[12]=o-r[12],e[13]=o-r[13],e[14]=o-r[14],e[15]=o-r[15],e},mulMat4:function(o,r,e){e||(e=o);var n=o[0],l=o[1],a=o[2],S=o[3],T=o[4],M=o[5],X=o[6],Y=o[7],ee=o[8],oe=o[9],ge=o[10],ie=o[11],xe=o[12],Ee=o[13],Me=o[14],Be=o[15],ke=r[0],De=r[1],Ie=r[2],Fe=r[3],Ne=r[4],$e=r[5],it=r[6],pt=r[7],ut=r[8],dt=r[9],wt=r[10],Tt=r[11],Xt=r[12],Nt=r[13],Pt=r[14],er=r[15];return e[0]=ke*n+De*T+Ie*ee+Fe*xe,e[1]=ke*l+De*M+Ie*oe+Fe*Ee,e[2]=ke*a+De*X+Ie*ge+Fe*Me,e[3]=ke*S+De*Y+Ie*ie+Fe*Be,e[4]=Ne*n+$e*T+it*ee+pt*xe,e[5]=Ne*l+$e*M+it*oe+pt*Ee,e[6]=Ne*a+$e*X+it*ge+pt*Me,e[7]=Ne*S+$e*Y+it*ie+pt*Be,e[8]=ut*n+dt*T+wt*ee+Tt*xe,e[9]=ut*l+dt*M+wt*oe+Tt*Ee,e[10]=ut*a+dt*X+wt*ge+Tt*Me,e[11]=ut*S+dt*Y+wt*ie+Tt*Be,e[12]=Xt*n+Nt*T+Pt*ee+er*xe,e[13]=Xt*l+Nt*M+Pt*oe+er*Ee,e[14]=Xt*a+Nt*X+Pt*ge+er*Me,e[15]=Xt*S+Nt*Y+Pt*ie+er*Be,e},mulMat3:function(o,r,e){e||(e=new de(9));var n=o[0],l=o[3],a=o[6],S=o[1],T=o[4],M=o[7],X=o[2],Y=o[5],ee=o[8],oe=r[0],ge=r[3],ie=r[6],xe=r[1],Ee=r[4],Me=r[7],Be=r[2],ke=r[5],De=r[8];return e[0]=n*oe+l*xe+a*Be,e[3]=n*ge+l*Ee+a*ke,e[6]=n*ie+l*Me+a*De,e[1]=S*oe+T*xe+M*Be,e[4]=S*ge+T*Ee+M*ke,e[7]=S*ie+T*Me+M*De,e[2]=X*oe+Y*xe+ee*Be,e[5]=X*ge+Y*Ee+ee*ke,e[8]=X*ie+Y*Me+ee*De,e},mulMat4Scalar:function(o,r,e){return e||(e=o),e[0]=o[0]*r,e[1]=o[1]*r,e[2]=o[2]*r,e[3]=o[3]*r,e[4]=o[4]*r,e[5]=o[5]*r,e[6]=o[6]*r,e[7]=o[7]*r,e[8]=o[8]*r,e[9]=o[9]*r,e[10]=o[10]*r,e[11]=o[11]*r,e[12]=o[12]*r,e[13]=o[13]*r,e[14]=o[14]*r,e[15]=o[15]*r,e},mulMat4v4:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec4(),n=r[0],l=r[1],a=r[2],S=r[3];return e[0]=o[0]*n+o[4]*l+o[8]*a+o[12]*S,e[1]=o[1]*n+o[5]*l+o[9]*a+o[13]*S,e[2]=o[2]*n+o[6]*l+o[10]*a+o[14]*S,e[3]=o[3]*n+o[7]*l+o[11]*a+o[15]*S,e},transposeMat4:function(o,r){var e=o[4],n=o[14],l=o[8],a=o[13],S=o[12],T=o[9];if(!r||o===r){var M=o[1],X=o[2],Y=o[3],ee=o[6],oe=o[7],ge=o[11];return o[1]=e,o[2]=l,o[3]=S,o[4]=M,o[6]=T,o[7]=a,o[8]=X,o[9]=ee,o[11]=n,o[12]=Y,o[13]=oe,o[14]=ge,o}return r[0]=o[0],r[1]=e,r[2]=l,r[3]=S,r[4]=o[1],r[5]=o[5],r[6]=T,r[7]=a,r[8]=o[2],r[9]=o[6],r[10]=o[10],r[11]=n,r[12]=o[3],r[13]=o[7],r[14]=o[11],r[15]=o[15],r},transposeMat3:function(o,r){if(r===o){var e=o[1],n=o[2],l=o[5];r[1]=o[3],r[2]=o[6],r[3]=e,r[5]=o[7],r[6]=n,r[7]=l}else r[0]=o[0],r[1]=o[3],r[2]=o[6],r[3]=o[1],r[4]=o[4],r[5]=o[7],r[6]=o[2],r[7]=o[5],r[8]=o[8];return r},determinantMat4:function(o){var r=o[0],e=o[1],n=o[2],l=o[3],a=o[4],S=o[5],T=o[6],M=o[7],X=o[8],Y=o[9],ee=o[10],oe=o[11],ge=o[12],ie=o[13],xe=o[14],Ee=o[15];return ge*Y*T*l-X*ie*T*l-ge*S*ee*l+a*ie*ee*l+X*S*xe*l-a*Y*xe*l-ge*Y*n*M+X*ie*n*M+ge*e*ee*M-r*ie*ee*M-X*e*xe*M+r*Y*xe*M+ge*S*n*oe-a*ie*n*oe-ge*e*T*oe+r*ie*T*oe+a*e*xe*oe-r*S*xe*oe-X*S*n*Ee+a*Y*n*Ee+X*e*T*Ee-r*Y*T*Ee-a*e*ee*Ee+r*S*ee*Ee},inverseMat4:function(o,r){r||(r=o);var e=o[0],n=o[1],l=o[2],a=o[3],S=o[4],T=o[5],M=o[6],X=o[7],Y=o[8],ee=o[9],oe=o[10],ge=o[11],ie=o[12],xe=o[13],Ee=o[14],Me=o[15],Be=e*T-n*S,ke=e*M-l*S,De=e*X-a*S,Ie=n*M-l*T,Fe=n*X-a*T,Ne=l*X-a*M,$e=Y*xe-ee*ie,it=Y*Ee-oe*ie,pt=Y*Me-ge*ie,ut=ee*Ee-oe*xe,dt=ee*Me-ge*xe,wt=oe*Me-ge*Ee,Tt=1/(Be*wt-ke*dt+De*ut+Ie*pt-Fe*it+Ne*$e);return r[0]=(T*wt-M*dt+X*ut)*Tt,r[1]=(-n*wt+l*dt-a*ut)*Tt,r[2]=(xe*Ne-Ee*Fe+Me*Ie)*Tt,r[3]=(-ee*Ne+oe*Fe-ge*Ie)*Tt,r[4]=(-S*wt+M*pt-X*it)*Tt,r[5]=(e*wt-l*pt+a*it)*Tt,r[6]=(-ie*Ne+Ee*De-Me*ke)*Tt,r[7]=(Y*Ne-oe*De+ge*ke)*Tt,r[8]=(S*dt-T*pt+X*$e)*Tt,r[9]=(-e*dt+n*pt-a*$e)*Tt,r[10]=(ie*Fe-xe*De+Me*Be)*Tt,r[11]=(-Y*Fe+ee*De-ge*Be)*Tt,r[12]=(-S*ut+T*it-M*$e)*Tt,r[13]=(e*ut-n*it+l*$e)*Tt,r[14]=(-ie*Ie+xe*ke-Ee*Be)*Tt,r[15]=(Y*Ie-ee*ke+oe*Be)*Tt,r},traceMat4:function(o){return o[0]+o[5]+o[10]+o[15]},translationMat4v:function(o,r){var e=r||V.identityMat4();return e[12]=o[0],e[13]=o[1],e[14]=o[2],e},translationMat3v:function(o,r){var e=r||V.identityMat3();return e[6]=o[0],e[7]=o[1],e},translationMat4c:function(){var B=new de(3);return function(o,r,e,n){return B[0]=o,B[1]=r,B[2]=e,V.translationMat4v(B,n)}}(),translationMat4s:function(o,r){return V.translationMat4c(o,o,o,r)},translateMat4v:function(o,r){return V.translateMat4c(o[0],o[1],o[2],r)},translateMat4c:function(o,r,e,n){var l=n[3];n[0]+=l*o,n[1]+=l*r,n[2]+=l*e;var a=n[7];n[4]+=a*o,n[5]+=a*r,n[6]+=a*e;var S=n[11];n[8]+=S*o,n[9]+=S*r,n[10]+=S*e;var T=n[15];return n[12]+=T*o,n[13]+=T*r,n[14]+=T*e,n},setMat4Translation:function(o,r,e){return e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],e[4]=o[4],e[5]=o[5],e[6]=o[6],e[7]=o[7],e[8]=o[8],e[9]=o[9],e[10]=o[10],e[11]=o[11],e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=o[15],e},rotationMat4v:function(o,r,e){var n=V.normalizeVec4([r[0],r[1],r[2],0],[]),l=Math.sin(o),a=Math.cos(o),S=1-a,T=n[0],M=n[1],X=n[2],Y,ee,oe,ge,ie,xe;return Y=T*M,ee=M*X,oe=X*T,ge=T*l,ie=M*l,xe=X*l,e=e||V.mat4(),e[0]=S*T*T+a,e[1]=S*Y+xe,e[2]=S*oe-ie,e[3]=0,e[4]=S*Y-xe,e[5]=S*M*M+a,e[6]=S*ee+ge,e[7]=0,e[8]=S*oe+ie,e[9]=S*ee-ge,e[10]=S*X*X+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},rotationMat4c:function(o,r,e,n,l){return V.rotationMat4v(o,[r,e,n],l)},scalingMat4v:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.identityMat4();return r[0]=o[0],r[5]=o[1],r[10]=o[2],r},scalingMat3v:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.identityMat3();return r[0]=o[0],r[4]=o[1],r},scalingMat4c:function(){var B=new de(3);return function(o,r,e,n){return B[0]=o,B[1]=r,B[2]=e,V.scalingMat4v(B,n)}}(),scaleMat4c:function(o,r,e,n){return n[0]*=o,n[4]*=r,n[8]*=e,n[1]*=o,n[5]*=r,n[9]*=e,n[2]*=o,n[6]*=r,n[10]*=e,n[3]*=o,n[7]*=r,n[11]*=e,n},scaleMat4v:function(o,r){var e=o[0],n=o[1],l=o[2];return r[0]*=e,r[4]*=n,r[8]*=l,r[1]*=e,r[5]*=n,r[9]*=l,r[2]*=e,r[6]*=n,r[10]*=l,r[3]*=e,r[7]*=n,r[11]*=l,r},scalingMat4s:function(o){return V.scalingMat4c(o,o,o)},rotationTranslationMat4:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.mat4(),n=o[0],l=o[1],a=o[2],S=o[3],T=n+n,M=l+l,X=a+a,Y=n*T,ee=n*M,oe=n*X,ge=l*M,ie=l*X,xe=a*X,Ee=S*T,Me=S*M,Be=S*X;return e[0]=1-(ge+xe),e[1]=ee+Be,e[2]=oe-Me,e[3]=0,e[4]=ee-Be,e[5]=1-(Y+xe),e[6]=ie+Ee,e[7]=0,e[8]=oe+Me,e[9]=ie-Ee,e[10]=1-(Y+ge),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e},mat4ToEuler:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec4(),n=V.clamp,l=o[0],a=o[4],S=o[8],T=o[1],M=o[5],X=o[9],Y=o[2],ee=o[6],oe=o[10];return r==="XYZ"?(e[1]=Math.asin(n(S,-1,1)),Math.abs(S)<.99999?(e[0]=Math.atan2(-X,oe),e[2]=Math.atan2(-a,l)):(e[0]=Math.atan2(ee,M),e[2]=0)):r==="YXZ"?(e[0]=Math.asin(-n(X,-1,1)),Math.abs(X)<.99999?(e[1]=Math.atan2(S,oe),e[2]=Math.atan2(T,M)):(e[1]=Math.atan2(-Y,l),e[2]=0)):r==="ZXY"?(e[0]=Math.asin(n(ee,-1,1)),Math.abs(ee)<.99999?(e[1]=Math.atan2(-Y,oe),e[2]=Math.atan2(-a,M)):(e[1]=0,e[2]=Math.atan2(T,l))):r==="ZYX"?(e[1]=Math.asin(-n(Y,-1,1)),Math.abs(Y)<.99999?(e[0]=Math.atan2(ee,oe),e[2]=Math.atan2(T,l)):(e[0]=0,e[2]=Math.atan2(-a,M))):r==="YZX"?(e[2]=Math.asin(n(T,-1,1)),Math.abs(T)<.99999?(e[0]=Math.atan2(-X,M),e[1]=Math.atan2(-Y,l)):(e[0]=0,e[1]=Math.atan2(S,oe))):r==="XZY"&&(e[2]=Math.asin(-n(a,-1,1)),Math.abs(a)<.99999?(e[0]=Math.atan2(ee,M),e[1]=Math.atan2(S,l)):(e[0]=Math.atan2(-X,oe),e[1]=0)),e},composeMat4:function(o,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:V.mat4();return V.quaternionToRotationMat4(r,n),V.scaleMat4v(e,n),V.translateMat4v(o,n),n},decomposeMat4:function(){var B=new de(3),o=new de(16);return function(e,n,l,a){B[0]=e[0],B[1]=e[1],B[2]=e[2];var S=V.lenVec3(B);B[0]=e[4],B[1]=e[5],B[2]=e[6];var T=V.lenVec3(B);B[8]=e[8],B[9]=e[9],B[10]=e[10];var M=V.lenVec3(B),X=V.determinantMat4(e);X<0&&(S=-S),n[0]=e[12],n[1]=e[13],n[2]=e[14],o.set(e);var Y=1/S,ee=1/T,oe=1/M;return o[0]*=Y,o[1]*=Y,o[2]*=Y,o[4]*=ee,o[5]*=ee,o[6]*=ee,o[8]*=oe,o[9]*=oe,o[10]*=oe,V.mat4ToQuaternion(o,l),a[0]=S,a[1]=T,a[2]=M,this}}(),getColMat4:function(o,r){var e=r*4;return[o[e],o[e+1],o[e+2],o[e+3]]},setRowMat4:function(o,r,e){o[r]=e[0],o[r+4]=e[1],o[r+8]=e[2],o[r+12]=e[3]},lookAtMat4v:function(o,r,e,n){n||(n=V.mat4());var l=o[0],a=o[1],S=o[2],T=e[0],M=e[1],X=e[2],Y=r[0],ee=r[1],oe=r[2];if(l===Y&&a===ee&&S===oe)return V.identityMat4();var ge,ie,xe,Ee,Me,Be,ke,De,Ie,Fe;return ge=l-Y,ie=a-ee,xe=S-oe,Fe=1/Math.sqrt(ge*ge+ie*ie+xe*xe),ge*=Fe,ie*=Fe,xe*=Fe,Ee=M*xe-X*ie,Me=X*ge-T*xe,Be=T*ie-M*ge,Fe=Math.sqrt(Ee*Ee+Me*Me+Be*Be),Fe?(Fe=1/Fe,Ee*=Fe,Me*=Fe,Be*=Fe):(Ee=0,Me=0,Be=0),ke=ie*Be-xe*Me,De=xe*Ee-ge*Be,Ie=ge*Me-ie*Ee,Fe=Math.sqrt(ke*ke+De*De+Ie*Ie),Fe?(Fe=1/Fe,ke*=Fe,De*=Fe,Ie*=Fe):(ke=0,De=0,Ie=0),n[0]=Ee,n[1]=ke,n[2]=ge,n[3]=0,n[4]=Me,n[5]=De,n[6]=ie,n[7]=0,n[8]=Be,n[9]=Ie,n[10]=xe,n[11]=0,n[12]=-(Ee*l+Me*a+Be*S),n[13]=-(ke*l+De*a+Ie*S),n[14]=-(ge*l+ie*a+xe*S),n[15]=1,n},lookAtMat4c:function(o,r,e,n,l,a,S,T,M){return V.lookAtMat4v([o,r,e],[n,l,a],[S,T,M],[])},orthoMat4c:function(o,r,e,n,l,a,S){S||(S=V.mat4());var T=r-o,M=n-e,X=a-l;return S[0]=2/T,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=2/M,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=-2/X,S[11]=0,S[12]=-(o+r)/T,S[13]=-(n+e)/M,S[14]=-(a+l)/X,S[15]=1,S},frustumMat4v:function(o,r,e){e||(e=V.mat4());var n=[o[0],o[1],o[2],0],l=[r[0],r[1],r[2],0];V.addVec4(l,n,ue),V.subVec4(l,n,pe);var a=2*n[2],S=pe[0],T=pe[1],M=pe[2];return e[0]=a/S,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a/T,e[6]=0,e[7]=0,e[8]=ue[0]/S,e[9]=ue[1]/T,e[10]=-ue[2]/M,e[11]=-1,e[12]=0,e[13]=0,e[14]=-a*l[2]/M,e[15]=0,e},frustumMat4:function(o,r,e,n,l,a,S){S||(S=V.mat4());var T=r-o,M=n-e,X=a-l;return S[0]=l*2/T,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=l*2/M,S[6]=0,S[7]=0,S[8]=(r+o)/T,S[9]=(n+e)/M,S[10]=-(a+l)/X,S[11]=-1,S[12]=0,S[13]=0,S[14]=-(a*l*2)/X,S[15]=0,S},perspectiveMat4:function(o,r,e,n,l){var a=[],S=[];return a[2]=e,S[2]=n,S[1]=a[2]*Math.tan(o/2),a[1]=-S[1],S[0]=S[1]*r,a[0]=-S[0],V.frustumMat4v(a,S,l)},compareMat4:function(o,r){return o[0]===r[0]&&o[1]===r[1]&&o[2]===r[2]&&o[3]===r[3]&&o[4]===r[4]&&o[5]===r[5]&&o[6]===r[6]&&o[7]===r[7]&&o[8]===r[8]&&o[9]===r[9]&&o[10]===r[10]&&o[11]===r[11]&&o[12]===r[12]&&o[13]===r[13]&&o[14]===r[14]&&o[15]===r[15]},transformPoint3:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec3(),n=r[0],l=r[1],a=r[2];return e[0]=o[0]*n+o[4]*l+o[8]*a+o[12],e[1]=o[1]*n+o[5]*l+o[9]*a+o[13],e[2]=o[2]*n+o[6]*l+o[10]*a+o[14],e},transformPoint4:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec4();return e[0]=o[0]*r[0]+o[4]*r[1]+o[8]*r[2]+o[12]*r[3],e[1]=o[1]*r[0]+o[5]*r[1]+o[9]*r[2]+o[13]*r[3],e[2]=o[2]*r[0]+o[6]*r[1]+o[10]*r[2]+o[14]*r[3],e[3]=o[3]*r[0]+o[7]*r[1]+o[11]*r[2]+o[15]*r[3],e},transformPoints3:function(o,r,e){for(var n=e||[],l=r.length,a,S,T,M,X=o[0],Y=o[1],ee=o[2],oe=o[3],ge=o[4],ie=o[5],xe=o[6],Ee=o[7],Me=o[8],Be=o[9],ke=o[10],De=o[11],Ie=o[12],Fe=o[13],Ne=o[14],$e=o[15],it,pt=0;pt<l;++pt)M=r[pt],a=M[0],S=M[1],T=M[2],it=n[pt]||(n[pt]=[0,0,0]),it[0]=X*a+ge*S+Me*T+Ie,it[1]=Y*a+ie*S+Be*T+Fe,it[2]=ee*a+xe*S+ke*T+Ne,it[3]=oe*a+Ee*S+De*T+$e;return n.length=l,n},transformPositions3:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r,n,l=r.length,a,S,T,M=o[0],X=o[1],Y=o[2];o[3];var ee=o[4],oe=o[5],ge=o[6];o[7];var ie=o[8],xe=o[9],Ee=o[10];o[11];var Me=o[12],Be=o[13],ke=o[14];for(o[15],n=0;n<l;n+=3)a=r[n+0],S=r[n+1],T=r[n+2],e[n+0]=M*a+ee*S+ie*T+Me,e[n+1]=X*a+oe*S+xe*T+Be,e[n+2]=Y*a+ge*S+Ee*T+ke;return e},transformPositions4:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r,n,l=r.length,a,S,T,M=o[0],X=o[1],Y=o[2],ee=o[3],oe=o[4],ge=o[5],ie=o[6],xe=o[7],Ee=o[8],Me=o[9],Be=o[10],ke=o[11],De=o[12],Ie=o[13],Fe=o[14],Ne=o[15];for(n=0;n<l;n+=4)a=r[n+0],S=r[n+1],T=r[n+2],e[n+0]=M*a+oe*S+Ee*T+De,e[n+1]=X*a+ge*S+Me*T+Ie,e[n+2]=Y*a+ie*S+Be*T+Fe,e[n+3]=ee*a+xe*S+ke*T+Ne;return e},transformVec3:function(o,r,e){var n=r[0],l=r[1],a=r[2];return e=e||this.vec3(),e[0]=o[0]*n+o[4]*l+o[8]*a,e[1]=o[1]*n+o[5]*l+o[9]*a,e[2]=o[2]*n+o[6]*l+o[10]*a,e},transformVec4:function(o,r,e){var n=r[0],l=r[1],a=r[2],S=r[3];return e=e||V.vec4(),e[0]=o[0]*n+o[4]*l+o[8]*a+o[12]*S,e[1]=o[1]*n+o[5]*l+o[9]*a+o[13]*S,e[2]=o[2]*n+o[6]*l+o[10]*a+o[14]*S,e[3]=o[3]*n+o[7]*l+o[11]*a+o[15]*S,e},rotateVec2:function(o,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o,l=Math.cos(e),a=Math.sin(e),S=o[0]-r[0],T=o[1]-r[1];return n[0]=S*l-T*a+r[0],n[1]=S*a+T*l+r[1],o},rotateVec3X:function(o,r,e,n){var l=[],a=[];return l[0]=o[0]-r[0],l[1]=o[1]-r[1],l[2]=o[2]-r[2],a[0]=l[0],a[1]=l[1]*Math.cos(e)-l[2]*Math.sin(e),a[2]=l[1]*Math.sin(e)+l[2]*Math.cos(e),n[0]=a[0]+r[0],n[1]=a[1]+r[1],n[2]=a[2]+r[2],n},rotateVec3Y:function(o,r,e,n){var l=[],a=[];return l[0]=o[0]-r[0],l[1]=o[1]-r[1],l[2]=o[2]-r[2],a[0]=l[2]*Math.sin(e)+l[0]*Math.cos(e),a[1]=l[1],a[2]=l[2]*Math.cos(e)-l[0]*Math.sin(e),n[0]=a[0]+r[0],n[1]=a[1]+r[1],n[2]=a[2]+r[2],n},rotateVec3Z:function(o,r,e,n){var l=[],a=[];return l[0]=o[0]-r[0],l[1]=o[1]-r[1],l[2]=o[2]-r[2],a[0]=l[0]*Math.cos(e)-l[1]*Math.sin(e),a[1]=l[0]*Math.sin(e)+l[1]*Math.cos(e),a[2]=l[2],n[0]=a[0]+r[0],n[1]=a[1]+r[1],n[2]=a[2]+r[2],n},projectVec4:function(o,r){var e=1/o[3];return r=r||V.vec2(),r[0]=o[0]*e,r[1]=o[1]*e,r},unprojectVec3:function(){var B=new de(16),o=new de(16),r=new de(16);return function(e,n,l,a){return this.transformVec3(this.mulMat4(this.inverseMat4(n,B),this.inverseMat4(l,o),r),e,a)}}(),lerpVec3:function(o,r,e,n,l,a){var S=a||V.vec3(),T=(o-r)/(e-r);return S[0]=n[0]+T*(l[0]-n[0]),S[1]=n[1]+T*(l[1]-n[1]),S[2]=n[2]+T*(l[2]-n[2]),S},lerpMat4:function(o,r,e,n,l,a){var S=a||V.mat4(),T=(o-r)/(e-r);return S[0]=n[0]+T*(l[0]-n[0]),S[1]=n[1]+T*(l[1]-n[1]),S[2]=n[2]+T*(l[2]-n[2]),S[3]=n[3]+T*(l[3]-n[3]),S[4]=n[4]+T*(l[4]-n[4]),S[5]=n[5]+T*(l[5]-n[5]),S[6]=n[6]+T*(l[6]-n[6]),S[7]=n[7]+T*(l[7]-n[7]),S[8]=n[8]+T*(l[8]-n[8]),S[9]=n[9]+T*(l[9]-n[9]),S[10]=n[10]+T*(l[10]-n[10]),S[11]=n[11]+T*(l[11]-n[11]),S[12]=n[12]+T*(l[12]-n[12]),S[13]=n[13]+T*(l[13]-n[13]),S[14]=n[14]+T*(l[14]-n[14]),S[15]=n[15]+T*(l[15]-n[15]),S},flatten:function(o){var r=[],e,n,l,a,S;for(e=0,n=o.length;e<n;e++)for(S=o[e],l=0,a=S.length;l<a;l++)r.push(S[l]);return r},identityQuaternion:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V.vec4();return o[0]=0,o[1]=0,o[2]=0,o[3]=1,o},eulerToQuaternion:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec4(),n=o[0]*V.DEGTORAD/2,l=o[1]*V.DEGTORAD/2,a=o[2]*V.DEGTORAD/2,S=Math.cos(n),T=Math.cos(l),M=Math.cos(a),X=Math.sin(n),Y=Math.sin(l),ee=Math.sin(a);return r==="XYZ"?(e[0]=X*T*M+S*Y*ee,e[1]=S*Y*M-X*T*ee,e[2]=S*T*ee+X*Y*M,e[3]=S*T*M-X*Y*ee):r==="YXZ"?(e[0]=X*T*M+S*Y*ee,e[1]=S*Y*M-X*T*ee,e[2]=S*T*ee-X*Y*M,e[3]=S*T*M+X*Y*ee):r==="ZXY"?(e[0]=X*T*M-S*Y*ee,e[1]=S*Y*M+X*T*ee,e[2]=S*T*ee+X*Y*M,e[3]=S*T*M-X*Y*ee):r==="ZYX"?(e[0]=X*T*M-S*Y*ee,e[1]=S*Y*M+X*T*ee,e[2]=S*T*ee-X*Y*M,e[3]=S*T*M+X*Y*ee):r==="YZX"?(e[0]=X*T*M+S*Y*ee,e[1]=S*Y*M+X*T*ee,e[2]=S*T*ee-X*Y*M,e[3]=S*T*M-X*Y*ee):r==="XZY"&&(e[0]=X*T*M-S*Y*ee,e[1]=S*Y*M-X*T*ee,e[2]=S*T*ee+X*Y*M,e[3]=S*T*M+X*Y*ee),e},mat4ToQuaternion:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.vec4(),e=o[0],n=o[4],l=o[8],a=o[1],S=o[5],T=o[9],M=o[2],X=o[6],Y=o[10],ee,oe=e+S+Y;return oe>0?(ee=.5/Math.sqrt(oe+1),r[3]=.25/ee,r[0]=(X-T)*ee,r[1]=(l-M)*ee,r[2]=(a-n)*ee):e>S&&e>Y?(ee=2*Math.sqrt(1+e-S-Y),r[3]=(X-T)/ee,r[0]=.25*ee,r[1]=(n+a)/ee,r[2]=(l+M)/ee):S>Y?(ee=2*Math.sqrt(1+S-e-Y),r[3]=(l-M)/ee,r[0]=(n+a)/ee,r[1]=.25*ee,r[2]=(T+X)/ee):(ee=2*Math.sqrt(1+Y-e-S),r[3]=(a-n)/ee,r[0]=(l+M)/ee,r[1]=(T+X)/ee,r[2]=.25*ee),r},vec3PairToQuaternion:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec4(),n=Math.sqrt(V.dotVec3(o,o)*V.dotVec3(r,r)),l=n+V.dotVec3(o,r);return l<1e-8*n?(l=0,Math.abs(o[0])>Math.abs(o[2])?(e[0]=-o[1],e[1]=o[0],e[2]=0):(e[0]=0,e[1]=-o[2],e[2]=o[1])):V.cross3Vec3(o,r,e),e[3]=l,V.normalizeQuaternion(e)},angleAxisToQuaternion:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.vec4(),e=o[3]/2,n=Math.sin(e);return r[0]=n*o[0],r[1]=n*o[1],r[2]=n*o[2],r[3]=Math.cos(e),r},quaternionToEuler:function(){var B=new de(16);return function(o,r,e){return e=e||V.vec3(),V.quaternionToRotationMat4(o,B),V.mat4ToEuler(B,r,e),e}}(),mulQuaternions:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec4(),n=o[0],l=o[1],a=o[2],S=o[3],T=r[0],M=r[1],X=r[2],Y=r[3];return e[0]=S*T+n*Y+l*X-a*M,e[1]=S*M+l*Y+a*T-n*X,e[2]=S*X+a*Y+n*M-l*T,e[3]=S*Y-n*T-l*M-a*X,e},vec3ApplyQuaternion:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V.vec3(),n=r[0],l=r[1],a=r[2],S=o[0],T=o[1],M=o[2],X=o[3],Y=X*n+T*a-M*l,ee=X*l+M*n-S*a,oe=X*a+S*l-T*n,ge=-S*n-T*l-M*a;return e[0]=Y*X+ge*-S+ee*-M-oe*-T,e[1]=ee*X+ge*-T+oe*-S-Y*-M,e[2]=oe*X+ge*-M+Y*-T-ee*-S,e},quaternionToMat4:function(o,r){r=V.identityMat4(r);var e=o[0],n=o[1],l=o[2],a=o[3],S=2*e,T=2*n,M=2*l,X=S*a,Y=T*a,ee=M*a,oe=S*e,ge=T*e,ie=M*e,xe=T*n,Ee=M*n,Me=M*l;return r[0]=1-(xe+Me),r[1]=ge+ee,r[2]=ie-Y,r[4]=ge-ee,r[5]=1-(oe+Me),r[6]=Ee+X,r[8]=ie+Y,r[9]=Ee-X,r[10]=1-(oe+xe),r},quaternionToRotationMat4:function(o,r){var e=o[0],n=o[1],l=o[2],a=o[3],S=e+e,T=n+n,M=l+l,X=e*S,Y=e*T,ee=e*M,oe=n*T,ge=n*M,ie=l*M,xe=a*S,Ee=a*T,Me=a*M;return r[0]=1-(oe+ie),r[4]=Y-Me,r[8]=ee+Ee,r[1]=Y+Me,r[5]=1-(X+ie),r[9]=ge-xe,r[2]=ee-Ee,r[6]=ge+xe,r[10]=1-(X+oe),r[3]=0,r[7]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},normalizeQuaternion:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,e=V.lenVec4([o[0],o[1],o[2],o[3]]);return r[0]=o[0]/e,r[1]=o[1]/e,r[2]=o[2]/e,r[3]=o[3]/e,r},conjugateQuaternion:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o;return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=o[3],r},inverseQuaternion:function(o,r){return V.normalizeQuaternion(V.conjugateQuaternion(o,r))},quaternionToAngleAxis:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.vec4();o=V.normalizeQuaternion(o,se);var e=o[3],n=2*Math.acos(e),l=Math.sqrt(1-e*e);return l<.001?(r[0]=o[0],r[1]=o[1],r[2]=o[2]):(r[0]=o[0]/l,r[1]=o[1]/l,r[2]=o[2]/l),r[3]=n,r},AABB3:function(o){return new de(o||6)},AABB2:function(o){return new de(o||4)},OBB3:function(o){return new de(o||32)},OBB2:function(o){return new de(o||16)},Sphere3:function(o,r,e,n){return new de([o,r,e,n])},transformOBB3:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r,n,l=r.length,a,S,T,M=o[0],X=o[1],Y=o[2],ee=o[3],oe=o[4],ge=o[5],ie=o[6],xe=o[7],Ee=o[8],Me=o[9],Be=o[10],ke=o[11],De=o[12],Ie=o[13],Fe=o[14],Ne=o[15];for(n=0;n<l;n+=4)a=r[n+0],S=r[n+1],T=r[n+2],e[n+0]=M*a+oe*S+Ee*T+De,e[n+1]=X*a+ge*S+Me*T+Ie,e[n+2]=Y*a+ie*S+Be*T+Fe,e[n+3]=ee*a+xe*S+ke*T+Ne;return e},containsAABB3:function(o,r){var e=o[0]<=r[0]&&r[3]<=o[3]&&o[1]<=r[1]&&r[4]<=o[4]&&o[2]<=r[2]&&r[5]<=o[5];return e},getAABB3Diag:function(){var B=new de(3),o=new de(3),r=new de(3);return function(e){return B[0]=e[0],B[1]=e[1],B[2]=e[2],o[0]=e[3],o[1]=e[4],o[2]=e[5],V.subVec3(o,B,r),Math.abs(V.lenVec3(r))}}(),getAABB3DiagPoint:function(){var B=new de(3),o=new de(3),r=new de(3);return function(e,n){B[0]=e[0],B[1]=e[1],B[2]=e[2],o[0]=e[3],o[1]=e[4],o[2]=e[5];var l=V.subVec3(o,B,r),a=n[0]-e[0],S=e[3]-n[0],T=n[1]-e[1],M=e[4]-n[1],X=n[2]-e[2],Y=e[5]-n[2];return l[0]+=a>S?a:S,l[1]+=T>M?T:M,l[2]+=X>Y?X:Y,Math.abs(V.lenVec3(l))}}(),getAABB3Area:function(o){var r=o[3]-o[0],e=o[4]-o[1],n=o[5]-o[2];return r*e*n},getAABB3Center:function(o,r){var e=r||V.vec3();return e[0]=(o[0]+o[3])/2,e[1]=(o[1]+o[4])/2,e[2]=(o[2]+o[5])/2,e},getAABB2Center:function(o,r){var e=r||V.vec2();return e[0]=(o[2]+o[0])/2,e[1]=(o[3]+o[1])/2,e},collapseAABB3:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V.AABB3();return o[0]=V.MAX_DOUBLE,o[1]=V.MAX_DOUBLE,o[2]=V.MAX_DOUBLE,o[3]=V.MIN_DOUBLE,o[4]=V.MIN_DOUBLE,o[5]=V.MIN_DOUBLE,o},AABB3ToOBB3:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.OBB3();return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=1,r[4]=o[3],r[5]=o[1],r[6]=o[2],r[7]=1,r[8]=o[3],r[9]=o[4],r[10]=o[2],r[11]=1,r[12]=o[0],r[13]=o[4],r[14]=o[2],r[15]=1,r[16]=o[0],r[17]=o[1],r[18]=o[5],r[19]=1,r[20]=o[3],r[21]=o[1],r[22]=o[5],r[23]=1,r[24]=o[3],r[25]=o[4],r[26]=o[5],r[27]=1,r[28]=o[0],r[29]=o[4],r[30]=o[5],r[31]=1,r},positions3ToAABB3:function(){var B=new de(3);return function(o,r,e){r=r||V.AABB3();for(var n=V.MAX_DOUBLE,l=V.MAX_DOUBLE,a=V.MAX_DOUBLE,S=V.MIN_DOUBLE,T=V.MIN_DOUBLE,M=V.MIN_DOUBLE,X,Y,ee,oe=0,ge=o.length;oe<ge;oe+=3)e?(B[0]=o[oe+0],B[1]=o[oe+1],B[2]=o[oe+2],V.decompressPosition(B,e,B),X=B[0],Y=B[1],ee=B[2]):(X=o[oe+0],Y=o[oe+1],ee=o[oe+2]),X<n&&(n=X),Y<l&&(l=Y),ee<a&&(a=ee),X>S&&(S=X),Y>T&&(T=Y),ee>M&&(M=ee);return r[0]=n,r[1]=l,r[2]=a,r[3]=S,r[4]=T,r[5]=M,r}}(),OBB3ToAABB3:function(o){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.AABB3(),e=V.MAX_DOUBLE,n=V.MAX_DOUBLE,l=V.MAX_DOUBLE,a=V.MIN_DOUBLE,S=V.MIN_DOUBLE,T=V.MIN_DOUBLE,M,X,Y,ee=0,oe=o.length;ee<oe;ee+=4)M=o[ee+0],X=o[ee+1],Y=o[ee+2],M<e&&(e=M),X<n&&(n=X),Y<l&&(l=Y),M>a&&(a=M),X>S&&(S=X),Y>T&&(T=Y);return r[0]=e,r[1]=n,r[2]=l,r[3]=a,r[4]=S,r[5]=T,r},points3ToAABB3:function(o){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.AABB3(),e=V.MAX_DOUBLE,n=V.MAX_DOUBLE,l=V.MAX_DOUBLE,a=V.MIN_DOUBLE,S=V.MIN_DOUBLE,T=V.MIN_DOUBLE,M,X,Y,ee=0,oe=o.length;ee<oe;ee++)M=o[ee][0],X=o[ee][1],Y=o[ee][2],M<e&&(e=M),X<n&&(n=X),Y<l&&(l=Y),M>a&&(a=M),X>S&&(S=X),Y>T&&(T=Y);return r[0]=e,r[1]=n,r[2]=l,r[3]=a,r[4]=S,r[5]=T,r},points3ToSphere3:function(){var B=new de(3);return function(o,r){r=r||V.vec4();var e=0,n=0,l=0,a,S=o.length;for(a=0;a<S;a++)e+=o[a][0],n+=o[a][1],l+=o[a][2];r[0]=e/S,r[1]=n/S,r[2]=l/S;var T=0,M;for(a=0;a<S;a++)M=Math.abs(V.lenVec3(V.subVec3(o[a],r,B))),M>T&&(T=M);return r[3]=T,r}}(),positions3ToSphere3:function(){var B=new de(3),o=new de(3);return function(r,e){e=e||V.vec4();var n=0,l=0,a=0,S,T=r.length,M=0;for(S=0;S<T;S+=3)n+=r[S],l+=r[S+1],a+=r[S+2];var X=T/3;e[0]=n/X,e[1]=l/X,e[2]=a/X;var Y;for(S=0;S<T;S+=3)B[0]=r[S],B[1]=r[S+1],B[2]=r[S+2],Y=Math.abs(V.lenVec3(V.subVec3(B,e,o))),Y>M&&(M=Y);return e[3]=M,e}}(),OBB3ToSphere3:function(){var B=new de(3),o=new de(3);return function(r,e){e=e||V.vec4();var n=0,l=0,a=0,S,T=r.length,M=T/4;for(S=0;S<T;S+=4)n+=r[S+0],l+=r[S+1],a+=r[S+2];e[0]=n/M,e[1]=l/M,e[2]=a/M;var X=0,Y;for(S=0;S<T;S+=4)B[0]=r[S+0],B[1]=r[S+1],B[2]=r[S+2],Y=Math.abs(V.lenVec3(V.subVec3(B,e,o))),Y>X&&(X=Y);return e[3]=X,e}}(),getSphere3Center:function(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.vec3();return r[0]=o[0],r[1]=o[1],r[2]=o[2],r},getPositionsCenter:function(o){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.vec3(),e=0,n=0,l=0,a=0,S=o.length;a<S;a+=3)e+=o[a+0],n+=o[a+1],l+=o[a+2];var T=o.length/3;return r[0]=e/T,r[1]=n/T,r[2]=l/T,r},expandAABB3:function(o,r){return o[0]>r[0]&&(o[0]=r[0]),o[1]>r[1]&&(o[1]=r[1]),o[2]>r[2]&&(o[2]=r[2]),o[3]<r[3]&&(o[3]=r[3]),o[4]<r[4]&&(o[4]=r[4]),o[5]<r[5]&&(o[5]=r[5]),o},expandAABB3Point3:function(o,r){return o[0]>r[0]&&(o[0]=r[0]),o[1]>r[1]&&(o[1]=r[1]),o[2]>r[2]&&(o[2]=r[2]),o[3]<r[0]&&(o[3]=r[0]),o[4]<r[1]&&(o[4]=r[1]),o[5]<r[2]&&(o[5]=r[2]),o},expandAABB3Points3:function(o,r){for(var e,n,l,a=0,S=r.length;a<S;a+=3)e=r[a],n=r[a+1],l=r[a+2],o[0]>e&&(o[0]=e),o[1]>n&&(o[1]=n),o[2]>l&&(o[2]=l),o[3]<e&&(o[3]=e),o[4]<n&&(o[4]=n),o[5]<l&&(o[5]=l);return o},collapseAABB2:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V.AABB2();return o[0]=V.MAX_DOUBLE,o[1]=V.MAX_DOUBLE,o[2]=V.MIN_DOUBLE,o[3]=V.MIN_DOUBLE,o},point3AABB3Intersect:function(o,r){return o[0]>r[0]||o[3]<r[0]||o[1]>r[1]||o[4]<r[1]||o[2]>r[2]||o[5]<r[2]},point3AABB3AbsoluteIntersect:function(o,r){return o[0]<=r[0]&&o[3]>=r[0]&&o[1]<=r[1]&&o[4]>=r[1]&&o[2]<=r[2]&&o[5]>=r[2]},planeAABB3Intersect:function(o,r,e){var n,l;o[0]>0?(n=o[0]*e[0],l=o[0]*e[3]):(n=o[0]*e[3],l=o[0]*e[0]),o[1]>0?(n+=o[1]*e[1],l+=o[1]*e[4]):(n+=o[1]*e[4],l+=o[1]*e[1]),o[2]>0?(n+=o[2]*e[2],l+=o[2]*e[5]):(n+=o[2]*e[5],l+=o[2]*e[2]);var a=n<=-r&&l<=-r;if(a)return-1;var S=n>=-r&&l>=-r;return S?1:0},OBB3ToAABB2:function(o){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.AABB2(),e=V.MAX_DOUBLE,n=V.MAX_DOUBLE,l=V.MIN_DOUBLE,a=V.MIN_DOUBLE,S,T,M,X,Y=0,ee=o.length;Y<ee;Y+=4)S=o[Y+0],T=o[Y+1],M=o[Y+3]||1,X=1/M,S*=X,T*=X,S<e&&(e=S),T<n&&(n=T),S>l&&(l=S),T>a&&(a=T);return r[0]=e,r[1]=n,r[2]=l,r[3]=a,r},expandAABB2:function(o,r){return o[0]>r[0]&&(o[0]=r[0]),o[1]>r[1]&&(o[1]=r[1]),o[2]<r[2]&&(o[2]=r[2]),o[3]<r[3]&&(o[3]=r[3]),o},expandAABB2Point2:function(o,r){return o[0]>r[0]&&(o[0]=r[0]),o[1]>r[1]&&(o[1]=r[1]),o[2]<r[0]&&(o[2]=r[0]),o[3]<r[1]&&(o[3]=r[1]),o},AABB2ToCanvas:function(o,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o,l=(o[0]+1)*.5,a=(o[1]+1)*.5,S=(o[2]+1)*.5,T=(o[3]+1)*.5;return n[0]=Math.floor(l*r),n[1]=e-Math.floor(T*e),n[2]=Math.floor(S*r),n[3]=e-Math.floor(a*e),n},tangentQuadraticBezier:function(o,r,e,n){return 2*(1-o)*(e-r)+2*o*(n-e)},tangentQuadraticBezier3:function(o,r,e,n,l){return-3*r*(1-o)*(1-o)+3*e*(1-o)*(1-o)-6*o*e*(1-o)+6*o*n*(1-o)-3*o*o*n+3*o*o*l},tangentSpline:function(o){var r=6*o*o-6*o,e=3*o*o-4*o+1,n=-6*o*o+6*o,l=3*o*o-2*o;return r+e+n+l},catmullRomInterpolate:function(o,r,e,n,l){var a=(e-o)*.5,S=(n-r)*.5,T=l*l,M=l*T;return(2*r-2*e+a+S)*M+(-3*r+3*e-2*a-S)*T+a*l+r},b2p0:function(o,r){var e=1-o;return e*e*r},b2p1:function(o,r){return 2*(1-o)*o*r},b2p2:function(o,r){return o*o*r},b2:function(o,r,e,n){return this.b2p0(o,r)+this.b2p1(o,e)+this.b2p2(o,n)},b3p0:function(o,r){var e=1-o;return e*e*e*r},b3p1:function(o,r){var e=1-o;return 3*e*e*o*r},b3p2:function(o,r){var e=1-o;return 3*e*o*o*r},b3p3:function(o,r){return o*o*o*r},b3:function(o,r,e,n,l){return this.b3p0(o,r)+this.b3p1(o,e)+this.b3p2(o,n)+this.b3p3(o,l)},triangleNormal:function(o,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:V.vec3(),l=r[0]-o[0],a=r[1]-o[1],S=r[2]-o[2],T=e[0]-o[0],M=e[1]-o[1],X=e[2]-o[2],Y=a*X-S*M,ee=S*T-l*X,oe=l*M-a*T,ge=Math.sqrt(Y*Y+ee*ee+oe*oe);return ge===0?(n[0]=0,n[1]=0,n[2]=0):(n[0]=Y/ge,n[1]=ee/ge,n[2]=oe/ge),n},rayTriangleIntersect:function(){var B=new de(3),o=new de(3),r=new de(3),e=new de(3),n=new de(3);return function(l,a,S,T,M,X){X=X||V.vec3();var Y=1e-6,ee=V.subVec3(T,S,B),oe=V.subVec3(M,S,o),ge=V.cross3Vec3(a,oe,r),ie=V.dotVec3(ee,ge);if(ie<Y)return null;var xe=V.subVec3(l,S,e),Ee=V.dotVec3(xe,ge);if(Ee<0||Ee>ie)return null;var Me=V.cross3Vec3(xe,ee,n),Be=V.dotVec3(a,Me);if(Be<0||Ee+Be>ie)return null;var ke=V.dotVec3(oe,Me)/ie;return X[0]=l[0]+ke*a[0],X[1]=l[1]+ke*a[1],X[2]=l[2]+ke*a[2],X}}(),rayPlaneIntersect:function(){var B=new de(3),o=new de(3),r=new de(3),e=new de(3);return function(n,l,a,S,T,M){M=M||V.vec3(),l=V.normalizeVec3(l,B);var X=V.subVec3(S,a,o),Y=V.subVec3(T,a,r),ee=V.cross3Vec3(X,Y,e);V.normalizeVec3(ee,ee);var oe=-V.dotVec3(a,ee),ge=-(V.dotVec3(n,ee)+oe)/V.dotVec3(l,ee);return M[0]=n[0]+ge*l[0],M[1]=n[1]+ge*l[1],M[2]=n[2]+ge*l[2],M}}(),cartesianToBarycentric:function(){var B=new de(3),o=new de(3),r=new de(3);return function(e,n,l,a,S){var T=V.subVec3(a,n,B),M=V.subVec3(l,n,o),X=V.subVec3(e,n,r),Y=V.dotVec3(T,T),ee=V.dotVec3(T,M),oe=V.dotVec3(T,X),ge=V.dotVec3(M,M),ie=V.dotVec3(M,X),xe=Y*ge-ee*ee;if(xe===0)return null;var Ee=1/xe,Me=(ge*oe-ee*ie)*Ee,Be=(Y*ie-ee*oe)*Ee;return S[0]=1-Me-Be,S[1]=Be,S[2]=Me,S}}(),barycentricInsideTriangle:function(o){var r=o[1],e=o[2];return e>=0&&r>=0&&e+r<1},barycentricToCartesian:function(o,r,e,n){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:V.vec3(),a=o[0],S=o[1],T=o[2];return l[0]=r[0]*a+e[0]*S+n[0]*T,l[1]=r[1]*a+e[1]*S+n[1]*T,l[2]=r[2]*a+e[2]*S+n[2]*T,l},mergeVertices:function(o,r,e,n){var l={},a=[],S=[],T=r?[]:null,M=e?[]:null,X=[],Y,ee,oe,ge,ie=4,xe=Math.pow(10,ie),Ee,Me,Be=0;for(Ee=0,Me=o.length;Ee<Me;Ee+=3)Y=o[Ee],ee=o[Ee+1],oe=o[Ee+2],ge="".concat(Math.round(Y*xe),"_").concat(Math.round(ee*xe),"_").concat(Math.round(oe*xe)),l[ge]===void 0&&(l[ge]=S.length/3,S.push(Y),S.push(ee),S.push(oe),r&&(T.push(r[Ee]),T.push(r[Ee+1]),T.push(r[Ee+2])),e&&(M.push(e[Be]),M.push(e[Be+1]))),a[Ee/3]=l[ge],Be+=2;for(Ee=0,Me=n.length;Ee<Me;Ee++)X[Ee]=a[n[Ee]];var ke={positions:S,indices:X};return T&&(ke.normals=T),M&&(ke.uv=M),ke},buildNormals:function(){var B=new de(3),o=new de(3),r=new de(3),e=new de(3),n=new de(3),l=new de(3);return function(a,S,T){var M,X,Y=new Array(a.length/3),ee,oe,ge;for(M=0,X=S.length;M<X;M+=3){ee=S[M],oe=S[M+1],ge=S[M+2],B[0]=a[ee*3],B[1]=a[ee*3+1],B[2]=a[ee*3+2],o[0]=a[oe*3],o[1]=a[oe*3+1],o[2]=a[oe*3+2],r[0]=a[ge*3],r[1]=a[ge*3+1],r[2]=a[ge*3+2],V.subVec3(o,B,e),V.subVec3(r,B,n);var ie=V.vec3();V.normalizeVec3(V.cross3Vec3(e,n,l),ie),Y[ee]||(Y[ee]=[]),Y[oe]||(Y[oe]=[]),Y[ge]||(Y[ge]=[]),Y[ee].push(ie),Y[oe].push(ie),Y[ge].push(ie)}T=T&&T.length===a.length?T:new Float32Array(a.length);var xe,Ee,Me,Be;for(M=0,X=Y.length;M<X;M++){xe=Y[M].length,Ee=0,Me=0,Be=0;for(var ke=0;ke<xe;ke++)Ee+=Y[M][ke][0],Me+=Y[M][ke][1],Be+=Y[M][ke][2];T[M*3]=Ee/xe,T[M*3+1]=Me/xe,T[M*3+2]=Be/xe}return T}}(),buildTangents:function(){var B=new de(3),o=new de(3),r=new de(3),e=new de(3),n=new de(3),l=new de(3),a=new de(3);return function(S,T,M){for(var X=new Float32Array(S.length),Y=0;Y<T.length;Y+=3){var ee=T[Y],oe=S.subarray(ee*3,ee*3+3),ge=M.subarray(ee*2,ee*2+2);ee=T[Y+1];var ie=S.subarray(ee*3,ee*3+3),xe=M.subarray(ee*2,ee*2+2);ee=T[Y+2];for(var Ee=S.subarray(ee*3,ee*3+3),Me=M.subarray(ee*2,ee*2+2),Be=V.subVec3(ie,oe,B),ke=V.subVec3(Ee,oe,o),De=V.subVec2(xe,ge,r),Ie=V.subVec2(Me,ge,e),Fe=1/(De[0]*Ie[1]-De[1]*Ie[0]),Ne=V.mulVec3Scalar(V.subVec3(V.mulVec3Scalar(Be,Ie[1],n),V.mulVec3Scalar(ke,De[1],l),a),Fe,l),$e=void 0,it=0;it<3;it++)$e=T[Y+it]*3,X[$e]+=Ne[0],X[$e+1]+=Ne[1],X[$e+2]+=Ne[2]}return X}}(),buildPickTriangles:function(o,r,e){for(var n=r.length,l=e?new Uint16Array(n*9):new Float32Array(n*9),a=new Uint8Array(n*12),S=0,T,M=0,X=0,Y,ee,oe,ge,ie,xe=0;xe<n;xe+=3)ie=S>>24&255,ge=S>>16&255,oe=S>>8&255,ee=S&255,Y=r[xe],T=Y*3,l[M++]=o[T],l[M++]=o[T+1],l[M++]=o[T+2],a[X++]=ee,a[X++]=oe,a[X++]=ge,a[X++]=ie,Y=r[xe+1],T=Y*3,l[M++]=o[T],l[M++]=o[T+1],l[M++]=o[T+2],a[X++]=ee,a[X++]=oe,a[X++]=ge,a[X++]=ie,Y=r[xe+2],T=Y*3,l[M++]=o[T],l[M++]=o[T+1],l[M++]=o[T+2],a[X++]=ee,a[X++]=oe,a[X++]=ge,a[X++]=ie,S++;return{positions:l,colors:a}},faceToVertexNormals:function(o,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.smoothNormalsAngleThreshold||20,l={},a=[],S={},T,M,X,Y,ee,oe=4,ge=Math.pow(10,oe),ie,xe,Ee,Me,Be,ke;for(xe=0,Me=o.length;xe<Me;xe+=3){ie=xe/3,M=o[xe],X=o[xe+1],Y=o[xe+2],ee="".concat(Math.round(M*ge),"_").concat(Math.round(X*ge),"_").concat(Math.round(Y*ge)),l[ee]===void 0?l[ee]=[ie]:l[ee].push(ie);var De=V.normalizeVec3([r[xe],r[xe+1],r[xe+2]]);a[ie]=De,T=V.vec4([De[0],De[1],De[2],1]),S[ie]=T}for(ee in l)if(l.hasOwnProperty(ee)){var Ie=l[ee],Fe=Ie.length;for(xe=0;xe<Fe;xe++){var Ne=Ie[xe];for(T=S[Ne],Ee=0;Ee<Fe;Ee++)if(xe!==Ee){var $e=Ie[Ee];Be=a[Ne],ke=a[$e];var it=Math.abs(V.angleVec3(Be,ke)/V.DEGTORAD);it<n&&(T[0]+=ke[0],T[1]+=ke[1],T[2]+=ke[2],T[3]+=1)}}}for(xe=0,Me=r.length;xe<Me;xe+=3)T=S[xe/3],r[xe+0]=T[0]/T[3],r[xe+1]=T[1]/T[3],r[xe+2]=T[2]/T[3]},transformRay:function(){var B=new de(4),o=new de(4);return function(r,e,n,l,a){B[0]=e[0],B[1]=e[1],B[2]=e[2],B[3]=1,V.transformVec4(r,B,o),l[0]=o[0],l[1]=o[1],l[2]=o[2],B[0]=n[0],B[1]=n[1],B[2]=n[2],V.transformVec3(r,B,o),V.normalizeVec3(o),a[0]=o[0],a[1]=o[1],a[2]=o[2]}}(),canvasPosToWorldRay:function(){var B=new de(16),o=new de(4),r=new de(4),e=function(l,a,S,T,M){M[0]=l,M[1]=a,M[2]=S,M[3]=1,V.transformVec4(B,M,M),T||V.mulVec4Scalar(M,1/M[3])};return function(n,l,a,S,T,M,X){var Y=S==="ortho";V.mulMat4(a,l,B),V.inverseMat4(B,B);var ee=2*T[0]/n.width-1,oe=1-2*T[1]/n.height;e(ee,oe,-1,Y,o),e(ee,oe,1,Y,r),M[0]=o[0],M[1]=o[1],M[2]=o[2],V.subVec3(r,o,X),V.normalizeVec3(X)}}(),canvasPosToLocalRay:function(){var B=new de(3),o=new de(3);return function(r,e,n,l,a,S,T,M){V.canvasPosToWorldRay(r,e,n,l,S,B,o),V.worldRayToLocalRay(a,B,o,T,M)}}(),worldRayToLocalRay:function(){var B=new de(16),o=new de(4),r=new de(4);return function(e,n,l,a,S){var T=V.inverseMat4(e,B);o[0]=n[0],o[1]=n[1],o[2]=n[2],o[3]=1,V.transformVec4(T,o,r),a[0]=r[0],a[1]=r[1],a[2]=r[2],V.transformVec3(T,l,S)}}(),buildKDTree:function(){var B=10,o=20,r=new Float32Array;function e(n,l,a,S){var T=new de(6),M={triangles:null,left:null,right:null,leaf:!1,splitDim:0,aabb:T};T[0]=T[1]=T[2]=Number.POSITIVE_INFINITY,T[3]=T[4]=T[5]=Number.NEGATIVE_INFINITY;var X,Y;for(X=0,Y=n.length;X<Y;++X)for(var ee=n[X]*3,oe=0;oe<3;++oe){var ge=l[ee+oe]*3;a[ge]<T[0]&&(T[0]=a[ge]),a[ge]>T[3]&&(T[3]=a[ge]),a[ge+1]<T[1]&&(T[1]=a[ge+1]),a[ge+1]>T[4]&&(T[4]=a[ge+1]),a[ge+2]<T[2]&&(T[2]=a[ge+2]),a[ge+2]>T[5]&&(T[5]=a[ge+2])}if(n.length<o||S>B)return M.triangles=n,M.leaf=!0,M;r[0]=T[3]-T[0],r[1]=T[4]-T[1],r[2]=T[5]-T[2];var ie=0;r[1]>r[ie]&&(ie=1),r[2]>r[ie]&&(ie=2),M.splitDim=ie;var xe=(T[ie]+T[ie+3])/2,Ee=new Array(n.length),Me=0,Be=new Array(n.length),ke=0;for(X=0,Y=n.length;X<Y;++X){var ee=n[X]*3,De=l[ee],Ie=l[ee+1],Fe=l[ee+2],Ne=De*3,$e=Ie*3,it=Fe*3;a[Ne+ie]<=xe||a[$e+ie]<=xe||a[it+ie]<=xe?Ee[Me++]=n[X]:Be[ke++]=n[X]}return Ee.length=Me,Be.length=ke,M.left=e(Ee,l,a,S+1),M.right=e(Be,l,a,S+1),M}return function(n,l){for(var a=n.length/3,S=new Array(a),T=0;T<a;++T)S[T]=T;return e(S,n,l,0)}}(),decompressPosition:function(o,r,e){e=e||o,e[0]=o[0]*r[0]+r[12],e[1]=o[1]*r[5]+r[13],e[2]=o[2]*r[10]+r[14]},decompressPositions:function(o,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Float32Array(o.length),n=0,l=o.length;n<l;n+=3)e[n+0]=o[n+0]*r[0]+r[12],e[n+1]=o[n+1]*r[5]+r[13],e[n+2]=o[n+2]*r[10]+r[14];return e},decompressUV:function(o,r,e){e[0]=o[0]*r[0]+r[6],e[1]=o[1]*r[4]+r[7]},decompressUVs:function(o,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Float32Array(o.length),n=0,l=o.length;n<l;n+=3)e[n+0]=o[n+0]*r[0]+r[6],e[n+1]=o[n+1]*r[4]+r[7];return e},octDecodeVec2:function(o,r){var e=o[0],n=o[1];e=(2*e+1)/255,n=(2*n+1)/255;var l=1-Math.abs(e)-Math.abs(n);l<0&&(e=(1-Math.abs(n))*(e>=0?1:-1),n=(1-Math.abs(e))*(n>=0?1:-1));var a=Math.sqrt(e*e+n*n+l*l);return r[0]=e/a,r[1]=n/a,r[2]=l/a,r},octDecodeVec2s:function(o,r){for(var e=0,n=0,l=o.length;e<l;e+=2){var a=o[e+0],S=o[e+1];a=(2*a+1)/255,S=(2*S+1)/255;var T=1-Math.abs(a)-Math.abs(S);T<0&&(a=(1-Math.abs(S))*(a>=0?1:-1),S=(1-Math.abs(a))*(S>=0?1:-1));var M=Math.sqrt(a*a+S*S+T*T);r[n+0]=a/M,r[n+1]=S/M,r[n+2]=T/M,n+=3}return r}};V.buildEdgeIndices=function(){var B=[],o=[],r=[],e=[],n=[],l=0,a=new Uint16Array(3),S=new Uint16Array(3),T=new Uint16Array(3),M=V.vec3(),X=V.vec3(),Y=V.vec3(),ee=V.vec3(),oe=V.vec3(),ge=V.vec3(),ie=V.vec3();function xe(Me,Be){var ke={},De,Ie,Fe,Ne,$e=4,it=Math.pow(10,$e),pt,ut,dt=0;for(pt=0,ut=Me.length;pt<ut;pt+=3)De=Me[pt],Ie=Me[pt+1],Fe=Me[pt+2],Ne=Math.round(De*it)+"_"+Math.round(Ie*it)+"_"+Math.round(Fe*it),ke[Ne]===void 0&&(ke[Ne]=dt/3,B[dt++]=De,B[dt++]=Ie,B[dt++]=Fe),o[pt/3]=ke[Ne];for(pt=0,ut=Be.length;pt<ut;pt++)e[pt]=o[Be[pt]],r[e[pt]]=Be[pt]}function Ee(Me,Be){l=0;for(var ke=0,De=Me;ke<De;ke+=3){var Ie=e[ke]*3,Fe=e[ke+1]*3,Ne=e[ke+2]*3;Be?(a[0]=B[Ie],a[1]=B[Ie+1],a[2]=B[Ie+2],S[0]=B[Fe],S[1]=B[Fe+1],S[2]=B[Fe+2],T[0]=B[Ne],T[1]=B[Ne+1],T[2]=B[Ne+2],V.decompressPosition(a,Be,M),V.decompressPosition(S,Be,X),V.decompressPosition(T,Be,Y)):(M[0]=B[Ie],M[1]=B[Ie+1],M[2]=B[Ie+2],X[0]=B[Fe],X[1]=B[Fe+1],X[2]=B[Fe+2],Y[0]=B[Ne],Y[1]=B[Ne+1],Y[2]=B[Ne+2]),V.subVec3(Y,X,ee),V.subVec3(M,X,oe),V.cross3Vec3(ee,oe,ge),V.normalizeVec3(ge,ie);var $e=n[l]||(n[l]={normal:V.vec3()});$e.normal[0]=ie[0],$e.normal[1]=ie[1],$e.normal[2]=ie[2],l++}}return function(Me,Be,ke,De){xe(Me,Be),Ee(Be.length,ke);for(var Ie=[],Fe=Math.cos(V.DEGTORAD*De),Ne={},$e,it,pt,ut,dt,wt=!1,Tt,Xt,Nt,Pt,er,sr,mr=0,Mr=Be.length;mr<Mr;mr+=3)for(var tn=mr/3,qr=0;qr<3;qr++)$e=e[mr+qr],it=e[mr+(qr+1)%3],pt=Math.min($e,it),ut=Math.max($e,it),dt=pt+","+ut,Ne[dt]===void 0?Ne[dt]={index1:pt,index2:ut,face1:tn,face2:void 0}:Ne[dt].face2=tn;for(dt in Ne)Tt=Ne[dt],!(Tt.face2!==void 0&&(Xt=n[Tt.face1].normal,Nt=n[Tt.face2].normal,Pt=V.dotVec3(Xt,Nt),Pt>Fe))&&(er=r[Tt.index1],sr=r[Tt.index2],(!wt&&er>65535||sr>65535)&&(wt=!0),Ie.push(er),Ie.push(sr));return wt?new Uint32Array(Ie):new Uint16Array(Ie)}}(),V.planeClipsPositions3=function(B,o,r){for(var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:3,n=0,l=r.length;n<l;n+=e){he[0]=r[n+0]-B[0],he[1]=r[n+1]-B[1],he[2]=r[n+2]-B[2];var a=he[0]*o[0]+he[1]*o[1]+he[2]*o[2];if(a<0)return!0}return!1};var Ce=15,ve=new Float32Array(3),ye=function(){function B(o){var r=this;if(O(this,B),!o)throw"Parameter expected: cfg";if(!o.viewer)throw"Parameter expected: cfg.viewer";this.viewer=o.viewer,this._maxTreeDepth=o.maxTreeDepth||Ce,this._root=null,this._needsRebuild=!0,this._onModelLoaded=this.viewer.scene.on("modelLoaded",function(e){r._needsRebuild=!0}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",function(e){r._needsRebuild=!0}),this.viewer.scene.aabb.on("aabb",function(){r._needsRebuild=!0})}return W(B,[{key:"root",get:function(){return this._needsRebuild&&this._rebuild(),this._root}},{key:"_rebuild",value:function(){var r=this.viewer,e=r.scene,n=0;this._root={aabb:e.getAABB()};for(var l in e.objects){var a=e.objects[l];this._insertEntity(this._root,a,n+1)}this._needsRebuild=!1}},{key:"_insertEntity",value:function(r,e,n){var l=e.aabb;if(n>=this._maxTreeDepth){r.entities=r.entities||[],r.entities.push(e);return}if(r.left&&V.containsAABB3(r.left.aabb,l)){this._insertEntity(r.left,e,n+1);return}if(r.right&&V.containsAABB3(r.right.aabb,l)){this._insertEntity(r.right,e,n+1);return}var a=r.aabb;ve[0]=a[3]-a[0],ve[1]=a[4]-a[1],ve[2]=a[5]-a[2];var S=0;if(ve[1]>ve[S]&&(S=1),ve[2]>ve[S]&&(S=2),!r.left){var T=a.slice();if(T[S+3]=(a[S]+a[S+3])/2,r.left={aabb:T},V.containsAABB3(T,l)){this._insertEntity(r.left,e,n+1);return}}if(!r.right){var M=a.slice();if(M[S]=(a[S]+a[S+3])/2,r.right={aabb:M},V.containsAABB3(M,l)){this._insertEntity(r.right,e,n+1);return}}r.entities=r.entities||[],r.entities.push(e)}},{key:"destroy",value:function(){var r=this.viewer.scene;r.off(this._onModelLoaded),r.off(this._onModelUnloaded),this._root=null,this._needsRebuild=!0}}])}(),Ae=function(){function B(o,r){O(this,B),this.items=o||[],this._lastUniqueId=(r||0)+1}return W(B,[{key:"addItem",value:function(){var r;if(arguments.length===2){var e=arguments[0];if(r=arguments[1],this.items[e])throw"ID clash: '"+e+"'";return this.items[e]=r,e}else for(r=arguments[0]||{};;){var n=this._lastUniqueId++;if(!this.items[n])return this.items[n]=r,n}}},{key:"removeItem",value:function(r){var e=this.items[r];return delete this.items[r],e}}])}(),me=function(){function B(){O(this,B),this._head=[],this._headLength=0,this._tail=[],this._index=0,this._length=0}return W(B,[{key:"length",get:function(){return this._length}},{key:"shift",value:function(){if(this._index>=this._headLength){var r=this._head;if(r.length=0,this._head=this._tail,this._tail=r,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(r){return this._length++,this._tail.push(r),this}},{key:"unshift",value:function(r){return this._head[--this._index]=r,this._length++,this}}])}(),be={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 we(B,o){if(B.nodeType===B.TEXT_NODE){var r=B.nodeValue;if(r.match(/^\s+$/)===null)return r}else if(B.nodeType===B.ELEMENT_NODE||B.nodeType===B.DOCUMENT_NODE){var e={type:B.nodeName,children:[]};if(B.nodeType===B.ELEMENT_NODE)for(var n=0;n<B.attributes.length;n++){var l=B.attributes[n],a=o[l.nodeName]||l.nodeName;e[a]=l.nodeValue}for(var S=0;S<B.childNodes.length;S++){var T=B.childNodes[S],n=we(T,o);n&&e.children.push(n)}return e}}function Te(B){return JSON.parse(JSON.stringify(B))}var He=[["0",10],["A",26],["a",26],["_",1],["$",1]].map(function(B){for(var o=[],r=B[0].charCodeAt(0),e=r+B[1],n=r;n<e;++n)o.push(n);return String.fromCharCode.apply(null,o)}).join("");function je(B,o){var r=!o||o===4?[0,6,12,18]:[0,6];return r.map(function(e){return He.substr(parseInt(B/(1<<e))%64,1)}).reverse().join("")}function qe(B){var o=[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30].map(function(r){return parseInt(B.substr(r,2),16)});return je(o[0],2)+[1,4,7,10,13].map(function(r){return je((o[r]<<16)+(o[r+1]<<8)+o[r+2])}).join("")}function tt(B,o){var r=[],e=function(l){l.type===o&&r.push(l),(l.children||[]).forEach(function(a){e(a)})};return e(B),r}function mt(B){return new Promise(function(o,r){setTimeout(o,B)})}function kt(B){return new Promise(function(o,r){var e=new XMLHttpRequest;e.open(B.method||"GET",B.url,!0),e.onload=function(n){e.readyState===4&&(e.status===200?o(e.responseXML):r(e.statusText))},e.send(null)})}var ht=function(){for(var B={},o=window.location.search.substring(1),r=o.split("&"),e=0;e<r.length;e++){var n=r[e].split("=");if(typeof B[n[0]]>"u")B[n[0]]=decodeURIComponent(n[1]);else if(typeof B[n[0]]=="string"){var l=[B[n[0]],decodeURIComponent(n[1])];B[n[0]]=l}else B[n[0]].push(decodeURIComponent(n[1]))}return B}();function yt(B,o,r){var e=function(a){};o=o||e,r=r||e;var n=new XMLHttpRequest;n.overrideMimeType("application/json"),n.open("GET",B,!0),n.addEventListener("load",function(l){var a=l.target.response;if(this.status===200){var S;try{S=JSON.parse(a)}catch(T){r("utils.loadJSON(): Failed to parse JSON response - ".concat(T))}o(S)}else if(this.status===0){console.warn("loadFile: HTTP Status 0 received.");try{o(JSON.parse(a))}catch(T){r("utils.loadJSON(): Failed to parse JSON response - ".concat(T))}}else r(l)},!1),n.addEventListener("error",function(l){r(l)},!1),n.send(null)}function Lt(B,o,r){var e=function(oe){};o=o||e,r=r||e;var n=/^data:(.*?)(;base64)?,(.*)$/,l=B.match(n);if(l){var a=!!l[2],S=l[3];S=window.decodeURIComponent(S),a&&(S=window.atob(S));try{for(var T=new ArrayBuffer(S.length),M=new Uint8Array(T),X=0;X<S.length;X++)M[X]=S.charCodeAt(X);dr.scheduleTask(function(){o(T)})}catch(ee){dr.scheduleTask(function(){r(ee)})}}else{var Y=new XMLHttpRequest;Y.open("GET",B,!0),Y.responseType="arraybuffer",Y.onreadystatechange=function(){Y.readyState===4&&(Y.status===200?o(Y.response):r("loadArrayBuffer error : "+Y.response))},Y.send(null)}}function We(B){return B&&!B.propertyIsEnumerable("length")&&U(B)==="object"&&typeof B.length=="number"}function Oe(B){return typeof B=="string"||B instanceof String}function Ke(B){return!isNaN(parseFloat(B))&&isFinite(B)}function nt(B){return at.isString(B)||at.isNumeric(B)}function Xe(B,o){if(!B||!o)return!1;var r=at.isNumeric(B)||at.isString(B)?"".concat(B):B.id,e=at.isNumeric(o)||at.isString(o)?"".concat(o):o.id;return r===e}function Ge(B){return typeof B=="function"}function ze(B){var o={}.constructor;return!!B&&B.constructor===o}function Ct(B){return at.apply(B,{})}function It(B,o){for(var r in B)B.hasOwnProperty(r)&&(o[r]=B[r]);return o}function Ot(B,o){for(var r in B)B.hasOwnProperty(r)&&B[r]!==void 0&&B[r]!==null&&(o[r]=B[r]);return o}function Ze(B,o){for(var r in B)B.hasOwnProperty(r)&&(o[r]===void 0||o[r]===null)&&(o[r]=B[r]);return o}function gt(B){for(var o in B)if(B.hasOwnProperty(o))return!1;return!0}function vt(B){return at.isNumeric(B)?"".concat(B):"'".concat(B,"'")}function _t(B,o){var r=new B.constructor(B.length+o.length);return r.set(B),r.set(o,B.length),r}function Bt(B){var o=[];function r(e){e.id=e.uuid,delete e.oid,o.push(e);var n=e.children;if(n)for(var l=0,a=n.length;l<a;l++){var S=n[l];S.parent=e.id,r(n[l])}e.children=[]}return r(B),o}var at={xmlToJson:we,clone:Te,compressGuid:qe,findNodeOfType:tt,timeout:mt,httpRequest:kt,loadJSON:yt,loadArraybuffer:Lt,queryString:ht,isArray:We,isString:Oe,isNumeric:Ke,isID:nt,isSameComponent:Xe,isFunction:Ge,isObject:ze,copy:Ct,apply:It,apply2:Ot,applyIf:Ze,isEmptyObject:gt,inQuotes:vt,concat:_t,flattenParentChildHierarchy:Bt},jt={},rr=new Ae,Dt=new me,rt={sceneId:null,time:null,startTime:null,prevTime:null,deltaTime:null},ct=10,Rt=[],qt=30,pr=0,ar,Ir=0;function Lr(){this.version="1.0.0",this.scenes={},this._superTypes={},this._addScene=function(B){if(B.id){if(dr.scenes[B.id]){console.error("[ERROR] Scene ".concat(at.inQuotes(B.id)," already exists"));return}}else B.id=rr.addItem({});dr.scenes[B.id]=B;var o=B.ticksPerOcclusionTest,r=B.ticksPerRender;jt[B.id]={ticksPerOcclusionTest:o,ticksPerRender:r,renderCountdown:r},be.components.scenes++,B.once("destroyed",function(){rr.removeItem(B.id),delete dr.scenes[B.id],delete jt[B.id],be.components.scenes--})},this.clear=function(){var B;for(var o in dr.scenes)dr.scenes.hasOwnProperty(o)&&(B=dr.scenes[o],o==="default.scene"?B.clear():(B.destroy(),delete dr.scenes[B.id]))},this.scheduleTask=function(B){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Dt.push(B),Dt.push(o)},this.runTasks=function(){for(var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1,o=new Date().getTime(),r,e,n=0;Dt.length>0&&(B<0||o<B);)r=Dt.shift(),e=Dt.shift(),e?r.call(e):r(),o=new Date().getTime(),n++;return n},this.getNumTasks=function(){return Dt.length}}var dr=new Lr,zr=function(){var o=Date.now();if(ar=o-pr,pr>0&&ar>0){var r=1e3/ar;Ir+=r,Rt.push(r),Rt.length>=qt&&(Ir-=Rt.shift()),be.frame.fps=Math.round(Ir/Rt.length)}for(var e in dr.scenes)dr.scenes[e].compile();Le(o),pr=o},Se=function(){function B(o,r){O(this,B),L(this,"worker",null);var e=new Blob(["setInterval(() => postMessage(0), ".concat(r,");")]),n=URL.createObjectURL(e);this.worker=new Worker(n),this.worker.onmessage=o}return W(B,[{key:"stop",value:function(){this.worker.terminate()}}])}();new Se(zr,100);var Re=function(){var o=Date.now();if(ar=o-pr,pr>0&&ar>0){var r=1e3/ar;Ir+=r,Rt.push(r),Rt.length>=qt&&(Ir-=Rt.shift()),be.frame.fps=Math.round(Ir/Rt.length)}Le(o),Ue(o),Je(),window.requestPostAnimationFrame!==void 0?window.requestPostAnimationFrame(zr):requestAnimationFrame(Re)};Re();function Le(B){var o=dr.runTasks(B+ct),r=dr.getNumTasks();be.frame.tasksRun=o,be.frame.tasksScheduled=r,be.frame.tasksBudget=ct}function Ue(B){rt.time=B;for(var o in dr.scenes)if(dr.scenes.hasOwnProperty(o)){var r=dr.scenes[o];rt.sceneId=o,rt.startTime=r.startTime,rt.deltaTime=rt.prevTime!=null?rt.time-rt.prevTime:0,r.fire("tick",rt,!0)}rt.prevTime=B}function Je(){var B=dr.scenes,o=!1,r,e,n,l,a;for(a in B)B.hasOwnProperty(a)&&(r=B[a],e=jt[a],e||(e=jt[a]={}),n=r.ticksPerOcclusionTest,e.ticksPerOcclusionTest!==n&&(e.ticksPerOcclusionTest=n,e.renderCountdown=n),--r.occlusionTestCountdown<=0&&(r.doOcclusionTest(),r.occlusionTestCountdown=n),l=r.ticksPerRender,e.ticksPerRender!==l&&(e.ticksPerRender=l,e.renderCountdown=l),--e.renderCountdown===0&&(r.render(o),e.renderCountdown=l))}var Ye=function(){function B(o,r,e){O(this,B),this.id=e&&e.id?e.id:o,this.viewer=r,this._subIdMap=null,this._subIdEvents=null,this._eventSubs=null,this._eventSubsNum=null,this._events=null,this._eventCallDepth=0,r.addPlugin(this)}return W(B,[{key:"scheduleTask",value:function(r){dr.scheduleTask(r,null)}},{key:"fire",value:function(r,e,n){this._events||(this._events={}),this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),n!==!0&&(this._events[r]=e||!0);var l=this._eventSubs[r],a;if(l)for(var S in l)l.hasOwnProperty(S)&&(a=l[S],this._eventCallDepth++,this._eventCallDepth<300?a.callback.call(a.scope,e):this.error("fire: potential stack overflow from recursive event '"+r+"' - dropping this event"),this._eventCallDepth--)}},{key:"on",value:function(r,e,n){this._events||(this._events={}),this._subIdMap||(this._subIdMap=new Ae),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={}),this._eventSubsNum||(this._eventSubsNum={});var l=this._eventSubs[r];l?this._eventSubsNum[r]++:(l={},this._eventSubs[r]=l,this._eventSubsNum[r]=1);var a=this._subIdMap.addItem();l[a]={callback:e,scope:n||this},this._subIdEvents[a]=r;var S=this._events[r];return S!==void 0&&e.call(n||this,S),a}},{key:"off",value:function(r){if(r!=null&&this._subIdEvents){var e=this._subIdEvents[r];if(e){delete this._subIdEvents[r];var n=this._eventSubs[e];n&&(delete n[r],this._eventSubsNum[e]--),this._subIdMap.removeItem(r)}}}},{key:"once",value:function(r,e,n){var l=this,a=this.on(r,function(S){l.off(a),e.call(n||this,S)},n)}},{key:"hasSubs",value:function(r){return this._eventSubsNum&&this._eventSubsNum[r]>0}},{key:"log",value:function(r){console.log("[xtctwins plugin ".concat(this.id,"]: ").concat(r))}},{key:"warn",value:function(r){console.warn("[xtctwins plugin ".concat(this.id,"]: ").concat(r))}},{key:"error",value:function(r){console.error("[xtctwins plugin ".concat(this.id,"]: ").concat(r))}},{key:"send",value:function(r,e){}},{key:"destroy",value:function(){this.viewer.removePlugin(this)}}])}(),At=function(){function B(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(O(this,B),this.scene=null,this.type==="Scene")this.scene=this,this.viewer=r.viewer;else{if(o.type==="Scene")this.scene=o;else if(o instanceof B)this.scene=o.scene;else throw"Invalid param: owner must be a Component";this._owner=o}this._dontClear=!!r.dontClear,this._renderer=this.scene._renderer,this.meta=r.meta||{},this.id=r.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,o&&o._own(this)}return W(B,[{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(r){return this.type===r}},{key:"fire",value:function(r,e,n){this._events||(this._events={}),this._eventSubs||(this._eventSubs={},this._eventSubsNum={}),n!==!0&&(this._events[r]=e||!0);var l=this._eventSubs[r],a;if(l)for(var S in l)l.hasOwnProperty(S)&&(a=l[S],this._eventCallDepth++,this._eventCallDepth<300?a.callback.call(a.scope,e):this.error("fire: potential stack overflow from recursive event '"+r+"' - dropping this event"),this._eventCallDepth--)}},{key:"on",value:function(r,e,n){this._events||(this._events={}),this._subIdMap||(this._subIdMap=new Ae),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={}),this._eventSubsNum||(this._eventSubsNum={});var l=this._eventSubs[r];l?this._eventSubsNum[r]++:(l={},this._eventSubs[r]=l,this._eventSubsNum[r]=1);var a=this._subIdMap.addItem();l[a]={callback:e,scope:n||this},this._subIdEvents[a]=r;var S=this._events[r];return S!==void 0&&e.call(n||this,S),a}},{key:"off",value:function(r){if(r!=null&&this._subIdEvents){var e=this._subIdEvents[r];if(e){delete this._subIdEvents[r];var n=this._eventSubs[e];n&&(delete n[r],this._eventSubsNum[e]--),this._subIdMap.removeItem(r)}}}},{key:"once",value:function(r,e,n){var l=this,a=this.on(r,function(S){l.off(a),e.call(n||this,S)},n)}},{key:"hasSubs",value:function(r){return this._eventSubsNum&&this._eventSubsNum[r]>0}},{key:"log",value:function(r){r="[LOG]"+this._message(r),window.console.log(r),this.scene.fire("log",r)}},{key:"_message",value:function(r){return" ["+this.type+" "+at.inQuotes(this.id)+"]: "+r}},{key:"warn",value:function(r){r="[WARN]"+this._message(r),window.console.warn(r),this.scene.fire("warn",r)}},{key:"error",value:function(r){r="[ERROR]"+this._message(r),window.console.error(r),this.scene.fire("error",r)}},{key:"_attach",value:function(r){var e=r.name;if(!e){this.error("Component 'name' expected");return}var n=r.component,l=r.sceneDefault,a=r.sceneSingleton,S=r.type,T=r.on,M=r.recompiles!==!1,X=!1;if(n&&(at.isNumeric(n)||at.isString(n))){var Y=n;if(n=this.scene.components[Y],!n){this.error("Component not found: "+at.inQuotes(Y));return}}if(!n){if(a===!0){var ee=this.scene.types[S];for(var oe in ee)if(ee.hasOwnProperty){n=ee[oe];break}if(!n)return this.error("Scene has no default component for '"+e+"'"),null}else if(l===!0&&(n=this.scene[e],!n))return this.error("Scene has no default component for '"+e+"'"),null}if(n){if(n.scene.id!==this.scene.id){this.error("Not in same scene: "+n.type+" "+at.inQuotes(n.id));return}if(S&&!n.isType(S)){this.error("Expected a "+S+" type or subtype: "+n.type+" "+at.inQuotes(n.id));return}}this._attachments||(this._attachments={});var ge=this._attached[e],ie,xe,Ee;if(ge){if(n&&ge.id===n.id)return;var Me=this._attachments[ge.id];for(ie=Me.subs,xe=0,Ee=ie.length;xe<Ee;xe++)ge.off(ie[xe]);delete this._attached[e],delete this._attachments[ge.id];var Be=Me.params.onDetached;Be&&(at.isFunction(Be)?Be(ge):Be.scope?Be.callback.call(Be.scope,ge):Be.callback(ge)),Me.managingLifecycle&&ge.destroy()}if(n){var ke={params:r,component:n,subs:[],managingLifecycle:X};ke.subs.push(n.once("destroyed",function(){ke.params.component=null,this._attach(ke.params)},this)),M&&ke.subs.push(n.on("dirty",function(){this.fire("dirty",this)},this)),this._attached[e]=n,this._attachments[n.id]=ke;var De=r.onAttached;if(De&&(at.isFunction(De)?De(n):De.scope?De.callback.call(De.scope,n):De.callback(n)),T){var Ie,Fe,Ne,$e;for(Ie in T)if(T.hasOwnProperty(Ie)){if(Fe=T[Ie],at.isFunction(Fe)?(Ne=Fe,$e=null):(Ne=Fe.callback,$e=Fe.scope),!Ne)continue;ke.subs.push(n.on(Ie,Ne,$e))}}}return M&&this.fire("dirty",this),this.fire(e,n),n}},{key:"_checkComponent",value:function(r,e){if(!e.isComponent)if(at.isID(e)){var n=e;if(e=this.scene.components[n],!e){this.error("Component not found: "+n);return}}else{this.error("Expected a Component or ID");return}if(r!==e.type){this.error("Expected a "+r+" Component");return}if(e.scene.id!==this.scene.id){this.error("Not in same scene: "+e.type);return}return e}},{key:"_checkComponent2",value:function(r,e){if(!e.isComponent)if(at.isID(e)){var n=e;if(e=this.scene.components[n],!e){this.error("Component not found: "+n);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 l=0,a=r.length;l<a;l++)if(r[l]===e.type)return e;return this.error("Expected component types: "+r),null}},{key:"_own",value:function(r){var e=this;this._ownedComponents||(this._ownedComponents={}),this._ownedComponents[r.id]||(this._ownedComponents[r.id]=r),r.once("destroyed",function(){delete e._ownedComponents[r.id]},this)}},{key:"_needUpdate",value:function(r){this._updateScheduled||(this._updateScheduled=!0,r===0?this._doUpdate():dr.scheduleTask(this._doUpdate,this))}},{key:"_doUpdate",value:function(){this._updateScheduled&&(this._updateScheduled=!1,this._update&&this._update())}},{key:"scheduleTask",value:function(r){dr.scheduleTask(r,null)}},{key:"_update",value:function(){}},{key:"clear",value:function(){if(this._ownedComponents){for(var r in this._ownedComponents)if(this._ownedComponents.hasOwnProperty(r)){var e=this._ownedComponents[r];e.destroy(),delete this._ownedComponents[r]}}}},{key:"destroy",value:function(r){if(!this.destroyed){this.fire("destroyed",this.destroyed=!0);var e,n,l,a,S,T;if(this._attachments){for(e in this._attachments)if(this._attachments.hasOwnProperty(e)){for(n=this._attachments[e],l=n.component,a=n.subs,S=0,T=a.length;S<T;S++)l.off(a[S]);n.managingLifecycle&&l.destroy()}}if(this._ownedComponents)for(e in this._ownedComponents)this._ownedComponents.hasOwnProperty(e)&&(l=this._ownedComponents[e],l.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}}}])}(),Ve=V.vec3(),st=V.vec4(),ot=function(){var B=new Float64Array(16),o=new Float64Array(4),r=new Float64Array(4);return function(e,n,l){return l=l||B,o[0]=n[0],o[1]=n[1],o[2]=n[2],o[3]=1,V.transformVec4(e,o,r),V.setMat4Translation(e,r,l),l.slice()}}();function Et(B,o,r){var e=Float32Array.from([B[0]])[0],n=B[0]-e,l=Float32Array.from([B[1]])[0],a=B[1]-l,S=Float32Array.from([B[2]])[0],T=B[2]-S;o[0]=e,o[1]=l,o[2]=S,r[0]=n,r[1]=a,r[2]=T}function ft(B,o,r){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e3,n=V.getPositionsCenter(B,Ve),l=Math.round(n[0]/e)*e,a=Math.round(n[1]/e)*e,S=Math.round(n[2]/e)*e;r[0]=l,r[1]=a,r[2]=S;var T=r[0]!==0||r[1]!==0||r[2]!==0;if(T)for(var M=0,X=B.length;M<X;M+=3)o[M+0]=B[M+0]-l,o[M+1]=B[M+1]-a,o[M+2]=B[M+2]-S;return T}function bt(B,o,r){return r[0]=B[0]+o[0],r[1]=B[1]+o[1],r[2]=B[2]+o[2],r}function Ft(B,o,r,e,n){var l=n?(st.set(r,0),st[3]=1,V.mulMat4v4(n,st,st)):r,a=V.dotVec3(o,l)+B,S=V.normalizeVec3(o,Ve);return V.mulVec3Scalar(S,-a,e),e}var lt={VISIBLE:1,CULLED:4,PICKABLE:8,CLIPPABLE:16,COLLIDABLE:32,XRAYED:256,HIGHLIGHTED:512,SELECTED:1024,EDGES:2048},fr=new Float32Array([0,0,0]),Fr=new Uint16Array([0,0,0]);V.OBB3();var Br=function(){function B(o,r,e,n,l,a){O(this,B),this._isObject=r,this.scene=o.scene,this.model=o,this.meshes=n,this._numPrimitives=0;for(var S=0,T=this.meshes.length;S<T;S++){var M=this.meshes[S];M.parent=this,M.entity=this,this._numPrimitives+=M.numPrimitives}this.id=e,this.originalSystemId=V.unglobalizeObjectId(o.id,e),this._flags=l,this._aabb=V.AABB3(),this._aabbDirty=!0,this._offset=V.vec3(),this._colorizeUpdated=!1,this._opacityUpdated=!1,this._origin_opacity=-1,this._lodCullable=!!a,this._culled=!1,this._culledVFC=!1,this._culledLOD=!1,this._finalizedOnce=!1,this._isObject&&o.scene._registerObject(this)}return W(B,[{key:"position",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.position:null},set:function(r){for(var e={},n=0,l=this.meshes.length;n<l;n++){var a=this.meshes[n];a.transform&&!e[a.transform.id]&&(e[a.transform.id]=!0,a.position=r)}}},{key:"matrix",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.matrix:null},set:function(r){for(var e={},n=0,l=this.meshes.length;n<l;n++){var a=this.meshes[n].transform;a&&!e[a.id]&&(e[a.id]=!0,a.matrix=r)}}},{key:"rotation",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.rotation:null},set:function(r){for(var e={},n=0,l=this.meshes.length;n<l;n++){var a=this.meshes[n].transform;a&&!e[a.id]&&(e[a.id]=!0,a.rotation=r)}}},{key:"quaternion",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.quaternion:null},set:function(r){for(var e={},n=0,l=this.meshes.length;n<l;n++){var a=this.meshes[n].transform;a&&!e[a.id]&&(e[a.id]=!0,a.quaternion=r)}}},{key:"scale",get:function(){return this.meshes.length>0&&this.meshes[0].transform?this.meshes[0].transform.scale:null},set:function(r){for(var e={},n=0,l=this.meshes.length;n<l;n++){var a=this.meshes[n].transform;a&&!e[a.id]&&(e[a.id]=!0,a.scale=r)}}},{key:"_transformDirty",value:function(){this._aabbDirty=!0,this.model._transformDirty()}},{key:"_sceneModelDirty",value:function(){this._aabbDirty=!0;for(var r=0,e=this.meshes.length;r<e;r++)this.meshes[r]._sceneModelDirty()}},{key:"aabb",get:function(){if(this._aabbDirty){V.collapseAABB3(this._aabb);for(var r=0,e=this.meshes.length;r<e;r++)V.expandAABB3(this._aabb,this.meshes[r].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(lt.VISIBLE)},set:function(r){if(!!(this._flags<.VISIBLE)!==r){r?this._flags=this._flags|lt.VISIBLE:this._flags=this._flags&-2;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setVisible(this._flags);this._isObject&&this.model.scene._objectVisibilityUpdated(this),this.model.glRedraw()}}},{key:"highlighted",get:function(){return this._getFlag(lt.HIGHLIGHTED)},set:function(r){if(!!(this._flags<.HIGHLIGHTED)!==r){r?this._flags=this._flags|lt.HIGHLIGHTED:this._flags=this._flags&-513;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setHighlighted(this._flags);this._isObject&&this.model.scene._objectHighlightedUpdated(this),this.model.glRedraw()}}},{key:"xrayed",get:function(){return this._getFlag(lt.XRAYED)},set:function(r){if(!!(this._flags<.XRAYED)!==r){r?this._flags=this._flags|lt.XRAYED:this._flags=this._flags&-257;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setXRayed(this._flags);this._isObject&&this.model.scene._objectXRayedUpdated(this),this.model.glRedraw()}}},{key:"selected",get:function(){return this._getFlag(lt.SELECTED)},set:function(r){if(!!(this._flags<.SELECTED)!==r){r?this._flags=this._flags|lt.SELECTED:this._flags=this._flags&-1025;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setSelected(this._flags);this._isObject&&this.model.scene._objectSelectedUpdated(this),this.model.glRedraw()}}},{key:"edges",get:function(){return this._getFlag(lt.EDGES)},set:function(r){if(!!(this._flags<.EDGES)!==r){r?this._flags=this._flags|lt.EDGES:this._flags=this._flags&-2049;for(var e=0,n=this.meshes.length;e<n;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(r){this._culledVFC=r,this._setCulled()}},{key:"culledLOD",get:function(){return!!this._culledLOD},set:function(r){this._culledLOD=r,this._setCulled()}},{key:"culled",get:function(){return!!this._culled},set:function(r){this._culled=r,this._setCulled()}},{key:"_setCulled",value:function(){var r=!!this._culled||!!(this._culledLOD&&this._lodCullable)||!!this._culledVFC;if(!!(this._flags<.CULLED)!==r){r?this._flags=this._flags|lt.CULLED:this._flags=this._flags&-5;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setCulled(this._flags);this.model.glRedraw()}}},{key:"clippable",get:function(){return this._getFlag(lt.CLIPPABLE)},set:function(r){if(!!(this._flags<.CLIPPABLE)!==r){r?this._flags=this._flags|lt.CLIPPABLE:this._flags=this._flags&-17;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setClippable(this._flags);this.model.glRedraw()}}},{key:"collidable",get:function(){return this._getFlag(lt.COLLIDABLE)},set:function(r){if(!!(this._flags<.COLLIDABLE)!==r){r?this._flags=this._flags|lt.COLLIDABLE:this._flags=this._flags&-33;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setCollidable(this._flags)}}},{key:"pickable",get:function(){return this._getFlag(lt.PICKABLE)},set:function(r){if(!!(this._flags<.PICKABLE)!==r){r?this._flags=this._flags|lt.PICKABLE:this._flags=this._flags&-9;for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setPickable(this._flags)}}},{key:"colorize",get:function(){if(this.meshes.length===0)return null;var r=this.meshes[0]._colorize;return fr[0]=r[0]/255,fr[1]=r[1]/255,fr[2]=r[2]/255,fr},set:function(r){if(r){Fr[0]=Math.floor(r[0]*255),Fr[1]=Math.floor(r[1]*255),Fr[2]=Math.floor(r[2]*255);for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setColorize(Fr)}else for(var l=0,a=this.meshes.length;l<a;l++)this.meshes[l]._setColorize(null);if(this._isObject){var S=!!r;this.scene._objectColorizeUpdated(this,S),this._colorizeUpdated=S}this.model.glRedraw()}},{key:"opacity",get:function(){return this.meshes.length>0?this.meshes[0]._colorize[3]/255:1},set:function(r){if(this.meshes.length!==0){var e=r!=null,n=this.meshes[0]._colorize[3],l=255;if(e){if(r<0?r=0:r>1&&(r=1),l=Math.floor(r*255),n===l)return}else if(l=255,n===l)return;for(var a=0,S=this.meshes.length;a<S;a++)this.meshes[a]._setOpacity(l,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(r){this._origin_opacity=r}},{key:"offset",get:function(){return this._offset},set:function(r){r?(this._offset[0]=r[0],this._offset[1]=r[1],this._offset[2]=r[2]):(this._offset[0]=0,this._offset[1]=0,this._offset[2]=0);for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._setOffset(this._offset);this._aabbDirty=!0,this.model._aabbDirty=!0,this.scene._aabbDirty=!0,this.scene._objectOffsetUpdated(this,r),this.model.glRedraw()}},{key:"saoEnabled",get:function(){return this.model.saoEnabled}},{key:"getEachVertex",value:function(r){for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e].getEachVertex(r)}},{key:"_getFlag",value:function(r){return!!(this._flags&r)}},{key:"_addMeshes",value:function(r){if(!(!r||r.length===0)){for(var e=0,n=r.length;e<n;e++){var l=r[e];l.parent=this,l.entity=this,this.meshes.push(l),this._numPrimitives+=l.numPrimitives}this._finalizedOnce&&this.model._entitiesToFinalize.indexOf(this)===-1&&this.model._entitiesToFinalize.push(this),this._aabbDirty=!0,this.model._aabbDirty=!0,this.model.glRedraw()}}},{key:"_finalize",value:function(){var r=this.model.scene;this._isObject&&!this._finalizedOnce&&(this.visible&&r._objectVisibilityUpdated(this),this.highlighted&&r._objectHighlightedUpdated(this),this.xrayed&&r._objectXRayedUpdated(this),this.selected&&r._objectSelectedUpdated(this));for(var e=0,n=this.meshes.length;e<n;e++)this.meshes[e]._finalize(this._flags);this._finalizedOnce=!0}},{key:"_finalize2",value:function(){for(var r=0,e=this.meshes.length;r<e;r++)this.meshes[r]._finalize2()}},{key:"_destroy",value:function(){var r=this.model.scene;this._isObject&&(r._deregisterObject(this),this.visible&&r._deRegisterVisibleObject(this),this.xrayed&&r._deRegisterXRayedObject(this),this.selected&&r._deRegisterSelectedObject(this),this.highlighted&&r._deRegisterHighlightedObject(this),this.edges&&r._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,n=this.meshes.length;e<n;e++)this.meshes[e]._destroy();r._aabbDirty=!0}}])}(),gn=V.vec4(),Qr=V.vec4(),ln=function(B){function o(r,e){var n;return O(this,o),n=R(this,o,[r,e]),n.id=e.id,n._entity=null,n._visible=null,n._worldPos=V.vec3(),n._origin=V.vec3(),n._rtcPos=V.vec3(),n._viewPos=V.vec3(),n._canvasPos=V.vec2(),n._occludable=!1,n._onCameraViewMatrix=n.scene.camera.on("matrix",function(){n._viewPosDirty=!0,n._needUpdate()}),n._onCameraProjMatrix=n.scene.camera.on("projMatrix",function(){n._canvasPosDirty=!0,n._needUpdate()}),n._onEntityDestroyed=null,n._onEntityModelDestroyed=null,n._renderer.addMarker(n),n.entity=e.entity,n.worldPos=e.worldPos,n.occludable=e.occludable,n}return N(o,B),W(o,[{key:"_update",value:function(){if(this._viewPosDirty&&(V.transformPoint3(this.scene.camera.viewMatrix,this._worldPos,this._viewPos),this._viewPosDirty=!1,this._canvasPosDirty=!0,this.fire("viewPos",this._viewPos)),this._canvasPosDirty){gn.set(this._viewPos),gn[3]=1,V.transformPoint4(this.scene.camera.projMatrix,gn,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 n=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 Br?this._onEntityModelDestroyed=this._entity.model.on("destroyed",function(){n._entity=null,n._onEntityModelDestroyed=null}):this._onEntityDestroyed=this._entity.on("destroyed",function(){n._entity=null,n._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]),Et(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),$(o,"destroy",this)([])}}])}(At),Wn=function(){function B(o){var r=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,B),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 n=this._wire,l=n.style;l.border="solid "+this._thickness+"px "+this._color,l.position="absolute",l["z-index"]=e.zIndex===void 0?"2000001":e.zIndex,l.width="0px",l.height="0px",l.display="block",l.top="0px",l.left="0px",l["-webkit-transform-origin"]="0 0",l["-moz-transform-origin"]="0 0",l["-ms-transform-origin"]="0 0",l["-o-transform-origin"]="0 0",l["transform-origin"]="0 0",l["-webkit-transform"]="rotate(0deg)",l["-moz-transform"]="rotate(0deg)",l["-ms-transform"]="rotate(0deg)",l["-o-transform"]="rotate(0deg)",l.transform="rotate(0deg)",l.opacity=1,l["pointer-events"]="none",e.onContextMenu,o.appendChild(n);var a=this._wireClickable,S=a.style;S.border="solid "+this._thicknessClickable+"px "+this._color,S.position="absolute",S["z-index"]=e.zIndex===void 0?"2000002":e.zIndex+1,S.width="0px",S.height="0px",S.display="block",S.top="0px",S.left="0px",S["-webkit-transform-origin"]="0 0",S["-moz-transform-origin"]="0 0",S["-ms-transform-origin"]="0 0",S["-o-transform-origin"]="0 0",S["transform-origin"]="0 0",S["-webkit-transform"]="rotate(0deg)",S["-moz-transform"]="rotate(0deg)",S["-ms-transform"]="rotate(0deg)",S["-o-transform"]="rotate(0deg)",S.transform="rotate(0deg)",S.opacity=0,S["pointer-events"]="none",e.onContextMenu,o.appendChild(a),e.onMouseOver&&a.addEventListener("mouseover",function(T){e.onMouseOver(T,r)}),e.onMouseLeave&&a.addEventListener("mouseleave",function(T){e.onMouseLeave(T,r)}),e.onMouseWheel&&a.addEventListener("wheel",function(T){e.onMouseWheel(T,r)}),e.onMouseDown&&a.addEventListener("mousedown",function(T){e.onMouseDown(T,r)}),e.onMouseClick&&a.addEventListener("click",function(T){e.onMouseClick(T,r)}),e.onTouchStart&&a.addEventListener("touchstart",function(T){e.onTouchStart(T,r)}),e.onMouseUp&&a.addEventListener("mouseup",function(T){e.onMouseUp(T,r)}),e.onMouseMove&&a.addEventListener("mousemove",function(T){e.onMouseMove(T,r)}),e.onContextMenu&&a.addEventListener("contextmenu",function(T){e.onContextMenu(T,r),T.preventDefault()}),this._x1=0,this._y1=0,this._x2=0,this._y2=0,this._update()}return W(B,[{key:"visible",get:function(){return this._wire.style.display==="block"}},{key:"_update",value:function(){var r=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,n=this._wire.style;n.width=Math.round(r)+"px",n.left=Math.round(this._x1)+"px",n.top=Math.round(this._y1)+"px",n["-webkit-transform"]="rotate("+e+"deg)",n["-moz-transform"]="rotate("+e+"deg)",n["-ms-transform"]="rotate("+e+"deg)",n["-o-transform"]="rotate("+e+"deg)",n.transform="rotate("+e+"deg)";var l=this._wireClickable.style;l.width=Math.round(r)+"px",l.left=Math.round(this._x1)+"px",l.top=Math.round(this._y1)+"px",l["-webkit-transform"]="rotate("+e+"deg)",l["-moz-transform"]="rotate("+e+"deg)",l["-ms-transform"]="rotate("+e+"deg)",l["-o-transform"]="rotate("+e+"deg)",l.transform="rotate("+e+"deg)"}},{key:"setStartAndEnd",value:function(r,e,n,l){this._x1=r,this._y1=e,this._x2=n,this._y2=l,this._update()}},{key:"setColor",value:function(r){this._color=r||"black",this._wire.style.border="solid "+this._thickness+"px "+this._color}},{key:"setOpacity",value:function(r){this._wire.style.opacity=r}},{key:"setVisible",value:function(r){this._visible!==r&&(this._visible=!!r,this._wire.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setCulled",value:function(r){this._culled!==r&&(this._culled=!!r,this._wire.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setClickable",value:function(r){this._wireClickable.style["pointer-events"]=r?"all":"none"}},{key:"setHighlighted",value:function(r){this._highlighted!==r&&(this._highlighted=!!r,this._highlighted?this._wire.classList.add(this._highlightClass):this._wire.classList.remove(this._highlightClass))}},{key:"destroy",value:function(r){this._wire.parentElement&&this._wire.parentElement.removeChild(this._wire),this._wireClickable.parentElement&&this._wireClickable.parentElement.removeChild(this._wireClickable)}}])}(),Yn=function(){function B(o){var r=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,B),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 n=this._dot,l=n.style;l["border-radius"]="25px",l.border="solid 2px white",l.background="lightgreen",l.position="absolute",l["z-index"]=e.zIndex===void 0?"40000005":e.zIndex,l.width="10px",l.height="10px",l.display=e.visible!==!1?"block":"none",l.top="0px",l.left="0px",l["box-shadow"]="0 2px 5px 0 #182A3D;",l.opacity=1,l["pointer-events"]="none",e.onContextMenu,o.appendChild(n);var a=this._dotClickable,S=a.style;S["border-radius"]="35px",S.border="solid 10px white",S.position="absolute",S["z-index"]=e.zIndex===void 0?"40000007":e.zIndex+1,S.width="10px",S.height="10px",S.display="block",S.top="0px",S.left="0px",S.opacity=0,S["pointer-events"]="none",e.onContextMenu,o.appendChild(a),a.addEventListener("click",function(T){o.dispatchEvent(new MouseEvent("mouseover",T))}),e.onMouseOver&&a.addEventListener("mouseover",function(T){e.onMouseOver(T,r),o.dispatchEvent(new MouseEvent("mouseover",T))}),e.onMouseLeave&&a.addEventListener("mouseleave",function(T){e.onMouseLeave(T,r)}),e.onMouseWheel&&a.addEventListener("wheel",function(T){e.onMouseWheel(T,r)}),e.onMouseDown&&a.addEventListener("mousedown",function(T){e.onMouseDown(T,r)}),e.onMouseClick&&a.addEventListener("click",function(T){e.onMouseClick(T,r)}),e.onTouchStart&&a.addEventListener("touchstart",function(T){e.onTouchStart(T,r)}),e.onMouseUp&&a.addEventListener("mouseup",function(T){e.onMouseUp(T,r)}),e.onMouseMove&&a.addEventListener("mousemove",function(T){e.onMouseMove(T,r)}),e.onContextMenu&&a.addEventListener("contextmenu",function(T){e.onContextMenu(T,r),T.preventDefault()}),this.setPos(e.x||0,e.y||0),this.setFillColor(e.fillColor),this.setBorderColor(e.borderColor)}return W(B,[{key:"setPos",value:function(r,e){this._x=r,this._y=e;var n=this._dot.style;n.left=Math.round(r)-7+"px",n.top=Math.round(e)-7+"px";var l=this._dotClickable.style;l.left=Math.round(r)-9+"px",l.top=Math.round(e)-9+"px"}},{key:"setFillColor",value:function(r){this._dot.style.background=r||"lightgreen"}},{key:"setBorderColor",value:function(r){this._dot.style.border="solid 2px"+(r||"black")}},{key:"setOpacity",value:function(r){this._dot.style.opacity=r}},{key:"setVisible",value:function(r){this._visible!==r&&(this._visible=!!r,this._dot.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setCulled",value:function(r){this._culled!==r&&(this._culled=!!r,this._dot.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setClickable",value:function(r){this._dotClickable.style["pointer-events"]=r?"all":"none"}},{key:"setHighlighted",value:function(r){this._highlighted!==r&&(this._highlighted=!!r,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)}}])}(),Ri=function(){function B(o){var r=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,B),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 n=this._label,l=n.style;l["border-radius"]="5px",l.color="white",l.padding="4px",l.border="solid 1px",l.borderRadius="20px",l.background="lightgreen",l.position="absolute",l["z-index"]=e.zIndex===void 0?"5000005":e.zIndex,l.width="auto",l.height="auto",l.fontSize="14px",l.display="block",l.top="0px",l.left="0px",l["pointer-events"]="all",l.opacity=1,e.onContextMenu,n.innerText="",o.appendChild(n),this.setPos(e.x||0,e.y||0),this.setFillColor(e.fillColor),this.setBorderColor(e.fillColor),this.setText(e.text),e.onMouseOver&&n.addEventListener("mouseover",function(a){e.onMouseOver(a,r),a.preventDefault()}),e.onMouseLeave&&n.addEventListener("mouseleave",function(a){e.onMouseLeave(a,r),a.preventDefault()}),e.onMouseWheel&&n.addEventListener("wheel",function(a){e.onMouseWheel(a,r)}),e.onMouseDown&&n.addEventListener("mousedown",function(a){e.onMouseDown(a,r)}),e.onMouseClick&&n.addEventListener("click",function(a){e.onMouseClick(a,r)}),e.onTouchStart&&n.addEventListener("touchstart",function(a){e.onTouchStart(a,r)}),e.onMouseUp&&n.addEventListener("mouseup",function(a){e.onMouseUp(a,r)}),e.onMouseMove&&n.addEventListener("mousemove",function(a){e.onMouseMove(a,r)}),e.onContextMenu&&n.addEventListener("contextmenu",function(a){e.onContextMenu(a,r),a.preventDefault()})}return W(B,[{key:"setPos",value:function(r,e){this._x=r,this._y=e;var n=this._label.style;n.left=Math.round(r)-20+"px",n.top=Math.round(e)-12+"px"}},{key:"setPosOnWire",value:function(r,e,n,l){var a=r+(n-r)*.5,S=e+(l-e)*.5,T=this._label.style;T.left=Math.round(a)-20+"px",T.top=Math.round(S)-12+"px"}},{key:"setPosBetweenWires",value:function(r,e,n,l,a,S){var T=(r+n+a)/3,M=(e+l+S)/3,X=this._label.style;X.left=Math.round(T)-20+"px",X.top=Math.round(M)-12+"px"}},{key:"setText",value:function(r){this._label.innerHTML=this._prefix+(r||"")}},{key:"setFillColor",value:function(r){this._fillColor=r||"lightgreen",this._label.style.background=this._fillColor}},{key:"setBorderColor",value:function(r){this._borderColor=r||"white",this._label.style.border="solid 1px "+this._borderColor}},{key:"setOpacity",value:function(r){this._label.style.opacity=r}},{key:"setVisible",value:function(r){this._visible!==r&&(this._visible=!!r,this._label.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setCulled",value:function(r){this._culled!==r&&(this._culled=!!r,this._label.style.display=this._visible&&!this._culled?"block":"none")}},{key:"setHighlighted",value:function(r){this._highlighted!==r&&(this._highlighted=!!r,this._highlighted?this._label.classList.add(this._highlightClass):this._label.classList.remove(this._highlightClass))}},{key:"setClickable",value:function(r){this._label.style["pointer-events"]=r?"all":"none"}},{key:"destroy",value:function(){this._label.parentElement&&this._label.parentElement.removeChild(this._label)}}])}();function ys(B){var o=new Map;return B.forEach(function(r,e){if(r.clipGroup){var n=o.get(r.clipGroup);n||o.set(r.clipGroup,n=[]),n.push(e)}}),o}function eo(B,o){for(var r=new Map,e=[],n=0;n<o;n++){var l=B[n]&&B[n].clipGroup;l?(r.has(l)||r.set(l,r.size),e.push("box".concat(r.get(l),":").concat(l.mode))):e.push("cp")}return e.join("/")+";"}function Cr(B){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B.getNumAllocatedSectionPlanes(),r=B.sectionPlanes,e=[],n=0;n<o;n++)r[n]&&r[n].clipGroup||e.push("if (sectionPlaneActive".concat(n,") { dist += clamp(dot(-sectionPlaneDir").concat(n,".xyz, vWorldPosition.xyz - sectionPlanePos").concat(n,".xyz), 0.0, 1000.0); }"));var l=0,a=k(ys(r)),S;try{var T=function(){var X=w(S.value,2),Y=X[0],ee=X[1];if(ee.length!==6||ee.some(function(ge){return ge>=o}))return 1;var oe="boxDistance".concat(l++);e.push("if (".concat(ee.map(function(ge){return"sectionPlaneActive".concat(ge)}).join(" && "),") {")),ee.forEach(function(ge,ie){var xe="dot(-sectionPlaneDir".concat(ge,".xyz, vWorldPosition.xyz - sectionPlanePos").concat(ge,".xyz)");e.push(ie===0?"float ".concat(oe," = ").concat(xe,";"):"".concat(oe," = max(").concat(oe,", ").concat(xe,");"))}),e.push("if (".concat(oe," ").concat(Y.mode==="outside"?"<":">"," 0.0) { discard; }")),e.push("}")};for(a.s();!(S=a.n()).done;)T()}catch(M){a.e(M)}finally{a.f()}return e}function us(B,o,r){var e=o[r],n=o[r+1],l=o[r+2],a=function(Ee){return-(Ee.dir[0]*(e-Ee.pos[0])+Ee.dir[1]*(n-Ee.pos[1])+Ee.dir[2]*(l-Ee.pos[2]))},S=k(B),T;try{for(S.s();!(T=S.n()).done;){var M=T.value;if(!M.clipGroup&&M.active&&a(M)>0)return!0}}catch(xe){S.e(xe)}finally{S.f()}var X=k(ys(B)),Y;try{for(X.s();!(Y=X.n()).done;){var ee=w(Y.value,2),oe=ee[0],ge=ee[1];if(!(ge.length!==6||ge.some(function(xe){return!B[xe].active}))){var ie=Math.max.apply(Math,m(ge.map(function(xe){return a(B[xe])})));if(oe.mode==="outside"?ie<0:ie>0)return!0}}}catch(xe){X.e(xe)}finally{X.f()}return!1}function to(B,o){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3,e=o.length>r?r:3,n=Math.max(1,Math.floor(o.length/e)),l=0;l<n;l++)if(us(B,o,l*e))return!0;return!1}var Rn=V.vec3(),Cn=V.vec3(),Ci=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(O(this,o),e=R(this,o,[r.viewer.scene,n]),e.plugin=r,e._container=n.container,!e._container)throw"config missing: container";e._color=n.color?n.color:r.defaultColor,e._borderColor=r.defaultColor?r.defaultColor:"white";var l=e.plugin.viewer.scene;e._originMarker=new ln(l,n.origin),e._cornerMarker=new ln(l,n.corner),e._targetMarker=new ln(l,n.target),e._originWorld=V.vec3(),e._cornerWorld=V.vec3(),e._targetWorld=V.vec3(),e._wp=new Float64Array(12),e._vp=new Float64Array(12),e._pp=new Float64Array(12),e._cp=new Int16Array(6);var a=n.onMouseOver?function(ie){n.onMouseOver(ie,e),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseover",ie))}:null,S=n.onMouseLeave?function(ie){n.onMouseLeave(ie,e),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseleave",ie))}:null,T=n.onMouseClick?function(ie){n.onMouseClick(ie,e),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("click",ie))}:null,M=n.onTouchStart?function(ie){n.onTouchStart(ie,e),ie.preventDefault(),e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("touchstart",ie))}:null,X=n.onContextMenu?function(ie){n.onContextMenu(ie,e)}:null,Y=function(xe){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",xe))},ee=function(xe){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousedown",xe))},oe=function(xe){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mouseup",xe))},ge=function(xe){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent("mousemove",xe))};return e._originDot=new Yn(e._container,{fillColor:e._color,borderColor:e._borderColor,zIndex:r.zIndex!==void 0?r.zIndex+2:void 0,onMouseOver:a,onMouseLeave:S,onMouseWheel:Y,onMouseDown:ee,onMouseClick:T,onTouchStart:M,onMouseUp:oe,onMouseMove:ge,onContextMenu:X}),e._cornerDot=new Yn(e._container,{fillColor:e._color,borderColor:e._borderColor,zIndex:r.zIndex!==void 0?r.zIndex+2:void 0,onMouseOver:a,onMouseLeave:S,onMouseWheel:Y,onMouseDown:ee,onMouseClick:T,onTouchStart:M,onMouseUp:oe,onMouseMove:ge,onContextMenu:X}),e._targetDot=new Yn(e._container,{fillColor:e._color,borderColor:e._borderColor,zIndex:r.zIndex!==void 0?r.zIndex+2:void 0,onMouseOver:a,onMouseLeave:S,onMouseWheel:Y,onMouseDown:ee,onMouseClick:T,onTouchStart:M,onMouseUp:oe,onMouseMove:ge,onContextMenu:X}),e._originWire=new Wn(e._container,{color:e._color||"#0065FC",thickness:1,zIndex:r.zIndex,onMouseOver:a,onMouseLeave:S,onMouseWheel:Y,onMouseDown:ee,onMouseClick:T,onTouchStart:M,onMouseUp:oe,onMouseMove:ge,onContextMenu:X}),e._targetWire=new Wn(e._container,{color:e._color||"red",thickness:1,zIndex:r.zIndex!==void 0?r.zIndex+1:void 0,onMouseOver:a,onMouseLeave:S,onMouseWheel:Y,onMouseDown:ee,onMouseClick:T,onTouchStart:M,onMouseUp:oe,onMouseMove:ge,onContextMenu:X}),e._angleLabel=new Ri(e._container,{fillColor:e._color||"#0065FC",borderColor:e._borderColor,prefix:"",text:"",zIndex:r.zIndex!==void 0?r.zIndex+2:void 0,onMouseOver:a,onMouseLeave:S,onMouseWheel:Y,onMouseDown:ee,onMouseClick:T,onTouchStart:M,onMouseUp:oe,onMouseMove:ge,onContextMenu:X}),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(ie){e._originWorld.set(ie||[0,0,0]),e._wpDirty=!0,e._needUpdate(0)}),e._cornerMarker.on("worldPos",function(ie){e._cornerWorld.set(ie||[0,0,0]),e._wpDirty=!0,e._needUpdate(0)}),e._targetMarker.on("worldPos",function(ie){e._targetWorld.set(ie||[0,0,0]),e._wpDirty=!0,e._needUpdate(0)}),e._onViewMatrix=l.camera.on("viewMatrix",function(){e._vpDirty=!0,e._needUpdate(0)}),e._onProjMatrix=l.camera.on("projMatrix",function(){e._cpDirty=!0,e._needUpdate()}),e._onCanvasBoundary=l.canvas.on("boundary",function(){e._cpDirty=!0,e._needUpdate(0)}),e._onSectionPlaneUpdated=l.on("sectionPlaneUpdated",function(){e._sectionPlanesDirty=!0,e._needUpdate()}),e.precision=n.precision!==void 0?n.precision:2,e.approximate=n.approximate,e.visible=n.visible,e.originVisible=n.originVisible,e.cornerVisible=n.cornerVisible,e.targetVisible=n.targetVisible,e.originWireVisible=n.originWireVisible,e.targetWireVisible=n.targetWireVisible,e.angleVisible=n.angleVisible,e.labelsVisible=n.labelsVisible,e}return N(o,B),W(o,[{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&&(V.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 n=-.3,l=this._originMarker.viewPos[2],a=this._cornerMarker.viewPos[2],S=this._targetMarker.viewPos[2];if(l>n||a>n||S>n){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}V.transformPositions4(e.camera.project.matrix,this._vp,this._pp);for(var T=this._pp,M=this._cp,X=e.canvas.canvas,Y=X.getBoundingClientRect(),ee=this._container.getBoundingClientRect(),oe=Y.top-ee.top,ge=Y.left-ee.left,ie=e.canvas.boundary,xe=ie[2],Ee=ie[3],Me=0,Be=0,ke=T.length;Be<ke;Be+=4)M[Me]=ge+Math.floor((1+T[Be+0]/T[Be+3])*xe/2),M[Me+1]=oe+Math.floor((1-T[Be+1]/T[Be+3])*Ee/2),Me+=2;this._originDot.setPos(M[0],M[1]),this._cornerDot.setPos(M[2],M[3]),this._targetDot.setPos(M[4],M[5]),this._originWire.setStartAndEnd(M[0],M[1],M[2],M[3]),this._targetWire.setStartAndEnd(M[2],M[3],M[4],M[5]),this._angleLabel.setPosBetweenWires(M[0],M[1],M[2],M[3],M[4],M[5]),V.subVec3(this._originWorld,this._cornerWorld,Rn),V.subVec3(this._targetWorld,this._cornerWorld,Cn);var De=(Rn[0]!==0||Rn[1]!==0||Rn[2]!==0)&&(Cn[0]!==0||Cn[1]!==0||Cn[2]!==0);if(De){var Ie=this._approximate?" ":" = ";V.normalizeVec3(Rn),V.normalizeVec3(Cn);var Fe=Math.abs(V.angleVec3(Rn,Cn));this._angle=Fe/V.DEGTORAD,this._angleLabel.setText(Ie+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){return to(this.scene._sectionPlanesState.sectionPlanes,e,4)}},{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 n=this._visible&&this._labelsVisible;this._angleLabel.setVisible(n),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(),$(o,"destroy",this)([])}}])}(At),Nn=function(B){function o(){return O(this,o),R(this,o,arguments)}return N(o,B),W(o,[{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(){}}])}(At),vo=0,Cs=1,yo=2,xa=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O(this,o),e=R(this,o,[r.viewer.scene]),e.cfg=n,e._canvasToPagePos=n.canvasToPagePos,e.pointerLens=n.pointerLens,e._active=!1,e._activate=!1,e._mouseState=vo,e._currentAngleMeasurement=null,e._initMarkerDiv(),e._onInputMouseDown=null,e._onInputMouseUp=null,e._snapping=!!n.snapping,e._mouseState=vo,e._attachPlugin(r,n),e._offsetX=n._offsetX|0,e._offsetY=n._offsetY|0,e}return N(o,B),W(o,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myAnglePivotMarker");var n=this.scene.canvas.canvas;n.parentNode.insertBefore(e,n),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 n=this.angleMeasurementsPlugin,l=!1;n.on("mouseOver",function(Be){l=!0}),n.on("mouseLeave",function(Be){l=!1}),n.on("measureDelete",function(Be){l=!1});var a=this.scene,S=a.canvas.canvas,T=20,M=n.viewer.cameraControl,X=this.pointerLens,Y=!1,ee=null,oe=0,ge=0,ie=V.vec3(),xe=V.vec2();this._currentAngleMeasurement=null;var Ee=function(ke){if(e._active&&!l){ke.snappedToVertex||ke.snappedToEdge?(X&&(X.visible=!0,X.canvasPos=ke.canvasPos,X.snappedCanvasPos=ke.snappedCanvasPos||ke.canvasPos,X.snapped=!0),e.markerDiv.style.background="greenyellow",e.markerDiv.style.border="2px solid green"):(X&&(X.visible=!0,X.canvasPos=ke.canvasPos,X.snappedCanvasPos=ke.canvasPos,X.snapped=!1),e.markerDiv.style.background="pink",e.markerDiv.style.border="2px solid red");var De=ke.snappedCanvasPos||ke.canvasPos;switch(Y=!0,ee=ke.entity,ie.set(ke.worldPos),xe.set(De),S.style.cursor="pointer",e._mouseState){case vo:var Ie=document.documentElement.scrollLeft,Fe=document.documentElement.scrollTop,Ne=Ie,$e=Fe;e.markerDiv.style.marginLeft="".concat(e._offsetX+Ne+De[0]-5,"px"),e.markerDiv.style.marginTop="".concat(e._offsetY+$e+De[1]-5,"px");break;case Cs:e._currentAngleMeasurement&&(e._currentAngleMeasurement.originWireVisible=!0,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.cornerVisible=!0,e._currentAngleMeasurement.angleVisible=!1,e._currentAngleMeasurement.corner.worldPos=ke.worldPos,e._currentAngleMeasurement.corner.entity=ke.entity),e.markerDiv.style.marginLeft="-10000px",e.markerDiv.style.marginTop="-10000px",S.style.cursor="pointer";break;case yo:e._currentAngleMeasurement&&(e._currentAngleMeasurement.targetWireVisible=!0,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.target.worldPos=ke.worldPos,e._currentAngleMeasurement.target.entity=ke.entity),e.markerDiv.style.marginLeft="-10000px",e.markerDiv.style.marginTop="-10000px",S.style.cursor="pointer";break}}};this._onHoverSnapOrSurface=M.on("hoverSnapOrSurface",function(Be){e._snapping&&Ee(Be)}),this._onHoverSurface=M.on("hoverSurface",function(Be){e._snapping||Ee(Be)}),S.addEventListener("mousedown",this._onMouseDown=function(Be){e._active&&Be.which===1&&(oe=Be.clientX,ge=Be.clientY)}),S.addEventListener("mouseup",this._onMouseUp=function(Be){if(e._active&&!l&&Be.which===1&&!(Be.clientX>oe+T||Be.clientX<oe-T||Be.clientY>ge+T||Be.clientY<ge-T))switch(e._mouseState){case vo:Y&&(e._currentAngleMeasurement=n.createMeasurement({id:V.createUUID(),origin:{worldPos:ie,entity:ee},corner:{worldPos:ie,entity:ee},target:{worldPos:ie,entity:ee},precision:n.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=ee,e._mouseState=Cs,n.fire("measurementStart",e._currentAngleMeasurement));break;case Cs:Y?(e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.corner.entity=ee,e._mouseState=yo):e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null,ee=null,e._mouseState=vo,n.fire("measurementCancel",e._currentAngleMeasurement));break;case yo:Y?(e._currentAngleMeasurement.targetVisible=!0,e._currentAngleMeasurement.angleVisible=!0,e._currentAngleMeasurement.target.entity=ee,e._currentAngleMeasurement.clickable=!0,ee=null,n.fire("measurementEnd",e._currentAngleMeasurement),e._currentAngleMeasurement=null,e._mouseState=vo):e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null,ee=null,e._mouseState=vo,n.fire("measurementCancel",e._currentAngleMeasurement));break}}),this.markerHidden=function(Be){e.markerDiv&&Be.target!==S&&(e.markerDiv.style.marginLeft="-100px",e.markerDiv.style.marginTop="-100px")},document.addEventListener("mousemove",this.markerHidden);var Me=function(ke){if(e._active&&!l){if(Y=!1,X&&(X.visible=!0,X.pointerPos=ke.canvasPos,X.snappedCanvasPos=ke.snappedCanvasPos||ke.canvasPos,X.snapped=!1),e.markerDiv.style.marginLeft="-100px",e.markerDiv.style.marginTop="-100px",e._currentAngleMeasurement){switch(e._mouseState){case vo:e._currentAngleMeasurement.originVisible=!1;break;case Cs:e._currentAngleMeasurement.cornerVisible=!1,e._currentAngleMeasurement.originWireVisible=!1,e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1;break;case yo:e._currentAngleMeasurement.targetVisible=!1,e._currentAngleMeasurement.targetWireVisible=!1,e._currentAngleMeasurement.angleVisible=!1;break}S.style.cursor="default"}S.style.cursor="default"}};this._onHoverSnapOrSurfaceOff=M.on("hoverSnapOrSurfaceOff",function(Be){e._snapping&&Me(Be)}),this._onHoverOff=M.on("hoverOff",function(Be){e._snapping||Me(Be)}),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 n=this.angleMeasurementsPlugin.viewer.cameraControl;n.off(this._onHoverSnapOrSurface),n.off(this._onHoverSurface),n.off(this._onHoverSnapOrSurfaceOff),n.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=vo)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),this.pointerLens&&this.pointerLens.destroy(),$(o,"destroy",this)([])}}])}(Nn),Au=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O(this,o),e=R(this,o,["AngleMeasurements",r]),e._container=n.container||r.viewerElement||document.body,e._defaultControl=null,e._measurements={},e.defaultColor=n.defaultColor!==void 0?n.defaultColor:"#0065fc",e.defaultLabelsVisible=n.defaultLabelsVisible!==!1,e.zIndex=n.zIndex||1e4,e.precision=n.precision!==void 0?n.precision:2,e._onMouseOver=function(l,a){e.fire("mouseOver",{plugin:e,angleMeasurement:a,measurement:a,event:l})},e._onMouseLeave=function(l,a){e.fire("mouseLeave",{plugin:e,angleMeasurement:a,measurement:a,event:l})},e._onMouseClick=function(l,a){e.fire("clickMeasure",{plugin:e,angleMeasurement:a,measurement:a,event:l})},e._onTouchStart=function(l,a){e.fire("touchMeasure",{plugin:e,angleMeasurement:a,measurement:a,event:l})},e._onContextMenu=function(l,a){e.fire("contextMenu",{plugin:e,angleMeasurement:a,measurement:a,event:l})},e}return N(o,B),W(o,[{key:"precision",get:function(){return this._precision},set:function(e){if(this._precision!=e&&(this._precision=e,this.measureNum>0))for(var n in this.measurements)this.measurements[n].precision=e}},{key:"measureNum",get:function(){return Object.keys(this.measurements).length}},{key:"getContainerElement",value:function(){return this._container}},{key:"send",value:function(e,n){}},{key:"control",get:function(){return this._defaultControl||(this._defaultControl=new xa(this,{})),this._defaultControl}},{key:"measurements",get:function(){return this._measurements}},{key:"createMeasurement",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.viewer.scene.components[n.id]&&(this.error("Viewer scene component with this ID already exists: "+n.id),delete n.id);var l=n.origin,a=n.corner,S=n.target,T=new Ci(this,{id:n.id,plugin:this,container:this._container,origin:{entity:l.entity,worldPos:l.worldPos},corner:{entity:a.entity,worldPos:a.worldPos},target:{entity:S.entity,worldPos:S.worldPos},borderColor:n.borderColor,color:n.color,visible:n.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[T.id]=T,T.on("destroyed",function(){delete e._measurements[T.id]}),T.clickable=!0,this.fire("measurementCreated",T),T}},{key:"destroyMeasurement",value:function(e){var n=this._measurements[e];if(!n){this.log("AngleMeasurement not found: "+e);return}n.destroy(),this.fire("measurementDestroyed",n)}},{key:"setLabelsShown",value:function(e){for(var n=0,l=Object.entries(this.measurements);n<l.length;n++){var a=w(l[n],2);a[0];var S=a[1];S.labelShown=e}}},{key:"setMeasurementsShown",value:function(e){for(var n in this.measurements)this.measurements[n].visible=e}},{key:"clear",value:function(){for(var e=Object.keys(this._measurements),n=0,l=e.length;n<l;n++)this.destroyMeasurement(e[n])}},{key:"destroy",value:function(){this.clear(),$(o,"destroy",this)([])}}])}(Ye),gu=function(){function B(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,B),this.viewer=o,this.scene=this.viewer.scene,this._circleDiv=document.createElement("div"),this._circleDiv.id=r.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=r.active!==!1,this._visible=!1,this._running=!1,this._destroyed=!1}return W(B,[{key:"start",value:function(r){var e=this;if(!this._destroyed){this._circlePos=r,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 n=this._circleMaxRadius,l=2,a,S=300,T=function(X){if(e._running){a||(a=X);var Y=X-a,ee=Math.min(Y/S,1),oe=n+(l-n)*ee;e._circleRadius=oe,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"),ee<1&&requestAnimationFrame(T)}};this._running=!0,requestAnimationFrame(T),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(r){this.stop(),this._durationMs=r}},{key:"destroy",value:function(){this._destroyed||(this.stop(),this._circleDiv&&this._circleDiv.parentNode.removeChild(this._circleDiv),this._destroyed=!0)}}])}(),xs=0,Ea=1,vu=2,xl=3,Ld=4,El=5,Bl=6,Rh=7,Sl=8,dc=7,EEe=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O(this,o),e=R(this,o,[r.viewer.scene]),e.pointerLens=n.pointerLens,e.pointerCircle=new gu(r.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=n.snapping!==!1,e._snapToEdge=n.snapping!==!1,e._snapToVertex=n.snapping!==!1,e._touchState=xs,e._attachPlugin(r,n),e._offsetX=n._offsetX|0,e._offsetY=n._offsetY|0,e}return N(o,B),W(o,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myAngleMeasureTouchMarker");var n=this.scene.canvas.canvas;n.parentNode.insertBefore(e,n),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 n=this.plugin,l=this.scene,a=l.canvas.canvas;n.pointerLens;var S=V.vec3(),T=20,M=null;this._touchState=xs;var X=V.vec2(),Y=V.vec2(),ee=V.vec2(),oe=null,ge=function(){e.plugin.viewer.cameraControl.active=!1},ie=function(){e.plugin.viewer.cameraControl.active=!0},xe=function(){M&&(clearTimeout(M),M=null),e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),ie(),e._touchState=xs};a.addEventListener("touchstart",this._onCanvasTouchStart=function(Ee){if(e._active&&Ee.isTrusted){var Me=Ee.touches.length;if(Me!==1){M&&(clearTimeout(M),M=null);return}var Be=Ee.touches[0],ke=Be.clientX,De=Be.clientY;switch(X.set([ke+e.offsetX,De+e.offsetY]),Y.set([ke+e.offsetX,De+e.offsetY]),e._touchState){case xs:if(Me!==1&&M!==null){xe();return}var Ie=l.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping});if(Ie&&Ie.snapped)S.set(Ie.worldPos),e.pointerCircle.start(Ie.snappedCanvasPos);else{var Fe=l.pick({canvasPos:Y,pickSurface:!0});if(Fe&&Fe.worldPos)S.set(Fe.worldPos),e.pointerCircle.start(Fe.canvasPos);else return}M=setTimeout(function(){Me!==1||Y[0]>X[0]+T||Y[0]<X[0]-T||Y[1]>X[1]+T||Y[1]<X[1]-T||(e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=X,e.pointerLens.cursorPos=X),e.pointerLens&&(e.pointerLens.canvasPos=Y,e.pointerLens.snapped=!1),e.pointerLens&&(e.pointerLens.cursorPos=Ie.canvasPos,e.pointerLens.snapped=!0),e._currentAngleMeasurement?e._currentAngleMeasurement.origin.worldPos=S:(e._currentAngleMeasurement=n.createMeasurement({id:V.createUUID(),origin:{worldPos:Ie.worldPos,entity:Ie.entity},corner:{worldPos:Ie.worldPos,entity:Ie.entity},target:{worldPos:Ie.worldPos,entity:Ie.entity},precision:n.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),n.fire("measurementStart",e._currentAngleMeasurement),e._touchState=vu,ge())},e._longTouchTimeoutMs),e._touchState=Ea,oe=Be.identifier;break;case xl:if(Me!==1&&M!==null){clearTimeout(M),M=null;return}Me===1&&(M=setTimeout(function(){if(M=null,!(Me!==1||Y[0]>X[0]+T||Y[0]<X[0]-T||Y[1]>X[1]+T||Y[1]<X[1]-T)){e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=X,e.pointerLens.snapped=!1);var Ne=l.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping});if(Ne&&Ne.snapped)e.pointerLens&&(e.pointerLens.cursorPos=Ne.snappedCanvasPos,e.pointerLens.snapped=!0),e.pointerCircle.start(Ne.snappedCanvasPos),S.set(Ne.worldPos),e._currentAngleMeasurement.corner.worldPos=Ne.worldPos,e._currentAngleMeasurement.corner.entity=Ne.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 $e=l.pick({canvasPos:Y,pickSurface:!0});$e&&$e.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=$e.canvasPos,e.pointerLens.snapped=!1),e.pointerCircle.start($e.canvasPos),S.set($e.worldPos),e._currentAngleMeasurement.corner.worldPos=$e.worldPos,e._currentAngleMeasurement.corner.entity=$e.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=El,ge()}},e._longTouchTimeoutMs),e._touchState=Ld),oe=Be.identifier;break;case Bl:if(Me!==1&&M!==null){clearTimeout(M),M=null;return}Me===1&&(M=setTimeout(function(){if(M=null,!(Me!==1||Y[0]>X[0]+T||Y[0]<X[0]-T||Y[1]>X[1]+T||Y[1]<X[1]-T)){e.pointerLens&&(e.pointerLens.visible=!0,e.pointerLens.canvasPos=X,e.pointerLens.snapped=!1);var Ne=l.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping});if(Ne&&Ne.snapped)e.pointerLens&&(e.pointerLens.cursorPos=Ne.snappedCanvasPos,e.pointerLens.snapped=!0),e.pointerCircle.start(Ne.snappedCanvasPos),S.set(Ne.worldPos),e._currentAngleMeasurement.target.worldPos=Ne.worldPos,e._currentAngleMeasurement.target.entity=Ne.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 $e=l.pick({canvasPos:Y,pickSurface:!0});$e&&$e.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=$e.canvasPos,e.pointerLens.snapped=!1),e.pointerCircle.start($e.canvasPos),S.set($e.worldPos),e._currentAngleMeasurement.target.worldPos=$e.worldPos,e._currentAngleMeasurement.target.entity=$e.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,n.fire("measurementStart",e._currentAngleMeasurement)):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)}e._touchState=Sl,ge()}},e._longTouchTimeoutMs),e._touchState=Rh),oe=Be.identifier;break;default:M!==null&&(clearTimeout(M),M=null),e._touchState=dc;return}}},{passive:!0}),a.addEventListener("touchmove",function(Ee){if(e._active){e.pointerCircle.stop();var Me=Ee.touches.length;if(Me!==1||Ee.changedTouches.length!==1){M&&(clearTimeout(M),M=null);return}var Be=Ee.touches[0],ke=Be.clientX,De=Be.clientY;if(Be.identifier===oe){Y.set([ke+e.offsetX,De+e.offsetY]);var Ie,Fe;switch(e._touchState){case vu:e.pointerLens&&(e.pointerLens.canvasPos=Y),Ie=l.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping}),Ie&&Ie.snapped?(e.pointerLens&&(e.pointerLens.snappedCanvasPos=Ie.snappedCanvasPos,e.pointerLens.snapped=!0),S.set(Ie.worldPos),e._currentAngleMeasurement.origin.worldPos=Ie.worldPos):(Fe=l.pick({canvasPos:Y,pickSurface:!0}),Fe&&Fe.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=Fe.canvasPos,e.pointerLens.snapped=!1),S.set(Fe.worldPos),e._currentAngleMeasurement.origin.worldPos=Fe.worldPos):e.pointerLens&&(e.pointerLens.cursorPos=null,e.pointerLens.snapped=!1)),e._touchState=vu;break;case El:if(Me!==1&&M!==null){clearTimeout(M),M=null,e.pointerLens&&(e.pointerLens.visible=!1),e._touchState=dc;return}e.pointerLens&&(e.pointerLens.canvasPos=Y),Ie=l.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping}),Ie&&Ie.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=Ie.snappedCanvasPos,e.pointerLens.snapped=!0),e._currentAngleMeasurement.corner.worldPos=Ie.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=l.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=El;break;case Sl:if(Me!==1&&M!==null){clearTimeout(M),M=null,e.pointerLens&&(e.pointerLens.visible=!1),e._touchState=dc;return}e.pointerLens&&(e.pointerLens.canvasPos=Y),Ie=l.pick({canvasPos:Y,snapToVertex:e._snapping,snapToEdge:e._snapping}),Ie&&Ie.worldPos?(e.pointerLens&&(e.pointerLens.cursorPos=Ie.snappedCanvasPos,e.pointerLens.snapped=!0),e._currentAngleMeasurement.target.worldPos=Ie.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=l.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=Sl;break}}}},{passive:!0}),a.addEventListener("touchend",this._onCanvasTouchEnd=function(Ee){if(e._active){e.pointerCircle.stop();var Me=Ee.changedTouches.length;if(Me===1){var Be=Ee.changedTouches[0],ke=Be.clientX,De=Be.clientY;if(Be.identifier===oe)switch(M&&(clearTimeout(M),M=null),ee.set([ke,De]),e._touchState){case Ea:{if(Me!==1||ke>X[0]+T||ke<X[0]-T||De>X[1]+T||De<X[1]-T){e._touchState=xs;return}var Ie=l.pick({canvasPos:Y,pickSurface:!0});Ie&&Ie.worldPos?(e._currentAngleMeasurement=n.createMeasurement({id:V.createUUID(),origin:{worldPos:Ie.worldPos},corner:{worldPos:Ie.worldPos},target:{worldPos:Ie.worldPos},precision:n.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=xl):(e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=xs)}ie();break;case vu:e.pointerLens&&(e.pointerLens.visible=!1),e._currentAngleMeasurement?e._touchState=xl:(e.pointerLens&&(e.pointerLens.snapped=!1,e.pointerLens.visible=!1),e._touchState=xs),ie();break;case Ld:{if(Me!==1||ke>X[0]+T||ke<X[0]-T||De>X[1]+T||De<X[1]-T){e._touchState=xl;return}var Fe=l.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=Bl):(e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=xs)}ie();break;case El:e.pointerLens&&(e.pointerLens.visible=!1),e._touchState=Bl,ie();break;case Rh:{if(Me!==1||ke>X[0]+T||ke<X[0]-T||De>X[1]+T||De<X[1]-T){e._touchState=Bl;return}var Ne=l.pick({canvasPos:Y,pickSurface:!0});Ne&&Ne.worldPos?(e._currentAngleMeasurement.target.worldPos=Ne.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=xs}ie();break;case Sl:e.pointerLens&&(e.pointerLens.visible=!1),!e._currentAngleMeasurement||!e._currentAngleMeasurement.targetVisible?(e._currentAngleMeasurement&&(e._currentAngleMeasurement.destroy(),e._currentAngleMeasurement=null),e._touchState=xs):(e._currentAngleMeasurement.clickable=!0,e.angleMeasurementsPlugin.fire("measurementEnd",e._currentAngleMeasurement),e._currentAngleMeasurement=null,e._touchState=xs),ie();break}}}},{passive:!0}),a.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(),$(o,"destroy",this)([])}}])}(Nn),fc=0,$A=1,GA=2,BEe=function(B){function o(r){var e,n,l,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O(this,o),l=R(this,o,[r.viewer.scene]),l.cfg=a,l.snapRadius=a.snapRadius,l._active=!1,l._mouseState=fc,l._currentAngleMeasurement=null,l.angleMeasurementsPlugin=r,l.plugin=r,l._initMarkerDiv(),l._snapping=a.snapping!==!1,l._offsetX=(e=a._offsetX)!==null&&e!==void 0?e:0,l._offsetY=(n=a._offsetY)!==null&&n!==void 0?n:0,l.hover=!1,l.angleMeasurementsPlugin.on("mouseOver",function(S){l.hover=!0}),l.angleMeasurementsPlugin.on("mouseLeave",function(S){l.hover=!1}),l.angleMeasurementsPlugin.on("measureDelete",function(S){l.hover=!1}),l}return N(o,B),W(o,[{key:"_initMarkerDiv",value:function(){var e=document.createElement("div");e.setAttribute("id","myAnglePivotMarker");var n=this.scene.canvas.canvas;n.parentNode.insertBefore(e,n),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=V.vec3(),this.pointerCanvasPos=V.vec2(),this._currentAngleMeasurement=null,this.markerHidden=function(n){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 n;if(this._active){this.pointerCanvasPos.set(e);var l=this.scene.pick({canvasPos:this.pointerCanvasPos,snapToVertex:!0,snapToEdge:!0,snapRadius:(n=this.snapRadius)!==null&&n!==void 0?n:20});if(l){this.mouseHovering=!0,this.hoveredEntity=l.entity,this.pointerWorldPos.set(l.worldPos);var a=document.documentElement.scrollLeft,S=document.documentElement.scrollTop,T=a,M=S;if(this._markerDiv.style.marginLeft="".concat(this._offsetX+T+e[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+M+e[1]-5,"px"),this._markerDiv.style.background="pink",this._markerDiv.style.border="2px solid orangered",l.snappedCanvasPos){var X=l.snappedCanvasPos;this._markerDiv.style.marginLeft="".concat(this._offsetX+T+X[0]-5,"px"),this._markerDiv.style.marginTop="".concat(this._offsetY+M+X[1]-5,"px")}switch(l.snappedToVertex&&(this._markerDiv.style.background="greenyellow",this._markerDiv.style.border="2px solid forestgreen"),l.snappedToEdge&&(this._markerDiv.style.background="lightblue",this._markerDiv.style.border="2px solid royalblue"),this._mouseState){case fc:case $A:this._currentAngleMeasurement&&(this._currentAngleMeasurement.originWireVisible=!0,this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.cornerVisible=!0,this._currentAngleMeasurement.angleVisible=!1,this._currentAngleMeasurement.corner.worldPos=l.worldPos,this._currentAngleMeasurement.corner.entity=l.entity);break;case GA:this._currentAngleMeasurement&&(this._currentAngleMeasurement.targetWireVisible=!0,this._currentAngleMeasurement.targetVisible=!0,this._currentAngleMeasurement.angleVisible=!0,this._currentAngleMeasurement.target.worldPos=l.worldPos,this._currentAngleMeasurement.target.entity=l.entity);break}}else if(this.mouseHovering=!0,this._markerDiv.style.marginLeft="-10000px",this._markerDiv.style.marginTop="-10000px",this._currentAngleMeasurement)switch(this._mouseState){case fc:this._currentAngleMeasurement.originVisible=!1;break;case $A:this._currentAngleMeasurement.cornerVisible=!1,this._currentAngleMeasurement.originWireVisible=!1,this._currentAngleMeasurement.targetVisible=!1,this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.angleVisible=!1;break;case GA: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 fc:this.mouseHovering&&(this._currentAngleMeasurement=this.angleMeasurementsPlugin.createMeasurement({id:V.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=$A,this.angleMeasurementsPlugin.fire("measurementStart",this._currentAngleMeasurement));break;case $A:this.mouseHovering?(this._currentAngleMeasurement.targetWireVisible=!1,this._currentAngleMeasurement.targetVisible=!0,this._currentAngleMeasurement.angleVisible=!0,this._currentAngleMeasurement.corner.entity=this.hoveredEntity,this._mouseState=GA):this._currentAngleMeasurement&&(this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null,this.hoveredEntity=null,this._mouseState=fc,this.angleMeasurementsPlugin.fire("measurementCancel",this._currentAngleMeasurement));break;case GA: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=fc):this._currentAngleMeasurement&&(this._currentAngleMeasurement.destroy(),this._currentAngleMeasurement=null,this.hoveredEntity=null,this._mouseState=fc,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=fc)}},{key:"destroy",value:function(){this.deactivate(),this._destroyMarkerDiv(),$(o,"destroy",this)([])}}])}(Nn),SEe=function(B){function o(r,e){var n;if(O(this,o),n=R(this,o,[r,e]),n.plugin=e.plugin,n._container=e.container,!n._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 n._htmlDirty=!1,e.markerElement?(n._marker=e.markerElement,n._marker.addEventListener("click",n._onMouseClickedExternalMarker=function(){n.plugin.fire("markerClicked",n)}),n._marker.addEventListener("dblclick",n._onMouseDblClickedExternalMarker=function(){n.plugin.fire("markerDoubleClicked",n)}),n._marker.addEventListener("mouseenter",n._onMouseEnterExternalMarker=function(){n.plugin.fire("markerMouseEnter",n)}),n._marker.addEventListener("mouseleave",n._onMouseLeaveExternalMarker=function(){n.plugin.fire("markerMouseLeave",n)}),n._markerExternal=!0):(n._markerHTML=e.markerHTML,n._htmlDirty=!0,n._markerExternal=!1),e.labelElement?(n._label=e.labelElement,n._label.addEventListener("click",function(){n.plugin.fire("labelClicked",n)}),n._labelExternal=!0):(n._labelHTML=e.labelHTML,n._htmlDirty=!0,n._labelExternal=!1),n._markerShown=!!e.markerShown,n._labelShown=!!e.labelShown,n._labelPlacement=e.labelPlacement||"right",n._labelOffset=e.labelOffset||null,n._values=e.values||{},n._layoutDirty=!0,n._visibilityDirty=!0,n._buildHTML(),n._onTick=n.scene.on("tick",function(){n._htmlDirty&&(n._buildHTML(),n._htmlDirty=!1,n._layoutDirty=!0,n._visibilityDirty=!0),(n._layoutDirty||n._visibilityDirty)&&(n._markerShown||n._labelShown)&&(n._updatePosition(),n._layoutDirty=!1),n._visibilityDirty&&(n._marker.style.visibility=n.visible&&n._markerShown?"visible":"hidden",n._label.style.visibility=n.visible&&n._markerShown&&n._labelShown?"visible":"hidden",n._visibilityDirty=!1)}),n.on("canvasPos",function(){n._layoutDirty=!0}),n.on("visible",function(){n._visibilityDirty=!0}),n.setMarkerShown(e.markerShown!==!1),n.setLabelShown(e.labelShown),n.eye=e.eye?e.eye.slice():null,n.look=e.look?e.look.slice():null,n.up=e.up?e.up.slice():null,n.projection=e.projection,n}return N(o,B),W(o,[{key:"_buildHTML",value:function(){var e=this;if(!this._markerExternal){this._marker&&(this._container.removeChild(this._marker),this._marker=null);var n=this._markerHTML||"<p></p>";at.isArray(n)&&(n=n.join("")),n=this._renderTemplate(n.trim());var l=document.createRange().createContextualFragment(n);this._marker=l.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(T){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",T))})}if(!this._labelExternal){this._label&&(this._container.removeChild(this._label),this._label=null);var a=this._labelHTML||"<p></p>";at.isArray(a)&&(a=a.join("")),a=this._renderTemplate(a.trim());var S=document.createRange().createContextualFragment(a);this._label=S.firstChild,this._container.appendChild(this._label),this._label.style.visibility=this._markerShown&&this._labelShown?"visible":"hidden",this._label.addEventListener("click",function(){e.plugin.fire("labelClicked",e)}),this._label.addEventListener("wheel",function(T){e.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent("wheel",T))})}}},{key:"_updatePosition",value:function(){var e=this.scene.canvas.boundary,n=e[0],l=e[1],a=this.canvasPos,S=this._labelOffset||{},T=S.x||0,M=S.y||0;if(this._marker.style.left=Math.floor(n+a[0])-12+"px",this._marker.style.top=Math.floor(l+a[1])-12+"px",this._marker.style["z-index"]=90005+Math.floor(this._viewPos[2])+1,this._labelPlacement==="above"){var X=this._label.offsetWidth||0,Y=this._label.offsetHeight||0;this._label.style.left=Math.floor(n+a[0]-X/2+T)+"px",this._label.style.top=Math.floor(l+a[1]-12-Y-4+M)+"px"}else{var ee=20+T,oe=-17+M;this._label.style.left=20+Math.floor(n+a[0]+ee)+"px",this._label.style.top=Math.floor(l+a[1]+oe)+"px"}this._label.style["z-index"]=90005+Math.floor(this._viewPos[2])+1}},{key:"_renderTemplate",value:function(e){for(var n in this._values)if(this._values.hasOwnProperty(n)){var l=this._values[n];e=e.replace(new RegExp("{{"+n+"}}","g"),l)}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:"labelOffset",get:function(){return this._labelOffset},set:function(e){this._labelOffset=e||null,this._layoutDirty=!0}},{key:"setField",value:function(e,n){this._values[e]=n||"",this._htmlDirty=!0}},{key:"getField",value:function(e){return this._values[e]}},{key:"setValues",value:function(e){for(var n in e)if(e.hasOwnProperty(n)){var l=e[n];this.setField(n,l)}}},{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),$(o,"destroy",this)([])}}])}(ln),kEe=V.vec3(),PEe=V.vec3(),MEe=V.vec3(),TEe=function(B){function o(r,e){var n;return O(this,o),n=R(this,o,["Annotations",r]),n._labelHTML=e.labelHTML||"<div></div>",n._markerHTML=e.markerHTML||"<div></div>",n._container=e.container||document.body,n._values=e.values||{},n.annotations={},n.surfaceOffset=e.surfaceOffset,n._labelPlacement=e.labelPlacement,n._labelOffset=e.labelOffset,n}return N(o,B),W(o,[{key:"getContainerElement",value:function(){return this._container}},{key:"send",value:function(e,n){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 n=this;this.viewer.scene.components[e.id]&&(this.error("Viewer component with this ID already exists: "+e.id),delete e.id);var l,a;if(e.pickResult=e.pickResult||e.pickRecord,e.pickResult){var S=e.pickResult;if(!S.worldPos||!S.worldNormal)this.error("Param 'pickResult' does not have both worldPos and worldNormal");else{var T=V.normalizeVec3(S.worldNormal,kEe),M=V.mulVec3Scalar(T,this._surfaceOffset,PEe),X=V.addVec3(S.worldPos,M,MEe);l=X,a=S.entity}}else l=e.worldPos,a=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 ee=null;e.labelElementId&&(ee=document.getElementById(e.labelElementId),ee||this.error("Can't find DOM element for 'labelElementId' value '"+e.labelElementId+"' - defaulting to internally-generated empty DIV"));var oe=new SEe(this.viewer.scene,{id:e.id,plugin:this,entity:a,worldPos:l,container:this._container,markerElement:Y,labelElement:ee,markerHTML:e.markerHTML||this._markerHTML,labelHTML:e.labelHTML||this._labelHTML,labelPlacement:e.labelPlacement||this._labelPlacement,labelOffset:e.labelOffset||this._labelOffset,occludable:e.occludable,values:at.apply(e.values,at.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[oe.id]=oe,oe.on("destroyed",function(){delete n.annotations[oe.id],n.fire("annotationDestroyed",oe.id)}),this.fire("annotationCreated",oe.id),oe}},{key:"destroyAnnotation",value:function(e){var n=this.annotations[e];if(!n){this.log("Annotation not found: "+e);return}n.destroy()}},{key:"setAllVisible",value:function(e){for(var n in this.annotations)this.annotations[n].setMarkerShown(e)}},{key:"clear",value:function(){for(var e=Object.keys(this.annotations),n=0,l=e.length;n<l;n++)this.destroyAnnotation(e[n])}},{key:"destroy",value:function(){this.clear(),$(o,"destroy",this)([])}}])}(Ye),IEe=V.vec3(),DEe=V.vec3(),REe=V.mat4(),yu=function(){function B(){O(this,B),this.normal=V.vec3(),this.offset=0,this.testVertex=V.vec3()}return W(B,[{key:"set",value:function(r,e,n,l){var a=1/Math.sqrt(r*r+e*e+n*n);this.normal[0]=r*a,this.normal[1]=e*a,this.normal[2]=n*a,this.offset=l*a,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}}])}(),ro=W(function B(){O(this,B),this.planes=[new yu,new yu,new yu,new yu,new yu,new yu]});ro.INSIDE=0,ro.INTERSECT=1,ro.OUTSIDE=2;function N3(B,o,r){var e=V.mulMat4(r,o,REe),n=e[0],l=e[1],a=e[2],S=e[3],T=e[4],M=e[5],X=e[6],Y=e[7],ee=e[8],oe=e[9],ge=e[10],ie=e[11],xe=e[12],Ee=e[13],Me=e[14],Be=e[15];B.planes[0].set(S-n,Y-T,ie-ee,Be-xe),B.planes[1].set(S+n,Y+T,ie+ee,Be+xe),B.planes[2].set(S-l,Y-M,ie-oe,Be-Ee),B.planes[3].set(S+l,Y+M,ie+oe,Be+Ee),B.planes[4].set(S-a,Y-X,ie-ge,Be-Me),B.planes[5].set(S+a,Y+X,ie+ge,Be+Me)}function O3(B,o){var r=ro.INSIDE,e=IEe,n=DEe;e[0]=o[0],e[1]=o[1],e[2]=o[2],n[0]=o[3],n[1]=o[4],n[2]=o[5];for(var l=[e,n],a=0;a<6;++a){var S=B.planes[a];if(S.normal[0]*l[S.testVertex[0]][0]+S.normal[1]*l[S.testVertex[1]][1]+S.normal[2]*l[S.testVertex[2]][2]+S.offset<0)return ro.OUTSIDE;S.normal[0]*l[1-S.testVertex[0]][0]+S.normal[1]*l[1-S.testVertex[1]][1]+S.normal[2]*l[1-S.testVertex[2]][2]+S.offset<0&&(r=ro.INTERSECT)}return r}var FEe=function(){function B(o,r){O(this,B),this.primLODLevels=o,this.entitiesInLOD={},this.primCountInLOD={},this.targetFps=r,this.lodLevelIndex=0,this.consecutiveFramesWithTargetFps=0,this.consecutiveFramesWithoutTargetFps=0}return W(B,[{key:"initializeLodState",value:function(r){var e=Object.values(r.objects);if(e.length!==0){for(var n={},l={},a=0,S=e.length;a<S;a++){var T=e[a];T.numPrimitives,V.getAABB3Diag(T.aabb);var M=0,X=void 0;for(M=0,X=this.primLODLevels.length;M<X&&!(T.numPrimitives>=this.primLODLevels[M]);M++);var Y=this.primLODLevels[M]||0;Y in n||(n[Y]=[]),n[Y].push(T),Y in l||(l[Y]=0),l[Y]+=T.numPrimitives}this.entitiesInLOD=n,this.primCountInLOD=l}}}])}(),NEe=function(){function B(o,r,e,n){O(this,B),this.id=r.id,this.scene=o,this.sceneModel=r,this.lodState=new FEe(e,n),this.lodState.initializeLodState(r)}return W(B,[{key:"_increaseLODLevelIndex",value:function(){var r=this.lodState;if(r.lodLevelIndex===r.primLODLevels.length)return!1;for(var e=r.entitiesInLOD[r.primLODLevels[r.lodLevelIndex]]||[],n=0,l=e.length;n<l;n++)e[n].culledLOD=!0;return r.lodLevelIndex++,!0}},{key:"_decreaseLODLevelIndex",value:function(){var r=this.lodState;if(r.lodLevelIndex===0)return!1;for(var e=r.entitiesInLOD[r.primLODLevels[r.lodLevelIndex-1]]||[],n=0,l=e.length;n<l;n++)e[n].culledLOD=!1;return r.lodLevelIndex--,!0}},{key:"applyLodCulling",value:function(r){var e=this.lodState,n=!1;return r<e.targetFps?++e.consecutiveFramesWithoutTargetFps>0&&(e.consecutiveFramesWithoutTargetFps=0,n=this._increaseLODLevelIndex()):r>e.targetFps+4&&++e.consecutiveFramesWithTargetFps>1&&(e.consecutiveFramesWithTargetFps=0,n=this._decreaseLODLevelIndex()),n}},{key:"resetLodCulling",value:function(){var r=!1,e=!1;do r|=e=this._decreaseLODLevelIndex();while(e);return r}}])}(),OEe=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O(this,o),e=R(this,o,[r,n]),e._scene=r,e._lodLevels=[2e3,600,150,80,20],e._lodManagers={},e._lodManagerList=[],e.enabled=n.enabled,e.targetFPS=n.targetFPS,e._init(),e}return N(o,B),W(o,[{key:"_init",value:function(){var e=this,n=4,l=new Array(n),a=0,S=-1,T=Date.now(),M=0,X=0,Y=X;this._scene.on("rendering",function(){if(S!==-1)for(var ee=0,oe=e._lodManagerList.length;ee<oe;ee++)e._lodManagerList[ee].applyLodCulling(S)}),this._scene.on("rendered",function(){T=Date.now(),window.requestAnimationFrame(function(){a++;var ee=Date.now();M=ee-T,T=ee,l[a%n]=M;var oe=0;if(a>n){for(var ge=0;ge<n;ge++)oe+=l[ge];S=n/oe*1e3}})}),this._scene.camera.on("matrix",function(){Y=X}),this._scene.on("tick",function(){if(X-Y>3)for(var ee=0,oe=e._lodManagerList.length;ee<oe;ee++)e._lodManagerList[ee].resetLodCulling();X++})}},{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 n=new NEe(this.scene,e,this._lodLevels,this._targetFPS);return this._lodManagers[n.id]=n,this._lodManagerList=Object.values(this._lodManagers),n}},{key:"putLODManager",value:function(e){delete this._lodManagers[e.id],this._lodManagerList=Object.values(this._lodManagers)}},{key:"destroy",value:function(){$(o,"destroy",this)([])}}])}(At),LEe=".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; } }",jEe=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O(this,o),e=R(this,o,[r,n]),e._canvas=n.canvas,e._element=null,e._isCustom=!1,n.elementId?(e._element=document.getElementById(n.elementId),e._element?e._adjustPosition():e._createDefaultSpinner(n.elementId)):e._createDefaultSpinner("engine_spinner"),e.processes=0,e}return N(o,B),W(o,[{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 n=document.createElement("div");n.setAttribute("id",e);var l=n.style;if(l["z-index"]="9000",l.position="absolute",n.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>',n.setAttribute("class","loading-circle"),this._canvas.parentElement)this._canvas.parentElement.appendChild(n);else{var a=document.getElementById("myViewer");a.appendChild(n)}this._element=n,this._isCustom=!1,this._adjustPosition()}},{key:"_injectDefaultCSS",value:function(){var e="tctwins-spinner-css";if(!document.getElementById(e)){var n=document.createElement("style");if(n.innerHTML=LEe,n.id=e,this._canvas.parentElement)this._canvas.parentElement.appendChild(n);else{var l=document.getElementById("myViewer");l.appendChild(n)}}}},{key:"_adjustPosition",value:function(){if(!this._isCustom){var e=this._canvas,n=this._element,l=n.style;l.left=e.offsetLeft+e.clientWidth*.5-n.clientWidth*.5+"px",l.top=e.offsetTop+e.clientHeight*.5-n.clientHeight*.5+"px"}}},{key:"processes",get:function(){return this._processes},set:function(e){if(e=e||0,this._processes!==e&&!(e<0)){var n=this._processes;this._processes=e;var l=this._element;l&&(l.style.visibility=this._processes>0?"visible":"hidden"),this.fire("processes",this._processes),this._processes===0&&this._processes!==n&&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)}}])}(At),L3=["webgl2","experimental-webgl","webkit-3d","moz-webgl","moz-glweb20"],j3=function(B){function o(r){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,o),e=R(this,o,[r,n]),e._backgroundColor=V.vec3([n.backgroundColor?n.backgroundColor[0]:1,n.backgroundColor?n.backgroundColor[1]:1,n.backgroundColor?n.backgroundColor[2]:1]),e._backgroundColorFromAmbientLight=!!n.backgroundColorFromAmbientLight,e.parent=r,n.canvas?e.canvas=n.canvas:e._createCanvas(),e.gl=null,e.webgl2=!1,e.transparent=!!n.transparent,e.contextAttr=n.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=n.resolutionScale,e._offset=n.offset!==void 0?n.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 l=e;e.canvas.addEventListener("webglcontextlost",e._webglcontextlostListener=function(S){console.time("webglcontextrestored"),l.scene._webglContextLost(),l.fire("webglcontextlost"),S.preventDefault()},!1),e.canvas.addEventListener("webglcontextrestored",e._webglcontextrestoredListener=function(S){l._initWebGL(),l.gl&&(l.scene._webglContextRestored(l.gl),l.fire("webglcontextrestored",l.gl),S.preventDefault()),console.timeEnd("webglcontextrestored")},!1),e._dirtyBoundary=!0;var a=new ResizeObserver(function(S){var T=k(S),M;try{for(T.s();!(M=T.n()).done;){var X=M.value;X.contentBoxSize&&(e._dirtyBoundary=!0)}}catch(Y){T.e(Y)}finally{T.f()}});return a.observe(e.canvas),e._tick=e.scene.on("tick",function(){e._dirtyBoundary&&(e._dirtyBoundary=!1,l.canvas.width=Math.round(l.canvas.clientWidth*l._resolutionScale),l.canvas.height=Math.round(l.canvas.clientHeight*l._resolutionScale),l.boundary[0]=l.canvas.offsetLeft,l.boundary[1]=l.canvas.offsetTop,l.boundary[2]=l.canvas.clientWidth,l.boundary[3]=l.canvas.clientHeight,l.fire("boundary",l.boundary))}),e._spinner=new jEe(e.scene,{canvas:e.canvas,elementId:n.spinnerElementId}),e}return N(o,B),W(o,[{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 n=this.canvas;n.width=Math.round(n.clientWidth*this._resolutionScale),n.height=Math.round(n.clientHeight*this._resolutionScale),this.glRedraw()}}},{key:"spinner",get:function(){return this._spinner}},{key:"_createCanvas",value:function(){var e="tctwins-canvas-"+V.createUUID(),n=document.createElement("div"),l=n.style;l.height="100%",l.width="100%",l.padding="0",l.margin="0",l.background="rgba(0,0,0,0);",l.float="left",l.left="0",l.top="0",l.position="absolute",l.opacity="1.0",l["z-index"]="-10000",n.innerHTML+='<canvas id="'+e+'" style="width: 100%; height: 100%; float: left; margin: 0; padding: 0;"></canvas>',this.parent.viewer.container.appendChild(n),this.canvas=document.getElementById(e)}},{key:"_getElementXY",value:function(e){for(var n=0,l=0;e;)n+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:n,y:l}}},{key:"_initWebGL",value:function(){if(!this.gl)for(var e=0;!this.gl&&e<L3.length;e++)try{this.gl=this.canvas.getContext(L3[e],this.contextAttr)}catch{}this.gl||(this.error("Failed to get a WebGL context"),this.fire("webglContextFailed",!0,!0));{var n=this.gl,l="__",a=n.activeTexture;n.activeTexture=function(M){l!==M&&(l=M,a.call(this,M))};var S={},T=n.bindTexture;n.bindTexture=function(M,X){S[l]!==X&&(S[l]=X,T.call(this,M,X))}}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,n,l,a){return this.scene._renderer.readPixels(e,n,l,a)}},{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),$(o,"destroy",this)([])}}])}(At),VEe=function(){function B(o){O(this,B),this._scene=o,this._matPool=[],this._matPoolNextFreeIndex=0,this._rtcViewMats={},this._rtcPickViewMats={},this.reset()}return W(B,[{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=V.vec3(),this.snapPickOrigin=V.vec3()}},{key:"getRTCViewMatrix",value:function(r,e){var n=this._rtcViewMats[r];return n||(n=this._getNewMat(),ot(this._scene.camera.viewMatrix,e,n),this._rtcViewMats[r]=n),n}},{key:"getRTCPickViewMatrix",value:function(r,e){var n=this._rtcPickViewMats[r];if(!n){n=this._getNewMat();var l=this.pickViewMatrix||this._scene.camera.viewMatrix;ot(l,e,n),this._rtcPickViewMats[r]=n}return n}},{key:"_getNewMat",value:function(){var r=this._matPool[this._matPoolNextFreeIndex];return r||(r=V.mat4(),this._matPool[this._matPoolNextFreeIndex]=r),this._matPoolNextFreeIndex++,r}}])}(),li={WEBGL:!1,SUPPORTED_EXTENSIONS:{}},R_=document.createElement("canvas");if(R_){var ci=R_.getContext("webgl",{antialias:!0})||R_.getContext("experimental-webgl",{antialias:!0});li.WEBGL=!!ci,li.WEBGL&&(li.ANTIALIAS=ci.getContextAttributes().antialias,ci.getShaderPrecisionFormat?ci.getShaderPrecisionFormat(ci.FRAGMENT_SHADER,ci.HIGH_FLOAT).precision>0?li.FS_MAX_FLOAT_PRECISION="highp":ci.getShaderPrecisionFormat(ci.FRAGMENT_SHADER,ci.MEDIUM_FLOAT).precision>0?li.FS_MAX_FLOAT_PRECISION="mediump":li.FS_MAX_FLOAT_PRECISION="lowp":li.FS_MAX_FLOAT_PRECISION="mediump",li.DEPTH_BUFFER_BITS=ci.getParameter(ci.DEPTH_BITS),li.MAX_TEXTURE_SIZE=ci.getParameter(ci.MAX_TEXTURE_SIZE),li.MAX_CUBE_MAP_SIZE=ci.getParameter(ci.MAX_CUBE_MAP_TEXTURE_SIZE),li.MAX_RENDERBUFFER_SIZE=ci.getParameter(ci.MAX_RENDERBUFFER_SIZE),li.MAX_TEXTURE_UNITS=ci.getParameter(ci.MAX_COMBINED_TEXTURE_IMAGE_UNITS),li.MAX_TEXTURE_IMAGE_UNITS=ci.getParameter(ci.MAX_TEXTURE_IMAGE_UNITS),li.MAX_VERTEX_ATTRIBS=ci.getParameter(ci.MAX_VERTEX_ATTRIBS),li.MAX_VERTEX_UNIFORM_VECTORS=ci.getParameter(ci.MAX_VERTEX_UNIFORM_VECTORS),li.MAX_FRAGMENT_UNIFORM_VECTORS=ci.getParameter(ci.MAX_FRAGMENT_UNIFORM_VECTORS),li.MAX_VARYING_VECTORS=ci.getParameter(ci.MAX_VARYING_VECTORS),ci.getSupportedExtensions().forEach(function(B){li.SUPPORTED_EXTENSIONS[B]=!0}))}var F_=function(){function B(){O(this,B),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 W(B,[{key:"canvasPos",get:function(){return this._gotCanvasPos?this._canvasPos:null},set:function(r){r?(this._canvasPos[0]=r[0],this._canvasPos[1]=r[1],this._gotCanvasPos=!0):this._gotCanvasPos=!1}},{key:"origin",get:function(){return this._gotOrigin?this._origin:null},set:function(r){r?(this._origin[0]=r[0],this._origin[1]=r[1],this._origin[2]=r[2],this._gotOrigin=!0):this._gotOrigin=!1}},{key:"direction",get:function(){return this._gotDirection?this._direction:null},set:function(r){r?(this._direction[0]=r[0],this._direction[1]=r[1],this._direction[2]=r[2],this._gotDirection=!0):this._gotDirection=!1}},{key:"indices",get:function(){return this.entity&&this._gotIndices?this._indices:null},set:function(r){r?(this._indices[0]=r[0],this._indices[1]=r[1],this._indices[2]=r[2],this._gotIndices=!0):this._gotIndices=!1}},{key:"localPos",get:function(){return this.entity&&this._gotLocalPos?this._localPos:null},set:function(r){r?(this._localPos[0]=r[0],this._localPos[1]=r[1],this._localPos[2]=r[2],this._gotLocalPos=!0):this._gotLocalPos=!1}},{key:"snappedCanvasPos",get:function(){return this._gotSnappedCanvasPos?this._snappedCanvasPos:null},set:function(r){r?(this._snappedCanvasPos[0]=r[0],this._snappedCanvasPos[1]=r[1],this._gotSnappedCanvasPos=!0):this._gotSnappedCanvasPos=!1}},{key:"worldPos",get:function(){var r;return(r=this._worldPos)!==null&&r!==void 0?r:null},set:function(r){r&&(this._worldPos[0]=r[0],this._worldPos[1]=r[1],this._worldPos[2]=r[2])}},{key:"viewPos",get:function(){return this.entity&&this._gotViewPos?this._viewPos:null},set:function(r){r?(this._viewPos[0]=r[0],this._viewPos[1]=r[1],this._viewPos[2]=r[2],this._gotViewPos=!0):this._gotViewPos=!1}},{key:"bary",get:function(){return this.entity&&this._gotBary?this._bary:null},set:function(r){r?(this._bary[0]=r[0],this._bary[1]=r[1],this._bary[2]=r[2],this._gotBary=!0):this._gotBary=!1}},{key:"worldNormal",get:function(){return this.entity&&this._gotWorldNormal?this._worldNormal:null},set:function(r){r?(this._worldNormal[0]=r[0],this._worldNormal[1]=r[1],this._worldNormal[2]=r[2],this._gotWorldNormal=!0):this._gotWorldNormal=!1}},{key:"uv",get:function(){return this.entity&&this._gotUV?this._uv:null},set:function(r){r?(this._uv[0]=r[0],this._uv[1]=r[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}}])}(),V3=function(){function B(o,r,e){if(O(this,B),this.allocated=!1,this.compiled=!1,this.handle=o.createShader(r),!this.handle){this.errors=["Failed to allocate"];return}if(this.allocated=!0,o.shaderSource(this.handle,e),o.compileShader(this.handle),this.compiled=o.getShaderParameter(this.handle,o.COMPILE_STATUS),!this.compiled&&!o.isContextLost()){for(var n=e.split(`
|
|
@@ -543,7 +543,7 @@ headers: `+JSON.stringify(Oe),ht.data=yt,ht.path=W.path,ht.status=ue,ht.headers=
|
|
|
543
543
|
JSZip uses the library pako released under the MIT license :
|
|
544
544
|
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
545
545
|
*/(function(p){s.exports=p()})(function(){return function p(y,A,h){function d(f,m){if(!A[f]){if(!y[f]){var g=void 0;if(!m&&g)return require(f,!0);if(u)return u(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var b=A[f]={exports:{}};y[f][0].call(b.exports,function(w){var _=y[f][1][w];return d(_||w)},b,b.exports,p,y,A,h)}return A[f].exports}for(var u=void 0,c=0;c<h.length;c++)d(h[c]);return d}({1:[function(p,y,A){var h=p("./utils"),d=p("./support"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";A.encode=function(c){for(var f,m,g,v,b,w,_,x=[],E=0,k=c.length,P=k,D=h.getTypeOf(c)!=="string";E<c.length;)P=k-E,g=D?(f=c[E++],m=E<k?c[E++]:0,E<k?c[E++]:0):(f=c.charCodeAt(E++),m=E<k?c.charCodeAt(E++):0,E<k?c.charCodeAt(E++):0),v=f>>2,b=(3&f)<<4|m>>4,w=1<P?(15&m)<<2|g>>6:64,_=2<P?63&g:64,x.push(u.charAt(v)+u.charAt(b)+u.charAt(w)+u.charAt(_));return x.join("")},A.decode=function(c){var f,m,g,v,b,w,_=0,x=0,E="data:";if(c.substr(0,E.length)===E)throw new Error("Invalid base64 input, it looks like a data url.");var k,P=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===u.charAt(64)&&P--,c.charAt(c.length-2)===u.charAt(64)&&P--,P%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=d.uint8array?new Uint8Array(0|P):new Array(0|P);_<c.length;)f=u.indexOf(c.charAt(_++))<<2|(v=u.indexOf(c.charAt(_++)))>>4,m=(15&v)<<4|(b=u.indexOf(c.charAt(_++)))>>2,g=(3&b)<<6|(w=u.indexOf(c.charAt(_++))),k[x++]=f,b!==64&&(k[x++]=m),w!==64&&(k[x++]=g);return k}},{"./support":30,"./utils":32}],2:[function(p,y,A){var h=p("./external"),d=p("./stream/DataWorker"),u=p("./stream/Crc32Probe"),c=p("./stream/DataLengthProbe");function f(m,g,v,b,w){this.compressedSize=m,this.uncompressedSize=g,this.crc32=v,this.compression=b,this.compressedContent=w}f.prototype={getContentWorker:function(){var m=new d(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),g=this;return m.on("end",function(){if(this.streamInfo.data_length!==g.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),m},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)}},f.createWorkerFrom=function(m,g,v){return m.pipe(new u).pipe(new c("uncompressedSize")).pipe(g.compressWorker(v)).pipe(new c("compressedSize")).withStreamInfo("compression",g)},y.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(p,y,A){var h=p("./stream/GenericWorker");A.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},A.DEFLATE=p("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(p,y,A){var h=p("./utils"),d=function(){for(var u,c=[],f=0;f<256;f++){u=f;for(var m=0;m<8;m++)u=1&u?3988292384^u>>>1:u>>>1;c[f]=u}return c}();y.exports=function(u,c){return u!==void 0&&u.length?h.getTypeOf(u)!=="string"?function(f,m,g,v){var b=d,w=v+g;f^=-1;for(var _=v;_<w;_++)f=f>>>8^b[255&(f^m[_])];return-1^f}(0|c,u,u.length,0):function(f,m,g,v){var b=d,w=v+g;f^=-1;for(var _=v;_<w;_++)f=f>>>8^b[255&(f^m.charCodeAt(_))];return-1^f}(0|c,u,u.length,0):0}},{"./utils":32}],5:[function(p,y,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(p,y,A){var h=null;h=typeof Promise<"u"?Promise:p("lie"),y.exports={Promise:h}},{lie:37}],7:[function(p,y,A){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=p("pako"),u=p("./utils"),c=p("./stream/GenericWorker"),f=h?"uint8array":"array";function m(g,v){c.call(this,"FlateWorker/"+g),this._pako=null,this._pakoAction=g,this._pakoOptions=v,this.meta={}}A.magic="\b\0",u.inherits(m,c),m.prototype.processChunk=function(g){this.meta=g.meta,this._pako===null&&this._createPako(),this._pako.push(u.transformTo(f,g.data),!1)},m.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},m.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},m.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var g=this;this._pako.onData=function(v){g.push({data:v,meta:g.meta})}},A.compressWorker=function(g){return new m("Deflate",g)},A.uncompressWorker=function(){return new m("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(p,y,A){function h(b,w){var _,x="";for(_=0;_<w;_++)x+=String.fromCharCode(255&b),b>>>=8;return x}function d(b,w,_,x,E,k){var P,D,R=b.file,z=b.compression,F=k!==f.utf8encode,H=u.transformTo("string",k(R.name)),$=u.transformTo("string",f.utf8encode(R.name)),K=R.comment,G=u.transformTo("string",k(K)),j=u.transformTo("string",f.utf8encode(K)),N=$.length!==R.name.length,I=j.length!==K.length,L="",U="",O="",Q=R.dir,W=R.date,Z={crc32:0,compressedSize:0,uncompressedSize:0};w&&!_||(Z.crc32=b.crc32,Z.compressedSize=b.compressedSize,Z.uncompressedSize=b.uncompressedSize);var J=0;w&&(J|=8),F||!N&&!I||(J|=2048);var ne=0,ae=0;Q&&(ne|=16),E==="UNIX"?(ae=798,ne|=function(q,fe){var re=q;return q||(re=fe?16893:33204),(65535&re)<<16}(R.unixPermissions,Q)):(ae=20,ne|=function(q){return 63&(q||0)}(R.dosPermissions)),P=W.getUTCHours(),P<<=6,P|=W.getUTCMinutes(),P<<=5,P|=W.getUTCSeconds()/2,D=W.getUTCFullYear()-1980,D<<=4,D|=W.getUTCMonth()+1,D<<=5,D|=W.getUTCDate(),N&&(U=h(1,1)+h(m(H),4)+$,L+="up"+h(U.length,2)+U),I&&(O=h(1,1)+h(m(G),4)+j,L+="uc"+h(O.length,2)+O);var ce="";return ce+=`
|
|
546
|
-
\0`,ce+=h(J,2),ce+=z.magic,ce+=h(P,2),ce+=h(D,2),ce+=h(Z.crc32,4),ce+=h(Z.compressedSize,4),ce+=h(Z.uncompressedSize,4),ce+=h(H.length,2),ce+=h(L.length,2),{fileRecord:g.LOCAL_FILE_HEADER+ce+H+L,dirRecord:g.CENTRAL_FILE_HEADER+h(ae,2)+ce+h(G.length,2)+"\0\0\0\0"+h(ne,4)+h(x,4)+H+L+G}}var u=p("../utils"),c=p("../stream/GenericWorker"),f=p("../utf8"),m=p("../crc32"),g=p("../signature");function v(b,w,_,x){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=_,this.encodeFileName=x,this.streamFiles=b,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(v,c),v.prototype.push=function(b){var w=b.meta.percent||0,_=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(b):(this.bytesWritten+=b.data.length,c.prototype.push.call(this,{data:b.data,meta:{currentFile:this.currentFile,percent:_?(w+100*(_-x-1))/_:100}}))},v.prototype.openedSource=function(b){this.currentSourceOffset=this.bytesWritten,this.currentFile=b.file.name;var w=this.streamFiles&&!b.file.dir;if(w){var _=d(b,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:_.fileRecord,meta:{percent:0}})}else this.accumulate=!0},v.prototype.closedSource=function(b){this.accumulate=!1;var w=this.streamFiles&&!b.file.dir,_=d(b,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(_.dirRecord),w)this.push({data:function(x){return g.DATA_DESCRIPTOR+h(x.crc32,4)+h(x.compressedSize,4)+h(x.uncompressedSize,4)}(b),meta:{percent:100}});else for(this.push({data:_.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},v.prototype.flush=function(){for(var b=this.bytesWritten,w=0;w<this.dirRecords.length;w++)this.push({data:this.dirRecords[w],meta:{percent:100}});var _=this.bytesWritten-b,x=function(E,k,P,D,R){var z=u.transformTo("string",R(D));return g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+h(E,2)+h(E,2)+h(k,4)+h(P,4)+h(z.length,2)+z}(this.dirRecords.length,_,b,this.zipComment,this.encodeFileName);this.push({data:x,meta:{percent:100}})},v.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},v.prototype.registerPrevious=function(b){this._sources.push(b);var w=this;return b.on("data",function(_){w.processChunk(_)}),b.on("end",function(){w.closedSource(w.previous.streamInfo),w._sources.length?w.prepareNextSource():w.end()}),b.on("error",function(_){w.error(_)}),this},v.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},v.prototype.error=function(b){var w=this._sources;if(!c.prototype.error.call(this,b))return!1;for(var _=0;_<w.length;_++)try{w[_].error(b)}catch{}return!0},v.prototype.lock=function(){c.prototype.lock.call(this);for(var b=this._sources,w=0;w<b.length;w++)b[w].lock()},y.exports=v},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(p,y,A){var h=p("../compressions"),d=p("./ZipFileWorker");A.generateWorker=function(u,c,f){var m=new d(c.streamFiles,f,c.platform,c.encodeFileName),g=0;try{u.forEach(function(v,b){g++;var w=function(k,P){var D=k||P,R=h[D];if(!R)throw new Error(D+" is not a valid compression method !");return R}(b.options.compression,c.compression),_=b.options.compressionOptions||c.compressionOptions||{},x=b.dir,E=b.date;b._compressWorker(w,_).withStreamInfo("file",{name:v,dir:x,date:E,comment:b.comment||"",unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions}).pipe(m)}),m.entriesCount=g}catch(v){m.error(v)}return m}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(p,y,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=p("./object")).loadAsync=p("./load"),h.support=p("./support"),h.defaults=p("./defaults"),h.version="3.10.1",h.loadAsync=function(d,u){return new h().loadAsync(d,u)},h.external=p("./external"),y.exports=h},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(p,y,A){var h=p("./utils"),d=p("./external"),u=p("./utf8"),c=p("./zipEntries"),f=p("./stream/Crc32Probe"),m=p("./nodejsUtils");function g(v){return new d.Promise(function(b,w){var _=v.decompressed.getContentWorker().pipe(new f);_.on("error",function(x){w(x)}).on("end",function(){_.streamInfo.crc32!==v.decompressed.crc32?w(new Error("Corrupted zip : CRC32 mismatch")):b()}).resume()})}y.exports=function(v,b){var w=this;return b=h.extend(b||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:u.utf8decode}),m.isNode&&m.isStream(v)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):h.prepareContent("the loaded zip file",v,!0,b.optimizedBinaryString,b.base64).then(function(_){var x=new c(b);return x.load(_),x}).then(function(_){var x=[d.Promise.resolve(_)],E=_.files;if(b.checkCRC32)for(var k=0;k<E.length;k++)x.push(g(E[k]));return d.Promise.all(x)}).then(function(_){for(var x=_.shift(),E=x.files,k=0;k<E.length;k++){var P=E[k],D=P.fileNameStr,R=h.resolve(P.fileNameStr);w.file(R,P.decompressed,{binary:!0,optimizedBinaryString:!0,date:P.date,dir:P.dir,comment:P.fileCommentStr.length?P.fileCommentStr:null,unixPermissions:P.unixPermissions,dosPermissions:P.dosPermissions,createFolders:b.createFolders}),P.dir||(w.file(R).unsafeOriginalName=D)}return x.zipComment.length&&(w.comment=x.zipComment),w})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(p,y,A){var h=p("../utils"),d=p("../stream/GenericWorker");function u(c,f){d.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(f)}h.inherits(u,d),u.prototype._bindStream=function(c){var f=this;(this._stream=c).pause(),c.on("data",function(m){f.push({data:m,meta:{percent:0}})}).on("error",function(m){f.isPaused?this.generatedError=m:f.error(m)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.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)},y.exports=u},{"../stream/GenericWorker":28,"../utils":32}],13:[function(p,y,A){var h=p("readable-stream").Readable;function d(u,c,f){h.call(this,c),this._helper=u;var m=this;u.on("data",function(g,v){m.push(g)||m._helper.pause(),f&&f(v)}).on("error",function(g){m.emit("error",g)}).on("end",function(){m.push(null)})}p("../utils").inherits(d,h),d.prototype._read=function(){this._helper.resume()},y.exports=d},{"../utils":32,"readable-stream":16}],14:[function(p,y,A){y.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(p,y,A){function h(R,z,F){var H,$=u.getTypeOf(z),K=u.extend(F||{},m);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&&(R=E(R)),K.createFolders&&(H=x(R))&&k.call(this,H,!0);var G=$==="string"&&K.binary===!1&&K.base64===!1;F&&F.binary!==void 0||(K.binary=!G),(z instanceof g&&z.uncompressedSize===0||K.dir||!z||z.length===0)&&(K.base64=!1,K.binary=!0,z="",K.compression="STORE",$="string");var j=null;j=z instanceof g||z instanceof c?z:w.isNode&&w.isStream(z)?new _(R,z):u.prepareContent(R,z,K.binary,K.optimizedBinaryString,K.base64);var N=new v(R,j,K);this.files[R]=N}var d=p("./utf8"),u=p("./utils"),c=p("./stream/GenericWorker"),f=p("./stream/StreamHelper"),m=p("./defaults"),g=p("./compressedObject"),v=p("./zipObject"),b=p("./generate"),w=p("./nodejsUtils"),_=p("./nodejs/NodejsStreamInputAdapter"),x=function(R){R.slice(-1)==="/"&&(R=R.substring(0,R.length-1));var z=R.lastIndexOf("/");return 0<z?R.substring(0,z):""},E=function(R){return R.slice(-1)!=="/"&&(R+="/"),R},k=function(R,z){return z=z!==void 0?z:m.createFolders,R=E(R),this.files[R]||h.call(this,R,null,{dir:!0,createFolders:z}),this.files[R]};function P(R){return Object.prototype.toString.call(R)==="[object RegExp]"}var D={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(R){var z,F,H;for(z in this.files)H=this.files[z],(F=z.slice(this.root.length,z.length))&&z.slice(0,this.root.length)===this.root&&R(F,H)},filter:function(R){var z=[];return this.forEach(function(F,H){R(F,H)&&z.push(H)}),z},file:function(R,z,F){if(arguments.length!==1)return R=this.root+R,h.call(this,R,z,F),this;if(P(R)){var H=R;return this.filter(function(K,G){return!G.dir&&H.test(K)})}var $=this.files[this.root+R];return $&&!$.dir?$:null},folder:function(R){if(!R)return this;if(P(R))return this.filter(function($,K){return K.dir&&R.test($)});var z=this.root+R,F=k.call(this,z),H=this.clone();return H.root=F.name,H},remove:function(R){R=this.root+R;var z=this.files[R];if(z||(R.slice(-1)!=="/"&&(R+="/"),z=this.files[R]),z&&!z.dir)delete this.files[R];else for(var F=this.filter(function($,K){return K.name.slice(0,R.length)===R}),H=0;H<F.length;H++)delete this.files[F[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(R){var z,F={};try{if((F=u.extend(R||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=F.type.toLowerCase(),F.compression=F.compression.toUpperCase(),F.type==="binarystring"&&(F.type="string"),!F.type)throw new Error("No output type specified.");u.checkSupport(F.type),F.platform!=="darwin"&&F.platform!=="freebsd"&&F.platform!=="linux"&&F.platform!=="sunos"||(F.platform="UNIX"),F.platform==="win32"&&(F.platform="DOS");var H=F.comment||this.comment||"";z=b.generateWorker(this,F,H)}catch($){(z=new c("error")).error($)}return new f(z,F.type||"string",F.mimeType)},generateAsync:function(R,z){return this.generateInternalStream(R).accumulate(z)},generateNodeStream:function(R,z){return(R=R||{}).type||(R.type="nodebuffer"),this.generateInternalStream(R).toNodejsStream(z)}};y.exports=D},{"./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(p,y,A){y.exports=p("stream")},{stream:void 0}],17:[function(p,y,A){var h=p("./DataReader");function d(u){h.call(this,u);for(var c=0;c<this.data.length;c++)u[c]=255&u[c]}p("../utils").inherits(d,h),d.prototype.byteAt=function(u){return this.data[this.zero+u]},d.prototype.lastIndexOfSignature=function(u){for(var c=u.charCodeAt(0),f=u.charCodeAt(1),m=u.charCodeAt(2),g=u.charCodeAt(3),v=this.length-4;0<=v;--v)if(this.data[v]===c&&this.data[v+1]===f&&this.data[v+2]===m&&this.data[v+3]===g)return v-this.zero;return-1},d.prototype.readAndCheckSignature=function(u){var c=u.charCodeAt(0),f=u.charCodeAt(1),m=u.charCodeAt(2),g=u.charCodeAt(3),v=this.readData(4);return c===v[0]&&f===v[1]&&m===v[2]&&g===v[3]},d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./DataReader":18}],18:[function(p,y,A){var h=p("../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 c,f=0;for(this.checkOffset(u),c=this.index+u-1;c>=this.index;c--)f=(f<<8)+this.byteAt(c);return this.index+=u,f},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))}},y.exports=d},{"../utils":32}],19:[function(p,y,A){var h=p("./Uint8ArrayReader");function d(u){h.call(this,u)}p("../utils").inherits(d,h),d.prototype.readData=function(u){this.checkOffset(u);var c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(p,y,A){var h=p("./DataReader");function d(u){h.call(this,u)}p("../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 c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./DataReader":18}],21:[function(p,y,A){var h=p("./ArrayReader");function d(u){h.call(this,u)}p("../utils").inherits(d,h),d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(p,y,A){var h=p("../utils"),d=p("../support"),u=p("./ArrayReader"),c=p("./StringReader"),f=p("./NodeBufferReader"),m=p("./Uint8ArrayReader");y.exports=function(g){var v=h.getTypeOf(g);return h.checkSupport(v),v!=="string"||d.uint8array?v==="nodebuffer"?new f(g):d.uint8array?new m(h.transformTo("uint8array",g)):new u(h.transformTo("array",g)):new c(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(p,y,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(p,y,A){var h=p("./GenericWorker"),d=p("../utils");function u(c){h.call(this,"ConvertWorker to "+c),this.destType=c}d.inherits(u,h),u.prototype.processChunk=function(c){this.push({data:d.transformTo(this.destType,c.data),meta:c.meta})},y.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(p,y,A){var h=p("./GenericWorker"),d=p("../crc32");function u(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}p("../utils").inherits(u,h),u.prototype.processChunk=function(c){this.streamInfo.crc32=d(c.data,this.streamInfo.crc32||0),this.push(c)},y.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(p,y,A){var h=p("../utils"),d=p("./GenericWorker");function u(c){d.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}h.inherits(u,d),u.prototype.processChunk=function(c){if(c){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+c.data.length}d.prototype.processChunk.call(this,c)},y.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(p,y,A){var h=p("../utils"),d=p("./GenericWorker");function u(c){d.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(m){f.dataIsReady=!0,f.data=m,f.max=m&&m.length||0,f.type=h.getTypeOf(m),f.isPaused||f._tickAndRepeat()},function(m){f.error(m)})}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 c=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,f);break;case"uint8array":c=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":c=this.data.slice(this.index,f)}return this.index=f,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},y.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(p,y,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 c=0;c<this._listeners[d].length;c++)this._listeners[d][c].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(c){u.processChunk(c)}),d.on("end",function(){u.end()}),d.on("error",function(c){u.error(c)}),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}},y.exports=h},{}],29:[function(p,y,A){var h=p("../utils"),d=p("./ConvertWorker"),u=p("./GenericWorker"),c=p("../base64"),f=p("../support"),m=p("../external"),g=null;if(f.nodestream)try{g=p("../nodejs/NodejsStreamOutputAdapter")}catch{}function v(w,_){return new m.Promise(function(x,E){var k=[],P=w._internalType,D=w._outputType,R=w._mimeType;w.on("data",function(z,F){k.push(z),_&&_(F)}).on("error",function(z){k=[],E(z)}).on("end",function(){try{var z=function(F,H,$){switch(F){case"blob":return h.newBlob(h.transformTo("arraybuffer",H),$);case"base64":return c.encode(H);default:return h.transformTo(F,H)}}(D,function(F,H){var $,K=0,G=null,j=0;for($=0;$<H.length;$++)j+=H[$].length;switch(F){case"string":return H.join("");case"array":return Array.prototype.concat.apply([],H);case"uint8array":for(G=new Uint8Array(j),$=0;$<H.length;$++)G.set(H[$],K),K+=H[$].length;return G;case"nodebuffer":return Buffer.concat(H);default:throw new Error("concat : unsupported type '"+F+"'")}}(P,k),R);x(z)}catch(F){E(F)}k=[]}).resume()})}function b(w,_,x){var E=_;switch(_){case"blob":case"arraybuffer":E="uint8array";break;case"base64":E="string"}try{this._internalType=E,this._outputType=_,this._mimeType=x,h.checkSupport(E),this._worker=w.pipe(new d(E)),w.lock()}catch(k){this._worker=new u("error"),this._worker.error(k)}}b.prototype={accumulate:function(w){return v(this,w)},on:function(w,_){var x=this;return w==="data"?this._worker.on(w,function(E){_.call(x,E.data,E.meta)}):this._worker.on(w,function(){h.delay(_,arguments,x)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(w){if(h.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new g(this,{objectMode:this._outputType!=="nodebuffer"},w)}},y.exports=b},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(p,y,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=!!p("readable-stream").Readable}catch{A.nodestream=!1}},{"readable-stream":16}],31:[function(p,y,A){for(var h=p("./utils"),d=p("./support"),u=p("./nodejsUtils"),c=p("./stream/GenericWorker"),f=new Array(256),m=0;m<256;m++)f[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;f[254]=f[254]=1;function g(){c.call(this,"utf-8 decode"),this.leftOver=null}function v(){c.call(this,"utf-8 encode")}A.utf8encode=function(b){return d.nodebuffer?u.newBufferFrom(b,"utf-8"):function(w){var _,x,E,k,P,D=w.length,R=0;for(k=0;k<D;k++)(64512&(x=w.charCodeAt(k)))==55296&&k+1<D&&(64512&(E=w.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(E-56320),k++),R+=x<128?1:x<2048?2:x<65536?3:4;for(_=d.uint8array?new Uint8Array(R):new Array(R),k=P=0;P<R;k++)(64512&(x=w.charCodeAt(k)))==55296&&k+1<D&&(64512&(E=w.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(E-56320),k++),x<128?_[P++]=x:(x<2048?_[P++]=192|x>>>6:(x<65536?_[P++]=224|x>>>12:(_[P++]=240|x>>>18,_[P++]=128|x>>>12&63),_[P++]=128|x>>>6&63),_[P++]=128|63&x);return _}(b)},A.utf8decode=function(b){return d.nodebuffer?h.transformTo("nodebuffer",b).toString("utf-8"):function(w){var _,x,E,k,P=w.length,D=new Array(2*P);for(_=x=0;_<P;)if((E=w[_++])<128)D[x++]=E;else if(4<(k=f[E]))D[x++]=65533,_+=k-1;else{for(E&=k===2?31:k===3?15:7;1<k&&_<P;)E=E<<6|63&w[_++],k--;1<k?D[x++]=65533:E<65536?D[x++]=E:(E-=65536,D[x++]=55296|E>>10&1023,D[x++]=56320|1023&E)}return D.length!==x&&(D.subarray?D=D.subarray(0,x):D.length=x),h.applyFromCharCode(D)}(b=h.transformTo(d.uint8array?"uint8array":"array",b))},h.inherits(g,c),g.prototype.processChunk=function(b){var w=h.transformTo(d.uint8array?"uint8array":"array",b.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var _=w;(w=new Uint8Array(_.length+this.leftOver.length)).set(this.leftOver,0),w.set(_,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var x=function(k,P){var D;for((P=P||k.length)>k.length&&(P=k.length),D=P-1;0<=D&&(192&k[D])==128;)D--;return D<0||D===0?P:D+f[k[D]]>P?D:P}(w),E=w;x!==w.length&&(d.uint8array?(E=w.subarray(0,x),this.leftOver=w.subarray(x,w.length)):(E=w.slice(0,x),this.leftOver=w.slice(x,w.length))),this.push({data:A.utf8decode(E),meta:b.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:A.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},A.Utf8DecodeWorker=g,h.inherits(v,c),v.prototype.processChunk=function(b){this.push({data:A.utf8encode(b.data),meta:b.meta})},A.Utf8EncodeWorker=v},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(p,y,A){var h=p("./support"),d=p("./base64"),u=p("./nodejsUtils"),c=p("./external");function f(_){return _}function m(_,x){for(var E=0;E<_.length;++E)x[E]=255&_.charCodeAt(E);return x}p("setimmediate"),A.newBlob=function(_,x){A.checkSupport("blob");try{return new Blob([_],{type:x})}catch{try{var E=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return E.append(_),E.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var g={stringifyByChunk:function(_,x,E){var k=[],P=0,D=_.length;if(D<=E)return String.fromCharCode.apply(null,_);for(;P<D;)x==="array"||x==="nodebuffer"?k.push(String.fromCharCode.apply(null,_.slice(P,Math.min(P+E,D)))):k.push(String.fromCharCode.apply(null,_.subarray(P,Math.min(P+E,D)))),P+=E;return k.join("")},stringifyByChar:function(_){for(var x="",E=0;E<_.length;E++)x+=String.fromCharCode(_[E]);return x},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 v(_){var x=65536,E=A.getTypeOf(_),k=!0;if(E==="uint8array"?k=g.applyCanBeUsed.uint8array:E==="nodebuffer"&&(k=g.applyCanBeUsed.nodebuffer),k)for(;1<x;)try{return g.stringifyByChunk(_,E,x)}catch{x=Math.floor(x/2)}return g.stringifyByChar(_)}function b(_,x){for(var E=0;E<_.length;E++)x[E]=_[E];return x}A.applyFromCharCode=v;var w={};w.string={string:f,array:function(_){return m(_,new Array(_.length))},arraybuffer:function(_){return w.string.uint8array(_).buffer},uint8array:function(_){return m(_,new Uint8Array(_.length))},nodebuffer:function(_){return m(_,u.allocBuffer(_.length))}},w.array={string:v,array:f,arraybuffer:function(_){return new Uint8Array(_).buffer},uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return u.newBufferFrom(_)}},w.arraybuffer={string:function(_){return v(new Uint8Array(_))},array:function(_){return b(new Uint8Array(_),new Array(_.byteLength))},arraybuffer:f,uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return u.newBufferFrom(new Uint8Array(_))}},w.uint8array={string:v,array:function(_){return b(_,new Array(_.length))},arraybuffer:function(_){return _.buffer},uint8array:f,nodebuffer:function(_){return u.newBufferFrom(_)}},w.nodebuffer={string:v,array:function(_){return b(_,new Array(_.length))},arraybuffer:function(_){return w.nodebuffer.uint8array(_).buffer},uint8array:function(_){return b(_,new Uint8Array(_.length))},nodebuffer:f},A.transformTo=function(_,x){if(x=x||"",!_)return x;A.checkSupport(_);var E=A.getTypeOf(x);return w[E][_](x)},A.resolve=function(_){for(var x=_.split("/"),E=[],k=0;k<x.length;k++){var P=x[k];P==="."||P===""&&k!==0&&k!==x.length-1||(P===".."?E.pop():E.push(P))}return E.join("/")},A.getTypeOf=function(_){return typeof _=="string"?"string":Object.prototype.toString.call(_)==="[object Array]"?"array":h.nodebuffer&&u.isBuffer(_)?"nodebuffer":h.uint8array&&_ instanceof Uint8Array?"uint8array":h.arraybuffer&&_ instanceof ArrayBuffer?"arraybuffer":void 0},A.checkSupport=function(_){if(!h[_.toLowerCase()])throw new Error(_+" is not supported by this platform")},A.MAX_VALUE_16BITS=65535,A.MAX_VALUE_32BITS=-1,A.pretty=function(_){var x,E,k="";for(E=0;E<(_||"").length;E++)k+="\\x"+((x=_.charCodeAt(E))<16?"0":"")+x.toString(16).toUpperCase();return k},A.delay=function(_,x,E){setImmediate(function(){_.apply(E||null,x||[])})},A.inherits=function(_,x){function E(){}E.prototype=x.prototype,_.prototype=new E},A.extend=function(){var _,x,E={};for(_=0;_<arguments.length;_++)for(x in arguments[_])Object.prototype.hasOwnProperty.call(arguments[_],x)&&E[x]===void 0&&(E[x]=arguments[_][x]);return E},A.prepareContent=function(_,x,E,k,P){return c.Promise.resolve(x).then(function(D){return h.blob&&(D instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(D))!==-1)&&typeof FileReader<"u"?new c.Promise(function(R,z){var F=new FileReader;F.onload=function(H){R(H.target.result)},F.onerror=function(H){z(H.target.error)},F.readAsArrayBuffer(D)}):D}).then(function(D){var R=A.getTypeOf(D);return R?(R==="arraybuffer"?D=A.transformTo("uint8array",D):R==="string"&&(P?D=d.decode(D):E&&k!==!0&&(D=function(z){return m(z,h.uint8array?new Uint8Array(z.length):new Array(z.length))}(D))),D):c.Promise.reject(new Error("Can't read the data of '"+_+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(p,y,A){var h=p("./reader/readerFor"),d=p("./utils"),u=p("./signature"),c=p("./zipEntry"),f=p("./support");function m(g){this.files=[],this.loadOptions=g}m.prototype={checkSignature:function(g){if(!this.reader.readAndCheckSignature(g)){this.reader.index-=4;var v=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(v)+", expected "+d.pretty(g)+")")}},isSignature:function(g,v){var b=this.reader.index;this.reader.setIndex(g);var w=this.reader.readString(4)===v;return this.reader.setIndex(b),w},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 g=this.reader.readData(this.zipCommentLength),v=f.uint8array?"uint8array":"array",b=d.transformTo(v,g);this.zipComment=this.loadOptions.decodeFileName(b)},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 g,v,b,w=this.zip64EndOfCentralSize-44;0<w;)g=this.reader.readInt(2),v=this.reader.readInt(4),b=this.reader.readData(v),this.zip64ExtensibleData[g]={id:g,length:v,value:b}},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 g,v;for(g=0;g<this.files.length;g++)v=this.files[g],this.reader.setIndex(v.localHeaderOffset),this.checkSignature(u.LOCAL_FILE_HEADER),v.readLocalPart(this.reader),v.handleUTF8(),v.processAttributes()},readCentralDir:function(){var g;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(u.CENTRAL_FILE_HEADER);)(g=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(g);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 g=this.reader.lastIndexOfSignature(u.CENTRAL_DIRECTORY_END);if(g<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(g);var v=g;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,(g=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(g),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 b=this.centralDirOffset+this.centralDirSize;this.zip64&&(b+=20,b+=12+this.zip64EndOfCentralSize);var w=v-b;if(0<w)this.isSignature(v,u.CENTRAL_FILE_HEADER)||(this.reader.zero=w);else if(w<0)throw new Error("Corrupted zip: missing "+Math.abs(w)+" bytes.")},prepareReader:function(g){this.reader=h(g)},load:function(g){this.prepareReader(g),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},y.exports=m},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(p,y,A){var h=p("./reader/readerFor"),d=p("./utils"),u=p("./compressedObject"),c=p("./crc32"),f=p("./utf8"),m=p("./compressions"),g=p("./support");function v(b,w){this.options=b,this.loadOptions=w}v.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(b){var w,_;if(b.skip(22),this.fileNameLength=b.readInt(2),_=b.readInt(2),this.fileName=b.readData(this.fileNameLength),b.skip(_),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((w=function(x){for(var E in m)if(Object.prototype.hasOwnProperty.call(m,E)&&m[E].magic===x)return m[E];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,w,b.readData(this.compressedSize))},readCentralPart:function(b){this.versionMadeBy=b.readInt(2),b.skip(2),this.bitFlag=b.readInt(2),this.compressionMethod=b.readString(2),this.date=b.readDate(),this.crc32=b.readInt(4),this.compressedSize=b.readInt(4),this.uncompressedSize=b.readInt(4);var w=b.readInt(2);if(this.extraFieldsLength=b.readInt(2),this.fileCommentLength=b.readInt(2),this.diskNumberStart=b.readInt(2),this.internalFileAttributes=b.readInt(2),this.externalFileAttributes=b.readInt(4),this.localHeaderOffset=b.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");b.skip(w),this.readExtraFields(b),this.parseZIP64ExtraField(b),this.fileComment=b.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var b=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),b==0&&(this.dosPermissions=63&this.externalFileAttributes),b==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var b=h(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(b){var w,_,x,E=b.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});b.index+4<E;)w=b.readInt(2),_=b.readInt(2),x=b.readData(_),this.extraFields[w]={id:w,length:_,value:x};b.setIndex(E)},handleUTF8:function(){var b=g.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var w=this.findExtraFieldUnicodePath();if(w!==null)this.fileNameStr=w;else{var _=d.transformTo(b,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(_)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var E=d.transformTo(b,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(E)}}},findExtraFieldUnicodePath:function(){var b=this.extraFields[28789];if(b){var w=h(b.value);return w.readInt(1)!==1||c(this.fileName)!==w.readInt(4)?null:f.utf8decode(w.readData(b.length-5))}return null},findExtraFieldUnicodeComment:function(){var b=this.extraFields[25461];if(b){var w=h(b.value);return w.readInt(1)!==1||c(this.fileComment)!==w.readInt(4)?null:f.utf8decode(w.readData(b.length-5))}return null}},y.exports=v},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(p,y,A){function h(w,_,x){this.name=w,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=_,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var d=p("./stream/StreamHelper"),u=p("./stream/DataWorker"),c=p("./utf8"),f=p("./compressedObject"),m=p("./stream/GenericWorker");h.prototype={internalStream:function(w){var _=null,x="string";try{if(!w)throw new Error("No output type specified.");var E=(x=w.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),_=this._decompressWorker();var k=!this._dataBinary;k&&!E&&(_=_.pipe(new c.Utf8EncodeWorker)),!k&&E&&(_=_.pipe(new c.Utf8DecodeWorker))}catch(P){(_=new m("error")).error(P)}return new d(_,x,"")},async:function(w,_){return this.internalStream(w).accumulate(_)},nodeStream:function(w,_){return this.internalStream(w||"nodebuffer").toNodejsStream(_)},_compressWorker:function(w,_){if(this._data instanceof f&&this._data.compression.magic===w.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new c.Utf8EncodeWorker)),f.createWorkerFrom(x,w,_)},_decompressWorker:function(){return this._data instanceof f?this._data.getContentWorker():this._data instanceof m?this._data:new u(this._data)}};for(var g=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],v=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},b=0;b<g.length;b++)h.prototype[g[b]]=v;y.exports=h},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(p,y,A){(function(h){var d,u,c=h.MutationObserver||h.WebKitMutationObserver;if(c){var f=0,m=new c(w),g=h.document.createTextNode("");m.observe(g,{characterData:!0}),d=function(){g.data=f=++f%2}}else if(h.setImmediate||h.MessageChannel===void 0)d="document"in h&&"onreadystatechange"in h.document.createElement("script")?function(){var _=h.document.createElement("script");_.onreadystatechange=function(){w(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},h.document.documentElement.appendChild(_)}:function(){setTimeout(w,0)};else{var v=new h.MessageChannel;v.port1.onmessage=w,d=function(){v.port2.postMessage(0)}}var b=[];function w(){var _,x;u=!0;for(var E=b.length;E;){for(x=b,b=[],_=-1;++_<E;)x[_]();E=b.length}u=!1}y.exports=function(_){b.push(_)!==1||u||d()}}).call(this,typeof i.g<"u"?i.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(p,y,A){var h=p("immediate");function d(){}var u={},c=["REJECTED"],f=["FULFILLED"],m=["PENDING"];function g(E){if(typeof E!="function")throw new TypeError("resolver must be a function");this.state=m,this.queue=[],this.outcome=void 0,E!==d&&_(this,E)}function v(E,k,P){this.promise=E,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof P=="function"&&(this.onRejected=P,this.callRejected=this.otherCallRejected)}function b(E,k,P){h(function(){var D;try{D=k(P)}catch(R){return u.reject(E,R)}D===E?u.reject(E,new TypeError("Cannot resolve promise with itself")):u.resolve(E,D)})}function w(E){var k=E&&E.then;if(E&&(typeof E=="object"||typeof E=="function")&&typeof k=="function")return function(){k.apply(E,arguments)}}function _(E,k){var P=!1;function D(F){P||(P=!0,u.reject(E,F))}function R(F){P||(P=!0,u.resolve(E,F))}var z=x(function(){k(R,D)});z.status==="error"&&D(z.value)}function x(E,k){var P={};try{P.value=E(k),P.status="success"}catch(D){P.status="error",P.value=D}return P}(y.exports=g).prototype.finally=function(E){if(typeof E!="function")return this;var k=this.constructor;return this.then(function(P){return k.resolve(E()).then(function(){return P})},function(P){return k.resolve(E()).then(function(){throw P})})},g.prototype.catch=function(E){return this.then(null,E)},g.prototype.then=function(E,k){if(typeof E!="function"&&this.state===f||typeof k!="function"&&this.state===c)return this;var P=new this.constructor(d);return this.state!==m?b(P,this.state===f?E:k,this.outcome):this.queue.push(new v(P,E,k)),P},v.prototype.callFulfilled=function(E){u.resolve(this.promise,E)},v.prototype.otherCallFulfilled=function(E){b(this.promise,this.onFulfilled,E)},v.prototype.callRejected=function(E){u.reject(this.promise,E)},v.prototype.otherCallRejected=function(E){b(this.promise,this.onRejected,E)},u.resolve=function(E,k){var P=x(w,k);if(P.status==="error")return u.reject(E,P.value);var D=P.value;if(D)_(E,D);else{E.state=f,E.outcome=k;for(var R=-1,z=E.queue.length;++R<z;)E.queue[R].callFulfilled(k)}return E},u.reject=function(E,k){E.state=c,E.outcome=k;for(var P=-1,D=E.queue.length;++P<D;)E.queue[P].callRejected(k);return E},g.resolve=function(E){return E instanceof this?E:u.resolve(new this(d),E)},g.reject=function(E){var k=new this(d);return u.reject(k,E)},g.all=function(E){var k=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=E.length,D=!1;if(!P)return this.resolve([]);for(var R=new Array(P),z=0,F=-1,H=new this(d);++F<P;)$(E[F],F);return H;function $(K,G){k.resolve(K).then(function(j){R[G]=j,++z!==P||D||(D=!0,u.resolve(H,R))},function(j){D||(D=!0,u.reject(H,j))})}},g.race=function(E){var k=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=E.length,D=!1;if(!P)return this.resolve([]);for(var R=-1,z=new this(d);++R<P;)F=E[R],k.resolve(F).then(function(H){D||(D=!0,u.resolve(z,H))},function(H){D||(D=!0,u.reject(z,H))});var F;return z}},{immediate:36}],38:[function(p,y,A){var h={};(0,p("./lib/utils/common").assign)(h,p("./lib/deflate"),p("./lib/inflate"),p("./lib/zlib/constants")),y.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(p,y,A){var h=p("./zlib/deflate"),d=p("./utils/common"),u=p("./utils/strings"),c=p("./zlib/messages"),f=p("./zlib/zstream"),m=Object.prototype.toString,g=0,v=-1,b=0,w=8;function _(E){if(!(this instanceof _))return new _(E);this.options=d.assign({level:v,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:b,to:""},E||{});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 f,this.strm.avail_out=0;var P=h.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(P!==g)throw new Error(c[P]);if(k.header&&h.deflateSetHeader(this.strm,k.header),k.dictionary){var D;if(D=typeof k.dictionary=="string"?u.string2buf(k.dictionary):m.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(P=h.deflateSetDictionary(this.strm,D))!==g)throw new Error(c[P]);this._dict_set=!0}}function x(E,k){var P=new _(k);if(P.push(E,!0),P.err)throw P.msg||c[P.err];return P.result}_.prototype.push=function(E,k){var P,D,R=this.strm,z=this.options.chunkSize;if(this.ended)return!1;D=k===~~k?k:k===!0?4:0,typeof E=="string"?R.input=u.string2buf(E):m.call(E)==="[object ArrayBuffer]"?R.input=new Uint8Array(E):R.input=E,R.next_in=0,R.avail_in=R.input.length;do{if(R.avail_out===0&&(R.output=new d.Buf8(z),R.next_out=0,R.avail_out=z),(P=h.deflate(R,D))!==1&&P!==g)return this.onEnd(P),!(this.ended=!0);R.avail_out!==0&&(R.avail_in!==0||D!==4&&D!==2)||(this.options.to==="string"?this.onData(u.buf2binstring(d.shrinkBuf(R.output,R.next_out))):this.onData(d.shrinkBuf(R.output,R.next_out)))}while((0<R.avail_in||R.avail_out===0)&&P!==1);return D===4?(P=h.deflateEnd(this.strm),this.onEnd(P),this.ended=!0,P===g):D!==2||(this.onEnd(g),!(R.avail_out=0))},_.prototype.onData=function(E){this.chunks.push(E)},_.prototype.onEnd=function(E){E===g&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=E,this.msg=this.strm.msg},A.Deflate=_,A.deflate=x,A.deflateRaw=function(E,k){return(k=k||{}).raw=!0,x(E,k)},A.gzip=function(E,k){return(k=k||{}).gzip=!0,x(E,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(p,y,A){var h=p("./zlib/inflate"),d=p("./utils/common"),u=p("./utils/strings"),c=p("./zlib/constants"),f=p("./zlib/messages"),m=p("./zlib/zstream"),g=p("./zlib/gzheader"),v=Object.prototype.toString;function b(_){if(!(this instanceof b))return new b(_);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},_||{});var x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||_&&_.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&!(15&x.windowBits)&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var E=h.inflateInit2(this.strm,x.windowBits);if(E!==c.Z_OK)throw new Error(f[E]);this.header=new g,h.inflateGetHeader(this.strm,this.header)}function w(_,x){var E=new b(x);if(E.push(_,!0),E.err)throw E.msg||f[E.err];return E.result}b.prototype.push=function(_,x){var E,k,P,D,R,z,F=this.strm,H=this.options.chunkSize,$=this.options.dictionary,K=!1;if(this.ended)return!1;k=x===~~x?x:x===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof _=="string"?F.input=u.binstring2buf(_):v.call(_)==="[object ArrayBuffer]"?F.input=new Uint8Array(_):F.input=_,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new d.Buf8(H),F.next_out=0,F.avail_out=H),(E=h.inflate(F,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&$&&(z=typeof $=="string"?u.string2buf($):v.call($)==="[object ArrayBuffer]"?new Uint8Array($):$,E=h.inflateSetDictionary(this.strm,z)),E===c.Z_BUF_ERROR&&K===!0&&(E=c.Z_OK,K=!1),E!==c.Z_STREAM_END&&E!==c.Z_OK)return this.onEnd(E),!(this.ended=!0);F.next_out&&(F.avail_out!==0&&E!==c.Z_STREAM_END&&(F.avail_in!==0||k!==c.Z_FINISH&&k!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(P=u.utf8border(F.output,F.next_out),D=F.next_out-P,R=u.buf2string(F.output,P),F.next_out=D,F.avail_out=H-D,D&&d.arraySet(F.output,F.output,P,D,0),this.onData(R)):this.onData(d.shrinkBuf(F.output,F.next_out)))),F.avail_in===0&&F.avail_out===0&&(K=!0)}while((0<F.avail_in||F.avail_out===0)&&E!==c.Z_STREAM_END);return E===c.Z_STREAM_END&&(k=c.Z_FINISH),k===c.Z_FINISH?(E=h.inflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===c.Z_OK):k!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(F.avail_out=0))},b.prototype.onData=function(_){this.chunks.push(_)},b.prototype.onEnd=function(_){_===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},A.Inflate=b,A.inflate=w,A.inflateRaw=function(_,x){return(x=x||{}).raw=!0,w(_,x)},A.ungzip=w},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(p,y,A){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";A.assign=function(c){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var m=f.shift();if(m){if(typeof m!="object")throw new TypeError(m+"must be non-object");for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])}}return c},A.shrinkBuf=function(c,f){return c.length===f?c:c.subarray?c.subarray(0,f):(c.length=f,c)};var d={arraySet:function(c,f,m,g,v){if(f.subarray&&c.subarray)c.set(f.subarray(m,m+g),v);else for(var b=0;b<g;b++)c[v+b]=f[m+b]},flattenChunks:function(c){var f,m,g,v,b,w;for(f=g=0,m=c.length;f<m;f++)g+=c[f].length;for(w=new Uint8Array(g),f=v=0,m=c.length;f<m;f++)b=c[f],w.set(b,v),v+=b.length;return w}},u={arraySet:function(c,f,m,g,v){for(var b=0;b<g;b++)c[v+b]=f[m+b]},flattenChunks:function(c){return[].concat.apply([],c)}};A.setTyped=function(c){c?(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(p,y,A){var h=p("./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 c=new h.Buf8(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function m(g,v){if(v<65537&&(g.subarray&&u||!g.subarray&&d))return String.fromCharCode.apply(null,h.shrinkBuf(g,v));for(var b="",w=0;w<v;w++)b+=String.fromCharCode(g[w]);return b}c[254]=c[254]=1,A.string2buf=function(g){var v,b,w,_,x,E=g.length,k=0;for(_=0;_<E;_++)(64512&(b=g.charCodeAt(_)))==55296&&_+1<E&&(64512&(w=g.charCodeAt(_+1)))==56320&&(b=65536+(b-55296<<10)+(w-56320),_++),k+=b<128?1:b<2048?2:b<65536?3:4;for(v=new h.Buf8(k),_=x=0;x<k;_++)(64512&(b=g.charCodeAt(_)))==55296&&_+1<E&&(64512&(w=g.charCodeAt(_+1)))==56320&&(b=65536+(b-55296<<10)+(w-56320),_++),b<128?v[x++]=b:(b<2048?v[x++]=192|b>>>6:(b<65536?v[x++]=224|b>>>12:(v[x++]=240|b>>>18,v[x++]=128|b>>>12&63),v[x++]=128|b>>>6&63),v[x++]=128|63&b);return v},A.buf2binstring=function(g){return m(g,g.length)},A.binstring2buf=function(g){for(var v=new h.Buf8(g.length),b=0,w=v.length;b<w;b++)v[b]=g.charCodeAt(b);return v},A.buf2string=function(g,v){var b,w,_,x,E=v||g.length,k=new Array(2*E);for(b=w=0;b<E;)if((_=g[b++])<128)k[w++]=_;else if(4<(x=c[_]))k[w++]=65533,b+=x-1;else{for(_&=x===2?31:x===3?15:7;1<x&&b<E;)_=_<<6|63&g[b++],x--;1<x?k[w++]=65533:_<65536?k[w++]=_:(_-=65536,k[w++]=55296|_>>10&1023,k[w++]=56320|1023&_)}return m(k,w)},A.utf8border=function(g,v){var b;for((v=v||g.length)>g.length&&(v=g.length),b=v-1;0<=b&&(192&g[b])==128;)b--;return b<0||b===0?v:b+c[g[b]]>v?b:v}},{"./common":41}],43:[function(p,y,A){y.exports=function(h,d,u,c){for(var f=65535&h|0,m=h>>>16&65535|0,g=0;u!==0;){for(u-=g=2e3<u?2e3:u;m=m+(f=f+d[c++]|0)|0,--g;);f%=65521,m%=65521}return f|m<<16|0}},{}],44:[function(p,y,A){y.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(p,y,A){var h=function(){for(var d,u=[],c=0;c<256;c++){d=c;for(var f=0;f<8;f++)d=1&d?3988292384^d>>>1:d>>>1;u[c]=d}return u}();y.exports=function(d,u,c,f){var m=h,g=f+c;d^=-1;for(var v=f;v<g;v++)d=d>>>8^m[255&(d^u[v])];return-1^d}},{}],46:[function(p,y,A){var h,d=p("../utils/common"),u=p("./trees"),c=p("./adler32"),f=p("./crc32"),m=p("./messages"),g=0,v=4,b=0,w=-2,_=-1,x=4,E=2,k=8,P=9,D=286,R=30,z=19,F=2*D+1,H=15,$=3,K=258,G=K+$+1,j=42,N=113,I=1,L=2,U=3,O=4;function Q(se,V){return se.msg=m[V],V}function W(se){return(se<<1)-(4<se?9:0)}function Z(se){for(var V=se.length;0<=--V;)se[V]=0}function J(se){var V=se.state,Ce=V.pending;Ce>se.avail_out&&(Ce=se.avail_out),Ce!==0&&(d.arraySet(se.output,V.pending_buf,V.pending_out,Ce,se.next_out),se.next_out+=Ce,V.pending_out+=Ce,se.total_out+=Ce,se.avail_out-=Ce,V.pending-=Ce,V.pending===0&&(V.pending_out=0))}function ne(se,V){u._tr_flush_block(se,0<=se.block_start?se.block_start:-1,se.strstart-se.block_start,V),se.block_start=se.strstart,J(se.strm)}function ae(se,V){se.pending_buf[se.pending++]=V}function ce(se,V){se.pending_buf[se.pending++]=V>>>8&255,se.pending_buf[se.pending++]=255&V}function q(se,V){var Ce,ve,ye=se.max_chain_length,Ae=se.strstart,me=se.prev_length,be=se.nice_match,we=se.strstart>se.w_size-G?se.strstart-(se.w_size-G):0,Te=se.window,He=se.w_mask,je=se.prev,qe=se.strstart+K,tt=Te[Ae+me-1],mt=Te[Ae+me];se.prev_length>=se.good_match&&(ye>>=2),be>se.lookahead&&(be=se.lookahead);do if(Te[(Ce=V)+me]===mt&&Te[Ce+me-1]===tt&&Te[Ce]===Te[Ae]&&Te[++Ce]===Te[Ae+1]){Ae+=2,Ce++;do;while(Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Ae<qe);if(ve=K-(qe-Ae),Ae=qe-K,me<ve){if(se.match_start=V,be<=(me=ve))break;tt=Te[Ae+me-1],mt=Te[Ae+me]}}while((V=je[V&He])>we&&--ye!=0);return me<=se.lookahead?me:se.lookahead}function fe(se){var V,Ce,ve,ye,Ae,me,be,we,Te,He,je=se.w_size;do{if(ye=se.window_size-se.lookahead-se.strstart,se.strstart>=je+(je-G)){for(d.arraySet(se.window,se.window,je,je,0),se.match_start-=je,se.strstart-=je,se.block_start-=je,V=Ce=se.hash_size;ve=se.head[--V],se.head[V]=je<=ve?ve-je:0,--Ce;);for(V=Ce=je;ve=se.prev[--V],se.prev[V]=je<=ve?ve-je:0,--Ce;);ye+=je}if(se.strm.avail_in===0)break;if(me=se.strm,be=se.window,we=se.strstart+se.lookahead,Te=ye,He=void 0,He=me.avail_in,Te<He&&(He=Te),Ce=He===0?0:(me.avail_in-=He,d.arraySet(be,me.input,me.next_in,He,we),me.state.wrap===1?me.adler=c(me.adler,be,He,we):me.state.wrap===2&&(me.adler=f(me.adler,be,He,we)),me.next_in+=He,me.total_in+=He,He),se.lookahead+=Ce,se.lookahead+se.insert>=$)for(Ae=se.strstart-se.insert,se.ins_h=se.window[Ae],se.ins_h=(se.ins_h<<se.hash_shift^se.window[Ae+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[Ae+$-1])&se.hash_mask,se.prev[Ae&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=Ae,Ae++,se.insert--,!(se.lookahead+se.insert<$)););}while(se.lookahead<G&&se.strm.avail_in!==0)}function re(se,V){for(var Ce,ve;;){if(se.lookahead<G){if(fe(se),se.lookahead<G&&V===g)return I;if(se.lookahead===0)break}if(Ce=0,se.lookahead>=$&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ce!==0&&se.strstart-Ce<=se.w_size-G&&(se.match_length=q(se,Ce)),se.match_length>=$)if(ve=u._tr_tally(se,se.strstart-se.match_start,se.match_length-$),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=$){for(se.match_length--;se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart,--se.match_length!=0;);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else ve=u._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(ve&&(ne(se,!1),se.strm.avail_out===0))return I}return se.insert=se.strstart<$-1?se.strstart:$-1,V===v?(ne(se,!0),se.strm.avail_out===0?U:O):se.last_lit&&(ne(se,!1),se.strm.avail_out===0)?I:L}function te(se,V){for(var Ce,ve,ye;;){if(se.lookahead<G){if(fe(se),se.lookahead<G&&V===g)return I;if(se.lookahead===0)break}if(Ce=0,se.lookahead>=$&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=$-1,Ce!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ce<=se.w_size-G&&(se.match_length=q(se,Ce),se.match_length<=5&&(se.strategy===1||se.match_length===$&&4096<se.strstart-se.match_start)&&(se.match_length=$-1)),se.prev_length>=$&&se.match_length<=se.prev_length){for(ye=se.strstart+se.lookahead-$,ve=u._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-$),se.lookahead-=se.prev_length-1,se.prev_length-=2;++se.strstart<=ye&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),--se.prev_length!=0;);if(se.match_available=0,se.match_length=$-1,se.strstart++,ve&&(ne(se,!1),se.strm.avail_out===0))return I}else if(se.match_available){if((ve=u._tr_tally(se,0,se.window[se.strstart-1]))&&ne(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return I}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(ve=u._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<$-1?se.strstart:$-1,V===v?(ne(se,!0),se.strm.avail_out===0?U:O):se.last_lit&&(ne(se,!1),se.strm.avail_out===0)?I:L}function le(se,V,Ce,ve,ye){this.good_length=se,this.max_lazy=V,this.nice_length=Ce,this.max_chain=ve,this.func=ye}function de(){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*F),this.dyn_dtree=new d.Buf16(2*(2*R+1)),this.bl_tree=new d.Buf16(2*(2*z+1)),Z(this.dyn_ltree),Z(this.dyn_dtree),Z(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*D+1),Z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*D+1),Z(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 he(se){var V;return se&&se.state?(se.total_in=se.total_out=0,se.data_type=E,(V=se.state).pending=0,V.pending_out=0,V.wrap<0&&(V.wrap=-V.wrap),V.status=V.wrap?j:N,se.adler=V.wrap===2?0:1,V.last_flush=g,u._tr_init(V),b):Q(se,w)}function ue(se){var V=he(se);return V===b&&function(Ce){Ce.window_size=2*Ce.w_size,Z(Ce.head),Ce.max_lazy_match=h[Ce.level].max_lazy,Ce.good_match=h[Ce.level].good_length,Ce.nice_match=h[Ce.level].nice_length,Ce.max_chain_length=h[Ce.level].max_chain,Ce.strstart=0,Ce.block_start=0,Ce.lookahead=0,Ce.insert=0,Ce.match_length=Ce.prev_length=$-1,Ce.match_available=0,Ce.ins_h=0}(se.state),V}function pe(se,V,Ce,ve,ye,Ae){if(!se)return w;var me=1;if(V===_&&(V=6),ve<0?(me=0,ve=-ve):15<ve&&(me=2,ve-=16),ye<1||P<ye||Ce!==k||ve<8||15<ve||V<0||9<V||Ae<0||x<Ae)return Q(se,w);ve===8&&(ve=9);var be=new de;return(se.state=be).strm=se,be.wrap=me,be.gzhead=null,be.w_bits=ve,be.w_size=1<<be.w_bits,be.w_mask=be.w_size-1,be.hash_bits=ye+7,be.hash_size=1<<be.hash_bits,be.hash_mask=be.hash_size-1,be.hash_shift=~~((be.hash_bits+$-1)/$),be.window=new d.Buf8(2*be.w_size),be.head=new d.Buf16(be.hash_size),be.prev=new d.Buf16(be.w_size),be.lit_bufsize=1<<ye+6,be.pending_buf_size=4*be.lit_bufsize,be.pending_buf=new d.Buf8(be.pending_buf_size),be.d_buf=1*be.lit_bufsize,be.l_buf=3*be.lit_bufsize,be.level=V,be.strategy=Ae,be.method=Ce,ue(se)}h=[new le(0,0,0,0,function(se,V){var Ce=65535;for(Ce>se.pending_buf_size-5&&(Ce=se.pending_buf_size-5);;){if(se.lookahead<=1){if(fe(se),se.lookahead===0&&V===g)return I;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var ve=se.block_start+Ce;if((se.strstart===0||se.strstart>=ve)&&(se.lookahead=se.strstart-ve,se.strstart=ve,ne(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-G&&(ne(se,!1),se.strm.avail_out===0))return I}return se.insert=0,V===v?(ne(se,!0),se.strm.avail_out===0?U:O):(se.strstart>se.block_start&&(ne(se,!1),se.strm.avail_out),I)}),new le(4,4,8,4,re),new le(4,5,16,8,re),new le(4,6,32,32,re),new le(4,4,16,16,te),new le(8,16,32,32,te),new le(8,16,128,128,te),new le(8,32,128,256,te),new le(32,128,258,1024,te),new le(32,258,258,4096,te)],A.deflateInit=function(se,V){return pe(se,V,k,15,8,0)},A.deflateInit2=pe,A.deflateReset=ue,A.deflateResetKeep=he,A.deflateSetHeader=function(se,V){return se&&se.state?se.state.wrap!==2?w:(se.state.gzhead=V,b):w},A.deflate=function(se,V){var Ce,ve,ye,Ae;if(!se||!se.state||5<V||V<0)return se?Q(se,w):w;if(ve=se.state,!se.output||!se.input&&se.avail_in!==0||ve.status===666&&V!==v)return Q(se,se.avail_out===0?-5:w);if(ve.strm=se,Ce=ve.last_flush,ve.last_flush=V,ve.status===j)if(ve.wrap===2)se.adler=0,ae(ve,31),ae(ve,139),ae(ve,8),ve.gzhead?(ae(ve,(ve.gzhead.text?1:0)+(ve.gzhead.hcrc?2:0)+(ve.gzhead.extra?4:0)+(ve.gzhead.name?8:0)+(ve.gzhead.comment?16:0)),ae(ve,255&ve.gzhead.time),ae(ve,ve.gzhead.time>>8&255),ae(ve,ve.gzhead.time>>16&255),ae(ve,ve.gzhead.time>>24&255),ae(ve,ve.level===9?2:2<=ve.strategy||ve.level<2?4:0),ae(ve,255&ve.gzhead.os),ve.gzhead.extra&&ve.gzhead.extra.length&&(ae(ve,255&ve.gzhead.extra.length),ae(ve,ve.gzhead.extra.length>>8&255)),ve.gzhead.hcrc&&(se.adler=f(se.adler,ve.pending_buf,ve.pending,0)),ve.gzindex=0,ve.status=69):(ae(ve,0),ae(ve,0),ae(ve,0),ae(ve,0),ae(ve,0),ae(ve,ve.level===9?2:2<=ve.strategy||ve.level<2?4:0),ae(ve,3),ve.status=N);else{var me=k+(ve.w_bits-8<<4)<<8;me|=(2<=ve.strategy||ve.level<2?0:ve.level<6?1:ve.level===6?2:3)<<6,ve.strstart!==0&&(me|=32),me+=31-me%31,ve.status=N,ce(ve,me),ve.strstart!==0&&(ce(ve,se.adler>>>16),ce(ve,65535&se.adler)),se.adler=1}if(ve.status===69)if(ve.gzhead.extra){for(ye=ve.pending;ve.gzindex<(65535&ve.gzhead.extra.length)&&(ve.pending!==ve.pending_buf_size||(ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),J(se),ye=ve.pending,ve.pending!==ve.pending_buf_size));)ae(ve,255&ve.gzhead.extra[ve.gzindex]),ve.gzindex++;ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),ve.gzindex===ve.gzhead.extra.length&&(ve.gzindex=0,ve.status=73)}else ve.status=73;if(ve.status===73)if(ve.gzhead.name){ye=ve.pending;do{if(ve.pending===ve.pending_buf_size&&(ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),J(se),ye=ve.pending,ve.pending===ve.pending_buf_size)){Ae=1;break}Ae=ve.gzindex<ve.gzhead.name.length?255&ve.gzhead.name.charCodeAt(ve.gzindex++):0,ae(ve,Ae)}while(Ae!==0);ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),Ae===0&&(ve.gzindex=0,ve.status=91)}else ve.status=91;if(ve.status===91)if(ve.gzhead.comment){ye=ve.pending;do{if(ve.pending===ve.pending_buf_size&&(ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),J(se),ye=ve.pending,ve.pending===ve.pending_buf_size)){Ae=1;break}Ae=ve.gzindex<ve.gzhead.comment.length?255&ve.gzhead.comment.charCodeAt(ve.gzindex++):0,ae(ve,Ae)}while(Ae!==0);ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),Ae===0&&(ve.status=103)}else ve.status=103;if(ve.status===103&&(ve.gzhead.hcrc?(ve.pending+2>ve.pending_buf_size&&J(se),ve.pending+2<=ve.pending_buf_size&&(ae(ve,255&se.adler),ae(ve,se.adler>>8&255),se.adler=0,ve.status=N)):ve.status=N),ve.pending!==0){if(J(se),se.avail_out===0)return ve.last_flush=-1,b}else if(se.avail_in===0&&W(V)<=W(Ce)&&V!==v)return Q(se,-5);if(ve.status===666&&se.avail_in!==0)return Q(se,-5);if(se.avail_in!==0||ve.lookahead!==0||V!==g&&ve.status!==666){var be=ve.strategy===2?function(we,Te){for(var He;;){if(we.lookahead===0&&(fe(we),we.lookahead===0)){if(Te===g)return I;break}if(we.match_length=0,He=u._tr_tally(we,0,we.window[we.strstart]),we.lookahead--,we.strstart++,He&&(ne(we,!1),we.strm.avail_out===0))return I}return we.insert=0,Te===v?(ne(we,!0),we.strm.avail_out===0?U:O):we.last_lit&&(ne(we,!1),we.strm.avail_out===0)?I:L}(ve,V):ve.strategy===3?function(we,Te){for(var He,je,qe,tt,mt=we.window;;){if(we.lookahead<=K){if(fe(we),we.lookahead<=K&&Te===g)return I;if(we.lookahead===0)break}if(we.match_length=0,we.lookahead>=$&&0<we.strstart&&(je=mt[qe=we.strstart-1])===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]){tt=we.strstart+K;do;while(je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&qe<tt);we.match_length=K-(tt-qe),we.match_length>we.lookahead&&(we.match_length=we.lookahead)}if(we.match_length>=$?(He=u._tr_tally(we,1,we.match_length-$),we.lookahead-=we.match_length,we.strstart+=we.match_length,we.match_length=0):(He=u._tr_tally(we,0,we.window[we.strstart]),we.lookahead--,we.strstart++),He&&(ne(we,!1),we.strm.avail_out===0))return I}return we.insert=0,Te===v?(ne(we,!0),we.strm.avail_out===0?U:O):we.last_lit&&(ne(we,!1),we.strm.avail_out===0)?I:L}(ve,V):h[ve.level].func(ve,V);if(be!==U&&be!==O||(ve.status=666),be===I||be===U)return se.avail_out===0&&(ve.last_flush=-1),b;if(be===L&&(V===1?u._tr_align(ve):V!==5&&(u._tr_stored_block(ve,0,0,!1),V===3&&(Z(ve.head),ve.lookahead===0&&(ve.strstart=0,ve.block_start=0,ve.insert=0))),J(se),se.avail_out===0))return ve.last_flush=-1,b}return V!==v?b:ve.wrap<=0?1:(ve.wrap===2?(ae(ve,255&se.adler),ae(ve,se.adler>>8&255),ae(ve,se.adler>>16&255),ae(ve,se.adler>>24&255),ae(ve,255&se.total_in),ae(ve,se.total_in>>8&255),ae(ve,se.total_in>>16&255),ae(ve,se.total_in>>24&255)):(ce(ve,se.adler>>>16),ce(ve,65535&se.adler)),J(se),0<ve.wrap&&(ve.wrap=-ve.wrap),ve.pending!==0?b:1)},A.deflateEnd=function(se){var V;return se&&se.state?(V=se.state.status)!==j&&V!==69&&V!==73&&V!==91&&V!==103&&V!==N&&V!==666?Q(se,w):(se.state=null,V===N?Q(se,-3):b):w},A.deflateSetDictionary=function(se,V){var Ce,ve,ye,Ae,me,be,we,Te,He=V.length;if(!se||!se.state||(Ae=(Ce=se.state).wrap)===2||Ae===1&&Ce.status!==j||Ce.lookahead)return w;for(Ae===1&&(se.adler=c(se.adler,V,He,0)),Ce.wrap=0,He>=Ce.w_size&&(Ae===0&&(Z(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),Te=new d.Buf8(Ce.w_size),d.arraySet(Te,V,He-Ce.w_size,Ce.w_size,0),V=Te,He=Ce.w_size),me=se.avail_in,be=se.next_in,we=se.input,se.avail_in=He,se.next_in=0,se.input=V,fe(Ce);Ce.lookahead>=$;){for(ve=Ce.strstart,ye=Ce.lookahead-($-1);Ce.ins_h=(Ce.ins_h<<Ce.hash_shift^Ce.window[ve+$-1])&Ce.hash_mask,Ce.prev[ve&Ce.w_mask]=Ce.head[Ce.ins_h],Ce.head[Ce.ins_h]=ve,ve++,--ye;);Ce.strstart=ve,Ce.lookahead=$-1,fe(Ce)}return Ce.strstart+=Ce.lookahead,Ce.block_start=Ce.strstart,Ce.insert=Ce.lookahead,Ce.lookahead=0,Ce.match_length=Ce.prev_length=$-1,Ce.match_available=0,se.next_in=be,se.input=we,se.avail_in=me,Ce.wrap=Ae,b},A.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(p,y,A){y.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(p,y,A){y.exports=function(h,d){var u,c,f,m,g,v,b,w,_,x,E,k,P,D,R,z,F,H,$,K,G,j,N,I,L;u=h.state,c=h.next_in,I=h.input,f=c+(h.avail_in-5),m=h.next_out,L=h.output,g=m-(d-h.avail_out),v=m+(h.avail_out-257),b=u.dmax,w=u.wsize,_=u.whave,x=u.wnext,E=u.window,k=u.hold,P=u.bits,D=u.lencode,R=u.distcode,z=(1<<u.lenbits)-1,F=(1<<u.distbits)-1;e:do{P<15&&(k+=I[c++]<<P,P+=8,k+=I[c++]<<P,P+=8),H=D[k&z];t:for(;;){if(k>>>=$=H>>>24,P-=$,($=H>>>16&255)===0)L[m++]=65535&H;else{if(!(16&$)){if(!(64&$)){H=D[(65535&H)+(k&(1<<$)-1)];continue t}if(32&$){u.mode=12;break e}h.msg="invalid literal/length code",u.mode=30;break e}K=65535&H,($&=15)&&(P<$&&(k+=I[c++]<<P,P+=8),K+=k&(1<<$)-1,k>>>=$,P-=$),P<15&&(k+=I[c++]<<P,P+=8,k+=I[c++]<<P,P+=8),H=R[k&F];r:for(;;){if(k>>>=$=H>>>24,P-=$,!(16&($=H>>>16&255))){if(!(64&$)){H=R[(65535&H)+(k&(1<<$)-1)];continue r}h.msg="invalid distance code",u.mode=30;break e}if(G=65535&H,P<($&=15)&&(k+=I[c++]<<P,(P+=8)<$&&(k+=I[c++]<<P,P+=8)),b<(G+=k&(1<<$)-1)){h.msg="invalid distance too far back",u.mode=30;break e}if(k>>>=$,P-=$,($=m-g)<G){if(_<($=G-$)&&u.sane){h.msg="invalid distance too far back",u.mode=30;break e}if(N=E,(j=0)===x){if(j+=w-$,$<K){for(K-=$;L[m++]=E[j++],--$;);j=m-G,N=L}}else if(x<$){if(j+=w+x-$,($-=x)<K){for(K-=$;L[m++]=E[j++],--$;);if(j=0,x<K){for(K-=$=x;L[m++]=E[j++],--$;);j=m-G,N=L}}}else if(j+=x-$,$<K){for(K-=$;L[m++]=E[j++],--$;);j=m-G,N=L}for(;2<K;)L[m++]=N[j++],L[m++]=N[j++],L[m++]=N[j++],K-=3;K&&(L[m++]=N[j++],1<K&&(L[m++]=N[j++]))}else{for(j=m-G;L[m++]=L[j++],L[m++]=L[j++],L[m++]=L[j++],2<(K-=3););K&&(L[m++]=L[j++],1<K&&(L[m++]=L[j++]))}break}}break}}while(c<f&&m<v);c-=K=P>>3,k&=(1<<(P-=K<<3))-1,h.next_in=c,h.next_out=m,h.avail_in=c<f?f-c+5:5-(c-f),h.avail_out=m<v?v-m+257:257-(m-v),u.hold=k,u.bits=P}},{}],49:[function(p,y,A){var h=p("../utils/common"),d=p("./adler32"),u=p("./crc32"),c=p("./inffast"),f=p("./inftrees"),m=1,g=2,v=0,b=-2,w=1,_=852,x=592;function E(j){return(j>>>24&255)+(j>>>8&65280)+((65280&j)<<8)+((255&j)<<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 P(j){var N;return j&&j.state?(N=j.state,j.total_in=j.total_out=N.total=0,j.msg="",N.wrap&&(j.adler=1&N.wrap),N.mode=w,N.last=0,N.havedict=0,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new h.Buf32(_),N.distcode=N.distdyn=new h.Buf32(x),N.sane=1,N.back=-1,v):b}function D(j){var N;return j&&j.state?((N=j.state).wsize=0,N.whave=0,N.wnext=0,P(j)):b}function R(j,N){var I,L;return j&&j.state?(L=j.state,N<0?(I=0,N=-N):(I=1+(N>>4),N<48&&(N&=15)),N&&(N<8||15<N)?b:(L.window!==null&&L.wbits!==N&&(L.window=null),L.wrap=I,L.wbits=N,D(j))):b}function z(j,N){var I,L;return j?(L=new k,(j.state=L).window=null,(I=R(j,N))!==v&&(j.state=null),I):b}var F,H,$=!0;function K(j){if($){var N;for(F=new h.Buf32(512),H=new h.Buf32(32),N=0;N<144;)j.lens[N++]=8;for(;N<256;)j.lens[N++]=9;for(;N<280;)j.lens[N++]=7;for(;N<288;)j.lens[N++]=8;for(f(m,j.lens,0,288,F,0,j.work,{bits:9}),N=0;N<32;)j.lens[N++]=5;f(g,j.lens,0,32,H,0,j.work,{bits:5}),$=!1}j.lencode=F,j.lenbits=9,j.distcode=H,j.distbits=5}function G(j,N,I,L){var U,O=j.state;return O.window===null&&(O.wsize=1<<O.wbits,O.wnext=0,O.whave=0,O.window=new h.Buf8(O.wsize)),L>=O.wsize?(h.arraySet(O.window,N,I-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(L<(U=O.wsize-O.wnext)&&(U=L),h.arraySet(O.window,N,I-L,U,O.wnext),(L-=U)?(h.arraySet(O.window,N,I-L,L,0),O.wnext=L,O.whave=O.wsize):(O.wnext+=U,O.wnext===O.wsize&&(O.wnext=0),O.whave<O.wsize&&(O.whave+=U))),0}A.inflateReset=D,A.inflateReset2=R,A.inflateResetKeep=P,A.inflateInit=function(j){return z(j,15)},A.inflateInit2=z,A.inflate=function(j,N){var I,L,U,O,Q,W,Z,J,ne,ae,ce,q,fe,re,te,le,de,he,ue,pe,se,V,Ce,ve,ye=0,Ae=new h.Buf8(4),me=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!j||!j.state||!j.output||!j.input&&j.avail_in!==0)return b;(I=j.state).mode===12&&(I.mode=13),Q=j.next_out,U=j.output,Z=j.avail_out,O=j.next_in,L=j.input,W=j.avail_in,J=I.hold,ne=I.bits,ae=W,ce=Z,V=v;e:for(;;)switch(I.mode){case w:if(I.wrap===0){I.mode=13;break}for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(2&I.wrap&&J===35615){Ae[I.check=0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0),ne=J=0,I.mode=2;break}if(I.flags=0,I.head&&(I.head.done=!1),!(1&I.wrap)||(((255&J)<<8)+(J>>8))%31){j.msg="incorrect header check",I.mode=30;break}if((15&J)!=8){j.msg="unknown compression method",I.mode=30;break}if(ne-=4,se=8+(15&(J>>>=4)),I.wbits===0)I.wbits=se;else if(se>I.wbits){j.msg="invalid window size",I.mode=30;break}I.dmax=1<<se,j.adler=I.check=1,I.mode=512&J?10:12,ne=J=0;break;case 2:for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(I.flags=J,(255&I.flags)!=8){j.msg="unknown compression method",I.mode=30;break}if(57344&I.flags){j.msg="unknown header flags set",I.mode=30;break}I.head&&(I.head.text=J>>8&1),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0)),ne=J=0,I.mode=3;case 3:for(;ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.head&&(I.head.time=J),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,Ae[2]=J>>>16&255,Ae[3]=J>>>24&255,I.check=u(I.check,Ae,4,0)),ne=J=0,I.mode=4;case 4:for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.head&&(I.head.xflags=255&J,I.head.os=J>>8),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0)),ne=J=0,I.mode=5;case 5:if(1024&I.flags){for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.length=J,I.head&&(I.head.extra_len=J),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0)),ne=J=0}else I.head&&(I.head.extra=null);I.mode=6;case 6:if(1024&I.flags&&(W<(q=I.length)&&(q=W),q&&(I.head&&(se=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Array(I.head.extra_len)),h.arraySet(I.head.extra,L,O,q,se)),512&I.flags&&(I.check=u(I.check,L,q,O)),W-=q,O+=q,I.length-=q),I.length))break e;I.length=0,I.mode=7;case 7:if(2048&I.flags){if(W===0)break e;for(q=0;se=L[O+q++],I.head&&se&&I.length<65536&&(I.head.name+=String.fromCharCode(se)),se&&q<W;);if(512&I.flags&&(I.check=u(I.check,L,q,O)),W-=q,O+=q,se)break e}else I.head&&(I.head.name=null);I.length=0,I.mode=8;case 8:if(4096&I.flags){if(W===0)break e;for(q=0;se=L[O+q++],I.head&&se&&I.length<65536&&(I.head.comment+=String.fromCharCode(se)),se&&q<W;);if(512&I.flags&&(I.check=u(I.check,L,q,O)),W-=q,O+=q,se)break e}else I.head&&(I.head.comment=null);I.mode=9;case 9:if(512&I.flags){for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(J!==(65535&I.check)){j.msg="header crc mismatch",I.mode=30;break}ne=J=0}I.head&&(I.head.hcrc=I.flags>>9&1,I.head.done=!0),j.adler=I.check=0,I.mode=12;break;case 10:for(;ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}j.adler=I.check=E(J),ne=J=0,I.mode=11;case 11:if(I.havedict===0)return j.next_out=Q,j.avail_out=Z,j.next_in=O,j.avail_in=W,I.hold=J,I.bits=ne,2;j.adler=I.check=1,I.mode=12;case 12:if(N===5||N===6)break e;case 13:if(I.last){J>>>=7&ne,ne-=7&ne,I.mode=27;break}for(;ne<3;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}switch(I.last=1&J,ne-=1,3&(J>>>=1)){case 0:I.mode=14;break;case 1:if(K(I),I.mode=20,N!==6)break;J>>>=2,ne-=2;break e;case 2:I.mode=17;break;case 3:j.msg="invalid block type",I.mode=30}J>>>=2,ne-=2;break;case 14:for(J>>>=7&ne,ne-=7≠ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if((65535&J)!=(J>>>16^65535)){j.msg="invalid stored block lengths",I.mode=30;break}if(I.length=65535&J,ne=J=0,I.mode=15,N===6)break e;case 15:I.mode=16;case 16:if(q=I.length){if(W<q&&(q=W),Z<q&&(q=Z),q===0)break e;h.arraySet(U,L,O,q,Q),W-=q,O+=q,Z-=q,Q+=q,I.length-=q;break}I.mode=12;break;case 17:for(;ne<14;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(I.nlen=257+(31&J),J>>>=5,ne-=5,I.ndist=1+(31&J),J>>>=5,ne-=5,I.ncode=4+(15&J),J>>>=4,ne-=4,286<I.nlen||30<I.ndist){j.msg="too many length or distance symbols",I.mode=30;break}I.have=0,I.mode=18;case 18:for(;I.have<I.ncode;){for(;ne<3;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.lens[me[I.have++]]=7&J,J>>>=3,ne-=3}for(;I.have<19;)I.lens[me[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,Ce={bits:I.lenbits},V=f(0,I.lens,0,19,I.lencode,0,I.work,Ce),I.lenbits=Ce.bits,V){j.msg="invalid code lengths set",I.mode=30;break}I.have=0,I.mode=19;case 19:for(;I.have<I.nlen+I.ndist;){for(;le=(ye=I.lencode[J&(1<<I.lenbits)-1])>>>16&255,de=65535&ye,!((te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(de<16)J>>>=te,ne-=te,I.lens[I.have++]=de;else{if(de===16){for(ve=te+2;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(J>>>=te,ne-=te,I.have===0){j.msg="invalid bit length repeat",I.mode=30;break}se=I.lens[I.have-1],q=3+(3&J),J>>>=2,ne-=2}else if(de===17){for(ve=te+3;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}ne-=te,se=0,q=3+(7&(J>>>=te)),J>>>=3,ne-=3}else{for(ve=te+7;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}ne-=te,se=0,q=11+(127&(J>>>=te)),J>>>=7,ne-=7}if(I.have+q>I.nlen+I.ndist){j.msg="invalid bit length repeat",I.mode=30;break}for(;q--;)I.lens[I.have++]=se}}if(I.mode===30)break;if(I.lens[256]===0){j.msg="invalid code -- missing end-of-block",I.mode=30;break}if(I.lenbits=9,Ce={bits:I.lenbits},V=f(m,I.lens,0,I.nlen,I.lencode,0,I.work,Ce),I.lenbits=Ce.bits,V){j.msg="invalid literal/lengths set",I.mode=30;break}if(I.distbits=6,I.distcode=I.distdyn,Ce={bits:I.distbits},V=f(g,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,Ce),I.distbits=Ce.bits,V){j.msg="invalid distances set",I.mode=30;break}if(I.mode=20,N===6)break e;case 20:I.mode=21;case 21:if(6<=W&&258<=Z){j.next_out=Q,j.avail_out=Z,j.next_in=O,j.avail_in=W,I.hold=J,I.bits=ne,c(j,ce),Q=j.next_out,U=j.output,Z=j.avail_out,O=j.next_in,L=j.input,W=j.avail_in,J=I.hold,ne=I.bits,I.mode===12&&(I.back=-1);break}for(I.back=0;le=(ye=I.lencode[J&(1<<I.lenbits)-1])>>>16&255,de=65535&ye,!((te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(le&&!(240&le)){for(he=te,ue=le,pe=de;le=(ye=I.lencode[pe+((J&(1<<he+ue)-1)>>he)])>>>16&255,de=65535&ye,!(he+(te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}J>>>=he,ne-=he,I.back+=he}if(J>>>=te,ne-=te,I.back+=te,I.length=de,le===0){I.mode=26;break}if(32&le){I.back=-1,I.mode=12;break}if(64&le){j.msg="invalid literal/length code",I.mode=30;break}I.extra=15&le,I.mode=22;case 22:if(I.extra){for(ve=I.extra;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.length+=J&(1<<I.extra)-1,J>>>=I.extra,ne-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=23;case 23:for(;le=(ye=I.distcode[J&(1<<I.distbits)-1])>>>16&255,de=65535&ye,!((te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(!(240&le)){for(he=te,ue=le,pe=de;le=(ye=I.distcode[pe+((J&(1<<he+ue)-1)>>he)])>>>16&255,de=65535&ye,!(he+(te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}J>>>=he,ne-=he,I.back+=he}if(J>>>=te,ne-=te,I.back+=te,64&le){j.msg="invalid distance code",I.mode=30;break}I.offset=de,I.extra=15&le,I.mode=24;case 24:if(I.extra){for(ve=I.extra;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.offset+=J&(1<<I.extra)-1,J>>>=I.extra,ne-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){j.msg="invalid distance too far back",I.mode=30;break}I.mode=25;case 25:if(Z===0)break e;if(q=ce-Z,I.offset>q){if((q=I.offset-q)>I.whave&&I.sane){j.msg="invalid distance too far back",I.mode=30;break}fe=q>I.wnext?(q-=I.wnext,I.wsize-q):I.wnext-q,q>I.length&&(q=I.length),re=I.window}else re=U,fe=Q-I.offset,q=I.length;for(Z<q&&(q=Z),Z-=q,I.length-=q;U[Q++]=re[fe++],--q;);I.length===0&&(I.mode=21);break;case 26:if(Z===0)break e;U[Q++]=I.length,Z--,I.mode=21;break;case 27:if(I.wrap){for(;ne<32;){if(W===0)break e;W--,J|=L[O++]<<ne,ne+=8}if(ce-=Z,j.total_out+=ce,I.total+=ce,ce&&(j.adler=I.check=I.flags?u(I.check,U,ce,Q-ce):d(I.check,U,ce,Q-ce)),ce=Z,(I.flags?J:E(J))!==I.check){j.msg="incorrect data check",I.mode=30;break}ne=J=0}I.mode=28;case 28:if(I.wrap&&I.flags){for(;ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(J!==(4294967295&I.total)){j.msg="incorrect length check",I.mode=30;break}ne=J=0}I.mode=29;case 29:V=1;break e;case 30:V=-3;break e;case 31:return-4;case 32:default:return b}return j.next_out=Q,j.avail_out=Z,j.next_in=O,j.avail_in=W,I.hold=J,I.bits=ne,(I.wsize||ce!==j.avail_out&&I.mode<30&&(I.mode<27||N!==4))&&G(j,j.output,j.next_out,ce-j.avail_out)?(I.mode=31,-4):(ae-=j.avail_in,ce-=j.avail_out,j.total_in+=ae,j.total_out+=ce,I.total+=ce,I.wrap&&ce&&(j.adler=I.check=I.flags?u(I.check,U,ce,j.next_out-ce):d(I.check,U,ce,j.next_out-ce)),j.data_type=I.bits+(I.last?64:0)+(I.mode===12?128:0)+(I.mode===20||I.mode===15?256:0),(ae==0&&ce===0||N===4)&&V===v&&(V=-5),V)},A.inflateEnd=function(j){if(!j||!j.state)return b;var N=j.state;return N.window&&(N.window=null),j.state=null,v},A.inflateGetHeader=function(j,N){var I;return j&&j.state&&2&(I=j.state).wrap?((I.head=N).done=!1,v):b},A.inflateSetDictionary=function(j,N){var I,L=N.length;return j&&j.state?(I=j.state).wrap!==0&&I.mode!==11?b:I.mode===11&&d(1,N,L,0)!==I.check?-3:G(j,N,L,L)?(I.mode=31,-4):(I.havedict=1,v):b},A.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(p,y,A){var h=p("../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],c=[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],f=[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];y.exports=function(m,g,v,b,w,_,x,E){var k,P,D,R,z,F,H,$,K,G=E.bits,j=0,N=0,I=0,L=0,U=0,O=0,Q=0,W=0,Z=0,J=0,ne=null,ae=0,ce=new h.Buf16(16),q=new h.Buf16(16),fe=null,re=0;for(j=0;j<=15;j++)ce[j]=0;for(N=0;N<b;N++)ce[g[v+N]]++;for(U=G,L=15;1<=L&&ce[L]===0;L--);if(L<U&&(U=L),L===0)return w[_++]=20971520,w[_++]=20971520,E.bits=1,0;for(I=1;I<L&&ce[I]===0;I++);for(U<I&&(U=I),j=W=1;j<=15;j++)if(W<<=1,(W-=ce[j])<0)return-1;if(0<W&&(m===0||L!==1))return-1;for(q[1]=0,j=1;j<15;j++)q[j+1]=q[j]+ce[j];for(N=0;N<b;N++)g[v+N]!==0&&(x[q[g[v+N]]++]=N);if(F=m===0?(ne=fe=x,19):m===1?(ne=d,ae-=257,fe=u,re-=257,256):(ne=c,fe=f,-1),j=I,z=_,Q=N=J=0,D=-1,R=(Z=1<<(O=U))-1,m===1&&852<Z||m===2&&592<Z)return 1;for(;;){for(H=j-Q,K=x[N]<F?($=0,x[N]):x[N]>F?($=fe[re+x[N]],ne[ae+x[N]]):($=96,0),k=1<<j-Q,I=P=1<<O;w[z+(J>>Q)+(P-=k)]=H<<24|$<<16|K|0,P!==0;);for(k=1<<j-1;J&k;)k>>=1;if(k!==0?(J&=k-1,J+=k):J=0,N++,--ce[j]==0){if(j===L)break;j=g[v+x[N]]}if(U<j&&(J&R)!==D){for(Q===0&&(Q=U),z+=I,W=1<<(O=j-Q);O+Q<L&&!((W-=ce[O+Q])<=0);)O++,W<<=1;if(Z+=1<<O,m===1&&852<Z||m===2&&592<Z)return 1;w[D=J&R]=U<<24|O<<16|z-_|0}}return J!==0&&(w[z+J]=j-Q<<24|64<<16|0),E.bits=U,0}},{"../utils/common":41}],51:[function(p,y,A){y.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(p,y,A){var h=p("../utils/common"),d=0,u=1;function c(ye){for(var Ae=ye.length;0<=--Ae;)ye[Ae]=0}var f=0,m=29,g=256,v=g+1+m,b=30,w=19,_=2*v+1,x=15,E=16,k=7,P=256,D=16,R=17,z=18,F=[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],$=[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],G=new Array(2*(v+2));c(G);var j=new Array(2*b);c(j);var N=new Array(512);c(N);var I=new Array(256);c(I);var L=new Array(m);c(L);var U,O,Q,W=new Array(b);function Z(ye,Ae,me,be,we){this.static_tree=ye,this.extra_bits=Ae,this.extra_base=me,this.elems=be,this.max_length=we,this.has_stree=ye&&ye.length}function J(ye,Ae){this.dyn_tree=ye,this.max_code=0,this.stat_desc=Ae}function ne(ye){return ye<256?N[ye]:N[256+(ye>>>7)]}function ae(ye,Ae){ye.pending_buf[ye.pending++]=255&Ae,ye.pending_buf[ye.pending++]=Ae>>>8&255}function ce(ye,Ae,me){ye.bi_valid>E-me?(ye.bi_buf|=Ae<<ye.bi_valid&65535,ae(ye,ye.bi_buf),ye.bi_buf=Ae>>E-ye.bi_valid,ye.bi_valid+=me-E):(ye.bi_buf|=Ae<<ye.bi_valid&65535,ye.bi_valid+=me)}function q(ye,Ae,me){ce(ye,me[2*Ae],me[2*Ae+1])}function fe(ye,Ae){for(var me=0;me|=1&ye,ye>>>=1,me<<=1,0<--Ae;);return me>>>1}function re(ye,Ae,me){var be,we,Te=new Array(x+1),He=0;for(be=1;be<=x;be++)Te[be]=He=He+me[be-1]<<1;for(we=0;we<=Ae;we++){var je=ye[2*we+1];je!==0&&(ye[2*we]=fe(Te[je]++,je))}}function te(ye){var Ae;for(Ae=0;Ae<v;Ae++)ye.dyn_ltree[2*Ae]=0;for(Ae=0;Ae<b;Ae++)ye.dyn_dtree[2*Ae]=0;for(Ae=0;Ae<w;Ae++)ye.bl_tree[2*Ae]=0;ye.dyn_ltree[2*P]=1,ye.opt_len=ye.static_len=0,ye.last_lit=ye.matches=0}function le(ye){8<ye.bi_valid?ae(ye,ye.bi_buf):0<ye.bi_valid&&(ye.pending_buf[ye.pending++]=ye.bi_buf),ye.bi_buf=0,ye.bi_valid=0}function de(ye,Ae,me,be){var we=2*Ae,Te=2*me;return ye[we]<ye[Te]||ye[we]===ye[Te]&&be[Ae]<=be[me]}function he(ye,Ae,me){for(var be=ye.heap[me],we=me<<1;we<=ye.heap_len&&(we<ye.heap_len&&de(Ae,ye.heap[we+1],ye.heap[we],ye.depth)&&we++,!de(Ae,be,ye.heap[we],ye.depth));)ye.heap[me]=ye.heap[we],me=we,we<<=1;ye.heap[me]=be}function ue(ye,Ae,me){var be,we,Te,He,je=0;if(ye.last_lit!==0)for(;be=ye.pending_buf[ye.d_buf+2*je]<<8|ye.pending_buf[ye.d_buf+2*je+1],we=ye.pending_buf[ye.l_buf+je],je++,be===0?q(ye,we,Ae):(q(ye,(Te=I[we])+g+1,Ae),(He=F[Te])!==0&&ce(ye,we-=L[Te],He),q(ye,Te=ne(--be),me),(He=H[Te])!==0&&ce(ye,be-=W[Te],He)),je<ye.last_lit;);q(ye,P,Ae)}function pe(ye,Ae){var me,be,we,Te=Ae.dyn_tree,He=Ae.stat_desc.static_tree,je=Ae.stat_desc.has_stree,qe=Ae.stat_desc.elems,tt=-1;for(ye.heap_len=0,ye.heap_max=_,me=0;me<qe;me++)Te[2*me]!==0?(ye.heap[++ye.heap_len]=tt=me,ye.depth[me]=0):Te[2*me+1]=0;for(;ye.heap_len<2;)Te[2*(we=ye.heap[++ye.heap_len]=tt<2?++tt:0)]=1,ye.depth[we]=0,ye.opt_len--,je&&(ye.static_len-=He[2*we+1]);for(Ae.max_code=tt,me=ye.heap_len>>1;1<=me;me--)he(ye,Te,me);for(we=qe;me=ye.heap[1],ye.heap[1]=ye.heap[ye.heap_len--],he(ye,Te,1),be=ye.heap[1],ye.heap[--ye.heap_max]=me,ye.heap[--ye.heap_max]=be,Te[2*we]=Te[2*me]+Te[2*be],ye.depth[we]=(ye.depth[me]>=ye.depth[be]?ye.depth[me]:ye.depth[be])+1,Te[2*me+1]=Te[2*be+1]=we,ye.heap[1]=we++,he(ye,Te,1),2<=ye.heap_len;);ye.heap[--ye.heap_max]=ye.heap[1],function(mt,kt){var ht,yt,Lt,We,Oe,Ke,nt=kt.dyn_tree,Xe=kt.max_code,Ge=kt.stat_desc.static_tree,ze=kt.stat_desc.has_stree,Ct=kt.stat_desc.extra_bits,It=kt.stat_desc.extra_base,Ot=kt.stat_desc.max_length,Ze=0;for(We=0;We<=x;We++)mt.bl_count[We]=0;for(nt[2*mt.heap[mt.heap_max]+1]=0,ht=mt.heap_max+1;ht<_;ht++)Ot<(We=nt[2*nt[2*(yt=mt.heap[ht])+1]+1]+1)&&(We=Ot,Ze++),nt[2*yt+1]=We,Xe<yt||(mt.bl_count[We]++,Oe=0,It<=yt&&(Oe=Ct[yt-It]),Ke=nt[2*yt],mt.opt_len+=Ke*(We+Oe),ze&&(mt.static_len+=Ke*(Ge[2*yt+1]+Oe)));if(Ze!==0){do{for(We=Ot-1;mt.bl_count[We]===0;)We--;mt.bl_count[We]--,mt.bl_count[We+1]+=2,mt.bl_count[Ot]--,Ze-=2}while(0<Ze);for(We=Ot;We!==0;We--)for(yt=mt.bl_count[We];yt!==0;)Xe<(Lt=mt.heap[--ht])||(nt[2*Lt+1]!==We&&(mt.opt_len+=(We-nt[2*Lt+1])*nt[2*Lt],nt[2*Lt+1]=We),yt--)}}(ye,Ae),re(Te,tt,ye.bl_count)}function se(ye,Ae,me){var be,we,Te=-1,He=Ae[1],je=0,qe=7,tt=4;for(He===0&&(qe=138,tt=3),Ae[2*(me+1)+1]=65535,be=0;be<=me;be++)we=He,He=Ae[2*(be+1)+1],++je<qe&&we===He||(je<tt?ye.bl_tree[2*we]+=je:we!==0?(we!==Te&&ye.bl_tree[2*we]++,ye.bl_tree[2*D]++):je<=10?ye.bl_tree[2*R]++:ye.bl_tree[2*z]++,Te=we,tt=(je=0)===He?(qe=138,3):we===He?(qe=6,3):(qe=7,4))}function V(ye,Ae,me){var be,we,Te=-1,He=Ae[1],je=0,qe=7,tt=4;for(He===0&&(qe=138,tt=3),be=0;be<=me;be++)if(we=He,He=Ae[2*(be+1)+1],!(++je<qe&&we===He)){if(je<tt)for(;q(ye,we,ye.bl_tree),--je!=0;);else we!==0?(we!==Te&&(q(ye,we,ye.bl_tree),je--),q(ye,D,ye.bl_tree),ce(ye,je-3,2)):je<=10?(q(ye,R,ye.bl_tree),ce(ye,je-3,3)):(q(ye,z,ye.bl_tree),ce(ye,je-11,7));Te=we,tt=(je=0)===He?(qe=138,3):we===He?(qe=6,3):(qe=7,4)}}c(W);var Ce=!1;function ve(ye,Ae,me,be){ce(ye,(f<<1)+(be?1:0),3),function(we,Te,He,je){le(we),ae(we,He),ae(we,~He),h.arraySet(we.pending_buf,we.window,Te,He,we.pending),we.pending+=He}(ye,Ae,me)}A._tr_init=function(ye){Ce||(function(){var Ae,me,be,we,Te,He=new Array(x+1);for(we=be=0;we<m-1;we++)for(L[we]=be,Ae=0;Ae<1<<F[we];Ae++)I[be++]=we;for(I[be-1]=we,we=Te=0;we<16;we++)for(W[we]=Te,Ae=0;Ae<1<<H[we];Ae++)N[Te++]=we;for(Te>>=7;we<b;we++)for(W[we]=Te<<7,Ae=0;Ae<1<<H[we]-7;Ae++)N[256+Te++]=we;for(me=0;me<=x;me++)He[me]=0;for(Ae=0;Ae<=143;)G[2*Ae+1]=8,Ae++,He[8]++;for(;Ae<=255;)G[2*Ae+1]=9,Ae++,He[9]++;for(;Ae<=279;)G[2*Ae+1]=7,Ae++,He[7]++;for(;Ae<=287;)G[2*Ae+1]=8,Ae++,He[8]++;for(re(G,v+1,He),Ae=0;Ae<b;Ae++)j[2*Ae+1]=5,j[2*Ae]=fe(Ae,5);U=new Z(G,F,g+1,v,x),O=new Z(j,H,0,b,x),Q=new Z(new Array(0),$,0,w,k)}(),Ce=!0),ye.l_desc=new J(ye.dyn_ltree,U),ye.d_desc=new J(ye.dyn_dtree,O),ye.bl_desc=new J(ye.bl_tree,Q),ye.bi_buf=0,ye.bi_valid=0,te(ye)},A._tr_stored_block=ve,A._tr_flush_block=function(ye,Ae,me,be){var we,Te,He=0;0<ye.level?(ye.strm.data_type===2&&(ye.strm.data_type=function(je){var qe,tt=4093624447;for(qe=0;qe<=31;qe++,tt>>>=1)if(1&tt&&je.dyn_ltree[2*qe]!==0)return d;if(je.dyn_ltree[18]!==0||je.dyn_ltree[20]!==0||je.dyn_ltree[26]!==0)return u;for(qe=32;qe<g;qe++)if(je.dyn_ltree[2*qe]!==0)return u;return d}(ye)),pe(ye,ye.l_desc),pe(ye,ye.d_desc),He=function(je){var qe;for(se(je,je.dyn_ltree,je.l_desc.max_code),se(je,je.dyn_dtree,je.d_desc.max_code),pe(je,je.bl_desc),qe=w-1;3<=qe&&je.bl_tree[2*K[qe]+1]===0;qe--);return je.opt_len+=3*(qe+1)+5+5+4,qe}(ye),we=ye.opt_len+3+7>>>3,(Te=ye.static_len+3+7>>>3)<=we&&(we=Te)):we=Te=me+5,me+4<=we&&Ae!==-1?ve(ye,Ae,me,be):ye.strategy===4||Te===we?(ce(ye,2+(be?1:0),3),ue(ye,G,j)):(ce(ye,4+(be?1:0),3),function(je,qe,tt,mt){var kt;for(ce(je,qe-257,5),ce(je,tt-1,5),ce(je,mt-4,4),kt=0;kt<mt;kt++)ce(je,je.bl_tree[2*K[kt]+1],3);V(je,je.dyn_ltree,qe-1),V(je,je.dyn_dtree,tt-1)}(ye,ye.l_desc.max_code+1,ye.d_desc.max_code+1,He+1),ue(ye,ye.dyn_ltree,ye.dyn_dtree)),te(ye),be&&le(ye)},A._tr_tally=function(ye,Ae,me){return ye.pending_buf[ye.d_buf+2*ye.last_lit]=Ae>>>8&255,ye.pending_buf[ye.d_buf+2*ye.last_lit+1]=255&Ae,ye.pending_buf[ye.l_buf+ye.last_lit]=255&me,ye.last_lit++,Ae===0?ye.dyn_ltree[2*me]++:(ye.matches++,Ae--,ye.dyn_ltree[2*(I[me]+g+1)]++,ye.dyn_dtree[2*ne(Ae)]++),ye.last_lit===ye.lit_bufsize-1},A._tr_align=function(ye){ce(ye,2,3),q(ye,P,G),function(Ae){Ae.bi_valid===16?(ae(Ae,Ae.bi_buf),Ae.bi_buf=0,Ae.bi_valid=0):8<=Ae.bi_valid&&(Ae.pending_buf[Ae.pending++]=255&Ae.bi_buf,Ae.bi_buf>>=8,Ae.bi_valid-=8)}(ye)}},{"../utils/common":41}],53:[function(p,y,A){y.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(p,y,A){(function(h){(function(d,u){if(!d.setImmediate){var c,f,m,g,v=1,b={},w=!1,_=d.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(d);x=x&&x.setTimeout?x:d,c={}.toString.call(d.process)==="[object process]"?function(D){process.nextTick(function(){k(D)})}:function(){if(d.postMessage&&!d.importScripts){var D=!0,R=d.onmessage;return d.onmessage=function(){D=!1},d.postMessage("","*"),d.onmessage=R,D}}()?(g="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",P,!1):d.attachEvent("onmessage",P),function(D){d.postMessage(g+D,"*")}):d.MessageChannel?((m=new MessageChannel).port1.onmessage=function(D){k(D.data)},function(D){m.port2.postMessage(D)}):_&&"onreadystatechange"in _.createElement("script")?(f=_.documentElement,function(D){var R=_.createElement("script");R.onreadystatechange=function(){k(D),R.onreadystatechange=null,f.removeChild(R),R=null},f.appendChild(R)}):function(D){setTimeout(k,0,D)},x.setImmediate=function(D){typeof D!="function"&&(D=new Function(""+D));for(var R=new Array(arguments.length-1),z=0;z<R.length;z++)R[z]=arguments[z+1];var F={callback:D,args:R};return b[v]=F,c(v),v++},x.clearImmediate=E}function E(D){delete b[D]}function k(D){if(w)setTimeout(k,0,D);else{var R=b[D];if(R){w=!0;try{(function(z){var F=z.callback,H=z.args;switch(H.length){case 0:F();break;case 1:F(H[0]);break;case 2:F(H[0],H[1]);break;case 3:F(H[0],H[1],H[2]);break;default:F.apply(u,H)}})(R)}finally{E(D),w=!1}}}}function P(D){D.source===d&&typeof D.data=="string"&&D.data.indexOf(g)===0&&k(+D.data.slice(g.length))}})(typeof self>"u"?h===void 0?this:h:self)}).call(this,typeof i.g<"u"?i.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})},"./src/tctwins-bim-viewer.css"(s,C,i){i.r(C)},"./node_modules/strnum/strnum.js"(s){const C=/^[-+]?0x[a-fA-F0-9]+$/,i=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,p={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function y(d,u={}){if(u=Object.assign({},p,u),!d||typeof d!="string")return d;let c=d.trim();if(u.skipLike!==void 0&&u.skipLike.test(c))return d;if(d==="0")return 0;if(u.hex&&C.test(c))return h(c,16);if(c.search(/[eE]/)!==-1){const f=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(f){if(u.leadingZeros)c=(f[1]||"")+f[3];else if(!(f[2]==="0"&&f[3][0]==="."))return d;return u.eNotation?Number(c):d}else return d}else{const f=i.exec(c);if(f){const m=f[1],g=f[2];let v=A(f[3]);if(!u.leadingZeros&&g.length>0&&m&&c[2]!==".")return d;if(!u.leadingZeros&&g.length>0&&!m&&c[1]!==".")return d;if(u.leadingZeros&&g===d)return 0;{const b=Number(c),w=""+b;return w.search(/[eE]/)!==-1?u.eNotation?b:d:c.indexOf(".")!==-1?w==="0"&&v===""||w===v||m&&w==="-"+v?b:d:g?v===w||m+v===w?b:d:c===w||c===m+w?b: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")}s.exports=y},"./src/BIMXViewer.ts"(s,C,i){i.r(C),i.d(C,{default:()=>G});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/messages.ts"),A=i("./src/EventTrigger.ts"),h=i("./src/Controller.ts"),d=i("./src/toolbar/ResetAction.ts"),u=i("./src/toolbar/FitAction.ts"),c=i("./src/toolbar/FirstPersonMode.ts"),f=i("./src/toolbar/HideTool.ts"),m=i("./src/toolbar/ShowSpacesMode.ts"),g=i("./src/toolbar/SectionTool.ts"),v=i("./src/toolbar/NavCubeMode.ts"),b=i("./src/explorer/ModelsExplorer.ts"),w=i("./src/explorer/ObjectsExplorer.ts"),_=i("./src/explorer/ClassesExplorer.ts"),x=i("./src/explorer/StoreysExplorer.ts"),E=i("./src/toolbar/ThreeDMode.ts"),k=i("./src/toolbar/OrthoMode.ts"),P=i("./src/toolbar/AnnotationTool.ts"),D=i("./src/toolbar/MarkerTool.ts"),R=i("./src/toolbar/MeasureTool.ts"),z=i("./src/toolbar/CommentsTool.ts"),F=i("./src/server/Server.ts"),H=i("./src/toolbar/SkyBoxTool.ts"),$=i("./src/toolbar/BCFTool.ts"),K=function(j,N,I,L){function U(O){return O instanceof I?O:new I(function(Q){Q(O)})}return new(I||(I=Promise))(function(O,Q){function W(ne){try{J(L.next(ne))}catch(ae){Q(ae)}}function Z(ne){try{J(L.throw(ne))}catch(ae){Q(ae)}}function J(ne){ne.done?O(ne.value):U(ne.value).then(W,Z)}J((L=L.apply(j,N||[])).next())})};class G extends h.default{constructor(N={}){if(!N.canvasElement)throw new Error("Config expected: canvasElement");if(!N.navCubeCanvasElement)throw new Error("Config expected: navCubeCanvasElement");const{canvasElement:I}=N,{viewerElement:L}=N,U=new p.LocaleService({messages:y.default,locale:"ch"}),O=new p.Viewer({passes:5,localeService:U,canvasElement:I,viewerElement:L,snapRadius:N.snapRadius,antialias:N.viewer_cfg.antialias,saoEnabled:N.viewer_cfg.saoEnabled,pbrEnabled:N.viewer_cfg.pbrEnabled,dtxEnabled:N.viewer_cfg.dtxEnabled,transparent:N.viewer_cfg.transparent,edgesEnabled:N.viewer_cfg.edgesEnabled,alphaDepthMask:N.viewer_cfg.alphaDepthMask,premultipliedAlpha:N.viewer_cfg.premultipliedAlpha,colorTextureEnabled:N.viewer_cfg.colorTextureEnabled,backgroundColorFromAmbientLight:N.viewer_cfg.backgroundColorFromAmbientLight,resolutionScale:window.devicePixelRatio,spinnerElementId:"engine_spinner"}),Q=new F.default({dataDir:"./data",filePath:"testdemo"});super(null,N,Q,O),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((ae,ce)=>{try{this.viewer.scene.camera.orbitYaw(ne),ae()}catch(q){ce(q)}}),this.cameraEnable=(ne=!this.viewer.cameraControl.pointerEnabled)=>{this.viewer.cameraControl.pointerEnabled=ne},this.shot=(ne,ae,ce)=>{const q=document.getElementById("myCanvas"),fe=document.createElement("a");fe.download="screenshot.png";const re=document.createElement("canvas"),te=re.getContext("2d");if(q&&te){re.width=ne,re.height=ae;const le=ne/q.width,de=ae/q.height,he=Math.max(le,de);return q.width*he,q.height*he,te.clearRect(0,0,ne,ae),te.fillStyle="transparent",te.fillRect(0,0,ne,ae),te.drawImage(q,0,0,q.width,q.height,0,0,1,1),ce&&re.toBlob(ue=>{const pe=URL.createObjectURL(ue);fe.href=pe,fe.click(),URL.revokeObjectURL(pe)}),re.toDataURL("image/png")}return""},this._configs={},this._eventTrigger=new A.default,this.navCubeCanvasElement=N.navCubeCanvasElement,this.viewerElement=N.viewerElement,this._multiModel=N.multiModel?N.multiModel:!1,this._hasOutlier=!1,this._outlierObjectIds=[],this._projectId=N.projectId?N.projectId:"",this.viewer=O,(N.skyBoxImage||N.skyBoxSrc)&&(this._skyBoxTool=new H.default(this,{skyBoxImage:N.skyBoxImage,skyBoxSrc:N.skyBoxSrc})),this._modelsExplorer=new b.default(this,{enableEditModels:!1,modelFromOutSide:!0,modelSrc:N.modelSrc?N.modelSrc:"/",modelConfig:N.modelConfig,IfcAPI:N.IfcAPI,WebIFC:N.WebIFC,multiModel:this._multiModel}),this._objectsExplorer=new w.default(this,{modelType:N.modelType}),this._classesExplorer=new _.default(this,{modelType:N.modelType}),this._storeysExplorer=new x.default(this,{modelType:N.modelType}),this._resetAction=new d.default(this,{}),this._fitAction=new u.default(this,{});class W{constructor(ae){this.threeDActive=!1,this.firstPersonActive=!1,this.setThreeDModeActive=ce=>{ce?(ae._firstPersonMode.setActive(!1),ae.viewer.cameraControl.navMode="orbit"):(ae._firstPersonMode.setActive(!1),ae.viewer.cameraControl.navMode="planView"),this.threeDActive=ce},this.setFirstPersonModeActive=ce=>{ae.viewer.cameraControl.navMode=ce?"firstPerson":this.threeDActive?"orbit":"planView",this.firstPersonActive=ce}}}const Z=new W(this);this._threeDMode=new E.default(this,{cameraControlNavModeMediator:Z}),this._orthoMode=new k.default(this,{}),this._firstPersonMode=new c.default(this,{cameraControlNavModeMediator:Z}),this._hideTool=new f.default(this,{}),this._annotationTool=new P.default(this,{modelId:this._projectId}),this._markerTool=new D.default(this,{}),this._measureTool=new R.default(this,{}),this._sectionTool=new g.default(this,{}),this._commentsTool=new z.default(this,{}),this._showSpacesMode=new m.default(this,{}),this._navCubeMode=new v.default(this,{navCubeCanvasElement:this.navCubeCanvasElement,viewerElement:this.viewerElement}),this._bcfTool=new $.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 J=0;this.eventTrigger.on("treeReady",()=>{J++,J%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(N){this._disableClickEvent=N}get disableClickEvent(){return this._disableClickEvent}get edgesActive(){return this._edgesActive}_initSingleClickEvent(){this.viewer.cameraControl.on("mouseDownEntity",N=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I&&I.entity&&(this.singleChoseEntity(I.entity),this._eventTrigger.emit("pickedEntity",I.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",N=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I&&I.entity&&(this._eventTrigger.emit("touchEntity",I.entity),this.singleChoseEntity(I.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",N=>{N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I?this._eventTrigger.emit("rightPicked",I.entity):this._eventTrigger.emit("rightPickedNothing")})}_initDoubleClickEvent(){this.viewer.cameraControl.on("doublePicked",N=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I&&I.entity&&(this.doubleChoseEntity(I.entity),this._eventTrigger.emit("doublePicked",I.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:N}=this.viewer;N.pointsMaterial.pointSize=1,N.pointsMaterial.roundPoints=!0,N.pointsMaterial.perspectivePoints=!0,N.pointsMaterial.minPerspectivePointSize=2,N.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 I=document.createRange().createContextualFragment("<div class='tctwins-camera-pivot-marker'></div>").firstChild;this.viewer.scene.canvas.canvas.parentNode.appendChild(I),this.viewer.cameraControl.pivotElement=I;const{sao:L}=N;L.enabled=!1,L.numSamples=50,L.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(N){for(const I in N)if(Object.prototype.hasOwnProperty.call(N,I)){const L=N[I];this.setConfig(I,L)}}setConfig(N,I){function L(U){return U===!0||U==="true"}try{switch(N){case"backgroundTransparency":const U=I;this.setBackgroundTransparent(U),this._configs[N]=U;break;case"backgroundColor":if(this._configs.backgroundTransparency)break;const O=I;this.setBackgroundColor(O),this._configs[N]=O;break;case"smartPivot":this.viewer.cameraControl.smartPivot=this._configs[N]=L(I);break;case"saoEnabled":this.viewer.scene.saoEnabled=this._configs[N]=L(I);break;case"saoBias":this.viewer.scene.sao.bias=parseFloat(I);break;case"saoIntensity":this.viewer.scene.sao.intensity=parseFloat(I);break;case"saoKernelRadius":this.viewer.scene.sao.kernelRadius=this._configs[N]=parseFloat(I);break;case"saoNumSamples":this.viewer.scene.sao.numSamples=this._configs[N]=parseFloat(I);break;case"saoBlur":this.viewer.scene.sao.blur=this._configs[N]=L(I);break;case"edgesEnabled":this.setEdgesEnabled(I);break;case"pbrEnabled":break;case"viewFitFOV":this.viewer.cameraFlight.fitFOV=this._configs[N]=parseFloat(I);break;case"viewFitDuration":this.viewer.cameraFlight.duration=this._configs[N]=parseFloat(I);break;case"perspectiveFOV":this.viewer.camera.perspective.fov=this._configs[N]=parseFloat(I);break;case"excludeUnclassifiedObjects":this._configs[N]=L(I);break;case"objectColorSource":this.setObjectColorSource(I),this._configs[N]=I;break;case"xrayContext":this._configs[N]=I;break;case"xrayPickable":this._configs[N]=L(I);break;case"externalMetadata":this._configs[N]=I;break;case"showSpaces":this._showSpacesMode.setActive(I);break;case"dtxEnabled":this._configs[N]=L(I),this.viewer.scene.dtxEnabled=I;break;case"snapRadius":this.setSnapRadius(I);break;default:this.error(`setConfig() - unsupported configuration: '${N}'`)}}catch(U){this.error(`setConfig() - failed to configure ${N}: ${U}`)}}getConfig(N){return this._configs[N]}getConfigs(){return this._configs}projectId(){return this._projectId}loadModel(N,I,L=()=>{},U=()=>{},O){this._modelNum+=1,!this._multiModel&&this._modelNum>1&&(this._multiModel=!0),this._multiModel||(this._projectId=N),this._modelsExplorer.loadModel(N,I,L,U,O)}unloadModel(N){if(!this.viewer.scene.models[N]){this.error("unloadModel() - Model not loaded: "+N);return}this._modelsExplorer.unloadModel(N);const I=Object.keys(this.viewer.scene.models);this._modelNum=I.length,I.length>1?(this._multiModel=!0,this._projectId=""):(this._multiModel=!1,this._projectId=I.length===1?I[0]:"")}_resolveModelId(N){if(N!=null&&N!=="")return N;if(this._projectId)return this._projectId;const I=Object.keys(this.viewer.scene.models);if(I.length===1)return I[0]}focusModel(N,I){const L=this._resolveModelId(N);return this.viewer.focusModel(L,I)}loadMetadata(N,I,L=!0,U=()=>{}){this._modelsExplorer.loadMetadata(N,I,L,()=>{this._metaLoaded=!0,this._focusPartial&&this.viewFitPartial(0,U)})}setObjectColorSource(N){switch(N){case"model":break;case"viewer":break;default:N="model",this.error("setObjectColorSource() - Unsupported value - accepted values are 'model' and 'viewer' - defaulting to 'model'");return}this._objectColorSource=N}getObjectProperties(N){const I=this.viewer.metaScene.metaObjects[N];if(!I)return null;const L={id:I.id,name:I.name,type:I.type,propertySets:[]},{propertySets:U}=I;if(U&&U.length>0)for(let O=0;O<U.length;O++){const{properties:Q}=U[O],W=[];for(let J=0;J<Q.length;J++){const ne={};ne[Q[J].name]=Q[J].value,W.push(ne)}const Z={id:U[O].id,name:U[O].name,properties:W,type:U[O].type};L.propertySets.push(Z)}return L}getModelInfo(N){const I=this.viewer.metaScene.metaModels[N];return{id:I.id,createDate:I.createdAt?I.createdAt:"",author:I.author?I.author:"",objectCount:I.objectCount?I.objectCount:"",propertySetCount:I.propertySetCount?I.propertySetCount:""}}getMetaModel(N){return this.viewer.metaScene.metaModels[N]}getSceneModel(N){return this.viewer.scene.models[N]}_withObjectsInSubtree(N,I=()=>{}){if(!N){this.error("Argument expected: objectIds");return}N.forEach(L=>{this.viewer.metaScene.withMetaObjectsInSubtree(L,U=>{const O=this.viewer.scene.objects[U.id];O&&I(O)})})}_withObjects(N,I=()=>{}){N.forEach(L=>{const U=this.viewer.scene.objects[L];I(U)})}flyToObject(N,I=()=>{}){if(!N){this.error("flyToObject() - Argument expected: objectId");return}const{viewer:L}=this,{scene:U}=L,O=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(N,W=>{U.objects[W.id]&&O.push(W.id)}),O.length===0){this.error(`Object not found in viewer: '${N}'`),I&&I();return}U.setObjectsVisible(O,!0);const Q=U.getAABB(O);L.cameraFlight.flyTo({aabb:Q},()=>{I&&I(),setTimeout(()=>{U.setObjectsHighlighted(U.highlightedObjectIds,!1)},500)}),L.cameraControl.pivotPos=p.math.getAABB3Center(Q)}viewFitObjects(N,I=()=>{}){if(!N){this.error("viewFitObjects() - Argument expected: objectIds");return}const{viewer:L}=this,{scene:U}=L;U.setObjectsVisible(N,!0);const O=U.getAABB(N);L.cameraFlight.flyTo({aabb:O},()=>{I&&I()}),L.cameraControl.pivotPos=p.math.getAABB3Center(O)}jumpToObjects(N){if(!N){this.error("jumpToObject() - Argument expected: objectIds");return}const{viewer:I}=this,{scene:L}=I,U=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(N,Q=>{L.objects[Q.id]&&U.push(Q.id)}),U.length===0){this.error(`Objects not found in viewer: '${N}'`);return}L.setObjectsVisible(U,!0);const O=L.getAABB(U);I.cameraFlight.jumpTo({aabb:O}),I.cameraControl.pivotPos=p.math.getAABB3Center(O)}setCamera(N){const{viewer:I}=this,{scene:L}=I,{camera:U}=L;N.eye&&(U.eye=N.eye),N.look&&(U.look=N.look),N.up&&(U.up=N.up)}getCameraView(){return{eye:this.viewer.scene.camera.eye,look:this.viewer.scene.camera.look,up:this.viewer.scene.camera.up}}flyToNewView(N){this.viewer.cameraControl.pivotPos=N.look,this.viewer.cameraFlight.flyTo({look:N.look,eye:N.eye,up:N.up,duration:N.duration})}flyToObjectFromDirection(N,I,L,U=()=>{}){const O=this.viewer.scene.objects[N];if(!O){this.error(`flyToObjectFromDirection() - Object not found in viewer: '${N}'`),U&&U();return}const Q=this._resolveViewDirection(I);if(!Q){this.error(`flyToObjectFromDirection() - Invalid direction: '${I}'`),U&&U();return}const W=p.math.getAABB3Center(O.aabb,[]),Z=[W[0]+Q[0]*L,W[1]+Q[1]*L,W[2]+Q[2]*L],J=Math.abs(Q[1])>.9?[0,0,1]:[0,1,0];this.viewer.cameraFlight.flyTo({eye:Z,look:W,up:J},()=>{U&&U()}),this.viewer.cameraControl.pivotPos=W}_resolveViewDirection(N){const I={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 L;if(typeof N=="string"){if(L=I[N.toLowerCase()],!L)return null}else if(Array.isArray(N)&&N.length>=3)L=[N[0],N[1],N[2]];else return null;const U=Math.sqrt(L[0]*L[0]+L[1]*L[1]+L[2]*L[2]);return U===0?null:[L[0]/U,L[1]/U,L[2]/U]}viewFitModels(N,I=()=>{}){if(!N){this.error("viewFitModels() - Argument expected: modelIds");return}const{viewer:L}=this,{scene:U}=L,O=p.math.AABB3();p.math.collapseAABB3(O),N.forEach(Q=>{const W=U.models[Q];W?(W.visible=!0,W.highlighted=!0,p.math.expandAABB3(O,W.aabb)):this.error(`Model not found in viewer: '${Q}'`)}),I?L.cameraFlight.flyTo({aabb:O},()=>{I(),setTimeout(()=>{U.setObjectsHighlighted(U.highlightedObjectIds,!1)},500)}):(L.cameraFlight.jumpTo({aabb:O}),setTimeout(()=>{U.setObjectsHighlighted(U.highlightedObjectIds,!1)},500)),L.cameraControl.pivotPos=p.math.getAABB3Center(O)}viewFitPartial(N,I){let L;typeof N=="function"?(I=N,L=this._partialFocusIndex+=1):L=N??(this._partialFocusIndex+=1),L>=0&&L<this._partialObjectIds.length?this.viewFitObjects(this._partialObjectIds[L],()=>{for(let U=0;U<this._partialObjectIds.length;U++)L==U?this.setObjectsVisible(this._partialObjectIds[U],!0):this.setObjectsVisible(this._partialObjectIds[U],!1);I&&I(L)}):(L=this._partialFocusIndex=0,this.viewFitObjects(this._partialObjectIds[L],()=>{for(let U=0;U<this._partialObjectIds.length;U++)L==U?this.setObjectsVisible(this._partialObjectIds[U],!0):this.setObjectsVisible(this._partialObjectIds[U],!1);I&&I(L)}))}setPartialObjectIds(N){const I=[];for(let L=0;L<N.length;L++)I.push(N[L]);this._partialObjectIds=I,this.viewer.cameraControl.smartPivot=!1,this.navCubeMode.fitVisible=!0,this._focusPartial=!0,this._metaLoaded&&this.viewFitPartial(0)}selectStorey(N,I=()=>{}){const{metaScene:L}=this.viewer,U=L.metaObjects[N];if(!U){this.error(`selectStorey() - Object is not found: '${N}'`);return}if(U.type!=="IfcBuildingStorey"){this.error(`selectStorey() - Object is not an IfcBuildingStorey: '${N}'`);return}this._storeysExplorer.selectStorey(N,I)}setKeyboardEnabled(N){this.viewer.scene.input.keyboardEnabled=N}getKeyboardEnabled(){return this.viewer.scene.input.keyboardEnabled}showSpinner(N=!this.viewer.scene.canvas.spinner.visible){this.viewer.scene.canvas.spinner.visible=N}updateAABB(N,I=()=>{}){N.length>0&&(this._hasOutlier=!0,this._outlierObjectIds=N);const L=this._resolveModelId(),U=L!==void 0?this.viewer.scene.models[L]:void 0;if(!U){this.error("updateAABB() - No model available for the current scene"),typeof I=="function"&&I();return}const O=N.concat(U.exceptionIds);U.exceptionIds=O,this.viewer.scene.setObjectsVisible(O,!1),this.viewer.scene.on("aabb",()=>{typeof I=="function"&&I()})}closeAll(){this.fire("closeAll",!0),this.disableClickEvent=!1}destroy(N=()=>{}){var I;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 L=document.querySelector(".tctwins-camera-pivot-marker");L&&((I=L.parentNode)===null||I===void 0||I.removeChild(L)),this.viewer.destroy(N)}getEntityById(N){return this.viewer.scene.objects[N]}setEntitySelected(N,I=!N.selected){N.selected=I}setObjectsSelected(N,I){this._withObjects(N,L=>{L.selected=I})}setOthersSelected(N){this.setAllObjectsSelected(!0),this.setEntitySelected(N,!0)}setAllObjectsSelected(N){N?this.viewer.scene.setObjectsSelected(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsSelected(this.viewer.scene.selectedObjectIds,!1)}viewFitEntity(N){this.viewer.cameraFlight.flyTo({aabb:N.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=p.math.getAABB3Center(N.aabb)}viewFitEntityById(N){this._withObjects([N],I=>{this.viewer.cameraFlight.flyTo({aabb:I.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=p.math.getAABB3Center(I.aabb)})}viewFitSelectedObjects(){this.viewFitObjects(this.viewer.scene.highlightedObjectIds,()=>{})}viewFitAll(N=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,N);return}this._fitAction.fit(N)}setEntityVisible(N,I=!N.visible){N.visible=I}setObjectsVisible(N,I){this._withObjects(N,L=>{L.visible=I})}setOthersHide(N){const I=this.viewer.metaScene.metaObjects[N.id];I&&(this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds,!1),I.withMetaObjectsInSubtree(L=>{const U=this.viewer.scene.objects[L.id];U&&(U.visible=!0)}))}setAllObjectsVisible(N){N?(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(N,I=!N.xrayed){N.xrayed=I}setObjectsXRayed(N,I){this._withObjects(N,L=>{L.xrayed=I})}setOthersXRayed(N){const{scene:I}=this.viewer,L=this.viewer.metaScene.metaObjects[N.id];L&&(I.setObjectsVisible(I.objectIds,!0),I.setObjectsXRayed(I.objectIds,!0),L.withMetaObjectsInSubtree(U=>{const O=I.objects[U.id];O&&(O.xrayed=!1)}))}setAllObjectsXRayed(N){N?this.viewer.scene.setObjectsXRayed(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsXRayed(this.viewer.scene.xrayedObjectIds,!1)}setEntityHighlighted(N,I=!N.highlighted){N.highlighted=I,N.origin_opacity!=-1&&(N.highlighted?N.opacity=N.opacity<1?N.opacity:.01:N.opacity=N.origin_opacity)}setAllObjectsHighlighted(N){N?(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.objectIds,!0),this.viewer.scene.withObjects(this.viewer.scene.objectIds,I=>{I.origin_opacity,I.opacity=I.opacity<.5?I.opacity:.01})):(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.highlightedObjectIds,!1),this.viewer.scene.withObjects(this.viewer.scene.objectIds,I=>{I.opacity=I.origin_opacity}))}setEntityEdges(N,I=!N.edges){N.edges=I}setObjectsEdges(N,I){this.viewer.scene.withObjects(N,L=>{L.edges=I}),this.viewer.scene.render(!0)}setAllObjectsEdges(N=!this._edgesActive){this._edgesActive=N,this.viewer.scene.withObjects(this.viewer.scene.objectIds,I=>{I.edges=N}),this.viewer.scene.render(!0)}setEntityColor(N,I){this.viewer.scene.setObjectsColorized([N],I),this.viewer.scene.render(!0)}setObjectsColor(N,I){this.viewer.scene.setObjectsColorized(N,I),this.viewer.scene.render(!0)}resetEntityColor(N){this.viewer.scene.setObjectsColorized([N],null)}setModelBrightness(N,I=1){const L=this._resolveModelId(N);if(L===void 0){this.error("setModelBrightness() - Model not found: "+N);return}const U=this.viewer.scene.models[L];if(!U){this.error("setModelBrightness() - Model not loaded: "+L);return}U.brightness=I,this.viewer.scene.render(!0)}getModelBrightness(N){const I=this._resolveModelId(N);if(I===void 0){this.error("getModelBrightness() - Model not found: "+N);return}const L=this.viewer.scene.models[I];if(!L){this.error("getModelBrightness() - Model not loaded: "+I);return}return L.brightness}entityVisble(N){return N.visible}entityXRayed(N){return N.xrayed}entityChosed(N){return N.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(N=!this.viewer.scene.backgroundTransparent){this.viewer.scene.backgroundTransparent=N,this.viewer.scene.render(!0)}setBackgroundColor(N){this.viewer.scene.backgroundColor=N,this.viewer.scene.render(!0)}setNavCubeSize(N){this.navCubeCanvasElement.style.width=`${N.toString()}px`,this.navCubeCanvasElement.style.height=`${N.toString()}px`}setNavCubePosition(N,I){switch(N){case"top":this.navCubeCanvasElement.style.top=`${I.toString()}px`,this.navCubeCanvasElement.style.bottom="";break;case"bottom":this.navCubeCanvasElement.style.top="",this.navCubeCanvasElement.style.bottom=`${I.toString()}px`;break;case"right":this.navCubeCanvasElement.style.left="",this.navCubeCanvasElement.style.right=`${I.toString()}px`;break;case"left":this.navCubeCanvasElement.style.right="",this.navCubeCanvasElement.style.left=`${I.toString()}px`;break}}updateCanvas(){this.viewer.scene.canvas.dirtyBoundary=!0}setMeasureOffSet(N,I){this._measureTool.setMeasureOffSet(N,I)}setCommentsOffset(N,I){this._commentsTool.offsetX=N,this._commentsTool.offsetY=I}setSnapRadius(N){this.measureTool.setSnapRadius(N)}setIsTouch(N){this.measureTool.isTouch=N,this.sectionTool.isTouch=N,this.commentTool.isTouch=N}setLightIntensity(N){if(!(N<0||N>100))for(const I in this.viewer.scene.lightsObject)this.viewer.scene.lightsObject[I].intensity=.6+(N-50)/200}setSpaceMaterialColor(N){N===1?this.viewer.scene.highlightMaterial.fillColor=[.6,.7,.8]:N===2&&(this.viewer.scene.highlightMaterial.fillColor=[.2,.3,.4])}setWorldAxisYDown(N){this._worldAxisYDown=N,N?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(N){this._worldAxisZUp=N,N?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(N=!this.viewer.scene.edgesEnabled){this.viewer.scene.edgesEnabled=N,this.viewer.scene.render(!0)}setSAOEnabled(N=!this.viewer.scene.saoEnabled){this.viewer.scene.saoEnabled=N}setDTXEnabled(N=!this.viewer.scene.dtxEnabled){this.viewer.scene.dtxEnabled=N}setPBREnabled(N=!this.viewer.scene.pbrEnabled){this.viewer.scene.pbrEnabled=N}resetView(N=()=>{}){if(this._focusPartial||this._worldAxisYDown){this.setDirection(25);return}this._resetAction.reset(N)}fitView(N=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,N);return}this._fitAction.fit()}SetAnnotationToolActive(N=!this._annotationTool.getActive(),I=()=>{}){this._annotationTool.setActive(N),I&&I(this._annotationTool.getActive())}SetMarkerToolActive(N=!this._markerTool.getActive(),I=()=>{}){this._markerTool.setActive(N),I&&I(this._markerTool.getActive())}SetCommentsToolActive(N=!this._commentsTool.getActive(),I=()=>{}){this._commentsTool.setActive(N),I&&I(this._commentsTool.getActive())}SetFirstPersonModeActive(N=!this._firstPersonMode.getActive(),I=()=>{}){this._firstPersonMode.setActive(N),I&&I(this._firstPersonMode.getActive())}SetMeasureToolActive(N=!this.measureAngleTool.getActive(),I=()=>{}){this._measureTool.setActive(N),I&&I(this._measureTool.getActive())}SetMeasureAngleActive(N=!this.measureAngleTool.getActive(),I=()=>{}){this._measureTool.SetMeasureAngleActive(N,I)}SetMeasureDistanceActive(N=!this.measureDistanceTool.getActive(),I=()=>{}){this._measureTool.SetMeasureDistanceActive(N,I)}SetSectionToolActive(N=!this._sectionTool.getActive(),I=()=>{}){this._sectionTool.setActive(N),I(this._sectionTool.getActive())}SetHideToolActive(N,I=()=>{}){this._hideTool.setActive(N),I&&I()}SetOrthoModeActive(N=!this._orthoMode.getActive(),I=()=>{}){this._orthoMode.setActive(N,I)}SetThreeDModeActive(N=!this._threeDMode.getActive(),I=()=>{}){this._threeDMode.setActive(N,I)}SetShowSpaceModeActive(N=!this._showSpacesMode.getActive(),I=()=>{}){this._showSpacesMode.setActive(N,I)}SetSkyBoxToolActive(N,I=()=>{}){this._skyBoxTool&&(N==null?this._skyBoxTool.setActive(!this._skyBoxTool.getActive()):this._skyBoxTool.setActive(N),I&&I(this._skyBoxTool.getActive()))}SetBCFToolActive(N=!this._bcfTool.getActive(),I=()=>{}){this._bcfTool.setActive(N),I(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(N){this._navCubeMode.flyByClick(N)}singleChoseEntity(N){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.setEntitySelected(N))}singleChosedSpace(){this._disableClickEvent||this.setAllObjectsSelected(!1)}doubleChoseEntity(N){this._disableClickEvent||(this.viewFitEntity(N),this.setAllObjectsSelected(!1),this.setEntitySelected(N))}choseSpace(){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.viewFitAll())}getPreShot(N,I){const{cameraEnable:L}=this;L(!1);const U=typeof N=="function"?1024:N;typeof N=="function"&&(I=N);const{orbitYawCamera:O}=this,{viewer:Q}=this,{canvas:W}=Q.scene.canvas,Z=this._projectId,J=document.createElement("canvas"),ne=J.getContext("2d"),ae=U*15,ce=U;J.width=ae,J.height=ce;const q=Array.from({length:15},()=>fe);function fe(){return K(this,void 0,void 0,function*(){return yield O(-18),yield re(100),te(U)})}function re(de){return new Promise(he=>setTimeout(he,de))}function te(de){return K(this,void 0,void 0,function*(){const he=document.createElement("canvas"),ue=he.getContext("2d");if(W&&ue){he.width=de,he.height=de;const pe=de/W.width,se=de/W.height,V=Math.max(pe,se),Ce=W.width*V,ve=W.height*V,ye=(de-Ce)/2,Ae=(de-ve)/2;return ue.clearRect(0,0,de,de),ue.fillStyle="transparent",ue.fillRect(0,0,de,de),ue.drawImage(W,0,0,W.width,W.height,ye,Ae,Ce,ve),new Promise((me,be)=>{const we=new Image;we.onload=()=>me(we),we.onerror=be,we.src=he.toDataURL()})}return Promise.reject(new Error("Canvas or context not found."))})}function le(de){const he=J.toDataURL("image/png");{console.log(de);const ue=document.createElement("a");ue.href=he,ue.download="combined_image.png",ue.click()}return L(!0),I&&I({modelId:Z,imageData:he}),he}return K(this,void 0,void 0,function*(){for(let de=0;de<q.length;de++)try{const he=yield q[de]();ne&&ne.drawImage(he,de*U,0)}catch(he){L(!0),console.error("获取图片内容失败:",he)}le(!0)}),""}setShelterCanvas(N=()=>{}){const{canvas:I}=this.viewer.scene.canvas,L=this.shot(I.width,I.height,!1),U=document.createElement("img");U.src=L,U.style.position="absolute",U.style.top="0px",U.style.left="0px",U.style.right="0px",U.style.bottom="0px",I.parentNode.appendChild(U),typeof N=="function"&&N(U)}}},"./src/Controller.ts"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/TMap.ts");class y{constructor(h,d={},u=null,c=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:c,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 c=this._eventSubs[h];let f;c&&Object.keys(c).forEach(m=>{Object.prototype.hasOwnProperty.call(c,m)&&(f=c[m],this._eventCallDepth+=1,this._eventCallDepth<300?f.callback.call(f.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 p.default),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={});let c=this._eventSubs[h];c||(c={},this._eventSubs[h]=c);const f=this._subIdMap.addItem();c[f]={callback:d,scope:u||this},this._subIdEvents[f]=h;const m=this._events[h];return m!==void 0&&d.call(u||this,m),f}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 c=this,f=this.on(h,m=>{c.off(f),d.call(u||this,m)},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",c=>{c&&h.forEach((f,m)=>{m!==u&&f.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"(s,C,i){i.r(C),i.d(C,{default:()=>p});class p{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"(s,C,i){i.r(C),i.d(C,{default:()=>p});class p{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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u={}){super(d),this.eventTrigger=d.eventTrigger;const{modelType:c}=u;this._treeView=new p.TreeViewPlugin(this.viewer,{hierarchy:"types",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",f=>{this._rootNode=f,this.eventTrigger.emit("classes_rootNodes",f)}),this._treeView.on("nodeNodes_Created",f=>{this._nodeList=f,this.eventTrigger.emit("classes_nodeNodes",f)}),this._treeView.on("objectNodes_Created",f=>{this._objectList=f,this.eventTrigger.emit("classes_objectNodes",f)}),this._treeView.on("checkBoxChanged",f=>{this.eventTrigger.emit("classes_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(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 c=this._nodeList[d],f=u,{objects:m}=this.viewer.scene;let g=0;this._treeView.withNodeTree(c,b=>{const{objectId:w}=b,_=m[w],x=b.children.length===0;b.numVisibleEntities=f?b.numEntities:0,x&&f!==b.checked&&g++,b.checked=f,_&&(_.visible=f)});let{parent:v}=c;for(;v;)v.checked=f,f?v.numVisibleEntities+=g:v.numVisibleEntities-=g,v=v.parent}nodeTitleClicked(d){const{scene:u}=this.viewer,c=this._nodeList[d],f=[];this._treeView.withNodeTree(c,g=>{g.objectId&&f.push(g.objectId)});const{checked:m}=c;m?(u.setObjectsXRayed(f,!1),u.setObjectsVisible(f,!1),u.setObjectsPickable(f,!0)):(u.setObjectsXRayed(f,!1),u.setObjectsVisible(f,!0),u.setObjectsPickable(f,!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"(s,C,i){i.r(C),i.d(C,{default:()=>m});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");let A;const h=["position","scale","rotation","matrix","origin"],d=p.math;function u(g,v,b,w){const _=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]),x=Math.sqrt(g[4]*g[4]+g[5]*g[5]+g[6]*g[6]),E=Math.sqrt(g[8]*g[8]+g[9]*g[9]+g[10]*g[10]);v[0]=g[12],v[1]=g[13],v[2]=g[14];const k=new Array(16);for(let P=0;P<16;P++)k[P]=g[P];_>1e-6&&(k[0]/=_,k[1]/=_,k[2]/=_),x>1e-6&&(k[4]/=x,k[5]/=x,k[6]/=x),E>1e-6&&(k[8]/=E,k[9]/=E,k[10]/=E),d.mat4ToQuaternion(k,b),w[0]=_,w[1]=x,w[2]=E}function c(g){const v=[0,0,0];return d.quaternionToEuler(g,"XYZ",v),v}class f{constructor(v,b){this._projectId="",this._modelId="",this._server=v,A=b.tempVec3a}setProjectId(v){this._projectId=v}setModelId(v){this._modelId=v}getManifest(v,b,w){this._server.getSplitModelManifest(this._projectId,this._modelId,v,b,w)}getMetaModel(v,b,w){this._server.getSplitModelMetadata(this._projectId,this._modelId,v,b,w)}getXTC(v,b,w){this._server.getSplitModelGeometry(this._projectId,this._modelId,v,b,w)}}class m extends y.default{constructor(v,b){super(v,b),this._modelFromOutSide=b.modelFromOutSide,this._projectId=b.projectId,this._modelType=b.modelType,this._modelSrc=b.modelSrc,this._eventTrigger=v.eventTrigger,this._dataSource=new f(this.server,{tempVec3a:b.tempVec3a}),this._modelConfig=b.modelConfig,this._modelsInfo={},this._numModels=0,this._numModelsLoaded=0}getModelIds(){return Object.keys(this._modelsInfo)}getModelInfo(v){return this._modelsInfo[v]}loadModel(v,b,w=()=>{},_=()=>{},x){if(this._modelType=x.modelType,this._modelType=="ifc"){const k=x.IfcAPI!==void 0&&x.IfcAPI!==null,P=x.WebIFC!==void 0&&x.WebIFC!==null;k&&P&&this.log("载入外部传入webifc..."),this._ifcLoader=k&&P?new p.WebIFCLoaderPlugin(this.viewer,{WebIFC:x.WebIFC,IfcAPI:x.IfcAPI}):new p.WebIFCLoaderPlugin(this.viewer,{}),this._modelsInfo[v]={id:v,ifc:b,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}}else this._modelType=="xtc"?(this._xtcLoader=new p.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[v]={id:v,xtc:b,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}):this._modelType=="glb"&&(this._glbLoader=new p.GLTFLoaderPlugin(this.viewer),this._modelsInfo[v]={id:v,gltf:b,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0});const E=this._modelsInfo[v];for(const k of h)x&&x[k]!==void 0&&x[k]!==null&&(E[k]=x[k]);x&&x.alignTo!==void 0&&x.alignTo!==null&&(E.alignTo=x.alignTo),x&&x.brightness!==void 0&&x.brightness!==null&&(E.brightness=x.brightness),this._loadGeometry(v,w,_)}unloadModel(v){const b=this.viewer.scene.models[v];if(!b){this.error("Model not loaded: "+v);return}b.destroy(),delete this._modelsInfo[v],this.fire("modelUnloaded",v)}loadMetadata(v,b,w,_){const x=this.viewer.metaScene.metaModels[v];if(!x){this.warn("loadMetadata() - MetaModel not found: "+v),_&&_();return}this._xtcLoader&&(this._modelsInfo[v]&&(this._modelsInfo[v].metaBuffer=b),this._xtcLoader.loadMetadata(x,b,w,_))}_loadGeometry(v,b,w){const _=this._modelsInfo[v],x=Object.assign({},_),E=this._resolveModelTransform(_);for(const D of h)delete x[D];delete x.alignTo;for(const D of Object.keys(E))x[D]=E[D];const k=()=>{this._jumpToInitialCamera(),this.fire("modelLoaded",v),b&&b()},P=D=>{this.error(D),w&&w(D)};if(this._modelType=="ifc"&&this._ifcLoader)if(this._modelFromOutSide){this.log("正在载入ifc模型...");const D=this._ifcLoader.load(x);D.on("loaded",k),D.on("error",P)}else{this.log("正在载入引擎从本地获取的ifc模型...");const D={id:v,src:this._modelSrc,edges:x.edges,loadMetadata:!1,pbrEnabled:x.pbrEnabled,dtxEnabled:x.dtxEnabled};for(const z of h)x[z]!==void 0&&x[z]!==null&&(D[z]=x[z]);const R=this._ifcLoader.load(D);R.on("loaded",k),R.on("error",P)}else if(this._modelType==="xtc"&&this._xtcLoader){if(this._modelFromOutSide){this.log("正在载入xtc模型...");const D=this._xtcLoader.load(x);D.on("loaded",k),D.on("error",P)}}else if(this._modelType==="glb"&&this._glbLoader&&this._modelFromOutSide){this.log("正在载入glb模型...");const D=this._glbLoader.load(x);D.on("loaded",k),D.on("error",P)}}_resolveModelTransform(v){const b={};let w=null,_=null,x=null,E=null;if(v.matrix){const k=[0,0,0],P=[0,0,0,1],D=[1,1,1];u(v.matrix,k,P,D),w=k,_=c(P),x=D}else v.position&&(w=Array.from(v.position)),v.quaternion?_=c(v.quaternion):v.rotation&&(_=Array.from(v.rotation)),v.scale&&(x=Array.from(v.scale));if(v.origin&&(E=Array.from(v.origin)),v.alignTo){const k=this.viewer.scene.models[v.alignTo];k?(E===null&&(E=Array.from(k.origin)),w===null&&(w=Array.from(k.position)),_===null&&(_=Array.from(k.rotation)),x===null&&(x=Array.from(k.scale))):this.warn(`alignTo: 基准模型 "${v.alignTo}" 尚未加载,将按自身坐标加载`)}return w&&(b.position=w),_&&(b.rotation=_),x&&(b.scale=x),E&&(b.origin=E),b}_jumpToInitialCamera(){const{viewer:v}=this,{scene:b}=v,w=b.getAABB(b.visibleObjectIds),_=p.math.getAABB3Diag(w),x=p.math.getAABB3Center(w,A),{camera:E}=b,k=Math.abs(_/Math.tan(45*p.math.DEGTORAD)),P=p.math.normalizeVec3(E.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),D=p.math.normalizeVec3(E.yUp?[-.5,.7071,-.5]:[-1,1,1]);v.cameraControl.pivotPos=x,v.cameraControl.planView&&(v.cameraControl.planView=!1),v.cameraFlight.jumpTo({look:x,eye:[x[0]-k*P[0],x[1]-k*P[1],x[2]-k*P[2]],up:D,orthoScale:_*1.1})}destroy(){super.destroy(),this._xtcLoader&&this._xtcLoader.destroy(),this._ifcLoader&&this._ifcLoader.destroy(),this._glbLoader&&this._glbLoader.destroy()}}},"./src/explorer/ObjectsExplorer.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u={}){super(d);const{modelType:c}=u;this.eventTrigger=d.eventTrigger,this._treeView=new p.TreeViewPlugin(this.viewer,{hierarchy:"containment",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",f=>{this._rootNode=f,this.eventTrigger.emit("object_rootNodes",f)}),this._treeView.on("nodeNodes_Created",f=>{this._nodeList=f,this.eventTrigger.emit("object_nodeNodes",f)}),this._treeView.on("objectNodes_Created",f=>{this._objectList=f,this.eventTrigger.emit("object_objectNodes",f)}),this._treeView.on("checkBoxChanged",f=>{this.eventTrigger.emit("object_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}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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");const A=p.math.vec3();class h extends y.default{constructor(u,c={}){super(u);const{modelType:f}=c;this.eventTrigger=u.eventTrigger,this._treeView=new p.TreeViewPlugin(this.viewer,{hierarchy:"storeys",autoAddModels:!1,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",m=>{this._rootNode=m,this.eventTrigger.emit("storeys_rootNodes",m)}),this._treeView.on("nodeNodes_Created",m=>{this._nodeList=m,this.eventTrigger.emit("storeys_nodeNodes",m)}),this._treeView.on("objectNodes_Created",m=>{this._objectList=m,this.eventTrigger.emit("storeys_objectNodes",m)}),this._treeView.on("checkBoxChanged",m=>{this.eventTrigger.emit("storeys_checkBoxChanged",m)}),f==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",m=>{this._treeView.addModel(m,{rootName:m})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",m=>{m.result==="success"&&(this._treeView.addModel(m.metaModel.id,{rootName:m.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",m=>{this.viewer.metaScene.metaModels[m]&&this._treeView.removeModel(m)})}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,c){const f=this._nodeList[u],m=c,{objects:g}=this.viewer.scene;let v=0;this._treeView.withNodeTree(f,w=>{const{objectId:_}=w,x=g[_],E=w.children.length===0;w.numVisibleEntities=m?w.numEntities:0,E&&m!==w.checked&&v++,w.checked=m,x&&(x.visible=m)});let{parent:b}=f;for(;b;)b.checked=m,m?b.numVisibleEntities+=v:b.numVisibleEntities-=v,b=b.parent}nodeTitleClicked(u){const{scene:c}=this.viewer,f=this._nodeList[u],m=[];this._treeView.withNodeTree(f,v=>{v.objectId&&m.push(v.objectId)});const{checked:g}=f;g?(c.setObjectsXRayed(m,!1),c.setObjectsVisible(m,!1),c.setObjectsPickable(m,!0)):(c.setObjectsXRayed(m,!1),c.setObjectsVisible(m,!0),c.setObjectsPickable(m,!0))}setEnabled(u){}_selectObjects(u,c){const{scene:f}=this.viewer,m=f.getAABB(u);this.viewer.cameraControl.pivotPos=p.math.getAABB3Center(m,A),c?(f.setObjectsXRayed(f.objectIds,!0),f.setObjectsVisible(f.objectIds,!0),f.setObjectsPickable(f.objectIds,!1),f.setObjectsSelected(f.selectedObjectIds,!1),f.setObjectsXRayed(u,!1),f.setObjectsVisible(u,!0),f.setObjectsPickable(u,!0),this.viewer.cameraFlight.flyTo({aabb:m},()=>{setTimeout(()=>{f.setObjectsVisible(f.xrayedObjectIds,!1),f.setObjectsXRayed(f.xrayedObjectIds,!1)},500),c()})):(f.setObjectsVisible(f.objectIds,!1),f.setObjectsPickable(f.xrayedObjectIds,!0),f.setObjectsXRayed(f.xrayedObjectIds,!1),f.setObjectsSelected(f.selectedObjectIds,!1),f.setObjectsVisible(u,!0),this.viewer.cameraFlight.jumpTo({aabb:m}))}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,c){const{metaScene:f}=this.viewer,m=f.metaObjects[u];if(!m){this.error(`selectStorey() - object is not found: ${u}`);return}if(m.type!=="IfcBuildingStorey"){this.error(`selectStorey() - object is not found: ${u}`);return}const g=m.getObjectIDsInSubtree();this._selectObjects(g,c)}}},"./src/messages.ts"(s,C,i){i.r(C),i.d(C,{default:()=>y});const y={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"(s,C,i){i.r(C),i.d(C,{default:()=>c});var p=i("./node_modules/axios/lib/axios.js"),y=i("./node_modules/ali-oss/dist/aliyun-oss-sdk.js"),A=i.n(y),h=function(f,m,g,v){function b(w){return w instanceof g?w:new g(function(_){_(w)})}return new(g||(g=Promise))(function(w,_){function x(P){try{k(v.next(P))}catch(D){_(D)}}function E(P){try{k(v.throw(P))}catch(D){_(D)}}function k(P){P.done?w(P.value):b(P.value).then(x,E)}k((v=v.apply(f,m||[])).next())})};function d(f){return h(this,void 0,void 0,function*(){try{return(yield p.default.get(f)).data.data}catch(m){throw console.error("Error fetching data:",m),m}})}function u(f,m){return h(this,void 0,void 0,function*(){const g=yield d(f);return new(A())({region:"oss-cn-beijing",accessKeyId:g.accessKeyId,accessKeySecret:g.accessKeySecret,stsToken:g.securityToken,bucket:m})})}class c{static getBuffer(m,g,v,b,w){return h(this,void 0,void 0,function*(){try{const x=yield(yield u(g,v)).get(`${m}`);b(x.content.buffer)}catch(_){w(_)}})}static requestFileFromOSS(m,g,v,b,w,_){return h(this,void 0,void 0,function*(){try{const x=yield u(g,v);if(b){const E=yield x.get(`${m}/metadata.json`);w(JSON.parse(E.content))}else{const E=yield x.get(`${m}/index.json`);w(JSON.parse(E.content))}}catch(x){console.error("请求文件失败:",x)}})}}},"./src/server/Server.ts"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/server/OSSHelper.ts"),A=function(d,u,c,f){function m(g){return g instanceof c?g:new c(function(v){v(g)})}return new(c||(c=Promise))(function(g,v){function b(x){try{_(f.next(x))}catch(E){v(E)}}function w(x){try{_(f.throw(x))}catch(E){v(E)}}function _(x){x.done?g(x.value):m(x.value).then(b,w)}_((f=f.apply(d,u||[])).next())})};class h{constructor(u={}){this._dataDir=u.dataDir||"",this._filePath=u.filePath||""}getProjects(u,c){const f=`${this._dataDir}/projects/index.json`;p.utils.loadJSON(f,u,c)}getProject(u,c,f){const m=`${this._dataDir}/projects/${u}/index.json`;p.utils.loadJSON(m,c,f)}getMetadata(u,c,f,m){const g=`${this._dataDir}/projects/${u}/models/${c}/metadata.json`;p.utils.loadJSON(g,f,m)}getModelProject(u,c,f,m){return A(this,void 0,void 0,function*(){yield y.default.requestFileFromOSS(this._filePath,u,c,!1,f,m)})}getModelMetadata(u,c,f,m){return A(this,void 0,void 0,function*(){yield y.default.requestFileFromOSS(this._filePath,u,c,!0,f,m)})}getModelGeometry(u,c,f,m){return A(this,void 0,void 0,function*(){yield y.default.getBuffer(this._filePath,u,c,f,m)})}getGeometry(u,c,f,m){const g=`${this._dataDir}/projects/${u}/models/${c}/geometry.xtc`;p.utils.loadArraybuffer(g,f,m)}getObjectInfo(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models${c}/props/${f}.json`;p.utils.loadJSON(v,m,g)}getIssues(u,c,f,m){const g=`${this._dataDir}/projects/${u}/modelId/${c}/issues.json`;p.utils.loadJSON(g,f,m)}getSplitModelManifest(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models${c}/${f}`;p.utils.loadJSON(v,m,g)}getSplitModelMetadata(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models/${c}/${f}`;p.utils.loadJSON(v,m,g)}getSplitModelGeometry(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models${c}/${f}`;p.utils.loadArraybuffer(v,m,g)}}},"./src/toolbar/AnnotationTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.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:m}=d.viewer.scene.canvas;m.parentNode.insertBefore(this.annotationWrapper,m)}this.annotationsPlugin=new p.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",m=>{});let c;this.annotationsPlugin.on("markerClicked",m=>{this.eventTrigger.emit("markerClicked",m),c=m}),this.annotationsPlugin.on("markerDoubleClicked",m=>{this.eventTrigger.emit("markerDoubleClicked",m)});const f=m=>{this._active&&(m.key==="Delete"||m.keyCode===8)&&this.eventTrigger.emit("requestDeleteMarker",c.id)};document.addEventListener("keydown",f.bind(this)),this.on("destroy",()=>{document.removeEventListener("keydown",f.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),c=this.viewer.scene.pick({canvasPos:u,pickSurface:!0});if(c){const f=c.entity.id,m=this.generateId(f);this.annotationsPlugin.createAnnotation({id:m,pickResult:c,occludable:!0,markerShown:!0,labelShown:!1,values:{id:m,entityid:f,iconPath:this.getTypeImage(this._currentType),iconType:this._currentType}}),this.currentAnnotation={id:m,modelId:c.entity.model.id,entityId:f,type:this._currentType,content:{worldPos:[c.worldPos[0],c.worldPos[1],c.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(),c=Math.floor(performance.now()*1e3);return`${d}_${this._currentType}_${u}_${c}`}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 c=d.touches[0];let f=d.target,m=0,g=0;for(;f.offsetParent;)m+=f.offsetLeft,g+=f.offsetTop,f=f.offsetParent;u[0]=c.pageX-m,u[1]=c.pageY-g}else{let c=this.viewer.scene.canvas.canvas,f=0,m=0;for(;c.offsetParent;)f+=c.offsetLeft,m+=c.offsetTop,c=c.offsetParent;u[0]=d.pageX-f,u[1]=d.pageY-m}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,c){this.annotationsPlugin.createAnnotation({id:d,worldPos:u,occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:d,entityid:d,iconPath:this.getTypeImage(c),iconType:c}})}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,c)=>{u.id===d&&this._AnnotationList.splice(c,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"(s,C,i){i.r(C),i.d(C,{default:()=>d});var p=i("./src/Controller.ts"),y=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),A=i("./node_modules/@parametricos/bcf-js/dist/index.js"),h=function(u,c,f,m){function g(v){return v instanceof f?v:new f(function(b){b(v)})}return new(f||(f=Promise))(function(v,b){function w(E){try{x(m.next(E))}catch(k){b(k)}}function _(E){try{x(m.throw(E))}catch(k){b(k)}}function x(E){E.done?v(E.value):g(E.value).then(w,_)}x((m=m.apply(u,c||[])).next())})};class d extends p.default{constructor(c,f){super(c,f),this._enableAnno=!1,this._imagePath="",this.eventTrigger=c.eventTrigger,this.bCFViewpointsPlugin=new y.BCFViewpointsPlugin(c.viewer,{originatingSystem:"tctwins.com",authoringTool:"tctwins.com"}),this.bcfAnnoWrapper=document.createElement("div"),this.bcfAnnoWrapper.id="bcfAnnoWrapper";const{canvas:m}=c.viewer.scene.canvas;m.parentNode.insertBefore(this.bcfAnnoWrapper,m),this.bcfAnnoPlugin=new y.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:""}}),c.viewer.scene.input.on("mouseclicked",g=>{if(!this._enableAnno||!this._active)return;const v=c.viewer.scene.pick({canvasPos:g,pickSurface:!0}),b=v.entity.id;if(v){const w=this.addBCFAnno(b,g,"text");this.eventTrigger.emit("bcfNewAnno",w)}}),this.on("active",g=>{c.disableClickEvent=g})}readBCF(c){return h(this,void 0,void 0,function*(){const f=new A.BcfReader;return yield f.read(c),f.project})}createBCF(c){return h(this,void 0,void 0,function*(){const f=new A.BcfReader;let m=[];const g=c.markups;g&&g.forEach(_=>{let x=[],E=[];_.viewPoints&&_.viewPoints.forEach((R,z)=>{var F;if(R.bcfView){let H=this.bCFViewpointsPlugin.getUUID(),$={index:z,guid:H,snapshot:R.bcfView.snapshot?`${H}_snapshot.png`:void 0,viewpoint:`${H}_viewpoint.bcfv`},K={guid:H,components:R.bcfView.components,perspective_camera:R.bcfView.perspective_camera,orthogonal_camera:R.bcfView.orthogonal_camera,snapshot:(F=R.bcfView.snapshot)===null||F===void 0?void 0:F.snapshot_data};x.push($),E.push(K)}});let k=[];_.comments&&_.comments.forEach((R,z)=>{let H={guid:this.bCFViewpointsPlugin.getUUID(),date:R.date,author:R.author,comment:R.comment,viewpoint:R.viewPoint,modified_date:R.modified_date?R.modified_date:R.date,modified_author:R.modified_author?R.modified_author:R.author};k.push(H)});const D={topic:{guid:this.bCFViewpointsPlugin.getUUID(),title:_.title,priority:_.priority,topic_type:_.type,topic_status:_.status?_.status:"Active",due_date:_.dueDate,creation_date:_.createDate?_.createDate:new Date().toISOString(),creation_author:_.author,assigned_to:_.assignedTo,index:_.index?_.index:1,viewpoints:x,comments:k},viewpoints:E};m.push(D)});const v={project_id:c.id?c.id:"",name:c.name?c.name:"",version:c.version?c.version:2.1,reader:f,markups:m,extension_schema:void 0};return yield new A.BcfWriter().write(v)})}saveBcf(c){return h(this,void 0,void 0,function*(){return console.log(c),yield new A.BcfWriter().write(c)})}getBCFView(){return this.bCFViewpointsPlugin.getViewpoint()}getSnapshot(c){for(var f=c.replace(/^data:image\/(png|jpeg);base64,/,""),m=atob(f),g=m.length,v=new Uint8Array(g),b=0;b<g;b++)v[b]=m.charCodeAt(b);var w=new Blob([v],{type:"image/png"});return w}set enableAnno(c){this._enableAnno=c}get enableAnno(){return this._enableAnno}set imagePath(c){this._imagePath=c}get imagePath(){return this._imagePath}addBCFAnno(c,f,m){this.bcfAnnoPlugin.createAnnotation({id:c,worldPos:f,occludable:!0,markerShown:!0,labelShown:!0,values:{id:c,entityid:c,iconPath:this._imagePath,iconType:m}})}getNewGuid(){return this.bCFViewpointsPlugin.getUUID()}}},"./src/toolbar/CommentsTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/decimal.js/decimal.mjs"),y=i("./src/Controller.ts");class A extends y.default{constructor(c,f){super(c,f),this._commentsList={},this.eventTrigger=c.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",m=>{m?this.saveSVG():this.endCommentsTool()}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.initEventListeners()}saveSVG(){const c=document.getElementById("myCanvas");let f=c.clientWidth,m=c.clientHeight;const g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",f.toString()),g.setAttribute("height",m.toString());const v=document.createElementNS("http://www.w3.org/2000/svg","image");v.setAttribute("x","0"),v.setAttribute("y","0"),v.setAttribute("width",f.toString()),v.setAttribute("height",m.toString()),v.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c.toDataURL()),g.appendChild(v),g.setAttribute("id","svgImage");const b=document.getElementById("comments_panel");b&&(b.innerHTML=""),b==null||b.appendChild(g),this.checkSelectionBox(),this._revocationMechanism=new h(this.eventTrigger),this.eventTrigger.emit("saveImage")}initEventListeners(){let c,f,m,g,v;const b=(w,_,x,E)=>{const k=[w-_,x-E],P=this.getInitVector(k[0],k[1]),D=this.getVerticalUnitVector(k[0],k[1]),R=.5,z=(_-2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),F=(E-2*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),H=(w-2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),$=(x-2*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),K=(w-7*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),G=(x-7*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),j=(w+12*Number(this._ArrowstrokeWidth)*R*P[0]).toString(),N=(x+12*Number(this._ArrowstrokeWidth)*R*P[1]).toString(),I=(w+7*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),L=(x+7*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),U=(w+2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),O=(x+2*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),Q=(_+2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),W=(E+2*Number(this._ArrowstrokeWidth)*R*D[1]).toString();return`M ${_},${E}L ${z},${F}L ${H},${$}L ${K},${G}L ${j},${N}L ${I},${L}L ${U},${O}L ${Q},${W}L${_},${E}`};this.eventTrigger.on("saveImage",()=>{const w=document.getElementById("svgImage"),_=H=>{const{target:$}=H;if($.tagName==="text"){this.hiddenAllInput();const K=$.parentNode,G=K.querySelector("foreignObject"),j=G.querySelector("input"),{textContent:N}=K;if(j)j.style.display="inline",$.textContent="";else{const I=document.createElement("input");I.setAttribute("type","text"),I.setAttribute("class","commentInputBox"),N!=""&&I.setAttribute("placeholder",N),G.appendChild(I)}this.isTyping=!0}},x=H=>{if(this._isTouch)return;const{target:$}=H;if($.tagName==="ellipse"||$.tagName==="path"||$.tagName==="rect"||$.tagName==="text"){if($.id!="selectionBox")if($.getAttribute("type")=="handle"){c=H.clientX+this._offsetX,f=H.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=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!=$&&(this.isDuplicate=!1,this.chosedTarget=$),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,c=H.clientX+this._offsetX,f=H.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.autoSaveInput(),this.setCurrentMode(""),this.eventTrigger.emit("choseTarget")}else if($.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,c=H.clientX+this._offsetX,f=H.clientY+this._offsetY;const K=document.createElementNS("http://www.w3.org/2000/svg","g");K.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let G;switch(this._currentMode){case"path":G=document.createElementNS("http://www.w3.org/2000/svg","path"),G.setAttribute("d",`M ${c},${f}`),G.setAttribute("stroke",this._Pathcolor),G.setAttribute("stroke-width",this._PathstrokeWidth),G.setAttribute("fill","transparent"),K.setAttribute("type","path");break;case"ellipse":G=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),G.setAttribute("cx",c.toString()),G.setAttribute("cy",f.toString()),G.setAttribute("rx","0"),G.setAttribute("ry","0"),G.setAttribute("stroke",this._Ellipsecolor),G.setAttribute("stroke-width",this._EllipsestrokeWidth),G.setAttribute("fill","transparent"),K.setAttribute("type","ellipse");break;case"rect":G=document.createElementNS("http://www.w3.org/2000/svg","rect"),G.setAttribute("x",c.toString()),G.setAttribute("y",f.toString()),G.setAttribute("stroke",this._Rectcolor),G.setAttribute("stroke-width",this._RectstrokeWidth),G.setAttribute("fill","transparent"),K.setAttribute("type","rect");break;case"arrow":G=document.createElementNS("http://www.w3.org/2000/svg","path"),G.setAttribute("d",`M ${c},${f}`),G.setAttribute("stroke-width","20"),G.setAttribute("stroke","transparent"),G.setAttribute("fill",this._Arrowcolor),K.setAttribute("type","arrow");break;case"text":if(this.isTyping)this.autoSaveInput();else if(!this.isChosed){const j=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");let N=0;this._FontSize=="16"?(j.setAttribute("width","120"),j.setAttribute("height","26"),N=28):this._FontSize=="18"?(j.setAttribute("width","140"),j.setAttribute("height","28"),N=30):Number(this._FontSize)<=14&&(j.setAttribute("width","100"),j.setAttribute("height",(Number(this._FontSize)+10).toString()),N=Number(this._FontSize)+10),j.setAttribute("x",c),j.setAttribute("y",f);const I=document.createElement("input");I.setAttribute("type","text"),I.setAttribute("class","commentInputBox"),I.setAttribute("placeholder","输入内容...");const L=document.createElementNS("http://www.w3.org/2000/svg","text");L.setAttribute("x",c+3),L.setAttribute("y",(f+N-Number(this._FontSize)/2).toString()),L.setAttribute("font-size",this._FontSize),L.setAttribute("stroke",this._Textcolor),L.setAttribute("stroke-width",this._TextstrokeWidth),L.setAttribute("fill",this._Textcolor),L.setAttribute("lengthAdjust","spacingAndGlyphs"),j.appendChild(I),K.setAttribute("type","text"),K.appendChild(j),K.appendChild(L),w==null||w.insertBefore(K,w==null?void 0:w.lastElementChild),I.click(),this.isTyping=!0,this.eventTrigger.emit("createNew")}break}this._currentMode!="text"&&this._currentMode!=""&&(K.appendChild(G),w==null||w.insertBefore(K,w==null?void 0:w.lastElementChild)),this.isChosed=!1}}},E=H=>{var $,K,G,j,N,I,L,U,O,Q,W,Z,J,ne,ae,ce,q,fe,re,te,le,de,he,ue,pe,se,V,Ce,ve,ye,Ae,me;if(this._isTouch)return;const be=H.clientX+this._offsetX,we=H.clientY+this._offsetY;let Te;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":Te=document.querySelectorAll("g");const Ke=[];Te.forEach(at=>{at.getAttribute("type")=="path"&&Ke.push(at)});const Xe=Ke[Ke.length-1].querySelector("path");let Ge=Xe.getAttribute("d");Ge&&(Ge+=`L ${be},${we}`,Xe.setAttribute("d",Ge));break;case"ellipse":var He=document.querySelectorAll("ellipse"),je=He[He.length-1];if(je){var qe=Math.abs(be-c)/2,tt=Math.abs(we-f)/2;je.setAttribute("cx",((be+c)/2).toString()),je.setAttribute("cy",((we+f)/2).toString()),je.setAttribute("rx",qe.toString()),je.setAttribute("ry",tt.toString())}break;case"rect":const ze=document.querySelectorAll("g"),Ct=[];ze.forEach(at=>{at.getAttribute("type")=="rect"&&Ct.push(at.childNodes[0])});const It=Ct[Ct.length-1],Ot=It.getAttribute("x"),Ze=It.getAttribute("y");if(Ot&&Ze){const at=Math.abs(parseInt(Ot)-be),jt=Math.abs(parseInt(Ze)-we);It.setAttribute("width",at.toString()),It.setAttribute("height",jt.toString()),It.setAttribute("rx","9"),It.setAttribute("ry","9"),It.setAttribute("type","comment")}break;case"arrow":Te=document.querySelectorAll("g");const gt=[];Te.forEach(at=>{at.getAttribute("type")=="arrow"&>.push(at)});const _t=gt[gt.length-1].querySelector("path");if(_t.getAttribute("d")){const at=b(be,c,we,f);_t.setAttribute("d",at)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(be-c)>=1||Math.abs(we-f)>=1)&&(this.isMoving=!0);const Ke=($=this.chosedTarget)===null||$===void 0?void 0:$.getBBox();switch(this.chosedTarget.tagName){case"path":const Xe=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,It=>{const[Ot,Ze]=It.split(",").map(parseFloat),gt=Number(Ot)+Number(be)-Number(Ke.x)-(Number(c)-Number(m)),vt=Number(Ze)+Number(we)-Number(Ke.y)-(Number(f)-Number(g));return`${gt.toString()},${vt.toString()}`});(G=this.chosedTarget)===null||G===void 0||G.setAttribute("d",Xe);break;case"ellipse":var mt=Number((j=this.chosedTarget)===null||j===void 0?void 0:j.getAttribute("cx")),kt=Number((N=this.chosedTarget)===null||N===void 0?void 0:N.getAttribute("cy"));const Ge=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("rx")),ze=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("ry"));(U=this.chosedTarget)===null||U===void 0||U.setAttribute("cx",be-(c-m)/2+Ge),(O=this.chosedTarget)===null||O===void 0||O.setAttribute("cy",we-(f-g)/2+ze);break;case"rect":(Q=this.chosedTarget)===null||Q===void 0||Q.setAttribute("x",be-(c-m)),(W=this.chosedTarget)===null||W===void 0||W.setAttribute("y",we-(f-g));break;case"text":(Z=this.chosedTarget)===null||Z===void 0||Z.setAttribute("x",(be-(c-m)).toString()),(J=this.chosedTarget)===null||J===void 0||J.setAttribute("y",(we-(f-g)+Ke.height*3/4).toString());var ht=this.chosedTarget.getAttribute("font-size");const Ct=this.chosedTarget.parentNode;if(Ct){const It=Ct.querySelector("foreignObject");It&&(It.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),It.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(ht)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const nt=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let Xe,Ge,ze,Ct,It;v=(ae=this.chosedTarget)===null||ae===void 0?void 0:ae.getBBox(),this._stratchPos.indexOf("right")!==-1&&v.width+be-c<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&v.width-(be-c)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&v.height-(we-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&v.height+(we-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top")),Xe=nt.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,_t=>{const[Bt,at]=_t.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(Ct=new p.default(be-c).mul(new p.default(Bt-v.x).div(v.width))),this._stratchPos.indexOf("left")!==-1&&(Ct=new p.default(be-c).mul(new p.default(v.x+v.width-Bt).div(v.width))),(Number.isNaN(Ct)||!Ct)&&(Ct=new p.default(0)),Ge=new p.default(Bt).add(Ct)):Ge=new p.default(Bt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(It=new p.default(we-f).mul(new p.default(v.y+v.height-at).div(v.height))),this._stratchPos.indexOf("bottom")!==-1&&(It=new p.default(we-f).mul(new p.default(at-v.y).div(v.height))),(Number.isNaN(It)||!It)&&(It=new p.default(0)),ze=new p.default(at).add(It)):ze=new p.default(at),`${Ge.toFixed(16)},${ze.toFixed(16)}`}),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("d",Xe);break;case"ellipse":var mt=Number((q=this.chosedTarget)===null||q===void 0?void 0:q.getAttribute("cx")),kt=Number((fe=this.chosedTarget)===null||fe===void 0?void 0:fe.getAttribute("cy")),qe=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("rx")),tt=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(mt+=(be-c)*.5,qe-=(be-c)*.5):this._stratchPos.indexOf("right")!==-1&&(mt+=(be-c)*.5,qe+=(be-c)*.5),this._stratchPos.indexOf("top")!==-1?(kt+=(we-f)*.5,tt-=(we-f)*.5):this._stratchPos.indexOf("bottom")!==-1&&(kt+=(we-f)*.5,tt+=(we-f)*.5),qe<0?this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left"):((le=this.chosedTarget)===null||le===void 0||le.setAttribute("cx",mt.toString()),(de=this.chosedTarget)===null||de===void 0||de.setAttribute("rx",qe.toString())),tt<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top"):((he=this.chosedTarget)===null||he===void 0||he.setAttribute("cy",kt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("ry",tt.toString()));break;case"rect":var yt=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),Lt=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("y")),We=Number((V=this.chosedTarget)===null||V===void 0?void 0:V.getAttribute("width")),Oe=Number((Ce=this.chosedTarget)===null||Ce===void 0?void 0:Ce.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(yt+=be-c,We-=be-c):this._stratchPos.indexOf("right")!==-1&&(We+=be-c),We<0?this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left"):((ve=this.chosedTarget)===null||ve===void 0||ve.setAttribute("x",yt.toString()),(ye=this.chosedTarget)===null||ye===void 0||ye.setAttribute("width",We.toString())),this._stratchPos.indexOf("top")!==-1?(Lt+=we-f,Oe-=we-f):this._stratchPos.indexOf("bottom")!==-1&&(Oe+=we-f),Oe<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top"):((Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("y",Lt.toString()),(me=this.chosedTarget)===null||me===void 0||me.setAttribute("height",Oe.toString()));break}this.updateSelectionBox(),c=H.clientX+this._offsetX,f=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=w==null?void 0:w.lastElementChild;if(H){const $=H.previousElementSibling;w==null||w.removeChild($)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))},P=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()},D=H=>{if(!this._isTouch)return;const $=H.touches[0],{target:K}=$;if(K.tagName==="ellipse"||K.tagName==="path"||K.tagName==="rect"||K.tagName==="arrow"||K.tagName==="text")if(K.getAttribute("type")=="handle"){c=$.clientX+this._offsetX,f=$.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.isStretch=!0;const{id:G}=$.target;this._stratchPos=G}else this.chosedTarget!=K&&(this.isDuplicate=!1,this.chosedTarget=K),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,c=$.clientX+this._offsetX,f=$.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=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&&$.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,c=$.clientX+this._offsetX,f=$.clientY+this._offsetY;const G=document.createElementNS("http://www.w3.org/2000/svg","g");G.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let j;switch(this._currentMode){case"path":j=document.createElementNS("http://www.w3.org/2000/svg","path"),j.setAttribute("d",`M ${c},${f}`),j.setAttribute("stroke",this._Pathcolor),j.setAttribute("stroke-width",this._PathstrokeWidth),j.setAttribute("fill","transparent"),G.setAttribute("type","path");break;case"ellipse":j=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),j.setAttribute("cx",c.toString()),j.setAttribute("cy",f.toString()),j.setAttribute("rx","0"),j.setAttribute("ry","0"),j.setAttribute("stroke",this._Ellipsecolor),j.setAttribute("stroke-width",this._EllipsestrokeWidth),j.setAttribute("fill","transparent"),G.setAttribute("type","ellipse");break;case"rect":j=document.createElementNS("http://www.w3.org/2000/svg","rect"),j.setAttribute("x",c.toString()),j.setAttribute("y",f.toString()),j.setAttribute("stroke",this._Rectcolor),j.setAttribute("stroke-width",this._RectstrokeWidth),j.setAttribute("fill","transparent"),G.setAttribute("type","rect");break;case"arrow":j=document.createElementNS("http://www.w3.org/2000/svg","path"),j.setAttribute("d",`M ${c},${f}`),j.setAttribute("stroke-width","20"),j.setAttribute("stroke","transparent"),j.setAttribute("fill",this._Arrowcolor),G.setAttribute("type","arrow");break;case"text":this.eventTrigger.emit("clickCreateText",$);break}this._currentMode!="text"&&this._currentMode!=""&&(G.appendChild(j),w==null||w.insertBefore(G,w==null?void 0:w.lastElementChild)),this.isChosed=!1}}},R=H=>{var $,K,G,j,N,I,L,U,O,Q,W,Z,J,ne,ae,ce,q,fe,re,te,le,de,he,ue,pe,se,V,Ce,ve,ye,Ae,me;if(!this._isTouch)return;const be=H.touches[0],we=be.clientX+this._offsetX,Te=be.clientY+this._offsetY;let He;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":He=document.querySelectorAll("g");const Ct=[];He.forEach(at=>{at.getAttribute("type")=="path"&&Ct.push(at)});const Ot=Ct[Ct.length-1].querySelector("path");let Ze=Ot.getAttribute("d");Ze&&(Ze+=`L ${we},${Te}`,Ot.setAttribute("d",Ze));break;case"ellipse":var je=document.querySelectorAll("ellipse"),qe=je[je.length-1];if(qe){var tt=Math.abs(we-c)/2,mt=Math.abs(Te-f)/2;qe.setAttribute("cx",((we+c)/2).toString()),qe.setAttribute("cy",((Te+f)/2).toString()),qe.setAttribute("rx",tt.toString()),qe.setAttribute("ry",mt.toString())}break;case"rect":var kt=document.querySelectorAll("rect"),ht=kt[kt.length-10],yt=ht.getAttribute("x"),Lt=ht.getAttribute("y");if(yt&&Lt){var We=Math.abs(parseInt(yt)-we),Oe=Math.abs(parseInt(Lt)-Te);ht.setAttribute("width",We.toString()),ht.setAttribute("height",Oe.toString()),ht.setAttribute("rx","9"),ht.setAttribute("ry","9"),ht.setAttribute("type","comment")}break;case"arrow":He=document.querySelectorAll("g");const gt=[];He.forEach(at=>{at.getAttribute("type")=="arrow"&>.push(at)});const _t=gt[gt.length-1].querySelector("path");if(_t.getAttribute("d")){const at=b(we,c,Te,f);_t.setAttribute("d",at)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(we-c)>=1||Math.abs(Te-f)>=1)&&(this.isMoving=!0);const Ct=($=this.chosedTarget)===null||$===void 0?void 0:$.getBBox();switch(this.chosedTarget.tagName){case"path":const Ot=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,_t=>{const[Bt,at]=_t.split(",").map(parseFloat),jt=Number(Bt)+Number(we)-Number(Ct.x)-(Number(c)-Number(m)),rr=Number(at)+Number(Te)-Number(Ct.y)-(Number(f)-Number(g));return`${jt.toString()},${rr.toString()}`});(G=this.chosedTarget)===null||G===void 0||G.setAttribute("d",Ot);break;case"ellipse":var Ke=Number((j=this.chosedTarget)===null||j===void 0?void 0:j.getAttribute("cx")),nt=Number((N=this.chosedTarget)===null||N===void 0?void 0:N.getAttribute("cy"));const Ze=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("rx")),gt=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("ry"));(U=this.chosedTarget)===null||U===void 0||U.setAttribute("cx",we-(c-m)/2+Ze),(O=this.chosedTarget)===null||O===void 0||O.setAttribute("cy",Te-(f-g)/2+gt);break;case"rect":(Q=this.chosedTarget)===null||Q===void 0||Q.setAttribute("x",we-(c-m)),(W=this.chosedTarget)===null||W===void 0||W.setAttribute("y",Te-(f-g));break;case"text":(Z=this.chosedTarget)===null||Z===void 0||Z.setAttribute("x",(we-(c-m)).toString()),(J=this.chosedTarget)===null||J===void 0||J.setAttribute("y",(Te-(f-g)+Ct.height*3/4).toString());var Xe=this.chosedTarget.getAttribute("font-size");const vt=this.chosedTarget.parentNode;if(vt){const _t=vt.querySelector("foreignObject");_t&&(_t.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),_t.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(Xe)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const It=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let Ot,Ze,gt,vt,_t;v=(ae=this.chosedTarget)===null||ae===void 0?void 0:ae.getBBox(),this._stratchPos.indexOf("right")!==-1&&v.width+we-c<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&v.width-(we-c)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&v.height-(Te-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&v.height+(Te-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top")),Ot=It.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,ct=>{const[Rt,qt]=ct.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(vt=new p.default(we-c).mul(new p.default(Rt-v.x).div(v.width))),this._stratchPos.indexOf("left")!==-1&&(vt=new p.default(we-c).mul(new p.default(v.x+v.width-Rt).div(v.width))),(Number.isNaN(vt)||!vt)&&(vt=new p.default(0)),Ze=new p.default(Rt).add(vt)):Ze=new p.default(Rt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(_t=new p.default(Te-f).mul(new p.default(v.y+v.height-qt).div(v.height))),this._stratchPos.indexOf("bottom")!==-1&&(_t=new p.default(Te-f).mul(new p.default(qt-v.y).div(v.height))),(Number.isNaN(_t)||!_t)&&(_t=new p.default(0)),gt=new p.default(qt).add(_t)):gt=new p.default(qt),`${Ze.toFixed(16)},${gt.toFixed(16)}`}),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("d",Ot);break;case"ellipse":var Ke=Number((q=this.chosedTarget)===null||q===void 0?void 0:q.getAttribute("cx")),nt=Number((fe=this.chosedTarget)===null||fe===void 0?void 0:fe.getAttribute("cy")),tt=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("rx")),mt=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(Ke+=(we-c)*.5,tt-=(we-c)*.5):this._stratchPos.indexOf("right")!==-1&&(Ke+=(we-c)*.5,tt+=(we-c)*.5),this._stratchPos.indexOf("top")!==-1?(nt+=(Te-f)*.5,mt-=(Te-f)*.5):this._stratchPos.indexOf("bottom")!==-1&&(nt+=(Te-f)*.5,mt+=(Te-f)*.5),tt<0?this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left"):((le=this.chosedTarget)===null||le===void 0||le.setAttribute("cx",Ke.toString()),(de=this.chosedTarget)===null||de===void 0||de.setAttribute("rx",tt.toString())),mt<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top"):((he=this.chosedTarget)===null||he===void 0||he.setAttribute("cy",nt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("ry",mt.toString()));break;case"rect":var Ge=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),ze=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("y")),We=Number((V=this.chosedTarget)===null||V===void 0?void 0:V.getAttribute("width")),Oe=Number((Ce=this.chosedTarget)===null||Ce===void 0?void 0:Ce.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(Ge+=we-c,We-=we-c):this._stratchPos.indexOf("right")!==-1&&(We+=we-c),We<0?this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left"):((ve=this.chosedTarget)===null||ve===void 0||ve.setAttribute("x",Ge.toString()),(ye=this.chosedTarget)===null||ye===void 0||ye.setAttribute("width",We.toString())),this._stratchPos.indexOf("top")!==-1?(ze+=Te-f,Oe-=Te-f):this._stratchPos.indexOf("bottom")!==-1&&(Oe+=Te-f),Oe<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top"):((Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("y",ze.toString()),(me=this.chosedTarget)===null||me===void 0||me.setAttribute("height",Oe.toString()));break}this.updateSelectionBox(),c=be.clientX+this._offsetX,f=be.clientY+this._offsetY}},z=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:w.lastElementChild;if($){const K=$.previousElementSibling;w==null||w.removeChild(K)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))};w?(document.addEventListener("keydown",P.bind(this)),w.addEventListener("dblclick",_.bind(this)),w.addEventListener("mousedown",x.bind(this)),document.addEventListener("mousemove",E.bind(this)),w.addEventListener("mouseup",k.bind(this)),w.addEventListener("touchstart",D.bind(this)),document.addEventListener("touchmove",R.bind(this)),w.addEventListener("touchend",z.bind(this))):this.log("no svgImage");const F=()=>{const H=document.getElementById("svgImage");H?(document.removeEventListener("keydown",P.bind(this)),H.removeEventListener("dblclick",_.bind(this)),H.removeEventListener("mousedown",x.bind(this)),document.removeEventListener("mousemove",E.bind(this)),H.removeEventListener("mouseup",k.bind(this)),H.removeEventListener("touchstart",D.bind(this)),document.removeEventListener("touchmove",R.bind(this)),H.removeEventListener("touchend",z.bind(this))):this.log("no svgImage");const $=document.getElementById("comments_panel");$&&($.innerHTML=""),this.eventTrigger.off("clearAll",F)};this.eventTrigger.on("clearAll",F)})}clickCreateText(c,f){var m,g;let v;c.touches?v=c.touches[0]:v=c,this.showHiddenSelectedBox(!1);const b=v.clientX+this._offsetX,w=v.clientY+this._offsetY,_=document.createElementNS("http://www.w3.org/2000/svg","g");if(_.setAttribute("id",`${this._currentMode}_${this.getTime()}`),!this.isTyping&&!this.isChosed){const x=document.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("x",b+3),x.setAttribute("y",(w+24-Number(this._FontSize)/2).toString()),x.setAttribute("font-size",this._FontSize),x.setAttribute("stroke",this._Textcolor),x.setAttribute("stroke-width",this._TextstrokeWidth),x.setAttribute("fill",this._Textcolor),x.setAttribute("lengthAdjust","spacingAndGlyphs"),x.textContent=f,_.setAttribute("type","text"),_.appendChild(x);const E=document.getElementById("selectionBox_g");E&&((m=E.parentNode)===null||m===void 0||m.insertBefore(_,(g=E.parentNode)===null||g===void 0?void 0:g.lastElementChild)),this.isTyping=!0,this.AddNewState(()=>{this.eventTrigger.emit("createNew")})}}getInitVector(c,f){const m=Math.sqrt(c*c+f*f);return m==0?[0,0]:[c/m,f/m]}getVerticalUnitVector(c,f){if(Math.sqrt(c*c+f*f)===0)return[0,0];const g=-f,v=c,b=Math.sqrt(g*g+v*v),w=g/b,_=v/b;return[w,_]}getTwoPointLength(c,f){return c==f?0:Math.sqrt(c*c+f*f)}hiddenAllInput(){const c=document.querySelectorAll("foreignObject");c.length>0&&c.forEach(f=>{const m=f.querySelector("input"),g=f.parentNode;let v;g&&(v=g.querySelector("text")),v&&m&&(m.value!=""?v.textContent=m.value:v.textContent="双击此处输入内容",m.style.display="none")})}showHiddenSelectedBox(c){if(c){const m=this.chosedTarget.getBBox();this.selectionBox.setAttribute("x",m.x),this.selectionBox.setAttribute("y",m.y),this.selectionBox.setAttribute("width",m.width),this.selectionBox.setAttribute("height",m.height),this.selectionBox.style.display="inline";for(var f=0;f<8;f++)this.handles[f].style.display="inline"}else{this.selectionBox.style.display="none";for(var f=0;f<8;f++)this.handles[f].style.display="none"}this.updateSelectionBox()}updateSelectionBox(){var c;const f=(c=this.chosedTarget)===null||c===void 0?void 0:c.getBBox();if(f){this.selectionBox.setAttribute("x",f.x-4),this.selectionBox.setAttribute("y",f.y-4),this.selectionBox.setAttribute("width",f.width+8),this.selectionBox.setAttribute("height",f.height+8);const m=this.selectionBox.getBBox();for(let g=0;g<8;g++){const v=this.handles[g];switch(g){case 0:v.setAttribute("x",m.x-4),v.setAttribute("y",m.y-4);break;case 1:v.setAttribute("x",m.x+m.width/2-4),v.setAttribute("y",m.y-4);break;case 2:v.setAttribute("x",m.x+m.width-4),v.setAttribute("y",m.y-4);break;case 3:v.setAttribute("x",m.x+m.width-4),v.setAttribute("y",m.y+m.height/2-4);break;case 4:v.setAttribute("x",m.x+m.width-4),v.setAttribute("y",m.y+m.height-4);break;case 5:v.setAttribute("x",m.x+m.width/2-4),v.setAttribute("y",m.y+m.height-4);break;case 6:v.setAttribute("x",m.x-4),v.setAttribute("y",m.y+m.height-4);break;case 7:v.setAttribute("x",m.x-4),v.setAttribute("y",m.y+m.height/2-4);break}}}}publishComments(){this.deleteSvgCommentsListeners()}updateCommentsColor(){document.querySelectorAll("path").forEach(g=>{g.setAttribute("stroke","red")}),document.querySelectorAll("ellipse").forEach(g=>{g.setAttribute("stroke","blue")}),document.querySelectorAll("rect").forEach(g=>{g.id!="selectionBox"&&g.setAttribute("stroke","green")})}deleteSvgCommentsListeners(){const c=document.getElementById("svgImage");c&&(c.removeEventListener("mousedown",()=>{}),document.removeEventListener("mousemove",()=>{}),c.removeEventListener("mouseup",()=>{}),c.removeEventListener("mouseover",()=>{}))}deleteCurrentComments(){if(this.isChosed){const c=document.getElementById("svgImage");c==null||c.removeChild(this.chosedTarget.parentNode),this.showHiddenSelectedBox(!1)}this.AddNewState(()=>{})}getTime(){const c=new Date,f=c.getFullYear(),m=c.getMonth()+1<10?`0${c.getMonth()+1}`:c.getMonth()+1,g=c.getDate()<10?`0${c.getDate()}`:c.getDate(),v=c.getHours()<10?`0${c.getHours()}`:c.getHours(),b=c.getMinutes()<10?`0${c.getMinutes()}`:c.getMinutes(),w=c.getSeconds()<10?`0${c.getSeconds()}`:c.getSeconds();return f+m+g+v+b+w}duplicateComment(){var c,f,m,g,v,b,w,_,x,E,k,P,D,R;if(this.isChosed){const F=document.getElementById("svgImage"),H=this.chosedTarget.parentNode.cloneNode(!0);switch(F==null||F.insertBefore(H,F==null?void 0:F.lastElementChild),this.chosedTarget=H.firstChild,this.chosedTarget.tagName){case"path":const K=((c=this.chosedTarget)===null||c===void 0?void 0:c.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,j=>{const[N,I]=j.split(",").map(parseFloat),L=N+20,U=I+10;return`${L},${U}`});(f=this.chosedTarget)===null||f===void 0||f.setAttribute("d",K);break;case"ellipse":(m=this.chosedTarget)===null||m===void 0||m.setAttribute("cx",(Number((g=this.chosedTarget)===null||g===void 0?void 0:g.getAttribute("cx"))+20).toString()),(v=this.chosedTarget)===null||v===void 0||v.setAttribute("cy",(Number((b=this.chosedTarget)===null||b===void 0?void 0:b.getAttribute("cy"))+10).toString());break;case"rect":(w=this.chosedTarget)===null||w===void 0||w.setAttribute("x",(Number((_=this.chosedTarget)===null||_===void 0?void 0:_.getAttribute("x"))+20).toString()),(x=this.chosedTarget)===null||x===void 0||x.setAttribute("y",(Number((E=this.chosedTarget)===null||E===void 0?void 0:E.getAttribute("y"))+10).toString());break;case"text":(k=this.chosedTarget)===null||k===void 0||k.setAttribute("x",(Number((P=this.chosedTarget)===null||P===void 0?void 0:P.getAttribute("x"))+20).toString()),(D=this.chosedTarget)===null||D===void 0||D.setAttribute("y",(Number((R=this.chosedTarget)===null||R===void 0?void 0:R.getAttribute("x"))+10).toString());var z=this.chosedTarget.getAttribute("font-size");const G=this.chosedTarget.parentNode;if(G){const j=G.querySelector("foreignObject");j&&(j.setAttribute("x",(Number(this.chosedTarget.getAttribute("x"))-3+20).toString()),j.setAttribute("y",(Number(this.chosedTarget.getAttribute("y"))-(24-Number(z)/2)+10).toString()))}break}this.updateSelectionBox()}this.AddNewState(()=>{})}AddNewState(c){this.saveCurrentState(f=>{this._revocationMechanism&&this._revocationMechanism&&this._revocationMechanism.AddNewState(f,c)}),this.eventTrigger.emit("newState")}saveCurrentState(c){function f(v){const b={};for(let w=0;w<v.length;w++){const _=v[w];b[_.name]=_.value}return b}const m=document.getElementById("svgImage");if(m){const v=m.querySelectorAll("g");var g=[];v.forEach(b=>{if(b.getAttribute("id")){const _=b.attributes,x=b.children,E=new Map;let k=null;if(b.getAttribute("type")==="text"){for(let P=0;P<x.length;P++){const{tagName:D}=x[P];E.set(D,f(x[P].attributes)),D==="text"&&(k=x[P].textContent)}var w=new d(_,E,k);g.push(w)}else{for(let D=0;D<x.length;D++)E.set(x[D].tagName,f(x[D].attributes));var w=new d(_,E,null);g.push(w)}}})}c(g)}displayState(c){const f=document.getElementById("svgImage");if(f){f.querySelectorAll("g").forEach(b=>{b.getAttribute("id")&&f.removeChild(b)});for(const b in c){const w=c[b];var m=document.createElementNS("http://www.w3.org/2000/svg","g");const{attributes:_}=w;var{textContent:g}=w;for(let P=0;P<_.length;P++){const D=_[P].name,R=_[P].value;m.setAttribute(D,R)}const{childrenContents:x}=w;x.forEach((P,D)=>{const R=document.createElementNS("http://www.w3.org/2000/svg",D);if(D=="text"&&(R.textContent=g),P)for(const z in P){const F=P[z];R.setAttribute(z,F)}m.appendChild(R)}),f==null||f.insertBefore(m,f==null?void 0:f.lastElementChild);const E=f==null?void 0:f.querySelector("image");E&&(f==null||f.insertBefore(E,f==null?void 0:f.firstElementChild));const k=f==null?void 0:f.querySelector("#selectionBox_g");k&&(f==null||f.removeChild(k),f==null||f.appendChild(k))}}}autoSaveInput(c){this.isTyping&&(this.isTyping=!1,this.hiddenAllInput(),this.AddNewState(()=>{c&&c()}))}setCurrentMode(c){this.autoSaveInput(),this._currentMode=c,c===""&&this.eventTrigger.emit("cancelAllMode")}ReDo(c){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.ReDo(f=>{this.displayState(f),this.showHiddenSelectedBox(!1),c&&c()}),this.checkSelectionBox()}UnDo(c){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.UnDo(f=>{this.displayState(f),this.showHiddenSelectedBox(!1),c&&c()}),this.checkSelectionBox()}checkSelectionBox(){const c=document.getElementById("svgImage"),f=c==null?void 0:c.querySelector("#selectionBox_g");if(f){if(f.childNodes.length>2)return;c==null||c.removeChild(f)}this.selectionBox=null,this.handles=[];const m=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",m.setAttribute("id","selectionBox_g"),m.appendChild(this.selectionBox);for(let v=0;v<8;v++){const b=document.createElementNS("http://www.w3.org/2000/svg","rect");b.setAttribute("width","8"),b.setAttribute("height","8"),b.setAttribute("rx","2"),b.setAttribute("ry","2");var g;v==0&&(g="left_top",b.setAttribute("id",g)),v==1&&(g="top",b.setAttribute("id",g)),v==2&&(g="right_top",b.setAttribute("id",g)),v==3&&(g="right",b.setAttribute("id",g)),v==4&&(g="right_bottom",b.setAttribute("id",g)),v==5&&(g="bottom",b.setAttribute("id",g)),v==6&&(g="left_bottom",b.setAttribute("id",g)),v==7&&(g="left",b.setAttribute("id",g)),b.setAttribute("type","handle"),b.setAttribute("fill","white"),b.setAttribute("stroke-width","0.8"),b.setAttribute("stroke","#066CFC"),b.setAttribute("class","selection_box_handle"),b.style.cursor="pointer",b.style.display="none",m.appendChild(b),this.handles.push(b)}c==null||c.appendChild(m)}endCommentsTool(){var c;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),(c=this._revocationMechanism)===null||c===void 0||c.destroy(),this._revocationMechanism=null,this.eventTrigger.emit("clearAll")}saveComments(c){this.showHiddenSelectedBox(!1),this.autoSaveInput(c)}setTargetColor(c){if(this.chosedTarget.tagName=="text")this.chosedTarget.setAttribute("stroke",c),this.chosedTarget.setAttribute("fill",c);else if(this.chosedTarget.tagName=="path"){const f=this.chosedTarget.parentNode;f&&f.getAttribute("type")=="arrow"?(this.chosedTarget.setAttribute("stroke",c),this.chosedTarget.setAttribute("fill",c)):this.chosedTarget.setAttribute("stroke",c)}else this.chosedTarget.setAttribute("stroke",c);this.AddNewState(()=>{})}setTargetWidth(c){this.chosedTarget.tagName=="text"?this.chosedTarget.setAttribute("font-size",c.toString()):this.chosedTarget.setAttribute("stroke-width",c.toString()),this.AddNewState(()=>{})}set isTouch(c){this._isTouch=c}set offsetX(c){this._offsetX=c}set offsetY(c){this._offsetY=c}set pathColor(c){this._Pathcolor=c}set ellipseColor(c){this._Ellipsecolor=c}set rectColor(c){this._Rectcolor=c}set arrowColor(c){this._Arrowcolor=c}set textColor(c){this._Textcolor=c}set pathStrokeWidth(c){this._PathstrokeWidth=c}set ellipseStrokeWidth(c){this._EllipsestrokeWidth=c}set rectStrokeWidth(c){this._RectstrokeWidth=c}set arrowSize(c){this._ArrowstrokeWidth=c}set textFontSize(c){this._FontSize=c}destroy(){this.endCommentsTool()}}class h{constructor(c){this.eventTrigger=c,this.stateMap=new Map,this.stateIndex=0,this.stateMap.set(0,null)}AddNewState(c,f){if(this.stateIndex===0)this.stateIndex+=1,this.stateMap.set(this.stateIndex,c),this.stateIndex+=1;else{const w=this.stateMap.get(this.stateIndex-1);m(c,w)||(this.stateMap.set(this.stateIndex,c),this.stateIndex+=1)}if(this.stateMap.size-1>this.stateIndex){for(let w=this.stateIndex;w<=this.stateMap.size;w++)this.stateMap.delete(w);this.stateIndex=this.stateMap.size-1}f();function m(w,_){if(_==null||w==null||w.length!==_.length)return!1;for(let x=0;x<w.length;x++){const E=w[x],k=_[x];if(!g(E,k))return!1}return!0}function g(w,_){return!(Object.keys(w).length!==Object.keys(_).length||!b(w.attributes,_.attributes)||!v(w.childrenContents,_.childrenContents)||w.textContent!==_.textContent)}function v(w,_){if(w.size!==_.size)return!1;for(const[x,E]of w)if(!_.has(x)||_.get(x)!==E)return!1;return!0}function b(w,_){if(w.length!==_.length)return!1;for(let x=0;x<w.length;x++){const E=w.item(x),k=_.item(x);if(E&&k&&(E.name!==k.name||E.value!==k.value))return!1}return!0}}ReDo(c){this.stateIndex==this.stateMap.size?(this.eventTrigger.emit("noNewState"),c(this.stateMap.get(this.stateIndex-1))):(this.stateIndex+=1,this.stateIndex==this.stateMap.size&&this.eventTrigger.emit("noNewState"),c(this.stateMap.get(this.stateIndex-1)))}UnDo(c){this.stateIndex==1?this.eventTrigger.emit("noPreviousState"):(this.stateIndex-=1,this.stateIndex==1&&this.eventTrigger.emit("noPreviousState"),c(this.stateMap.get(this.stateIndex-1)))}destroy(){this.stateIndex=0,this.stateMap.clear()}}class d{constructor(c,f,m){this.attributes=c,this.childrenContents=f,this.textContent=m}}},"./src/toolbar/FirstPersonMode.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u){super(d,u);const{cameraControl:c}=this.viewer,{cameraControlNavModeMediator:f}=u;c.navMode="orbit",c.followPointer=!0,this.cameraControl=c,c.on("personModeSpeedUp",m=>{d.eventTrigger.emit("personModeSpeedUp",m)}),c.on("personModeSpeedDown",m=>{d.eventTrigger.emit("personModeSpeedDown",m)}),this.on("active",m=>{f.setFirstPersonModeActive(m),m&&(c.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 p.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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");p.math.vec3();class A extends y.default{constructor(d,u={}){super(d,u)}fit(d){const{viewer:u}=this,{scene:c}=u,{center:f}=c;let m;this.bimViewer.multiModel?m=c.getAABB(c.visibleObjectIds):m=c.aabb;const g=p.math.getAABB3Diag(m);u.cameraControl.pivotPos=f,u.cameraControl.planView&&(u.cameraControl.planView=!1),u.cameraFlight.flyTo({aabb:m,orthoScale:g*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"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/Controller.ts");class y extends p.default{constructor(h,d){super(h,d),this.on("active",u=>{u?(this.viewer.cameraControl.doublePickFlyTo=!1,this._onPick=this.viewer.cameraControl.on("picked",c=>{c.entity&&(c.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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./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 y.default{constructor(u,c={}){if(super(u,c),this._markers=new Map,this._visible=!0,this._focusOnClick=!1,this._occludable=!1,this._defaultIcon=A,this._typeIcons=new Map,this._idCounter=0,this.eventTrigger=u.eventTrigger,this._focusOnClick=!!c.focusOnClick,this._occludable=!!c.occludable,document.getElementById("myMarkerDiv"))this.markerWrapper=document.getElementById("myMarkerDiv");else{this.markerWrapper=document.createElement("div"),this.markerWrapper.id="myMarkerDiv";const{canvas:f}=u.viewer.scene.canvas;f.parentNode.insertBefore(this.markerWrapper,f)}this.annotationsPlugin=new p.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,labelPlacement:"above",labelOffset:c.labelOffset,values:{id:"",iconPath:A,text:""}}),this.annotationsPlugin.on("markerClicked",f=>{this._focusedMarkerLabelId&&this._focusedMarkerLabelId!==f.id&&this._clearFocusedMarkerLabel();const m=this._markers.get(f.id),g=m?m.worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]];this.eventTrigger.emit("markerClicked",m??{id:f.id,worldPos:g}),this._focusOnClick&&g&&this._focusOn(g)}),this.annotationsPlugin.on("labelClicked",f=>{const m=this._markers.get(f.id),g=m?m.worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]];this.eventTrigger.emit("markerLabelClicked",m??{id:f.id,worldPos:g})}),this.annotationsPlugin.on("markerDoubleClicked",f=>{const m=this._markers.get(f.id);this.eventTrigger.emit("markerDoubleClicked",m??{id:f.id,worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]]})}),this.annotationsPlugin.on("markerMouseEnter",f=>{if(this._focusedMarkerLabelId===f.id)return;const m=this._markers.get(f.id);m&&m.text&&f.setLabelShown(!0)}),this.annotationsPlugin.on("markerMouseLeave",f=>{this._focusedMarkerLabelId!==f.id&&f.setLabelShown(!1)}),this.viewer.cameraControl.on("mouseDownEntity",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("mouseDownNothing",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("rightClick",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("doublePicked",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("doublePickedNothing",()=>this._clearFocusedMarkerLabel()),this.on("active",f=>{f||this._clearFocusedMarkerLabel()}),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 c in u)Object.prototype.hasOwnProperty.call(u,c)&&this._typeIcons.set(c,u[c])}setTypeIcon(u,c){this._typeIcons.set(u,c)}setFocusOnClick(u){this._focusOnClick=u}setOccludable(u){this._occludable=u;const c=this.annotationsPlugin.annotations;for(const f in c)Object.prototype.hasOwnProperty.call(c,f)&&(c[f].occludable=u)}setLabelOffset(u){this.annotationsPlugin._labelOffset=u;const c=this.annotationsPlugin.annotations;for(const f in c)Object.prototype.hasOwnProperty.call(c,f)&&(c[f].labelOffset=u)}clickToCreateMarker(u){if(!this.getActive()||!this.getEnabled())return;const c=this.getCanvasPos(u);if(!c)return;const f=this.viewer.scene.pick({canvasPos:c,pickSurface:!0});if(f)return this._createMarkerFromPickResult(f)}addMarker(u,c,f,m,g){const v=m??this._generateId(),b=this._resolveIcon(f);this.annotationsPlugin.createAnnotation({id:v,worldPos:[u[0],u[1],u[2]],occludable:this._occludable,markerShown:this._visible,labelShown:!1,values:{id:v,iconPath:b,text:g??""}});const w={id:v,worldPos:[u[0],u[1],u[2]],type:f,data:c,text:g};return this._markers.set(v,w),this.eventTrigger.emit("markerCreated",w),w}removeMarker(u){const c=this._markers.get(u);if(!c){this.warn("removeMarker() - Marker not found: "+u);return}this.annotationsPlugin.destroyAnnotation(u),this._markers.delete(u),this.eventTrigger.emit("markerRemoved",c)}setMarkerVisible(u,c){(Array.isArray(u)?u:[u]).forEach(m=>{const g=this.annotationsPlugin.annotations[m];g?g.setMarkerShown(c):this.warn("setMarkerVisible() - Marker not found: "+m)})}showMarker(u){this.setMarkerVisible(u,!0)}hideMarker(u){this.setMarkerVisible(u,!1)}getMarkerById(u){return this._markers.get(u)}focusMarker(u,c,f,m=!0,g=()=>{}){typeof m=="function"&&(g=m,m=!0);const v=this._markers.get(u);if(!v){this.warn("focusMarker() - Marker not found: "+u);return}if(c===void 0&&f===void 0){this._setMarkerLabelShown(u,m),this._focusOn(v.worldPos),g();return}if(c===void 0||f===void 0){this.warn("focusMarker() - Direction and distance must be provided together");return}const b=this._resolveViewDirection(c);if(!b){this.warn("focusMarker() - Invalid direction: "+c);return}this._setMarkerLabelShown(u,m),this._focusOnFromDirection(v.worldPos,b,f,()=>{g()})}getMarkers(){return Array.from(this._markers.values()).map(u=>Object.assign(Object.assign({},u),{worldPos:[...u.worldPos]}))}setMarkers(u){this.clear(),(u||[]).forEach(c=>{c&&c.worldPos&&c.worldPos.length>=3&&this.addMarker(c.worldPos,c.data,c.type,c.id,c.text)})}clear(){this.annotationsPlugin.clear(),this._markers.clear(),this.eventTrigger.emit("markersCleared")}getCanvasPos(u){const c=[];if(!u)u=window.event,c[0]=u.x,c[1]=u.y;else if("TouchEvent"in window&&u instanceof TouchEvent){if(!u.touches||u.touches.length===0)return;const f=u.touches[0];let m=u.target,g=0,v=0;for(;m.offsetParent;)g+=m.offsetLeft,v+=m.offsetTop,m=m.offsetParent;c[0]=f.pageX-g,c[1]=f.pageY-v}else{let f=this.viewer.scene.canvas.canvas,m=0,g=0;for(;f.offsetParent;)m+=f.offsetLeft,g+=f.offsetTop,f=f.offsetParent;c[0]=u.pageX-m,c[1]=u.pageY-g}return c}destroy(){this.clear(),this.annotationsPlugin.destroy(),this.markerWrapper&&this.markerWrapper.parentNode&&this.markerWrapper.parentNode.removeChild(this.markerWrapper),super.destroy()}_createMarkerFromPickResult(u){const c=this._generateId(),f=this._resolveIcon(void 0),m=this.annotationsPlugin.createAnnotation({id:c,pickResult:u,occludable:this._occludable,markerShown:this._visible,labelShown:!1,values:{id:c,iconPath:f}}),g={id:c,worldPos:[m.worldPos[0],m.worldPos[1],m.worldPos[2]],entityId:u.entity?u.entity.id:void 0};return this._markers.set(c,g),this.eventTrigger.emit("markerCreated",g),g}_resolveIcon(u){return u&&this._typeIcons.has(u)?this._typeIcons.get(u):this._defaultIcon}_focusOn(u){const c=[u[0],u[1],u[2]];this.viewer.cameraFlight.flyTo({look:c}),this.viewer.cameraControl.pivotPos=c}_focusOnFromDirection(u,c,f,m){const g=[u[0],u[1],u[2]],v=[g[0]+c[0]*f,g[1]+c[1]*f,g[2]+c[2]*f],b=Math.abs(c[1])>.9?[0,0,1]:[0,1,0];this.viewer.cameraFlight.flyTo({eye:v,look:g,up:b},()=>{m()}),this.viewer.cameraControl.pivotPos=g}_setMarkerLabelShown(u,c){const f=this.annotationsPlugin.annotations;for(const m in f)Object.prototype.hasOwnProperty.call(f,m)&&f[m].setLabelShown(!1);c===!0&&f[u]?(f[u].setLabelShown(!0),this._focusedMarkerLabelId=u):this._focusedMarkerLabelId=void 0}_clearFocusedMarkerLabel(){if(!this._focusedMarkerLabelId)return;const u=this.annotationsPlugin.annotations;for(const c in u)Object.prototype.hasOwnProperty.call(u,c)&&u[c].setLabelShown(!1);this._focusedMarkerLabelId=void 0}_resolveViewDirection(u){const c={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 f;if(typeof u=="string"){if(f=c[u.toLowerCase()],!f)return null}else if(Array.isArray(u)&&u.length>=3)f=[u[0],u[1],u[2]];else return null;const m=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return m===0?null:[f[0]/m,f[1]/m,f[2]/m]}_generateId(){return this._idCounter+=1,`marker_${Date.now()}_${this._idCounter}`}}},"./src/toolbar/MeasureTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./src/Controller.ts"),y=i("./src/toolbar/MeasureTools/MeasureAngleTool.ts"),A=i("./src/toolbar/MeasureTools/MeasureDistanceTool.ts");class h extends p.default{constructor(u,c){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 y.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,c=!this._tools[u].getActive()){this._toolType=u;for(let f in this._tools)u==f?this._tools[f].setActive(c):this._tools[f].setActive(!1)}getActiveByType(u){return this._tools[u].getActive()}get currentTool(){return this._tools[this._toolType]}SetMeasureAngleActive(u=!this._measure_angle_tool.getActive(),c=()=>{}){this._measure_angle_tool.setActive(u),c(this._measure_angle_tool.getActive())}SetMeasureDistanceActive(u=!this._measure_distance_tool.getActive(),c=()=>{}){this._measure_distance_tool.setActive(u),c(this._measure_distance_tool.getActive())}setAllDisActive(){for(let u in this._tools)this._tools[u].setActive(!1)}setMeasureOffSet(u,c){this.measureAngleTool.offsetX=u,this.measureAngleTool.offsetY=c,this.measureDistanceTool.offsetX=u,this.measureDistanceTool.offsetY=c}setSnapRadius(u){this.viewer.cameraControl.snapRadius=u}destroy(){this._measure_distance_tool.destroy(),this._measure_angle_tool.destroy()}}},"./src/toolbar/MeasureTools/MeasureAngleTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.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:c}=d.viewer.scene.canvas;c.parentNode.insertBefore(this.angleMeasureContainer,c),this._angleMeasurementsPlugin=new p.AngleMeasurementsPlugin(this.viewer,{container:this.angleMeasureContainer,defaultColor:"#0065FC"}),this._angleMeasurementsMouseControl=new p.AngleMeasurementsMouseControl(this._angleMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsTouchControl=new p.AngleMeasurementsTouchControl(this._angleMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsSimulateMouseControl=new p.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",c=>{this.eventTrigger.emit("newAngleMeasure",{id:c.id}),this.newMeasure=c,this.chosedTarget=null}),this._angleMeasurementsPlugin.on("measurementEnd",c=>{if(this.getMeasureResultByID(c.id)===0){this.destroyMeasurementById(c.id);return}this.eventTrigger.emit("createAngleMeasure",{id:c.id,result:this.getMeasureResultByID(c.id)}),this.setAllHightLighted(!1),this.chosedTarget=c,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._angleMeasurementsPlugin.on("mouseOver",c=>{c.measurement.setHighlighted(!0)}),this._angleMeasurementsPlugin.on("mouseLeave",c=>{c.angleMeasurement==this.chosedTarget&&this._active||c.measurement.setHighlighted(!1)}),this._angleMeasurementsPlugin.on("clickMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("touchMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("measurementDestroyed",c=>{this.eventTrigger.emit("AngleMeasureDestroyed",{id:c.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=c=>{if(this._active&&(c.key==="Delete"||c.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 c=this.getMeasurementById(d);c.color=u}setMeasureClickbleById(d,u){const c=this.getMeasurementById(d);c.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const c in u)u[c].setHighlighted(d)}setVisibleById(d,u){const c=this.getMeasurementById(d);c.visible=u}setAngleLabelVisible(d,u){const c=this.getMeasurementById(d);c.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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.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:c}=d.viewer.scene.canvas;c.parentNode.insertBefore(this.distanceMeasureContainer,c),this._distanceMeasurementsPlugin=new p.DistanceMeasurementsPlugin(this.viewer,{container:this.distanceMeasureContainer,defaultAxisVisible:!1,defaultColor:"#0065FC"}),this._distanceMeasurementsMouseControl=new p.DistanceMeasurementsMouseControl(this._distanceMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsTouchControl=new p.DistanceMeasurementsTouchControl(this._distanceMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsSimulateMouseControl=new p.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",c=>{this.eventTrigger.emit("newDistanceMeasure",{id:c.id}),this.newMeasure=c,this.chosedTarget=null}),this._distanceMeasurementsPlugin.on("measurementEnd",c=>{if(this.getMeasureResultByID(c.id)===0){this.destroyMeasurementById(c.id);return}this.eventTrigger.emit("createDistanceMeasure",{id:c.id,result:this.getMeasureResultByID(c.id),xResult:c.xLabel,yResult:c.yLabel,zResult:c.zLabel}),this.setAllHightLighted(!1),this.chosedTarget=c,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._distanceMeasurementsPlugin.on("mouseOver",c=>{c.measurement.setHighlighted(!0)}),this._distanceMeasurementsPlugin.on("mouseLeave",c=>{c.distanceMeasurement==this.chosedTarget&&this._active||c.measurement.setHighlighted(!1)}),this._distanceMeasurementsPlugin.on("clickMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("touchMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("measurementCancel",c=>{this.eventTrigger.emit("DistanceMeasureCancel",{id:c.id})}),this._distanceMeasurementsPlugin.on("measurementDestroyed",c=>{this.eventTrigger.emit("DistanceMeasureDestroyed",{id:c.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=c=>{if(this._active&&(c.key==="Delete"||c.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 c=this.getMeasurementById(d);c.color=u}setMeasureClickbleById(d,u){const c=this.getMeasurementById(d);c.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const c in u)u[c].setHighlighted(d)}setVisibleById(d,u){const c=this.getMeasurementById(d);c.visible=u}setLableVisibleById(d,u){const c=this.getMeasurementById(d);c.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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u){if(super(d,u),!u.navCubeCanvasElement)throw new Error("Missing config: NavCubeMode navCubeCanvasElement");const{navCubeCanvasElement:c}=u,{viewerElement:f}=u;this._navCubeCanvasElement=c,this._navCubeCanvasElement.oncontextmenu=m=>{m.preventDefault()},this._navCube=new p.NavCubePlugin(this.viewer,{canvasElement:c,viewerElement:f,fitVisible:!1,color:"#CFCFCF",shadowVisible:!1}),this._navCube.setVisible(this._active),this._visible=!0,this.on("active",m=>{this._navCube.setVisible(m)})}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"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/Controller.ts");class y extends p.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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");const A=p.math.vec3();class h extends y.default{constructor(u,c={}){super(u,c),this._modelMementos={},this.bimViewer.modelsExplorer.on("modelLoaded",f=>{this.reset()})}reset(u){this._resetCamera(u)}_resetCamera(u){const{viewer:c}=this,{scene:f}=c;let m;this.bimViewer.multiModel?m=f.getAABB(f.visibleObjectIds):m=f.aabb;const g=p.math.getAABB3Diag(m),v=p.math.getAABB3Center(m,A),{camera:b}=f;b.perspective.fov;const w=Math.abs(g/Math.tan(45*p.math.DEGTORAD)),_=p.math.normalizeVec3(b.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),x=p.math.normalizeVec3(b.yUp?[-.5,.7071,-.5]:[-1,1,1]);c.cameraControl.pivotPos=v,c.cameraControl.planView&&(c.cameraControl.planView=!1),c.cameraFlight.flyTo({look:v,eye:[v[0]-w*_[0],v[1]-w*_[1],v[2]-w*_[2]],up:x,orthoScale:g*1.3,projection:"perspective",duration:1},u)}}},"./src/toolbar/SectionTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u){super(d,u),this.eventTrigger=d.eventTrigger,this._sectionPlanesPlugin=new p.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",c=>{c?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 c=this._sectionPlanesPlugin.createSectionPlane({pos:u.worldPos,dir:p.math.mulVec3Scalar(u.worldNormal,-1)});this._sectionPlanesPlugin.showControl(c.id),this.eventTrigger.emit("createSection",{position:u.worldPos,direction:p.math.mulVec3Scalar(u.worldNormal,-1),id:c.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 c=this._sectionPlanesPlugin.createSectionPlane({pos:d,dir:u});this._sectionPlanesPlugin.showControl(c.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 c=this.getSectionPlane(d);c.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 c=d[u];c.active=!0}}disableSections(){const{sectionPlanes:d}=this.viewer.scene;for(const u in d){const c=d[u];c.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"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/Controller.ts");class y extends p.default{constructor(h,d){super(h,d),this._active=!0,h.eventTrigger.on("metaLoaded",u=>{const c=this.spaceObjects;if(c.length==0)return;this.viewer.scene.setObjectsCulled(c,!0),this.setIFCSpaceOpacity(),this.viewer.scene.setObjectsHighlighted(c,!0);const f=this.viewer.scene.models[u.metaModel.id],m=f.exceptionIds.concat(c);f.exceptionIds=m,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,c=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(c,!1)}_exitShowSpacesMode(){const{viewer:h}=this,{scene:d}=h,{metaScene:u}=h,c=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(c,!0)}get spaceObjects(){return this.viewer.metaScene.getObjectIDsByType("IfcSpace")}}},"./src/toolbar/SkyBoxTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u={}){super(d,u),this.skyboxesPlugin=new p.SkyboxesPlugin(this.viewer),this._active=!1,this.createSkyBox(u),this.on("active",c=>{this.setSkyBoxActiveById(c)})}createSkyBox(d){const{skyBoxImage:u}=d,{skyBoxSrc:c}=d;this.skyboxesPlugin.createSkybox("skybox1",{src:c,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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");const A=p.math.vec3();class h extends y.default{constructor(u,c){super(u,c),this._saveOrthoActive=null,this._cameraControlNavModeMediator=c.cameraControlNavModeMediator,this._active=!1}setEnabled(u){super.setEnabled(u),this._saveOrthoActive=this.bimViewer.orthoMode.getActive()}setActive(u,c=()=>{}){if(this._active===u){c&&c();return}this._active=u,u?this._enterThreeDMode(()=>{this.fire("active",this._active),c&&c()}):this._exitThreeDMode(()=>{this.fire("active",this._active),c&&c()})}_enterThreeDMode(u=()=>{}){const{viewer:c}=this,{scene:f}=c,{aabb:m}=f,g=p.math.getAABB3Diag(m),v=p.math.getAABB3Center(m,A),b=Math.abs(g/Math.tan(65/2)),{camera:w}=f,_=w.yUp?[-1,-1,-1]:[1,1,1],x=w.yUp?[-1,1,-1]:[-1,1,1];c.cameraControl.pivotPos=v,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?c.cameraFlight.flyTo({look:v,eye:[v[0]-b*_[0],v[1]-b*_[1],v[2]-b*_[2]],up:x,orthoScale:g*1.3,duration:1,projection:this._saveOrthoActive?"ortho":"perspective"},()=>{u()}):c.cameraFlight.jumpTo({look:v,eye:[v[0]-b*_[0],v[1]-b*_[1],v[2]-b*_[2]],up:x,orthoScale:g*1.3,projection:this._saveOrthoActive?"ortho":"perspective"})}_exitThreeDMode(u=()=>{}){const{viewer:c}=this,{scene:f}=c,{camera:m}=f,{aabb:g}=f,v=p.math.getAABB3Center(g),b=p.math.getAABB3Diag(g),_=Math.abs(b/Math.tan(45*p.math.DEGTORAD)),x=b*1.3,E=A;E[0]=v[0]+m.worldUp[0]*_,E[1]=v[1]+m.worldUp[1]*_,E[2]=v[2]+m.worldUp[2]*_;const k=p.math.mulVec3Scalar(m.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?c.cameraFlight.flyTo({eye:E,look:v,up:k,orthoScale:x,projection:"ortho"},()=>{this.bimViewer.navCubeMode.setActive(!1)}):(c.cameraFlight.jumpTo({eye:E,look:v,up:k,orthoScale:x,projection:"ortho"}),this.bimViewer.navCubeMode.setActive(!1))}}},"./node_modules/unzipit/dist/unzipit.module.js"(s,C,i){i.r(C),i.d(C,{HTTPRangeReader:()=>m,cleanup:()=>Lt,setOptions:()=>kt,unzip:()=>yt,unzipRaw:()=>ht}),s=i.hmd(s);function p(We){return We.arrayBuffer?We.arrayBuffer():new Promise((Oe,Ke)=>{const nt=new FileReader;nt.addEventListener("loadend",()=>{Oe(nt.result)}),nt.addEventListener("error",Ke),nt.readAsArrayBuffer(We)})}async function y(We){const Oe=await p(We);return new Uint8Array(Oe)}function A(We){return typeof Blob<"u"&&We instanceof Blob}function h(We){return typeof SharedArrayBuffer<"u"&&We instanceof SharedArrayBuffer}const d=typeof process<"u"&&process.versions&&typeof process.versions.node<"u"&&typeof process.versions.electron>"u";function u(We){return We.byteOffset===0&&We.byteLength===We.buffer.byteLength}class c{constructor(Oe){this.typedArray=Oe instanceof ArrayBuffer||h(Oe)?new Uint8Array(Oe):new Uint8Array(Oe.buffer,Oe.byteOffset,Oe.byteLength)}async getLength(){return this.typedArray.byteLength}async read(Oe,Ke){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+Oe,Ke)}}class f{constructor(Oe){this.blob=Oe}async getLength(){return this.blob.size}async read(Oe,Ke){const nt=this.blob.slice(Oe,Oe+Ke),Xe=await p(nt);return new Uint8Array(Xe)}async sliceAsBlob(Oe,Ke,nt=""){return this.blob.slice(Oe,Oe+Ke,nt)}}class m{constructor(Oe){this.url=Oe}async getLength(){if(this.length===void 0){const Oe=await fetch(this.url,{method:"HEAD"});if(!Oe.ok)throw new Error(`failed http request ${this.url}, status: ${Oe.status}: ${Oe.statusText}`);if(this.length=parseInt(Oe.headers.get("content-length")),Number.isNaN(this.length))throw Error("could not get length")}return this.length}async read(Oe,Ke){if(Ke===0)return new Uint8Array(0);const nt=await fetch(this.url,{headers:{Range:`bytes=${Oe}-${Oe+Ke-1}`}});if(!nt.ok)throw new Error(`failed http request ${this.url}, status: ${nt.status} offset: ${Oe} size: ${Ke}: ${nt.statusText}`);const Xe=await nt.arrayBuffer();return new Uint8Array(Xe)}}function g(We,Oe){var Ke=Uint8Array;if(We[0]==3&&We[1]==0)return Oe||new Ke(0);var nt=P,Xe=k,Ge=b,ze=D,Ct=Oe==null;Ct&&(Oe=new Ke(We.length>>>2<<3));for(var It=0,Ot=0,Ze=0,gt=0,vt=0,_t=0,Bt=0,at=0,jt=0,rr,Dt;It==0;){if(It=nt(We,jt,1),Ot=nt(We,jt+1,2),jt+=3,Ot==0){jt&7&&(jt+=8-(jt&7));var rt=(jt>>>3)+4,ct=We[rt-4]|We[rt-3]<<8;Ct&&(Oe=v(Oe,at+ct)),Oe.set(new Ke(We.buffer,We.byteOffset+rt,ct),at),jt=rt+ct<<3,at+=ct;continue}if(Ct&&(Oe=v(Oe,at+(1<<17))),Ot==1&&(rr=R.flmap,Dt=R.fdmap,_t=511,Bt=31),Ot==2){Ze=Xe(We,jt,5)+257,gt=Xe(We,jt+5,5)+1,vt=Xe(We,jt+10,4)+4,jt+=14;for(var Rt=0;Rt<38;Rt+=2)R.itree[Rt]=0,R.itree[Rt+1]=0;for(var qt=1,Rt=0;Rt<vt;Rt++){var pr=Xe(We,jt+Rt*3,3);R.itree[(R.ordr[Rt]<<1)+1]=pr,pr>qt&&(qt=pr)}jt+=3*vt,_(R.itree,qt),x(R.itree,qt,R.imap),rr=R.lmap,Dt=R.dmap,jt=Ge(R.imap,(1<<qt)-1,Ze+gt,We,jt,R.ttree);var ar=w(R.ttree,0,Ze,R.ltree);_t=(1<<ar)-1;var Ir=w(R.ttree,Ze,gt,R.dtree);Bt=(1<<Ir)-1,_(R.ltree,ar),x(R.ltree,ar,rr),_(R.dtree,Ir),x(R.dtree,Ir,Dt)}for(;;){var Lr=rr[ze(We,jt)&_t];jt+=Lr&15;var dr=Lr>>>4;if(!(dr>>>8))Oe[at++]=dr;else{if(dr==256)break;var zr=at+dr-254;if(dr>264){var Se=R.ldef[dr-257];zr=at+(Se>>>3)+Xe(We,jt,Se&7),jt+=Se&7}var Re=Dt[ze(We,jt)&Bt];jt+=Re&15;var Le=Re>>>4,Ue=R.ddef[Le],Je=(Ue>>>4)+nt(We,jt,Ue&15);for(jt+=Ue&15,Ct&&(Oe=v(Oe,at+(1<<17)));at<zr;)Oe[at]=Oe[at++-Je],Oe[at]=Oe[at++-Je],Oe[at]=Oe[at++-Je],Oe[at]=Oe[at++-Je];at=zr}}}return Oe.length==at?Oe:Oe.slice(0,at)}function v(We,Oe){var Ke=We.length;if(Oe<=Ke)return We;var nt=new Uint8Array(Math.max(Ke<<1,Oe));return nt.set(We,0),nt}function b(We,Oe,Ke,nt,Xe,Ge){for(var ze=k,Ct=D,It=0;It<Ke;){var Ot=We[Ct(nt,Xe)&Oe];Xe+=Ot&15;var Ze=Ot>>>4;if(Ze<=15)Ge[It]=Ze,It++;else{var gt=0,vt=0;Ze==16?(vt=3+ze(nt,Xe,2),Xe+=2,gt=Ge[It-1]):Ze==17?(vt=3+ze(nt,Xe,3),Xe+=3):Ze==18&&(vt=11+ze(nt,Xe,7),Xe+=7);for(var _t=It+vt;It<_t;)Ge[It]=gt,It++}}return Xe}function w(We,Oe,Ke,nt){for(var Xe=0,Ge=0,ze=nt.length>>>1;Ge<Ke;){var Ct=We[Ge+Oe];nt[Ge<<1]=0,nt[(Ge<<1)+1]=Ct,Ct>Xe&&(Xe=Ct),Ge++}for(;Ge<ze;)nt[Ge<<1]=0,nt[(Ge<<1)+1]=0,Ge++;return Xe}function _(We,Oe){for(var Ke=We.length,nt,Xe,Ge,ze,Ct,It=R.bl_count,ze=0;ze<=Oe;ze++)It[ze]=0;for(ze=1;ze<Ke;ze+=2)It[We[ze]]++;var Ot=R.next_code;for(nt=0,It[0]=0,Xe=1;Xe<=Oe;Xe++)nt=nt+It[Xe-1]<<1,Ot[Xe]=nt;for(Ge=0;Ge<Ke;Ge+=2)Ct=We[Ge+1],Ct!=0&&(We[Ge]=Ot[Ct],Ot[Ct]++)}function x(We,Oe,Ke){for(var nt=We.length,Xe=R.rev15,Ge=0;Ge<nt;Ge+=2)if(We[Ge+1]!=0)for(var ze=Ge>>1,Ct=We[Ge+1],It=ze<<4|Ct,Ot=Oe-Ct,Ze=We[Ge]<<Ot,gt=Ze+(1<<Ot);Ze!=gt;){var vt=Xe[Ze]>>>15-Oe;Ke[vt]=It,Ze++}}function E(We,Oe){for(var Ke=R.rev15,nt=15-Oe,Xe=0;Xe<We.length;Xe+=2){var Ge=We[Xe]<<Oe-We[Xe+1];We[Xe]=Ke[Ge]>>>nt}}function k(We,Oe,Ke){return(We[Oe>>>3]|We[(Oe>>>3)+1]<<8)>>>(Oe&7)&(1<<Ke)-1}function P(We,Oe,Ke){return(We[Oe>>>3]|We[(Oe>>>3)+1]<<8|We[(Oe>>>3)+2]<<16)>>>(Oe&7)&(1<<Ke)-1}function D(We,Oe){return(We[Oe>>>3]|We[(Oe>>>3)+1]<<8|We[(Oe>>>3)+2]<<16)>>>(Oe&7)}const R=function(){var We=Uint16Array,Oe=Uint32Array;return{next_code:new We(16),bl_count:new We(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 We(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 Oe(32),flmap:new We(512),fltree:[],fdmap:new We(32),fdtree:[],lmap:new We(32768),ltree:[],ttree:[],dmap:new We(32768),dtree:[],imap:new We(512),itree:[],rev15:new We(32768),lhst:new Oe(286),dhst:new Oe(30),ihst:new Oe(19),lits:new Oe(15e3),strt:new We(65536),prev:new We(32768)}}();(function(){for(var We=32768,Oe=0;Oe<We;Oe++){var Ke=Oe;Ke=(Ke&2863311530)>>>1|(Ke&1431655765)<<1,Ke=(Ke&3435973836)>>>2|(Ke&858993459)<<2,Ke=(Ke&4042322160)>>>4|(Ke&252645135)<<4,Ke=(Ke&4278255360)>>>8|(Ke&16711935)<<8,R.rev15[Oe]=(Ke>>>16|Ke<<16)>>>17}function nt(Xe,Ge,ze){for(;Ge--!=0;)Xe.push(0,ze)}for(var Oe=0;Oe<32;Oe++)R.ldef[Oe]=R.of0[Oe]<<3|R.exb[Oe],R.ddef[Oe]=R.df0[Oe]<<4|R.dxb[Oe];nt(R.fltree,144,8),nt(R.fltree,112,9),nt(R.fltree,24,7),nt(R.fltree,8,8),_(R.fltree,9),x(R.fltree,9,R.flmap),E(R.fltree,9),nt(R.fdtree,32,5),_(R.fdtree,5),x(R.fdtree,5,R.fdmap),E(R.fdtree,5),nt(R.itree,19,0),nt(R.ltree,286,0),nt(R.dtree,30,0),nt(R.ttree,320,0)})(),function(){for(var We=new Uint32Array(256),Oe=0;Oe<256;Oe++){for(var Ke=Oe,nt=0;nt<8;nt++)Ke&1?Ke=3988292384^Ke>>>1:Ke=Ke>>>1;We[Oe]=Ke}return We}();function z(We,Oe){return g(We,Oe)}const F={numWorkers:1,workerURL:"",useWorkers:!1};let H=0,$=0,K=!0;const G=[],j=[],N=[],I=new Map;function L(We){W(We.target);const{id:Oe,error:Ke,data:nt}=We.data,Xe=I.get(Oe);I.delete(Oe),Ke?Xe.reject(Ke):Xe.resolve(nt)}function U(We){return new Promise((Oe,Ke)=>{const nt=new Worker(We);nt.onmessage=Xe=>{Xe.data==="start"?(nt.onerror=void 0,nt.onmessage=void 0,Oe(nt)):Ke(new Error(`unexpected message: ${Xe.data}`))},nt.onerror=Ke})}function O(We,Oe){return We.require?We.require(Oe):{}}const Q=function(){if(d){const{Worker:We}=O(s,"worker_threads");return{async createWorker(Oe){return new We(Oe)},addEventListener(Oe,Ke){Oe.on("message",nt=>{Ke({target:Oe,data:nt})})},async terminate(Oe){await Oe.terminate()}}}else return{async createWorker(We){try{return await U(We)}catch{console.warn("could not load worker:",We)}let Oe;try{const Ke=await fetch(We,{mode:"cors"});if(!Ke.ok)throw new Error(`could not load: ${We}`);Oe=await Ke.text(),We=URL.createObjectURL(new Blob([Oe],{type:"application/javascript"}));const nt=await U(We);return F.workerURL=We,nt}catch{console.warn("could not load worker via fetch:",We)}if(Oe!==void 0)try{We=`data:application/javascript;base64,${btoa(Oe)}`;const Ke=await U(We);return F.workerURL=We,Ke}catch{console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(We,Oe){We.addEventListener("message",Oe)},async terminate(We){We.terminate()}}}();function W(We){j.push(We),ne()}async function Z(){if(j.length===0&&$<F.numWorkers){++$;try{const We=await Q.createWorker(F.workerURL);G.push(We),j.push(We),Q.addEventListener(We,L)}catch{K=!1}}return j.pop()}function J(We,Oe,Ke,nt){const Xe=new Uint8Array(Oe);z(We,Xe),nt(Ke?new Blob([Xe],{type:Ke}):Xe.buffer)}async function ne(){if(N.length!==0){if(F.useWorkers&&K){const We=await Z();if(K){if(We){if(N.length===0){W(We);return}const{id:Oe,src:Ke,uncompressedSize:nt,type:Xe,resolve:Ge,reject:ze}=N.shift();I.set(Oe,{id:Oe,resolve:Ge,reject:ze});const Ct=[];We.postMessage({type:"inflate",data:{id:Oe,type:Xe,src:Ke,uncompressedSize:nt}},Ct)}return}}for(;N.length;){const{src:We,uncompressedSize:Oe,type:Ke,resolve:nt}=N.shift();let Xe=We;A(We)&&(Xe=await y(We)),J(Xe,Oe,Ke,nt)}}}function ae(We){F.workerURL=We.workerURL||F.workerURL,We.workerURL&&(F.useWorkers=!0),F.useWorkers=We.useWorkers!==void 0?We.useWorkers:F.useWorkers,F.numWorkers=We.numWorkers||F.numWorkers}function ce(We,Oe,Ke){return new Promise((nt,Xe)=>{N.push({src:We,uncompressedSize:Oe,type:Ke,resolve:nt,reject:Xe,id:H++}),ne()})}function q(We){We.splice(0,We.length)}async function fe(){for(const We of G)await Q.terminate(We);q(G),q(j),q(N),I.clear(),$=0,K=!0}function re(We,Oe){const Ke=We&31,nt=(We>>5&15)-1,Xe=(We>>9&127)+1980,Ge=0,ze=(Oe&31)*2,Ct=Oe>>5&63,It=Oe>>11&31;return new Date(Xe,nt,Ke,It,Ct,ze,Ge)}class te{constructor(Oe,Ke){this._reader=Oe,this._rawEntry=Ke,this.name=Ke.name,this.nameBytes=Ke.nameBytes,this.size=Ke.uncompressedSize,this.compressedSize=Ke.compressedSize,this.comment=Ke.comment,this.commentBytes=Ke.commentBytes,this.compressionMethod=Ke.compressionMethod,this.lastModDate=re(Ke.lastModFileDate,Ke.lastModFileTime),this.isDirectory=Ke.uncompressedSize===0&&Ke.name.endsWith("/"),this.encrypted=!!(Ke.generalPurposeBitFlag&1),this.externalFileAttributes=Ke.externalFileAttributes,this.versionMadeBy=Ke.versionMadeBy}async blob(Oe="application/octet-stream"){return await mt(this._reader,this._rawEntry,Oe)}async arrayBuffer(){return await tt(this._reader,this._rawEntry)}async text(){const Oe=await this.arrayBuffer();return me(new Uint8Array(Oe))}async json(){const Oe=await this.text();return JSON.parse(Oe)}}const le=22,de=65535,he=101010256,ue=101075792;async function pe(We,Oe,Ke){return await We.read(Oe,Ke)}async function se(We,Oe,Ke,nt){return We.sliceAsBlob?await We.sliceAsBlob(Oe,Ke,nt):await We.read(Oe,Ke)}const V={unsigned(){return 0}};function Ce(We,Oe){return We[Oe]+We[Oe+1]*256}function ve(We,Oe){return We[Oe]+We[Oe+1]*256+We[Oe+2]*65536+We[Oe+3]*16777216}function ye(We,Oe){return ve(We,Oe)+ve(We,Oe+4)*4294967296}const Ae=new TextDecoder;function me(We,Oe){return h(We.buffer)&&(We=new Uint8Array(We)),Ae.decode(We)}async function be(We,Oe){const Ke=Math.min(le+de,Oe),nt=Oe-Ke,Xe=await pe(We,nt,Ke);for(let Ge=Ke-le;Ge>=0;--Ge){if(ve(Xe,Ge)!==he)continue;const ze=new Uint8Array(Xe.buffer,Xe.byteOffset+Ge,Xe.byteLength-Ge),Ct=Ce(ze,4);if(Ct!==0)throw new Error(`multi-volume zip files are not supported. This is volume: ${Ct}`);const It=Ce(ze,10),Ot=ve(ze,12),Ze=ve(ze,16),gt=Ce(ze,20),vt=ze.length-le;if(gt!==vt)throw new Error(`invalid comment length. expected: ${vt}, actual: ${gt}`);const _t=new Uint8Array(ze.buffer,ze.byteOffset+22,gt),Bt=me(_t);return It===65535||Ze===4294967295?await Te(We,nt+Ge,Bt,_t):await je(We,Ze,Ot,It,Bt,_t)}throw new Error("could not find end of central directory. maybe not zip file")}const we=117853008;async function Te(We,Oe,Ke,nt){const Xe=Oe-20,Ge=await pe(We,Xe,20);if(ve(Ge,0)!==we)throw new Error("invalid zip64 end of central directory locator signature");const ze=ye(Ge,8),Ct=await pe(We,ze,56);if(ve(Ct,0)!==ue)throw new Error("invalid zip64 end of central directory record signature");const It=ye(Ct,32),Ot=ye(Ct,40),Ze=ye(Ct,48);return je(We,Ze,Ot,It,Ke,nt)}const He=33639248;async function je(We,Oe,Ke,nt,Xe,Ge){let ze=0;const Ct=await pe(We,Oe,Ke),It=[];for(let Ze=0;Ze<nt;++Ze){const gt=Ct.subarray(ze,ze+46),vt=ve(gt,0);if(vt!==He)throw new Error(`invalid central directory file header signature: 0x${vt.toString(16)}`);const _t={versionMadeBy:Ce(gt,4),versionNeededToExtract:Ce(gt,6),generalPurposeBitFlag:Ce(gt,8),compressionMethod:Ce(gt,10),lastModFileTime:Ce(gt,12),lastModFileDate:Ce(gt,14),crc32:ve(gt,16),compressedSize:ve(gt,20),uncompressedSize:ve(gt,24),fileNameLength:Ce(gt,28),extraFieldLength:Ce(gt,30),fileCommentLength:Ce(gt,32),internalFileAttributes:Ce(gt,36),externalFileAttributes:ve(gt,38),relativeOffsetOfLocalHeader:ve(gt,42)};if(_t.generalPurposeBitFlag&64)throw new Error("strong encryption is not supported");ze+=46;const Bt=Ct.subarray(ze,ze+_t.fileNameLength+_t.extraFieldLength+_t.fileCommentLength);_t.nameBytes=Bt.slice(0,_t.fileNameLength),_t.name=me(_t.nameBytes);const at=_t.fileNameLength+_t.extraFieldLength,jt=Bt.slice(_t.fileNameLength,at);_t.extraFields=[];let rr=0;for(;rr<jt.length-3;){const rt=Ce(jt,rr+0),ct=Ce(jt,rr+2),Rt=rr+4,qt=Rt+ct;if(qt>jt.length)throw new Error("extra field length exceeds extra field buffer size");_t.extraFields.push({id:rt,data:jt.slice(Rt,qt)}),rr=qt}if(_t.commentBytes=Bt.slice(at,at+_t.fileCommentLength),_t.comment=me(_t.commentBytes),ze+=Bt.length,_t.uncompressedSize===4294967295||_t.compressedSize===4294967295||_t.relativeOffsetOfLocalHeader===4294967295){const rt=_t.extraFields.find(qt=>qt.id===1);if(!rt)throw new Error("expected zip64 extended information extra field");const ct=rt.data;let Rt=0;if(_t.uncompressedSize===4294967295){if(Rt+8>ct.length)throw new Error("zip64 extended information extra field does not include uncompressed size");_t.uncompressedSize=ye(ct,Rt),Rt+=8}if(_t.compressedSize===4294967295){if(Rt+8>ct.length)throw new Error("zip64 extended information extra field does not include compressed size");_t.compressedSize=ye(ct,Rt),Rt+=8}if(_t.relativeOffsetOfLocalHeader===4294967295){if(Rt+8>ct.length)throw new Error("zip64 extended information extra field does not include relative header offset");_t.relativeOffsetOfLocalHeader=ye(ct,Rt),Rt+=8}}const Dt=_t.extraFields.find(rt=>rt.id===28789&&rt.data.length>=6&&rt.data[0]===1&&ve(rt.data,1),V.unsigned(_t.nameBytes));if(Dt&&(_t.fileName=me(Dt.data.slice(5))),_t.compressionMethod===0){let rt=_t.uncompressedSize;if(_t.generalPurposeBitFlag&1&&(rt+=12),_t.compressedSize!==rt)throw new Error(`compressed size mismatch for stored file: ${_t.compressedSize} != ${rt}`)}It.push(_t)}return{zip:{comment:Xe,commentBytes:Ge},entries:It.map(Ze=>new te(We,Ze))}}async function qe(We,Oe){if(Oe.generalPurposeBitFlag&1)throw new Error("encrypted entries not supported");const Ke=await pe(We,Oe.relativeOffsetOfLocalHeader,30),nt=await We.getLength(),Xe=ve(Ke,0);if(Xe!==67324752)throw new Error(`invalid local file header signature: 0x${Xe.toString(16)}`);const Ge=Ce(Ke,26),ze=Ce(Ke,28),Ct=Oe.relativeOffsetOfLocalHeader+Ke.length+Ge+ze;let It;if(Oe.compressionMethod===0)It=!1;else if(Oe.compressionMethod===8)It=!0;else throw new Error(`unsupported compression method: ${Oe.compressionMethod}`);const Ot=Ct,Ze=Ot+Oe.compressedSize;if(Oe.compressedSize!==0&&Ze>nt)throw new Error(`file data overflows file bounds: ${Ot} + ${Oe.compressedSize} > ${nt}`);return{decompress:It,fileDataStart:Ot}}async function tt(We,Oe){const{decompress:Ke,fileDataStart:nt}=await qe(We,Oe);if(!Ke){const ze=await pe(We,nt,Oe.compressedSize);return u(ze)?ze.buffer:ze.slice().buffer}const Xe=await se(We,nt,Oe.compressedSize);return await ce(Xe,Oe.uncompressedSize)}async function mt(We,Oe,Ke){const{decompress:nt,fileDataStart:Xe}=await qe(We,Oe);if(!nt){const Ct=await se(We,Xe,Oe.compressedSize,Ke);return A(Ct)?Ct:new Blob([h(Ct.buffer)?new Uint8Array(Ct):Ct],{type:Ke})}const Ge=await se(We,Xe,Oe.compressedSize);return await ce(Ge,Oe.uncompressedSize,Ke)}function kt(We){ae(We)}async function ht(We){let Oe;if(typeof Blob<"u"&&We instanceof Blob)Oe=new f(We);else if(We instanceof ArrayBuffer||We&&We.buffer&&We.buffer instanceof ArrayBuffer)Oe=new c(We);else if(h(We)||h(We.buffer))Oe=new c(We);else if(typeof We=="string"){const nt=await fetch(We);if(!nt.ok)throw new Error(`failed http request ${We}, status: ${nt.status}: ${nt.statusText}`);const Xe=await nt.blob();Oe=new f(Xe)}else if(typeof We.getLength=="function"&&typeof We.read=="function")Oe=We;else throw new Error("unsupported source type");const Ke=await Oe.getLength();if(Ke>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${Ke}. Only file sizes up 4503599627370496 bytes are supported`);return await be(Oe,Ke)}async function yt(We){const{zip:Oe,entries:Ke}=await ht(We);return{zip:Oe,entries:Object.fromEntries(Ke.map(nt=>[nt.name,nt]))}}function Lt(){fe()}},"./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(c,f,m,g){g===void 0&&(g=m);var v=Object.getOwnPropertyDescriptor(f,m);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[m]}}),Object.defineProperty(c,g,v)}:function(c,f,m,g){g===void 0&&(g=m),c[g]=f[m]}),y=this&&this.__setModuleDefault||(Object.create?function(c,f){Object.defineProperty(c,"default",{enumerable:!0,value:f})}:function(c,f){c.default=f}),A=this&&this.__importStar||function(c){if(c&&c.__esModule)return c;var f={};if(c!=null)for(var m in c)m!=="default"&&Object.prototype.hasOwnProperty.call(c,m)&&p(f,c,m);return y(f,c),f};Object.defineProperty(C,"__esModule",{value:!0}),C.Helpers=void 0;const h=i("./node_modules/fast-xml-parser/src/fxp.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(c){c.XmlParserOptions=d.XmlParserOptions,c.XmlBuilderOptions=d.XmlBuilderOptions,c.GetViewpoint=d.GetViewpoint,c.XmlToJsonNotation=d.XmlToJsonNotation;const f=d.ChangeToUppercase;function m(D){const{Markup:R}=new h.XMLParser(c.XmlParserOptions).parse(D);return{header:{files:k(R.Header)},topic:{guid:R.Topic["@_Guid"],topic_type:R.Topic["@_TopicType"],topic_status:R.Topic["@_TopicStatus"],reference_links:R.Topic.ReferenceLink&&c.ObjectToArray(R.Topic.ReferenceLink),title:R.Topic.Title,priority:R.Topic.Priority,index:R.Topic.Index,labels:R.Topic.Labels&&c.ObjectToArray(R.Topic.Labels),creation_date:R.Topic.CreationDate,creation_author:R.Topic.CreationAuthor,modified_date:R.Topic.ModifiedDate,modified_author:R.Topic.ModifiedAuthor,assigned_to:R.Topic.AssignedTo,description:R.Topic.Description,comments:c.GetComments(R.Comment),viewpoints:c.GetViewpoints(R.Viewpoints)}}}c.GetMarkup=m;function g(D){if(!D)return;const R=F=>({guid:F["@_Guid"],viewpoint:F.Viewpoint,snapshot:F.Snapshot}),z=[];return Array.isArray(D)?D.forEach(F=>{z.push(R(F))}):z.push(R(D)),z}c.GetViewpoints=g;function v(D){if(!D)return;const R=F=>{var H;return{guid:F["@_Guid"],date:F.Date,author:F.Author,comment:F.Comment,viewpoint:(H=F==null?void 0:F.Viewpoint)==null?void 0:H["@_Guid"],modified_date:F.ModifiedDate,modified_author:F.ModifiedAuthor}},z=[];return Array.isArray(D)?D.forEach(F=>{z.push(R(F))}):z.push(R(D)),z}c.GetComments=v;function b(D){return Array.isArray(D)?D:[D]}c.ObjectToArray=b;function w(D){return{x:D.X,y:D.Y,z:D.Z}}c.ParsePoint=w;const _=["DocumentReferences","RelatedTopics"];function x(D){const R=P(D);let z={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:R.header,topic:R.topic,comment:R.comment,viewpoints:R.viewpoints}};return E(z)}c.MarkupToXmlNotation=x;function E(D,R){let z={};if(typeof D=="string")return D;const F=(R==null?void 0:R.plural_to_singular)!==void 0?R.plural_to_singular:!0;for(const H in D){let $=D[H];if(!$)continue;if(H.startsWith("@_")){z[H]=$;continue}let K=f(H,R);if(Array.isArray($)){const G=[];for(const N of $)G.push(E(N,R));const j=_.find(N=>N.startsWith(K));j&&F&&(K=j.slice(0,-1)),z[K]=G;continue}typeof $=="object"&&($=E($,R)),z[K]=$}return z}c.RenameJsonKeys=E;function k(D){if(D)return c.ObjectToArray(D).map(R=>c.XmlToJsonNotation(R))}function P(D){var $;if(!D.topic)return;const{comments:R,viewpoints:z,...F}=D.topic;return{header:{file:($=D.header)==null?void 0:$.files},topic:F,comment:R,viewpoints:z}}})(u||(C.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/2.1/index.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(g,v,b,w){w===void 0&&(w=b);var _=Object.getOwnPropertyDescriptor(v,b);(!_||("get"in _?!v.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return v[b]}}),Object.defineProperty(g,w,_)}:function(g,v,b,w){w===void 0&&(w=b),g[w]=v[b]}),y=this&&this.__exportStar||function(g,v){for(var b in g)b!=="default"&&!Object.prototype.hasOwnProperty.call(v,b)&&p(v,g,b)},A=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(C,"__esModule",{value:!0}),C.BcfWriter=C.BcfReader=void 0;const h=i("./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(i("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));y(i("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),C);const c={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 f extends d.default{constructor(){super("2.1",c)}}C.BcfReader=f;class m extends u.default{constructor(){super("2.1",c)}}C.BcfWriter=m},"./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(c,f,m,g){g===void 0&&(g=m);var v=Object.getOwnPropertyDescriptor(f,m);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[m]}}),Object.defineProperty(c,g,v)}:function(c,f,m,g){g===void 0&&(g=m),c[g]=f[m]}),y=this&&this.__setModuleDefault||(Object.create?function(c,f){Object.defineProperty(c,"default",{enumerable:!0,value:f})}:function(c,f){c.default=f}),A=this&&this.__importStar||function(c){if(c&&c.__esModule)return c;var f={};if(c!=null)for(var m in c)m!=="default"&&Object.prototype.hasOwnProperty.call(c,m)&&p(f,c,m);return y(f,c),f};Object.defineProperty(C,"__esModule",{value:!0}),C.Helpers=void 0;const h=i("./node_modules/fast-xml-parser/src/fxp.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(c){c.XmlParserOptions={...d.XmlParserOptions,oneListGroup:!0},c.XmlBuilderOptions=d.XmlBuilderOptions,c.GetViewpoint=d.GetViewpoint,c.XmlToJsonNotation=d.XmlToJsonNotation;const f=d.ChangeToUppercase;function m(b){const{Markup:w}=new h.XMLParser(c.XmlParserOptions).parse(b),_=c.XmlToJsonNotation(w);return{header:_.header,topic:_.topic}}c.GetMarkup=m;function g(b){let w={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:b.header,topic:b.topic}};return v(w)}c.MarkupToXmlNotation=g;function v(b,w){let _={};if(typeof b=="string")return b;const x=(w==null?void 0:w.plural_to_singular)!==void 0?w.plural_to_singular:!0;for(const E in b){let k=b[E];if(!k)continue;if(E.startsWith("@_")){_[E]=k;continue}let P=f(E,w);if(Array.isArray(k)){const D=[];for(const R of k){let z={},F=P;x&&(F=F.slice(0,-1)),z[F]=v(R,w),D.push(z)}_[P]=D;continue}typeof k=="object"&&(k=v(k,w)),_[P]=k}return _}c.RenameJsonKeys=v})(u||(C.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/3.0/index.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(g,v,b,w){w===void 0&&(w=b);var _=Object.getOwnPropertyDescriptor(v,b);(!_||("get"in _?!v.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return v[b]}}),Object.defineProperty(g,w,_)}:function(g,v,b,w){w===void 0&&(w=b),g[w]=v[b]}),y=this&&this.__exportStar||function(g,v){for(var b in g)b!=="default"&&!Object.prototype.hasOwnProperty.call(v,b)&&p(v,g,b)},A=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(C,"__esModule",{value:!0}),C.BcfWriter=C.BcfReader=void 0;const h=i("./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(i("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));y(i("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),C);const c={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 f extends d.default{constructor(){super("3.0",c)}}C.BcfReader=f;class m extends u.default{constructor(){super("3.0",c)}}C.BcfWriter=m},"./node_modules/@parametricos/bcf-js/dist/BcfReader.js"(s,C,i){Object.defineProperty(C,"__esModule",{value:!0}),C.Markup=void 0;const p=i("./node_modules/unzipit/dist/unzipit.module.js"),y=i("./node_modules/fast-xml-parser/src/fxp.js");class A{constructor(u,c){qn(this,"version");qn(this,"bcf_archive");qn(this,"project");qn(this,"markups",[]);qn(this,"helpers");qn(this,"read",async u=>{try{const c=[];this.bcf_archive=await(0,p.unzip)(u);const{entries:f}=this.bcf_archive;let m="",g="",v="",b;for(const[_,x]of Object.entries(f))if(_.endsWith(".bcf"))c.push(x);else if(_.endsWith(".version"))v=new y.XMLParser(this.helpers.XmlParserOptions).parse(await x.text()).Version.DetailedVersion;else if(_.endsWith(".bcfp")){const E=new y.XMLParser(this.helpers.XmlParserOptions).parse(await x.text());if(!E.ProjectExtension||!E.ProjectExtension.Project)continue;m=E.ProjectExtension.Project["@_ProjectId"]||"",g=E.ProjectExtension.Project.Name||""}else if(_.endsWith("extensions.xsd")){const E=new y.XMLParser(this.helpers.XmlParserOptions).parse(await x.text());b=this.helpers.XmlToJsonNotation(E)}const w=[];for(let _=0;_<c.length;_++){const x=c[_],E=new h(this,x);await E.read(),this.markups.push(E);const k={header:E.header,topic:E.topic,project:this.project,viewpoints:E.viewpoints};w.push(k)}this.project={project_id:m,name:g,version:v,markups:void 0,reader:this,extension_schema:b},this.project.markups=w.map(_=>({..._,project:this.project}))}catch(c){console.log("Error in loading BCF archive. The error below was thrown."),console.error(c)}});qn(this,"getEntry",u=>{var c;return(c=this.bcf_archive)==null?void 0:c.entries[u]});this.version=u,this.helpers=c}}C.default=A;class h{constructor(u,c){qn(this,"reader");qn(this,"markup_file");qn(this,"header");qn(this,"topic");qn(this,"viewpoints",[]);qn(this,"read",async()=>{await this.parseMarkup(),await this.parseViewpoints()});qn(this,"parseMarkup",async()=>{const u=this.reader.helpers.GetMarkup(await this.markup_file.text());this.topic=u.topic,this.header=u.header});qn(this,"parseViewpoints",async()=>{if(this.topic&&this.topic.viewpoints){const u=this.topic.viewpoints;for(let c=0;c<u.length;c++){const f=u[c],m=this.topic.guid+"/"+f.viewpoint,g=this.reader.getEntry(m);if(!g)throw new Error("Missing Visualization Info");const v=this.reader.helpers.GetViewpoint(await g.text());v.snapshot=f.snapshot,v.getSnapshot=async()=>{if(f.snapshot)return await this.getSnapshot(f.snapshot)},this.viewpoints.push(v)}}});qn(this,"getViewpointSnapshot",async u=>{if(!u||!this.topic)return;const c=this.reader.getEntry(`${this.topic.guid}/${u.snapshot}`);if(c){const f=await c.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(f)))}});qn(this,"getSnapshot",async u=>{if(!u||!this.topic)return;const c=this.reader.getEntry(`${this.topic.guid}/${u}`);if(c){const f=await c.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(f)))}});this.reader=u,this.markup_file=c}}C.Markup=h},"./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"(s,C,i){var p=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(C,"__esModule",{value:!0});const y=p(i("./node_modules/jszip/dist/jszip.min.js")),A=i("./node_modules/fast-xml-parser/src/fxp.js");class h{constructor(v,b){qn(this,"version");qn(this,"project");qn(this,"markups",[]);qn(this,"files");qn(this,"helpers");qn(this,"addEntry",v=>{v.path.endsWith(".version")||this.files.push(v)});qn(this,"write",async v=>{try{return this.project=v,d(this,v.markups),await u(this.files)}catch(b){console.log("Error in writing BCF archive. The error below was thrown."),console.error(b)}});this.version=v,this.helpers=b,this.files=[]}}C.default=h;function d(g,v){if(g.project){g.addEntry(c(g.version)),g.addEntry(f(g.project.project_id,g.project.name)),g.addEntry(m(g));for(const b of v){const w=g.helpers.MarkupToXmlNotation(b);g.markups.push(w);let _=new A.XMLBuilder(g.helpers.XmlBuilderOptions).build(w);if(_=`<?xml version="1.0" encoding="utf-8"?>${_}`,b.topic){const E={path:`${b.topic.guid}/markup.bcf`,content:_};g.addEntry(E)}}}}async function u(g){var b;var v=new y.default;for(const w of g){const _=w.path.split("/");_&&(_.length==1?v.file(_[0],w.content):_.length==2&&((b=v.folder(_[0]))==null||b.file(_[1],w.content)))}return await v.generateAsync({type:"nodebuffer"})}function c(g){return{path:"bcf.version",content:`<?xml version="1.0" encoding="utf-8"?>
|
|
546
|
+
\0`,ce+=h(J,2),ce+=z.magic,ce+=h(P,2),ce+=h(D,2),ce+=h(Z.crc32,4),ce+=h(Z.compressedSize,4),ce+=h(Z.uncompressedSize,4),ce+=h(H.length,2),ce+=h(L.length,2),{fileRecord:g.LOCAL_FILE_HEADER+ce+H+L,dirRecord:g.CENTRAL_FILE_HEADER+h(ae,2)+ce+h(G.length,2)+"\0\0\0\0"+h(ne,4)+h(x,4)+H+L+G}}var u=p("../utils"),c=p("../stream/GenericWorker"),f=p("../utf8"),m=p("../crc32"),g=p("../signature");function v(b,w,_,x){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=_,this.encodeFileName=x,this.streamFiles=b,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(v,c),v.prototype.push=function(b){var w=b.meta.percent||0,_=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(b):(this.bytesWritten+=b.data.length,c.prototype.push.call(this,{data:b.data,meta:{currentFile:this.currentFile,percent:_?(w+100*(_-x-1))/_:100}}))},v.prototype.openedSource=function(b){this.currentSourceOffset=this.bytesWritten,this.currentFile=b.file.name;var w=this.streamFiles&&!b.file.dir;if(w){var _=d(b,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:_.fileRecord,meta:{percent:0}})}else this.accumulate=!0},v.prototype.closedSource=function(b){this.accumulate=!1;var w=this.streamFiles&&!b.file.dir,_=d(b,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(_.dirRecord),w)this.push({data:function(x){return g.DATA_DESCRIPTOR+h(x.crc32,4)+h(x.compressedSize,4)+h(x.uncompressedSize,4)}(b),meta:{percent:100}});else for(this.push({data:_.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},v.prototype.flush=function(){for(var b=this.bytesWritten,w=0;w<this.dirRecords.length;w++)this.push({data:this.dirRecords[w],meta:{percent:100}});var _=this.bytesWritten-b,x=function(E,k,P,D,R){var z=u.transformTo("string",R(D));return g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+h(E,2)+h(E,2)+h(k,4)+h(P,4)+h(z.length,2)+z}(this.dirRecords.length,_,b,this.zipComment,this.encodeFileName);this.push({data:x,meta:{percent:100}})},v.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},v.prototype.registerPrevious=function(b){this._sources.push(b);var w=this;return b.on("data",function(_){w.processChunk(_)}),b.on("end",function(){w.closedSource(w.previous.streamInfo),w._sources.length?w.prepareNextSource():w.end()}),b.on("error",function(_){w.error(_)}),this},v.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},v.prototype.error=function(b){var w=this._sources;if(!c.prototype.error.call(this,b))return!1;for(var _=0;_<w.length;_++)try{w[_].error(b)}catch{}return!0},v.prototype.lock=function(){c.prototype.lock.call(this);for(var b=this._sources,w=0;w<b.length;w++)b[w].lock()},y.exports=v},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(p,y,A){var h=p("../compressions"),d=p("./ZipFileWorker");A.generateWorker=function(u,c,f){var m=new d(c.streamFiles,f,c.platform,c.encodeFileName),g=0;try{u.forEach(function(v,b){g++;var w=function(k,P){var D=k||P,R=h[D];if(!R)throw new Error(D+" is not a valid compression method !");return R}(b.options.compression,c.compression),_=b.options.compressionOptions||c.compressionOptions||{},x=b.dir,E=b.date;b._compressWorker(w,_).withStreamInfo("file",{name:v,dir:x,date:E,comment:b.comment||"",unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions}).pipe(m)}),m.entriesCount=g}catch(v){m.error(v)}return m}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(p,y,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=p("./object")).loadAsync=p("./load"),h.support=p("./support"),h.defaults=p("./defaults"),h.version="3.10.1",h.loadAsync=function(d,u){return new h().loadAsync(d,u)},h.external=p("./external"),y.exports=h},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(p,y,A){var h=p("./utils"),d=p("./external"),u=p("./utf8"),c=p("./zipEntries"),f=p("./stream/Crc32Probe"),m=p("./nodejsUtils");function g(v){return new d.Promise(function(b,w){var _=v.decompressed.getContentWorker().pipe(new f);_.on("error",function(x){w(x)}).on("end",function(){_.streamInfo.crc32!==v.decompressed.crc32?w(new Error("Corrupted zip : CRC32 mismatch")):b()}).resume()})}y.exports=function(v,b){var w=this;return b=h.extend(b||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:u.utf8decode}),m.isNode&&m.isStream(v)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):h.prepareContent("the loaded zip file",v,!0,b.optimizedBinaryString,b.base64).then(function(_){var x=new c(b);return x.load(_),x}).then(function(_){var x=[d.Promise.resolve(_)],E=_.files;if(b.checkCRC32)for(var k=0;k<E.length;k++)x.push(g(E[k]));return d.Promise.all(x)}).then(function(_){for(var x=_.shift(),E=x.files,k=0;k<E.length;k++){var P=E[k],D=P.fileNameStr,R=h.resolve(P.fileNameStr);w.file(R,P.decompressed,{binary:!0,optimizedBinaryString:!0,date:P.date,dir:P.dir,comment:P.fileCommentStr.length?P.fileCommentStr:null,unixPermissions:P.unixPermissions,dosPermissions:P.dosPermissions,createFolders:b.createFolders}),P.dir||(w.file(R).unsafeOriginalName=D)}return x.zipComment.length&&(w.comment=x.zipComment),w})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(p,y,A){var h=p("../utils"),d=p("../stream/GenericWorker");function u(c,f){d.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(f)}h.inherits(u,d),u.prototype._bindStream=function(c){var f=this;(this._stream=c).pause(),c.on("data",function(m){f.push({data:m,meta:{percent:0}})}).on("error",function(m){f.isPaused?this.generatedError=m:f.error(m)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.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)},y.exports=u},{"../stream/GenericWorker":28,"../utils":32}],13:[function(p,y,A){var h=p("readable-stream").Readable;function d(u,c,f){h.call(this,c),this._helper=u;var m=this;u.on("data",function(g,v){m.push(g)||m._helper.pause(),f&&f(v)}).on("error",function(g){m.emit("error",g)}).on("end",function(){m.push(null)})}p("../utils").inherits(d,h),d.prototype._read=function(){this._helper.resume()},y.exports=d},{"../utils":32,"readable-stream":16}],14:[function(p,y,A){y.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(p,y,A){function h(R,z,F){var H,$=u.getTypeOf(z),K=u.extend(F||{},m);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&&(R=E(R)),K.createFolders&&(H=x(R))&&k.call(this,H,!0);var G=$==="string"&&K.binary===!1&&K.base64===!1;F&&F.binary!==void 0||(K.binary=!G),(z instanceof g&&z.uncompressedSize===0||K.dir||!z||z.length===0)&&(K.base64=!1,K.binary=!0,z="",K.compression="STORE",$="string");var j=null;j=z instanceof g||z instanceof c?z:w.isNode&&w.isStream(z)?new _(R,z):u.prepareContent(R,z,K.binary,K.optimizedBinaryString,K.base64);var N=new v(R,j,K);this.files[R]=N}var d=p("./utf8"),u=p("./utils"),c=p("./stream/GenericWorker"),f=p("./stream/StreamHelper"),m=p("./defaults"),g=p("./compressedObject"),v=p("./zipObject"),b=p("./generate"),w=p("./nodejsUtils"),_=p("./nodejs/NodejsStreamInputAdapter"),x=function(R){R.slice(-1)==="/"&&(R=R.substring(0,R.length-1));var z=R.lastIndexOf("/");return 0<z?R.substring(0,z):""},E=function(R){return R.slice(-1)!=="/"&&(R+="/"),R},k=function(R,z){return z=z!==void 0?z:m.createFolders,R=E(R),this.files[R]||h.call(this,R,null,{dir:!0,createFolders:z}),this.files[R]};function P(R){return Object.prototype.toString.call(R)==="[object RegExp]"}var D={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(R){var z,F,H;for(z in this.files)H=this.files[z],(F=z.slice(this.root.length,z.length))&&z.slice(0,this.root.length)===this.root&&R(F,H)},filter:function(R){var z=[];return this.forEach(function(F,H){R(F,H)&&z.push(H)}),z},file:function(R,z,F){if(arguments.length!==1)return R=this.root+R,h.call(this,R,z,F),this;if(P(R)){var H=R;return this.filter(function(K,G){return!G.dir&&H.test(K)})}var $=this.files[this.root+R];return $&&!$.dir?$:null},folder:function(R){if(!R)return this;if(P(R))return this.filter(function($,K){return K.dir&&R.test($)});var z=this.root+R,F=k.call(this,z),H=this.clone();return H.root=F.name,H},remove:function(R){R=this.root+R;var z=this.files[R];if(z||(R.slice(-1)!=="/"&&(R+="/"),z=this.files[R]),z&&!z.dir)delete this.files[R];else for(var F=this.filter(function($,K){return K.name.slice(0,R.length)===R}),H=0;H<F.length;H++)delete this.files[F[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(R){var z,F={};try{if((F=u.extend(R||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=F.type.toLowerCase(),F.compression=F.compression.toUpperCase(),F.type==="binarystring"&&(F.type="string"),!F.type)throw new Error("No output type specified.");u.checkSupport(F.type),F.platform!=="darwin"&&F.platform!=="freebsd"&&F.platform!=="linux"&&F.platform!=="sunos"||(F.platform="UNIX"),F.platform==="win32"&&(F.platform="DOS");var H=F.comment||this.comment||"";z=b.generateWorker(this,F,H)}catch($){(z=new c("error")).error($)}return new f(z,F.type||"string",F.mimeType)},generateAsync:function(R,z){return this.generateInternalStream(R).accumulate(z)},generateNodeStream:function(R,z){return(R=R||{}).type||(R.type="nodebuffer"),this.generateInternalStream(R).toNodejsStream(z)}};y.exports=D},{"./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(p,y,A){y.exports=p("stream")},{stream:void 0}],17:[function(p,y,A){var h=p("./DataReader");function d(u){h.call(this,u);for(var c=0;c<this.data.length;c++)u[c]=255&u[c]}p("../utils").inherits(d,h),d.prototype.byteAt=function(u){return this.data[this.zero+u]},d.prototype.lastIndexOfSignature=function(u){for(var c=u.charCodeAt(0),f=u.charCodeAt(1),m=u.charCodeAt(2),g=u.charCodeAt(3),v=this.length-4;0<=v;--v)if(this.data[v]===c&&this.data[v+1]===f&&this.data[v+2]===m&&this.data[v+3]===g)return v-this.zero;return-1},d.prototype.readAndCheckSignature=function(u){var c=u.charCodeAt(0),f=u.charCodeAt(1),m=u.charCodeAt(2),g=u.charCodeAt(3),v=this.readData(4);return c===v[0]&&f===v[1]&&m===v[2]&&g===v[3]},d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./DataReader":18}],18:[function(p,y,A){var h=p("../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 c,f=0;for(this.checkOffset(u),c=this.index+u-1;c>=this.index;c--)f=(f<<8)+this.byteAt(c);return this.index+=u,f},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))}},y.exports=d},{"../utils":32}],19:[function(p,y,A){var h=p("./Uint8ArrayReader");function d(u){h.call(this,u)}p("../utils").inherits(d,h),d.prototype.readData=function(u){this.checkOffset(u);var c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(p,y,A){var h=p("./DataReader");function d(u){h.call(this,u)}p("../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 c=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./DataReader":18}],21:[function(p,y,A){var h=p("./ArrayReader");function d(u){h.call(this,u)}p("../utils").inherits(d,h),d.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,c},y.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(p,y,A){var h=p("../utils"),d=p("../support"),u=p("./ArrayReader"),c=p("./StringReader"),f=p("./NodeBufferReader"),m=p("./Uint8ArrayReader");y.exports=function(g){var v=h.getTypeOf(g);return h.checkSupport(v),v!=="string"||d.uint8array?v==="nodebuffer"?new f(g):d.uint8array?new m(h.transformTo("uint8array",g)):new u(h.transformTo("array",g)):new c(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(p,y,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(p,y,A){var h=p("./GenericWorker"),d=p("../utils");function u(c){h.call(this,"ConvertWorker to "+c),this.destType=c}d.inherits(u,h),u.prototype.processChunk=function(c){this.push({data:d.transformTo(this.destType,c.data),meta:c.meta})},y.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(p,y,A){var h=p("./GenericWorker"),d=p("../crc32");function u(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}p("../utils").inherits(u,h),u.prototype.processChunk=function(c){this.streamInfo.crc32=d(c.data,this.streamInfo.crc32||0),this.push(c)},y.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(p,y,A){var h=p("../utils"),d=p("./GenericWorker");function u(c){d.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}h.inherits(u,d),u.prototype.processChunk=function(c){if(c){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+c.data.length}d.prototype.processChunk.call(this,c)},y.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(p,y,A){var h=p("../utils"),d=p("./GenericWorker");function u(c){d.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(m){f.dataIsReady=!0,f.data=m,f.max=m&&m.length||0,f.type=h.getTypeOf(m),f.isPaused||f._tickAndRepeat()},function(m){f.error(m)})}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 c=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,f);break;case"uint8array":c=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":c=this.data.slice(this.index,f)}return this.index=f,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},y.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(p,y,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 c=0;c<this._listeners[d].length;c++)this._listeners[d][c].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(c){u.processChunk(c)}),d.on("end",function(){u.end()}),d.on("error",function(c){u.error(c)}),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}},y.exports=h},{}],29:[function(p,y,A){var h=p("../utils"),d=p("./ConvertWorker"),u=p("./GenericWorker"),c=p("../base64"),f=p("../support"),m=p("../external"),g=null;if(f.nodestream)try{g=p("../nodejs/NodejsStreamOutputAdapter")}catch{}function v(w,_){return new m.Promise(function(x,E){var k=[],P=w._internalType,D=w._outputType,R=w._mimeType;w.on("data",function(z,F){k.push(z),_&&_(F)}).on("error",function(z){k=[],E(z)}).on("end",function(){try{var z=function(F,H,$){switch(F){case"blob":return h.newBlob(h.transformTo("arraybuffer",H),$);case"base64":return c.encode(H);default:return h.transformTo(F,H)}}(D,function(F,H){var $,K=0,G=null,j=0;for($=0;$<H.length;$++)j+=H[$].length;switch(F){case"string":return H.join("");case"array":return Array.prototype.concat.apply([],H);case"uint8array":for(G=new Uint8Array(j),$=0;$<H.length;$++)G.set(H[$],K),K+=H[$].length;return G;case"nodebuffer":return Buffer.concat(H);default:throw new Error("concat : unsupported type '"+F+"'")}}(P,k),R);x(z)}catch(F){E(F)}k=[]}).resume()})}function b(w,_,x){var E=_;switch(_){case"blob":case"arraybuffer":E="uint8array";break;case"base64":E="string"}try{this._internalType=E,this._outputType=_,this._mimeType=x,h.checkSupport(E),this._worker=w.pipe(new d(E)),w.lock()}catch(k){this._worker=new u("error"),this._worker.error(k)}}b.prototype={accumulate:function(w){return v(this,w)},on:function(w,_){var x=this;return w==="data"?this._worker.on(w,function(E){_.call(x,E.data,E.meta)}):this._worker.on(w,function(){h.delay(_,arguments,x)}),this},resume:function(){return h.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(w){if(h.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new g(this,{objectMode:this._outputType!=="nodebuffer"},w)}},y.exports=b},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(p,y,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=!!p("readable-stream").Readable}catch{A.nodestream=!1}},{"readable-stream":16}],31:[function(p,y,A){for(var h=p("./utils"),d=p("./support"),u=p("./nodejsUtils"),c=p("./stream/GenericWorker"),f=new Array(256),m=0;m<256;m++)f[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;f[254]=f[254]=1;function g(){c.call(this,"utf-8 decode"),this.leftOver=null}function v(){c.call(this,"utf-8 encode")}A.utf8encode=function(b){return d.nodebuffer?u.newBufferFrom(b,"utf-8"):function(w){var _,x,E,k,P,D=w.length,R=0;for(k=0;k<D;k++)(64512&(x=w.charCodeAt(k)))==55296&&k+1<D&&(64512&(E=w.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(E-56320),k++),R+=x<128?1:x<2048?2:x<65536?3:4;for(_=d.uint8array?new Uint8Array(R):new Array(R),k=P=0;P<R;k++)(64512&(x=w.charCodeAt(k)))==55296&&k+1<D&&(64512&(E=w.charCodeAt(k+1)))==56320&&(x=65536+(x-55296<<10)+(E-56320),k++),x<128?_[P++]=x:(x<2048?_[P++]=192|x>>>6:(x<65536?_[P++]=224|x>>>12:(_[P++]=240|x>>>18,_[P++]=128|x>>>12&63),_[P++]=128|x>>>6&63),_[P++]=128|63&x);return _}(b)},A.utf8decode=function(b){return d.nodebuffer?h.transformTo("nodebuffer",b).toString("utf-8"):function(w){var _,x,E,k,P=w.length,D=new Array(2*P);for(_=x=0;_<P;)if((E=w[_++])<128)D[x++]=E;else if(4<(k=f[E]))D[x++]=65533,_+=k-1;else{for(E&=k===2?31:k===3?15:7;1<k&&_<P;)E=E<<6|63&w[_++],k--;1<k?D[x++]=65533:E<65536?D[x++]=E:(E-=65536,D[x++]=55296|E>>10&1023,D[x++]=56320|1023&E)}return D.length!==x&&(D.subarray?D=D.subarray(0,x):D.length=x),h.applyFromCharCode(D)}(b=h.transformTo(d.uint8array?"uint8array":"array",b))},h.inherits(g,c),g.prototype.processChunk=function(b){var w=h.transformTo(d.uint8array?"uint8array":"array",b.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var _=w;(w=new Uint8Array(_.length+this.leftOver.length)).set(this.leftOver,0),w.set(_,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var x=function(k,P){var D;for((P=P||k.length)>k.length&&(P=k.length),D=P-1;0<=D&&(192&k[D])==128;)D--;return D<0||D===0?P:D+f[k[D]]>P?D:P}(w),E=w;x!==w.length&&(d.uint8array?(E=w.subarray(0,x),this.leftOver=w.subarray(x,w.length)):(E=w.slice(0,x),this.leftOver=w.slice(x,w.length))),this.push({data:A.utf8decode(E),meta:b.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:A.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},A.Utf8DecodeWorker=g,h.inherits(v,c),v.prototype.processChunk=function(b){this.push({data:A.utf8encode(b.data),meta:b.meta})},A.Utf8EncodeWorker=v},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(p,y,A){var h=p("./support"),d=p("./base64"),u=p("./nodejsUtils"),c=p("./external");function f(_){return _}function m(_,x){for(var E=0;E<_.length;++E)x[E]=255&_.charCodeAt(E);return x}p("setimmediate"),A.newBlob=function(_,x){A.checkSupport("blob");try{return new Blob([_],{type:x})}catch{try{var E=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return E.append(_),E.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var g={stringifyByChunk:function(_,x,E){var k=[],P=0,D=_.length;if(D<=E)return String.fromCharCode.apply(null,_);for(;P<D;)x==="array"||x==="nodebuffer"?k.push(String.fromCharCode.apply(null,_.slice(P,Math.min(P+E,D)))):k.push(String.fromCharCode.apply(null,_.subarray(P,Math.min(P+E,D)))),P+=E;return k.join("")},stringifyByChar:function(_){for(var x="",E=0;E<_.length;E++)x+=String.fromCharCode(_[E]);return x},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 v(_){var x=65536,E=A.getTypeOf(_),k=!0;if(E==="uint8array"?k=g.applyCanBeUsed.uint8array:E==="nodebuffer"&&(k=g.applyCanBeUsed.nodebuffer),k)for(;1<x;)try{return g.stringifyByChunk(_,E,x)}catch{x=Math.floor(x/2)}return g.stringifyByChar(_)}function b(_,x){for(var E=0;E<_.length;E++)x[E]=_[E];return x}A.applyFromCharCode=v;var w={};w.string={string:f,array:function(_){return m(_,new Array(_.length))},arraybuffer:function(_){return w.string.uint8array(_).buffer},uint8array:function(_){return m(_,new Uint8Array(_.length))},nodebuffer:function(_){return m(_,u.allocBuffer(_.length))}},w.array={string:v,array:f,arraybuffer:function(_){return new Uint8Array(_).buffer},uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return u.newBufferFrom(_)}},w.arraybuffer={string:function(_){return v(new Uint8Array(_))},array:function(_){return b(new Uint8Array(_),new Array(_.byteLength))},arraybuffer:f,uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return u.newBufferFrom(new Uint8Array(_))}},w.uint8array={string:v,array:function(_){return b(_,new Array(_.length))},arraybuffer:function(_){return _.buffer},uint8array:f,nodebuffer:function(_){return u.newBufferFrom(_)}},w.nodebuffer={string:v,array:function(_){return b(_,new Array(_.length))},arraybuffer:function(_){return w.nodebuffer.uint8array(_).buffer},uint8array:function(_){return b(_,new Uint8Array(_.length))},nodebuffer:f},A.transformTo=function(_,x){if(x=x||"",!_)return x;A.checkSupport(_);var E=A.getTypeOf(x);return w[E][_](x)},A.resolve=function(_){for(var x=_.split("/"),E=[],k=0;k<x.length;k++){var P=x[k];P==="."||P===""&&k!==0&&k!==x.length-1||(P===".."?E.pop():E.push(P))}return E.join("/")},A.getTypeOf=function(_){return typeof _=="string"?"string":Object.prototype.toString.call(_)==="[object Array]"?"array":h.nodebuffer&&u.isBuffer(_)?"nodebuffer":h.uint8array&&_ instanceof Uint8Array?"uint8array":h.arraybuffer&&_ instanceof ArrayBuffer?"arraybuffer":void 0},A.checkSupport=function(_){if(!h[_.toLowerCase()])throw new Error(_+" is not supported by this platform")},A.MAX_VALUE_16BITS=65535,A.MAX_VALUE_32BITS=-1,A.pretty=function(_){var x,E,k="";for(E=0;E<(_||"").length;E++)k+="\\x"+((x=_.charCodeAt(E))<16?"0":"")+x.toString(16).toUpperCase();return k},A.delay=function(_,x,E){setImmediate(function(){_.apply(E||null,x||[])})},A.inherits=function(_,x){function E(){}E.prototype=x.prototype,_.prototype=new E},A.extend=function(){var _,x,E={};for(_=0;_<arguments.length;_++)for(x in arguments[_])Object.prototype.hasOwnProperty.call(arguments[_],x)&&E[x]===void 0&&(E[x]=arguments[_][x]);return E},A.prepareContent=function(_,x,E,k,P){return c.Promise.resolve(x).then(function(D){return h.blob&&(D instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(D))!==-1)&&typeof FileReader<"u"?new c.Promise(function(R,z){var F=new FileReader;F.onload=function(H){R(H.target.result)},F.onerror=function(H){z(H.target.error)},F.readAsArrayBuffer(D)}):D}).then(function(D){var R=A.getTypeOf(D);return R?(R==="arraybuffer"?D=A.transformTo("uint8array",D):R==="string"&&(P?D=d.decode(D):E&&k!==!0&&(D=function(z){return m(z,h.uint8array?new Uint8Array(z.length):new Array(z.length))}(D))),D):c.Promise.reject(new Error("Can't read the data of '"+_+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(p,y,A){var h=p("./reader/readerFor"),d=p("./utils"),u=p("./signature"),c=p("./zipEntry"),f=p("./support");function m(g){this.files=[],this.loadOptions=g}m.prototype={checkSignature:function(g){if(!this.reader.readAndCheckSignature(g)){this.reader.index-=4;var v=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(v)+", expected "+d.pretty(g)+")")}},isSignature:function(g,v){var b=this.reader.index;this.reader.setIndex(g);var w=this.reader.readString(4)===v;return this.reader.setIndex(b),w},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 g=this.reader.readData(this.zipCommentLength),v=f.uint8array?"uint8array":"array",b=d.transformTo(v,g);this.zipComment=this.loadOptions.decodeFileName(b)},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 g,v,b,w=this.zip64EndOfCentralSize-44;0<w;)g=this.reader.readInt(2),v=this.reader.readInt(4),b=this.reader.readData(v),this.zip64ExtensibleData[g]={id:g,length:v,value:b}},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 g,v;for(g=0;g<this.files.length;g++)v=this.files[g],this.reader.setIndex(v.localHeaderOffset),this.checkSignature(u.LOCAL_FILE_HEADER),v.readLocalPart(this.reader),v.handleUTF8(),v.processAttributes()},readCentralDir:function(){var g;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(u.CENTRAL_FILE_HEADER);)(g=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(g);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 g=this.reader.lastIndexOfSignature(u.CENTRAL_DIRECTORY_END);if(g<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(g);var v=g;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,(g=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(g),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 b=this.centralDirOffset+this.centralDirSize;this.zip64&&(b+=20,b+=12+this.zip64EndOfCentralSize);var w=v-b;if(0<w)this.isSignature(v,u.CENTRAL_FILE_HEADER)||(this.reader.zero=w);else if(w<0)throw new Error("Corrupted zip: missing "+Math.abs(w)+" bytes.")},prepareReader:function(g){this.reader=h(g)},load:function(g){this.prepareReader(g),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},y.exports=m},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(p,y,A){var h=p("./reader/readerFor"),d=p("./utils"),u=p("./compressedObject"),c=p("./crc32"),f=p("./utf8"),m=p("./compressions"),g=p("./support");function v(b,w){this.options=b,this.loadOptions=w}v.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(b){var w,_;if(b.skip(22),this.fileNameLength=b.readInt(2),_=b.readInt(2),this.fileName=b.readData(this.fileNameLength),b.skip(_),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((w=function(x){for(var E in m)if(Object.prototype.hasOwnProperty.call(m,E)&&m[E].magic===x)return m[E];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,w,b.readData(this.compressedSize))},readCentralPart:function(b){this.versionMadeBy=b.readInt(2),b.skip(2),this.bitFlag=b.readInt(2),this.compressionMethod=b.readString(2),this.date=b.readDate(),this.crc32=b.readInt(4),this.compressedSize=b.readInt(4),this.uncompressedSize=b.readInt(4);var w=b.readInt(2);if(this.extraFieldsLength=b.readInt(2),this.fileCommentLength=b.readInt(2),this.diskNumberStart=b.readInt(2),this.internalFileAttributes=b.readInt(2),this.externalFileAttributes=b.readInt(4),this.localHeaderOffset=b.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");b.skip(w),this.readExtraFields(b),this.parseZIP64ExtraField(b),this.fileComment=b.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var b=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),b==0&&(this.dosPermissions=63&this.externalFileAttributes),b==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var b=h(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=b.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=b.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=b.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=b.readInt(4))}},readExtraFields:function(b){var w,_,x,E=b.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});b.index+4<E;)w=b.readInt(2),_=b.readInt(2),x=b.readData(_),this.extraFields[w]={id:w,length:_,value:x};b.setIndex(E)},handleUTF8:function(){var b=g.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var w=this.findExtraFieldUnicodePath();if(w!==null)this.fileNameStr=w;else{var _=d.transformTo(b,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(_)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var E=d.transformTo(b,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(E)}}},findExtraFieldUnicodePath:function(){var b=this.extraFields[28789];if(b){var w=h(b.value);return w.readInt(1)!==1||c(this.fileName)!==w.readInt(4)?null:f.utf8decode(w.readData(b.length-5))}return null},findExtraFieldUnicodeComment:function(){var b=this.extraFields[25461];if(b){var w=h(b.value);return w.readInt(1)!==1||c(this.fileComment)!==w.readInt(4)?null:f.utf8decode(w.readData(b.length-5))}return null}},y.exports=v},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(p,y,A){function h(w,_,x){this.name=w,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=_,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var d=p("./stream/StreamHelper"),u=p("./stream/DataWorker"),c=p("./utf8"),f=p("./compressedObject"),m=p("./stream/GenericWorker");h.prototype={internalStream:function(w){var _=null,x="string";try{if(!w)throw new Error("No output type specified.");var E=(x=w.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),_=this._decompressWorker();var k=!this._dataBinary;k&&!E&&(_=_.pipe(new c.Utf8EncodeWorker)),!k&&E&&(_=_.pipe(new c.Utf8DecodeWorker))}catch(P){(_=new m("error")).error(P)}return new d(_,x,"")},async:function(w,_){return this.internalStream(w).accumulate(_)},nodeStream:function(w,_){return this.internalStream(w||"nodebuffer").toNodejsStream(_)},_compressWorker:function(w,_){if(this._data instanceof f&&this._data.compression.magic===w.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new c.Utf8EncodeWorker)),f.createWorkerFrom(x,w,_)},_decompressWorker:function(){return this._data instanceof f?this._data.getContentWorker():this._data instanceof m?this._data:new u(this._data)}};for(var g=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],v=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},b=0;b<g.length;b++)h.prototype[g[b]]=v;y.exports=h},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(p,y,A){(function(h){var d,u,c=h.MutationObserver||h.WebKitMutationObserver;if(c){var f=0,m=new c(w),g=h.document.createTextNode("");m.observe(g,{characterData:!0}),d=function(){g.data=f=++f%2}}else if(h.setImmediate||h.MessageChannel===void 0)d="document"in h&&"onreadystatechange"in h.document.createElement("script")?function(){var _=h.document.createElement("script");_.onreadystatechange=function(){w(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},h.document.documentElement.appendChild(_)}:function(){setTimeout(w,0)};else{var v=new h.MessageChannel;v.port1.onmessage=w,d=function(){v.port2.postMessage(0)}}var b=[];function w(){var _,x;u=!0;for(var E=b.length;E;){for(x=b,b=[],_=-1;++_<E;)x[_]();E=b.length}u=!1}y.exports=function(_){b.push(_)!==1||u||d()}}).call(this,typeof i.g<"u"?i.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(p,y,A){var h=p("immediate");function d(){}var u={},c=["REJECTED"],f=["FULFILLED"],m=["PENDING"];function g(E){if(typeof E!="function")throw new TypeError("resolver must be a function");this.state=m,this.queue=[],this.outcome=void 0,E!==d&&_(this,E)}function v(E,k,P){this.promise=E,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof P=="function"&&(this.onRejected=P,this.callRejected=this.otherCallRejected)}function b(E,k,P){h(function(){var D;try{D=k(P)}catch(R){return u.reject(E,R)}D===E?u.reject(E,new TypeError("Cannot resolve promise with itself")):u.resolve(E,D)})}function w(E){var k=E&&E.then;if(E&&(typeof E=="object"||typeof E=="function")&&typeof k=="function")return function(){k.apply(E,arguments)}}function _(E,k){var P=!1;function D(F){P||(P=!0,u.reject(E,F))}function R(F){P||(P=!0,u.resolve(E,F))}var z=x(function(){k(R,D)});z.status==="error"&&D(z.value)}function x(E,k){var P={};try{P.value=E(k),P.status="success"}catch(D){P.status="error",P.value=D}return P}(y.exports=g).prototype.finally=function(E){if(typeof E!="function")return this;var k=this.constructor;return this.then(function(P){return k.resolve(E()).then(function(){return P})},function(P){return k.resolve(E()).then(function(){throw P})})},g.prototype.catch=function(E){return this.then(null,E)},g.prototype.then=function(E,k){if(typeof E!="function"&&this.state===f||typeof k!="function"&&this.state===c)return this;var P=new this.constructor(d);return this.state!==m?b(P,this.state===f?E:k,this.outcome):this.queue.push(new v(P,E,k)),P},v.prototype.callFulfilled=function(E){u.resolve(this.promise,E)},v.prototype.otherCallFulfilled=function(E){b(this.promise,this.onFulfilled,E)},v.prototype.callRejected=function(E){u.reject(this.promise,E)},v.prototype.otherCallRejected=function(E){b(this.promise,this.onRejected,E)},u.resolve=function(E,k){var P=x(w,k);if(P.status==="error")return u.reject(E,P.value);var D=P.value;if(D)_(E,D);else{E.state=f,E.outcome=k;for(var R=-1,z=E.queue.length;++R<z;)E.queue[R].callFulfilled(k)}return E},u.reject=function(E,k){E.state=c,E.outcome=k;for(var P=-1,D=E.queue.length;++P<D;)E.queue[P].callRejected(k);return E},g.resolve=function(E){return E instanceof this?E:u.resolve(new this(d),E)},g.reject=function(E){var k=new this(d);return u.reject(k,E)},g.all=function(E){var k=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=E.length,D=!1;if(!P)return this.resolve([]);for(var R=new Array(P),z=0,F=-1,H=new this(d);++F<P;)$(E[F],F);return H;function $(K,G){k.resolve(K).then(function(j){R[G]=j,++z!==P||D||(D=!0,u.resolve(H,R))},function(j){D||(D=!0,u.reject(H,j))})}},g.race=function(E){var k=this;if(Object.prototype.toString.call(E)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=E.length,D=!1;if(!P)return this.resolve([]);for(var R=-1,z=new this(d);++R<P;)F=E[R],k.resolve(F).then(function(H){D||(D=!0,u.resolve(z,H))},function(H){D||(D=!0,u.reject(z,H))});var F;return z}},{immediate:36}],38:[function(p,y,A){var h={};(0,p("./lib/utils/common").assign)(h,p("./lib/deflate"),p("./lib/inflate"),p("./lib/zlib/constants")),y.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(p,y,A){var h=p("./zlib/deflate"),d=p("./utils/common"),u=p("./utils/strings"),c=p("./zlib/messages"),f=p("./zlib/zstream"),m=Object.prototype.toString,g=0,v=-1,b=0,w=8;function _(E){if(!(this instanceof _))return new _(E);this.options=d.assign({level:v,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:b,to:""},E||{});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 f,this.strm.avail_out=0;var P=h.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(P!==g)throw new Error(c[P]);if(k.header&&h.deflateSetHeader(this.strm,k.header),k.dictionary){var D;if(D=typeof k.dictionary=="string"?u.string2buf(k.dictionary):m.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(P=h.deflateSetDictionary(this.strm,D))!==g)throw new Error(c[P]);this._dict_set=!0}}function x(E,k){var P=new _(k);if(P.push(E,!0),P.err)throw P.msg||c[P.err];return P.result}_.prototype.push=function(E,k){var P,D,R=this.strm,z=this.options.chunkSize;if(this.ended)return!1;D=k===~~k?k:k===!0?4:0,typeof E=="string"?R.input=u.string2buf(E):m.call(E)==="[object ArrayBuffer]"?R.input=new Uint8Array(E):R.input=E,R.next_in=0,R.avail_in=R.input.length;do{if(R.avail_out===0&&(R.output=new d.Buf8(z),R.next_out=0,R.avail_out=z),(P=h.deflate(R,D))!==1&&P!==g)return this.onEnd(P),!(this.ended=!0);R.avail_out!==0&&(R.avail_in!==0||D!==4&&D!==2)||(this.options.to==="string"?this.onData(u.buf2binstring(d.shrinkBuf(R.output,R.next_out))):this.onData(d.shrinkBuf(R.output,R.next_out)))}while((0<R.avail_in||R.avail_out===0)&&P!==1);return D===4?(P=h.deflateEnd(this.strm),this.onEnd(P),this.ended=!0,P===g):D!==2||(this.onEnd(g),!(R.avail_out=0))},_.prototype.onData=function(E){this.chunks.push(E)},_.prototype.onEnd=function(E){E===g&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=E,this.msg=this.strm.msg},A.Deflate=_,A.deflate=x,A.deflateRaw=function(E,k){return(k=k||{}).raw=!0,x(E,k)},A.gzip=function(E,k){return(k=k||{}).gzip=!0,x(E,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(p,y,A){var h=p("./zlib/inflate"),d=p("./utils/common"),u=p("./utils/strings"),c=p("./zlib/constants"),f=p("./zlib/messages"),m=p("./zlib/zstream"),g=p("./zlib/gzheader"),v=Object.prototype.toString;function b(_){if(!(this instanceof b))return new b(_);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},_||{});var x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||_&&_.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&!(15&x.windowBits)&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var E=h.inflateInit2(this.strm,x.windowBits);if(E!==c.Z_OK)throw new Error(f[E]);this.header=new g,h.inflateGetHeader(this.strm,this.header)}function w(_,x){var E=new b(x);if(E.push(_,!0),E.err)throw E.msg||f[E.err];return E.result}b.prototype.push=function(_,x){var E,k,P,D,R,z,F=this.strm,H=this.options.chunkSize,$=this.options.dictionary,K=!1;if(this.ended)return!1;k=x===~~x?x:x===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof _=="string"?F.input=u.binstring2buf(_):v.call(_)==="[object ArrayBuffer]"?F.input=new Uint8Array(_):F.input=_,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new d.Buf8(H),F.next_out=0,F.avail_out=H),(E=h.inflate(F,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&$&&(z=typeof $=="string"?u.string2buf($):v.call($)==="[object ArrayBuffer]"?new Uint8Array($):$,E=h.inflateSetDictionary(this.strm,z)),E===c.Z_BUF_ERROR&&K===!0&&(E=c.Z_OK,K=!1),E!==c.Z_STREAM_END&&E!==c.Z_OK)return this.onEnd(E),!(this.ended=!0);F.next_out&&(F.avail_out!==0&&E!==c.Z_STREAM_END&&(F.avail_in!==0||k!==c.Z_FINISH&&k!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(P=u.utf8border(F.output,F.next_out),D=F.next_out-P,R=u.buf2string(F.output,P),F.next_out=D,F.avail_out=H-D,D&&d.arraySet(F.output,F.output,P,D,0),this.onData(R)):this.onData(d.shrinkBuf(F.output,F.next_out)))),F.avail_in===0&&F.avail_out===0&&(K=!0)}while((0<F.avail_in||F.avail_out===0)&&E!==c.Z_STREAM_END);return E===c.Z_STREAM_END&&(k=c.Z_FINISH),k===c.Z_FINISH?(E=h.inflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===c.Z_OK):k!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(F.avail_out=0))},b.prototype.onData=function(_){this.chunks.push(_)},b.prototype.onEnd=function(_){_===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},A.Inflate=b,A.inflate=w,A.inflateRaw=function(_,x){return(x=x||{}).raw=!0,w(_,x)},A.ungzip=w},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(p,y,A){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";A.assign=function(c){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var m=f.shift();if(m){if(typeof m!="object")throw new TypeError(m+"must be non-object");for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])}}return c},A.shrinkBuf=function(c,f){return c.length===f?c:c.subarray?c.subarray(0,f):(c.length=f,c)};var d={arraySet:function(c,f,m,g,v){if(f.subarray&&c.subarray)c.set(f.subarray(m,m+g),v);else for(var b=0;b<g;b++)c[v+b]=f[m+b]},flattenChunks:function(c){var f,m,g,v,b,w;for(f=g=0,m=c.length;f<m;f++)g+=c[f].length;for(w=new Uint8Array(g),f=v=0,m=c.length;f<m;f++)b=c[f],w.set(b,v),v+=b.length;return w}},u={arraySet:function(c,f,m,g,v){for(var b=0;b<g;b++)c[v+b]=f[m+b]},flattenChunks:function(c){return[].concat.apply([],c)}};A.setTyped=function(c){c?(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(p,y,A){var h=p("./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 c=new h.Buf8(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function m(g,v){if(v<65537&&(g.subarray&&u||!g.subarray&&d))return String.fromCharCode.apply(null,h.shrinkBuf(g,v));for(var b="",w=0;w<v;w++)b+=String.fromCharCode(g[w]);return b}c[254]=c[254]=1,A.string2buf=function(g){var v,b,w,_,x,E=g.length,k=0;for(_=0;_<E;_++)(64512&(b=g.charCodeAt(_)))==55296&&_+1<E&&(64512&(w=g.charCodeAt(_+1)))==56320&&(b=65536+(b-55296<<10)+(w-56320),_++),k+=b<128?1:b<2048?2:b<65536?3:4;for(v=new h.Buf8(k),_=x=0;x<k;_++)(64512&(b=g.charCodeAt(_)))==55296&&_+1<E&&(64512&(w=g.charCodeAt(_+1)))==56320&&(b=65536+(b-55296<<10)+(w-56320),_++),b<128?v[x++]=b:(b<2048?v[x++]=192|b>>>6:(b<65536?v[x++]=224|b>>>12:(v[x++]=240|b>>>18,v[x++]=128|b>>>12&63),v[x++]=128|b>>>6&63),v[x++]=128|63&b);return v},A.buf2binstring=function(g){return m(g,g.length)},A.binstring2buf=function(g){for(var v=new h.Buf8(g.length),b=0,w=v.length;b<w;b++)v[b]=g.charCodeAt(b);return v},A.buf2string=function(g,v){var b,w,_,x,E=v||g.length,k=new Array(2*E);for(b=w=0;b<E;)if((_=g[b++])<128)k[w++]=_;else if(4<(x=c[_]))k[w++]=65533,b+=x-1;else{for(_&=x===2?31:x===3?15:7;1<x&&b<E;)_=_<<6|63&g[b++],x--;1<x?k[w++]=65533:_<65536?k[w++]=_:(_-=65536,k[w++]=55296|_>>10&1023,k[w++]=56320|1023&_)}return m(k,w)},A.utf8border=function(g,v){var b;for((v=v||g.length)>g.length&&(v=g.length),b=v-1;0<=b&&(192&g[b])==128;)b--;return b<0||b===0?v:b+c[g[b]]>v?b:v}},{"./common":41}],43:[function(p,y,A){y.exports=function(h,d,u,c){for(var f=65535&h|0,m=h>>>16&65535|0,g=0;u!==0;){for(u-=g=2e3<u?2e3:u;m=m+(f=f+d[c++]|0)|0,--g;);f%=65521,m%=65521}return f|m<<16|0}},{}],44:[function(p,y,A){y.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(p,y,A){var h=function(){for(var d,u=[],c=0;c<256;c++){d=c;for(var f=0;f<8;f++)d=1&d?3988292384^d>>>1:d>>>1;u[c]=d}return u}();y.exports=function(d,u,c,f){var m=h,g=f+c;d^=-1;for(var v=f;v<g;v++)d=d>>>8^m[255&(d^u[v])];return-1^d}},{}],46:[function(p,y,A){var h,d=p("../utils/common"),u=p("./trees"),c=p("./adler32"),f=p("./crc32"),m=p("./messages"),g=0,v=4,b=0,w=-2,_=-1,x=4,E=2,k=8,P=9,D=286,R=30,z=19,F=2*D+1,H=15,$=3,K=258,G=K+$+1,j=42,N=113,I=1,L=2,U=3,O=4;function Q(se,V){return se.msg=m[V],V}function W(se){return(se<<1)-(4<se?9:0)}function Z(se){for(var V=se.length;0<=--V;)se[V]=0}function J(se){var V=se.state,Ce=V.pending;Ce>se.avail_out&&(Ce=se.avail_out),Ce!==0&&(d.arraySet(se.output,V.pending_buf,V.pending_out,Ce,se.next_out),se.next_out+=Ce,V.pending_out+=Ce,se.total_out+=Ce,se.avail_out-=Ce,V.pending-=Ce,V.pending===0&&(V.pending_out=0))}function ne(se,V){u._tr_flush_block(se,0<=se.block_start?se.block_start:-1,se.strstart-se.block_start,V),se.block_start=se.strstart,J(se.strm)}function ae(se,V){se.pending_buf[se.pending++]=V}function ce(se,V){se.pending_buf[se.pending++]=V>>>8&255,se.pending_buf[se.pending++]=255&V}function q(se,V){var Ce,ve,ye=se.max_chain_length,Ae=se.strstart,me=se.prev_length,be=se.nice_match,we=se.strstart>se.w_size-G?se.strstart-(se.w_size-G):0,Te=se.window,He=se.w_mask,je=se.prev,qe=se.strstart+K,tt=Te[Ae+me-1],mt=Te[Ae+me];se.prev_length>=se.good_match&&(ye>>=2),be>se.lookahead&&(be=se.lookahead);do if(Te[(Ce=V)+me]===mt&&Te[Ce+me-1]===tt&&Te[Ce]===Te[Ae]&&Te[++Ce]===Te[Ae+1]){Ae+=2,Ce++;do;while(Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Te[++Ae]===Te[++Ce]&&Ae<qe);if(ve=K-(qe-Ae),Ae=qe-K,me<ve){if(se.match_start=V,be<=(me=ve))break;tt=Te[Ae+me-1],mt=Te[Ae+me]}}while((V=je[V&He])>we&&--ye!=0);return me<=se.lookahead?me:se.lookahead}function fe(se){var V,Ce,ve,ye,Ae,me,be,we,Te,He,je=se.w_size;do{if(ye=se.window_size-se.lookahead-se.strstart,se.strstart>=je+(je-G)){for(d.arraySet(se.window,se.window,je,je,0),se.match_start-=je,se.strstart-=je,se.block_start-=je,V=Ce=se.hash_size;ve=se.head[--V],se.head[V]=je<=ve?ve-je:0,--Ce;);for(V=Ce=je;ve=se.prev[--V],se.prev[V]=je<=ve?ve-je:0,--Ce;);ye+=je}if(se.strm.avail_in===0)break;if(me=se.strm,be=se.window,we=se.strstart+se.lookahead,Te=ye,He=void 0,He=me.avail_in,Te<He&&(He=Te),Ce=He===0?0:(me.avail_in-=He,d.arraySet(be,me.input,me.next_in,He,we),me.state.wrap===1?me.adler=c(me.adler,be,He,we):me.state.wrap===2&&(me.adler=f(me.adler,be,He,we)),me.next_in+=He,me.total_in+=He,He),se.lookahead+=Ce,se.lookahead+se.insert>=$)for(Ae=se.strstart-se.insert,se.ins_h=se.window[Ae],se.ins_h=(se.ins_h<<se.hash_shift^se.window[Ae+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[Ae+$-1])&se.hash_mask,se.prev[Ae&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=Ae,Ae++,se.insert--,!(se.lookahead+se.insert<$)););}while(se.lookahead<G&&se.strm.avail_in!==0)}function re(se,V){for(var Ce,ve;;){if(se.lookahead<G){if(fe(se),se.lookahead<G&&V===g)return I;if(se.lookahead===0)break}if(Ce=0,se.lookahead>=$&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ce!==0&&se.strstart-Ce<=se.w_size-G&&(se.match_length=q(se,Ce)),se.match_length>=$)if(ve=u._tr_tally(se,se.strstart-se.match_start,se.match_length-$),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=$){for(se.match_length--;se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart,--se.match_length!=0;);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else ve=u._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(ve&&(ne(se,!1),se.strm.avail_out===0))return I}return se.insert=se.strstart<$-1?se.strstart:$-1,V===v?(ne(se,!0),se.strm.avail_out===0?U:O):se.last_lit&&(ne(se,!1),se.strm.avail_out===0)?I:L}function te(se,V){for(var Ce,ve,ye;;){if(se.lookahead<G){if(fe(se),se.lookahead<G&&V===g)return I;if(se.lookahead===0)break}if(Ce=0,se.lookahead>=$&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=$-1,Ce!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ce<=se.w_size-G&&(se.match_length=q(se,Ce),se.match_length<=5&&(se.strategy===1||se.match_length===$&&4096<se.strstart-se.match_start)&&(se.match_length=$-1)),se.prev_length>=$&&se.match_length<=se.prev_length){for(ye=se.strstart+se.lookahead-$,ve=u._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-$),se.lookahead-=se.prev_length-1,se.prev_length-=2;++se.strstart<=ye&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+$-1])&se.hash_mask,Ce=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),--se.prev_length!=0;);if(se.match_available=0,se.match_length=$-1,se.strstart++,ve&&(ne(se,!1),se.strm.avail_out===0))return I}else if(se.match_available){if((ve=u._tr_tally(se,0,se.window[se.strstart-1]))&&ne(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return I}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(ve=u._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<$-1?se.strstart:$-1,V===v?(ne(se,!0),se.strm.avail_out===0?U:O):se.last_lit&&(ne(se,!1),se.strm.avail_out===0)?I:L}function le(se,V,Ce,ve,ye){this.good_length=se,this.max_lazy=V,this.nice_length=Ce,this.max_chain=ve,this.func=ye}function de(){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*F),this.dyn_dtree=new d.Buf16(2*(2*R+1)),this.bl_tree=new d.Buf16(2*(2*z+1)),Z(this.dyn_ltree),Z(this.dyn_dtree),Z(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*D+1),Z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*D+1),Z(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 he(se){var V;return se&&se.state?(se.total_in=se.total_out=0,se.data_type=E,(V=se.state).pending=0,V.pending_out=0,V.wrap<0&&(V.wrap=-V.wrap),V.status=V.wrap?j:N,se.adler=V.wrap===2?0:1,V.last_flush=g,u._tr_init(V),b):Q(se,w)}function ue(se){var V=he(se);return V===b&&function(Ce){Ce.window_size=2*Ce.w_size,Z(Ce.head),Ce.max_lazy_match=h[Ce.level].max_lazy,Ce.good_match=h[Ce.level].good_length,Ce.nice_match=h[Ce.level].nice_length,Ce.max_chain_length=h[Ce.level].max_chain,Ce.strstart=0,Ce.block_start=0,Ce.lookahead=0,Ce.insert=0,Ce.match_length=Ce.prev_length=$-1,Ce.match_available=0,Ce.ins_h=0}(se.state),V}function pe(se,V,Ce,ve,ye,Ae){if(!se)return w;var me=1;if(V===_&&(V=6),ve<0?(me=0,ve=-ve):15<ve&&(me=2,ve-=16),ye<1||P<ye||Ce!==k||ve<8||15<ve||V<0||9<V||Ae<0||x<Ae)return Q(se,w);ve===8&&(ve=9);var be=new de;return(se.state=be).strm=se,be.wrap=me,be.gzhead=null,be.w_bits=ve,be.w_size=1<<be.w_bits,be.w_mask=be.w_size-1,be.hash_bits=ye+7,be.hash_size=1<<be.hash_bits,be.hash_mask=be.hash_size-1,be.hash_shift=~~((be.hash_bits+$-1)/$),be.window=new d.Buf8(2*be.w_size),be.head=new d.Buf16(be.hash_size),be.prev=new d.Buf16(be.w_size),be.lit_bufsize=1<<ye+6,be.pending_buf_size=4*be.lit_bufsize,be.pending_buf=new d.Buf8(be.pending_buf_size),be.d_buf=1*be.lit_bufsize,be.l_buf=3*be.lit_bufsize,be.level=V,be.strategy=Ae,be.method=Ce,ue(se)}h=[new le(0,0,0,0,function(se,V){var Ce=65535;for(Ce>se.pending_buf_size-5&&(Ce=se.pending_buf_size-5);;){if(se.lookahead<=1){if(fe(se),se.lookahead===0&&V===g)return I;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var ve=se.block_start+Ce;if((se.strstart===0||se.strstart>=ve)&&(se.lookahead=se.strstart-ve,se.strstart=ve,ne(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-G&&(ne(se,!1),se.strm.avail_out===0))return I}return se.insert=0,V===v?(ne(se,!0),se.strm.avail_out===0?U:O):(se.strstart>se.block_start&&(ne(se,!1),se.strm.avail_out),I)}),new le(4,4,8,4,re),new le(4,5,16,8,re),new le(4,6,32,32,re),new le(4,4,16,16,te),new le(8,16,32,32,te),new le(8,16,128,128,te),new le(8,32,128,256,te),new le(32,128,258,1024,te),new le(32,258,258,4096,te)],A.deflateInit=function(se,V){return pe(se,V,k,15,8,0)},A.deflateInit2=pe,A.deflateReset=ue,A.deflateResetKeep=he,A.deflateSetHeader=function(se,V){return se&&se.state?se.state.wrap!==2?w:(se.state.gzhead=V,b):w},A.deflate=function(se,V){var Ce,ve,ye,Ae;if(!se||!se.state||5<V||V<0)return se?Q(se,w):w;if(ve=se.state,!se.output||!se.input&&se.avail_in!==0||ve.status===666&&V!==v)return Q(se,se.avail_out===0?-5:w);if(ve.strm=se,Ce=ve.last_flush,ve.last_flush=V,ve.status===j)if(ve.wrap===2)se.adler=0,ae(ve,31),ae(ve,139),ae(ve,8),ve.gzhead?(ae(ve,(ve.gzhead.text?1:0)+(ve.gzhead.hcrc?2:0)+(ve.gzhead.extra?4:0)+(ve.gzhead.name?8:0)+(ve.gzhead.comment?16:0)),ae(ve,255&ve.gzhead.time),ae(ve,ve.gzhead.time>>8&255),ae(ve,ve.gzhead.time>>16&255),ae(ve,ve.gzhead.time>>24&255),ae(ve,ve.level===9?2:2<=ve.strategy||ve.level<2?4:0),ae(ve,255&ve.gzhead.os),ve.gzhead.extra&&ve.gzhead.extra.length&&(ae(ve,255&ve.gzhead.extra.length),ae(ve,ve.gzhead.extra.length>>8&255)),ve.gzhead.hcrc&&(se.adler=f(se.adler,ve.pending_buf,ve.pending,0)),ve.gzindex=0,ve.status=69):(ae(ve,0),ae(ve,0),ae(ve,0),ae(ve,0),ae(ve,0),ae(ve,ve.level===9?2:2<=ve.strategy||ve.level<2?4:0),ae(ve,3),ve.status=N);else{var me=k+(ve.w_bits-8<<4)<<8;me|=(2<=ve.strategy||ve.level<2?0:ve.level<6?1:ve.level===6?2:3)<<6,ve.strstart!==0&&(me|=32),me+=31-me%31,ve.status=N,ce(ve,me),ve.strstart!==0&&(ce(ve,se.adler>>>16),ce(ve,65535&se.adler)),se.adler=1}if(ve.status===69)if(ve.gzhead.extra){for(ye=ve.pending;ve.gzindex<(65535&ve.gzhead.extra.length)&&(ve.pending!==ve.pending_buf_size||(ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),J(se),ye=ve.pending,ve.pending!==ve.pending_buf_size));)ae(ve,255&ve.gzhead.extra[ve.gzindex]),ve.gzindex++;ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),ve.gzindex===ve.gzhead.extra.length&&(ve.gzindex=0,ve.status=73)}else ve.status=73;if(ve.status===73)if(ve.gzhead.name){ye=ve.pending;do{if(ve.pending===ve.pending_buf_size&&(ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),J(se),ye=ve.pending,ve.pending===ve.pending_buf_size)){Ae=1;break}Ae=ve.gzindex<ve.gzhead.name.length?255&ve.gzhead.name.charCodeAt(ve.gzindex++):0,ae(ve,Ae)}while(Ae!==0);ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),Ae===0&&(ve.gzindex=0,ve.status=91)}else ve.status=91;if(ve.status===91)if(ve.gzhead.comment){ye=ve.pending;do{if(ve.pending===ve.pending_buf_size&&(ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),J(se),ye=ve.pending,ve.pending===ve.pending_buf_size)){Ae=1;break}Ae=ve.gzindex<ve.gzhead.comment.length?255&ve.gzhead.comment.charCodeAt(ve.gzindex++):0,ae(ve,Ae)}while(Ae!==0);ve.gzhead.hcrc&&ve.pending>ye&&(se.adler=f(se.adler,ve.pending_buf,ve.pending-ye,ye)),Ae===0&&(ve.status=103)}else ve.status=103;if(ve.status===103&&(ve.gzhead.hcrc?(ve.pending+2>ve.pending_buf_size&&J(se),ve.pending+2<=ve.pending_buf_size&&(ae(ve,255&se.adler),ae(ve,se.adler>>8&255),se.adler=0,ve.status=N)):ve.status=N),ve.pending!==0){if(J(se),se.avail_out===0)return ve.last_flush=-1,b}else if(se.avail_in===0&&W(V)<=W(Ce)&&V!==v)return Q(se,-5);if(ve.status===666&&se.avail_in!==0)return Q(se,-5);if(se.avail_in!==0||ve.lookahead!==0||V!==g&&ve.status!==666){var be=ve.strategy===2?function(we,Te){for(var He;;){if(we.lookahead===0&&(fe(we),we.lookahead===0)){if(Te===g)return I;break}if(we.match_length=0,He=u._tr_tally(we,0,we.window[we.strstart]),we.lookahead--,we.strstart++,He&&(ne(we,!1),we.strm.avail_out===0))return I}return we.insert=0,Te===v?(ne(we,!0),we.strm.avail_out===0?U:O):we.last_lit&&(ne(we,!1),we.strm.avail_out===0)?I:L}(ve,V):ve.strategy===3?function(we,Te){for(var He,je,qe,tt,mt=we.window;;){if(we.lookahead<=K){if(fe(we),we.lookahead<=K&&Te===g)return I;if(we.lookahead===0)break}if(we.match_length=0,we.lookahead>=$&&0<we.strstart&&(je=mt[qe=we.strstart-1])===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]){tt=we.strstart+K;do;while(je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&je===mt[++qe]&&qe<tt);we.match_length=K-(tt-qe),we.match_length>we.lookahead&&(we.match_length=we.lookahead)}if(we.match_length>=$?(He=u._tr_tally(we,1,we.match_length-$),we.lookahead-=we.match_length,we.strstart+=we.match_length,we.match_length=0):(He=u._tr_tally(we,0,we.window[we.strstart]),we.lookahead--,we.strstart++),He&&(ne(we,!1),we.strm.avail_out===0))return I}return we.insert=0,Te===v?(ne(we,!0),we.strm.avail_out===0?U:O):we.last_lit&&(ne(we,!1),we.strm.avail_out===0)?I:L}(ve,V):h[ve.level].func(ve,V);if(be!==U&&be!==O||(ve.status=666),be===I||be===U)return se.avail_out===0&&(ve.last_flush=-1),b;if(be===L&&(V===1?u._tr_align(ve):V!==5&&(u._tr_stored_block(ve,0,0,!1),V===3&&(Z(ve.head),ve.lookahead===0&&(ve.strstart=0,ve.block_start=0,ve.insert=0))),J(se),se.avail_out===0))return ve.last_flush=-1,b}return V!==v?b:ve.wrap<=0?1:(ve.wrap===2?(ae(ve,255&se.adler),ae(ve,se.adler>>8&255),ae(ve,se.adler>>16&255),ae(ve,se.adler>>24&255),ae(ve,255&se.total_in),ae(ve,se.total_in>>8&255),ae(ve,se.total_in>>16&255),ae(ve,se.total_in>>24&255)):(ce(ve,se.adler>>>16),ce(ve,65535&se.adler)),J(se),0<ve.wrap&&(ve.wrap=-ve.wrap),ve.pending!==0?b:1)},A.deflateEnd=function(se){var V;return se&&se.state?(V=se.state.status)!==j&&V!==69&&V!==73&&V!==91&&V!==103&&V!==N&&V!==666?Q(se,w):(se.state=null,V===N?Q(se,-3):b):w},A.deflateSetDictionary=function(se,V){var Ce,ve,ye,Ae,me,be,we,Te,He=V.length;if(!se||!se.state||(Ae=(Ce=se.state).wrap)===2||Ae===1&&Ce.status!==j||Ce.lookahead)return w;for(Ae===1&&(se.adler=c(se.adler,V,He,0)),Ce.wrap=0,He>=Ce.w_size&&(Ae===0&&(Z(Ce.head),Ce.strstart=0,Ce.block_start=0,Ce.insert=0),Te=new d.Buf8(Ce.w_size),d.arraySet(Te,V,He-Ce.w_size,Ce.w_size,0),V=Te,He=Ce.w_size),me=se.avail_in,be=se.next_in,we=se.input,se.avail_in=He,se.next_in=0,se.input=V,fe(Ce);Ce.lookahead>=$;){for(ve=Ce.strstart,ye=Ce.lookahead-($-1);Ce.ins_h=(Ce.ins_h<<Ce.hash_shift^Ce.window[ve+$-1])&Ce.hash_mask,Ce.prev[ve&Ce.w_mask]=Ce.head[Ce.ins_h],Ce.head[Ce.ins_h]=ve,ve++,--ye;);Ce.strstart=ve,Ce.lookahead=$-1,fe(Ce)}return Ce.strstart+=Ce.lookahead,Ce.block_start=Ce.strstart,Ce.insert=Ce.lookahead,Ce.lookahead=0,Ce.match_length=Ce.prev_length=$-1,Ce.match_available=0,se.next_in=be,se.input=we,se.avail_in=me,Ce.wrap=Ae,b},A.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(p,y,A){y.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(p,y,A){y.exports=function(h,d){var u,c,f,m,g,v,b,w,_,x,E,k,P,D,R,z,F,H,$,K,G,j,N,I,L;u=h.state,c=h.next_in,I=h.input,f=c+(h.avail_in-5),m=h.next_out,L=h.output,g=m-(d-h.avail_out),v=m+(h.avail_out-257),b=u.dmax,w=u.wsize,_=u.whave,x=u.wnext,E=u.window,k=u.hold,P=u.bits,D=u.lencode,R=u.distcode,z=(1<<u.lenbits)-1,F=(1<<u.distbits)-1;e:do{P<15&&(k+=I[c++]<<P,P+=8,k+=I[c++]<<P,P+=8),H=D[k&z];t:for(;;){if(k>>>=$=H>>>24,P-=$,($=H>>>16&255)===0)L[m++]=65535&H;else{if(!(16&$)){if(!(64&$)){H=D[(65535&H)+(k&(1<<$)-1)];continue t}if(32&$){u.mode=12;break e}h.msg="invalid literal/length code",u.mode=30;break e}K=65535&H,($&=15)&&(P<$&&(k+=I[c++]<<P,P+=8),K+=k&(1<<$)-1,k>>>=$,P-=$),P<15&&(k+=I[c++]<<P,P+=8,k+=I[c++]<<P,P+=8),H=R[k&F];r:for(;;){if(k>>>=$=H>>>24,P-=$,!(16&($=H>>>16&255))){if(!(64&$)){H=R[(65535&H)+(k&(1<<$)-1)];continue r}h.msg="invalid distance code",u.mode=30;break e}if(G=65535&H,P<($&=15)&&(k+=I[c++]<<P,(P+=8)<$&&(k+=I[c++]<<P,P+=8)),b<(G+=k&(1<<$)-1)){h.msg="invalid distance too far back",u.mode=30;break e}if(k>>>=$,P-=$,($=m-g)<G){if(_<($=G-$)&&u.sane){h.msg="invalid distance too far back",u.mode=30;break e}if(N=E,(j=0)===x){if(j+=w-$,$<K){for(K-=$;L[m++]=E[j++],--$;);j=m-G,N=L}}else if(x<$){if(j+=w+x-$,($-=x)<K){for(K-=$;L[m++]=E[j++],--$;);if(j=0,x<K){for(K-=$=x;L[m++]=E[j++],--$;);j=m-G,N=L}}}else if(j+=x-$,$<K){for(K-=$;L[m++]=E[j++],--$;);j=m-G,N=L}for(;2<K;)L[m++]=N[j++],L[m++]=N[j++],L[m++]=N[j++],K-=3;K&&(L[m++]=N[j++],1<K&&(L[m++]=N[j++]))}else{for(j=m-G;L[m++]=L[j++],L[m++]=L[j++],L[m++]=L[j++],2<(K-=3););K&&(L[m++]=L[j++],1<K&&(L[m++]=L[j++]))}break}}break}}while(c<f&&m<v);c-=K=P>>3,k&=(1<<(P-=K<<3))-1,h.next_in=c,h.next_out=m,h.avail_in=c<f?f-c+5:5-(c-f),h.avail_out=m<v?v-m+257:257-(m-v),u.hold=k,u.bits=P}},{}],49:[function(p,y,A){var h=p("../utils/common"),d=p("./adler32"),u=p("./crc32"),c=p("./inffast"),f=p("./inftrees"),m=1,g=2,v=0,b=-2,w=1,_=852,x=592;function E(j){return(j>>>24&255)+(j>>>8&65280)+((65280&j)<<8)+((255&j)<<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 P(j){var N;return j&&j.state?(N=j.state,j.total_in=j.total_out=N.total=0,j.msg="",N.wrap&&(j.adler=1&N.wrap),N.mode=w,N.last=0,N.havedict=0,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new h.Buf32(_),N.distcode=N.distdyn=new h.Buf32(x),N.sane=1,N.back=-1,v):b}function D(j){var N;return j&&j.state?((N=j.state).wsize=0,N.whave=0,N.wnext=0,P(j)):b}function R(j,N){var I,L;return j&&j.state?(L=j.state,N<0?(I=0,N=-N):(I=1+(N>>4),N<48&&(N&=15)),N&&(N<8||15<N)?b:(L.window!==null&&L.wbits!==N&&(L.window=null),L.wrap=I,L.wbits=N,D(j))):b}function z(j,N){var I,L;return j?(L=new k,(j.state=L).window=null,(I=R(j,N))!==v&&(j.state=null),I):b}var F,H,$=!0;function K(j){if($){var N;for(F=new h.Buf32(512),H=new h.Buf32(32),N=0;N<144;)j.lens[N++]=8;for(;N<256;)j.lens[N++]=9;for(;N<280;)j.lens[N++]=7;for(;N<288;)j.lens[N++]=8;for(f(m,j.lens,0,288,F,0,j.work,{bits:9}),N=0;N<32;)j.lens[N++]=5;f(g,j.lens,0,32,H,0,j.work,{bits:5}),$=!1}j.lencode=F,j.lenbits=9,j.distcode=H,j.distbits=5}function G(j,N,I,L){var U,O=j.state;return O.window===null&&(O.wsize=1<<O.wbits,O.wnext=0,O.whave=0,O.window=new h.Buf8(O.wsize)),L>=O.wsize?(h.arraySet(O.window,N,I-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(L<(U=O.wsize-O.wnext)&&(U=L),h.arraySet(O.window,N,I-L,U,O.wnext),(L-=U)?(h.arraySet(O.window,N,I-L,L,0),O.wnext=L,O.whave=O.wsize):(O.wnext+=U,O.wnext===O.wsize&&(O.wnext=0),O.whave<O.wsize&&(O.whave+=U))),0}A.inflateReset=D,A.inflateReset2=R,A.inflateResetKeep=P,A.inflateInit=function(j){return z(j,15)},A.inflateInit2=z,A.inflate=function(j,N){var I,L,U,O,Q,W,Z,J,ne,ae,ce,q,fe,re,te,le,de,he,ue,pe,se,V,Ce,ve,ye=0,Ae=new h.Buf8(4),me=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!j||!j.state||!j.output||!j.input&&j.avail_in!==0)return b;(I=j.state).mode===12&&(I.mode=13),Q=j.next_out,U=j.output,Z=j.avail_out,O=j.next_in,L=j.input,W=j.avail_in,J=I.hold,ne=I.bits,ae=W,ce=Z,V=v;e:for(;;)switch(I.mode){case w:if(I.wrap===0){I.mode=13;break}for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(2&I.wrap&&J===35615){Ae[I.check=0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0),ne=J=0,I.mode=2;break}if(I.flags=0,I.head&&(I.head.done=!1),!(1&I.wrap)||(((255&J)<<8)+(J>>8))%31){j.msg="incorrect header check",I.mode=30;break}if((15&J)!=8){j.msg="unknown compression method",I.mode=30;break}if(ne-=4,se=8+(15&(J>>>=4)),I.wbits===0)I.wbits=se;else if(se>I.wbits){j.msg="invalid window size",I.mode=30;break}I.dmax=1<<se,j.adler=I.check=1,I.mode=512&J?10:12,ne=J=0;break;case 2:for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(I.flags=J,(255&I.flags)!=8){j.msg="unknown compression method",I.mode=30;break}if(57344&I.flags){j.msg="unknown header flags set",I.mode=30;break}I.head&&(I.head.text=J>>8&1),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0)),ne=J=0,I.mode=3;case 3:for(;ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.head&&(I.head.time=J),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,Ae[2]=J>>>16&255,Ae[3]=J>>>24&255,I.check=u(I.check,Ae,4,0)),ne=J=0,I.mode=4;case 4:for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.head&&(I.head.xflags=255&J,I.head.os=J>>8),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0)),ne=J=0,I.mode=5;case 5:if(1024&I.flags){for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.length=J,I.head&&(I.head.extra_len=J),512&I.flags&&(Ae[0]=255&J,Ae[1]=J>>>8&255,I.check=u(I.check,Ae,2,0)),ne=J=0}else I.head&&(I.head.extra=null);I.mode=6;case 6:if(1024&I.flags&&(W<(q=I.length)&&(q=W),q&&(I.head&&(se=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Array(I.head.extra_len)),h.arraySet(I.head.extra,L,O,q,se)),512&I.flags&&(I.check=u(I.check,L,q,O)),W-=q,O+=q,I.length-=q),I.length))break e;I.length=0,I.mode=7;case 7:if(2048&I.flags){if(W===0)break e;for(q=0;se=L[O+q++],I.head&&se&&I.length<65536&&(I.head.name+=String.fromCharCode(se)),se&&q<W;);if(512&I.flags&&(I.check=u(I.check,L,q,O)),W-=q,O+=q,se)break e}else I.head&&(I.head.name=null);I.length=0,I.mode=8;case 8:if(4096&I.flags){if(W===0)break e;for(q=0;se=L[O+q++],I.head&&se&&I.length<65536&&(I.head.comment+=String.fromCharCode(se)),se&&q<W;);if(512&I.flags&&(I.check=u(I.check,L,q,O)),W-=q,O+=q,se)break e}else I.head&&(I.head.comment=null);I.mode=9;case 9:if(512&I.flags){for(;ne<16;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(J!==(65535&I.check)){j.msg="header crc mismatch",I.mode=30;break}ne=J=0}I.head&&(I.head.hcrc=I.flags>>9&1,I.head.done=!0),j.adler=I.check=0,I.mode=12;break;case 10:for(;ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}j.adler=I.check=E(J),ne=J=0,I.mode=11;case 11:if(I.havedict===0)return j.next_out=Q,j.avail_out=Z,j.next_in=O,j.avail_in=W,I.hold=J,I.bits=ne,2;j.adler=I.check=1,I.mode=12;case 12:if(N===5||N===6)break e;case 13:if(I.last){J>>>=7&ne,ne-=7&ne,I.mode=27;break}for(;ne<3;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}switch(I.last=1&J,ne-=1,3&(J>>>=1)){case 0:I.mode=14;break;case 1:if(K(I),I.mode=20,N!==6)break;J>>>=2,ne-=2;break e;case 2:I.mode=17;break;case 3:j.msg="invalid block type",I.mode=30}J>>>=2,ne-=2;break;case 14:for(J>>>=7&ne,ne-=7≠ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if((65535&J)!=(J>>>16^65535)){j.msg="invalid stored block lengths",I.mode=30;break}if(I.length=65535&J,ne=J=0,I.mode=15,N===6)break e;case 15:I.mode=16;case 16:if(q=I.length){if(W<q&&(q=W),Z<q&&(q=Z),q===0)break e;h.arraySet(U,L,O,q,Q),W-=q,O+=q,Z-=q,Q+=q,I.length-=q;break}I.mode=12;break;case 17:for(;ne<14;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(I.nlen=257+(31&J),J>>>=5,ne-=5,I.ndist=1+(31&J),J>>>=5,ne-=5,I.ncode=4+(15&J),J>>>=4,ne-=4,286<I.nlen||30<I.ndist){j.msg="too many length or distance symbols",I.mode=30;break}I.have=0,I.mode=18;case 18:for(;I.have<I.ncode;){for(;ne<3;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.lens[me[I.have++]]=7&J,J>>>=3,ne-=3}for(;I.have<19;)I.lens[me[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,Ce={bits:I.lenbits},V=f(0,I.lens,0,19,I.lencode,0,I.work,Ce),I.lenbits=Ce.bits,V){j.msg="invalid code lengths set",I.mode=30;break}I.have=0,I.mode=19;case 19:for(;I.have<I.nlen+I.ndist;){for(;le=(ye=I.lencode[J&(1<<I.lenbits)-1])>>>16&255,de=65535&ye,!((te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(de<16)J>>>=te,ne-=te,I.lens[I.have++]=de;else{if(de===16){for(ve=te+2;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(J>>>=te,ne-=te,I.have===0){j.msg="invalid bit length repeat",I.mode=30;break}se=I.lens[I.have-1],q=3+(3&J),J>>>=2,ne-=2}else if(de===17){for(ve=te+3;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}ne-=te,se=0,q=3+(7&(J>>>=te)),J>>>=3,ne-=3}else{for(ve=te+7;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}ne-=te,se=0,q=11+(127&(J>>>=te)),J>>>=7,ne-=7}if(I.have+q>I.nlen+I.ndist){j.msg="invalid bit length repeat",I.mode=30;break}for(;q--;)I.lens[I.have++]=se}}if(I.mode===30)break;if(I.lens[256]===0){j.msg="invalid code -- missing end-of-block",I.mode=30;break}if(I.lenbits=9,Ce={bits:I.lenbits},V=f(m,I.lens,0,I.nlen,I.lencode,0,I.work,Ce),I.lenbits=Ce.bits,V){j.msg="invalid literal/lengths set",I.mode=30;break}if(I.distbits=6,I.distcode=I.distdyn,Ce={bits:I.distbits},V=f(g,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,Ce),I.distbits=Ce.bits,V){j.msg="invalid distances set",I.mode=30;break}if(I.mode=20,N===6)break e;case 20:I.mode=21;case 21:if(6<=W&&258<=Z){j.next_out=Q,j.avail_out=Z,j.next_in=O,j.avail_in=W,I.hold=J,I.bits=ne,c(j,ce),Q=j.next_out,U=j.output,Z=j.avail_out,O=j.next_in,L=j.input,W=j.avail_in,J=I.hold,ne=I.bits,I.mode===12&&(I.back=-1);break}for(I.back=0;le=(ye=I.lencode[J&(1<<I.lenbits)-1])>>>16&255,de=65535&ye,!((te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(le&&!(240&le)){for(he=te,ue=le,pe=de;le=(ye=I.lencode[pe+((J&(1<<he+ue)-1)>>he)])>>>16&255,de=65535&ye,!(he+(te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}J>>>=he,ne-=he,I.back+=he}if(J>>>=te,ne-=te,I.back+=te,I.length=de,le===0){I.mode=26;break}if(32&le){I.back=-1,I.mode=12;break}if(64&le){j.msg="invalid literal/length code",I.mode=30;break}I.extra=15&le,I.mode=22;case 22:if(I.extra){for(ve=I.extra;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.length+=J&(1<<I.extra)-1,J>>>=I.extra,ne-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=23;case 23:for(;le=(ye=I.distcode[J&(1<<I.distbits)-1])>>>16&255,de=65535&ye,!((te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(!(240&le)){for(he=te,ue=le,pe=de;le=(ye=I.distcode[pe+((J&(1<<he+ue)-1)>>he)])>>>16&255,de=65535&ye,!(he+(te=ye>>>24)<=ne);){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}J>>>=he,ne-=he,I.back+=he}if(J>>>=te,ne-=te,I.back+=te,64&le){j.msg="invalid distance code",I.mode=30;break}I.offset=de,I.extra=15&le,I.mode=24;case 24:if(I.extra){for(ve=I.extra;ne<ve;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}I.offset+=J&(1<<I.extra)-1,J>>>=I.extra,ne-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){j.msg="invalid distance too far back",I.mode=30;break}I.mode=25;case 25:if(Z===0)break e;if(q=ce-Z,I.offset>q){if((q=I.offset-q)>I.whave&&I.sane){j.msg="invalid distance too far back",I.mode=30;break}fe=q>I.wnext?(q-=I.wnext,I.wsize-q):I.wnext-q,q>I.length&&(q=I.length),re=I.window}else re=U,fe=Q-I.offset,q=I.length;for(Z<q&&(q=Z),Z-=q,I.length-=q;U[Q++]=re[fe++],--q;);I.length===0&&(I.mode=21);break;case 26:if(Z===0)break e;U[Q++]=I.length,Z--,I.mode=21;break;case 27:if(I.wrap){for(;ne<32;){if(W===0)break e;W--,J|=L[O++]<<ne,ne+=8}if(ce-=Z,j.total_out+=ce,I.total+=ce,ce&&(j.adler=I.check=I.flags?u(I.check,U,ce,Q-ce):d(I.check,U,ce,Q-ce)),ce=Z,(I.flags?J:E(J))!==I.check){j.msg="incorrect data check",I.mode=30;break}ne=J=0}I.mode=28;case 28:if(I.wrap&&I.flags){for(;ne<32;){if(W===0)break e;W--,J+=L[O++]<<ne,ne+=8}if(J!==(4294967295&I.total)){j.msg="incorrect length check",I.mode=30;break}ne=J=0}I.mode=29;case 29:V=1;break e;case 30:V=-3;break e;case 31:return-4;case 32:default:return b}return j.next_out=Q,j.avail_out=Z,j.next_in=O,j.avail_in=W,I.hold=J,I.bits=ne,(I.wsize||ce!==j.avail_out&&I.mode<30&&(I.mode<27||N!==4))&&G(j,j.output,j.next_out,ce-j.avail_out)?(I.mode=31,-4):(ae-=j.avail_in,ce-=j.avail_out,j.total_in+=ae,j.total_out+=ce,I.total+=ce,I.wrap&&ce&&(j.adler=I.check=I.flags?u(I.check,U,ce,j.next_out-ce):d(I.check,U,ce,j.next_out-ce)),j.data_type=I.bits+(I.last?64:0)+(I.mode===12?128:0)+(I.mode===20||I.mode===15?256:0),(ae==0&&ce===0||N===4)&&V===v&&(V=-5),V)},A.inflateEnd=function(j){if(!j||!j.state)return b;var N=j.state;return N.window&&(N.window=null),j.state=null,v},A.inflateGetHeader=function(j,N){var I;return j&&j.state&&2&(I=j.state).wrap?((I.head=N).done=!1,v):b},A.inflateSetDictionary=function(j,N){var I,L=N.length;return j&&j.state?(I=j.state).wrap!==0&&I.mode!==11?b:I.mode===11&&d(1,N,L,0)!==I.check?-3:G(j,N,L,L)?(I.mode=31,-4):(I.havedict=1,v):b},A.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(p,y,A){var h=p("../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],c=[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],f=[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];y.exports=function(m,g,v,b,w,_,x,E){var k,P,D,R,z,F,H,$,K,G=E.bits,j=0,N=0,I=0,L=0,U=0,O=0,Q=0,W=0,Z=0,J=0,ne=null,ae=0,ce=new h.Buf16(16),q=new h.Buf16(16),fe=null,re=0;for(j=0;j<=15;j++)ce[j]=0;for(N=0;N<b;N++)ce[g[v+N]]++;for(U=G,L=15;1<=L&&ce[L]===0;L--);if(L<U&&(U=L),L===0)return w[_++]=20971520,w[_++]=20971520,E.bits=1,0;for(I=1;I<L&&ce[I]===0;I++);for(U<I&&(U=I),j=W=1;j<=15;j++)if(W<<=1,(W-=ce[j])<0)return-1;if(0<W&&(m===0||L!==1))return-1;for(q[1]=0,j=1;j<15;j++)q[j+1]=q[j]+ce[j];for(N=0;N<b;N++)g[v+N]!==0&&(x[q[g[v+N]]++]=N);if(F=m===0?(ne=fe=x,19):m===1?(ne=d,ae-=257,fe=u,re-=257,256):(ne=c,fe=f,-1),j=I,z=_,Q=N=J=0,D=-1,R=(Z=1<<(O=U))-1,m===1&&852<Z||m===2&&592<Z)return 1;for(;;){for(H=j-Q,K=x[N]<F?($=0,x[N]):x[N]>F?($=fe[re+x[N]],ne[ae+x[N]]):($=96,0),k=1<<j-Q,I=P=1<<O;w[z+(J>>Q)+(P-=k)]=H<<24|$<<16|K|0,P!==0;);for(k=1<<j-1;J&k;)k>>=1;if(k!==0?(J&=k-1,J+=k):J=0,N++,--ce[j]==0){if(j===L)break;j=g[v+x[N]]}if(U<j&&(J&R)!==D){for(Q===0&&(Q=U),z+=I,W=1<<(O=j-Q);O+Q<L&&!((W-=ce[O+Q])<=0);)O++,W<<=1;if(Z+=1<<O,m===1&&852<Z||m===2&&592<Z)return 1;w[D=J&R]=U<<24|O<<16|z-_|0}}return J!==0&&(w[z+J]=j-Q<<24|64<<16|0),E.bits=U,0}},{"../utils/common":41}],51:[function(p,y,A){y.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(p,y,A){var h=p("../utils/common"),d=0,u=1;function c(ye){for(var Ae=ye.length;0<=--Ae;)ye[Ae]=0}var f=0,m=29,g=256,v=g+1+m,b=30,w=19,_=2*v+1,x=15,E=16,k=7,P=256,D=16,R=17,z=18,F=[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],$=[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],G=new Array(2*(v+2));c(G);var j=new Array(2*b);c(j);var N=new Array(512);c(N);var I=new Array(256);c(I);var L=new Array(m);c(L);var U,O,Q,W=new Array(b);function Z(ye,Ae,me,be,we){this.static_tree=ye,this.extra_bits=Ae,this.extra_base=me,this.elems=be,this.max_length=we,this.has_stree=ye&&ye.length}function J(ye,Ae){this.dyn_tree=ye,this.max_code=0,this.stat_desc=Ae}function ne(ye){return ye<256?N[ye]:N[256+(ye>>>7)]}function ae(ye,Ae){ye.pending_buf[ye.pending++]=255&Ae,ye.pending_buf[ye.pending++]=Ae>>>8&255}function ce(ye,Ae,me){ye.bi_valid>E-me?(ye.bi_buf|=Ae<<ye.bi_valid&65535,ae(ye,ye.bi_buf),ye.bi_buf=Ae>>E-ye.bi_valid,ye.bi_valid+=me-E):(ye.bi_buf|=Ae<<ye.bi_valid&65535,ye.bi_valid+=me)}function q(ye,Ae,me){ce(ye,me[2*Ae],me[2*Ae+1])}function fe(ye,Ae){for(var me=0;me|=1&ye,ye>>>=1,me<<=1,0<--Ae;);return me>>>1}function re(ye,Ae,me){var be,we,Te=new Array(x+1),He=0;for(be=1;be<=x;be++)Te[be]=He=He+me[be-1]<<1;for(we=0;we<=Ae;we++){var je=ye[2*we+1];je!==0&&(ye[2*we]=fe(Te[je]++,je))}}function te(ye){var Ae;for(Ae=0;Ae<v;Ae++)ye.dyn_ltree[2*Ae]=0;for(Ae=0;Ae<b;Ae++)ye.dyn_dtree[2*Ae]=0;for(Ae=0;Ae<w;Ae++)ye.bl_tree[2*Ae]=0;ye.dyn_ltree[2*P]=1,ye.opt_len=ye.static_len=0,ye.last_lit=ye.matches=0}function le(ye){8<ye.bi_valid?ae(ye,ye.bi_buf):0<ye.bi_valid&&(ye.pending_buf[ye.pending++]=ye.bi_buf),ye.bi_buf=0,ye.bi_valid=0}function de(ye,Ae,me,be){var we=2*Ae,Te=2*me;return ye[we]<ye[Te]||ye[we]===ye[Te]&&be[Ae]<=be[me]}function he(ye,Ae,me){for(var be=ye.heap[me],we=me<<1;we<=ye.heap_len&&(we<ye.heap_len&&de(Ae,ye.heap[we+1],ye.heap[we],ye.depth)&&we++,!de(Ae,be,ye.heap[we],ye.depth));)ye.heap[me]=ye.heap[we],me=we,we<<=1;ye.heap[me]=be}function ue(ye,Ae,me){var be,we,Te,He,je=0;if(ye.last_lit!==0)for(;be=ye.pending_buf[ye.d_buf+2*je]<<8|ye.pending_buf[ye.d_buf+2*je+1],we=ye.pending_buf[ye.l_buf+je],je++,be===0?q(ye,we,Ae):(q(ye,(Te=I[we])+g+1,Ae),(He=F[Te])!==0&&ce(ye,we-=L[Te],He),q(ye,Te=ne(--be),me),(He=H[Te])!==0&&ce(ye,be-=W[Te],He)),je<ye.last_lit;);q(ye,P,Ae)}function pe(ye,Ae){var me,be,we,Te=Ae.dyn_tree,He=Ae.stat_desc.static_tree,je=Ae.stat_desc.has_stree,qe=Ae.stat_desc.elems,tt=-1;for(ye.heap_len=0,ye.heap_max=_,me=0;me<qe;me++)Te[2*me]!==0?(ye.heap[++ye.heap_len]=tt=me,ye.depth[me]=0):Te[2*me+1]=0;for(;ye.heap_len<2;)Te[2*(we=ye.heap[++ye.heap_len]=tt<2?++tt:0)]=1,ye.depth[we]=0,ye.opt_len--,je&&(ye.static_len-=He[2*we+1]);for(Ae.max_code=tt,me=ye.heap_len>>1;1<=me;me--)he(ye,Te,me);for(we=qe;me=ye.heap[1],ye.heap[1]=ye.heap[ye.heap_len--],he(ye,Te,1),be=ye.heap[1],ye.heap[--ye.heap_max]=me,ye.heap[--ye.heap_max]=be,Te[2*we]=Te[2*me]+Te[2*be],ye.depth[we]=(ye.depth[me]>=ye.depth[be]?ye.depth[me]:ye.depth[be])+1,Te[2*me+1]=Te[2*be+1]=we,ye.heap[1]=we++,he(ye,Te,1),2<=ye.heap_len;);ye.heap[--ye.heap_max]=ye.heap[1],function(mt,kt){var ht,yt,Lt,We,Oe,Ke,nt=kt.dyn_tree,Xe=kt.max_code,Ge=kt.stat_desc.static_tree,ze=kt.stat_desc.has_stree,Ct=kt.stat_desc.extra_bits,It=kt.stat_desc.extra_base,Ot=kt.stat_desc.max_length,Ze=0;for(We=0;We<=x;We++)mt.bl_count[We]=0;for(nt[2*mt.heap[mt.heap_max]+1]=0,ht=mt.heap_max+1;ht<_;ht++)Ot<(We=nt[2*nt[2*(yt=mt.heap[ht])+1]+1]+1)&&(We=Ot,Ze++),nt[2*yt+1]=We,Xe<yt||(mt.bl_count[We]++,Oe=0,It<=yt&&(Oe=Ct[yt-It]),Ke=nt[2*yt],mt.opt_len+=Ke*(We+Oe),ze&&(mt.static_len+=Ke*(Ge[2*yt+1]+Oe)));if(Ze!==0){do{for(We=Ot-1;mt.bl_count[We]===0;)We--;mt.bl_count[We]--,mt.bl_count[We+1]+=2,mt.bl_count[Ot]--,Ze-=2}while(0<Ze);for(We=Ot;We!==0;We--)for(yt=mt.bl_count[We];yt!==0;)Xe<(Lt=mt.heap[--ht])||(nt[2*Lt+1]!==We&&(mt.opt_len+=(We-nt[2*Lt+1])*nt[2*Lt],nt[2*Lt+1]=We),yt--)}}(ye,Ae),re(Te,tt,ye.bl_count)}function se(ye,Ae,me){var be,we,Te=-1,He=Ae[1],je=0,qe=7,tt=4;for(He===0&&(qe=138,tt=3),Ae[2*(me+1)+1]=65535,be=0;be<=me;be++)we=He,He=Ae[2*(be+1)+1],++je<qe&&we===He||(je<tt?ye.bl_tree[2*we]+=je:we!==0?(we!==Te&&ye.bl_tree[2*we]++,ye.bl_tree[2*D]++):je<=10?ye.bl_tree[2*R]++:ye.bl_tree[2*z]++,Te=we,tt=(je=0)===He?(qe=138,3):we===He?(qe=6,3):(qe=7,4))}function V(ye,Ae,me){var be,we,Te=-1,He=Ae[1],je=0,qe=7,tt=4;for(He===0&&(qe=138,tt=3),be=0;be<=me;be++)if(we=He,He=Ae[2*(be+1)+1],!(++je<qe&&we===He)){if(je<tt)for(;q(ye,we,ye.bl_tree),--je!=0;);else we!==0?(we!==Te&&(q(ye,we,ye.bl_tree),je--),q(ye,D,ye.bl_tree),ce(ye,je-3,2)):je<=10?(q(ye,R,ye.bl_tree),ce(ye,je-3,3)):(q(ye,z,ye.bl_tree),ce(ye,je-11,7));Te=we,tt=(je=0)===He?(qe=138,3):we===He?(qe=6,3):(qe=7,4)}}c(W);var Ce=!1;function ve(ye,Ae,me,be){ce(ye,(f<<1)+(be?1:0),3),function(we,Te,He,je){le(we),ae(we,He),ae(we,~He),h.arraySet(we.pending_buf,we.window,Te,He,we.pending),we.pending+=He}(ye,Ae,me)}A._tr_init=function(ye){Ce||(function(){var Ae,me,be,we,Te,He=new Array(x+1);for(we=be=0;we<m-1;we++)for(L[we]=be,Ae=0;Ae<1<<F[we];Ae++)I[be++]=we;for(I[be-1]=we,we=Te=0;we<16;we++)for(W[we]=Te,Ae=0;Ae<1<<H[we];Ae++)N[Te++]=we;for(Te>>=7;we<b;we++)for(W[we]=Te<<7,Ae=0;Ae<1<<H[we]-7;Ae++)N[256+Te++]=we;for(me=0;me<=x;me++)He[me]=0;for(Ae=0;Ae<=143;)G[2*Ae+1]=8,Ae++,He[8]++;for(;Ae<=255;)G[2*Ae+1]=9,Ae++,He[9]++;for(;Ae<=279;)G[2*Ae+1]=7,Ae++,He[7]++;for(;Ae<=287;)G[2*Ae+1]=8,Ae++,He[8]++;for(re(G,v+1,He),Ae=0;Ae<b;Ae++)j[2*Ae+1]=5,j[2*Ae]=fe(Ae,5);U=new Z(G,F,g+1,v,x),O=new Z(j,H,0,b,x),Q=new Z(new Array(0),$,0,w,k)}(),Ce=!0),ye.l_desc=new J(ye.dyn_ltree,U),ye.d_desc=new J(ye.dyn_dtree,O),ye.bl_desc=new J(ye.bl_tree,Q),ye.bi_buf=0,ye.bi_valid=0,te(ye)},A._tr_stored_block=ve,A._tr_flush_block=function(ye,Ae,me,be){var we,Te,He=0;0<ye.level?(ye.strm.data_type===2&&(ye.strm.data_type=function(je){var qe,tt=4093624447;for(qe=0;qe<=31;qe++,tt>>>=1)if(1&tt&&je.dyn_ltree[2*qe]!==0)return d;if(je.dyn_ltree[18]!==0||je.dyn_ltree[20]!==0||je.dyn_ltree[26]!==0)return u;for(qe=32;qe<g;qe++)if(je.dyn_ltree[2*qe]!==0)return u;return d}(ye)),pe(ye,ye.l_desc),pe(ye,ye.d_desc),He=function(je){var qe;for(se(je,je.dyn_ltree,je.l_desc.max_code),se(je,je.dyn_dtree,je.d_desc.max_code),pe(je,je.bl_desc),qe=w-1;3<=qe&&je.bl_tree[2*K[qe]+1]===0;qe--);return je.opt_len+=3*(qe+1)+5+5+4,qe}(ye),we=ye.opt_len+3+7>>>3,(Te=ye.static_len+3+7>>>3)<=we&&(we=Te)):we=Te=me+5,me+4<=we&&Ae!==-1?ve(ye,Ae,me,be):ye.strategy===4||Te===we?(ce(ye,2+(be?1:0),3),ue(ye,G,j)):(ce(ye,4+(be?1:0),3),function(je,qe,tt,mt){var kt;for(ce(je,qe-257,5),ce(je,tt-1,5),ce(je,mt-4,4),kt=0;kt<mt;kt++)ce(je,je.bl_tree[2*K[kt]+1],3);V(je,je.dyn_ltree,qe-1),V(je,je.dyn_dtree,tt-1)}(ye,ye.l_desc.max_code+1,ye.d_desc.max_code+1,He+1),ue(ye,ye.dyn_ltree,ye.dyn_dtree)),te(ye),be&&le(ye)},A._tr_tally=function(ye,Ae,me){return ye.pending_buf[ye.d_buf+2*ye.last_lit]=Ae>>>8&255,ye.pending_buf[ye.d_buf+2*ye.last_lit+1]=255&Ae,ye.pending_buf[ye.l_buf+ye.last_lit]=255&me,ye.last_lit++,Ae===0?ye.dyn_ltree[2*me]++:(ye.matches++,Ae--,ye.dyn_ltree[2*(I[me]+g+1)]++,ye.dyn_dtree[2*ne(Ae)]++),ye.last_lit===ye.lit_bufsize-1},A._tr_align=function(ye){ce(ye,2,3),q(ye,P,G),function(Ae){Ae.bi_valid===16?(ae(Ae,Ae.bi_buf),Ae.bi_buf=0,Ae.bi_valid=0):8<=Ae.bi_valid&&(Ae.pending_buf[Ae.pending++]=255&Ae.bi_buf,Ae.bi_buf>>=8,Ae.bi_valid-=8)}(ye)}},{"../utils/common":41}],53:[function(p,y,A){y.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(p,y,A){(function(h){(function(d,u){if(!d.setImmediate){var c,f,m,g,v=1,b={},w=!1,_=d.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(d);x=x&&x.setTimeout?x:d,c={}.toString.call(d.process)==="[object process]"?function(D){process.nextTick(function(){k(D)})}:function(){if(d.postMessage&&!d.importScripts){var D=!0,R=d.onmessage;return d.onmessage=function(){D=!1},d.postMessage("","*"),d.onmessage=R,D}}()?(g="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",P,!1):d.attachEvent("onmessage",P),function(D){d.postMessage(g+D,"*")}):d.MessageChannel?((m=new MessageChannel).port1.onmessage=function(D){k(D.data)},function(D){m.port2.postMessage(D)}):_&&"onreadystatechange"in _.createElement("script")?(f=_.documentElement,function(D){var R=_.createElement("script");R.onreadystatechange=function(){k(D),R.onreadystatechange=null,f.removeChild(R),R=null},f.appendChild(R)}):function(D){setTimeout(k,0,D)},x.setImmediate=function(D){typeof D!="function"&&(D=new Function(""+D));for(var R=new Array(arguments.length-1),z=0;z<R.length;z++)R[z]=arguments[z+1];var F={callback:D,args:R};return b[v]=F,c(v),v++},x.clearImmediate=E}function E(D){delete b[D]}function k(D){if(w)setTimeout(k,0,D);else{var R=b[D];if(R){w=!0;try{(function(z){var F=z.callback,H=z.args;switch(H.length){case 0:F();break;case 1:F(H[0]);break;case 2:F(H[0],H[1]);break;case 3:F(H[0],H[1],H[2]);break;default:F.apply(u,H)}})(R)}finally{E(D),w=!1}}}}function P(D){D.source===d&&typeof D.data=="string"&&D.data.indexOf(g)===0&&k(+D.data.slice(g.length))}})(typeof self>"u"?h===void 0?this:h:self)}).call(this,typeof i.g<"u"?i.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})},"./src/tctwins-bim-viewer.css"(s,C,i){i.r(C)},"./node_modules/strnum/strnum.js"(s){const C=/^[-+]?0x[a-fA-F0-9]+$/,i=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,p={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function y(d,u={}){if(u=Object.assign({},p,u),!d||typeof d!="string")return d;let c=d.trim();if(u.skipLike!==void 0&&u.skipLike.test(c))return d;if(d==="0")return 0;if(u.hex&&C.test(c))return h(c,16);if(c.search(/[eE]/)!==-1){const f=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(f){if(u.leadingZeros)c=(f[1]||"")+f[3];else if(!(f[2]==="0"&&f[3][0]==="."))return d;return u.eNotation?Number(c):d}else return d}else{const f=i.exec(c);if(f){const m=f[1],g=f[2];let v=A(f[3]);if(!u.leadingZeros&&g.length>0&&m&&c[2]!==".")return d;if(!u.leadingZeros&&g.length>0&&!m&&c[1]!==".")return d;if(u.leadingZeros&&g===d)return 0;{const b=Number(c),w=""+b;return w.search(/[eE]/)!==-1?u.eNotation?b:d:c.indexOf(".")!==-1?w==="0"&&v===""||w===v||m&&w==="-"+v?b:d:g?v===w||m+v===w?b:d:c===w||c===m+w?b: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")}s.exports=y},"./src/BIMXViewer.ts"(s,C,i){i.r(C),i.d(C,{default:()=>G});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/messages.ts"),A=i("./src/EventTrigger.ts"),h=i("./src/Controller.ts"),d=i("./src/toolbar/ResetAction.ts"),u=i("./src/toolbar/FitAction.ts"),c=i("./src/toolbar/FirstPersonMode.ts"),f=i("./src/toolbar/HideTool.ts"),m=i("./src/toolbar/ShowSpacesMode.ts"),g=i("./src/toolbar/SectionTool.ts"),v=i("./src/toolbar/NavCubeMode.ts"),b=i("./src/explorer/ModelsExplorer.ts"),w=i("./src/explorer/ObjectsExplorer.ts"),_=i("./src/explorer/ClassesExplorer.ts"),x=i("./src/explorer/StoreysExplorer.ts"),E=i("./src/toolbar/ThreeDMode.ts"),k=i("./src/toolbar/OrthoMode.ts"),P=i("./src/toolbar/AnnotationTool.ts"),D=i("./src/toolbar/MarkerTool.ts"),R=i("./src/toolbar/MeasureTool.ts"),z=i("./src/toolbar/CommentsTool.ts"),F=i("./src/server/Server.ts"),H=i("./src/toolbar/SkyBoxTool.ts"),$=i("./src/toolbar/BCFTool.ts"),K=function(j,N,I,L){function U(O){return O instanceof I?O:new I(function(Q){Q(O)})}return new(I||(I=Promise))(function(O,Q){function W(ne){try{J(L.next(ne))}catch(ae){Q(ae)}}function Z(ne){try{J(L.throw(ne))}catch(ae){Q(ae)}}function J(ne){ne.done?O(ne.value):U(ne.value).then(W,Z)}J((L=L.apply(j,N||[])).next())})};class G extends h.default{constructor(N={}){if(!N.canvasElement)throw new Error("Config expected: canvasElement");if(!N.navCubeCanvasElement)throw new Error("Config expected: navCubeCanvasElement");const{canvasElement:I}=N,{viewerElement:L}=N,U=new p.LocaleService({messages:y.default,locale:"ch"}),O=new p.Viewer({passes:5,localeService:U,canvasElement:I,viewerElement:L,snapRadius:N.snapRadius,antialias:N.viewer_cfg.antialias,saoEnabled:N.viewer_cfg.saoEnabled,pbrEnabled:N.viewer_cfg.pbrEnabled,dtxEnabled:N.viewer_cfg.dtxEnabled,transparent:N.viewer_cfg.transparent,edgesEnabled:N.viewer_cfg.edgesEnabled,alphaDepthMask:N.viewer_cfg.alphaDepthMask,premultipliedAlpha:N.viewer_cfg.premultipliedAlpha,colorTextureEnabled:N.viewer_cfg.colorTextureEnabled,backgroundColorFromAmbientLight:N.viewer_cfg.backgroundColorFromAmbientLight,resolutionScale:window.devicePixelRatio,spinnerElementId:"engine_spinner"}),Q=new F.default({dataDir:"./data",filePath:"testdemo"});super(null,N,Q,O),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((ae,ce)=>{try{this.viewer.scene.camera.orbitYaw(ne),ae()}catch(q){ce(q)}}),this.cameraEnable=(ne=!this.viewer.cameraControl.pointerEnabled)=>{this.viewer.cameraControl.pointerEnabled=ne},this.shot=(ne,ae,ce)=>{const q=document.getElementById("myCanvas"),fe=document.createElement("a");fe.download="screenshot.png";const re=document.createElement("canvas"),te=re.getContext("2d");if(q&&te){re.width=ne,re.height=ae;const le=ne/q.width,de=ae/q.height,he=Math.max(le,de);return q.width*he,q.height*he,te.clearRect(0,0,ne,ae),te.fillStyle="transparent",te.fillRect(0,0,ne,ae),te.drawImage(q,0,0,q.width,q.height,0,0,1,1),ce&&re.toBlob(ue=>{const pe=URL.createObjectURL(ue);fe.href=pe,fe.click(),URL.revokeObjectURL(pe)}),re.toDataURL("image/png")}return""},this._configs={},this._eventTrigger=new A.default,this.navCubeCanvasElement=N.navCubeCanvasElement,this.viewerElement=N.viewerElement,this._multiModel=N.multiModel?N.multiModel:!1,this._hasOutlier=!1,this._outlierObjectIds=[],this._projectId=N.projectId?N.projectId:"",this.viewer=O,(N.skyBoxImage||N.skyBoxSrc)&&(this._skyBoxTool=new H.default(this,{skyBoxImage:N.skyBoxImage,skyBoxSrc:N.skyBoxSrc})),this._modelsExplorer=new b.default(this,{enableEditModels:!1,modelFromOutSide:!0,modelSrc:N.modelSrc?N.modelSrc:"/",modelConfig:N.modelConfig,IfcAPI:N.IfcAPI,WebIFC:N.WebIFC,multiModel:this._multiModel}),this._objectsExplorer=new w.default(this,{modelType:N.modelType}),this._classesExplorer=new _.default(this,{modelType:N.modelType}),this._storeysExplorer=new x.default(this,{modelType:N.modelType}),this._resetAction=new d.default(this,{}),this._fitAction=new u.default(this,{});class W{constructor(ae){this.threeDActive=!1,this.firstPersonActive=!1,this.setThreeDModeActive=ce=>{ce?(ae._firstPersonMode.setActive(!1),ae.viewer.cameraControl.navMode="orbit"):(ae._firstPersonMode.setActive(!1),ae.viewer.cameraControl.navMode="planView"),this.threeDActive=ce},this.setFirstPersonModeActive=ce=>{ae.viewer.cameraControl.navMode=ce?"firstPerson":this.threeDActive?"orbit":"planView",this.firstPersonActive=ce}}}const Z=new W(this);this._threeDMode=new E.default(this,{cameraControlNavModeMediator:Z}),this._orthoMode=new k.default(this,{}),this._firstPersonMode=new c.default(this,{cameraControlNavModeMediator:Z}),this._hideTool=new f.default(this,{}),this._annotationTool=new P.default(this,{modelId:this._projectId}),this._markerTool=new D.default(this,{}),this._measureTool=new R.default(this,{}),this._sectionTool=new g.default(this,{}),this._commentsTool=new z.default(this,{}),this._showSpacesMode=new m.default(this,{}),this._navCubeMode=new v.default(this,{navCubeCanvasElement:this.navCubeCanvasElement,viewerElement:this.viewerElement}),this._bcfTool=new $.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 J=0;this.eventTrigger.on("treeReady",()=>{J++,J%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(N){this._disableClickEvent=N}get disableClickEvent(){return this._disableClickEvent}get edgesActive(){return this._edgesActive}_initSingleClickEvent(){this.viewer.cameraControl.on("mouseDownEntity",N=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I&&I.entity&&(this.singleChoseEntity(I.entity),this._eventTrigger.emit("pickedEntity",I.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",N=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I&&I.entity&&(this._eventTrigger.emit("touchEntity",I.entity),this.singleChoseEntity(I.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",N=>{N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I?this._eventTrigger.emit("rightPicked",I.entity):this._eventTrigger.emit("rightPickedNothing")})}_initDoubleClickEvent(){this.viewer.cameraControl.on("doublePicked",N=>{if(this.measureTool.getActive()||this.sectionTool.getActive()||this.annotationTool.getActive()||this._markerTool.getActive())return;N.preventDefault;const I=this.viewer.scene.pick({canvasPos:N.canvasPos});I&&I.entity&&(this.doubleChoseEntity(I.entity),this._eventTrigger.emit("doublePicked",I.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:N}=this.viewer;N.pointsMaterial.pointSize=1,N.pointsMaterial.roundPoints=!0,N.pointsMaterial.perspectivePoints=!0,N.pointsMaterial.minPerspectivePointSize=2,N.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 I=document.createRange().createContextualFragment("<div class='tctwins-camera-pivot-marker'></div>").firstChild;this.viewer.scene.canvas.canvas.parentNode.appendChild(I),this.viewer.cameraControl.pivotElement=I;const{sao:L}=N;L.enabled=!1,L.numSamples=50,L.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(N){for(const I in N)if(Object.prototype.hasOwnProperty.call(N,I)){const L=N[I];this.setConfig(I,L)}}setConfig(N,I){function L(U){return U===!0||U==="true"}try{switch(N){case"backgroundTransparency":const U=I;this.setBackgroundTransparent(U),this._configs[N]=U;break;case"backgroundColor":if(this._configs.backgroundTransparency)break;const O=I;this.setBackgroundColor(O),this._configs[N]=O;break;case"smartPivot":this.viewer.cameraControl.smartPivot=this._configs[N]=L(I);break;case"saoEnabled":this.viewer.scene.saoEnabled=this._configs[N]=L(I);break;case"saoBias":this.viewer.scene.sao.bias=parseFloat(I);break;case"saoIntensity":this.viewer.scene.sao.intensity=parseFloat(I);break;case"saoKernelRadius":this.viewer.scene.sao.kernelRadius=this._configs[N]=parseFloat(I);break;case"saoNumSamples":this.viewer.scene.sao.numSamples=this._configs[N]=parseFloat(I);break;case"saoBlur":this.viewer.scene.sao.blur=this._configs[N]=L(I);break;case"edgesEnabled":this.setEdgesEnabled(I);break;case"pbrEnabled":break;case"viewFitFOV":this.viewer.cameraFlight.fitFOV=this._configs[N]=parseFloat(I);break;case"viewFitDuration":this.viewer.cameraFlight.duration=this._configs[N]=parseFloat(I);break;case"perspectiveFOV":this.viewer.camera.perspective.fov=this._configs[N]=parseFloat(I);break;case"excludeUnclassifiedObjects":this._configs[N]=L(I);break;case"objectColorSource":this.setObjectColorSource(I),this._configs[N]=I;break;case"xrayContext":this._configs[N]=I;break;case"xrayPickable":this._configs[N]=L(I);break;case"externalMetadata":this._configs[N]=I;break;case"showSpaces":this._showSpacesMode.setActive(I);break;case"dtxEnabled":this._configs[N]=L(I),this.viewer.scene.dtxEnabled=I;break;case"snapRadius":this.setSnapRadius(I);break;default:this.error(`setConfig() - unsupported configuration: '${N}'`)}}catch(U){this.error(`setConfig() - failed to configure ${N}: ${U}`)}}getConfig(N){return this._configs[N]}getConfigs(){return this._configs}projectId(){return this._projectId}loadModel(N,I,L=()=>{},U=()=>{},O){this._modelNum+=1,!this._multiModel&&this._modelNum>1&&(this._multiModel=!0),this._multiModel||(this._projectId=N),this._modelsExplorer.loadModel(N,I,L,U,O)}unloadModel(N){if(!this.viewer.scene.models[N]){this.error("unloadModel() - Model not loaded: "+N);return}this._modelsExplorer.unloadModel(N);const I=Object.keys(this.viewer.scene.models);this._modelNum=I.length,I.length>1?(this._multiModel=!0,this._projectId=""):(this._multiModel=!1,this._projectId=I.length===1?I[0]:"")}_resolveModelId(N){if(N!=null&&N!=="")return N;if(this._projectId)return this._projectId;const I=Object.keys(this.viewer.scene.models);if(I.length===1)return I[0]}focusModel(N,I){const L=this._resolveModelId(N);return this.viewer.focusModel(L,I)}loadMetadata(N,I,L=!0,U=()=>{}){this._modelsExplorer.loadMetadata(N,I,L,()=>{this._metaLoaded=!0,this._focusPartial&&this.viewFitPartial(0,U)})}setObjectColorSource(N){switch(N){case"model":break;case"viewer":break;default:N="model",this.error("setObjectColorSource() - Unsupported value - accepted values are 'model' and 'viewer' - defaulting to 'model'");return}this._objectColorSource=N}getObjectProperties(N){const I=this.viewer.metaScene.metaObjects[N];if(!I)return null;const L={id:I.id,name:I.name,type:I.type,propertySets:[]},{propertySets:U}=I;if(U&&U.length>0)for(let O=0;O<U.length;O++){const{properties:Q}=U[O],W=[];for(let J=0;J<Q.length;J++){const ne={};ne[Q[J].name]=Q[J].value,W.push(ne)}const Z={id:U[O].id,name:U[O].name,properties:W,type:U[O].type};L.propertySets.push(Z)}return L}getModelInfo(N){const I=this.viewer.metaScene.metaModels[N];return{id:I.id,createDate:I.createdAt?I.createdAt:"",author:I.author?I.author:"",objectCount:I.objectCount?I.objectCount:"",propertySetCount:I.propertySetCount?I.propertySetCount:""}}getMetaModel(N){return this.viewer.metaScene.metaModels[N]}getSceneModel(N){return this.viewer.scene.models[N]}_withObjectsInSubtree(N,I=()=>{}){if(!N){this.error("Argument expected: objectIds");return}N.forEach(L=>{this.viewer.metaScene.withMetaObjectsInSubtree(L,U=>{const O=this.viewer.scene.objects[U.id];O&&I(O)})})}_withObjects(N,I=()=>{}){N.forEach(L=>{const U=this.viewer.scene.objects[L];I(U)})}flyToObject(N,I=()=>{}){if(!N){this.error("flyToObject() - Argument expected: objectId");return}const{viewer:L}=this,{scene:U}=L,O=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(N,W=>{U.objects[W.id]&&O.push(W.id)}),O.length===0){this.error(`Object not found in viewer: '${N}'`),I&&I();return}U.setObjectsVisible(O,!0);const Q=U.getAABB(O);L.cameraFlight.flyTo({aabb:Q},()=>{I&&I(),setTimeout(()=>{U.setObjectsHighlighted(U.highlightedObjectIds,!1)},500)}),L.cameraControl.pivotPos=p.math.getAABB3Center(Q)}viewFitObjects(N,I=()=>{}){if(!N){this.error("viewFitObjects() - Argument expected: objectIds");return}const{viewer:L}=this,{scene:U}=L;U.setObjectsVisible(N,!0);const O=U.getAABB(N);L.cameraFlight.flyTo({aabb:O},()=>{I&&I()}),L.cameraControl.pivotPos=p.math.getAABB3Center(O)}jumpToObjects(N){if(!N){this.error("jumpToObject() - Argument expected: objectIds");return}const{viewer:I}=this,{scene:L}=I,U=[];if(this.viewer.metaScene.withMetaObjectsInSubtree(N,Q=>{L.objects[Q.id]&&U.push(Q.id)}),U.length===0){this.error(`Objects not found in viewer: '${N}'`);return}L.setObjectsVisible(U,!0);const O=L.getAABB(U);I.cameraFlight.jumpTo({aabb:O}),I.cameraControl.pivotPos=p.math.getAABB3Center(O)}setCamera(N){const{viewer:I}=this,{scene:L}=I,{camera:U}=L;N.eye&&(U.eye=N.eye),N.look&&(U.look=N.look),N.up&&(U.up=N.up)}getCameraView(){return{eye:this.viewer.scene.camera.eye,look:this.viewer.scene.camera.look,up:this.viewer.scene.camera.up}}flyToNewView(N){this.viewer.cameraControl.pivotPos=N.look,this.viewer.cameraFlight.flyTo({look:N.look,eye:N.eye,up:N.up,duration:N.duration})}flyToObjectFromDirection(N,I,L,U=()=>{}){const O=this.viewer.scene.objects[N];if(!O){this.error(`flyToObjectFromDirection() - Object not found in viewer: '${N}'`),U&&U();return}const Q=this._resolveViewDirection(I);if(!Q){this.error(`flyToObjectFromDirection() - Invalid direction: '${I}'`),U&&U();return}const W=p.math.getAABB3Center(O.aabb,[]),Z=[W[0]+Q[0]*L,W[1]+Q[1]*L,W[2]+Q[2]*L],J=Math.abs(Q[1])>.9?[0,0,1]:[0,1,0];this.viewer.cameraFlight.flyTo({eye:Z,look:W,up:J},()=>{U&&U()}),this.viewer.cameraControl.pivotPos=W}_resolveViewDirection(N){const I={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 L;if(typeof N=="string"){if(L=I[N.toLowerCase()],!L)return null}else if(Array.isArray(N)&&N.length>=3)L=[N[0],N[1],N[2]];else return null;const U=Math.sqrt(L[0]*L[0]+L[1]*L[1]+L[2]*L[2]);return U===0?null:[L[0]/U,L[1]/U,L[2]/U]}viewFitModels(N,I=()=>{}){if(!N){this.error("viewFitModels() - Argument expected: modelIds");return}const{viewer:L}=this,{scene:U}=L,O=p.math.AABB3();p.math.collapseAABB3(O),N.forEach(Q=>{const W=U.models[Q];W?(W.visible=!0,W.highlighted=!0,p.math.expandAABB3(O,W.aabb)):this.error(`Model not found in viewer: '${Q}'`)}),I?L.cameraFlight.flyTo({aabb:O},()=>{I(),setTimeout(()=>{U.setObjectsHighlighted(U.highlightedObjectIds,!1)},500)}):(L.cameraFlight.jumpTo({aabb:O}),setTimeout(()=>{U.setObjectsHighlighted(U.highlightedObjectIds,!1)},500)),L.cameraControl.pivotPos=p.math.getAABB3Center(O)}viewFitPartial(N,I){let L;typeof N=="function"?(I=N,L=this._partialFocusIndex+=1):L=N??(this._partialFocusIndex+=1),L>=0&&L<this._partialObjectIds.length?this.viewFitObjects(this._partialObjectIds[L],()=>{for(let U=0;U<this._partialObjectIds.length;U++)L==U?this.setObjectsVisible(this._partialObjectIds[U],!0):this.setObjectsVisible(this._partialObjectIds[U],!1);I&&I(L)}):(L=this._partialFocusIndex=0,this.viewFitObjects(this._partialObjectIds[L],()=>{for(let U=0;U<this._partialObjectIds.length;U++)L==U?this.setObjectsVisible(this._partialObjectIds[U],!0):this.setObjectsVisible(this._partialObjectIds[U],!1);I&&I(L)}))}setPartialObjectIds(N){const I=[];for(let L=0;L<N.length;L++)I.push(N[L]);this._partialObjectIds=I,this.viewer.cameraControl.smartPivot=!1,this.navCubeMode.fitVisible=!0,this._focusPartial=!0,this._metaLoaded&&this.viewFitPartial(0)}selectStorey(N,I=()=>{}){const{metaScene:L}=this.viewer,U=L.metaObjects[N];if(!U){this.error(`selectStorey() - Object is not found: '${N}'`);return}if(U.type!=="IfcBuildingStorey"){this.error(`selectStorey() - Object is not an IfcBuildingStorey: '${N}'`);return}this._storeysExplorer.selectStorey(N,I)}setKeyboardEnabled(N){this.viewer.scene.input.keyboardEnabled=N}getKeyboardEnabled(){return this.viewer.scene.input.keyboardEnabled}showSpinner(N=!this.viewer.scene.canvas.spinner.visible){this.viewer.scene.canvas.spinner.visible=N}updateAABB(N,I=()=>{}){N.length>0&&(this._hasOutlier=!0,this._outlierObjectIds=N);const L=this._resolveModelId(),U=L!==void 0?this.viewer.scene.models[L]:void 0;if(!U){this.error("updateAABB() - No model available for the current scene"),typeof I=="function"&&I();return}const O=N.concat(U.exceptionIds);U.exceptionIds=O,this.viewer.scene.setObjectsVisible(O,!1),this.viewer.scene.on("aabb",()=>{typeof I=="function"&&I()})}closeAll(){this.fire("closeAll",!0),this.disableClickEvent=!1}destroy(N=()=>{}){var I;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 L=document.querySelector(".tctwins-camera-pivot-marker");L&&((I=L.parentNode)===null||I===void 0||I.removeChild(L)),this.viewer.destroy(N)}getEntityById(N){return this.viewer.scene.objects[N]}setEntitySelected(N,I=!N.selected){N.selected=I}setObjectsSelected(N,I){this._withObjects(N,L=>{L.selected=I})}setOthersSelected(N){this.setAllObjectsSelected(!0),this.setEntitySelected(N,!0)}setAllObjectsSelected(N){N?this.viewer.scene.setObjectsSelected(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsSelected(this.viewer.scene.selectedObjectIds,!1)}viewFitEntity(N){this.viewer.cameraFlight.flyTo({aabb:N.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=p.math.getAABB3Center(N.aabb)}viewFitEntityById(N){this._withObjects([N],I=>{this.viewer.cameraFlight.flyTo({aabb:I.aabb,duration:.5}),this.viewer.cameraControl.pivotPos=p.math.getAABB3Center(I.aabb)})}viewFitSelectedObjects(){this.viewFitObjects(this.viewer.scene.highlightedObjectIds,()=>{})}viewFitAll(N=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,N);return}this._fitAction.fit(N)}setEntityVisible(N,I=!N.visible){N.visible=I}setObjectsVisible(N,I){this._withObjects(N,L=>{L.visible=I})}setOthersHide(N){const I=this.viewer.metaScene.metaObjects[N.id];I&&(this.viewer.scene.setObjectsVisible(this.viewer.scene.visibleObjectIds,!1),I.withMetaObjectsInSubtree(L=>{const U=this.viewer.scene.objects[L.id];U&&(U.visible=!0)}))}setAllObjectsVisible(N){N?(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(N,I=!N.xrayed){N.xrayed=I}setObjectsXRayed(N,I){this._withObjects(N,L=>{L.xrayed=I})}setOthersXRayed(N){const{scene:I}=this.viewer,L=this.viewer.metaScene.metaObjects[N.id];L&&(I.setObjectsVisible(I.objectIds,!0),I.setObjectsXRayed(I.objectIds,!0),L.withMetaObjectsInSubtree(U=>{const O=I.objects[U.id];O&&(O.xrayed=!1)}))}setAllObjectsXRayed(N){N?this.viewer.scene.setObjectsXRayed(this.viewer.scene.objectIds,!0):this.viewer.scene.setObjectsXRayed(this.viewer.scene.xrayedObjectIds,!1)}setEntityHighlighted(N,I=!N.highlighted){N.highlighted=I,N.origin_opacity!=-1&&(N.highlighted?N.opacity=N.opacity<1?N.opacity:.01:N.opacity=N.origin_opacity)}setAllObjectsHighlighted(N){N?(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.objectIds,!0),this.viewer.scene.withObjects(this.viewer.scene.objectIds,I=>{I.origin_opacity,I.opacity=I.opacity<.5?I.opacity:.01})):(this.viewer.scene.setObjectsHighlighted(this.viewer.scene.highlightedObjectIds,!1),this.viewer.scene.withObjects(this.viewer.scene.objectIds,I=>{I.opacity=I.origin_opacity}))}setEntityEdges(N,I=!N.edges){N.edges=I}setObjectsEdges(N,I){this.viewer.scene.withObjects(N,L=>{L.edges=I}),this.viewer.scene.render(!0)}setAllObjectsEdges(N=!this._edgesActive){this._edgesActive=N,this.viewer.scene.withObjects(this.viewer.scene.objectIds,I=>{I.edges=N}),this.viewer.scene.render(!0)}setEntityColor(N,I){this.viewer.scene.setObjectsColorized([N],I),this.viewer.scene.render(!0)}setObjectsColor(N,I){this.viewer.scene.setObjectsColorized(N,I),this.viewer.scene.render(!0)}resetEntityColor(N){this.viewer.scene.setObjectsColorized([N],null)}setModelBrightness(N,I=1){const L=this._resolveModelId(N);if(L===void 0){this.error("setModelBrightness() - Model not found: "+N);return}const U=this.viewer.scene.models[L];if(!U){this.error("setModelBrightness() - Model not loaded: "+L);return}U.brightness=I,this.viewer.scene.render(!0)}getModelBrightness(N){const I=this._resolveModelId(N);if(I===void 0){this.error("getModelBrightness() - Model not found: "+N);return}const L=this.viewer.scene.models[I];if(!L){this.error("getModelBrightness() - Model not loaded: "+I);return}return L.brightness}entityVisble(N){return N.visible}entityXRayed(N){return N.xrayed}entityChosed(N){return N.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(N=!this.viewer.scene.backgroundTransparent){this.viewer.scene.backgroundTransparent=N,this.viewer.scene.render(!0)}setBackgroundColor(N){this.viewer.scene.backgroundColor=N,this.viewer.scene.render(!0)}setNavCubeSize(N){this.navCubeCanvasElement.style.width=`${N.toString()}px`,this.navCubeCanvasElement.style.height=`${N.toString()}px`}setNavCubePosition(N,I){switch(N){case"top":this.navCubeCanvasElement.style.top=`${I.toString()}px`,this.navCubeCanvasElement.style.bottom="";break;case"bottom":this.navCubeCanvasElement.style.top="",this.navCubeCanvasElement.style.bottom=`${I.toString()}px`;break;case"right":this.navCubeCanvasElement.style.left="",this.navCubeCanvasElement.style.right=`${I.toString()}px`;break;case"left":this.navCubeCanvasElement.style.right="",this.navCubeCanvasElement.style.left=`${I.toString()}px`;break}}updateCanvas(){this.viewer.scene.canvas.dirtyBoundary=!0}setMeasureOffSet(N,I){this._measureTool.setMeasureOffSet(N,I)}setCommentsOffset(N,I){this._commentsTool.offsetX=N,this._commentsTool.offsetY=I}setSnapRadius(N){this.measureTool.setSnapRadius(N)}setIsTouch(N){this.measureTool.isTouch=N,this.sectionTool.isTouch=N,this.commentTool.isTouch=N}setLightIntensity(N){if(!(N<0||N>100))for(const I in this.viewer.scene.lightsObject)this.viewer.scene.lightsObject[I].intensity=.6+(N-50)/200}setSpaceMaterialColor(N){N===1?this.viewer.scene.highlightMaterial.fillColor=[.6,.7,.8]:N===2&&(this.viewer.scene.highlightMaterial.fillColor=[.2,.3,.4])}setWorldAxisYDown(N){this._worldAxisYDown=N,N?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(N){this._worldAxisZUp=N,N?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(N=!this.viewer.scene.edgesEnabled){this.viewer.scene.edgesEnabled=N,this.viewer.scene.render(!0)}setSAOEnabled(N=!this.viewer.scene.saoEnabled){this.viewer.scene.saoEnabled=N}setDTXEnabled(N=!this.viewer.scene.dtxEnabled){this.viewer.scene.dtxEnabled=N}setPBREnabled(N=!this.viewer.scene.pbrEnabled){this.viewer.scene.pbrEnabled=N}resetView(N=()=>{}){if(this._focusPartial||this._worldAxisYDown){this.setDirection(25);return}this._resetAction.reset(N)}fitView(N=()=>{}){if(this._focusPartial){this.viewFitPartial(this._partialFocusIndex,N);return}this._fitAction.fit()}SetAnnotationToolActive(N=!this._annotationTool.getActive(),I=()=>{}){this._annotationTool.setActive(N),I&&I(this._annotationTool.getActive())}SetMarkerToolActive(N=!this._markerTool.getActive(),I=()=>{}){this._markerTool.setActive(N),I&&I(this._markerTool.getActive())}SetCommentsToolActive(N=!this._commentsTool.getActive(),I=()=>{}){this._commentsTool.setActive(N),I&&I(this._commentsTool.getActive())}SetFirstPersonModeActive(N=!this._firstPersonMode.getActive(),I=()=>{}){this._firstPersonMode.setActive(N),I&&I(this._firstPersonMode.getActive())}SetMeasureToolActive(N=!this.measureAngleTool.getActive(),I=()=>{}){this._measureTool.setActive(N),I&&I(this._measureTool.getActive())}SetMeasureAngleActive(N=!this.measureAngleTool.getActive(),I=()=>{}){this._measureTool.SetMeasureAngleActive(N,I)}SetMeasureDistanceActive(N=!this.measureDistanceTool.getActive(),I=()=>{}){this._measureTool.SetMeasureDistanceActive(N,I)}SetSectionToolActive(N=!this._sectionTool.getActive(),I=()=>{}){this._sectionTool.setActive(N),I(this._sectionTool.getActive())}SetHideToolActive(N,I=()=>{}){this._hideTool.setActive(N),I&&I()}SetOrthoModeActive(N=!this._orthoMode.getActive(),I=()=>{}){this._orthoMode.setActive(N,I)}SetThreeDModeActive(N=!this._threeDMode.getActive(),I=()=>{}){this._threeDMode.setActive(N,I)}SetShowSpaceModeActive(N=!this._showSpacesMode.getActive(),I=()=>{}){this._showSpacesMode.setActive(N,I)}SetSkyBoxToolActive(N,I=()=>{}){this._skyBoxTool&&(N==null?this._skyBoxTool.setActive(!this._skyBoxTool.getActive()):this._skyBoxTool.setActive(N),I&&I(this._skyBoxTool.getActive()))}SetBCFToolActive(N=!this._bcfTool.getActive(),I=()=>{}){this._bcfTool.setActive(N),I(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(N){this._navCubeMode.flyByClick(N)}singleChoseEntity(N){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.setEntitySelected(N))}singleChosedSpace(){this._disableClickEvent||this.setAllObjectsSelected(!1)}doubleChoseEntity(N){this._disableClickEvent||(this.viewFitEntity(N),this.setAllObjectsSelected(!1),this.setEntitySelected(N))}choseSpace(){this._disableClickEvent||(this.setAllObjectsSelected(!1),this.viewFitAll())}getPreShot(N,I){const{cameraEnable:L}=this;L(!1);const U=typeof N=="function"?1024:N;typeof N=="function"&&(I=N);const{orbitYawCamera:O}=this,{viewer:Q}=this,{canvas:W}=Q.scene.canvas,Z=this._projectId,J=document.createElement("canvas"),ne=J.getContext("2d"),ae=U*15,ce=U;J.width=ae,J.height=ce;const q=Array.from({length:15},()=>fe);function fe(){return K(this,void 0,void 0,function*(){return yield O(-18),yield re(100),te(U)})}function re(de){return new Promise(he=>setTimeout(he,de))}function te(de){return K(this,void 0,void 0,function*(){const he=document.createElement("canvas"),ue=he.getContext("2d");if(W&&ue){he.width=de,he.height=de;const pe=de/W.width,se=de/W.height,V=Math.max(pe,se),Ce=W.width*V,ve=W.height*V,ye=(de-Ce)/2,Ae=(de-ve)/2;return ue.clearRect(0,0,de,de),ue.fillStyle="transparent",ue.fillRect(0,0,de,de),ue.drawImage(W,0,0,W.width,W.height,ye,Ae,Ce,ve),new Promise((me,be)=>{const we=new Image;we.onload=()=>me(we),we.onerror=be,we.src=he.toDataURL()})}return Promise.reject(new Error("Canvas or context not found."))})}function le(de){const he=J.toDataURL("image/png");return L(!0),I&&I({modelId:Z,imageData:he}),he}return K(this,void 0,void 0,function*(){for(let de=0;de<q.length;de++)try{const he=yield q[de]();ne&&ne.drawImage(he,de*U,0)}catch(he){L(!0),console.error("获取图片内容失败:",he)}le()}),""}setShelterCanvas(N=()=>{}){const{canvas:I}=this.viewer.scene.canvas,L=this.shot(I.width,I.height,!1),U=document.createElement("img");U.src=L,U.style.position="absolute",U.style.top="0px",U.style.left="0px",U.style.right="0px",U.style.bottom="0px",I.parentNode.appendChild(U),typeof N=="function"&&N(U)}}},"./src/Controller.ts"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/TMap.ts");class y{constructor(h,d={},u=null,c=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:c,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 c=this._eventSubs[h];let f;c&&Object.keys(c).forEach(m=>{Object.prototype.hasOwnProperty.call(c,m)&&(f=c[m],this._eventCallDepth+=1,this._eventCallDepth<300?f.callback.call(f.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 p.default),this._subIdEvents||(this._subIdEvents={}),this._eventSubs||(this._eventSubs={});let c=this._eventSubs[h];c||(c={},this._eventSubs[h]=c);const f=this._subIdMap.addItem();c[f]={callback:d,scope:u||this},this._subIdEvents[f]=h;const m=this._events[h];return m!==void 0&&d.call(u||this,m),f}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 c=this,f=this.on(h,m=>{c.off(f),d.call(u||this,m)},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",c=>{c&&h.forEach((f,m)=>{m!==u&&f.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"(s,C,i){i.r(C),i.d(C,{default:()=>p});class p{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"(s,C,i){i.r(C),i.d(C,{default:()=>p});class p{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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u={}){super(d),this.eventTrigger=d.eventTrigger;const{modelType:c}=u;this._treeView=new p.TreeViewPlugin(this.viewer,{hierarchy:"types",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",f=>{this._rootNode=f,this.eventTrigger.emit("classes_rootNodes",f)}),this._treeView.on("nodeNodes_Created",f=>{this._nodeList=f,this.eventTrigger.emit("classes_nodeNodes",f)}),this._treeView.on("objectNodes_Created",f=>{this._objectList=f,this.eventTrigger.emit("classes_objectNodes",f)}),this._treeView.on("checkBoxChanged",f=>{this.eventTrigger.emit("classes_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(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 c=this._nodeList[d],f=u,{objects:m}=this.viewer.scene;let g=0;this._treeView.withNodeTree(c,b=>{const{objectId:w}=b,_=m[w],x=b.children.length===0;b.numVisibleEntities=f?b.numEntities:0,x&&f!==b.checked&&g++,b.checked=f,_&&(_.visible=f)});let{parent:v}=c;for(;v;)v.checked=f,f?v.numVisibleEntities+=g:v.numVisibleEntities-=g,v=v.parent}nodeTitleClicked(d){const{scene:u}=this.viewer,c=this._nodeList[d],f=[];this._treeView.withNodeTree(c,g=>{g.objectId&&f.push(g.objectId)});const{checked:m}=c;m?(u.setObjectsXRayed(f,!1),u.setObjectsVisible(f,!1),u.setObjectsPickable(f,!0)):(u.setObjectsXRayed(f,!1),u.setObjectsVisible(f,!0),u.setObjectsPickable(f,!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"(s,C,i){i.r(C),i.d(C,{default:()=>m});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");let A;const h=["position","scale","rotation","matrix","origin"],d=p.math;function u(g,v,b,w){const _=Math.sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]),x=Math.sqrt(g[4]*g[4]+g[5]*g[5]+g[6]*g[6]),E=Math.sqrt(g[8]*g[8]+g[9]*g[9]+g[10]*g[10]);v[0]=g[12],v[1]=g[13],v[2]=g[14];const k=new Array(16);for(let P=0;P<16;P++)k[P]=g[P];_>1e-6&&(k[0]/=_,k[1]/=_,k[2]/=_),x>1e-6&&(k[4]/=x,k[5]/=x,k[6]/=x),E>1e-6&&(k[8]/=E,k[9]/=E,k[10]/=E),d.mat4ToQuaternion(k,b),w[0]=_,w[1]=x,w[2]=E}function c(g){const v=[0,0,0];return d.quaternionToEuler(g,"XYZ",v),v}class f{constructor(v,b){this._projectId="",this._modelId="",this._server=v,A=b.tempVec3a}setProjectId(v){this._projectId=v}setModelId(v){this._modelId=v}getManifest(v,b,w){this._server.getSplitModelManifest(this._projectId,this._modelId,v,b,w)}getMetaModel(v,b,w){this._server.getSplitModelMetadata(this._projectId,this._modelId,v,b,w)}getXTC(v,b,w){this._server.getSplitModelGeometry(this._projectId,this._modelId,v,b,w)}}class m extends y.default{constructor(v,b){super(v,b),this._modelFromOutSide=b.modelFromOutSide,this._projectId=b.projectId,this._modelType=b.modelType,this._modelSrc=b.modelSrc,this._eventTrigger=v.eventTrigger,this._dataSource=new f(this.server,{tempVec3a:b.tempVec3a}),this._modelConfig=b.modelConfig,this._modelsInfo={},this._numModels=0,this._numModelsLoaded=0}getModelIds(){return Object.keys(this._modelsInfo)}getModelInfo(v){return this._modelsInfo[v]}loadModel(v,b,w=()=>{},_=()=>{},x){if(this._modelType=x.modelType,this._modelType=="ifc"){const k=x.IfcAPI!==void 0&&x.IfcAPI!==null,P=x.WebIFC!==void 0&&x.WebIFC!==null;k&&P&&this.log("载入外部传入webifc..."),this._ifcLoader=k&&P?new p.WebIFCLoaderPlugin(this.viewer,{WebIFC:x.WebIFC,IfcAPI:x.IfcAPI}):new p.WebIFCLoaderPlugin(this.viewer,{}),this._modelsInfo[v]={id:v,ifc:b,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}}else this._modelType=="xtc"?(this._xtcLoader=new p.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[v]={id:v,xtc:b,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0}):this._modelType=="glb"&&(this._glbLoader=new p.GLTFLoaderPlugin(this.viewer),this._modelsInfo[v]={id:v,gltf:b,metaBuffer:null,edges:!0,loadMetadata:!1,saoEnabled:!0,pbrEnabled:!0,dtxEnabled:!0});const E=this._modelsInfo[v];for(const k of h)x&&x[k]!==void 0&&x[k]!==null&&(E[k]=x[k]);x&&x.alignTo!==void 0&&x.alignTo!==null&&(E.alignTo=x.alignTo),x&&x.brightness!==void 0&&x.brightness!==null&&(E.brightness=x.brightness),this._loadGeometry(v,w,_)}unloadModel(v){const b=this.viewer.scene.models[v];if(!b){this.error("Model not loaded: "+v);return}b.destroy(),delete this._modelsInfo[v],this.fire("modelUnloaded",v)}loadMetadata(v,b,w,_){const x=this.viewer.metaScene.metaModels[v];if(!x){this.warn("loadMetadata() - MetaModel not found: "+v),_&&_();return}this._xtcLoader&&(this._modelsInfo[v]&&(this._modelsInfo[v].metaBuffer=b),this._xtcLoader.loadMetadata(x,b,w,_))}_loadGeometry(v,b,w){const _=this._modelsInfo[v],x=Object.assign({},_),E=this._resolveModelTransform(_);for(const D of h)delete x[D];delete x.alignTo;for(const D of Object.keys(E))x[D]=E[D];const k=()=>{this._jumpToInitialCamera(),this.fire("modelLoaded",v),b&&b()},P=D=>{this.error(D),w&&w(D)};if(this._modelType=="ifc"&&this._ifcLoader)if(this._modelFromOutSide){this.log("正在载入ifc模型...");const D=this._ifcLoader.load(x);D.on("loaded",k),D.on("error",P)}else{this.log("正在载入引擎从本地获取的ifc模型...");const D={id:v,src:this._modelSrc,edges:x.edges,loadMetadata:!1,pbrEnabled:x.pbrEnabled,dtxEnabled:x.dtxEnabled};for(const z of h)x[z]!==void 0&&x[z]!==null&&(D[z]=x[z]);const R=this._ifcLoader.load(D);R.on("loaded",k),R.on("error",P)}else if(this._modelType==="xtc"&&this._xtcLoader){if(this._modelFromOutSide){this.log("正在载入xtc模型...");const D=this._xtcLoader.load(x);D.on("loaded",k),D.on("error",P)}}else if(this._modelType==="glb"&&this._glbLoader&&this._modelFromOutSide){this.log("正在载入glb模型...");const D=this._glbLoader.load(x);D.on("loaded",k),D.on("error",P)}}_resolveModelTransform(v){const b={};let w=null,_=null,x=null,E=null;if(v.matrix){const k=[0,0,0],P=[0,0,0,1],D=[1,1,1];u(v.matrix,k,P,D),w=k,_=c(P),x=D}else v.position&&(w=Array.from(v.position)),v.quaternion?_=c(v.quaternion):v.rotation&&(_=Array.from(v.rotation)),v.scale&&(x=Array.from(v.scale));if(v.origin&&(E=Array.from(v.origin)),v.alignTo){const k=this.viewer.scene.models[v.alignTo];k?(E===null&&(E=Array.from(k.origin)),w===null&&(w=Array.from(k.position)),_===null&&(_=Array.from(k.rotation)),x===null&&(x=Array.from(k.scale))):this.warn(`alignTo: 基准模型 "${v.alignTo}" 尚未加载,将按自身坐标加载`)}return w&&(b.position=w),_&&(b.rotation=_),x&&(b.scale=x),E&&(b.origin=E),b}_jumpToInitialCamera(){const{viewer:v}=this,{scene:b}=v,w=b.getAABB(b.visibleObjectIds),_=p.math.getAABB3Diag(w),x=p.math.getAABB3Center(w,A),{camera:E}=b,k=Math.abs(_/Math.tan(45*p.math.DEGTORAD)),P=p.math.normalizeVec3(E.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),D=p.math.normalizeVec3(E.yUp?[-.5,.7071,-.5]:[-1,1,1]);v.cameraControl.pivotPos=x,v.cameraControl.planView&&(v.cameraControl.planView=!1),v.cameraFlight.jumpTo({look:x,eye:[x[0]-k*P[0],x[1]-k*P[1],x[2]-k*P[2]],up:D,orthoScale:_*1.1})}destroy(){super.destroy(),this._xtcLoader&&this._xtcLoader.destroy(),this._ifcLoader&&this._ifcLoader.destroy(),this._glbLoader&&this._glbLoader.destroy()}}},"./src/explorer/ObjectsExplorer.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u={}){super(d);const{modelType:c}=u;this.eventTrigger=d.eventTrigger,this._treeView=new p.TreeViewPlugin(this.viewer,{hierarchy:"containment",autoAddModels:!1,pruneEmptyNodes:!0,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",f=>{this._rootNode=f,this.eventTrigger.emit("object_rootNodes",f)}),this._treeView.on("nodeNodes_Created",f=>{this._nodeList=f,this.eventTrigger.emit("object_nodeNodes",f)}),this._treeView.on("objectNodes_Created",f=>{this._objectList=f,this.eventTrigger.emit("object_objectNodes",f)}),this._treeView.on("checkBoxChanged",f=>{this.eventTrigger.emit("object_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}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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");const A=p.math.vec3();class h extends y.default{constructor(u,c={}){super(u);const{modelType:f}=c;this.eventTrigger=u.eventTrigger,this._treeView=new p.TreeViewPlugin(this.viewer,{hierarchy:"storeys",autoAddModels:!1,autoExpandDepth:1}),this._treeView.on("rootNodes_Created",m=>{this._rootNode=m,this.eventTrigger.emit("storeys_rootNodes",m)}),this._treeView.on("nodeNodes_Created",m=>{this._nodeList=m,this.eventTrigger.emit("storeys_nodeNodes",m)}),this._treeView.on("objectNodes_Created",m=>{this._objectList=m,this.eventTrigger.emit("storeys_objectNodes",m)}),this._treeView.on("checkBoxChanged",m=>{this.eventTrigger.emit("storeys_checkBoxChanged",m)}),f==="ifc"?this._onModelLoaded=this.viewer.scene.on("modelLoaded",m=>{this._treeView.addModel(m,{rootName:m})}):this._onMetaDataLoaded=this.eventTrigger.on("metaLoaded",m=>{m.result==="success"&&(this._treeView.addModel(m.metaModel.id,{rootName:m.metaModel.id}),this.eventTrigger.emit("treeReady"))}),this._onModelUnloaded=this.viewer.scene.on("modelUnloaded",m=>{this.viewer.metaScene.metaModels[m]&&this._treeView.removeModel(m)})}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,c){const f=this._nodeList[u],m=c,{objects:g}=this.viewer.scene;let v=0;this._treeView.withNodeTree(f,w=>{const{objectId:_}=w,x=g[_],E=w.children.length===0;w.numVisibleEntities=m?w.numEntities:0,E&&m!==w.checked&&v++,w.checked=m,x&&(x.visible=m)});let{parent:b}=f;for(;b;)b.checked=m,m?b.numVisibleEntities+=v:b.numVisibleEntities-=v,b=b.parent}nodeTitleClicked(u){const{scene:c}=this.viewer,f=this._nodeList[u],m=[];this._treeView.withNodeTree(f,v=>{v.objectId&&m.push(v.objectId)});const{checked:g}=f;g?(c.setObjectsXRayed(m,!1),c.setObjectsVisible(m,!1),c.setObjectsPickable(m,!0)):(c.setObjectsXRayed(m,!1),c.setObjectsVisible(m,!0),c.setObjectsPickable(m,!0))}setEnabled(u){}_selectObjects(u,c){const{scene:f}=this.viewer,m=f.getAABB(u);this.viewer.cameraControl.pivotPos=p.math.getAABB3Center(m,A),c?(f.setObjectsXRayed(f.objectIds,!0),f.setObjectsVisible(f.objectIds,!0),f.setObjectsPickable(f.objectIds,!1),f.setObjectsSelected(f.selectedObjectIds,!1),f.setObjectsXRayed(u,!1),f.setObjectsVisible(u,!0),f.setObjectsPickable(u,!0),this.viewer.cameraFlight.flyTo({aabb:m},()=>{setTimeout(()=>{f.setObjectsVisible(f.xrayedObjectIds,!1),f.setObjectsXRayed(f.xrayedObjectIds,!1)},500),c()})):(f.setObjectsVisible(f.objectIds,!1),f.setObjectsPickable(f.xrayedObjectIds,!0),f.setObjectsXRayed(f.xrayedObjectIds,!1),f.setObjectsSelected(f.selectedObjectIds,!1),f.setObjectsVisible(u,!0),this.viewer.cameraFlight.jumpTo({aabb:m}))}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,c){const{metaScene:f}=this.viewer,m=f.metaObjects[u];if(!m){this.error(`selectStorey() - object is not found: ${u}`);return}if(m.type!=="IfcBuildingStorey"){this.error(`selectStorey() - object is not found: ${u}`);return}const g=m.getObjectIDsInSubtree();this._selectObjects(g,c)}}},"./src/messages.ts"(s,C,i){i.r(C),i.d(C,{default:()=>y});const y={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"(s,C,i){i.r(C),i.d(C,{default:()=>c});var p=i("./node_modules/axios/lib/axios.js"),y=i("./node_modules/ali-oss/dist/aliyun-oss-sdk.js"),A=i.n(y),h=function(f,m,g,v){function b(w){return w instanceof g?w:new g(function(_){_(w)})}return new(g||(g=Promise))(function(w,_){function x(P){try{k(v.next(P))}catch(D){_(D)}}function E(P){try{k(v.throw(P))}catch(D){_(D)}}function k(P){P.done?w(P.value):b(P.value).then(x,E)}k((v=v.apply(f,m||[])).next())})};function d(f){return h(this,void 0,void 0,function*(){try{return(yield p.default.get(f)).data.data}catch(m){throw console.error("Error fetching data:",m),m}})}function u(f,m){return h(this,void 0,void 0,function*(){const g=yield d(f);return new(A())({region:"oss-cn-beijing",accessKeyId:g.accessKeyId,accessKeySecret:g.accessKeySecret,stsToken:g.securityToken,bucket:m})})}class c{static getBuffer(m,g,v,b,w){return h(this,void 0,void 0,function*(){try{const x=yield(yield u(g,v)).get(`${m}`);b(x.content.buffer)}catch(_){w(_)}})}static requestFileFromOSS(m,g,v,b,w,_){return h(this,void 0,void 0,function*(){try{const x=yield u(g,v);if(b){const E=yield x.get(`${m}/metadata.json`);w(JSON.parse(E.content))}else{const E=yield x.get(`${m}/index.json`);w(JSON.parse(E.content))}}catch(x){console.error("请求文件失败:",x)}})}}},"./src/server/Server.ts"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/server/OSSHelper.ts"),A=function(d,u,c,f){function m(g){return g instanceof c?g:new c(function(v){v(g)})}return new(c||(c=Promise))(function(g,v){function b(x){try{_(f.next(x))}catch(E){v(E)}}function w(x){try{_(f.throw(x))}catch(E){v(E)}}function _(x){x.done?g(x.value):m(x.value).then(b,w)}_((f=f.apply(d,u||[])).next())})};class h{constructor(u={}){this._dataDir=u.dataDir||"",this._filePath=u.filePath||""}getProjects(u,c){const f=`${this._dataDir}/projects/index.json`;p.utils.loadJSON(f,u,c)}getProject(u,c,f){const m=`${this._dataDir}/projects/${u}/index.json`;p.utils.loadJSON(m,c,f)}getMetadata(u,c,f,m){const g=`${this._dataDir}/projects/${u}/models/${c}/metadata.json`;p.utils.loadJSON(g,f,m)}getModelProject(u,c,f,m){return A(this,void 0,void 0,function*(){yield y.default.requestFileFromOSS(this._filePath,u,c,!1,f,m)})}getModelMetadata(u,c,f,m){return A(this,void 0,void 0,function*(){yield y.default.requestFileFromOSS(this._filePath,u,c,!0,f,m)})}getModelGeometry(u,c,f,m){return A(this,void 0,void 0,function*(){yield y.default.getBuffer(this._filePath,u,c,f,m)})}getGeometry(u,c,f,m){const g=`${this._dataDir}/projects/${u}/models/${c}/geometry.xtc`;p.utils.loadArraybuffer(g,f,m)}getObjectInfo(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models${c}/props/${f}.json`;p.utils.loadJSON(v,m,g)}getIssues(u,c,f,m){const g=`${this._dataDir}/projects/${u}/modelId/${c}/issues.json`;p.utils.loadJSON(g,f,m)}getSplitModelManifest(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models${c}/${f}`;p.utils.loadJSON(v,m,g)}getSplitModelMetadata(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models/${c}/${f}`;p.utils.loadJSON(v,m,g)}getSplitModelGeometry(u,c,f,m,g){const v=`${this._dataDir}/projects/${u}/models${c}/${f}`;p.utils.loadArraybuffer(v,m,g)}}},"./src/toolbar/AnnotationTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.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:m}=d.viewer.scene.canvas;m.parentNode.insertBefore(this.annotationWrapper,m)}this.annotationsPlugin=new p.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",m=>{});let c;this.annotationsPlugin.on("markerClicked",m=>{this.eventTrigger.emit("markerClicked",m),c=m}),this.annotationsPlugin.on("markerDoubleClicked",m=>{this.eventTrigger.emit("markerDoubleClicked",m)});const f=m=>{this._active&&(m.key==="Delete"||m.keyCode===8)&&this.eventTrigger.emit("requestDeleteMarker",c.id)};document.addEventListener("keydown",f.bind(this)),this.on("destroy",()=>{document.removeEventListener("keydown",f.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),c=this.viewer.scene.pick({canvasPos:u,pickSurface:!0});if(c){const f=c.entity.id,m=this.generateId(f);this.annotationsPlugin.createAnnotation({id:m,pickResult:c,occludable:!0,markerShown:!0,labelShown:!1,values:{id:m,entityid:f,iconPath:this.getTypeImage(this._currentType),iconType:this._currentType}}),this.currentAnnotation={id:m,modelId:c.entity.model.id,entityId:f,type:this._currentType,content:{worldPos:[c.worldPos[0],c.worldPos[1],c.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(),c=Math.floor(performance.now()*1e3);return`${d}_${this._currentType}_${u}_${c}`}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 c=d.touches[0];let f=d.target,m=0,g=0;for(;f.offsetParent;)m+=f.offsetLeft,g+=f.offsetTop,f=f.offsetParent;u[0]=c.pageX-m,u[1]=c.pageY-g}else{let c=this.viewer.scene.canvas.canvas,f=0,m=0;for(;c.offsetParent;)f+=c.offsetLeft,m+=c.offsetTop,c=c.offsetParent;u[0]=d.pageX-f,u[1]=d.pageY-m}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,c){this.annotationsPlugin.createAnnotation({id:d,worldPos:u,occludable:!0,markerShown:this._visible,labelShown:!1,values:{id:d,entityid:d,iconPath:this.getTypeImage(c),iconType:c}})}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,c)=>{u.id===d&&this._AnnotationList.splice(c,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"(s,C,i){i.r(C),i.d(C,{default:()=>d});var p=i("./src/Controller.ts"),y=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),A=i("./node_modules/@parametricos/bcf-js/dist/index.js"),h=function(u,c,f,m){function g(v){return v instanceof f?v:new f(function(b){b(v)})}return new(f||(f=Promise))(function(v,b){function w(E){try{x(m.next(E))}catch(k){b(k)}}function _(E){try{x(m.throw(E))}catch(k){b(k)}}function x(E){E.done?v(E.value):g(E.value).then(w,_)}x((m=m.apply(u,c||[])).next())})};class d extends p.default{constructor(c,f){super(c,f),this._enableAnno=!1,this._imagePath="",this.eventTrigger=c.eventTrigger,this.bCFViewpointsPlugin=new y.BCFViewpointsPlugin(c.viewer,{originatingSystem:"tctwins.com",authoringTool:"tctwins.com"}),this.bcfAnnoWrapper=document.createElement("div"),this.bcfAnnoWrapper.id="bcfAnnoWrapper";const{canvas:m}=c.viewer.scene.canvas;m.parentNode.insertBefore(this.bcfAnnoWrapper,m),this.bcfAnnoPlugin=new y.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:""}}),c.viewer.scene.input.on("mouseclicked",g=>{if(!this._enableAnno||!this._active)return;const v=c.viewer.scene.pick({canvasPos:g,pickSurface:!0}),b=v.entity.id;if(v){const w=this.addBCFAnno(b,g,"text");this.eventTrigger.emit("bcfNewAnno",w)}}),this.on("active",g=>{c.disableClickEvent=g})}readBCF(c){return h(this,void 0,void 0,function*(){const f=new A.BcfReader;return yield f.read(c),f.project})}createBCF(c){return h(this,void 0,void 0,function*(){const f=new A.BcfReader;let m=[];const g=c.markups;g&&g.forEach(_=>{let x=[],E=[];_.viewPoints&&_.viewPoints.forEach((R,z)=>{var F;if(R.bcfView){let H=this.bCFViewpointsPlugin.getUUID(),$={index:z,guid:H,snapshot:R.bcfView.snapshot?`${H}_snapshot.png`:void 0,viewpoint:`${H}_viewpoint.bcfv`},K={guid:H,components:R.bcfView.components,perspective_camera:R.bcfView.perspective_camera,orthogonal_camera:R.bcfView.orthogonal_camera,snapshot:(F=R.bcfView.snapshot)===null||F===void 0?void 0:F.snapshot_data};x.push($),E.push(K)}});let k=[];_.comments&&_.comments.forEach((R,z)=>{let H={guid:this.bCFViewpointsPlugin.getUUID(),date:R.date,author:R.author,comment:R.comment,viewpoint:R.viewPoint,modified_date:R.modified_date?R.modified_date:R.date,modified_author:R.modified_author?R.modified_author:R.author};k.push(H)});const D={topic:{guid:this.bCFViewpointsPlugin.getUUID(),title:_.title,priority:_.priority,topic_type:_.type,topic_status:_.status?_.status:"Active",due_date:_.dueDate,creation_date:_.createDate?_.createDate:new Date().toISOString(),creation_author:_.author,assigned_to:_.assignedTo,index:_.index?_.index:1,viewpoints:x,comments:k},viewpoints:E};m.push(D)});const v={project_id:c.id?c.id:"",name:c.name?c.name:"",version:c.version?c.version:2.1,reader:f,markups:m,extension_schema:void 0};return yield new A.BcfWriter().write(v)})}saveBcf(c){return h(this,void 0,void 0,function*(){return console.log(c),yield new A.BcfWriter().write(c)})}getBCFView(){return this.bCFViewpointsPlugin.getViewpoint()}getSnapshot(c){for(var f=c.replace(/^data:image\/(png|jpeg);base64,/,""),m=atob(f),g=m.length,v=new Uint8Array(g),b=0;b<g;b++)v[b]=m.charCodeAt(b);var w=new Blob([v],{type:"image/png"});return w}set enableAnno(c){this._enableAnno=c}get enableAnno(){return this._enableAnno}set imagePath(c){this._imagePath=c}get imagePath(){return this._imagePath}addBCFAnno(c,f,m){this.bcfAnnoPlugin.createAnnotation({id:c,worldPos:f,occludable:!0,markerShown:!0,labelShown:!0,values:{id:c,entityid:c,iconPath:this._imagePath,iconType:m}})}getNewGuid(){return this.bCFViewpointsPlugin.getUUID()}}},"./src/toolbar/CommentsTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/decimal.js/decimal.mjs"),y=i("./src/Controller.ts");class A extends y.default{constructor(c,f){super(c,f),this._commentsList={},this.eventTrigger=c.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",m=>{m?this.saveSVG():this.endCommentsTool()}),this.bimViewer.on("closeAll",()=>{this.setActive(!1)}),this.initEventListeners()}saveSVG(){const c=document.getElementById("myCanvas");let f=c.clientWidth,m=c.clientHeight;const g=document.createElementNS("http://www.w3.org/2000/svg","svg");g.setAttribute("width",f.toString()),g.setAttribute("height",m.toString());const v=document.createElementNS("http://www.w3.org/2000/svg","image");v.setAttribute("x","0"),v.setAttribute("y","0"),v.setAttribute("width",f.toString()),v.setAttribute("height",m.toString()),v.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c.toDataURL()),g.appendChild(v),g.setAttribute("id","svgImage");const b=document.getElementById("comments_panel");b&&(b.innerHTML=""),b==null||b.appendChild(g),this.checkSelectionBox(),this._revocationMechanism=new h(this.eventTrigger),this.eventTrigger.emit("saveImage")}initEventListeners(){let c,f,m,g,v;const b=(w,_,x,E)=>{const k=[w-_,x-E],P=this.getInitVector(k[0],k[1]),D=this.getVerticalUnitVector(k[0],k[1]),R=.5,z=(_-2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),F=(E-2*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),H=(w-2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),$=(x-2*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),K=(w-7*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),G=(x-7*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),j=(w+12*Number(this._ArrowstrokeWidth)*R*P[0]).toString(),N=(x+12*Number(this._ArrowstrokeWidth)*R*P[1]).toString(),I=(w+7*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),L=(x+7*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),U=(w+2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),O=(x+2*Number(this._ArrowstrokeWidth)*R*D[1]).toString(),Q=(_+2*Number(this._ArrowstrokeWidth)*R*D[0]).toString(),W=(E+2*Number(this._ArrowstrokeWidth)*R*D[1]).toString();return`M ${_},${E}L ${z},${F}L ${H},${$}L ${K},${G}L ${j},${N}L ${I},${L}L ${U},${O}L ${Q},${W}L${_},${E}`};this.eventTrigger.on("saveImage",()=>{const w=document.getElementById("svgImage"),_=H=>{const{target:$}=H;if($.tagName==="text"){this.hiddenAllInput();const K=$.parentNode,G=K.querySelector("foreignObject"),j=G.querySelector("input"),{textContent:N}=K;if(j)j.style.display="inline",$.textContent="";else{const I=document.createElement("input");I.setAttribute("type","text"),I.setAttribute("class","commentInputBox"),N!=""&&I.setAttribute("placeholder",N),G.appendChild(I)}this.isTyping=!0}},x=H=>{if(this._isTouch)return;const{target:$}=H;if($.tagName==="ellipse"||$.tagName==="path"||$.tagName==="rect"||$.tagName==="text"){if($.id!="selectionBox")if($.getAttribute("type")=="handle"){c=H.clientX+this._offsetX,f=H.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=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!=$&&(this.isDuplicate=!1,this.chosedTarget=$),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,c=H.clientX+this._offsetX,f=H.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.autoSaveInput(),this.setCurrentMode(""),this.eventTrigger.emit("choseTarget")}else if($.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,c=H.clientX+this._offsetX,f=H.clientY+this._offsetY;const K=document.createElementNS("http://www.w3.org/2000/svg","g");K.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let G;switch(this._currentMode){case"path":G=document.createElementNS("http://www.w3.org/2000/svg","path"),G.setAttribute("d",`M ${c},${f}`),G.setAttribute("stroke",this._Pathcolor),G.setAttribute("stroke-width",this._PathstrokeWidth),G.setAttribute("fill","transparent"),K.setAttribute("type","path");break;case"ellipse":G=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),G.setAttribute("cx",c.toString()),G.setAttribute("cy",f.toString()),G.setAttribute("rx","0"),G.setAttribute("ry","0"),G.setAttribute("stroke",this._Ellipsecolor),G.setAttribute("stroke-width",this._EllipsestrokeWidth),G.setAttribute("fill","transparent"),K.setAttribute("type","ellipse");break;case"rect":G=document.createElementNS("http://www.w3.org/2000/svg","rect"),G.setAttribute("x",c.toString()),G.setAttribute("y",f.toString()),G.setAttribute("stroke",this._Rectcolor),G.setAttribute("stroke-width",this._RectstrokeWidth),G.setAttribute("fill","transparent"),K.setAttribute("type","rect");break;case"arrow":G=document.createElementNS("http://www.w3.org/2000/svg","path"),G.setAttribute("d",`M ${c},${f}`),G.setAttribute("stroke-width","20"),G.setAttribute("stroke","transparent"),G.setAttribute("fill",this._Arrowcolor),K.setAttribute("type","arrow");break;case"text":if(this.isTyping)this.autoSaveInput();else if(!this.isChosed){const j=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");let N=0;this._FontSize=="16"?(j.setAttribute("width","120"),j.setAttribute("height","26"),N=28):this._FontSize=="18"?(j.setAttribute("width","140"),j.setAttribute("height","28"),N=30):Number(this._FontSize)<=14&&(j.setAttribute("width","100"),j.setAttribute("height",(Number(this._FontSize)+10).toString()),N=Number(this._FontSize)+10),j.setAttribute("x",c),j.setAttribute("y",f);const I=document.createElement("input");I.setAttribute("type","text"),I.setAttribute("class","commentInputBox"),I.setAttribute("placeholder","输入内容...");const L=document.createElementNS("http://www.w3.org/2000/svg","text");L.setAttribute("x",c+3),L.setAttribute("y",(f+N-Number(this._FontSize)/2).toString()),L.setAttribute("font-size",this._FontSize),L.setAttribute("stroke",this._Textcolor),L.setAttribute("stroke-width",this._TextstrokeWidth),L.setAttribute("fill",this._Textcolor),L.setAttribute("lengthAdjust","spacingAndGlyphs"),j.appendChild(I),K.setAttribute("type","text"),K.appendChild(j),K.appendChild(L),w==null||w.insertBefore(K,w==null?void 0:w.lastElementChild),I.click(),this.isTyping=!0,this.eventTrigger.emit("createNew")}break}this._currentMode!="text"&&this._currentMode!=""&&(K.appendChild(G),w==null||w.insertBefore(K,w==null?void 0:w.lastElementChild)),this.isChosed=!1}}},E=H=>{var $,K,G,j,N,I,L,U,O,Q,W,Z,J,ne,ae,ce,q,fe,re,te,le,de,he,ue,pe,se,V,Ce,ve,ye,Ae,me;if(this._isTouch)return;const be=H.clientX+this._offsetX,we=H.clientY+this._offsetY;let Te;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":Te=document.querySelectorAll("g");const Ke=[];Te.forEach(at=>{at.getAttribute("type")=="path"&&Ke.push(at)});const Xe=Ke[Ke.length-1].querySelector("path");let Ge=Xe.getAttribute("d");Ge&&(Ge+=`L ${be},${we}`,Xe.setAttribute("d",Ge));break;case"ellipse":var He=document.querySelectorAll("ellipse"),je=He[He.length-1];if(je){var qe=Math.abs(be-c)/2,tt=Math.abs(we-f)/2;je.setAttribute("cx",((be+c)/2).toString()),je.setAttribute("cy",((we+f)/2).toString()),je.setAttribute("rx",qe.toString()),je.setAttribute("ry",tt.toString())}break;case"rect":const ze=document.querySelectorAll("g"),Ct=[];ze.forEach(at=>{at.getAttribute("type")=="rect"&&Ct.push(at.childNodes[0])});const It=Ct[Ct.length-1],Ot=It.getAttribute("x"),Ze=It.getAttribute("y");if(Ot&&Ze){const at=Math.abs(parseInt(Ot)-be),jt=Math.abs(parseInt(Ze)-we);It.setAttribute("width",at.toString()),It.setAttribute("height",jt.toString()),It.setAttribute("rx","9"),It.setAttribute("ry","9"),It.setAttribute("type","comment")}break;case"arrow":Te=document.querySelectorAll("g");const gt=[];Te.forEach(at=>{at.getAttribute("type")=="arrow"&>.push(at)});const _t=gt[gt.length-1].querySelector("path");if(_t.getAttribute("d")){const at=b(be,c,we,f);_t.setAttribute("d",at)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(be-c)>=1||Math.abs(we-f)>=1)&&(this.isMoving=!0);const Ke=($=this.chosedTarget)===null||$===void 0?void 0:$.getBBox();switch(this.chosedTarget.tagName){case"path":const Xe=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,It=>{const[Ot,Ze]=It.split(",").map(parseFloat),gt=Number(Ot)+Number(be)-Number(Ke.x)-(Number(c)-Number(m)),vt=Number(Ze)+Number(we)-Number(Ke.y)-(Number(f)-Number(g));return`${gt.toString()},${vt.toString()}`});(G=this.chosedTarget)===null||G===void 0||G.setAttribute("d",Xe);break;case"ellipse":var mt=Number((j=this.chosedTarget)===null||j===void 0?void 0:j.getAttribute("cx")),kt=Number((N=this.chosedTarget)===null||N===void 0?void 0:N.getAttribute("cy"));const Ge=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("rx")),ze=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("ry"));(U=this.chosedTarget)===null||U===void 0||U.setAttribute("cx",be-(c-m)/2+Ge),(O=this.chosedTarget)===null||O===void 0||O.setAttribute("cy",we-(f-g)/2+ze);break;case"rect":(Q=this.chosedTarget)===null||Q===void 0||Q.setAttribute("x",be-(c-m)),(W=this.chosedTarget)===null||W===void 0||W.setAttribute("y",we-(f-g));break;case"text":(Z=this.chosedTarget)===null||Z===void 0||Z.setAttribute("x",(be-(c-m)).toString()),(J=this.chosedTarget)===null||J===void 0||J.setAttribute("y",(we-(f-g)+Ke.height*3/4).toString());var ht=this.chosedTarget.getAttribute("font-size");const Ct=this.chosedTarget.parentNode;if(Ct){const It=Ct.querySelector("foreignObject");It&&(It.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),It.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(ht)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const nt=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let Xe,Ge,ze,Ct,It;v=(ae=this.chosedTarget)===null||ae===void 0?void 0:ae.getBBox(),this._stratchPos.indexOf("right")!==-1&&v.width+be-c<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&v.width-(be-c)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&v.height-(we-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&v.height+(we-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top")),Xe=nt.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,_t=>{const[Bt,at]=_t.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(Ct=new p.default(be-c).mul(new p.default(Bt-v.x).div(v.width))),this._stratchPos.indexOf("left")!==-1&&(Ct=new p.default(be-c).mul(new p.default(v.x+v.width-Bt).div(v.width))),(Number.isNaN(Ct)||!Ct)&&(Ct=new p.default(0)),Ge=new p.default(Bt).add(Ct)):Ge=new p.default(Bt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(It=new p.default(we-f).mul(new p.default(v.y+v.height-at).div(v.height))),this._stratchPos.indexOf("bottom")!==-1&&(It=new p.default(we-f).mul(new p.default(at-v.y).div(v.height))),(Number.isNaN(It)||!It)&&(It=new p.default(0)),ze=new p.default(at).add(It)):ze=new p.default(at),`${Ge.toFixed(16)},${ze.toFixed(16)}`}),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("d",Xe);break;case"ellipse":var mt=Number((q=this.chosedTarget)===null||q===void 0?void 0:q.getAttribute("cx")),kt=Number((fe=this.chosedTarget)===null||fe===void 0?void 0:fe.getAttribute("cy")),qe=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("rx")),tt=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(mt+=(be-c)*.5,qe-=(be-c)*.5):this._stratchPos.indexOf("right")!==-1&&(mt+=(be-c)*.5,qe+=(be-c)*.5),this._stratchPos.indexOf("top")!==-1?(kt+=(we-f)*.5,tt-=(we-f)*.5):this._stratchPos.indexOf("bottom")!==-1&&(kt+=(we-f)*.5,tt+=(we-f)*.5),qe<0?this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left"):((le=this.chosedTarget)===null||le===void 0||le.setAttribute("cx",mt.toString()),(de=this.chosedTarget)===null||de===void 0||de.setAttribute("rx",qe.toString())),tt<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top"):((he=this.chosedTarget)===null||he===void 0||he.setAttribute("cy",kt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("ry",tt.toString()));break;case"rect":var yt=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),Lt=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("y")),We=Number((V=this.chosedTarget)===null||V===void 0?void 0:V.getAttribute("width")),Oe=Number((Ce=this.chosedTarget)===null||Ce===void 0?void 0:Ce.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(yt+=be-c,We-=be-c):this._stratchPos.indexOf("right")!==-1&&(We+=be-c),We<0?this._stratchPos=this._stratchPos.replace(/left|right/g,_t=>_t==="left"?"right":"left"):((ve=this.chosedTarget)===null||ve===void 0||ve.setAttribute("x",yt.toString()),(ye=this.chosedTarget)===null||ye===void 0||ye.setAttribute("width",We.toString())),this._stratchPos.indexOf("top")!==-1?(Lt+=we-f,Oe-=we-f):this._stratchPos.indexOf("bottom")!==-1&&(Oe+=we-f),Oe<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,_t=>_t==="top"?"bottom":"top"):((Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("y",Lt.toString()),(me=this.chosedTarget)===null||me===void 0||me.setAttribute("height",Oe.toString()));break}this.updateSelectionBox(),c=H.clientX+this._offsetX,f=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=w==null?void 0:w.lastElementChild;if(H){const $=H.previousElementSibling;w==null||w.removeChild($)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))},P=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()},D=H=>{if(!this._isTouch)return;const $=H.touches[0],{target:K}=$;if(K.tagName==="ellipse"||K.tagName==="path"||K.tagName==="rect"||K.tagName==="arrow"||K.tagName==="text")if(K.getAttribute("type")=="handle"){c=$.clientX+this._offsetX,f=$.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=this.chosedTarget.getBBox().y,this.chosedTarget.getBBox().width,this.chosedTarget.getBBox().height,this.isStretch=!0;const{id:G}=$.target;this._stratchPos=G}else this.chosedTarget!=K&&(this.isDuplicate=!1,this.chosedTarget=K),this.showHiddenSelectedBox(!0),this.isChosed=!0,this.isHolding=!0,c=$.clientX+this._offsetX,f=$.clientY+this._offsetY,m=this.chosedTarget.getBBox().x,g=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&&$.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,c=$.clientX+this._offsetX,f=$.clientY+this._offsetY;const G=document.createElementNS("http://www.w3.org/2000/svg","g");G.setAttribute("id",`${this._currentMode}_${this.getTime()}`);let j;switch(this._currentMode){case"path":j=document.createElementNS("http://www.w3.org/2000/svg","path"),j.setAttribute("d",`M ${c},${f}`),j.setAttribute("stroke",this._Pathcolor),j.setAttribute("stroke-width",this._PathstrokeWidth),j.setAttribute("fill","transparent"),G.setAttribute("type","path");break;case"ellipse":j=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),j.setAttribute("cx",c.toString()),j.setAttribute("cy",f.toString()),j.setAttribute("rx","0"),j.setAttribute("ry","0"),j.setAttribute("stroke",this._Ellipsecolor),j.setAttribute("stroke-width",this._EllipsestrokeWidth),j.setAttribute("fill","transparent"),G.setAttribute("type","ellipse");break;case"rect":j=document.createElementNS("http://www.w3.org/2000/svg","rect"),j.setAttribute("x",c.toString()),j.setAttribute("y",f.toString()),j.setAttribute("stroke",this._Rectcolor),j.setAttribute("stroke-width",this._RectstrokeWidth),j.setAttribute("fill","transparent"),G.setAttribute("type","rect");break;case"arrow":j=document.createElementNS("http://www.w3.org/2000/svg","path"),j.setAttribute("d",`M ${c},${f}`),j.setAttribute("stroke-width","20"),j.setAttribute("stroke","transparent"),j.setAttribute("fill",this._Arrowcolor),G.setAttribute("type","arrow");break;case"text":this.eventTrigger.emit("clickCreateText",$);break}this._currentMode!="text"&&this._currentMode!=""&&(G.appendChild(j),w==null||w.insertBefore(G,w==null?void 0:w.lastElementChild)),this.isChosed=!1}}},R=H=>{var $,K,G,j,N,I,L,U,O,Q,W,Z,J,ne,ae,ce,q,fe,re,te,le,de,he,ue,pe,se,V,Ce,ve,ye,Ae,me;if(!this._isTouch)return;const be=H.touches[0],we=be.clientX+this._offsetX,Te=be.clientY+this._offsetY;let He;if(this.isCreating)switch(this.isDrawing=!0,this._currentMode){case"path":He=document.querySelectorAll("g");const Ct=[];He.forEach(at=>{at.getAttribute("type")=="path"&&Ct.push(at)});const Ot=Ct[Ct.length-1].querySelector("path");let Ze=Ot.getAttribute("d");Ze&&(Ze+=`L ${we},${Te}`,Ot.setAttribute("d",Ze));break;case"ellipse":var je=document.querySelectorAll("ellipse"),qe=je[je.length-1];if(qe){var tt=Math.abs(we-c)/2,mt=Math.abs(Te-f)/2;qe.setAttribute("cx",((we+c)/2).toString()),qe.setAttribute("cy",((Te+f)/2).toString()),qe.setAttribute("rx",tt.toString()),qe.setAttribute("ry",mt.toString())}break;case"rect":var kt=document.querySelectorAll("rect"),ht=kt[kt.length-10],yt=ht.getAttribute("x"),Lt=ht.getAttribute("y");if(yt&&Lt){var We=Math.abs(parseInt(yt)-we),Oe=Math.abs(parseInt(Lt)-Te);ht.setAttribute("width",We.toString()),ht.setAttribute("height",Oe.toString()),ht.setAttribute("rx","9"),ht.setAttribute("ry","9"),ht.setAttribute("type","comment")}break;case"arrow":He=document.querySelectorAll("g");const gt=[];He.forEach(at=>{at.getAttribute("type")=="arrow"&>.push(at)});const _t=gt[gt.length-1].querySelector("path");if(_t.getAttribute("d")){const at=b(we,c,Te,f);_t.setAttribute("d",at)}break;case"text":this.isDrawing=!1;break}else if(this.isHolding){(Math.abs(we-c)>=1||Math.abs(Te-f)>=1)&&(this.isMoving=!0);const Ct=($=this.chosedTarget)===null||$===void 0?void 0:$.getBBox();switch(this.chosedTarget.tagName){case"path":const Ot=((K=this.chosedTarget)===null||K===void 0?void 0:K.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,_t=>{const[Bt,at]=_t.split(",").map(parseFloat),jt=Number(Bt)+Number(we)-Number(Ct.x)-(Number(c)-Number(m)),rr=Number(at)+Number(Te)-Number(Ct.y)-(Number(f)-Number(g));return`${jt.toString()},${rr.toString()}`});(G=this.chosedTarget)===null||G===void 0||G.setAttribute("d",Ot);break;case"ellipse":var Ke=Number((j=this.chosedTarget)===null||j===void 0?void 0:j.getAttribute("cx")),nt=Number((N=this.chosedTarget)===null||N===void 0?void 0:N.getAttribute("cy"));const Ze=Number((I=this.chosedTarget)===null||I===void 0?void 0:I.getAttribute("rx")),gt=Number((L=this.chosedTarget)===null||L===void 0?void 0:L.getAttribute("ry"));(U=this.chosedTarget)===null||U===void 0||U.setAttribute("cx",we-(c-m)/2+Ze),(O=this.chosedTarget)===null||O===void 0||O.setAttribute("cy",Te-(f-g)/2+gt);break;case"rect":(Q=this.chosedTarget)===null||Q===void 0||Q.setAttribute("x",we-(c-m)),(W=this.chosedTarget)===null||W===void 0||W.setAttribute("y",Te-(f-g));break;case"text":(Z=this.chosedTarget)===null||Z===void 0||Z.setAttribute("x",(we-(c-m)).toString()),(J=this.chosedTarget)===null||J===void 0||J.setAttribute("y",(Te-(f-g)+Ct.height*3/4).toString());var Xe=this.chosedTarget.getAttribute("font-size");const vt=this.chosedTarget.parentNode;if(vt){const _t=vt.querySelector("foreignObject");_t&&(_t.setAttribute("x",Number(this.chosedTarget.getAttribute("x"))-3),_t.setAttribute("y",Number(this.chosedTarget.getAttribute("y"))-(24-Number(Xe)/2)))}break}this.updateSelectionBox()}else if(this.isStretch){switch(this.chosedTarget.parentNode.getAttribute("type")){case"path":const It=(ne=this.chosedTarget)===null||ne===void 0?void 0:ne.getAttribute("d");let Ot,Ze,gt,vt,_t;v=(ae=this.chosedTarget)===null||ae===void 0?void 0:ae.getBBox(),this._stratchPos.indexOf("right")!==-1&&v.width+we-c<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left")),this._stratchPos.indexOf("left")!==-1&&v.width-(we-c)<=0&&(this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left")),this._stratchPos.indexOf("top")!==-1&&v.height-(Te-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top")),this._stratchPos.indexOf("bottom")!==-1&&v.height+(Te-f)<=0&&(this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top")),Ot=It.replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,ct=>{const[Rt,qt]=ct.split(",").map(parseFloat);return this._stratchPos.indexOf("left")!==-1||this._stratchPos.indexOf("right")!==-1?(this._stratchPos.indexOf("right")!==-1&&(vt=new p.default(we-c).mul(new p.default(Rt-v.x).div(v.width))),this._stratchPos.indexOf("left")!==-1&&(vt=new p.default(we-c).mul(new p.default(v.x+v.width-Rt).div(v.width))),(Number.isNaN(vt)||!vt)&&(vt=new p.default(0)),Ze=new p.default(Rt).add(vt)):Ze=new p.default(Rt),this._stratchPos.indexOf("top")!==-1||this._stratchPos.indexOf("bottom")!==-1?(this._stratchPos.indexOf("top")!==-1&&(_t=new p.default(Te-f).mul(new p.default(v.y+v.height-qt).div(v.height))),this._stratchPos.indexOf("bottom")!==-1&&(_t=new p.default(Te-f).mul(new p.default(qt-v.y).div(v.height))),(Number.isNaN(_t)||!_t)&&(_t=new p.default(0)),gt=new p.default(qt).add(_t)):gt=new p.default(qt),`${Ze.toFixed(16)},${gt.toFixed(16)}`}),(ce=this.chosedTarget)===null||ce===void 0||ce.setAttribute("d",Ot);break;case"ellipse":var Ke=Number((q=this.chosedTarget)===null||q===void 0?void 0:q.getAttribute("cx")),nt=Number((fe=this.chosedTarget)===null||fe===void 0?void 0:fe.getAttribute("cy")),tt=Number((re=this.chosedTarget)===null||re===void 0?void 0:re.getAttribute("rx")),mt=Number((te=this.chosedTarget)===null||te===void 0?void 0:te.getAttribute("ry"));this._stratchPos.indexOf("left")!==-1?(Ke+=(we-c)*.5,tt-=(we-c)*.5):this._stratchPos.indexOf("right")!==-1&&(Ke+=(we-c)*.5,tt+=(we-c)*.5),this._stratchPos.indexOf("top")!==-1?(nt+=(Te-f)*.5,mt-=(Te-f)*.5):this._stratchPos.indexOf("bottom")!==-1&&(nt+=(Te-f)*.5,mt+=(Te-f)*.5),tt<0?this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left"):((le=this.chosedTarget)===null||le===void 0||le.setAttribute("cx",Ke.toString()),(de=this.chosedTarget)===null||de===void 0||de.setAttribute("rx",tt.toString())),mt<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top"):((he=this.chosedTarget)===null||he===void 0||he.setAttribute("cy",nt.toString()),(ue=this.chosedTarget)===null||ue===void 0||ue.setAttribute("ry",mt.toString()));break;case"rect":var Ge=Number((pe=this.chosedTarget)===null||pe===void 0?void 0:pe.getAttribute("x")),ze=Number((se=this.chosedTarget)===null||se===void 0?void 0:se.getAttribute("y")),We=Number((V=this.chosedTarget)===null||V===void 0?void 0:V.getAttribute("width")),Oe=Number((Ce=this.chosedTarget)===null||Ce===void 0?void 0:Ce.getAttribute("height"));this._stratchPos.indexOf("left")!==-1?(Ge+=we-c,We-=we-c):this._stratchPos.indexOf("right")!==-1&&(We+=we-c),We<0?this._stratchPos=this._stratchPos.replace(/left|right/g,ct=>ct==="left"?"right":"left"):((ve=this.chosedTarget)===null||ve===void 0||ve.setAttribute("x",Ge.toString()),(ye=this.chosedTarget)===null||ye===void 0||ye.setAttribute("width",We.toString())),this._stratchPos.indexOf("top")!==-1?(ze+=Te-f,Oe-=Te-f):this._stratchPos.indexOf("bottom")!==-1&&(Oe+=Te-f),Oe<0?this._stratchPos=this._stratchPos.replace(/top|bottom/g,ct=>ct==="top"?"bottom":"top"):((Ae=this.chosedTarget)===null||Ae===void 0||Ae.setAttribute("y",ze.toString()),(me=this.chosedTarget)===null||me===void 0||me.setAttribute("height",Oe.toString()));break}this.updateSelectionBox(),c=be.clientX+this._offsetX,f=be.clientY+this._offsetY}},z=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:w.lastElementChild;if($){const K=$.previousElementSibling;w==null||w.removeChild(K)}}this.chosedTarget=null,this.isCreating=!1}else this.isStretch&&(this.isStretch=!1,this.AddNewState(()=>{}))};w?(document.addEventListener("keydown",P.bind(this)),w.addEventListener("dblclick",_.bind(this)),w.addEventListener("mousedown",x.bind(this)),document.addEventListener("mousemove",E.bind(this)),w.addEventListener("mouseup",k.bind(this)),w.addEventListener("touchstart",D.bind(this)),document.addEventListener("touchmove",R.bind(this)),w.addEventListener("touchend",z.bind(this))):this.log("no svgImage");const F=()=>{const H=document.getElementById("svgImage");H?(document.removeEventListener("keydown",P.bind(this)),H.removeEventListener("dblclick",_.bind(this)),H.removeEventListener("mousedown",x.bind(this)),document.removeEventListener("mousemove",E.bind(this)),H.removeEventListener("mouseup",k.bind(this)),H.removeEventListener("touchstart",D.bind(this)),document.removeEventListener("touchmove",R.bind(this)),H.removeEventListener("touchend",z.bind(this))):this.log("no svgImage");const $=document.getElementById("comments_panel");$&&($.innerHTML=""),this.eventTrigger.off("clearAll",F)};this.eventTrigger.on("clearAll",F)})}clickCreateText(c,f){var m,g;let v;c.touches?v=c.touches[0]:v=c,this.showHiddenSelectedBox(!1);const b=v.clientX+this._offsetX,w=v.clientY+this._offsetY,_=document.createElementNS("http://www.w3.org/2000/svg","g");if(_.setAttribute("id",`${this._currentMode}_${this.getTime()}`),!this.isTyping&&!this.isChosed){const x=document.createElementNS("http://www.w3.org/2000/svg","text");x.setAttribute("x",b+3),x.setAttribute("y",(w+24-Number(this._FontSize)/2).toString()),x.setAttribute("font-size",this._FontSize),x.setAttribute("stroke",this._Textcolor),x.setAttribute("stroke-width",this._TextstrokeWidth),x.setAttribute("fill",this._Textcolor),x.setAttribute("lengthAdjust","spacingAndGlyphs"),x.textContent=f,_.setAttribute("type","text"),_.appendChild(x);const E=document.getElementById("selectionBox_g");E&&((m=E.parentNode)===null||m===void 0||m.insertBefore(_,(g=E.parentNode)===null||g===void 0?void 0:g.lastElementChild)),this.isTyping=!0,this.AddNewState(()=>{this.eventTrigger.emit("createNew")})}}getInitVector(c,f){const m=Math.sqrt(c*c+f*f);return m==0?[0,0]:[c/m,f/m]}getVerticalUnitVector(c,f){if(Math.sqrt(c*c+f*f)===0)return[0,0];const g=-f,v=c,b=Math.sqrt(g*g+v*v),w=g/b,_=v/b;return[w,_]}getTwoPointLength(c,f){return c==f?0:Math.sqrt(c*c+f*f)}hiddenAllInput(){const c=document.querySelectorAll("foreignObject");c.length>0&&c.forEach(f=>{const m=f.querySelector("input"),g=f.parentNode;let v;g&&(v=g.querySelector("text")),v&&m&&(m.value!=""?v.textContent=m.value:v.textContent="双击此处输入内容",m.style.display="none")})}showHiddenSelectedBox(c){if(c){const m=this.chosedTarget.getBBox();this.selectionBox.setAttribute("x",m.x),this.selectionBox.setAttribute("y",m.y),this.selectionBox.setAttribute("width",m.width),this.selectionBox.setAttribute("height",m.height),this.selectionBox.style.display="inline";for(var f=0;f<8;f++)this.handles[f].style.display="inline"}else{this.selectionBox.style.display="none";for(var f=0;f<8;f++)this.handles[f].style.display="none"}this.updateSelectionBox()}updateSelectionBox(){var c;const f=(c=this.chosedTarget)===null||c===void 0?void 0:c.getBBox();if(f){this.selectionBox.setAttribute("x",f.x-4),this.selectionBox.setAttribute("y",f.y-4),this.selectionBox.setAttribute("width",f.width+8),this.selectionBox.setAttribute("height",f.height+8);const m=this.selectionBox.getBBox();for(let g=0;g<8;g++){const v=this.handles[g];switch(g){case 0:v.setAttribute("x",m.x-4),v.setAttribute("y",m.y-4);break;case 1:v.setAttribute("x",m.x+m.width/2-4),v.setAttribute("y",m.y-4);break;case 2:v.setAttribute("x",m.x+m.width-4),v.setAttribute("y",m.y-4);break;case 3:v.setAttribute("x",m.x+m.width-4),v.setAttribute("y",m.y+m.height/2-4);break;case 4:v.setAttribute("x",m.x+m.width-4),v.setAttribute("y",m.y+m.height-4);break;case 5:v.setAttribute("x",m.x+m.width/2-4),v.setAttribute("y",m.y+m.height-4);break;case 6:v.setAttribute("x",m.x-4),v.setAttribute("y",m.y+m.height-4);break;case 7:v.setAttribute("x",m.x-4),v.setAttribute("y",m.y+m.height/2-4);break}}}}publishComments(){this.deleteSvgCommentsListeners()}updateCommentsColor(){document.querySelectorAll("path").forEach(g=>{g.setAttribute("stroke","red")}),document.querySelectorAll("ellipse").forEach(g=>{g.setAttribute("stroke","blue")}),document.querySelectorAll("rect").forEach(g=>{g.id!="selectionBox"&&g.setAttribute("stroke","green")})}deleteSvgCommentsListeners(){const c=document.getElementById("svgImage");c&&(c.removeEventListener("mousedown",()=>{}),document.removeEventListener("mousemove",()=>{}),c.removeEventListener("mouseup",()=>{}),c.removeEventListener("mouseover",()=>{}))}deleteCurrentComments(){if(this.isChosed){const c=document.getElementById("svgImage");c==null||c.removeChild(this.chosedTarget.parentNode),this.showHiddenSelectedBox(!1)}this.AddNewState(()=>{})}getTime(){const c=new Date,f=c.getFullYear(),m=c.getMonth()+1<10?`0${c.getMonth()+1}`:c.getMonth()+1,g=c.getDate()<10?`0${c.getDate()}`:c.getDate(),v=c.getHours()<10?`0${c.getHours()}`:c.getHours(),b=c.getMinutes()<10?`0${c.getMinutes()}`:c.getMinutes(),w=c.getSeconds()<10?`0${c.getSeconds()}`:c.getSeconds();return f+m+g+v+b+w}duplicateComment(){var c,f,m,g,v,b,w,_,x,E,k,P,D,R;if(this.isChosed){const F=document.getElementById("svgImage"),H=this.chosedTarget.parentNode.cloneNode(!0);switch(F==null||F.insertBefore(H,F==null?void 0:F.lastElementChild),this.chosedTarget=H.firstChild,this.chosedTarget.tagName){case"path":const K=((c=this.chosedTarget)===null||c===void 0?void 0:c.getAttribute("d")).replace(/-?\d+(\.\d+)?\s*,\s*-?\d+(\.\d+)?/g,j=>{const[N,I]=j.split(",").map(parseFloat),L=N+20,U=I+10;return`${L},${U}`});(f=this.chosedTarget)===null||f===void 0||f.setAttribute("d",K);break;case"ellipse":(m=this.chosedTarget)===null||m===void 0||m.setAttribute("cx",(Number((g=this.chosedTarget)===null||g===void 0?void 0:g.getAttribute("cx"))+20).toString()),(v=this.chosedTarget)===null||v===void 0||v.setAttribute("cy",(Number((b=this.chosedTarget)===null||b===void 0?void 0:b.getAttribute("cy"))+10).toString());break;case"rect":(w=this.chosedTarget)===null||w===void 0||w.setAttribute("x",(Number((_=this.chosedTarget)===null||_===void 0?void 0:_.getAttribute("x"))+20).toString()),(x=this.chosedTarget)===null||x===void 0||x.setAttribute("y",(Number((E=this.chosedTarget)===null||E===void 0?void 0:E.getAttribute("y"))+10).toString());break;case"text":(k=this.chosedTarget)===null||k===void 0||k.setAttribute("x",(Number((P=this.chosedTarget)===null||P===void 0?void 0:P.getAttribute("x"))+20).toString()),(D=this.chosedTarget)===null||D===void 0||D.setAttribute("y",(Number((R=this.chosedTarget)===null||R===void 0?void 0:R.getAttribute("x"))+10).toString());var z=this.chosedTarget.getAttribute("font-size");const G=this.chosedTarget.parentNode;if(G){const j=G.querySelector("foreignObject");j&&(j.setAttribute("x",(Number(this.chosedTarget.getAttribute("x"))-3+20).toString()),j.setAttribute("y",(Number(this.chosedTarget.getAttribute("y"))-(24-Number(z)/2)+10).toString()))}break}this.updateSelectionBox()}this.AddNewState(()=>{})}AddNewState(c){this.saveCurrentState(f=>{this._revocationMechanism&&this._revocationMechanism&&this._revocationMechanism.AddNewState(f,c)}),this.eventTrigger.emit("newState")}saveCurrentState(c){function f(v){const b={};for(let w=0;w<v.length;w++){const _=v[w];b[_.name]=_.value}return b}const m=document.getElementById("svgImage");if(m){const v=m.querySelectorAll("g");var g=[];v.forEach(b=>{if(b.getAttribute("id")){const _=b.attributes,x=b.children,E=new Map;let k=null;if(b.getAttribute("type")==="text"){for(let P=0;P<x.length;P++){const{tagName:D}=x[P];E.set(D,f(x[P].attributes)),D==="text"&&(k=x[P].textContent)}var w=new d(_,E,k);g.push(w)}else{for(let D=0;D<x.length;D++)E.set(x[D].tagName,f(x[D].attributes));var w=new d(_,E,null);g.push(w)}}})}c(g)}displayState(c){const f=document.getElementById("svgImage");if(f){f.querySelectorAll("g").forEach(b=>{b.getAttribute("id")&&f.removeChild(b)});for(const b in c){const w=c[b];var m=document.createElementNS("http://www.w3.org/2000/svg","g");const{attributes:_}=w;var{textContent:g}=w;for(let P=0;P<_.length;P++){const D=_[P].name,R=_[P].value;m.setAttribute(D,R)}const{childrenContents:x}=w;x.forEach((P,D)=>{const R=document.createElementNS("http://www.w3.org/2000/svg",D);if(D=="text"&&(R.textContent=g),P)for(const z in P){const F=P[z];R.setAttribute(z,F)}m.appendChild(R)}),f==null||f.insertBefore(m,f==null?void 0:f.lastElementChild);const E=f==null?void 0:f.querySelector("image");E&&(f==null||f.insertBefore(E,f==null?void 0:f.firstElementChild));const k=f==null?void 0:f.querySelector("#selectionBox_g");k&&(f==null||f.removeChild(k),f==null||f.appendChild(k))}}}autoSaveInput(c){this.isTyping&&(this.isTyping=!1,this.hiddenAllInput(),this.AddNewState(()=>{c&&c()}))}setCurrentMode(c){this.autoSaveInput(),this._currentMode=c,c===""&&this.eventTrigger.emit("cancelAllMode")}ReDo(c){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.ReDo(f=>{this.displayState(f),this.showHiddenSelectedBox(!1),c&&c()}),this.checkSelectionBox()}UnDo(c){this.autoSaveInput(),this._revocationMechanism&&this._revocationMechanism.UnDo(f=>{this.displayState(f),this.showHiddenSelectedBox(!1),c&&c()}),this.checkSelectionBox()}checkSelectionBox(){const c=document.getElementById("svgImage"),f=c==null?void 0:c.querySelector("#selectionBox_g");if(f){if(f.childNodes.length>2)return;c==null||c.removeChild(f)}this.selectionBox=null,this.handles=[];const m=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",m.setAttribute("id","selectionBox_g"),m.appendChild(this.selectionBox);for(let v=0;v<8;v++){const b=document.createElementNS("http://www.w3.org/2000/svg","rect");b.setAttribute("width","8"),b.setAttribute("height","8"),b.setAttribute("rx","2"),b.setAttribute("ry","2");var g;v==0&&(g="left_top",b.setAttribute("id",g)),v==1&&(g="top",b.setAttribute("id",g)),v==2&&(g="right_top",b.setAttribute("id",g)),v==3&&(g="right",b.setAttribute("id",g)),v==4&&(g="right_bottom",b.setAttribute("id",g)),v==5&&(g="bottom",b.setAttribute("id",g)),v==6&&(g="left_bottom",b.setAttribute("id",g)),v==7&&(g="left",b.setAttribute("id",g)),b.setAttribute("type","handle"),b.setAttribute("fill","white"),b.setAttribute("stroke-width","0.8"),b.setAttribute("stroke","#066CFC"),b.setAttribute("class","selection_box_handle"),b.style.cursor="pointer",b.style.display="none",m.appendChild(b),this.handles.push(b)}c==null||c.appendChild(m)}endCommentsTool(){var c;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),(c=this._revocationMechanism)===null||c===void 0||c.destroy(),this._revocationMechanism=null,this.eventTrigger.emit("clearAll")}saveComments(c){this.showHiddenSelectedBox(!1),this.autoSaveInput(c)}setTargetColor(c){if(this.chosedTarget.tagName=="text")this.chosedTarget.setAttribute("stroke",c),this.chosedTarget.setAttribute("fill",c);else if(this.chosedTarget.tagName=="path"){const f=this.chosedTarget.parentNode;f&&f.getAttribute("type")=="arrow"?(this.chosedTarget.setAttribute("stroke",c),this.chosedTarget.setAttribute("fill",c)):this.chosedTarget.setAttribute("stroke",c)}else this.chosedTarget.setAttribute("stroke",c);this.AddNewState(()=>{})}setTargetWidth(c){this.chosedTarget.tagName=="text"?this.chosedTarget.setAttribute("font-size",c.toString()):this.chosedTarget.setAttribute("stroke-width",c.toString()),this.AddNewState(()=>{})}set isTouch(c){this._isTouch=c}set offsetX(c){this._offsetX=c}set offsetY(c){this._offsetY=c}set pathColor(c){this._Pathcolor=c}set ellipseColor(c){this._Ellipsecolor=c}set rectColor(c){this._Rectcolor=c}set arrowColor(c){this._Arrowcolor=c}set textColor(c){this._Textcolor=c}set pathStrokeWidth(c){this._PathstrokeWidth=c}set ellipseStrokeWidth(c){this._EllipsestrokeWidth=c}set rectStrokeWidth(c){this._RectstrokeWidth=c}set arrowSize(c){this._ArrowstrokeWidth=c}set textFontSize(c){this._FontSize=c}destroy(){this.endCommentsTool()}}class h{constructor(c){this.eventTrigger=c,this.stateMap=new Map,this.stateIndex=0,this.stateMap.set(0,null)}AddNewState(c,f){if(this.stateIndex===0)this.stateIndex+=1,this.stateMap.set(this.stateIndex,c),this.stateIndex+=1;else{const w=this.stateMap.get(this.stateIndex-1);m(c,w)||(this.stateMap.set(this.stateIndex,c),this.stateIndex+=1)}if(this.stateMap.size-1>this.stateIndex){for(let w=this.stateIndex;w<=this.stateMap.size;w++)this.stateMap.delete(w);this.stateIndex=this.stateMap.size-1}f();function m(w,_){if(_==null||w==null||w.length!==_.length)return!1;for(let x=0;x<w.length;x++){const E=w[x],k=_[x];if(!g(E,k))return!1}return!0}function g(w,_){return!(Object.keys(w).length!==Object.keys(_).length||!b(w.attributes,_.attributes)||!v(w.childrenContents,_.childrenContents)||w.textContent!==_.textContent)}function v(w,_){if(w.size!==_.size)return!1;for(const[x,E]of w)if(!_.has(x)||_.get(x)!==E)return!1;return!0}function b(w,_){if(w.length!==_.length)return!1;for(let x=0;x<w.length;x++){const E=w.item(x),k=_.item(x);if(E&&k&&(E.name!==k.name||E.value!==k.value))return!1}return!0}}ReDo(c){this.stateIndex==this.stateMap.size?(this.eventTrigger.emit("noNewState"),c(this.stateMap.get(this.stateIndex-1))):(this.stateIndex+=1,this.stateIndex==this.stateMap.size&&this.eventTrigger.emit("noNewState"),c(this.stateMap.get(this.stateIndex-1)))}UnDo(c){this.stateIndex==1?this.eventTrigger.emit("noPreviousState"):(this.stateIndex-=1,this.stateIndex==1&&this.eventTrigger.emit("noPreviousState"),c(this.stateMap.get(this.stateIndex-1)))}destroy(){this.stateIndex=0,this.stateMap.clear()}}class d{constructor(c,f,m){this.attributes=c,this.childrenContents=f,this.textContent=m}}},"./src/toolbar/FirstPersonMode.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u){super(d,u);const{cameraControl:c}=this.viewer,{cameraControlNavModeMediator:f}=u;c.navMode="orbit",c.followPointer=!0,this.cameraControl=c,c.on("personModeSpeedUp",m=>{d.eventTrigger.emit("personModeSpeedUp",m)}),c.on("personModeSpeedDown",m=>{d.eventTrigger.emit("personModeSpeedDown",m)}),this.on("active",m=>{f.setFirstPersonModeActive(m),m&&(c.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 p.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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");p.math.vec3();class A extends y.default{constructor(d,u={}){super(d,u)}fit(d){const{viewer:u}=this,{scene:c}=u,{center:f}=c;let m;this.bimViewer.multiModel?m=c.getAABB(c.visibleObjectIds):m=c.aabb;const g=p.math.getAABB3Diag(m);u.cameraControl.pivotPos=f,u.cameraControl.planView&&(u.cameraControl.planView=!1),u.cameraFlight.flyTo({aabb:m,orthoScale:g*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"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/Controller.ts");class y extends p.default{constructor(h,d){super(h,d),this.on("active",u=>{u?(this.viewer.cameraControl.doublePickFlyTo=!1,this._onPick=this.viewer.cameraControl.on("picked",c=>{c.entity&&(c.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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./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 y.default{constructor(u,c={}){if(super(u,c),this._markers=new Map,this._visible=!0,this._focusOnClick=!1,this._occludable=!1,this._defaultIcon=A,this._typeIcons=new Map,this._idCounter=0,this.eventTrigger=u.eventTrigger,this._focusOnClick=!!c.focusOnClick,this._occludable=!!c.occludable,document.getElementById("myMarkerDiv"))this.markerWrapper=document.getElementById("myMarkerDiv");else{this.markerWrapper=document.createElement("div"),this.markerWrapper.id="myMarkerDiv";const{canvas:f}=u.viewer.scene.canvas;f.parentNode.insertBefore(this.markerWrapper,f)}this.annotationsPlugin=new p.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,labelPlacement:"above",labelOffset:c.labelOffset,values:{id:"",iconPath:A,text:""}}),this.annotationsPlugin.on("markerClicked",f=>{this._focusedMarkerLabelId&&this._focusedMarkerLabelId!==f.id&&this._clearFocusedMarkerLabel();const m=this._markers.get(f.id),g=m?m.worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]];this.eventTrigger.emit("markerClicked",m??{id:f.id,worldPos:g}),this._focusOnClick&&g&&this._focusOn(g)}),this.annotationsPlugin.on("labelClicked",f=>{const m=this._markers.get(f.id),g=m?m.worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]];this.eventTrigger.emit("markerLabelClicked",m??{id:f.id,worldPos:g})}),this.annotationsPlugin.on("markerDoubleClicked",f=>{const m=this._markers.get(f.id);this.eventTrigger.emit("markerDoubleClicked",m??{id:f.id,worldPos:[f.worldPos[0],f.worldPos[1],f.worldPos[2]]})}),this.annotationsPlugin.on("markerMouseEnter",f=>{if(this._focusedMarkerLabelId===f.id)return;const m=this._markers.get(f.id);m&&m.text&&f.setLabelShown(!0)}),this.annotationsPlugin.on("markerMouseLeave",f=>{this._focusedMarkerLabelId!==f.id&&f.setLabelShown(!1)}),this.viewer.cameraControl.on("mouseDownEntity",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("mouseDownNothing",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("rightClick",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("doublePicked",()=>this._clearFocusedMarkerLabel()),this.viewer.cameraControl.on("doublePickedNothing",()=>this._clearFocusedMarkerLabel()),this.on("active",f=>{f||this._clearFocusedMarkerLabel()}),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 c in u)Object.prototype.hasOwnProperty.call(u,c)&&this._typeIcons.set(c,u[c])}setTypeIcon(u,c){this._typeIcons.set(u,c)}setFocusOnClick(u){this._focusOnClick=u}setOccludable(u){this._occludable=u;const c=this.annotationsPlugin.annotations;for(const f in c)Object.prototype.hasOwnProperty.call(c,f)&&(c[f].occludable=u)}setLabelOffset(u){this.annotationsPlugin._labelOffset=u;const c=this.annotationsPlugin.annotations;for(const f in c)Object.prototype.hasOwnProperty.call(c,f)&&(c[f].labelOffset=u)}clickToCreateMarker(u){if(!this.getActive()||!this.getEnabled())return;const c=this.getCanvasPos(u);if(!c)return;const f=this.viewer.scene.pick({canvasPos:c,pickSurface:!0});if(f)return this._createMarkerFromPickResult(f)}addMarker(u,c,f,m,g){const v=m??this._generateId(),b=this._resolveIcon(f);this.annotationsPlugin.createAnnotation({id:v,worldPos:[u[0],u[1],u[2]],occludable:this._occludable,markerShown:this._visible,labelShown:!1,values:{id:v,iconPath:b,text:g??""}});const w={id:v,worldPos:[u[0],u[1],u[2]],type:f,data:c,text:g};return this._markers.set(v,w),this.eventTrigger.emit("markerCreated",w),w}removeMarker(u){const c=this._markers.get(u);if(!c){this.warn("removeMarker() - Marker not found: "+u);return}this.annotationsPlugin.destroyAnnotation(u),this._markers.delete(u),this.eventTrigger.emit("markerRemoved",c)}setMarkerVisible(u,c){(Array.isArray(u)?u:[u]).forEach(m=>{const g=this.annotationsPlugin.annotations[m];g?g.setMarkerShown(c):this.warn("setMarkerVisible() - Marker not found: "+m)})}showMarker(u){this.setMarkerVisible(u,!0)}hideMarker(u){this.setMarkerVisible(u,!1)}getMarkerById(u){return this._markers.get(u)}focusMarker(u,c,f,m=!0,g=()=>{}){typeof m=="function"&&(g=m,m=!0);const v=this._markers.get(u);if(!v){this.warn("focusMarker() - Marker not found: "+u);return}if(c===void 0&&f===void 0){this._setMarkerLabelShown(u,m),this._focusOn(v.worldPos),g();return}if(c===void 0||f===void 0){this.warn("focusMarker() - Direction and distance must be provided together");return}const b=this._resolveViewDirection(c);if(!b){this.warn("focusMarker() - Invalid direction: "+c);return}this._setMarkerLabelShown(u,m),this._focusOnFromDirection(v.worldPos,b,f,()=>{g()})}getMarkers(){return Array.from(this._markers.values()).map(u=>Object.assign(Object.assign({},u),{worldPos:[...u.worldPos]}))}setMarkers(u){this.clear(),(u||[]).forEach(c=>{c&&c.worldPos&&c.worldPos.length>=3&&this.addMarker(c.worldPos,c.data,c.type,c.id,c.text)})}clear(){this.annotationsPlugin.clear(),this._markers.clear(),this.eventTrigger.emit("markersCleared")}getCanvasPos(u){const c=[];if(!u)u=window.event,c[0]=u.x,c[1]=u.y;else if("TouchEvent"in window&&u instanceof TouchEvent){if(!u.touches||u.touches.length===0)return;const f=u.touches[0];let m=u.target,g=0,v=0;for(;m.offsetParent;)g+=m.offsetLeft,v+=m.offsetTop,m=m.offsetParent;c[0]=f.pageX-g,c[1]=f.pageY-v}else{let f=this.viewer.scene.canvas.canvas,m=0,g=0;for(;f.offsetParent;)m+=f.offsetLeft,g+=f.offsetTop,f=f.offsetParent;c[0]=u.pageX-m,c[1]=u.pageY-g}return c}destroy(){this.clear(),this.annotationsPlugin.destroy(),this.markerWrapper&&this.markerWrapper.parentNode&&this.markerWrapper.parentNode.removeChild(this.markerWrapper),super.destroy()}_createMarkerFromPickResult(u){const c=this._generateId(),f=this._resolveIcon(void 0),m=this.annotationsPlugin.createAnnotation({id:c,pickResult:u,occludable:this._occludable,markerShown:this._visible,labelShown:!1,values:{id:c,iconPath:f}}),g={id:c,worldPos:[m.worldPos[0],m.worldPos[1],m.worldPos[2]],entityId:u.entity?u.entity.id:void 0};return this._markers.set(c,g),this.eventTrigger.emit("markerCreated",g),g}_resolveIcon(u){return u&&this._typeIcons.has(u)?this._typeIcons.get(u):this._defaultIcon}_focusOn(u){const c=[u[0],u[1],u[2]];this.viewer.cameraFlight.flyTo({look:c}),this.viewer.cameraControl.pivotPos=c}_focusOnFromDirection(u,c,f,m){const g=[u[0],u[1],u[2]],v=[g[0]+c[0]*f,g[1]+c[1]*f,g[2]+c[2]*f],b=Math.abs(c[1])>.9?[0,0,1]:[0,1,0];this.viewer.cameraFlight.flyTo({eye:v,look:g,up:b},()=>{m()}),this.viewer.cameraControl.pivotPos=g}_setMarkerLabelShown(u,c){const f=this.annotationsPlugin.annotations;for(const m in f)Object.prototype.hasOwnProperty.call(f,m)&&f[m].setLabelShown(!1);c===!0&&f[u]?(f[u].setLabelShown(!0),this._focusedMarkerLabelId=u):this._focusedMarkerLabelId=void 0}_clearFocusedMarkerLabel(){if(!this._focusedMarkerLabelId)return;const u=this.annotationsPlugin.annotations;for(const c in u)Object.prototype.hasOwnProperty.call(u,c)&&u[c].setLabelShown(!1);this._focusedMarkerLabelId=void 0}_resolveViewDirection(u){const c={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 f;if(typeof u=="string"){if(f=c[u.toLowerCase()],!f)return null}else if(Array.isArray(u)&&u.length>=3)f=[u[0],u[1],u[2]];else return null;const m=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return m===0?null:[f[0]/m,f[1]/m,f[2]/m]}_generateId(){return this._idCounter+=1,`marker_${Date.now()}_${this._idCounter}`}}},"./src/toolbar/MeasureTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./src/Controller.ts"),y=i("./src/toolbar/MeasureTools/MeasureAngleTool.ts"),A=i("./src/toolbar/MeasureTools/MeasureDistanceTool.ts");class h extends p.default{constructor(u,c){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 y.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,c=!this._tools[u].getActive()){this._toolType=u;for(let f in this._tools)u==f?this._tools[f].setActive(c):this._tools[f].setActive(!1)}getActiveByType(u){return this._tools[u].getActive()}get currentTool(){return this._tools[this._toolType]}SetMeasureAngleActive(u=!this._measure_angle_tool.getActive(),c=()=>{}){this._measure_angle_tool.setActive(u),c(this._measure_angle_tool.getActive())}SetMeasureDistanceActive(u=!this._measure_distance_tool.getActive(),c=()=>{}){this._measure_distance_tool.setActive(u),c(this._measure_distance_tool.getActive())}setAllDisActive(){for(let u in this._tools)this._tools[u].setActive(!1)}setMeasureOffSet(u,c){this.measureAngleTool.offsetX=u,this.measureAngleTool.offsetY=c,this.measureDistanceTool.offsetX=u,this.measureDistanceTool.offsetY=c}setSnapRadius(u){this.viewer.cameraControl.snapRadius=u}destroy(){this._measure_distance_tool.destroy(),this._measure_angle_tool.destroy()}}},"./src/toolbar/MeasureTools/MeasureAngleTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.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:c}=d.viewer.scene.canvas;c.parentNode.insertBefore(this.angleMeasureContainer,c),this._angleMeasurementsPlugin=new p.AngleMeasurementsPlugin(this.viewer,{container:this.angleMeasureContainer,defaultColor:"#0065FC"}),this._angleMeasurementsMouseControl=new p.AngleMeasurementsMouseControl(this._angleMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsTouchControl=new p.AngleMeasurementsTouchControl(this._angleMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._angleMeasurementsSimulateMouseControl=new p.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",c=>{this.eventTrigger.emit("newAngleMeasure",{id:c.id}),this.newMeasure=c,this.chosedTarget=null}),this._angleMeasurementsPlugin.on("measurementEnd",c=>{if(this.getMeasureResultByID(c.id)===0){this.destroyMeasurementById(c.id);return}this.eventTrigger.emit("createAngleMeasure",{id:c.id,result:this.getMeasureResultByID(c.id)}),this.setAllHightLighted(!1),this.chosedTarget=c,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._angleMeasurementsPlugin.on("mouseOver",c=>{c.measurement.setHighlighted(!0)}),this._angleMeasurementsPlugin.on("mouseLeave",c=>{c.angleMeasurement==this.chosedTarget&&this._active||c.measurement.setHighlighted(!1)}),this._angleMeasurementsPlugin.on("clickMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("touchMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickAngleMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._angleMeasurementsPlugin.on("measurementDestroyed",c=>{this.eventTrigger.emit("AngleMeasureDestroyed",{id:c.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=c=>{if(this._active&&(c.key==="Delete"||c.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 c=this.getMeasurementById(d);c.color=u}setMeasureClickbleById(d,u){const c=this.getMeasurementById(d);c.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const c in u)u[c].setHighlighted(d)}setVisibleById(d,u){const c=this.getMeasurementById(d);c.visible=u}setAngleLabelVisible(d,u){const c=this.getMeasurementById(d);c.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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.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:c}=d.viewer.scene.canvas;c.parentNode.insertBefore(this.distanceMeasureContainer,c),this._distanceMeasurementsPlugin=new p.DistanceMeasurementsPlugin(this.viewer,{container:this.distanceMeasureContainer,defaultAxisVisible:!1,defaultColor:"#0065FC"}),this._distanceMeasurementsMouseControl=new p.DistanceMeasurementsMouseControl(this._distanceMeasurementsPlugin,{snapping:!0,offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsTouchControl=new p.DistanceMeasurementsTouchControl(this._distanceMeasurementsPlugin,{offsetX:u.offsetX,offsetY:u.offsetY}),this._distanceMeasurementsSimulateMouseControl=new p.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",c=>{this.eventTrigger.emit("newDistanceMeasure",{id:c.id}),this.newMeasure=c,this.chosedTarget=null}),this._distanceMeasurementsPlugin.on("measurementEnd",c=>{if(this.getMeasureResultByID(c.id)===0){this.destroyMeasurementById(c.id);return}this.eventTrigger.emit("createDistanceMeasure",{id:c.id,result:this.getMeasureResultByID(c.id),xResult:c.xLabel,yResult:c.yLabel,zResult:c.zLabel}),this.setAllHightLighted(!1),this.chosedTarget=c,this.chosedTarget.setHighlighted(!0),this.newMeasure=null}),this._distanceMeasurementsPlugin.on("mouseOver",c=>{c.measurement.setHighlighted(!0)}),this._distanceMeasurementsPlugin.on("mouseLeave",c=>{c.distanceMeasurement==this.chosedTarget&&this._active||c.measurement.setHighlighted(!1)}),this._distanceMeasurementsPlugin.on("clickMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("touchMeasure",c=>{this.chosedTarget&&this.chosedTarget.id!==c.measurement.id&&this.chosedTarget.setHighlighted(!1),this.chosedTarget=c.measurement,this.chosedTarget.setHighlighted(!0),this.eventTrigger.emit("clickDistanceMeasure",{id:this.chosedTarget.id,result:this.getMeasureResultByID(this.chosedTarget.id)})}),this._distanceMeasurementsPlugin.on("measurementCancel",c=>{this.eventTrigger.emit("DistanceMeasureCancel",{id:c.id})}),this._distanceMeasurementsPlugin.on("measurementDestroyed",c=>{this.eventTrigger.emit("DistanceMeasureDestroyed",{id:c.id})});const d=()=>{this._active&&this.chosedTarget&&this.chosedTarget.setHighlighted(!0)},u=c=>{if(this._active&&(c.key==="Delete"||c.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 c=this.getMeasurementById(d);c.color=u}setMeasureClickbleById(d,u){const c=this.getMeasurementById(d);c.clickable=u}setMeasureHightlighted(d,u){this.getMeasurementById(d).setHighlighted(u)}setAllHightLighted(d){const u=this.getMeasurementsList();for(const c in u)u[c].setHighlighted(d)}setVisibleById(d,u){const c=this.getMeasurementById(d);c.visible=u}setLableVisibleById(d,u){const c=this.getMeasurementById(d);c.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"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u){if(super(d,u),!u.navCubeCanvasElement)throw new Error("Missing config: NavCubeMode navCubeCanvasElement");const{navCubeCanvasElement:c}=u,{viewerElement:f}=u;this._navCubeCanvasElement=c,this._navCubeCanvasElement.oncontextmenu=m=>{m.preventDefault()},this._navCube=new p.NavCubePlugin(this.viewer,{canvasElement:c,viewerElement:f,fitVisible:!1,color:"#CFCFCF",shadowVisible:!1}),this._navCube.setVisible(this._active),this._visible=!0,this.on("active",m=>{this._navCube.setVisible(m)})}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"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/Controller.ts");class y extends p.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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");const A=p.math.vec3();class h extends y.default{constructor(u,c={}){super(u,c),this._modelMementos={},this.bimViewer.modelsExplorer.on("modelLoaded",f=>{this.reset()})}reset(u){this._resetCamera(u)}_resetCamera(u){const{viewer:c}=this,{scene:f}=c;let m;this.bimViewer.multiModel?m=f.getAABB(f.visibleObjectIds):m=f.aabb;const g=p.math.getAABB3Diag(m),v=p.math.getAABB3Center(m,A),{camera:b}=f;b.perspective.fov;const w=Math.abs(g/Math.tan(45*p.math.DEGTORAD)),_=p.math.normalizeVec3(b.yUp?[-.5,-.7071,-.5]:[-1,1,-1]),x=p.math.normalizeVec3(b.yUp?[-.5,.7071,-.5]:[-1,1,1]);c.cameraControl.pivotPos=v,c.cameraControl.planView&&(c.cameraControl.planView=!1),c.cameraFlight.flyTo({look:v,eye:[v[0]-w*_[0],v[1]-w*_[1],v[2]-w*_[2]],up:x,orthoScale:g*1.3,projection:"perspective",duration:1},u)}}},"./src/toolbar/SectionTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u){super(d,u),this.eventTrigger=d.eventTrigger,this._sectionPlanesPlugin=new p.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",c=>{c?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 c=this._sectionPlanesPlugin.createSectionPlane({pos:u.worldPos,dir:p.math.mulVec3Scalar(u.worldNormal,-1)});this._sectionPlanesPlugin.showControl(c.id),this.eventTrigger.emit("createSection",{position:u.worldPos,direction:p.math.mulVec3Scalar(u.worldNormal,-1),id:c.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 c=this._sectionPlanesPlugin.createSectionPlane({pos:d,dir:u});this._sectionPlanesPlugin.showControl(c.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 c=this.getSectionPlane(d);c.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 c=d[u];c.active=!0}}disableSections(){const{sectionPlanes:d}=this.viewer.scene;for(const u in d){const c=d[u];c.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"(s,C,i){i.r(C),i.d(C,{default:()=>y});var p=i("./src/Controller.ts");class y extends p.default{constructor(h,d){super(h,d),this._active=!0,h.eventTrigger.on("metaLoaded",u=>{const c=this.spaceObjects;if(c.length==0)return;this.viewer.scene.setObjectsCulled(c,!0),this.setIFCSpaceOpacity(),this.viewer.scene.setObjectsHighlighted(c,!0);const f=this.viewer.scene.models[u.metaModel.id],m=f.exceptionIds.concat(c);f.exceptionIds=m,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,c=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(c,!1)}_exitShowSpacesMode(){const{viewer:h}=this,{scene:d}=h,{metaScene:u}=h,c=u.getObjectIDsByType("IfcSpace");d.setObjectsCulled(c,!0)}get spaceObjects(){return this.viewer.metaScene.getObjectIDsByType("IfcSpace")}}},"./src/toolbar/SkyBoxTool.ts"(s,C,i){i.r(C),i.d(C,{default:()=>A});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");class A extends y.default{constructor(d,u={}){super(d,u),this.skyboxesPlugin=new p.SkyboxesPlugin(this.viewer),this._active=!1,this.createSkyBox(u),this.on("active",c=>{this.setSkyBoxActiveById(c)})}createSkyBox(d){const{skyBoxImage:u}=d,{skyBoxSrc:c}=d;this.skyboxesPlugin.createSkybox("skybox1",{src:c,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"(s,C,i){i.r(C),i.d(C,{default:()=>h});var p=i("./node_modules/@xtctwins/tctwins-core/dist/tctwins-core.es5.js"),y=i("./src/Controller.ts");const A=p.math.vec3();class h extends y.default{constructor(u,c){super(u,c),this._saveOrthoActive=null,this._cameraControlNavModeMediator=c.cameraControlNavModeMediator,this._active=!1}setEnabled(u){super.setEnabled(u),this._saveOrthoActive=this.bimViewer.orthoMode.getActive()}setActive(u,c=()=>{}){if(this._active===u){c&&c();return}this._active=u,u?this._enterThreeDMode(()=>{this.fire("active",this._active),c&&c()}):this._exitThreeDMode(()=>{this.fire("active",this._active),c&&c()})}_enterThreeDMode(u=()=>{}){const{viewer:c}=this,{scene:f}=c,{aabb:m}=f,g=p.math.getAABB3Diag(m),v=p.math.getAABB3Center(m,A),b=Math.abs(g/Math.tan(65/2)),{camera:w}=f,_=w.yUp?[-1,-1,-1]:[1,1,1],x=w.yUp?[-1,1,-1]:[-1,1,1];c.cameraControl.pivotPos=v,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?c.cameraFlight.flyTo({look:v,eye:[v[0]-b*_[0],v[1]-b*_[1],v[2]-b*_[2]],up:x,orthoScale:g*1.3,duration:1,projection:this._saveOrthoActive?"ortho":"perspective"},()=>{u()}):c.cameraFlight.jumpTo({look:v,eye:[v[0]-b*_[0],v[1]-b*_[1],v[2]-b*_[2]],up:x,orthoScale:g*1.3,projection:this._saveOrthoActive?"ortho":"perspective"})}_exitThreeDMode(u=()=>{}){const{viewer:c}=this,{scene:f}=c,{camera:m}=f,{aabb:g}=f,v=p.math.getAABB3Center(g),b=p.math.getAABB3Diag(g),_=Math.abs(b/Math.tan(45*p.math.DEGTORAD)),x=b*1.3,E=A;E[0]=v[0]+m.worldUp[0]*_,E[1]=v[1]+m.worldUp[1]*_,E[2]=v[2]+m.worldUp[2]*_;const k=p.math.mulVec3Scalar(m.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?c.cameraFlight.flyTo({eye:E,look:v,up:k,orthoScale:x,projection:"ortho"},()=>{this.bimViewer.navCubeMode.setActive(!1)}):(c.cameraFlight.jumpTo({eye:E,look:v,up:k,orthoScale:x,projection:"ortho"}),this.bimViewer.navCubeMode.setActive(!1))}}},"./node_modules/unzipit/dist/unzipit.module.js"(s,C,i){i.r(C),i.d(C,{HTTPRangeReader:()=>m,cleanup:()=>Lt,setOptions:()=>kt,unzip:()=>yt,unzipRaw:()=>ht}),s=i.hmd(s);function p(We){return We.arrayBuffer?We.arrayBuffer():new Promise((Oe,Ke)=>{const nt=new FileReader;nt.addEventListener("loadend",()=>{Oe(nt.result)}),nt.addEventListener("error",Ke),nt.readAsArrayBuffer(We)})}async function y(We){const Oe=await p(We);return new Uint8Array(Oe)}function A(We){return typeof Blob<"u"&&We instanceof Blob}function h(We){return typeof SharedArrayBuffer<"u"&&We instanceof SharedArrayBuffer}const d=typeof process<"u"&&process.versions&&typeof process.versions.node<"u"&&typeof process.versions.electron>"u";function u(We){return We.byteOffset===0&&We.byteLength===We.buffer.byteLength}class c{constructor(Oe){this.typedArray=Oe instanceof ArrayBuffer||h(Oe)?new Uint8Array(Oe):new Uint8Array(Oe.buffer,Oe.byteOffset,Oe.byteLength)}async getLength(){return this.typedArray.byteLength}async read(Oe,Ke){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+Oe,Ke)}}class f{constructor(Oe){this.blob=Oe}async getLength(){return this.blob.size}async read(Oe,Ke){const nt=this.blob.slice(Oe,Oe+Ke),Xe=await p(nt);return new Uint8Array(Xe)}async sliceAsBlob(Oe,Ke,nt=""){return this.blob.slice(Oe,Oe+Ke,nt)}}class m{constructor(Oe){this.url=Oe}async getLength(){if(this.length===void 0){const Oe=await fetch(this.url,{method:"HEAD"});if(!Oe.ok)throw new Error(`failed http request ${this.url}, status: ${Oe.status}: ${Oe.statusText}`);if(this.length=parseInt(Oe.headers.get("content-length")),Number.isNaN(this.length))throw Error("could not get length")}return this.length}async read(Oe,Ke){if(Ke===0)return new Uint8Array(0);const nt=await fetch(this.url,{headers:{Range:`bytes=${Oe}-${Oe+Ke-1}`}});if(!nt.ok)throw new Error(`failed http request ${this.url}, status: ${nt.status} offset: ${Oe} size: ${Ke}: ${nt.statusText}`);const Xe=await nt.arrayBuffer();return new Uint8Array(Xe)}}function g(We,Oe){var Ke=Uint8Array;if(We[0]==3&&We[1]==0)return Oe||new Ke(0);var nt=P,Xe=k,Ge=b,ze=D,Ct=Oe==null;Ct&&(Oe=new Ke(We.length>>>2<<3));for(var It=0,Ot=0,Ze=0,gt=0,vt=0,_t=0,Bt=0,at=0,jt=0,rr,Dt;It==0;){if(It=nt(We,jt,1),Ot=nt(We,jt+1,2),jt+=3,Ot==0){jt&7&&(jt+=8-(jt&7));var rt=(jt>>>3)+4,ct=We[rt-4]|We[rt-3]<<8;Ct&&(Oe=v(Oe,at+ct)),Oe.set(new Ke(We.buffer,We.byteOffset+rt,ct),at),jt=rt+ct<<3,at+=ct;continue}if(Ct&&(Oe=v(Oe,at+(1<<17))),Ot==1&&(rr=R.flmap,Dt=R.fdmap,_t=511,Bt=31),Ot==2){Ze=Xe(We,jt,5)+257,gt=Xe(We,jt+5,5)+1,vt=Xe(We,jt+10,4)+4,jt+=14;for(var Rt=0;Rt<38;Rt+=2)R.itree[Rt]=0,R.itree[Rt+1]=0;for(var qt=1,Rt=0;Rt<vt;Rt++){var pr=Xe(We,jt+Rt*3,3);R.itree[(R.ordr[Rt]<<1)+1]=pr,pr>qt&&(qt=pr)}jt+=3*vt,_(R.itree,qt),x(R.itree,qt,R.imap),rr=R.lmap,Dt=R.dmap,jt=Ge(R.imap,(1<<qt)-1,Ze+gt,We,jt,R.ttree);var ar=w(R.ttree,0,Ze,R.ltree);_t=(1<<ar)-1;var Ir=w(R.ttree,Ze,gt,R.dtree);Bt=(1<<Ir)-1,_(R.ltree,ar),x(R.ltree,ar,rr),_(R.dtree,Ir),x(R.dtree,Ir,Dt)}for(;;){var Lr=rr[ze(We,jt)&_t];jt+=Lr&15;var dr=Lr>>>4;if(!(dr>>>8))Oe[at++]=dr;else{if(dr==256)break;var zr=at+dr-254;if(dr>264){var Se=R.ldef[dr-257];zr=at+(Se>>>3)+Xe(We,jt,Se&7),jt+=Se&7}var Re=Dt[ze(We,jt)&Bt];jt+=Re&15;var Le=Re>>>4,Ue=R.ddef[Le],Je=(Ue>>>4)+nt(We,jt,Ue&15);for(jt+=Ue&15,Ct&&(Oe=v(Oe,at+(1<<17)));at<zr;)Oe[at]=Oe[at++-Je],Oe[at]=Oe[at++-Je],Oe[at]=Oe[at++-Je],Oe[at]=Oe[at++-Je];at=zr}}}return Oe.length==at?Oe:Oe.slice(0,at)}function v(We,Oe){var Ke=We.length;if(Oe<=Ke)return We;var nt=new Uint8Array(Math.max(Ke<<1,Oe));return nt.set(We,0),nt}function b(We,Oe,Ke,nt,Xe,Ge){for(var ze=k,Ct=D,It=0;It<Ke;){var Ot=We[Ct(nt,Xe)&Oe];Xe+=Ot&15;var Ze=Ot>>>4;if(Ze<=15)Ge[It]=Ze,It++;else{var gt=0,vt=0;Ze==16?(vt=3+ze(nt,Xe,2),Xe+=2,gt=Ge[It-1]):Ze==17?(vt=3+ze(nt,Xe,3),Xe+=3):Ze==18&&(vt=11+ze(nt,Xe,7),Xe+=7);for(var _t=It+vt;It<_t;)Ge[It]=gt,It++}}return Xe}function w(We,Oe,Ke,nt){for(var Xe=0,Ge=0,ze=nt.length>>>1;Ge<Ke;){var Ct=We[Ge+Oe];nt[Ge<<1]=0,nt[(Ge<<1)+1]=Ct,Ct>Xe&&(Xe=Ct),Ge++}for(;Ge<ze;)nt[Ge<<1]=0,nt[(Ge<<1)+1]=0,Ge++;return Xe}function _(We,Oe){for(var Ke=We.length,nt,Xe,Ge,ze,Ct,It=R.bl_count,ze=0;ze<=Oe;ze++)It[ze]=0;for(ze=1;ze<Ke;ze+=2)It[We[ze]]++;var Ot=R.next_code;for(nt=0,It[0]=0,Xe=1;Xe<=Oe;Xe++)nt=nt+It[Xe-1]<<1,Ot[Xe]=nt;for(Ge=0;Ge<Ke;Ge+=2)Ct=We[Ge+1],Ct!=0&&(We[Ge]=Ot[Ct],Ot[Ct]++)}function x(We,Oe,Ke){for(var nt=We.length,Xe=R.rev15,Ge=0;Ge<nt;Ge+=2)if(We[Ge+1]!=0)for(var ze=Ge>>1,Ct=We[Ge+1],It=ze<<4|Ct,Ot=Oe-Ct,Ze=We[Ge]<<Ot,gt=Ze+(1<<Ot);Ze!=gt;){var vt=Xe[Ze]>>>15-Oe;Ke[vt]=It,Ze++}}function E(We,Oe){for(var Ke=R.rev15,nt=15-Oe,Xe=0;Xe<We.length;Xe+=2){var Ge=We[Xe]<<Oe-We[Xe+1];We[Xe]=Ke[Ge]>>>nt}}function k(We,Oe,Ke){return(We[Oe>>>3]|We[(Oe>>>3)+1]<<8)>>>(Oe&7)&(1<<Ke)-1}function P(We,Oe,Ke){return(We[Oe>>>3]|We[(Oe>>>3)+1]<<8|We[(Oe>>>3)+2]<<16)>>>(Oe&7)&(1<<Ke)-1}function D(We,Oe){return(We[Oe>>>3]|We[(Oe>>>3)+1]<<8|We[(Oe>>>3)+2]<<16)>>>(Oe&7)}const R=function(){var We=Uint16Array,Oe=Uint32Array;return{next_code:new We(16),bl_count:new We(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 We(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 Oe(32),flmap:new We(512),fltree:[],fdmap:new We(32),fdtree:[],lmap:new We(32768),ltree:[],ttree:[],dmap:new We(32768),dtree:[],imap:new We(512),itree:[],rev15:new We(32768),lhst:new Oe(286),dhst:new Oe(30),ihst:new Oe(19),lits:new Oe(15e3),strt:new We(65536),prev:new We(32768)}}();(function(){for(var We=32768,Oe=0;Oe<We;Oe++){var Ke=Oe;Ke=(Ke&2863311530)>>>1|(Ke&1431655765)<<1,Ke=(Ke&3435973836)>>>2|(Ke&858993459)<<2,Ke=(Ke&4042322160)>>>4|(Ke&252645135)<<4,Ke=(Ke&4278255360)>>>8|(Ke&16711935)<<8,R.rev15[Oe]=(Ke>>>16|Ke<<16)>>>17}function nt(Xe,Ge,ze){for(;Ge--!=0;)Xe.push(0,ze)}for(var Oe=0;Oe<32;Oe++)R.ldef[Oe]=R.of0[Oe]<<3|R.exb[Oe],R.ddef[Oe]=R.df0[Oe]<<4|R.dxb[Oe];nt(R.fltree,144,8),nt(R.fltree,112,9),nt(R.fltree,24,7),nt(R.fltree,8,8),_(R.fltree,9),x(R.fltree,9,R.flmap),E(R.fltree,9),nt(R.fdtree,32,5),_(R.fdtree,5),x(R.fdtree,5,R.fdmap),E(R.fdtree,5),nt(R.itree,19,0),nt(R.ltree,286,0),nt(R.dtree,30,0),nt(R.ttree,320,0)})(),function(){for(var We=new Uint32Array(256),Oe=0;Oe<256;Oe++){for(var Ke=Oe,nt=0;nt<8;nt++)Ke&1?Ke=3988292384^Ke>>>1:Ke=Ke>>>1;We[Oe]=Ke}return We}();function z(We,Oe){return g(We,Oe)}const F={numWorkers:1,workerURL:"",useWorkers:!1};let H=0,$=0,K=!0;const G=[],j=[],N=[],I=new Map;function L(We){W(We.target);const{id:Oe,error:Ke,data:nt}=We.data,Xe=I.get(Oe);I.delete(Oe),Ke?Xe.reject(Ke):Xe.resolve(nt)}function U(We){return new Promise((Oe,Ke)=>{const nt=new Worker(We);nt.onmessage=Xe=>{Xe.data==="start"?(nt.onerror=void 0,nt.onmessage=void 0,Oe(nt)):Ke(new Error(`unexpected message: ${Xe.data}`))},nt.onerror=Ke})}function O(We,Oe){return We.require?We.require(Oe):{}}const Q=function(){if(d){const{Worker:We}=O(s,"worker_threads");return{async createWorker(Oe){return new We(Oe)},addEventListener(Oe,Ke){Oe.on("message",nt=>{Ke({target:Oe,data:nt})})},async terminate(Oe){await Oe.terminate()}}}else return{async createWorker(We){try{return await U(We)}catch{console.warn("could not load worker:",We)}let Oe;try{const Ke=await fetch(We,{mode:"cors"});if(!Ke.ok)throw new Error(`could not load: ${We}`);Oe=await Ke.text(),We=URL.createObjectURL(new Blob([Oe],{type:"application/javascript"}));const nt=await U(We);return F.workerURL=We,nt}catch{console.warn("could not load worker via fetch:",We)}if(Oe!==void 0)try{We=`data:application/javascript;base64,${btoa(Oe)}`;const Ke=await U(We);return F.workerURL=We,Ke}catch{console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(We,Oe){We.addEventListener("message",Oe)},async terminate(We){We.terminate()}}}();function W(We){j.push(We),ne()}async function Z(){if(j.length===0&&$<F.numWorkers){++$;try{const We=await Q.createWorker(F.workerURL);G.push(We),j.push(We),Q.addEventListener(We,L)}catch{K=!1}}return j.pop()}function J(We,Oe,Ke,nt){const Xe=new Uint8Array(Oe);z(We,Xe),nt(Ke?new Blob([Xe],{type:Ke}):Xe.buffer)}async function ne(){if(N.length!==0){if(F.useWorkers&&K){const We=await Z();if(K){if(We){if(N.length===0){W(We);return}const{id:Oe,src:Ke,uncompressedSize:nt,type:Xe,resolve:Ge,reject:ze}=N.shift();I.set(Oe,{id:Oe,resolve:Ge,reject:ze});const Ct=[];We.postMessage({type:"inflate",data:{id:Oe,type:Xe,src:Ke,uncompressedSize:nt}},Ct)}return}}for(;N.length;){const{src:We,uncompressedSize:Oe,type:Ke,resolve:nt}=N.shift();let Xe=We;A(We)&&(Xe=await y(We)),J(Xe,Oe,Ke,nt)}}}function ae(We){F.workerURL=We.workerURL||F.workerURL,We.workerURL&&(F.useWorkers=!0),F.useWorkers=We.useWorkers!==void 0?We.useWorkers:F.useWorkers,F.numWorkers=We.numWorkers||F.numWorkers}function ce(We,Oe,Ke){return new Promise((nt,Xe)=>{N.push({src:We,uncompressedSize:Oe,type:Ke,resolve:nt,reject:Xe,id:H++}),ne()})}function q(We){We.splice(0,We.length)}async function fe(){for(const We of G)await Q.terminate(We);q(G),q(j),q(N),I.clear(),$=0,K=!0}function re(We,Oe){const Ke=We&31,nt=(We>>5&15)-1,Xe=(We>>9&127)+1980,Ge=0,ze=(Oe&31)*2,Ct=Oe>>5&63,It=Oe>>11&31;return new Date(Xe,nt,Ke,It,Ct,ze,Ge)}class te{constructor(Oe,Ke){this._reader=Oe,this._rawEntry=Ke,this.name=Ke.name,this.nameBytes=Ke.nameBytes,this.size=Ke.uncompressedSize,this.compressedSize=Ke.compressedSize,this.comment=Ke.comment,this.commentBytes=Ke.commentBytes,this.compressionMethod=Ke.compressionMethod,this.lastModDate=re(Ke.lastModFileDate,Ke.lastModFileTime),this.isDirectory=Ke.uncompressedSize===0&&Ke.name.endsWith("/"),this.encrypted=!!(Ke.generalPurposeBitFlag&1),this.externalFileAttributes=Ke.externalFileAttributes,this.versionMadeBy=Ke.versionMadeBy}async blob(Oe="application/octet-stream"){return await mt(this._reader,this._rawEntry,Oe)}async arrayBuffer(){return await tt(this._reader,this._rawEntry)}async text(){const Oe=await this.arrayBuffer();return me(new Uint8Array(Oe))}async json(){const Oe=await this.text();return JSON.parse(Oe)}}const le=22,de=65535,he=101010256,ue=101075792;async function pe(We,Oe,Ke){return await We.read(Oe,Ke)}async function se(We,Oe,Ke,nt){return We.sliceAsBlob?await We.sliceAsBlob(Oe,Ke,nt):await We.read(Oe,Ke)}const V={unsigned(){return 0}};function Ce(We,Oe){return We[Oe]+We[Oe+1]*256}function ve(We,Oe){return We[Oe]+We[Oe+1]*256+We[Oe+2]*65536+We[Oe+3]*16777216}function ye(We,Oe){return ve(We,Oe)+ve(We,Oe+4)*4294967296}const Ae=new TextDecoder;function me(We,Oe){return h(We.buffer)&&(We=new Uint8Array(We)),Ae.decode(We)}async function be(We,Oe){const Ke=Math.min(le+de,Oe),nt=Oe-Ke,Xe=await pe(We,nt,Ke);for(let Ge=Ke-le;Ge>=0;--Ge){if(ve(Xe,Ge)!==he)continue;const ze=new Uint8Array(Xe.buffer,Xe.byteOffset+Ge,Xe.byteLength-Ge),Ct=Ce(ze,4);if(Ct!==0)throw new Error(`multi-volume zip files are not supported. This is volume: ${Ct}`);const It=Ce(ze,10),Ot=ve(ze,12),Ze=ve(ze,16),gt=Ce(ze,20),vt=ze.length-le;if(gt!==vt)throw new Error(`invalid comment length. expected: ${vt}, actual: ${gt}`);const _t=new Uint8Array(ze.buffer,ze.byteOffset+22,gt),Bt=me(_t);return It===65535||Ze===4294967295?await Te(We,nt+Ge,Bt,_t):await je(We,Ze,Ot,It,Bt,_t)}throw new Error("could not find end of central directory. maybe not zip file")}const we=117853008;async function Te(We,Oe,Ke,nt){const Xe=Oe-20,Ge=await pe(We,Xe,20);if(ve(Ge,0)!==we)throw new Error("invalid zip64 end of central directory locator signature");const ze=ye(Ge,8),Ct=await pe(We,ze,56);if(ve(Ct,0)!==ue)throw new Error("invalid zip64 end of central directory record signature");const It=ye(Ct,32),Ot=ye(Ct,40),Ze=ye(Ct,48);return je(We,Ze,Ot,It,Ke,nt)}const He=33639248;async function je(We,Oe,Ke,nt,Xe,Ge){let ze=0;const Ct=await pe(We,Oe,Ke),It=[];for(let Ze=0;Ze<nt;++Ze){const gt=Ct.subarray(ze,ze+46),vt=ve(gt,0);if(vt!==He)throw new Error(`invalid central directory file header signature: 0x${vt.toString(16)}`);const _t={versionMadeBy:Ce(gt,4),versionNeededToExtract:Ce(gt,6),generalPurposeBitFlag:Ce(gt,8),compressionMethod:Ce(gt,10),lastModFileTime:Ce(gt,12),lastModFileDate:Ce(gt,14),crc32:ve(gt,16),compressedSize:ve(gt,20),uncompressedSize:ve(gt,24),fileNameLength:Ce(gt,28),extraFieldLength:Ce(gt,30),fileCommentLength:Ce(gt,32),internalFileAttributes:Ce(gt,36),externalFileAttributes:ve(gt,38),relativeOffsetOfLocalHeader:ve(gt,42)};if(_t.generalPurposeBitFlag&64)throw new Error("strong encryption is not supported");ze+=46;const Bt=Ct.subarray(ze,ze+_t.fileNameLength+_t.extraFieldLength+_t.fileCommentLength);_t.nameBytes=Bt.slice(0,_t.fileNameLength),_t.name=me(_t.nameBytes);const at=_t.fileNameLength+_t.extraFieldLength,jt=Bt.slice(_t.fileNameLength,at);_t.extraFields=[];let rr=0;for(;rr<jt.length-3;){const rt=Ce(jt,rr+0),ct=Ce(jt,rr+2),Rt=rr+4,qt=Rt+ct;if(qt>jt.length)throw new Error("extra field length exceeds extra field buffer size");_t.extraFields.push({id:rt,data:jt.slice(Rt,qt)}),rr=qt}if(_t.commentBytes=Bt.slice(at,at+_t.fileCommentLength),_t.comment=me(_t.commentBytes),ze+=Bt.length,_t.uncompressedSize===4294967295||_t.compressedSize===4294967295||_t.relativeOffsetOfLocalHeader===4294967295){const rt=_t.extraFields.find(qt=>qt.id===1);if(!rt)throw new Error("expected zip64 extended information extra field");const ct=rt.data;let Rt=0;if(_t.uncompressedSize===4294967295){if(Rt+8>ct.length)throw new Error("zip64 extended information extra field does not include uncompressed size");_t.uncompressedSize=ye(ct,Rt),Rt+=8}if(_t.compressedSize===4294967295){if(Rt+8>ct.length)throw new Error("zip64 extended information extra field does not include compressed size");_t.compressedSize=ye(ct,Rt),Rt+=8}if(_t.relativeOffsetOfLocalHeader===4294967295){if(Rt+8>ct.length)throw new Error("zip64 extended information extra field does not include relative header offset");_t.relativeOffsetOfLocalHeader=ye(ct,Rt),Rt+=8}}const Dt=_t.extraFields.find(rt=>rt.id===28789&&rt.data.length>=6&&rt.data[0]===1&&ve(rt.data,1),V.unsigned(_t.nameBytes));if(Dt&&(_t.fileName=me(Dt.data.slice(5))),_t.compressionMethod===0){let rt=_t.uncompressedSize;if(_t.generalPurposeBitFlag&1&&(rt+=12),_t.compressedSize!==rt)throw new Error(`compressed size mismatch for stored file: ${_t.compressedSize} != ${rt}`)}It.push(_t)}return{zip:{comment:Xe,commentBytes:Ge},entries:It.map(Ze=>new te(We,Ze))}}async function qe(We,Oe){if(Oe.generalPurposeBitFlag&1)throw new Error("encrypted entries not supported");const Ke=await pe(We,Oe.relativeOffsetOfLocalHeader,30),nt=await We.getLength(),Xe=ve(Ke,0);if(Xe!==67324752)throw new Error(`invalid local file header signature: 0x${Xe.toString(16)}`);const Ge=Ce(Ke,26),ze=Ce(Ke,28),Ct=Oe.relativeOffsetOfLocalHeader+Ke.length+Ge+ze;let It;if(Oe.compressionMethod===0)It=!1;else if(Oe.compressionMethod===8)It=!0;else throw new Error(`unsupported compression method: ${Oe.compressionMethod}`);const Ot=Ct,Ze=Ot+Oe.compressedSize;if(Oe.compressedSize!==0&&Ze>nt)throw new Error(`file data overflows file bounds: ${Ot} + ${Oe.compressedSize} > ${nt}`);return{decompress:It,fileDataStart:Ot}}async function tt(We,Oe){const{decompress:Ke,fileDataStart:nt}=await qe(We,Oe);if(!Ke){const ze=await pe(We,nt,Oe.compressedSize);return u(ze)?ze.buffer:ze.slice().buffer}const Xe=await se(We,nt,Oe.compressedSize);return await ce(Xe,Oe.uncompressedSize)}async function mt(We,Oe,Ke){const{decompress:nt,fileDataStart:Xe}=await qe(We,Oe);if(!nt){const Ct=await se(We,Xe,Oe.compressedSize,Ke);return A(Ct)?Ct:new Blob([h(Ct.buffer)?new Uint8Array(Ct):Ct],{type:Ke})}const Ge=await se(We,Xe,Oe.compressedSize);return await ce(Ge,Oe.uncompressedSize,Ke)}function kt(We){ae(We)}async function ht(We){let Oe;if(typeof Blob<"u"&&We instanceof Blob)Oe=new f(We);else if(We instanceof ArrayBuffer||We&&We.buffer&&We.buffer instanceof ArrayBuffer)Oe=new c(We);else if(h(We)||h(We.buffer))Oe=new c(We);else if(typeof We=="string"){const nt=await fetch(We);if(!nt.ok)throw new Error(`failed http request ${We}, status: ${nt.status}: ${nt.statusText}`);const Xe=await nt.blob();Oe=new f(Xe)}else if(typeof We.getLength=="function"&&typeof We.read=="function")Oe=We;else throw new Error("unsupported source type");const Ke=await Oe.getLength();if(Ke>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${Ke}. Only file sizes up 4503599627370496 bytes are supported`);return await be(Oe,Ke)}async function yt(We){const{zip:Oe,entries:Ke}=await ht(We);return{zip:Oe,entries:Object.fromEntries(Ke.map(nt=>[nt.name,nt]))}}function Lt(){fe()}},"./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(c,f,m,g){g===void 0&&(g=m);var v=Object.getOwnPropertyDescriptor(f,m);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[m]}}),Object.defineProperty(c,g,v)}:function(c,f,m,g){g===void 0&&(g=m),c[g]=f[m]}),y=this&&this.__setModuleDefault||(Object.create?function(c,f){Object.defineProperty(c,"default",{enumerable:!0,value:f})}:function(c,f){c.default=f}),A=this&&this.__importStar||function(c){if(c&&c.__esModule)return c;var f={};if(c!=null)for(var m in c)m!=="default"&&Object.prototype.hasOwnProperty.call(c,m)&&p(f,c,m);return y(f,c),f};Object.defineProperty(C,"__esModule",{value:!0}),C.Helpers=void 0;const h=i("./node_modules/fast-xml-parser/src/fxp.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(c){c.XmlParserOptions=d.XmlParserOptions,c.XmlBuilderOptions=d.XmlBuilderOptions,c.GetViewpoint=d.GetViewpoint,c.XmlToJsonNotation=d.XmlToJsonNotation;const f=d.ChangeToUppercase;function m(D){const{Markup:R}=new h.XMLParser(c.XmlParserOptions).parse(D);return{header:{files:k(R.Header)},topic:{guid:R.Topic["@_Guid"],topic_type:R.Topic["@_TopicType"],topic_status:R.Topic["@_TopicStatus"],reference_links:R.Topic.ReferenceLink&&c.ObjectToArray(R.Topic.ReferenceLink),title:R.Topic.Title,priority:R.Topic.Priority,index:R.Topic.Index,labels:R.Topic.Labels&&c.ObjectToArray(R.Topic.Labels),creation_date:R.Topic.CreationDate,creation_author:R.Topic.CreationAuthor,modified_date:R.Topic.ModifiedDate,modified_author:R.Topic.ModifiedAuthor,assigned_to:R.Topic.AssignedTo,description:R.Topic.Description,comments:c.GetComments(R.Comment),viewpoints:c.GetViewpoints(R.Viewpoints)}}}c.GetMarkup=m;function g(D){if(!D)return;const R=F=>({guid:F["@_Guid"],viewpoint:F.Viewpoint,snapshot:F.Snapshot}),z=[];return Array.isArray(D)?D.forEach(F=>{z.push(R(F))}):z.push(R(D)),z}c.GetViewpoints=g;function v(D){if(!D)return;const R=F=>{var H;return{guid:F["@_Guid"],date:F.Date,author:F.Author,comment:F.Comment,viewpoint:(H=F==null?void 0:F.Viewpoint)==null?void 0:H["@_Guid"],modified_date:F.ModifiedDate,modified_author:F.ModifiedAuthor}},z=[];return Array.isArray(D)?D.forEach(F=>{z.push(R(F))}):z.push(R(D)),z}c.GetComments=v;function b(D){return Array.isArray(D)?D:[D]}c.ObjectToArray=b;function w(D){return{x:D.X,y:D.Y,z:D.Z}}c.ParsePoint=w;const _=["DocumentReferences","RelatedTopics"];function x(D){const R=P(D);let z={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:R.header,topic:R.topic,comment:R.comment,viewpoints:R.viewpoints}};return E(z)}c.MarkupToXmlNotation=x;function E(D,R){let z={};if(typeof D=="string")return D;const F=(R==null?void 0:R.plural_to_singular)!==void 0?R.plural_to_singular:!0;for(const H in D){let $=D[H];if(!$)continue;if(H.startsWith("@_")){z[H]=$;continue}let K=f(H,R);if(Array.isArray($)){const G=[];for(const N of $)G.push(E(N,R));const j=_.find(N=>N.startsWith(K));j&&F&&(K=j.slice(0,-1)),z[K]=G;continue}typeof $=="object"&&($=E($,R)),z[K]=$}return z}c.RenameJsonKeys=E;function k(D){if(D)return c.ObjectToArray(D).map(R=>c.XmlToJsonNotation(R))}function P(D){var $;if(!D.topic)return;const{comments:R,viewpoints:z,...F}=D.topic;return{header:{file:($=D.header)==null?void 0:$.files},topic:F,comment:R,viewpoints:z}}})(u||(C.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/2.1/index.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(g,v,b,w){w===void 0&&(w=b);var _=Object.getOwnPropertyDescriptor(v,b);(!_||("get"in _?!v.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return v[b]}}),Object.defineProperty(g,w,_)}:function(g,v,b,w){w===void 0&&(w=b),g[w]=v[b]}),y=this&&this.__exportStar||function(g,v){for(var b in g)b!=="default"&&!Object.prototype.hasOwnProperty.call(v,b)&&p(v,g,b)},A=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(C,"__esModule",{value:!0}),C.BcfWriter=C.BcfReader=void 0;const h=i("./node_modules/@parametricos/bcf-js/dist/2.1/Helpers.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(i("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));y(i("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),C);const c={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 f extends d.default{constructor(){super("2.1",c)}}C.BcfReader=f;class m extends u.default{constructor(){super("2.1",c)}}C.BcfWriter=m},"./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(c,f,m,g){g===void 0&&(g=m);var v=Object.getOwnPropertyDescriptor(f,m);(!v||("get"in v?!f.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return f[m]}}),Object.defineProperty(c,g,v)}:function(c,f,m,g){g===void 0&&(g=m),c[g]=f[m]}),y=this&&this.__setModuleDefault||(Object.create?function(c,f){Object.defineProperty(c,"default",{enumerable:!0,value:f})}:function(c,f){c.default=f}),A=this&&this.__importStar||function(c){if(c&&c.__esModule)return c;var f={};if(c!=null)for(var m in c)m!=="default"&&Object.prototype.hasOwnProperty.call(c,m)&&p(f,c,m);return y(f,c),f};Object.defineProperty(C,"__esModule",{value:!0}),C.Helpers=void 0;const h=i("./node_modules/fast-xml-parser/src/fxp.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/SharedHelpers.js"));var u;(function(c){c.XmlParserOptions={...d.XmlParserOptions,oneListGroup:!0},c.XmlBuilderOptions=d.XmlBuilderOptions,c.GetViewpoint=d.GetViewpoint,c.XmlToJsonNotation=d.XmlToJsonNotation;const f=d.ChangeToUppercase;function m(b){const{Markup:w}=new h.XMLParser(c.XmlParserOptions).parse(b),_=c.XmlToJsonNotation(w);return{header:_.header,topic:_.topic}}c.GetMarkup=m;function g(b){let w={Markup:{"@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xmlns:xsd":"http://www.w3.org/2001/XMLSchema",header:b.header,topic:b.topic}};return v(w)}c.MarkupToXmlNotation=g;function v(b,w){let _={};if(typeof b=="string")return b;const x=(w==null?void 0:w.plural_to_singular)!==void 0?w.plural_to_singular:!0;for(const E in b){let k=b[E];if(!k)continue;if(E.startsWith("@_")){_[E]=k;continue}let P=f(E,w);if(Array.isArray(k)){const D=[];for(const R of k){let z={},F=P;x&&(F=F.slice(0,-1)),z[F]=v(R,w),D.push(z)}_[P]=D;continue}typeof k=="object"&&(k=v(k,w)),_[P]=k}return _}c.RenameJsonKeys=v})(u||(C.Helpers=u={}))},"./node_modules/@parametricos/bcf-js/dist/3.0/index.js"(s,C,i){var p=this&&this.__createBinding||(Object.create?function(g,v,b,w){w===void 0&&(w=b);var _=Object.getOwnPropertyDescriptor(v,b);(!_||("get"in _?!v.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return v[b]}}),Object.defineProperty(g,w,_)}:function(g,v,b,w){w===void 0&&(w=b),g[w]=v[b]}),y=this&&this.__exportStar||function(g,v){for(var b in g)b!=="default"&&!Object.prototype.hasOwnProperty.call(v,b)&&p(v,g,b)},A=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(C,"__esModule",{value:!0}),C.BcfWriter=C.BcfReader=void 0;const h=i("./node_modules/@parametricos/bcf-js/dist/3.0/Helpers.js"),d=A(i("./node_modules/@parametricos/bcf-js/dist/BcfReader.js")),u=A(i("./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"));y(i("./node_modules/@parametricos/bcf-js/dist/schema/index.js"),C);const c={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 f extends d.default{constructor(){super("3.0",c)}}C.BcfReader=f;class m extends u.default{constructor(){super("3.0",c)}}C.BcfWriter=m},"./node_modules/@parametricos/bcf-js/dist/BcfReader.js"(s,C,i){Object.defineProperty(C,"__esModule",{value:!0}),C.Markup=void 0;const p=i("./node_modules/unzipit/dist/unzipit.module.js"),y=i("./node_modules/fast-xml-parser/src/fxp.js");class A{constructor(u,c){qn(this,"version");qn(this,"bcf_archive");qn(this,"project");qn(this,"markups",[]);qn(this,"helpers");qn(this,"read",async u=>{try{const c=[];this.bcf_archive=await(0,p.unzip)(u);const{entries:f}=this.bcf_archive;let m="",g="",v="",b;for(const[_,x]of Object.entries(f))if(_.endsWith(".bcf"))c.push(x);else if(_.endsWith(".version"))v=new y.XMLParser(this.helpers.XmlParserOptions).parse(await x.text()).Version.DetailedVersion;else if(_.endsWith(".bcfp")){const E=new y.XMLParser(this.helpers.XmlParserOptions).parse(await x.text());if(!E.ProjectExtension||!E.ProjectExtension.Project)continue;m=E.ProjectExtension.Project["@_ProjectId"]||"",g=E.ProjectExtension.Project.Name||""}else if(_.endsWith("extensions.xsd")){const E=new y.XMLParser(this.helpers.XmlParserOptions).parse(await x.text());b=this.helpers.XmlToJsonNotation(E)}const w=[];for(let _=0;_<c.length;_++){const x=c[_],E=new h(this,x);await E.read(),this.markups.push(E);const k={header:E.header,topic:E.topic,project:this.project,viewpoints:E.viewpoints};w.push(k)}this.project={project_id:m,name:g,version:v,markups:void 0,reader:this,extension_schema:b},this.project.markups=w.map(_=>({..._,project:this.project}))}catch(c){console.log("Error in loading BCF archive. The error below was thrown."),console.error(c)}});qn(this,"getEntry",u=>{var c;return(c=this.bcf_archive)==null?void 0:c.entries[u]});this.version=u,this.helpers=c}}C.default=A;class h{constructor(u,c){qn(this,"reader");qn(this,"markup_file");qn(this,"header");qn(this,"topic");qn(this,"viewpoints",[]);qn(this,"read",async()=>{await this.parseMarkup(),await this.parseViewpoints()});qn(this,"parseMarkup",async()=>{const u=this.reader.helpers.GetMarkup(await this.markup_file.text());this.topic=u.topic,this.header=u.header});qn(this,"parseViewpoints",async()=>{if(this.topic&&this.topic.viewpoints){const u=this.topic.viewpoints;for(let c=0;c<u.length;c++){const f=u[c],m=this.topic.guid+"/"+f.viewpoint,g=this.reader.getEntry(m);if(!g)throw new Error("Missing Visualization Info");const v=this.reader.helpers.GetViewpoint(await g.text());v.snapshot=f.snapshot,v.getSnapshot=async()=>{if(f.snapshot)return await this.getSnapshot(f.snapshot)},this.viewpoints.push(v)}}});qn(this,"getViewpointSnapshot",async u=>{if(!u||!this.topic)return;const c=this.reader.getEntry(`${this.topic.guid}/${u.snapshot}`);if(c){const f=await c.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(f)))}});qn(this,"getSnapshot",async u=>{if(!u||!this.topic)return;const c=this.reader.getEntry(`${this.topic.guid}/${u}`);if(c){const f=await c.arrayBuffer();return btoa(String.fromCharCode.apply(null,new Uint8Array(f)))}});this.reader=u,this.markup_file=c}}C.Markup=h},"./node_modules/@parametricos/bcf-js/dist/BcfWriter.js"(s,C,i){var p=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(C,"__esModule",{value:!0});const y=p(i("./node_modules/jszip/dist/jszip.min.js")),A=i("./node_modules/fast-xml-parser/src/fxp.js");class h{constructor(v,b){qn(this,"version");qn(this,"project");qn(this,"markups",[]);qn(this,"files");qn(this,"helpers");qn(this,"addEntry",v=>{v.path.endsWith(".version")||this.files.push(v)});qn(this,"write",async v=>{try{return this.project=v,d(this,v.markups),await u(this.files)}catch(b){console.log("Error in writing BCF archive. The error below was thrown."),console.error(b)}});this.version=v,this.helpers=b,this.files=[]}}C.default=h;function d(g,v){if(g.project){g.addEntry(c(g.version)),g.addEntry(f(g.project.project_id,g.project.name)),g.addEntry(m(g));for(const b of v){const w=g.helpers.MarkupToXmlNotation(b);g.markups.push(w);let _=new A.XMLBuilder(g.helpers.XmlBuilderOptions).build(w);if(_=`<?xml version="1.0" encoding="utf-8"?>${_}`,b.topic){const E={path:`${b.topic.guid}/markup.bcf`,content:_};g.addEntry(E)}}}}async function u(g){var b;var v=new y.default;for(const w of g){const _=w.path.split("/");_&&(_.length==1?v.file(_[0],w.content):_.length==2&&((b=v.folder(_[0]))==null||b.file(_[1],w.content)))}return await v.generateAsync({type:"nodebuffer"})}function c(g){return{path:"bcf.version",content:`<?xml version="1.0" encoding="utf-8"?>
|
|
547
547
|
<Version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
548
548
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema" VersionId="${g}">
|
|
549
549
|
<DetailedVersion>${g}</DetailedVersion>
|